PiDevCfgVerifyService
INT64 __stdcall PiDevCfgVerifyService(WCHAR *ServiceName, UINT8 *BootStart, UINT64 *PnpFlags){
int v3;
unsigned int v6;
NTSTATUS RegistryValue;
unsigned int *v8;
unsigned int *v9;
unsigned int *v11;
struct _UNICODE_STRING DestinationString;
KEY_VALUE_FULL_INFORMATION *Information;
HANDLE Handle;
Handle = 0i64;
LOBYTE(v3) = 0;
Information = 0i64;
DestinationString = 0i64;
v6 = 4;
if( BootStart )
*BootStart = 0;
if( PnpFlags )
*(_DWORD *)PnpFlags = 0;
RtlInitUnicodeString(&DestinationString, ServiceName, (WCHAR)PnpFlags);
RegistryValue = PipOpenServiceEnumKeys(&DestinationString, 0x20019ui64, &Handle, 0i64, 0);
if( RegistryValue >= 0 )
{
RegistryValue = IopGetRegistryValue(Handle, (PWCHAR)L"Type", 0i64, &Information);
if( RegistryValue >= 0 )
{
if( PnpValidateRegistryDword(Information) )
v3 = *(unsigned int *)((char *)v8 + v8[2]);
else
RegistryValue = -1073741823;
ExFreePoolWithTag(v8, 0);
if( RegistryValue >= 0 )
{
if( (v3 & 0xB) == 0 )
goto LABEL_23;
RegistryValue = IopGetRegistryValue(Handle, (PWCHAR)L"Start", 0i64, &Information);
if( RegistryValue < 0 )
goto LABEL_20;
if( PnpValidateRegistryDword(Information) )
v6 = *(unsigned int *)((char *)v9 + v9[2]);
else
RegistryValue = -1073741823;
ExFreePoolWithTag(v9, 0);
if( RegistryValue < 0 )
goto LABEL_20;
if( v6 <= 4 )
{
if( BootStart )
*BootStart = v6 == 0;
if( PnpFlags && IopGetRegistryValue(Handle, (PWCHAR)&stru_1407D01E0.Xmm9, 0i64, &Information) >= 0 )
{
if( PnpValidateRegistryDword(Information) )
*(_DWORD *)PnpFlags = *(unsigned int *)((char *)v11 + v11[2]);
ExFreePoolWithTag(v11, 0);
}
}
else
{
LABEL_23:
RegistryValue = -1073741823;
}
}
}
}
LABEL_20:
if( Handle )
ZwClose(Handle);
return(unsigned int)RegistryValue;
}Referenced by:
PiDevCfgQueryDriverConfiguration