CmOpenDeviceRegKey

__int64 __fastcall CmOpenDeviceRegKey(
        __int64 a1,
        const wchar_t *a2,
        int a3,
        int a4,
        int a5,
        char a6,
        __int64 a7,
        _DWORD *a8){
  __int64(__fastcall *v8)(__int64, const wchar_t *, __int64); 
  VOID *PoolWithTag; 
  void *v14; 
  int v15; 
  int v16; 
  int v17; 
  int v19; 
  int v20; 
  int v21; 
  v8 = *(__int64(__fastcall **)(__int64, const wchar_t *, __int64))(a1 + 504);
  PoolWithTag = ExAllocatePoolWithTag(PagedPool, 0x58ui64, 0x52504E50ui64);
  v14 = PoolWithTag;
  if( !PoolWithTag )
    return(unsigned int)-1073741801;
  memset((INT64)PoolWithTag, 0i64);
  *((_DWORD *)v14 + 6) = a5;
  *((_BYTE *)v14 + 28) = a6;
  *((_DWORD *)v14 + 4) = a3;
  *((_QWORD *)v14 + 4) = a7;
  *((_DWORD *)v14 + 5) = a4;
  if( !v8 )
    goto LABEL_5;
  v15 = v8(a1, a2, 1i64);
  switch( v15 )
  {
    case -1073741822:
      v8 = 0i64;
      goto LABEL_5;
    case -1073741536:
      goto LABEL_15;
    case 0:
LABEL_5:
      v16 = CmOpenDeviceRegKeyWorker(
              a1,
              a2,
              *((_DWORD *)v14 + 4),
              *((_DWORD *)v14 + 5),
              *((_DWORD *)v14 + 6),
              *((_BYTE *)v14 + 28),
              *((_QWORD *)v14 + 4),
              (__int64)v14 + 40);
      v17 = v16;
      if( !v8 || (*(_DWORD *)v14 = v16, v19 = v8(a1, a2, 1i64), v20 = v19, v19 == -1073741822) )
      {
LABEL_6:
        if( v17 >= 0 && a8 )
          *a8 = *((_DWORD *)v14 + 10);
        goto LABEL_9;
      }
      if( v19 != -1073741536 )
      {
        v21 = v17;
        if( v20 )
          v21 = -1073741595;
        v17 = v21;
        goto LABEL_6;
      }
LABEL_15:
      v17 = *(_DWORD *)v14;
      goto LABEL_6;
  }
  v17 = -1073741595;
LABEL_9:
  ExFreePoolWithTag(v14, 0);
  return(unsigned int)v17;
}

Referenced by:

CmCreateDeviceWorker
CmDeleteDeviceMappedPropertyFromDriverKeyRegValue
CmDeleteDeviceMappedPropertyFromInstanceKeyRegValue
CmDeleteDeviceRegKeyWorker
CmDeleteDeviceWorker
CmGetDeviceCompoundFilters
CmGetDeviceMappedPropertyFromComposite
CmGetDeviceMappedPropertyFromInstanceKeyRegValue
CmGetDeviceMappedPropertyFromRegProp
CmGetDeviceRegPropWorker
CmOpenDeviceRegKeyWorker
CmSetDeviceMappedPropertyFromDriverKeyRegValue
CmSetDeviceMappedPropertyFromInstanceKeyRegValue
CmSetDeviceRegPropWorker
IoOpenDeviceRegistryKey
IoReportDetectedDevice
IopGetRootDevices
IopIsReportedAlready
IopQueryDeviceResources
IopReleaseDeviceResources
IopWriteAllocatedResourcesToRegistry
PiCMCreateDevice
PiCMOpenDeviceKey
PiDevCfgEnumDeviceKeys
PiDevCfgInitDeviceContext
PiDevCfgInitDriverDatabaseCallback
PiDevCfgProcessDeviceCallback
PiDevCfgResetDeviceDriverSettings
PiDevCfgResolveVariableKeyHandle
PiInitializeDevice
PiQueryAndAllocateBootResources
PiQueryResourceRequirements
PiUEventBroadcastPortsChangedEvent
PipApplyFunctionToServiceInstances
PipCallDriverAddDevice
PipMakeGloballyUniqueId
PnpCheckDeviceIdsChanged
PnpDeviceObjectToDeviceInstance
PnpDispatchDevice
PnpGetDeviceInstanceCsConfigFlags
PnpGetDeviceInstanceRegistryValue
PnpGetDeviceResourcesFromRegistry
PnpIsDeviceInstanceEnabled
PpForEachDeviceInstanceDriver