PiDevCfgConfigureDeviceKeys

__int64 __fastcall PiDevCfgConfigureDeviceKeys(__int64 a1, __int64 a2, void *a3, int a4, _DWORD *a5, _DWORD *a6){
  int inited; 
  int v11; 
  unsigned int *v13; 
  unsigned int *v14; 
  unsigned int *v15; 
  KEY_VALUE_FULL_INFORMATION *KeyValueInfo; 
  void *KeyHandle; 
  __int128 v18; 
  __int128 v19[2]; 
  struct _OBJECT_ATTRIBUTES ObjectAttributes; 
  KeyHandle = 0i64;
  KeyValueInfo = 0i64;
  v18 = 0i64;
  memset(v19, 0, sizeof(v19));
  if( a5 )
    *a5 = 0;
  if( a6 )
    *a6 = 0;
  inited = PiDevCfgInitResolveContext(a1, a3, (__int64)v19);
  if( inited >= 0 )
  {
    inited = PiDevCfgEnumDeviceKeys(
               a1,
               a2,
               (__int64)a3,
               a4,
               1,
               (__int64(__fastcall *)(__int64, __int64, int *, void *))PiDevCfgConfigureDeviceKeyCallback,
               (__int64)v19);
    if( inited >= 0 )
    {
      if( (a4 & 8) == 0
        || (inited = PiDevCfgConfigureDeviceInterfaces(*(wchar_t **)(a2 + 8), a3, (__int64)v19), inited >= 0) )
      {
        if( (a4 & 0x10) == 0 || (PiDevCfgConfigureSoftwareDevices(*(PVOID *)(a2 + 16), a3), inited = v11, v11 >= 0) )
        {
          if( (a4 & 0x20) == 0 || (inited = PiDevCfgConfigureDeviceFilters(*(PVOID *)(a2 + 16), a3), inited >= 0) )
          {
            *(&ObjectAttributes.Length + 1) = 0;
            memset(&ObjectAttributes.Attributes + 1, 0, 20);
            *((_QWORD *)&v18 + 1) = L"Status";
            LODWORD(v18) = 917516;
            ObjectAttributes.ObjectName = (_UNICODE_STRING *)&v18;
            ObjectAttributes.Length = 48;
            ObjectAttributes.RootDirectory = a3;
            ObjectAttributes.Attributes = 576;
            if( ZwOpenKey(&KeyHandle, 0x20019u, &ObjectAttributes) >= 0 )
            {
              if( a6 )
              {
                if( (int)PiDevCfgQueryResolveValue((__int64)v19, KeyHandle, L"Reboot", &KeyValueInfo) >= 0 )
                {
                  if( PnpValidateRegistryDword(KeyValueInfo) && *(unsigned int *)((char *)v13 + v13[2]) )
                    *a6 |= 0x40u;
                  ExFreePoolWithTag(v13, 0);
                }
                if( (int)PiDevCfgQueryResolveValue((__int64)v19, KeyHandle, L"ClassConfigured", &KeyValueInfo) >= 0 )
                {
                  if( PnpValidateRegistryDword(KeyValueInfo) && *(unsigned int *)((char *)v14 + v14[2]) )
                    *a6 |= 2u;
                  ExFreePoolWithTag(v14, 0);
                }
              }
              if( a5 && (int)PiDevCfgQueryResolveValue((__int64)v19, KeyHandle, L"ConfigFlags", &KeyValueInfo) >= 0 )
              {
                if( PnpValidateRegistryDword(KeyValueInfo) )
                  *a5 |= *(unsigned int *)((char *)v15 + v15[2]);
                ExFreePoolWithTag(v15, 0);
              }
            }
          }
        }
      }
    }
  }
  PiDevCfgFreeResolveContext((__int64)v19);
  if( KeyHandle )
    ZwClose(KeyHandle);
  return(unsigned int)inited;
}

Referenced by:

PiDevCfgConfigureDevice
PiDevCfgConfigureDeviceDriverConfiguration
PiDevCfgConfigureDeviceLocation
PpDevCfgProcessDeviceOperations