PipHardwareConfigExists

UINT8 __fastcall PipHardwareConfigExists(VOID *hHardwareConfigRoot, UINT64 HardwareConfigIndex){
  ULONG v2; 
  UINT8 v3; 
  int v4; 
  int v6; 
  unsigned int v8; 
  int v9; 
  __int64 v10; 
  HANDLE Handle; 
  __int16 v12[264]; 
  Handle = 0i64;
  v2 = 0;
  LODWORD(v10) = 0;
  v3 = 0;
  v9 = 0;
  v4 = HardwareConfigIndex;
  do
  {
    v8 = 260;
    v6 = PnpCtxRegEnumKey((__int64)hHardwareConfigRoot, hHardwareConfigRoot, v2++, (char *)v12, &v8);
    if( v6 < 0 )
      break;
    if( (int)PnpCtxRegOpenKey(0i64, (char *)hHardwareConfigRoot, (const WCHAR *)v12, 0, 1u, &Handle) >= 0 )
    {
      v8 = 4;
      if( (int)PnpCtxRegQueryValue((__int64)hHardwareConfigRoot, Handle, L"Id", &v9, &v10, (__int64)&v8) >= 0
        && v9 == 4
        && v8 == 4
        && (_DWORD)v10 == v4 )
      {
        v3 = 1;
      }
      ZwClose(Handle);
      Handle = 0i64;
    }
  }
  while( !v3 );
  return v3;
}

Referenced by:

PipHardwareConfigInit