RtlpGetWindowsPolicy

NTSTATUS __stdcall RtlpGetWindowsPolicy(WCHAR *LicenseName, UINT64 *Type, UINT64 *ValueSize, UINT8 **Value){
  VOID **v4; 
  NTSTATUS v8; 
  int v9; 
  size_t v10; 
  size_t v11; 
  VOID **PoolWithTag; 
  _UNICODE_STRING ValueName; 

  v4 = 0i64;
  ValueName = 0i64;
  if( !Type || !ValueSize || !Value || !LicenseName )
  {
    v9 = -1073741811;
    goto LABEL_14;
  }
  RtlInitUnicodeString(&ValueName, LicenseName);
  v8 = ZwQueryLicenseValue(&ValueName, Type, 0i64, 0i64, ValueSize);
  v9 = v8;
  if( v8 >= 0 )
  {
    v10 = *(_DWORD *)ValueSize;
    if( !*(_DWORD *)ValueSize )
    {
      *Value = 0i64;
      return v9;
    }
LABEL_8:
    v11 = v10;
    PoolWithTag = ExAllocatePoolWithTag(1ui64, v10, 1920232557i64);
    v4 = PoolWithTag;
    if( PoolWithTag )
      memset(PoolWithTag, 0i64, v11);
    goto LABEL_10;
  }
  if( v8 != -1073741789 )
    goto LABEL_11;
  v10 = *(_DWORD *)ValueSize;
  if( *(_DWORD *)ValueSize )
    goto LABEL_8;
LABEL_10:
  if( !v4 )
    return -1073741801;
LABEL_11:
  v9 = ZwQueryLicenseValue(&ValueName, Type, v4, *(unsigned int *)ValueSize, ValueSize);
  if( v9 >= 0 )
  {
    *Value = (UINT8 *)v4;
    return v9;
  }
LABEL_14:
  if( v4 )
    ExFreePoolWithTag(v4, 0);
  return v9;
}

Referenced by:

RtlpMuiRegLoadLicInformation