PnpDispatchDeviceContainer

NTSTATUS __fastcall PnpDispatchDeviceContainer(
        HPNPCTX *hPnpCtx,
        WCHAR *DeviceContainerId,
        __int64 a3,
        int a4,
        _DEVPROPKEY *PropertyKeys){
  NTSTATUS(__fastcall *v6)(INT64, INT64, INT64); 
  HPNPCTX *v7; 
  int v8; 
  INT64 v9; 
  int v10; 
  int v11; 
  int v12; 
  int v13; 
  int v14; 
  int v15; 
  _DEVPROPKEY *PropertyKey; 
  UINT64 *PropertyType; 
  UINT8 *PropertyBuffer; 
  WCHAR *BufferSize; 
  UINT64 *PropertySize; 
  UINT64 *v22; 
  UINT64 Flags[2]; 

  v6 = 0i64;
  v7 = 0i64;
  *(_OWORD *)Flags = 0i64;
  v8 = a4 - 1;
  if( !v8 )
    return CmValidateDeviceContainerName((WCHAR *)hPnpCtx);
  v9 = (unsigned int)(v8 - 1);
  if( (_DWORD)v9 )
  {
    v10 = v9 - 1;
    if( v10 && (v11 = v10 - 1) != 0 )
    {
      v12 = v11 - 1;
      if( v12 )
      {
        v13 = v12 - 1;
        if( v13 )
        {
          v14 = v13 - 1;
          if( v14 )
          {
            v15 = v14 - 1;
            if( v15 )
            {
              if( v15 == 1 )
                return CmSetDeviceContainerMappedProperty((WCHAR *)hPnpCtx, 0i64);
              else
                return -1073741811;
            }
            else
            {
              LODWORD(BufferSize) = PropertyKeys[2].fmtid.Data1;
              return CmGetDeviceContainerMappedProperty(
                       hPnpCtx,
                       DeviceContainerId,
                       *(VOID **)&PropertyKeys->fmtid.Data1,
                       *(WCHAR **)PropertyKeys->fmtid.Data4,
                       *(_DEVPROPKEY **)&PropertyKeys->pid,
                       *(UINT64 **)&PropertyKeys[1].fmtid.Data2,
                       *(UINT8 **)&PropertyKeys[1].fmtid.Data4[4],
                       (UINT64)BufferSize,
                       *(UINT64 **)PropertyKeys[2].fmtid.Data4);
            }
          }
          else
          {
            return CmGetDeviceContainerMappedPropertyLocales(
                     (_DEVPROPKEY *)hPnpCtx,
                     0i64,
                     0i64,
                     *(UINT64 **)PropertyKeys->fmtid.Data4);
          }
        }
        else
        {
          return CmGetDeviceContainerMappedPropertyKeys(PropertyKeys, 0i64, 0i64);
        }
      }
      else
      {
        if( *(_QWORD *)&PropertyKeys->fmtid.Data1 )
        {
          Flags[0] = *(_QWORD *)&PropertyKeys->fmtid.Data1;
          v6 = PnpCmMatchCallbackRoutine;
          v7 = (HPNPCTX *)Flags;
          Flags[1] = *(_QWORD *)PropertyKeys->fmtid.Data4;
        }
        LODWORD(PropertyBuffer) = PropertyKeys[2].fmtid.Data1 & 0xFFFF0000;
        return CmGetMatchingDeviceContainerList(
                 hPnpCtx,
                 (UINT8 *)v6,
                 v7,
                 *(const WCHAR **)&PropertyKeys->pid,
                 *(_CM_OBJECT_TYPE *)&PropertyKeys[1].fmtid.Data2,
                 *(VOID **)&PropertyKeys[1].fmtid.Data4[4],
                 PropertyBuffer,
                 BufferSize,
                 (INT64)PropertySize,
                 v22,
                 Flags[0]);
      }
    }
    else
    {
      return -1073741822;
    }
  }
  else
  {
    LOBYTE(PropertyType) = PropertyKeys->fmtid.Data2;
    LODWORD(PropertyKey) = PropertyKeys->fmtid.Data1;
    return CmOpenDeviceContainerRegKey(
             hPnpCtx,
             DeviceContainerId,
             0i64,
             v9,
             (INT64)PropertyKey,
             (INT64)PropertyType,
             *(VOID ***)PropertyKeys->fmtid.Data4,
             (UINT64 *)&PropertyKeys->pid);
  }
}

Referenced by:

No references.