WheapWmiExecuteMethod

INT64 __stdcall WheapWmiExecuteMethod(GUID *GuidPtr, UINT64 BufferSize, VOID *Buffer, UINT64 *Size){
  __int64 v4; 
  int v6; 
  UINT8 *v8; 
  unsigned int v9; 
  UINT64 v10; 
  __int64 v12; 
  __int64 v13; 
  unsigned int v14; 
  __int64 v15; 
  __int64 v16; 
  int v17; 
  unsigned int v18; 
  INT64 result; 
  UINT64 BytesUsed; 
  v4 = *((unsigned int *)Buffer + 15);
  v6 = 0;
  LODWORD(BytesUsed) = 0;
  v8 = (UINT8 *)Buffer + v4;
  v9 = BufferSize;
  v10 = (unsigned int)(BufferSize - v4);
  v12 = *(_QWORD *)&GuidPtr->Data1;
  v13 = *(_QWORD *)&WHEAErrorSourceMethods_GUID.Data1 - *(_QWORD *)&GuidPtr->Data1;
  if( !v13 )
    v13 = *(_QWORD *)WHEAErrorSourceMethods_GUID.Data4 - *(_QWORD *)GuidPtr->Data4;
  if( v13 )
  {
    v15 = *(_QWORD *)&WHEAErrorInjectionMethods_GUID.Data1 - v12;
    if( *(_QWORD *)&WHEAErrorInjectionMethods_GUID.Data1 == v12 )
      v15 = *(_QWORD *)WHEAErrorInjectionMethods_GUID.Data4 - *(_QWORD *)GuidPtr->Data4;
    if( v15 )
    {
      v16 = *(_QWORD *)&WHEAPolicyManagementMethods_GUID.Data1 - v12;
      if( *(_QWORD *)&WHEAPolicyManagementMethods_GUID.Data1 == v12 )
        v16 = *(_QWORD *)WHEAPolicyManagementMethods_GUID.Data4 - *(_QWORD *)GuidPtr->Data4;
      if( v16 )
      {
        v18 = -1073741808;
        goto LABEL_19;
      }
      v14 = WheapWmiExecutePolicyManagementMethod(
              *((unsigned int *)Buffer + 14),
              v10,
              v8,
              *((unsigned int *)Buffer + 16),
              &BytesUsed);
    }
    else
    {
      v14 = WheapWmiExecuteErrorInjectionMethod(
              *((unsigned int *)Buffer + 14),
              v10,
              v8,
              *((unsigned int *)Buffer + 16),
              &BytesUsed);
    }
  }
  else
  {
    v14 = WheapWmiExecuteErrorSourceMethod(
            *((unsigned int *)Buffer + 14),
            v10,
            v8,
            *((unsigned int *)Buffer + 16),
            &BytesUsed);
  }
  v17 = BytesUsed;
  v18 = v14;
  v6 = BytesUsed + *((_DWORD *)Buffer + 15);
  if( v14 == -1073741789 )
  {
    if( v9 < 0x38 )
    {
      v18 = -1073741789;
      v6 = 0;
    }
    else
    {
      *((_DWORD *)Buffer + 12) = v6;
      v18 = 0;
      v6 = 56;
      *(_DWORD *)Buffer = 56;
      *((_DWORD *)Buffer + 11) = 32;
    }
  }
  else
  {
    *(_DWORD *)Buffer = v6;
    *((_DWORD *)Buffer + 16) = v17;
  }
LABEL_19:
  result = v18;
  *(_DWORD *)Size = v6;
  return result;
}

Referenced by:

WheaWmiDispatch