PiDqPnPGetObjectProperty

NTSTATUS __stdcall PiDqPnPGetObjectProperty(
        WCHAR *ObjectName,
        PNP_OBJECT_TYPE ObjectType,
        VOID *ObjectBaseKey,
        _DEVPROPKEY *PropertyKey,
        _DEVPROPSTORE Store,
        WCHAR *LocaleName,
        _DEVPROPERTY *Property){
  _GUID fmtid; 
  _DEVPROPERTY *v8; 
  WCHAR *v9; 
  VOID **PoolWithTag; 
  _DEVPROPSTORE v14; 
  UINT64 v15; 
  NTSTATUS PWSTR; 
  NTSTATUS ObjectProperty; 
  wchar_t *v19; 
  INT64 v20; 
  UINT64 v21; 
  INT64 v22[9]; 
  UINT64 NumberOfBytes; 

  fmtid = PropertyKey->fmtid;
  v8 = Property;
  v9 = LocaleName;
  LODWORD(v22[0]) = 0;
  LODWORD(NumberOfBytes) = 512;
  Property->CompKey.Key.fmtid = fmtid;
  PoolWithTag = 0i64;
  v8->CompKey.Key.pid = PropertyKey->pid;
  v14 = Store;
  LODWORD(v15) = 0;
  *(_QWORD *)&v8->Type = 0i64;
  v8->Buffer = 0i64;
  v8->CompKey.Store = v14;
  PWSTR = PnpAllocatePWSTR(v9, 0x7FFFFFFFui64, 0x58706E50u, (PVOID *)&v8->CompKey.LocaleName);
  if( PWSTR >= 0 )
  {
    while( 1 )
    {
      if( (unsigned int)NumberOfBytes > (unsigned int)v15 )
      {
        v15 = (unsigned int)NumberOfBytes;
        if( PoolWithTag )
          ExFreePoolWithTag(PoolWithTag, 0x58706E50u);
        PoolWithTag = ExAllocatePoolWithTag(1ui64, v15, 1483763280i64);
        if( !PoolWithTag )
          break;
      }
      LODWORD(NumberOfBytes) = 0;
      if( ObjectType )
      {
        LODWORD(v21) = v15;
        ObjectProperty = PnpGetObjectProperty(
                           *(&stru_140CF2E80 + 1214),
                           (INT64)ObjectName,
                           (unsigned int)ObjectType,
                           (INT64)ObjectBaseKey,
                           (INT64)v9,
                           (INT64)PropertyKey,
                           (INT64)v22,
                           (INT64)PoolWithTag);
      }
      else
      {
        LODWORD(v20) = v15;
        ObjectProperty = PnpGetGenericStoreProperty(
                           *(&stru_140CF2E80 + 607),
                           ObjectBaseKey,
                           v9,
                           PropertyKey,
                           (UINT64 *)v22,
                           (UINT8 *)PoolWithTag,
                           v20,
                           &NumberOfBytes,
                           v21);
      }
      PWSTR = ObjectProperty;
      if( ObjectProperty != -1073741789 )
        goto LABEL_9;
    }
    PWSTR = -1073741670;
LABEL_9:
    if( PWSTR >= 0 )
    {
      v8->Type = v22[0];
      v8->BufferSize = NumberOfBytes;
      v8->Buffer = PoolWithTag;
      return PWSTR;
    }
    if( PoolWithTag )
      ExFreePoolWithTag(PoolWithTag, 0x58706E50u);
  }
  if( PWSTR == -1073741275 )
    return 0;
  v19 = (wchar_t *)v8->CompKey.LocaleName;
  if( v19 )
    ExFreePoolWithTag(v19, 0x58706E50u);
  return PWSTR;
}

Referenced by:

PiDqActionDataGetChangedProperties
PiDqActionDataGetRequestedProperties
PiDqPnPGetObjectPropertyInBestLocale
PiDqPropertyCallback