PiCMGetObjectProperty

NTSTATUS __stdcall PiCMGetObjectProperty(
        PVOID IoctlInputBuffer,
        UINT64 IoctlInputBufferSize,
        PVOID IoctlOutputBuffer,
        UINT64 IoctlOutputBufferSize,
        UINT64 *BytesUsed){
  UINT64 *v5; 
  unsigned int v6; 
  unsigned int v9; 
  UINT8 *PoolWithTag; 
  NTSTATUS v11; 
  __int64 v12; 
  unsigned int v13; 
  int v14; 
  NTSTATUS ObjectProperty; 
  NTSTATUS v16; 
  UINT64 BufferSize; 
  UINT64 ExpectedOutputSize; 
  UINT64 IoctlOutputBufferSizea; 
  UINT64 Type; 
  UINT64 *v22; 
  INT64 result; 
  int v24; 
  __int64 v25; 
  char v26[20]; 
  int v27; 
  __int64 v28; 
  int v29; 
  UINT64 v30; 
  UINT64 *v31; 
  v5 = v31;
  v6 = IoctlInputBufferSize;
  v22 = v31;
  v9 = IoctlOutputBufferSize;
  memset((INT64)&result, 0i64);
  *(_DWORD *)v31 = 0;
  PoolWithTag = 0i64;
  Type = 0i64;
  v11 = PiCMCapturePropertyInputData((UINT64)IoctlInputBuffer, v6, (unsigned int)BytesUsed, (INT64)&result);
  if( v11 < 0 )
    goto LABEL_29;
  v12 = v25;
  if( v25 && !HIDWORD(result) && !v28 && !v29 && !v27 )
  {
    if( !IoctlOutputBuffer || v9 < 0x14 )
    {
      v11 = -1073741811;
      goto LABEL_34;
    }
    v13 = 0;
    if( v24 <= 6 )
    {
      switch( v24 )
      {
        case 6:
          v13 = 6;
LABEL_19:
          if( v11 < 0 )
            goto LABEL_34;
          if( v9 != 20 )
          {
            PoolWithTag = (UINT8 *)ExAllocatePoolWithTag(PagedPool, v9 - 20, 0x34706E50ui64);
            if( !PoolWithTag )
              v11 = -1073741670;
          }
          if( v11 < 0 )
            goto LABEL_34;
          ObjectProperty = PnpGetObjectProperty(
                             PiPnpRtlCtx,
                             v12,
                             v13,
                             0i64,
                             0i64,
                             (__int64)v26,
                             (int *)&Type,
                             (unsigned __int64)PoolWithTag,
                             v9 - 20,
                             (ULONG *)&Type + 1,
                             0);
          v5 = v22;
          v11 = ObjectProperty;
          goto LABEL_25;
        case 1:
          v13 = 1;
          goto LABEL_19;
        case 2:
          v13 = 2;
          goto LABEL_19;
        case 3:
          v13 = 4;
          goto LABEL_19;
        case 4:
          v13 = 3;
          goto LABEL_19;
        case 5:
          v13 = 5;
          goto LABEL_19;
      }
LABEL_17:
      if( !v13 )
        v11 = -1073741811;
      goto LABEL_19;
    }
    switch( v24 )
    {
      case 65537:
        v14 = 7;
        break;
      case 65538:
        v14 = 8;
        break;
      case 65539:
        v14 = 9;
        break;
      case 65540:
        v14 = 10;
        break;
      case 65541:
        v14 = 11;
        break;
      default:
        goto LABEL_17;
    }
    v13 = PiDrvDbCtx != 0 ? v14 : 0;
    goto LABEL_17;
  }
  v11 = -1073741811;
LABEL_25:
  if( v11 >= 0 )
  {
    LODWORD(IoctlOutputBufferSizea) = v9;
    LODWORD(ExpectedOutputSize) = v30;
    LODWORD(BufferSize) = HIDWORD(Type);
    v16 = PiCMReturnBufferResultData(
            (unsigned int)v11,
            HIDWORD(Type),
            (unsigned int)Type,
            PoolWithTag,
            BufferSize,
            ExpectedOutputSize,
            IoctlOutputBuffer,
            IoctlOutputBufferSizea,
            v5);
    goto LABEL_27;
  }
LABEL_34:
  LODWORD(IoctlOutputBufferSizea) = v9;
  LODWORD(ExpectedOutputSize) = v30;
  LODWORD(BufferSize) = 0;
  v16 = PiCMReturnBufferResultData(
          (unsigned int)v11,
          HIDWORD(Type),
          (unsigned int)Type,
          0i64,
          BufferSize,
          ExpectedOutputSize,
          IoctlOutputBuffer,
          IoctlOutputBufferSizea,
          v22);
LABEL_27:
  v11 = v16;
  if( PoolWithTag )
    ExFreePoolWithTag(PoolWithTag, 0x34706E50u);
LABEL_29:
  PiCMReleasePropertyInputData((INT64)&result);
  return v11;
}

Referenced by:

No references.