PipGetRegistryDwordWithFallback

UINT8 __stdcall PipGetRegistryDwordWithFallback(
        _CM_REG_PROP RegistryProperty,
        WCHAR *DeviceInstanceId,
        VOID *DeviceInstanceKey,
        WCHAR *ClassGuid,
        VOID *InstallerClassKey,
        UINT64 *Value){
  UINT8 v6; 
  UINT64 Flags; 
  UINT64 Flagsa; 
  UINT64 CmRegPropType; 
  UINT8 PropertyBuffer[4]; 

  v6 = 0;
  CmRegPropType = 4i64;
  LODWORD(Flags) = 0;
  *(_DWORD *)PropertyBuffer = 0;
  if( CmGetDeviceRegProp(
         *(&stru_140CF2E80 + 607),
         DeviceInstanceId,
         DeviceInstanceKey,
         (unsigned int)RegistryProperty,
         (UINT64 *)((char *)&CmRegPropType + 4),
         PropertyBuffer,
         &CmRegPropType,
         Flags) >= 0
    && CmRegPropType == 0x400000004i64
    || InstallerClassKey
    && (LODWORD(CmRegPropType) = 4,
        CmGetInstallerClassRegProp(
          *(&stru_140CF2E80 + 607),
          ClassGuid,
          InstallerClassKey,
          (unsigned int)RegistryProperty,
          (UINT64 *)((char *)&CmRegPropType + 4),
          PropertyBuffer,
          &CmRegPropType,
          Flagsa) >= 0)
    && CmRegPropType == 0x400000004i64 )
  {
    v6 = 1;
    *(_DWORD *)Value = *(_DWORD *)PropertyBuffer;
  }
  return v6;
}

Referenced by:

PipChangeDeviceObjectFromRegistryProperties