RtlpGetWindowsPolicy
INT64 __fastcall RtlpGetWindowsPolicy(const WCHAR *LicenseName, UINT64 *Type, UINT64 *ValueSize, UINT8 **Value){
VOID *v4;
NTSTATUS v8;
unsigned int v9;
unsigned int v10;
VOID *PoolWithTag;
UNICODE_STRING ValueName;
v4 = 0i64;
ValueName = 0i64;
if( !Type || !ValueSize || !Value || !LicenseName )
{
v9 = -1073741811;
goto LABEL_14;
}
RtlInitUnicodeString(&ValueName, LicenseName, (WCHAR)ValueSize);
v8 = ZwQueryLicenseValue(&ValueName, Type, 0i64, 0i64, ValueSize);
v9 = v8;
if( v8 >= 0 )
{
v10 = *(_DWORD *)ValueSize;
if( !*(_DWORD *)ValueSize )
{
*Value = 0i64;
return v9;
}
LABEL_8:
PoolWithTag = ExAllocatePoolWithTag(PagedPool, v10, 0x72746C6Dui64);
v4 = PoolWithTag;
if( PoolWithTag )
memset((INT64)PoolWithTag, 0i64);
goto LABEL_10;
}
if( v8 != -1073741789 )
goto LABEL_11;
v10 = *(_DWORD *)ValueSize;
if( *(_DWORD *)ValueSize )
goto LABEL_8;
LABEL_10:
if( !v4 )
return(unsigned int)-1073741801;
LABEL_11:
v9 = ZwQueryLicenseValue(&ValueName, Type, v4, *(unsigned int *)ValueSize, ValueSize);
if( (v9 & 0x80000000) == 0 )
{
*Value = (UINT8 *)v4;
return v9;
}
LABEL_14:
if( v4 )
ExFreePoolWithTag(v4, 0);
return v9;
}Referenced by:
RtlpMuiRegLoadLicInformation