PiDevCfgVerifyDeviceAllowed
NTSTATUS __stdcall PiDevCfgVerifyDeviceAllowed(_DEVICE_NODE *DeviceNode, VOID *ConfigurationKeyHandle){
INT64 v2;
int inited;
int v6;
unsigned int *v8;
__int64 v9;
_PI_DEVCFG_RESOLVE_CONTEXT ResolveContext[4];
__int128 v11;
_OBJECT_ATTRIBUTES ObjectAttributes;
VOID *KeyHandle;
_KEY_VALUE_FULL_INFORMATION *KeyValueInfoResult;
inited = 0;
ObjectAttributes.RootDirectory = ConfigurationKeyHandle;
KeyValueInfoResult = 0i64;
*(&ObjectAttributes.Length + 1) = 0;
memset(&ObjectAttributes.Attributes + 1, 0, 20);
KeyHandle = 0i64;
ObjectAttributes.ObjectName = (_UNICODE_STRING *)&v9;
v6 = 0;
ObjectAttributes.Length = 48;
v11 = 0i64;
ObjectAttributes.Attributes = 576;
if( ZwOpenKey(&KeyHandle, 0x20019ui64, &ObjectAttributes, v2, 917516i64, (INT64)L"Status", 0i64, 0i64) >= 0 )
{
inited = PiDevCfgInitResolveContext(DeviceNode, ConfigurationKeyHandle, ResolveContext);
if( inited >= 0
&& PiDevCfgQueryResolveValue(ResolveContext, KeyHandle, (WCHAR *)L"Blocked", &KeyValueInfoResult) >= 0 )
{
if( PnpValidateRegistryDword((__int64)KeyValueInfoResult) )
v6 = *(unsigned int *)((char *)v8 + v8[2]);
ExFreePoolWithTag(v8, 0);
if( v6 )
inited = -1073740948;
}
}
PiDevCfgFreeResolveContext(ResolveContext);
if( KeyHandle )
ZwClose((_HANDLE)KeyHandle);
return inited;
}Referenced by:
PiDevCfgConfigureDevice