PiDqPnPGetObjectPropertyKeys

NTSTATUS __stdcall PiDqPnPGetObjectPropertyKeys(
        WCHAR *ObjectName,
        PNP_OBJECT_TYPE ObjectType,
        VOID *ObjectBaseKey,
        _DEVPROPKEY **PropertyKeys,
        UINT64 *PropertyCount){
  UINT64 v8; 
  VOID **PoolWithTag; 
  NTSTATUS ObjectPropertyKeys; 
  NTSTATUS v11; 
  __int64 v12; 
  __int64 v14; 
  INT64 v15; 
  _DWORD *v16; 

  v8 = 6000i64;
  *PropertyCount = 0i64;
  while( 1 )
  {
    if( *PropertyCount )
      ExFreePoolWithTag((PVOID)*PropertyCount, 0x58706E50u);
    PoolWithTag = ExAllocatePoolWithTag(1ui64, v8, 1483763280i64);
    *PropertyCount = (UINT64)PoolWithTag;
    if( !PoolWithTag )
      break;
    *v16 = 0;
    if( ObjectType )
    {
      LODWORD(v15) = v8 / 0x14;
      ObjectPropertyKeys = PnpGetObjectPropertyKeys(
                             *(&stru_140CF2E80 + 607),
                             (INT64)ObjectName,
                             (unsigned int)ObjectType,
                             (INT64)ObjectBaseKey,
                             v14,
                             1,
                             (INT64)PoolWithTag,
                             v15,
                             (INT64)v16);
    }
    else
    {
      ObjectPropertyKeys = PnpGetGenericStorePropertyKeys(
                             *(&stru_140CF2E80 + 607),
                             ObjectBaseKey,
                             0i64,
                             1,
                             (__int64)PoolWithTag,
                             v8 / 0x14,
                             (__int64)v16);
    }
    v11 = ObjectPropertyKeys;
    if( ObjectPropertyKeys != -1073741789 )
      goto LABEL_13;
    v12 = (unsigned int)*v16;
    if( (unsigned __int64)(20 * v12) > 0xFFFFFFFF )
    {
      v11 = -1073741675;
      goto LABEL_14;
    }
    v8 = (unsigned int)(20 * v12);
  }
  v11 = -1073741670;
LABEL_13:
  if( v11 >= 0 )
    goto LABEL_15;
LABEL_14:
  *v16 = 0;
LABEL_15:
  if( !*v16 && *PropertyCount )
  {
    ExFreePoolWithTag((PVOID)*PropertyCount, 0x58706E50u);
    *PropertyCount = 0i64;
  }
  return v11;
}

Referenced by:

PiDqActionDataGetAllPropertiesInAllLanguages
PiDqActionDataGetAllPropertiesInBestLanguage