DbgkUnMapViewOfSection

void __fastcall DbgkUnMapViewOfSection(PVOID Object, __int64 a2){
  BYTE *v4; 
  PVOID *CurrentThread; 
  _ETHREAD *v6; 
  TEB *v7; 
  int v8; 
  INT64 result[5]; 
  int v10; 
  __int64 v11; 
  memset((INT64)result, 0i64);
  if( *((_BYTE *)KeGetCurrentThread() + 562) )
  {
    CurrentThread = (PVOID *)KeGetCurrentThread();
    if( ((_DWORD)CurrentThread[162] & 4) == 0 )
    {
      if( *((_QWORD *)Object + 175) )
      {
        v6 = (_ETHREAD *)KeGetCurrentThread();
        if( (*((_DWORD *)v6 + 29) & 0x400) != 0 || *((_BYTE *)v6 + 586) == 1 )
          v7 = 0i64;
        else
          v7 = (TEB *)*((_QWORD *)v6 + 30);
        if( !v7 || Object != CurrentThread[68] || (DbgkpSuppressDbgMsg(v7, v4), !v8) )
        {
          v11 = a2;
          result[0] = 0x800380010i64;
          v10 = 6;
          DbgkpSendApiMessage(Object, 1, (__int64)result);
        }
      }
    }
  }
}

Referenced by:

MiFreeEnclaveModules
MiUnmapViewOfSection