# CVE-2023-24902 — win32kbase.sys patch diff

`win32kbase.sys` 10.0.22621.1635 -> 10.0.22621.1702 (ghidriff).

## `NtUserSystemParametersInfo`  (modified)

```diff
--- NtUserSystemParametersInfo
+++ NtUserSystemParametersInfo
@@ -1,78 +1,1141 @@
 

 /* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

 

-void NtUserSystemParametersInfo(void)

+longlong NtUserSystemParametersInfo(uint param_1,uint param_2,uint *param_3,uint param_4)

 

 {

-  longlong lVar1;

-  longlong *plVar2;

-  undefined8 uVar3;

-  int unaff_EBX;

-  longlong unaff_RSI;

-  bool bVar4;

+  int iVar1;

+  void *_Src;

+  uint uVar2;

+  uint uVar3;

+  undefined8 uVar4;

+  tagKERNELHANDLETABLEENTRY *ptVar5;

+  CLeakTrackingAllocator *this;

+  bool bVar6;

+  char cVar7;

+  int iVar8;

+  uint uVar9;

+  uint *puVar10;

+  longlong lVar11;

+  uint *puVar12;

+  tagTHREADINFO *ptVar13;

+  uint *puVar14;

+  ushort uVar15;

+  uint *puVar16;

+  void *pvVar17;

+  ulonglong uVar18;

+  uint *puVar19;

+  undefined4 uVar20;

+  ulonglong uVar21;

+  longlong lVar22;

+  undefined4 uVar23;

+  uint uVar24;

+  undefined1 auStack_468 [32];

+  undefined8 uStack_448;

+  ulonglong **ppuStack_440;

+  undefined8 uStack_438;

+  undefined8 uStack_430;

+  undefined4 uStack_428;

+  uint local_418;

+  int local_414;

+  undefined4 local_410;

+  uint local_408;

+  uint local_400;

+  uint *local_3f8;

+  int local_3f0;

+  uint *local_3e8;

+  undefined4 local_3e0 [2];

+  int local_3d8;

+  __uint64 _Stack_3c0;

+  ulonglong local_3b8;

+  undefined8 local_3b0 [2];

+  undefined8 local_3a0;

+  void *pvStack_398;

+  undefined8 local_390;

+  undefined8 uStack_388;

+  undefined8 local_380;

+  undefined8 local_378;

+  undefined8 uStack_370;

+  undefined8 local_368;

+  uint local_350;

+  uint uStack_34c;

+  uint uStack_348;

+  uint uStack_344;

+  undefined8 local_340;

+  CBackTrace aCStack_338 [160];

+  uint local_298 [140];

+  ulonglong *puStack_68;

+  undefined4 *puStack_60;

+  ulonglong local_48;

   

-  ExAcquireResourceExclusiveLite();

-  lVar1 = *(longlong *)(unaff_RSI + 0x98);

-  if ((unaff_EBX == 0) || (*(ulonglong *)(lVar1 + 0x88) <= (ulonglong)(unaff_EBX - 1))) {

-    uVar3 = 0;

+                    /* 0x83e10  1727  NtUserSystemParametersInfo */

+  local_48 = __security_cookie ^ (ulonglong)auStack_468;

+  local_3a0 = 0;

+  pvStack_398 = (void *)0x0;

+  puVar19 = (uint *)0x0;

+  local_418 = 0;

+  local_3e8 = (uint *)0x0;

+  local_390 = 0;

+  uStack_388 = 0;

+  local_380 = 0;

+  local_378 = 0;

+  uStack_370 = 0;

+  local_368 = 0;

+  local_3d8 = 0;

+  local_3f0 = 0;

+  local_410 = param_2;

+  local_408 = param_2;

+  local_400 = param_1;

+  local_3f8 = param_3;

+  gptiCurrent = PrivateAPI::`anonymous_namespace'::EnterCritInternal(1);

+  uVar23 = 1;

+  if (gptiCurrent != 0) {

+    *(undefined4 *)(gptiCurrent + 0x5ec) = 1;

+    puVar10 = (uint *)PsGetCurrentProcessWin32Process();

+    if (puVar10 != (uint *)0x0) {

+      if (*(longlong *)puVar10 == 0) {

+        puVar10 = puVar19;

+      }

+      if ((((puVar10 != (uint *)0x0) && ((puVar10[3] & 0x8000) != 0)) &&

+          ((*(uint *)(gptiCurrent + 0x1e8) & 0x1000000) != 0)) &&

+         (ptVar5 = gpSharedUserCritDeferredUnlockListHead,

+         -1 < (char)*(undefined4 *)(gptiCurrent + 0x4f0))) {

+        while (gpSharedUserCritDeferredUnlockListHead = ptVar5,

+              ptVar5 != (tagKERNELHANDLETABLEENTRY *)0x0) {

+          gpSharedUserCritDeferredUnlockListHead = *(tagKERNELHANDLETABLEENTRY **)(ptVar5 + 0x10);

+          *(longlong *)(ptVar5 + 0x10) = 0;

+          if (*(int *)(*(longlong *)ptVar5 + 8) == 0) {

+            MicrosoftTelemetryAssertTriggeredNoArgsKM();

+          }

+          HMUnlockObject(*(longlong *)ptVar5);

+          ptVar5 = gpSharedUserCritDeferredUnlockListHead;

+        }

+      }

+    }

+  }

+  iVar8 = 0;

+  if (((*(uint *)(gptiCurrent + 0x1e8) & 0x20000000) == 0) ||

+     ((*(uint *)(*(longlong *)(*(longlong *)(gptiCurrent + 0x1a8) + 0x2f8) + 0x18) & 8) == 0)) {

+    puVar10 = (uint *)PsGetCurrentProcessWin32Process();

+    if ((puVar10 != (uint *)0x0) && (*(longlong *)puVar10 == 0)) {

+      puVar10 = puVar19;

+    }

+    if ((UIPrivelegeIsolation::fEnforce != false) && (puVar10[0xd8] < 0x2000)) goto LAB_0;

   }

   else {

-    uVar3 = *(undefined8 *)

-             ((ulonglong)(unaff_EBX - 1) * *(longlong *)(lVar1 + 0x90) + *(longlong *)(lVar1 + 0x70)

-             );

-  }

-  func_0x0001c00593fc(uVar3);

-  plVar2 = *(longlong **)(unaff_RSI + 0x98);

-  ExReleaseResourceLite(plVar2[4]);

-  KeLeaveCriticalRegion();

-  do {

-    LOCK();

-    bVar4 = (int)plVar2[3] == 1;

-    if (bVar4) {

-      *(int *)(plVar2 + 3) = 2;

-    }

-    UNLOCK();

-    if (bVar4) {

-      lVar1 = plVar2[4];

-      KeEnterCriticalRegion();

-      ExAcquireResourceExclusiveLite(lVar1,1);

-      (**(code **)(*plVar2 + 0x30))(plVar2,0);

-      uVar3 = *(undefined8 *)(plVar2[5] + 8);

-      KeEnterCriticalRegion();

-      ExAcquireResourceSharedLite(uVar3,1);

-      bVar4 = DirectComposition::CConnection::IsConnected((CConnection *)plVar2[5]);

-      if (bVar4) {

-        *(undefined4 *)(plVar2 + 3) = 4;

-      }

-      ExReleaseResourceLite(plVar2[4]);

-      KeLeaveCriticalRegion();

-      ExReleaseResourceLite(*(undefined8 *)(plVar2[5] + 8));

-      KeLeaveCriticalRegion();

-    }

-    LOCK();

-    bVar4 = (int)plVar2[3] == 4;

-    if (bVar4) {

-      *(int *)(plVar2 + 3) = 5;

-    }

-    UNLOCK();

-    if (bVar4) {

-      lVar1 = plVar2[4];

-      KeEnterCriticalRegion();

-      ExAcquireResourceExclusiveLite(lVar1,1);

-      (**(code **)(*plVar2 + 0x38))(plVar2);

-      uVar3 = *(undefined8 *)(plVar2[5] + 8);

-      KeEnterCriticalRegion();

-      ExAcquireResourceSharedLite(uVar3,1);

-      bVar4 = DirectComposition::CConnection::IsConnected((CConnection *)plVar2[5]);

-      if (!bVar4) {

-        *(undefined4 *)(plVar2 + 3) = 1;

-      }

-      ExReleaseResourceLite(plVar2[4]);

-      KeLeaveCriticalRegion();

-      ExReleaseResourceLite(*(undefined8 *)(plVar2[5] + 8));

-      KeLeaveCriticalRegion();

-    }

-  } while ((int)plVar2[3] == 1);

-  return;

+LAB_0:

+    if ((param_1 != 0x42) && (((param_1 < 0x200a || (0x200e < param_1)) && (param_1 != 0x1042)))) {

+      if (param_1 < 0x1002) {

+        if (param_1 != 0x1001) {

+          switch(param_1) {

+          case 2:

+          case 4:

+          case 6:

+          case 0xb:

+          case 0xd:

+          case 0xf:

+          case 0x11:

+          case 0x13:

+          case 0x14:

+          case 0x15:

+          case 0x17:

+          case 0x18:

+          case 0x1a:

+          case 0x1c:

+          case 0x1d:

+          case 0x1e:

+          case 0x20:

+          case 0x21:

+          case 0x22:

+          case 0x24:

+          case 0x25:

+          case 0x2a:

+          case 0x2c:

+          case 0x2e:

+          case 0x2f:

+          case 0x31:

+          case 0x33:

+          case 0x35:

+          case 0x37:

+          case 0x39:

+          case 0x3b:

+          case 0x3d:

+          case 0x41:

+          case 0x43:

+          case 0x45:

+          case 0x47:

+          case 0x49:

+          case 0x4b:

+          case 0x4c:

+          case 0x4d:

+          case 0x4e:

+          case 0x51:

+          case 0x52:

+          case 0x55:

+          case 0x56:

+          case 0x57:

+          case 0x58:

+          case 0x5a:

+          case 0x5b:

+          case 0x5d:

+          case 0x60:

+          case 0x61:

+          case 99:

+          case 0x65:

+          case 0x67:

+          case 0x69:

+          case 0x6b:

+          case 0x6d:

+          case 0x6f:

+          case 0x71:

+          case 0x75:

+          case 0x77:

+          case 0x93:

+          case 0x95:

+          case 0x97:

+          case 0x99:

+          case 0x9b:

+          case 0xa1:

+          case 0xa3:

+          case 0xa6:

+          case 0xa9:

+          case 0xab:

+          case 0xad:

+          case 0xaf:

+          case 0xb1:

+            break;

+          default:

+            goto switchD_1c0084d4e_caseD_3;

+          }

+        }

+      }

+      else {

+        if (0x2001 < param_1) {

+          switch(param_1) {

+          case 0x2003:

+          case 0x2005:

+          case 0x2009:

+          case 0x200f:

+          case 0x2011:

+          case 0x2015:

+          case 0x2017:

+          case 0x2019:

+          case 0x201b:

+          case 0x201d:

+          case 0x2031:

+          case 0x2033:

+            goto switchD_1c0084d4e_caseD_2;

+          default:

+            goto switchD_1c0084d4e_caseD_3;

+          }

+        }

+        if (param_1 != 0x2001) {

+          switch(param_1) {

+          case 0x1003:

+          case 0x1005:

+          case 0x1007:

+          case 0x1009:

+          case 0x100b:

+          case 0x100d:

+          case 0x100f:

+          case 0x1013:

+          case 0x1015:

+          case 0x1017:

+          case 0x1019:

+          case 0x101d:

+          case 0x101f:

+          case 0x1027:

+          case 0x1041:

+          case 0x1043:

+          case 0x1049:

+          case 0x104b:

+          case 0x104d:

+          case 0x104f:

+          case 0x1051:

+          case 0x1053:

+            break;

+          default:

+            goto switchD_1c0084d4e_caseD_3;

+          }

+        }

+      }

+switchD_1c0084d4e_caseD_2:

+      puVar10 = (uint *)PsGetCurrentProcessWin32Process();

+      if ((puVar10 != (uint *)0x0) && (*(longlong *)puVar10 == 0)) {

+        puVar10 = puVar19;

+      }

+      EtwTraceUIPISystemError(puVar10,0,1);

+      UserSetLastError(5);

+      goto LAB_1;

+    }

+  }

+switchD_1c0084d4e_caseD_3:

+  this = gpLeakTrackingAllocator;

+  local_3e0[0] = 0x79747355;

+  local_3b8 = 0x104;

+  local_3b0[0] = 0x228;

+  iVar1 = *(int *)gpLeakTrackingAllocator;

+  if (iVar1 == 0) {

+    puVar10 = (uint *)ExAllocatePool2(0x105,0x228,0x79747355);

+    param_3 = param_3;

+    if (puVar10 != (uint *)0x0) {

+      LOCK();

+      *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + 1;

+      UNLOCK();

+      local_410 = local_408;

+      param_3 = local_3f8;

+    }

+  }

+  else {

+    puVar10 = puVar19;

+    if (iVar1 == 1) {

+      bVar6 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                        (gpLeakTrackingAllocator,0x79747355);

+      param_3 = param_3;

+      if (bVar6) {

+        puVar10 = (uint *)ExAllocatePool2(local_3b8 & 0xfffffffffffffffd | 1,0x238,local_3e0[0]);

+        if (puVar10 != (uint *)0x0) {

+          LOCK();

+          *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + 1;

+          UNLOCK();

+          local_410 = local_408;

+          puVar10[0] = 0x79747355;

+          puVar10[1] = 0;

+          puVar10 = puVar10 + 4;

+          param_3 = local_3f8;

+          if (puVar10 != (uint *)0x0) goto LAB_2;

+        }

+        NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

+                  (*(CPointerHashTable **)(this + 8),(void *)0x79747355);

+      }

+    }

+    else {

+      param_3 = param_3;

+      if (iVar1 == 2) {

+        _Stack_3c0 = 0;

+        bVar6 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                          (gpLeakTrackingAllocator,0x79747355,&_Stack_3c0);

+        if (bVar6) {

+          local_3b0[0] = 0x238;

+          puVar14 = (uint *)ExAllocatePool2(0x105,0x238,0x79747355);

+          puVar12 = local_3f8;

+          param_3 = param_3;

+          if (puVar14 != (uint *)0x0) {

+            LOCK();

+            *(longlong *)(this + 0x80) = *(longlong *)(this + 0x80) + 1;

+            UNLOCK();

+            local_410 = local_408;

+            NSInstrumentation::CBackTrace::CBackTrace(aCStack_338);

+            param_3 = puVar12;

+            if (((uint)puVar14 & 0xfff) + 0x10 < 0x1000) {

+              bVar6 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

+                                (this,puVar14,_Stack_3c0,aCStack_338);

+              if (!bVar6) goto LAB_3;

+              puVar10 = puVar14 + 4;

+            }

+            else {

+              bVar6 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

+                                (this,puVar14,_Stack_3c0,aCStack_338);

+              puVar10 = puVar14;

+              if (!bVar6) {

+LAB_3:

+                LOCK();

+                *(longlong *)(this + 0x88) = *(longlong *)(this + 0x88) + 1;

+                UNLOCK();

+                ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                          (puVar14);

+                local_410 = local_408;

+                param_3 = local_3f8;

+                puVar10 = puVar19;

+              }

+            }

+          }

+        }

+        else {

+          puStack_68 = &local_3b8;

+          puStack_60 = local_3e0;

+          puVar10 = (uint *)NSInstrumentation::CLeakTrackingAllocator::

+                            MakeUntrackedAllocation<<lambda_a6c9ad8a3ccccec93018e691c2ba1200>,unsigned___int64_&>

+                                      (this,&puStack_68,local_3b0);

+          param_3 = param_3;

+        }

+      }

+    }

+  }

+LAB_2:

+  uVar9 = local_410;

+  if (puVar10 == (uint *)0x0) {

+    UserSetLastError(8);

+    goto LAB_1;

+  }

+  if (DAT_4 != 0) {

+    (*(code *)DAT_4)(puVar10,&local_378,Win32FreePool);

+  }

+  uVar24 = local_410;

+  if (local_400 == 0x42) {

+    local_418 = 0x10;

+    lVar11 = PsGetCurrentProcessWow64Process();

+    if (lVar11 == 0) {

+      uVar23 = 4;

+    }

+    ProbeForWrite(param_3,0x10,uVar23);

+    uVar9 = param_3[1];

+    uVar24 = param_3[2];

+    uVar2 = param_3[3];

+    *puVar10 = *param_3;

+    puVar10[1] = uVar9;

+    puVar10[2] = uVar24;

+    puVar10[3] = uVar2;

+    local_3f8 = puVar10;

+    local_3e8 = param_3;

+    ProbeForWrite(*(undefined8 *)(puVar10 + 2),0x100,2);

+LAB_5:

+    local_3f0 = 1;

+    puVar12 = puVar10;

+    uVar24 = local_410;

+    goto LAB_6;

+  }

+  puVar12 = param_3;

+  if (0x1026 < local_400) {

+    if (local_400 != 0x1027) {

+      if (local_400 != 0x201d) goto switchD_1c00840b7_caseD_2;

+      if (((param_3 != (uint *)0x0) && (param_3 != (uint *)0x1)) && (param_3 != (uint *)0x2)) {

+        UserSetLastError(0x57);

+        iVar8 = 0;

+        local_414 = 0;

+        goto LAB_7;

+      }

+    }

+    goto LAB_6;

+  }

+  if (local_400 == 0x1026) {

+switchD_1c00840b7_caseD_1:

+    local_418 = 4;

+    puVar19 = param_3;

+    if (*(uint **)MmUserProbeAddress_exref <= param_3) {

+      puVar19 = *(uint **)MmUserProbeAddress_exref;

+    }

+    *puVar19 = *puVar19;

+    local_3f0 = 1;

+    puVar12 = puVar10;

+    uVar24 = local_408;

+    local_3f8 = puVar10;

+    local_3e8 = param_3;

+    goto LAB_6;

+  }

+  switch(local_400) {

+  case 1:

+  case 5:

+  case 10:

+  case 0xe:

+  case 0x10:

+  case 0x12:

+  case 0x16:

+  case 0x19:

+  case 0x1b:

+  case 0x23:

+  case 0x26:

+  case 0x38:

+  case 0x44:

+  case 0x46:

+  case 0x4a:

+  case 0x4f:

+  case 0x50:

+  case 0x53:

+  case 0x54:

+  case 0x5e:

+  case 0x5f:

+  case 0x62:

+  case 100:

+  case 0x66:

+  case 0x68:

+  case 0x6a:

+  case 0x6c:

+  case 0x6e:

+  case 0x70:

+  case 0x72:

+  case 0x76:

+  case 0x78:

+  case 0x7a:

+  case 0x7c:

+  case 0x7e:

+  case 0x80:

+  case 0x82:

+  case 0x84:

+  case 0x86:

+  case 0x88:

+  case 0x8a:

+  case 0x8c:

+  case 0x8e:

+  case 0x90:

+  case 0x9e:

+  case 0xa0:

+  case 0xa8:

+  case 0xaa:

+    goto switchD_1c00840b7_caseD_1;

+  default:

+switchD_1c00840b7_caseD_2:

+    if (local_400 < 0xb2) goto LAB_6;

+    if ((local_400 - 0x1000 < 0x54) || (local_400 - 0x2000 < 0x34)) {

+      if ((uVar9 == 0) ||

+         (((*(uint *)(gptiCurrent + 0x278) < 0x401 && (local_400 == 0x103f)) && (uVar9 == 1)))) {

+        if ((local_400 & 1) == 0) goto switchD_1c00840b7_caseD_1;

+        if (local_400 == 0x200b) {

+          if (((ulonglong)param_3 & 0xfffffffc) == 0) goto LAB_6;

+          UserSetLastError(0x57);

+          iVar8 = 0;

+          local_414 = 0;

+        }

+        else {

+          if ((local_400 != 0x2013) || (((ulonglong)param_3 & 0xfffffffe) == 0)) goto LAB_6;

+          UserSetLastError(0x57);

+          iVar8 = 0;

+          local_414 = 0;

+        }

+      }

+      else {

+        UserSetLastError(0x57);

+        iVar8 = 0;

+        local_414 = 0;

+      }

+    }

+    else {

+      UserSetLastError(0x57);

+      iVar8 = 0;

+      local_414 = 0;

+    }

+    break;

+  case 3:

+  case 0x3c:

+  case 0x74:

+switchD_1c00840b7_caseD_3:

+    local_418 = 0xc;

+    uVar9 = local_418;

+    goto LAB_8;

+  case 4:

+  case 0x3d:

+  case 0x75:

+    local_418 = 0xc;

+    goto LAB_9;

+  case 0xd:

+  case 0x18:

+    if (((ulonglong)param_3 & 0xffffffffffff0000) != 0) goto switchD_1c00840b7_caseD_1;

+    goto LAB_6;

+  case 0x14:

+    if (param_3 == (uint *)0x0) {

+      param_3 = (uint *)0xffffffffffffffff;

+      local_3f8 = (uint *)0xffffffffffffffff;

+    }

+    else if (param_3 < (uint *)0xfffffffffffffffe) {

+LAB_10:

+      if (*(uint **)MmUserProbeAddress_exref <= param_3) {

+        param_3 = *(uint **)MmUserProbeAddress_exref;

+      }

+      uVar9 = *param_3;

+      local_3a0 = CONCAT44(local_3a0._4_4_,uVar9);

+      _Src = *(void **)(param_3 + 2);

+      local_410 = uVar9;

+      pvStack_398 = _Src;

+      if (((ulonglong)_Src & 1) != 0) {

+                    /* WARNING: Subroutine does not return */

+        ExRaiseDatatypeMisalignment();

+      }

+      uVar15 = (ushort)uVar9;

+      uVar21 = (ulonglong)uVar15;

+      pvVar17 = (void *)((longlong)_Src + uVar21 + 2);

+      if ((pvVar17 <= _Src) || (*(void **)MmUserProbeAddress_exref <= pvVar17)) {

+                    /* WARNING: Subroutine does not return */

+        ExRaiseAccessViolation();

+      }

+      local_410._2_2_ = (ushort)(uVar9 >> 0x10);

+      if (local_410._2_2_ < uVar15) {

+        if ((uVar9 & 1) == 0) goto LAB_11;

+      }

+      else if ((uVar9 & 1) == 0) {

+        puVar12 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                            ((CLeakTrackingAllocator *)(ulonglong)uVar9,(__uint64)pvVar17,uVar21 + 2

+                             ,0x79747355);

+        local_3f8 = puVar12;

+        if (puVar12 == (uint *)0x0) {

+                    /* WARNING: Subroutine does not return */

+          ExRaiseStatus(0xc0000017);

+        }

+        if (DAT_4 != 0) {

+          (*(code *)DAT_4)(puVar12,&local_390,Win32FreePool);

+        }

+        local_3d8 = 1;

+        memcpy(puVar12,_Src,uVar21);

+        *(undefined2 *)((longlong)puVar12 + (ulonglong)(uVar15 >> 1) * 2) = 0;

+        uVar24 = local_408;

+        goto LAB_6;

+      }

+      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+LAB_11:

+                    /* WARNING: Subroutine does not return */

+      ExRaiseAccessViolation();

+    }

+LAB_12:

+    local_408 = 0xffffffff;

+    puVar12 = param_3;

+    uVar24 = 0xffffffff;

+    goto LAB_6;

+  case 0x15:

+    if (uVar9 != 0xffffffff) {

+      if (param_3 != (uint *)0x0) goto LAB_10;

+      goto LAB_12;

+    }

+    goto LAB_6;

+  case 0x1f:

+    local_418 = 0x5c;

+    uVar9 = local_418;

+    goto LAB_8;

+  case 0x22:

+    local_418 = 0x5c;

+    goto LAB_9;

+  case 0x29:

+    if ((uVar9 - 500 & 0xfffffffb) == 0) goto LAB_8;

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0x2a:

+    if ((uVar9 - 500 & 0xfffffffb) != 0) {

+      UserSetLastError(0x57);

+      iVar8 = 0;

+      local_414 = 0;

+      break;

+    }

+    local_418 = uVar9;

+    if (uVar9 != 0) goto LAB_9;

+    goto LAB_13;

+  case 0x2b:

+    local_418 = 0x14;

+    uVar9 = local_418;

+    goto LAB_8;

+  case 0x2c:

+    local_418 = 0x14;

+    goto LAB_9;

+  case 0x2d:

+    local_418 = 0x6c;

+    uVar9 = local_418;

+    goto LAB_8;

+  case 0x2e:

+    local_418 = 0x6c;

+    goto LAB_9;

+  case 0x2f:

+  case 0x9d:

+  case 0xa3:

+    local_418 = 0x10;

+    goto LAB_9;

+  case 0x30:

+  case 0xa2:

+switchD_1c00840b7_caseD_30:

+    local_418 = 0x10;

+    uVar9 = local_418;

+    goto LAB_8;

+  case 0x32:

+switchD_1c00840b7_caseD_32:

+    local_418 = 0x18;

+    uVar9 = local_418;

+    goto LAB_8;

+  case 0x33:

+switchD_1c00840b7_caseD_33:

+    local_418 = 0x18;

+    goto LAB_9;

+  case 0x34:

+  case 0x3a:

+  case 0x48:

+  case 0x59:

+    local_418 = 8;

+    uVar9 = local_418;

+    goto LAB_8;

+  case 0x35:

+  case 0x3b:

+  case 0x49:

+  case 0x5a:

+    local_418 = 8;

+    goto LAB_9;

+  case 0x36:

+switchD_1c00840b7_caseD_36:

+    local_418 = 0x1c;

+    uVar9 = local_418;

+    goto LAB_8;

+  case 0x37:

+switchD_1c00840b7_caseD_37:

+    local_418 = 0x1c;

+    goto LAB_9;

+  case 0x40:

+switchD_1c00840b7_caseD_40:

+    local_418 = 0x38;

+    uVar9 = local_418;

+LAB_8:

+    local_418 = uVar9;

+    local_3f8 = puVar10;

+    local_3e8 = param_3;

+    lVar11 = PsGetCurrentProcessWow64Process();

+    puVar19 = local_3e8;

+    uVar20 = 4;

+    if (lVar11 != 0) {

+      uVar20 = uVar23;

+    }

+    ProbeForWrite(local_3e8,local_418,uVar20);

+    local_3f0 = 1;

+    *puVar10 = *puVar19;

+    puVar12 = puVar10;

+    uVar24 = local_410;

+LAB_6:

+    iVar8 = xxxSystemParametersInfo(local_400,uVar24,puVar12,param_4 & 3);

+    local_414 = iVar8;

+    if (local_3f0 != 0) {

+      memcpy(local_3e8,puVar12,(ulonglong)local_418);

+    }

+    break;

+  case 0x41:

+switchD_1c00840b7_caseD_41:

+    local_418 = 0x38;

+LAB_9:

+    if (((ulonglong)param_3 & 3) != 0) {

+                    /* WARNING: Subroutine does not return */

+      ExRaiseDatatypeMisalignment();

+    }

+    if ((*(uint **)MmUserProbeAddress_exref < (uint *)((ulonglong)local_418 + (longlong)param_3)) ||

+       ((uint *)((ulonglong)local_418 + (longlong)param_3) < param_3)) {

+      *(undefined1 *)*(uint **)MmUserProbeAddress_exref = 0;

+    }

+LAB_13:

+    memcpy(puVar10,param_3,(ulonglong)local_418);

+    puVar12 = puVar10;

+    uVar24 = local_410;

+    local_3f8 = puVar10;

+    goto LAB_6;

+  case 0x43:

+    if ((param_3 + 6 < param_3) || (*(uint **)MmUserProbeAddress_exref < param_3 + 6)) {

+      param_3 = *(uint **)MmUserProbeAddress_exref;

+    }

+    local_350 = *param_3;

+    uStack_34c = param_3[1];

+    uStack_348 = param_3[2];

+    uStack_344 = param_3[3];

+    local_340 = *(undefined8 *)(param_3 + 4);

+    *puVar10 = local_350;

+    puVar10[1] = uStack_34c;

+    puVar10[2] = uStack_348;

+    puVar10[3] = uStack_344;

+    *(undefined8 *)(puVar10 + 4) = local_340;

+    uVar21 = *(ulonglong *)(puVar10 + 4);

+    if ((uVar21 & 1) != 0) {

+      local_3f8 = puVar10;

+                    /* WARNING: Subroutine does not return */

+      ExRaiseDatatypeMisalignment();

+    }

+    uVar15 = (ushort)puVar10[2];

+    uVar18 = uVar21 + 2 + (ulonglong)uVar15;

+    if ((uVar18 <= uVar21) || (*(ulonglong *)MmUserProbeAddress_exref <= uVar18)) {

+      local_3f8 = puVar10;

+                    /* WARNING: Subroutine does not return */

+      ExRaiseAccessViolation();

+    }

+    if (*(ushort *)((longlong)puVar10 + 10) < uVar15) {

+      local_3f8 = puVar10;

+      if ((uVar15 & 1) == 0) goto LAB_14;

+    }

+    else if ((uVar15 & 1) == 0) {

+      puVar12 = puVar10;

+      local_3f8 = puVar10;

+      if (uVar15 == 0) {

+        puVar10[4] = 0;

+        puVar10[5] = 0;

+      }

+      goto LAB_6;

+    }

+    local_3f8 = puVar10;

+    MicrosoftTelemetryAssertTriggeredNoArgsKM();

+LAB_14:

+                    /* WARNING: Subroutine does not return */

+    ExRaiseAccessViolation();

+  case 0x73:

+    local_3f8 = puVar10;

+    local_3e8 = param_3;

+    ProbeForWrite(param_3,(ulonglong)local_410 * 2,2);

+    if (0x103 < uVar24) {

+      uVar24 = 0x104;

+    }

+    local_418 = uVar24 * 2;

+    local_3f0 = 1;

+    puVar12 = puVar10;

+    local_408 = uVar24;

+    goto LAB_6;

+  case 0x92:

+    if (uVar9 == 0x38) goto switchD_1c00840b7_caseD_40;

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0x93:

+    if (uVar9 == 0x38) goto switchD_1c00840b7_caseD_41;

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0x94:

+    if (uVar9 == 0x20) goto LAB_8;

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0x95:

+    if (uVar9 == 0x20) {

+      local_418 = 0x20;

+      goto LAB_9;

+    }

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0x96:

+    if (uVar9 == 0x1c) goto switchD_1c00840b7_caseD_36;

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0x97:

+    if (uVar9 == 0x1c) goto switchD_1c00840b7_caseD_37;

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0x98:

+    if (uVar9 == 0x80) goto LAB_8;

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0x99:

+    if (uVar9 == 0x80) {

+      local_418 = 0x80;

+      goto LAB_9;

+    }

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0x9a:

+    if (uVar9 == 0x224) {

+      local_418 = 0x224;

+      lVar11 = PsGetCurrentProcessWow64Process();

+      lVar22 = 4;

+      uVar20 = 4;

+      if (lVar11 != 0) {

+        uVar20 = uVar23;

+      }

+      ProbeForWrite(param_3,0x224,uVar20);

+      puVar19 = puVar10;

+      do {

+        puVar16 = puVar12;

+        puVar14 = puVar19;

+        uVar4 = *(undefined8 *)(puVar16 + 2);

+        *(undefined8 *)puVar14 = *(undefined8 *)puVar16;

+        *(undefined8 *)(puVar14 + 2) = uVar4;

+        uVar4 = *(undefined8 *)(puVar16 + 6);

+        *(undefined8 *)(puVar14 + 4) = *(undefined8 *)(puVar16 + 4);

+        *(undefined8 *)(puVar14 + 6) = uVar4;

+        uVar4 = *(undefined8 *)(puVar16 + 10);

+        *(undefined8 *)(puVar14 + 8) = *(undefined8 *)(puVar16 + 8);

+        *(undefined8 *)(puVar14 + 10) = uVar4;

+        uVar4 = *(undefined8 *)(puVar16 + 0xe);

+        *(undefined8 *)(puVar14 + 0xc) = *(undefined8 *)(puVar16 + 0xc);

+        *(undefined8 *)(puVar14 + 0xe) = uVar4;

+        uVar4 = *(undefined8 *)(puVar16 + 0x12);

+        *(undefined8 *)(puVar14 + 0x10) = *(undefined8 *)(puVar16 + 0x10);

+        *(undefined8 *)(puVar14 + 0x12) = uVar4;

+        uVar4 = *(undefined8 *)(puVar16 + 0x16);

+        *(undefined8 *)(puVar14 + 0x14) = *(undefined8 *)(puVar16 + 0x14);

+        *(undefined8 *)(puVar14 + 0x16) = uVar4;

+        uVar4 = *(undefined8 *)(puVar16 + 0x1a);

+        *(undefined8 *)(puVar14 + 0x18) = *(undefined8 *)(puVar16 + 0x18);

+        *(undefined8 *)(puVar14 + 0x1a) = uVar4;

+        uVar4 = *(undefined8 *)(puVar16 + 0x1e);

+        *(undefined8 *)(puVar14 + 0x1c) = *(undefined8 *)(puVar16 + 0x1c);

+        *(undefined8 *)(puVar14 + 0x1e) = uVar4;

+        lVar22 = lVar22 + -1;

+        puVar19 = puVar14 + 0x20;

+        puVar12 = puVar16 + 0x20;

+      } while (lVar22 != 0);

+      uVar4 = *(undefined8 *)(puVar16 + 0x22);

+      *(undefined8 *)(puVar14 + 0x20) = *(undefined8 *)(puVar16 + 0x20);

+      *(undefined8 *)(puVar14 + 0x22) = uVar4;

+      uVar4 = *(undefined8 *)(puVar16 + 0x26);

+      *(undefined8 *)(puVar14 + 0x24) = *(undefined8 *)(puVar16 + 0x24);

+      *(undefined8 *)(puVar14 + 0x26) = uVar4;

+      puVar14[0x28] = puVar16[0x28];

+      local_3f8 = puVar10;

+      local_3e8 = param_3;

+      goto LAB_5;

+    }

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0x9b:

+    if (uVar9 == 0x224) {

+      local_418 = 0x224;

+      if ((param_3 + 0x89 < param_3) || (*(uint **)MmUserProbeAddress_exref < param_3 + 0x89)) {

+        param_3 = *(uint **)MmUserProbeAddress_exref;

+      }

+      lVar22 = 4;

+      lVar11 = 4;

+      puVar19 = local_298;

+      do {

+        puVar14 = param_3;

+        puVar12 = puVar19;

+        uVar4 = *(undefined8 *)(puVar14 + 2);

+        *(undefined8 *)puVar12 = *(undefined8 *)puVar14;

+        *(undefined8 *)(puVar12 + 2) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 6);

+        *(undefined8 *)(puVar12 + 4) = *(undefined8 *)(puVar14 + 4);

+        *(undefined8 *)(puVar12 + 6) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 10);

+        *(undefined8 *)(puVar12 + 8) = *(undefined8 *)(puVar14 + 8);

+        *(undefined8 *)(puVar12 + 10) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 0xe);

+        *(undefined8 *)(puVar12 + 0xc) = *(undefined8 *)(puVar14 + 0xc);

+        *(undefined8 *)(puVar12 + 0xe) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 0x12);

+        *(undefined8 *)(puVar12 + 0x10) = *(undefined8 *)(puVar14 + 0x10);

+        *(undefined8 *)(puVar12 + 0x12) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 0x16);

+        *(undefined8 *)(puVar12 + 0x14) = *(undefined8 *)(puVar14 + 0x14);

+        *(undefined8 *)(puVar12 + 0x16) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 0x1a);

+        *(undefined8 *)(puVar12 + 0x18) = *(undefined8 *)(puVar14 + 0x18);

+        *(undefined8 *)(puVar12 + 0x1a) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 0x1e);

+        *(undefined8 *)(puVar12 + 0x1c) = *(undefined8 *)(puVar14 + 0x1c);

+        *(undefined8 *)(puVar12 + 0x1e) = uVar4;

+        lVar11 = lVar11 + -1;

+        puVar19 = puVar12 + 0x20;

+        param_3 = puVar14 + 0x20;

+      } while (lVar11 != 0);

+      uVar4 = *(undefined8 *)(puVar14 + 0x22);

+      *(undefined8 *)(puVar12 + 0x20) = *(undefined8 *)(puVar14 + 0x20);

+      *(undefined8 *)(puVar12 + 0x22) = uVar4;

+      uVar4 = *(undefined8 *)(puVar14 + 0x26);

+      *(undefined8 *)(puVar12 + 0x24) = *(undefined8 *)(puVar14 + 0x24);

+      *(undefined8 *)(puVar12 + 0x26) = uVar4;

+      puVar12[0x28] = puVar14[0x28];

+      puVar19 = local_298;

+      puVar12 = puVar10;

+      do {

+        puVar16 = puVar12;

+        puVar14 = puVar19;

+        uVar4 = *(undefined8 *)(puVar14 + 2);

+        *(undefined8 *)puVar16 = *(undefined8 *)puVar14;

+        *(undefined8 *)(puVar16 + 2) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 6);

+        *(undefined8 *)(puVar16 + 4) = *(undefined8 *)(puVar14 + 4);

+        *(undefined8 *)(puVar16 + 6) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 10);

+        *(undefined8 *)(puVar16 + 8) = *(undefined8 *)(puVar14 + 8);

+        *(undefined8 *)(puVar16 + 10) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 0xe);

+        *(undefined8 *)(puVar16 + 0xc) = *(undefined8 *)(puVar14 + 0xc);

+        *(undefined8 *)(puVar16 + 0xe) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 0x12);

+        *(undefined8 *)(puVar16 + 0x10) = *(undefined8 *)(puVar14 + 0x10);

+        *(undefined8 *)(puVar16 + 0x12) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 0x16);

+        *(undefined8 *)(puVar16 + 0x14) = *(undefined8 *)(puVar14 + 0x14);

+        *(undefined8 *)(puVar16 + 0x16) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 0x1a);

+        *(undefined8 *)(puVar16 + 0x18) = *(undefined8 *)(puVar14 + 0x18);

+        *(undefined8 *)(puVar16 + 0x1a) = uVar4;

+        uVar4 = *(undefined8 *)(puVar14 + 0x1e);

+        *(undefined8 *)(puVar16 + 0x1c) = *(undefined8 *)(puVar14 + 0x1c);

+        *(undefined8 *)(puVar16 + 0x1e) = uVar4;

+        lVar22 = lVar22 + -1;

+        puVar19 = puVar14 + 0x20;

+        puVar12 = puVar16 + 0x20;

+      } while (lVar22 != 0);

+      uVar9 = puVar14[0x21];

+      uVar2 = puVar14[0x22];

+      uVar3 = puVar14[0x23];

+      puVar16[0x20] = puVar14[0x20];

+      puVar16[0x21] = uVar9;

+      puVar16[0x22] = uVar2;

+      puVar16[0x23] = uVar3;

+      uVar9 = puVar14[0x25];

+      uVar2 = puVar14[0x26];

+      uVar3 = puVar14[0x27];

+      puVar16[0x24] = puVar14[0x24];

+      puVar16[0x25] = uVar9;

+      puVar16[0x26] = uVar2;

+      puVar16[0x27] = uVar3;

+      puVar16[0x28] = puVar14[0x28];

+      puVar12 = puVar10;

+      local_3f8 = puVar10;

+      if (puVar10[6] < 0x105) goto LAB_6;

+      UserSetLastError(0x57);

+      iVar8 = 0;

+      local_414 = 0;

+    }

+    else {

+      UserSetLastError(0x57);

+      iVar8 = 0;

+      local_414 = 0;

+    }

+    break;

+  case 0x9c:

+    if (uVar9 == 0x10) goto switchD_1c00840b7_caseD_30;

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0xa5:

+  case 0xa7:

+    if (uVar9 == 0xc) goto switchD_1c00840b7_caseD_3;

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0xac:

+    if (uVar9 == 4) {

+      local_418 = 4;

+      uVar9 = local_418;

+      goto LAB_8;

+    }

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0xad:

+    if (uVar9 == 4) {

+      local_418 = 4;

+      goto LAB_9;

+    }

+    UserSetLastError(0x57);

+    iVar8 = 0;

+    local_414 = 0;

+    break;

+  case 0xae:

+    if (uVar9 == 0x18) {

+      lVar11 = PsGetCurrentProcessWow64Process();

+      puVar12 = (uint *)0x3;

+      if (lVar11 != 0) {

+        puVar12 = puVar19;

+      }

+      if (((ulonglong)puVar12 & (ulonglong)param_3) != 0) {

+                    /* WARNING: Subroutine does not return */

+        ExRaiseDatatypeMisalignment();

+      }

+      if ((*(uint **)MmUserProbeAddress_exref < param_3 + 1) || (param_3 + 1 < param_3)) {

+        *(undefined1 *)*(uint **)MmUserProbeAddress_exref = 0;

+      }

+      if (*param_3 == 0) {

+        *puVar10 = 0;

+        goto switchD_1c00840b7_caseD_32;

+      }

+      UserSetLastError(0x57);

+      iVar8 = 0;

+      local_414 = 0;

+    }

+    else {

+      UserSetLastError(0x57);

+      iVar8 = 0;

+      local_414 = 0;

+    }

+    break;

+  case 0xaf:

+    if (uVar9 == 0x18) {

+      lVar11 = PsGetCurrentProcessWow64Process();

+      puVar12 = (uint *)0x3;

+      if (lVar11 != 0) {

+        puVar12 = puVar19;

+      }

+      if (((ulonglong)puVar12 & (ulonglong)param_3) != 0) {

+                    /* WARNING: Subroutine does not return */

+        ExRaiseDatatypeMisalignment();

+      }

+      if ((*(uint **)MmUserProbeAddress_exref < param_3 + 1) || (param_3 + 1 < param_3)) {

+        *(undefined1 *)*(uint **)MmUserProbeAddress_exref = 0;

+      }

+      if (*param_3 == 0) goto switchD_1c00840b7_caseD_33;

+      UserSetLastError(0x57);

+      iVar8 = 0;

+      local_414 = 0;

+    }

+    else {

+      UserSetLastError(0x57);

+      iVar8 = 0;

+      local_414 = 0;

+    }

+  }

+LAB_7:

+  if ((local_3d8 != 0) && (DAT_15 != 0)) {

+    (*(code *)DAT_15)(&local_390);

+  }

+  if (DAT_15 != 0) {

+    (*(code *)DAT_15)(&local_378);

+  }

+LAB_1:

+  if (gcSwitchInProgressWaiters != 0) {

+    KeReleaseSemaphore(gpsemSwitchInProgressWaiters,0,gcSwitchInProgressWaiters,0);

+    gcSwitchInProgressWaiters = 0;

+  }

+  if (DAT_16 != 0) {

+    (*(code *)DAT_16)();

+  }

+  bVar6 = IS_USERCRIT_OWNED_EXCLUSIVE();

+  if (bVar6) {

+    if (gcInHMDestroyUnlockedObjectWorker != 0) {

+      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+    }

+    if (gphePrimaryDestroyTarget != (_HANDLEENTRY *)0x0) {

+      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+    }

+    if (gcSecondaryDestroyTargets < gcDeferredDestroyTargets) {

+      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+    }

+    gcInHMDestroyUnlockedObjectWorker = 0;

+    gphePrimaryDestroyTarget = (_HANDLEENTRY *)0x0;

+    DestroyExclusiveUserCritDeferredUnlockList();

+  }

+  uVar9 = AtomicExecutionCheck::GetCount();

+  if (uVar9 != 0) {

+    if ((gdwExtraInstrumentations & 1) != 0) {

+      uStack_448 = 0;

+                    /* WARNING: Subroutine does not return */

+      KeBugCheckEx(0x160,uVar9,0);

+    }

+    uStack_428 = 0;

+    uStack_430 = 0;

+    uStack_438 = 0;

+    ppuStack_440 = (ulonglong **)0x0;

+    uStack_448 = 0;

+    DbgkWerCaptureLiveKernelDump(L"NTUSER",400,0x25,0);

+  }

+  if ((gptiCurrent != 0) && (lVar11 = W32GetThreadWin32Thread(SystemReserved1[0xf]), lVar11 != 0)) {

+    ptVar13 = PtiCurrentShared();

+    *(undefined4 *)(ptVar13 + 0x5ec) = 0;

+  }

+  gptiCurrent = 0;

+  if ((InputTraceLogging::Perf::s_userCritLoggingEnabled != false) &&

+     (lVar11 = PsGetCurrentThreadWin32Thread(), lVar11 != 0)) {

+    uVar9 = *(uint *)(lVar11 + 0x2c);

+    if (((((uVar9 & 1) != 0) || (((uVar9 & 2) != 0 || (0 < *(int *)(lVar11 + 0x18))))) &&

+        (6 < DAT_17)) && (cVar7 = _tlgKeywordOn(&DAT_17,0x2000), cVar7 != '\0')) {

+      ppuStack_440 = &puStack_68;

+      uStack_448 = CONCAT44(uStack_448._4_4_,2);

+      _tlgWriteTransfer_EtwWriteTransfer(&DAT_17,&DAT_1c028f055,lVar11 + 0x1c,0);

+      uVar9 = *(uint *)(lVar11 + 0x2c);

+    }

+    *(uint *)(lVar11 + 0x2c) = uVar9 & 0xfffffffe;

+    *(undefined8 *)(lVar11 + 0x1c) = 0;

+    *(undefined8 *)(lVar11 + 0x24) = 0;

+  }

+  EtwTraceReleaseUserCrit();

+  lVar11 = SGDGetUserSessionState();

+  ExReleaseResourceAndLeaveCriticalRegion(*(undefined8 *)(lVar11 + 8));

+  return (longlong)iVar8;

 }
```

## `FastGetProfileKeysW`  (modified)

```diff
--- FastGetProfileKeysW
+++ FastGetProfileKeysW
@@ -1,13 +1,127 @@
 

-/* WARNING: Control flow encountered bad instruction data */

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

 

-void FastGetProfileKeysW(char param_1)

+void FastGetProfileKeysW(CLeakTrackingAllocator *param_1,undefined1 *param_2,void *param_3,

+                        undefined8 *param_4)

 

 {

-  longlong in_RAX;

+  int iVar1;

+  CLeakTrackingAllocator *pCVar2;

+  undefined1 *puVar3;

+  CLeakTrackingAllocator *pCVar4;

+  longlong lVar5;

+  CLeakTrackingAllocator *pCVar6;

+  undefined1 *puVar7;

+  uint uVar8;

+  undefined1 *puVar9;

+  uint uVar10;

+  uint uVar11;

+  undefined1 *puVar12;

+  undefined1 auStack_2a8 [32];

+  uint local_288;

+  uint *local_280;

+  uint local_278;

+  uint local_274;

+  void *local_270;

+  undefined8 *local_268;

+  undefined1 local_258 [512];

+  ulonglong local_58;

   

-  *(char *)(in_RAX + -0x7d) = *(char *)(in_RAX + -0x7d) + param_1;

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+                    /* 0x159df0  1126  FastGetProfileKeysW */

+  local_58 = __security_cookie ^ (ulonglong)auStack_2a8;

+  local_274 = 0;

+  puVar7 = (undefined1 *)0x0;

+  pCVar4 = (CLeakTrackingAllocator *)0x0;

+  uVar11 = 0;

+  puVar12 = (undefined1 *)0x0;

+  local_270 = param_3;

+  local_268 = param_4;

+  pCVar2 = (CLeakTrackingAllocator *)OpenCacheKeyEx(param_1,param_2,0x20019,0);

+  if (pCVar2 != (CLeakTrackingAllocator *)0x0) {

+    *param_4 = 0;

+    puVar3 = local_258;

+    uVar8 = 0x200;

+LAB_0:

+    local_280 = &local_278;

+    local_278 = 0;

+    param_1 = pCVar2;

+    param_2 = puVar12;

+    local_288 = uVar8;

+    iVar1 = ZwEnumerateValueKey(pCVar2,puVar12,0,puVar3);

+    pCVar6 = pCVar4;

+    puVar9 = puVar3;

+    uVar10 = uVar8;

+    if (iVar1 == -0x7ffffffb) {

+      if (uVar8 < local_278) goto code_r0x0001c0159e9c;

+      goto LAB_1;

+    }

+    if (-1 < iVar1) {

+      uVar8 = uVar11 + 0x1003 + *(int *)(puVar3 + 8) & 0xfffff000;

+      if (local_274 < uVar8) {

+        if (pCVar4 == (CLeakTrackingAllocator *)0x0) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             (param_1,(__uint64)param_2,(ulonglong)uVar8,0x72707355);

+          pCVar4 = pCVar6;

+        }

+        else {

+          param_2 = (undefined1 *)(ulonglong)uVar11;

+          param_1 = pCVar4;

+          pCVar4 = (CLeakTrackingAllocator *)UserReAllocPoolWithQuota();

+        }

+        if (pCVar4 == (CLeakTrackingAllocator *)0x0) goto LAB_1;

+      }

+      local_274 = uVar8;

+      memcpy(pCVar4 + (ulonglong)(uVar11 >> 1) * 2,puVar3 + 0xc,(ulonglong)*(uint *)(puVar3 + 8));

+      *(undefined2 *)(pCVar4 + (ulonglong)(*(int *)(puVar3 + 8) + uVar11 >> 1) * 2) = 0;

+      uVar11 = uVar11 + 2 + *(int *)(puVar3 + 8);

+      goto LAB_2;

+    }

+LAB_1:

+    param_3 = local_270;

+    if ((int)puVar12 != 0) goto LAB_3;

+  }

+  lVar5 = -1;

+  do {

+    lVar5 = lVar5 + 1;

+  } while (*(short *)((longlong)param_3 + lVar5 * 2) != 0);

+  iVar1 = (int)lVar5 * 2;

+  uVar8 = iVar1 + 4;

+  pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     (param_1,(__uint64)param_2,(ulonglong)uVar8,0x72707355);

+  if (pCVar6 != (CLeakTrackingAllocator *)0x0) {

+    memcpy(pCVar6,local_270,(ulonglong)uVar8 - 2);

+    uVar11 = iVar1 + 2;

+  }

+LAB_3:

+  if (pCVar2 != (CLeakTrackingAllocator *)0x0) {

+    ZwClose(pCVar2);

+  }

+  if (puVar7 != (undefined1 *)0x0) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar7);

+  }

+  if (pCVar6 != (CLeakTrackingAllocator *)0x0) {

+    *(undefined2 *)(pCVar6 + (ulonglong)(uVar11 >> 1) * 2) = 0;

+  }

+  *local_268 = pCVar6;

+  return;

+code_r0x0001c0159e9c:

+  if (puVar7 != (undefined1 *)0x0) {

+    param_1 = gpLeakTrackingAllocator;

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar7);

+    puVar9 = local_258;

+    uVar10 = 0x200;

+    param_2 = puVar7;

+  }

+  puVar3 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     (param_1,(__uint64)param_2,(ulonglong)local_278,0x72707355);

+  puVar7 = puVar3;

+  uVar8 = local_278;

+  if (puVar3 == (undefined1 *)0x0) {

+LAB_2:

+    puVar3 = puVar9;

+    puVar12 = (undefined1 *)(ulonglong)((int)puVar12 + 1);

+    uVar8 = uVar10;

+  }

+  goto LAB_0;

 }
```

## `FastGetProfileValue`  (modified)

```diff
--- FastGetProfileValue
+++ FastGetProfileValue
@@ -1,241 +1,99 @@
 

-/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

 

-undefined4

-FastGetProfileValue(undefined8 param_1,ulonglong param_2,undefined8 param_3,longlong param_4)

+ulonglong FastGetProfileValue(CLeakTrackingAllocator *param_1,uint param_2,undefined2 *param_3,

+                             void *param_4,void *param_5,uint param_6,uint param_7)

 

 {

-  OBJECT *pOVar1;

-  int *piVar2;

-  char cVar3;

-  uint *puVar4;

-  GdiHandleManager *this;

-  longlong *plVar5;

-  SURFACE *this_00;

-  HPALETTE__ *pHVar6;

-  OBJECT *pOVar7;

-  uint uVar8;

-  int iVar9;

-  longlong lVar10;

-  undefined8 in_RAX;

-  longlong lVar11;

-  longlong lVar12;

-  _ENTRY *p_Var13;

-  uint *puVar14;

-  uint uVar15;

-  uint uVar16;

-  ReferenceTrackerCountedType RVar17;

-  DC *this_01;

-  void *pvVar18;

-  int unaff_EBX;

-  longlong unaff_RBP;

-  XDCOBJ *unaff_RSI;

-  char *unaff_RDI;

-  int unaff_R12D;

-  GdiHandleManager *unaff_R13;

-  int unaff_R14D;

-  undefined4 uVar19;

-  char in_CF;

+  int iVar1;

+  longlong lVar2;

+  undefined8 *puVar3;

+  CLeakTrackingAllocator *this;

+  __uint64 _Var4;

+  undefined1 auStack_108 [32];

+  uint local_e8;

+  uint *local_e0;

+  uint local_d8;

+  uint local_d4;

+  uint local_d0;

+  undefined8 local_c8;

+  undefined8 uStack_c0;

+  undefined8 local_b8;

+  undefined8 uStack_b0;

+  undefined2 local_a8 [40];

+  ulonglong local_58;

   

-  *unaff_RDI = *unaff_RDI + (char)((ulonglong)in_RAX >> 8) + in_CF;

-code_r0x0001c007dad4:

-  puVar14 = *(uint **)(*(longlong *)(**(longlong **)(param_4 + 0x18) + (param_2 >> 8) * 8) + 8 +

-                      (param_2 & 0xff) * 0x10);

+                    /* 0x2f7a0  1129  FastGetProfileValue */

+  local_58 = __security_cookie ^ (ulonglong)auStack_108;

+  local_d4 = param_7 | gdwPolicyFlags;

+  local_d8 = 0;

+  _Var4 = (__uint64)param_2;

+  local_c8 = 0;

+  uStack_c0 = 0;

+  local_b8 = 0;

+  uStack_b0 = 0;

+  local_d0 = param_2;

+  if (((ulonglong)param_3 & 0xffffffffffff0000) == 0) {

+    local_a8[0] = 0;

+    RtlLoadStringOrError((ulonglong)param_3 & 0xffff,local_a8,0x28);

+    param_3 = local_a8;

+  }

+  this = param_1;

+  lVar2 = OpenCacheKeyEx(param_1,_Var4,0x20019,&local_d4);

   do {

-    uVar8 = GdiHandleManager::DecodeIndex(unaff_R13,*puVar14 >> 8 & 0xff0000 | *puVar14 & 0xffff);

-    lVar12 = *(longlong *)(unaff_R13 + 0x10);

-    uVar16 = *(uint *)(lVar12 + 0x808);

-    if (uVar8 < ((uint)*(ushort *)(lVar12 + 2) + unaff_EBX) * 0x10000 + uVar16) {

-      if (uVar8 < uVar16) {

-        uVar15 = 0;

-      }

-      else {

-        uVar15 = (uVar8 - uVar16 >> 0x10) + 1;

-      }

-      plVar5 = *(longlong **)(lVar12 + 8 + (ulonglong)uVar15 * 8);

-      if (uVar15 != 0) {

-        uVar8 = uVar8 + ((1 - uVar15) * 0x10000 - uVar16);

-      }

-      puVar14 = (uint *)(*plVar5 + 8 + (ulonglong)uVar8 * 0x18);

-      *puVar14 = *puVar14 & 0xfffffffe;

-      ExReleasePushLockExclusiveEx

-                (((ulonglong)uVar8 & 0xff) * 0x10 +

-                 *(longlong *)(*(longlong *)plVar5[3] + (ulonglong)(uVar8 >> 8) * 8),0);

-      KeLeaveCriticalRegion();

-    }

-    KeLeaveCriticalRegion();

-    lVar12 = *(longlong *)(unaff_RBP + 0x58);

-    do {

-      vRestoreRegion();

-      if (DAT_0 != 0) {

-        iVar9 = (*(code *)DAT_0)();

-        if ((-1 < iVar9) && (DAT_1 != 0)) {

-          (*(code *)DAT_1)();

+    if (lVar2 == 0) {

+      if ((param_7 & 0x10) == 0) {

+LAB_0:

+        if (lVar2 != 0) {

+          ZwClose(lVar2);

+        }

+        if (param_4 != (void *)0x0) {

+          memcpy(param_5,param_4,(ulonglong)param_6);

+          return (ulonglong)param_6;

         }

       }

-      this_00 = *(SURFACE **)(*(longlong *)unaff_RSI + 0x1f0);

-      if (this_00 != (SURFACE *)0x0) {

-        if (*(int *)(*(longlong *)unaff_RSI + 0x20) == 1) {

-          hbmSelectBitmapInternal

-                    (unaff_RSI,*(HBITMAP__ **)(*(longlong *)(lVar12 + 0xc60) + 0xa8),1,0,1);

-        }

-        else if ((*(uint *)(this_00 + 0x70) >> 0xb & 1) == 0) {

-          if (-1 < (int)*(uint *)(this_00 + 0x70)) {

-            SURFACE::vDec_cRef(this_00);

-          }

-        }

-        else {

-          HmgDecrementShareReferenceCountEx(this_00,0);

-        }

+      return 0;

+    }

+    if (param_6 == 0) {

+      local_d8 = 0x10;

+      puVar3 = &local_b8;

+    }

+    else {

+      local_d8 = param_6 + 0xc;

+      puVar3 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this,_Var4,(ulonglong)local_d8,0x72707355);

+      if (puVar3 == (undefined8 *)0x0) goto LAB_0;

+    }

+    RtlInitUnicodeString(&local_c8,param_3);

+    local_e0 = &local_d8;

+    local_e8 = local_d8;

+    iVar1 = ZwQueryValueKey(lVar2,&local_c8,2,puVar3);

+    if (-1 < iVar1) {

+      local_d8 = *(uint *)(puVar3 + 1);

+      memcpy(param_5,(void *)((longlong)puVar3 + 0xc),(ulonglong)local_d8);

+      if (param_6 != 0) {

+        NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar3);

       }

-      lVar10 = *(longlong *)(lVar12 + 0x28);

-      if (lVar10 != 0) {

-        PsEnterPriorityRegion();

-        ExEnterCriticalRegionAndAcquireResourceExclusive(lVar10);

+      ZwClose(lVar2);

+      return (ulonglong)local_d8;

+    }

+    if ((iVar1 == -0x7ffffffb) && (param_6 == 0)) {

+      ZwClose(lVar2);

+      return (ulonglong)*(uint *)(puVar3 + 1);

+    }

+    if (local_d4 == 0) {

+      if ((param_6 != 0) && (puVar3 != (undefined8 *)0x0)) {

+        NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar3);

       }

-      pHVar6 = *(HPALETTE__ **)(*(longlong *)(unaff_RBP + -0x38) + 0x50);

-      if (*(HPALETTE__ **)(*(longlong *)unaff_RSI + 0x50) != pHVar6) {

-        SelectPaletteWorker(unaff_RSI,pHVar6,1);

-      }

-      if (*(longlong *)(*(longlong *)unaff_RSI + 0x58) !=

-          *(longlong *)(*(longlong *)(unaff_RBP + -0x38) + 0x58)) {

-        EPALOBJ::EPALOBJ((EPALOBJ *)(unaff_RBP + 0x60),

-                         *(HPALETTE__ **)(*(longlong *)unaff_RSI + 0x50));

-        lVar11 = *(longlong *)(unaff_RBP + 0x60);

-        *(longlong *)(*(longlong *)(unaff_RBP + -0x38) + 0x58) = lVar11;

-        if (lVar11 != 0) {

-          HmgDecrementShareReferenceCountEx(lVar11,0);

-        }

-      }

-      lVar11 = *(longlong *)(*(longlong *)(unaff_RBP + -0x38) + 0x58);

-      if (lVar11 != *(longlong *)(lVar12 + 6000)) {

-        LOCK();

-        piVar2 = (int *)(lVar11 + 0x38);

-        *piVar2 = *piVar2 + -1;

-        UNLOCK();

-      }

-      DC::vCopyTo(*(DC **)(unaff_RBP + -0x38),unaff_RSI);

-      XDCOBJ::vDeleteCore((XDCOBJ *)(unaff_RBP + -0x38));

-      if (lVar10 != 0) {

-        lVar11 = SGDGetSessionState();

-        if ((*(int *)(*(longlong *)(lVar11 + 0x18) + 0xb4) != 0) &&

-           ((Microsoft_Windows_Win32kEnableBits & 0x10) != 0)) {

-          McTemplateK0pz_EtwWriteTransfer(*(longlong *)(lVar11 + 0x18),&LockRelease);

-        }

-        ExReleaseResourceAndLeaveCriticalRegion(lVar10);

-        PsLeavePriorityRegion();

-      }

-      XDCOBJ::vUnlockNoNullSet((XDCOBJ *)(unaff_RBP + -0x38));

-      lVar10 = *(longlong *)unaff_RSI;

-      if (*(int *)(lVar10 + 0x68) <= unaff_R14D) {

-        uVar19 = *(undefined4 *)(unaff_RBP + 0x50);

-LAB_2:

-        this_01 = *(DC **)unaff_RSI;

-        if (*(int *)(unaff_RBP + 0x48) != *(int *)(*(longlong *)(this_01 + 0x3d0) + 0x68)) {

-          *(uint *)(this_01 + 0xfc) = *(uint *)(this_01 + 0xfc) | 1;

-          this_01 = *(DC **)unaff_RSI;

-        }

-        if (unaff_R12D != 0) {

-          DC::bMakeInfoDC(this_01,1);

-        }

-        pOVar7 = *(OBJECT **)unaff_RSI;

-        pOVar1 = pOVar7 + 0x24;

-        *(uint *)pOVar1 = *(uint *)pOVar1 | 0x10;

-        lVar12 = SGDGetSessionState();

-        p_Var13 = GdiHandleManager::GetEntryFromObject

-                            (*(GdiHandleManager **)(*(longlong *)(lVar12 + 0x18) + 0x1f48),pOVar7);

-        p_Var13[0xf] = (_ENTRY)((byte)p_Var13[0xf] | 4);

-        DC::vUpdate_VisRect(*(DC **)unaff_RSI,*(REGION **)(*(DC **)unaff_RSI + 0x460));

-        puVar14 = (uint *)(*(longlong *)(*(longlong *)unaff_RSI + 0x3d0) + 0x98);

-        *puVar14 = *puVar14 | 0x12001f;

-        if (*(int *)(*(DC **)unaff_RSI + 0x20) == 1) {

-          DC::bSetDefaultRegion(*(DC **)unaff_RSI);

-        }

-        lVar12 = *(longlong *)unaff_RSI;

-        uVar16 = *(uint *)(lVar12 + 0x24);

-        lVar10 = *(longlong *)(lVar12 + 0x1f0);

-        if (((uVar16 & 1) == 0) &&

-           (((*(int *)(lVar12 + 0x20) != 1 || (lVar10 == 0)) ||

-            (((*(uint *)(lVar10 + 0x70) >> 0xe & 1) == 0 &&

-             ((unaff_RDI[0x28] & 1U) == 0 || (*(uint *)(lVar10 + 0x70) >> 0x17 & 1) == 0)))))) {

-          *(uint *)(lVar12 + 0x24) = uVar16 & 0xfffffdff;

-        }

-        else {

-          *(uint *)(lVar12 + 0x24) = uVar16 | 0x200;

-          uVar16 = *(uint *)(*(longlong *)unaff_RSI + 0x24);

-          if ((*(uint *)(lVar10 + 0x70) & 0x200) == 0) {

-            uVar16 = uVar16 & 0xffff7fff;

-          }

-          else {

-            uVar16 = uVar16 | 0x8000;

-          }

-          *(uint *)(*(longlong *)unaff_RSI + 0x24) = uVar16;

-        }

-        DC::vCalcFillOrigin(*(DC **)unaff_RSI);

-        if ((*(uint *)(unaff_RDI + 0x28) & 1) != 0) {

-          GreUnlockVisRgn();

-        }

-        return uVar19;

-      }

-      *(undefined4 *)(unaff_RBP + -0x30) = 0;

-      *(undefined4 *)(unaff_RBP + -0x2c) = 0;

-      *(undefined8 *)(unaff_RBP + -0x38) = 0;

-      lVar10 = HmgLockIgnoreOwner(*(undefined8 *)(lVar10 + 0x70),1);

-      *(longlong *)(unaff_RBP + -0x38) = lVar10;

-      if (lVar10 == 0) {

-        EngSetLastError(6);

-        uVar19 = 0;

-        XDCOBJ::vUnlockNoNullSet((XDCOBJ *)(unaff_RBP + -0x38));

-        goto LAB_2;

-      }

-      DEC_SHARE_REF_CNT_LAZY0(*(BRUSH **)(*(longlong *)unaff_RSI + 0x88));

-      DEC_SHARE_REF_CNT_LAZY0(*(BRUSH **)(*(longlong *)unaff_RSI + 0x90));

-      DEC_SHARE_REF_CNT_LAZY_DEL_LOGFONT(*(LFONT **)(*(longlong *)unaff_RSI + 0x98));

-      lVar10 = *(longlong *)unaff_RSI;

-      *(undefined8 *)(unaff_RBP + -0x28) = 0;

-      *(undefined4 *)(unaff_RBP + -0x20) = 0;

-      puVar14 = *(uint **)(lVar10 + 0x60);

-      HANDLELOCK::vLockHandle

-                ((HANDLELOCK *)(unaff_RBP + -0x28),*puVar14 >> 8 & 0xff0000 | *puVar14 & 0xffff,0,0,

-                 1);

-    } while (*(int *)(unaff_RBP + -0x20) == 0);

-    puVar4 = *(uint **)(unaff_RBP + -0x28);

-    cVar3 = *(char *)((longlong)puVar4 + 0xe);

-    if (cVar3 == '\x05') {

-      pvVar18 = *(void **)(puVar14 + 0xaa);

-      RVar17 = 0;

-LAB_3:

-      TrackObjectReferenceDecrement(RVar17,pvVar18);

+      goto LAB_0;

     }

-    else if (cVar3 == '\x10') {

-      pvVar18 = *(void **)(puVar14 + 0x22);

-      RVar17 = 2;

-      goto LAB_3;

+    if ((param_6 != 0) && (puVar3 != (undefined8 *)0x0)) {

+      NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar3);

     }

-    puVar14[2] = puVar14[2] - 1;

-    lVar12 = SGDGetSessionState();

-    unaff_R13 = *(GdiHandleManager **)(*(longlong *)(lVar12 + 0x18) + 0x1f48);

-    lVar12 = SGDGetSessionState();

-    this = *(GdiHandleManager **)(*(longlong *)(lVar12 + 0x18) + 0x1f48);

-    uVar8 = GdiHandleManager::DecodeIndex(this,*puVar4 & 0xffffff);

-    lVar12 = *(longlong *)(this + 0x10);

-    unaff_EBX = 0xffff;

-    uVar16 = *(uint *)(lVar12 + 0x808);

-    if (uVar8 < (*(ushort *)(lVar12 + 2) + 0xffff) * 0x10000 + uVar16) {

-      if (uVar8 < uVar16) {

-        uVar15 = 0;

-      }

-      else {

-        uVar15 = (uVar8 - uVar16 >> 0x10) + 1;

-      }

-      param_4 = *(longlong *)(lVar12 + 8 + (ulonglong)uVar15 * 8);

-      if (uVar15 != 0) {

-        uVar8 = uVar8 + ((1 - uVar15) * 0x10000 - uVar16);

-      }

-      param_2 = (ulonglong)uVar8;

-      if (uVar8 < *(uint *)(param_4 + 0x14)) goto code_r0x0001c007dad4;

-    }

-    puVar14 = (uint *)0x0;

+    ZwClose(lVar2);

+    _Var4 = (__uint64)local_d0;

+    this = param_1;

+    lVar2 = OpenCacheKeyEx(param_1,_Var4,0x20019,&local_d4);

   } while( true );

 }
```

## `GetProcessAppContainerSid`  (modified)

```diff
--- GetProcessAppContainerSid
+++ GetProcessAppContainerSid
@@ -1,37 +1,55 @@
 

-/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* unsigned short * __ptr64 __cdecl GetProcessAppContainerSid(void) */

 

 ushort * __cdecl GetProcessAppContainerSid(void)

 

 {

-  undefined4 uVar1;

-  char *in_RAX;

-  undefined1 *unaff_RDI;

-  undefined4 uStack0000000000000028;

-  int iStack0000000000000030;

-  int iStack0000000000000034;

-  undefined8 uStack0000000000000040;

-  int in_stack_00000050;

-  int in_stack_00000054;

-  int in_stack_00000058;

-  int in_stack_0000005c;

+  bool bVar1;

+  int iVar2;

+  long lVar3;

+  undefined8 uVar4;

+  ushort *puVar5;

+  CLeakTrackingAllocator *this;

+  __uint64 _Var6;

+  __uint64 *local_res8;

+  ulonglong local_18;

+  ushort *puStack_10;

   

-  *in_RAX = *in_RAX + (char)in_RAX;

-  if (*(undefined1 **)MmUserProbeAddress_exref <= unaff_RDI) {

-    unaff_RDI = *(undefined1 **)MmUserProbeAddress_exref;

+  local_res8 = (__uint64 *)0x0;

+  local_18 = 0;

+  puStack_10 = (ushort *)0x0;

+  puVar5 = (ushort *)0x0;

+  uVar4 = PsGetCurrentProcess();

+  uVar4 = PsReferencePrimaryToken(uVar4);

+  iVar2 = SeQueryInformationToken(uVar4,0x1f,&local_res8);

+  bVar1 = false;

+  if (-1 < iVar2) {

+    this = (CLeakTrackingAllocator *)&local_18;

+    _Var6 = *local_res8;

+    iVar2 = RtlConvertSidToUnicodeString(this,_Var6,1);

+    bVar1 = false;

+    if (-1 < iVar2) {

+      puVar5 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this,_Var6,(local_18 & 0xffff) + 2,0x79747355);

+      if (puVar5 != (ushort *)0x0) {

+        lVar3 = RtlStringCchCopyNW(puVar5,(local_18 & 0xffff) + 1,puStack_10,local_18 >> 1 & 0x7fff)

+        ;

+        bVar1 = false;

+        if (-1 < lVar3) {

+          bVar1 = true;

+        }

+      }

+    }

   }

-  *unaff_RDI = *unaff_RDI;

-  unaff_RDI[0xf] = unaff_RDI[0xf];

-  CCursorClip::GetClip(gpCursorClip,(tagRECT *)&stack0x00000050);

-  iStack0000000000000030 = (in_stack_00000058 + in_stack_00000050) / 2;

-  iStack0000000000000034 = (in_stack_0000005c + in_stack_00000054) / 2;

-  uVar1 = W32GetCurrentThreadDpiAwarenessContext();

-  uStack0000000000000040 =

-       GuessMonitorOverrideForCoordinateConversions

-                 (CONCAT44(iStack0000000000000034,iStack0000000000000030),uVar1,1);

-  PhysicalToLogicalDPIRect();

-  uStack0000000000000028 = 1;

-  UserSessionSwitchLeaveCrit();

-  return (ushort *)0x1;

+  PsDereferenceImpersonationToken(uVar4);

+  RtlFreeUnicodeString(&local_18);

+  if ((!bVar1) && (puVar5 != (ushort *)0x0)) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar5);

+    puVar5 = (ushort *)0x0;

+  }

+  if (local_res8 != (__uint64 *)0x0) {

+    ExFreePoolWithTag(local_res8,0);

+  }

+  return puVar5;

 }
```

## `NtConfigureInputSpace`  (modified)

```diff
--- NtConfigureInputSpace
+++ NtConfigureInputSpace
@@ -1,15 +1,200 @@
 

-undefined8 NtConfigureInputSpace(uint *param_1)

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+

+undefined4 NtConfigureInputSpace(undefined8 *param_1,undefined1 *param_2,uint param_3)

 

 {

-  undefined8 in_RAX;

-  undefined8 *unaff_RSI;

+  tagKERNELHANDLETABLEENTRY *ptVar1;

+  tagKERNELHANDLETABLEENTRY *ptVar2;

+  bool bVar3;

+  long lVar4;

+  longlong *plVar5;

+  ulonglong uVar6;

+  INPUT_SPACE_REGION *_Dst;

+  longlong lVar7;

+  INPUT_SPACE_REGION *pIVar8;

+  undefined4 uVar9;

+  CInputSpace *this;

+  INPUT_SPACE *pIVar10;

+  undefined4 uVar11;

+  uint uVar12;

+  longlong lVar13;

+  undefined1 auStack_928 [40];

+  INPUT_SPACE_REGION *local_900;

+  undefined8 local_8f0;

+  undefined4 local_8e8;

+  undefined8 local_8e0;

+  undefined4 local_8d8;

+  undefined8 local_8c8;

+  undefined8 uStack_8c0;

+  undefined8 local_8b8;

+  undefined8 uStack_8b0;

+  undefined8 local_8a8;

+  undefined8 uStack_8a0;

+  undefined8 local_898;

+  undefined8 uStack_890;

+  undefined8 local_888;

+  undefined8 uStack_880;

+  undefined8 local_878;

+  undefined8 uStack_870;

+  undefined8 local_868;

+  undefined8 uStack_860;

+  undefined8 local_858;

+  undefined8 uStack_850;

+  undefined8 local_848;

+  undefined8 uStack_840;

+  undefined8 local_838;

+  undefined8 uStack_830;

+  undefined8 local_828;

+  undefined8 uStack_820;

+  undefined8 local_818;

+  undefined8 uStack_810;

+  undefined8 local_808;

+  undefined1 local_800 [288];

+  undefined1 local_6e0;

+  undefined1 local_6d8 [224];

+  undefined8 local_5f8;

+  undefined4 local_5f0;

+  ulonglong local_38;

   

-  if ((undefined8 *)(ulonglong)*param_1 <= unaff_RSI) {

-    unaff_RSI = (undefined8 *)(ulonglong)*param_1;

-  }

-  *unaff_RSI = in_RAX;

+                    /* 0x1661f0  1465  NtConfigureInputSpace */

+  local_38 = __security_cookie ^ (ulonglong)auStack_928;

+  gptiCurrent = PrivateAPI::`anonymous_namespace'::EnterCritInternal(1);

+  uVar11 = 1;

+  if (gptiCurrent != 0) {

+    *(undefined4 *)(gptiCurrent + 0x5ec) = 1;

+    plVar5 = (longlong *)PsGetCurrentProcessWin32Process();

+    if (((plVar5 != (longlong *)0x0) &&

+        (uVar6 = (ulonglong)plVar5 & -(ulonglong)(*plVar5 != 0), uVar6 != 0)) &&

+       ((*(uint *)(uVar6 + 0xc) & 0x8000) != 0)) {

+      if (((*(uint *)(gptiCurrent + 0x1e8) & 0x1000000) == 0) ||

+         ((char)*(undefined4 *)(gptiCurrent + 0x4f0) < '\0')) {

+        bVar3 = false;

+      }

+      else {

+        bVar3 = true;

+      }

+      if (bVar3) {

+        while (ptVar2 = gpSharedUserCritDeferredUnlockListHead,

+              gpSharedUserCritDeferredUnlockListHead != (tagKERNELHANDLETABLEENTRY *)0x0) {

+          ptVar1 = gpSharedUserCritDeferredUnlockListHead + 0x10;

+          gpSharedUserCritDeferredUnlockListHead =

+               *(tagKERNELHANDLETABLEENTRY **)(gpSharedUserCritDeferredUnlockListHead + 0x10);

+          *(undefined8 *)ptVar1 = 0;

+          if (*(int *)(*(longlong *)ptVar2 + 8) == 0) {

+            MicrosoftTelemetryAssertTriggeredNoArgsKM();

+          }

+          HMUnlockObject(*(undefined8 *)ptVar2);

+        }

+      }

+    }

+  }

+  local_8f0 = 0;

+  local_8e8 = 0;

+  pIVar10 = (INPUT_SPACE *)&local_8f0;

+  this = (CInputSpace *)&local_5f8;

+  CInputSpace::CInputSpace(this,pIVar10,false);

+  uVar6 = 0;

+  _Dst = (INPUT_SPACE_REGION *)0x0;

+  local_900 = (INPUT_SPACE_REGION *)0x0;

+  if (param_3 == 0) {

+LAB_0:

+    _Dst = local_900;

+    if (((undefined8 *)((longlong)param_1 + 0xcU) < param_1) ||

+       (*(undefined8 **)MmUserProbeAddress_exref < (undefined8 *)((longlong)param_1 + 0xcU))) {

+      param_1 = *(undefined8 **)MmUserProbeAddress_exref;

+    }

+    local_8e0 = *param_1;

+    local_8d8 = *(undefined4 *)(param_1 + 1);

+    local_5f8 = local_8e0;

+    local_5f0 = local_8d8;

+    if (param_3 != 0) {

+      lVar13 = (ulonglong)param_3 * 200;

+      if (lVar13 != 0) {

+        lVar7 = PsGetCurrentProcessWow64Process();

+        if (((ulonglong)(~-(uint)(lVar7 != 0) & 3) & (ulonglong)param_2) != 0) {

+                    /* WARNING: Subroutine does not return */

+          ExRaiseDatatypeMisalignment();

+        }

+        if ((*(undefined1 **)MmUserProbeAddress_exref < param_2 + lVar13) ||

+           (param_2 + lVar13 < param_2)) {

+          **(undefined1 **)MmUserProbeAddress_exref = 0;

+        }

+      }

+      memcpy(_Dst,param_2,uVar6 & 0xffffffff);

+    }

+    pIVar10 = (INPUT_SPACE *)&local_5f8;

+    bVar3 = CInputConfig::Validate(pIVar10,_Dst,param_3);

+    if (bVar3) {

+      if (param_3 != 0) {

+        uVar6 = 0;

+        do {

+          pIVar8 = _Dst + uVar6 * 200;

+          local_8c8 = *(undefined8 *)pIVar8;

+          uStack_8c0 = *(undefined8 *)(pIVar8 + 8);

+          local_8b8 = *(undefined8 *)(pIVar8 + 0x10);

+          uStack_8b0 = *(undefined8 *)(pIVar8 + 0x18);

+          local_8a8 = *(undefined8 *)(pIVar8 + 0x20);

+          uStack_8a0 = *(undefined8 *)(pIVar8 + 0x28);

+          local_898 = *(undefined8 *)(pIVar8 + 0x30);

+          uStack_890 = *(undefined8 *)(pIVar8 + 0x38);

+          local_888 = *(undefined8 *)(pIVar8 + 0x40);

+          uStack_880 = *(undefined8 *)(pIVar8 + 0x48);

+          local_878 = *(undefined8 *)(pIVar8 + 0x50);

+          uStack_870 = *(undefined8 *)(pIVar8 + 0x58);

+          local_868 = *(undefined8 *)(pIVar8 + 0x60);

+          uStack_860 = *(undefined8 *)(pIVar8 + 0x68);

+          local_858 = *(undefined8 *)(pIVar8 + 0x70);

+          uStack_850 = *(undefined8 *)(pIVar8 + 0x78);

+          local_848 = *(undefined8 *)(pIVar8 + 0x80);

+          uStack_840 = *(undefined8 *)(pIVar8 + 0x88);

+          local_838 = *(undefined8 *)(pIVar8 + 0x90);

+          uStack_830 = *(undefined8 *)(pIVar8 + 0x98);

+          local_828 = *(undefined8 *)(pIVar8 + 0xa0);

+          uStack_820 = *(undefined8 *)(pIVar8 + 0xa8);

+          local_818 = *(undefined8 *)(pIVar8 + 0xb0);

+          uStack_810 = *(undefined8 *)(pIVar8 + 0xb8);

+          local_808 = *(undefined8 *)(pIVar8 + 0xc0);

+          memset(local_800,0,0x120);

+          local_6e0 = 0;

+          memset(local_6d8,0,0xd8);

+          pIVar10 = (INPUT_SPACE *)&local_5f8;

+          lVar4 = CInputSpace::AddRegion

+                            ((CInputSpace *)pIVar10,(CInputSpaceRegion *)&local_8c8,

+                             (CInputSpaceRegion **)0x0);

+          if (lVar4 < 0) goto LAB_1;

+          uVar12 = (int)uVar6 + 1;

+          uVar6 = (ulonglong)uVar12;

+        } while (uVar12 != param_3);

+      }

+      lVar4 = CInputConfig::ConfigureInputSpace((CInputConfig *)pIVar10,(CInputSpace *)&local_5f8);

+      if (-1 < lVar4) goto LAB_2;

+LAB_1:

+      uVar9 = RtlNtStatusToDosError(lVar4);

+    }

+    else {

+LAB_3:

+      uVar9 = 0x57;

+    }

+  }

+  else {

+    uVar6 = (ulonglong)param_3 * 200;

+    if (0xffffffff < uVar6) goto LAB_3;

+    _Dst = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     ((CLeakTrackingAllocator *)this,(__uint64)pIVar10,uVar6 & 0xffffffff,0x63736955

+                     );

+    local_900 = _Dst;

+    if (_Dst != (INPUT_SPACE_REGION *)0x0) goto LAB_0;

+    uVar9 = 8;

+  }

+  uVar11 = 0;

+  UserSetLastError(uVar9);

+LAB_2:

+  CInputSpace::FreeRegions((CInputSpace *)&local_5f8);

+  if (_Dst != (INPUT_SPACE_REGION *)0x0) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,_Dst);

+  }

   UserSessionSwitchLeaveCrit();

-  return 1;

+  return uVar11;

 }
```

## `GetProcessCommandLine`  (modified)

```diff
--- GetProcessCommandLine
+++ GetProcessCommandLine
@@ -1,342 +1,85 @@
 

-/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

-/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* unsigned short * __ptr64 __cdecl GetProcessCommandLine(void) */

 

 ushort * __cdecl GetProcessCommandLine(void)

 

 {

-  tagKERNELHANDLETABLEENTRY *ptVar1;

-  uint uVar2;

-  short *psVar3;

-  tagKERNELHANDLETABLEENTRY *ptVar4;

-  CLeakTrackingAllocator *this;

-  char cVar5;

-  int iVar6;

-  longlong *plVar7;

-  ulonglong uVar8;

-  longlong lVar9;

-  undefined8 *puVar10;

-  undefined8 *puVar11;

-  undefined4 uVar12;

-  char cVar13;

-  undefined8 *unaff_RBX;

-  longlong unaff_RSI;

-  char cVar14;

-  undefined8 *unaff_RDI;

-  undefined8 uVar15;

-  undefined8 *unaff_R14;

-  bool bVar16;

-  short sStack0000000000000070;

-  short sStack0000000000000072;

-  undefined4 in_stack_00000078;

-  longlong in_stack_00000098;

-  ulonglong in_stack_000000a0;

-  undefined8 in_stack_000000a8;

-  undefined4 *in_stack_000000b8;

-  undefined8 *in_stack_000000c0;

-  undefined4 *in_stack_000000c8;

-  undefined4 in_stack_000000e0;

-  undefined4 in_stack_000000e4;

-  undefined4 in_stack_000000e8;

-  undefined4 in_stack_000000ec;

-  ulong uStack0000000000000190;

-  ushort uStack0000000000000194;

-  ushort uStack0000000000000196;

-  uchar uStack0000000000000198;

-  uchar uStack0000000000000199;

-  uchar uStack000000000000019a;

-  uchar uStack000000000000019b;

-  uchar uStack000000000000019c;

-  uchar uStack000000000000019d;

-  uchar uStack000000000000019e;

-  uchar uStack000000000000019f;

+  bool bVar1;

+  bool bVar2;

+  int iVar3;

+  long lVar4;

+  ushort *puVar5;

+  ushort *puVar6;

+  CLeakTrackingAllocator *pCVar7;

+  __uint64 _Var8;

+  uint local_res8 [2];

+  CLeakTrackingAllocator *local_res10;

+  undefined8 local_58;

+  undefined8 local_50;

+  undefined4 local_48;

+  undefined4 local_44;

+  undefined8 local_40;

+  undefined8 local_38;

+  undefined4 local_30;

+  undefined4 local_2c;

+  undefined8 local_28;

+  undefined8 uStack_20;

   

-  plVar7 = (longlong *)PsGetCurrentProcessWin32Process();

-  cVar14 = (char)unaff_RDI;

-  cVar13 = (char)unaff_RBX;

-  if (((plVar7 != (longlong *)0x0) &&

-      (uVar8 = (ulonglong)plVar7 & -(ulonglong)(*plVar7 != 0), uVar8 != 0)) &&

-     ((*(uint *)(uVar8 + 0xc) & 0x8000) != 0)) {

-    if (((*(uint *)(gptiCurrent + 0x1e8) & 0x1000000) == 0) ||

-       (cVar5 = cVar14, (char)*(undefined4 *)(gptiCurrent + 0x4f0) < '\0')) {

-      cVar5 = cVar13;

-    }

-    if (cVar5 != '\0') {

-      while (ptVar4 = gpSharedUserCritDeferredUnlockListHead, unaff_RSI = in_stack_00000098,

-            gpSharedUserCritDeferredUnlockListHead != (tagKERNELHANDLETABLEENTRY *)0x0) {

-        ptVar1 = gpSharedUserCritDeferredUnlockListHead + 0x10;

-        gpSharedUserCritDeferredUnlockListHead =

-             *(tagKERNELHANDLETABLEENTRY **)(gpSharedUserCritDeferredUnlockListHead + 0x10);

-        *(undefined8 **)ptVar1 = unaff_RBX;

-        if (*(uint *)(*(longlong *)ptVar4 + 8) < (uint)unaff_RDI) {

-          MicrosoftTelemetryAssertTriggeredNoArgsKM();

+  bVar1 = false;

+  bVar2 = false;

+  local_48 = 0x30;

+  local_res8[0] = 0;

+  puVar6 = (ushort *)0x0;

+  local_res10 = (CLeakTrackingAllocator *)0x0;

+  local_44 = 0;

+  puVar5 = (ushort *)0x0;

+  local_2c = 0;

+  local_40 = 0;

+  local_38 = 0;

+  local_50 = 0;

+  local_28 = 0;

+  uStack_20 = 0;

+  local_30 = 0x200;

+  local_58 = PsGetCurrentThreadProcessId();

+  iVar3 = ZwOpenProcess(&local_res10,0x1000,&local_48,&local_58);

+  if (-1 < iVar3) {

+    _Var8 = 0x3c;

+    pCVar7 = local_res10;

+    iVar3 = ZwQueryInformationProcess(local_res10,0x3c,0,0,local_res8);

+    if ((iVar3 == -0x3ffffffc) && (0xf < local_res8[0])) {

+      puVar5 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (pCVar7,_Var8,(ulonglong)local_res8[0] + 2,0x79747355);

+      puVar6 = (ushort *)0x0;

+      bVar1 = bVar2;

+      if (puVar5 != (ushort *)0x0) {

+        _Var8 = 0x3c;

+        pCVar7 = local_res10;

+        iVar3 = ZwQueryInformationProcess(local_res10,0x3c,puVar5,local_res8[0],0);

+        if (-1 < iVar3) {

+          puVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             (pCVar7,_Var8,(ulonglong)*puVar5 + 2,0x79747355);

+          if (puVar6 != (ushort *)0x0) {

+            lVar4 = RtlStringCchCopyNW(puVar6,(ulonglong)*puVar5 + 1,*(ushort **)(puVar5 + 4),

+                                       (ulonglong)(*puVar5 >> 1));

+            bVar1 = false;

+            if (-1 < lVar4) {

+              bVar1 = true;

+            }

+          }

         }

-        HMUnlockObject(*(undefined8 *)ptVar4);

       }

     }

   }

-  uStack0000000000000190 = 0;

-  uStack0000000000000194 = 0;

-  uStack0000000000000196 = 0;

-  uStack0000000000000198 = '\0';

-  uStack0000000000000199 = '\0';

-  uStack000000000000019a = '\0';

-  uStack000000000000019b = '\0';

-  uStack000000000000019c = '\0';

-  uStack000000000000019d = '\0';

-  uStack000000000000019e = '\0';

-  uStack000000000000019f = '\0';

-  _sStack0000000000000070 = SUB84(unaff_RBX,0);

-  plVar7 = (longlong *)PsGetCurrentProcessWin32Process();

-  uVar8 = 0;

-  if (plVar7 != (longlong *)0x0) {

-    uVar8 = (ulonglong)plVar7 & -(ulonglong)(*plVar7 != 0);

+  if (local_res10 != (CLeakTrackingAllocator *)0x0) {

+    ZwClose();

   }

-  cVar5 = isChildPartition();

-  if (cVar5 == '\0') {

-    if ((unaff_R14 + 2 < unaff_R14) || (*(undefined8 **)MmUserProbeAddress_exref < unaff_R14 + 2)) {

-      unaff_R14 = *(undefined8 **)MmUserProbeAddress_exref;

-    }

-    in_stack_000000e0 = *(undefined4 *)unaff_R14;

-    in_stack_000000e4 = *(undefined4 *)((longlong)unaff_R14 + 4);

-    _uStack0000000000000190 = *unaff_R14;

-    in_stack_000000e8 = *(undefined4 *)*(uchar (*) [8])(unaff_R14 + 1);

-    in_stack_000000ec = *(undefined4 *)((longlong)unaff_R14 + 0xc);

-    _uStack0000000000000198 = *(uchar (*) [8])(unaff_R14 + 1);

-    if (gpfnIVResolveContainerId == (_func_long__GUID_ptr_CONTAINER_ID_ptr *)0x0) {

-      iVar6 = -0x3fffff45;

-    }

-    else {

-      iVar6 = (*gpfnIVResolveContainerId)

-                        ((_GUID *)&stack0x00000190,(CONTAINER_ID *)&stack0x00000070);

-    }

-    if (iVar6 < 0) {

-      if (((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-         (((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x800) == 0 ||

-          ((byte)WPP_GLOBAL_Control[0x29] < 3)))) {

-        unaff_RDI = (undefined8 *)((ulonglong)unaff_RBX & 0xff);

-      }

-      bVar16 = (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-      cVar14 = (char)unaff_RDI;

-      if ((cVar14 != '\0') || (bVar16)) {

-LAB_0:

-        WPP_RECORDER_AND_TRACE_SF_

-                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar14,bVar16,gBaseLog,3);

-      }

-    }

-    else {

-      lVar9 = ValidateHbwnd();

-      this = gpLeakTrackingAllocator;

-      if (lVar9 == 0) {

-        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-            ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x800) == 0)) ||

-           ((byte)WPP_GLOBAL_Control[0x29] < 3)) {

-          unaff_RDI = (undefined8 *)((ulonglong)unaff_RBX & 0xff);

-        }

-        cVar14 = (char)unaff_RDI;

-      }

-      else {

-        if (unaff_RSI != 0) {

-          if ((*(short *)(uVar8 + 0x430) != 0) ||

-             (cVar5 = cVar14, *(short *)(uVar8 + 0x432) != (short)unaff_RBX)) {

-            cVar5 = cVar13;

-          }

-          if (cVar5 == '\0') {

-            if ((*(short *)(uVar8 + 0x430) != sStack0000000000000070) ||

-               (cVar5 = cVar14, *(short *)(uVar8 + 0x432) != sStack0000000000000072)) {

-              cVar5 = cVar13;

-            }

-            if (cVar5 == '\0') {

-              if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-                  ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x800) == 0)) ||

-                 ((byte)WPP_GLOBAL_Control[0x29] < 3)) {

-                unaff_RDI = (undefined8 *)((ulonglong)unaff_RBX & 0xff);

-              }

-              bVar16 = (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-              cVar14 = (char)unaff_RDI;

-              if ((cVar14 != '\0') || (bVar16)) goto LAB_1;

-              goto LAB_2;

-            }

-          }

-          if (*(undefined8 **)(lVar9 + 0x88) != unaff_RBX) {

-LAB_3:

-            psVar3 = *(short **)(lVar9 + 0x88);

-            if ((*(longlong *)(psVar3 + 4) == 0) || (*(longlong *)(psVar3 + 4) == unaff_RSI)) {

-              if ((*psVar3 != 0) || (cVar5 = cVar14, psVar3[1] != (short)unaff_RBX)) {

-                cVar5 = cVar13;

-              }

-              if (cVar5 == '\0') {

-                if ((*psVar3 != sStack0000000000000070) || (psVar3[1] != sStack0000000000000072)) {

-                  cVar14 = cVar13;

-                }

-                if (cVar14 == '\0') {

-                  if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-                      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x800) == 0)) ||

-                     ((byte)WPP_GLOBAL_Control[0x29] < 3)) {

-                    unaff_RDI = (undefined8 *)((ulonglong)unaff_RBX & 0xff);

-                  }

-                  cVar14 = (char)unaff_RDI;

-                  goto joined_r0x0001c016c986;

-                }

-              }

-              if (*(undefined4 **)MmUserProbeAddress_exref <= in_stack_000000b8) {

-                in_stack_000000b8 = *(undefined4 **)MmUserProbeAddress_exref;

-              }

-              *in_stack_000000b8 = _sStack0000000000000070;

-              **(undefined4 **)(lVar9 + 0x88) = _sStack0000000000000070;

-              *(longlong *)(*(longlong *)(lVar9 + 0x88) + 8) = unaff_RSI;

-              *(undefined4 *)(uVar8 + 0x430) = _sStack0000000000000070;

-              if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-                  ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x800) == 0)) ||

-                 (puVar10 = unaff_RDI, (byte)WPP_GLOBAL_Control[0x29] < 4)) {

-                puVar10 = unaff_RBX;

-              }

-              if (((char)puVar10 != '\0') ||

-                 ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

-                WPP_RECORDER_AND_TRACE_SF_qqddq(*(undefined8 *)(WPP_GLOBAL_Control + 0x18));

-              }

-              unaff_RBX = (undefined8 *)((ulonglong)unaff_RDI & 0xffffffff);

-              goto LAB_4;

-            }

-            if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-                ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x800) == 0)) ||

-               ((byte)WPP_GLOBAL_Control[0x29] < 3)) {

-              unaff_RDI = (undefined8 *)((ulonglong)unaff_RBX & 0xff);

-            }

-            cVar14 = (char)unaff_RDI;

-joined_r0x0001c016c986:

-            bVar16 = (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-            if ((cVar14 != '\0') ||

-               (bVar16 = true, (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)

-               ) goto LAB_1;

-            goto LAB_2;

-          }

-          in_stack_00000078 = 0x64636755;

-          uVar15 = 0x104;

-          in_stack_000000a0 = 0x104;

-          in_stack_000000a8 = 0x14;

-          uVar2 = *(uint *)gpLeakTrackingAllocator;

-          if (uVar2 == 0) {

-            puVar10 = (undefined8 *)ExAllocatePool2(0x104,0x14,0x64636755);

-            if (puVar10 != (undefined8 *)0x0) {

-              LOCK();

-              *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + (longlong)unaff_RDI;

-              UNLOCK();

-            }

-          }

-          else {

-            puVar10 = unaff_RBX;

-            if (uVar2 == (uint)unaff_RDI) {

-              bVar16 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

-                                 (gpLeakTrackingAllocator,0x64636755);

-              if (bVar16) {

-                puVar10 = (undefined8 *)

-                          ExAllocatePool2(in_stack_000000a0 & 0xfffffffffffffffd,0x24,

-                                          in_stack_00000078);

-                if (puVar10 != (undefined8 *)0x0) {

-                  LOCK();

-                  *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + (longlong)unaff_RDI;

-                  UNLOCK();

-                  *puVar10 = 0x64636755;

-                  puVar10 = puVar10 + 2;

-                  if (puVar10 != (undefined8 *)0x0) goto LAB_5;

-                }

-                NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

-                          (*(CPointerHashTable **)(this + 8),(void *)0x64636755);

-              }

-            }

-            else if (uVar2 == 2) {

-              bVar16 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

-                                 (gpLeakTrackingAllocator,0x64636755,(__uint64 *)&stack0x00000090);

-              if (bVar16) {

-                in_stack_000000a8 = 0x24;

-                puVar11 = (undefined8 *)ExAllocatePool2(uVar15,0x24,0x64636755);

-                if (puVar11 != (undefined8 *)0x0) {

-                  LOCK();

-                  *(longlong *)(this + 0x80) = *(longlong *)(this + 0x80) + (longlong)unaff_RDI;

-                  UNLOCK();

-                  NSInstrumentation::CBackTrace::CBackTrace((CBackTrace *)&stack0x000000f0);

-                  if (((uint)puVar11 & 0xfff) + 0x10 < 0x1000) {

-                    bVar16 = NSInstrumentation::CLeakTrackingAllocator::

-                             AssociateAllocationWithBacktrace<1>

-                                       (this,puVar11,(__uint64)unaff_RBX,

-                                        (CBackTrace *)&stack0x000000f0);

-                    if (!bVar16) goto LAB_6;

-                    puVar10 = puVar11 + 2;

-                  }

-                  else {

-                    bVar16 = NSInstrumentation::CLeakTrackingAllocator::

-                             AssociateAllocationWithBacktrace<0>

-                                       (this,puVar11,(__uint64)unaff_RBX,

-                                        (CBackTrace *)&stack0x000000f0);

-                    puVar10 = puVar11;

-                    if (!bVar16) {

-LAB_6:

-                      LOCK();

-                      *(longlong *)(this + 0x88) = *(longlong *)(this + 0x88) + (longlong)unaff_RDI;

-                      UNLOCK();

-                      ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

-                                (puVar11);

-                      puVar10 = unaff_RBX;

-                    }

-                  }

-                }

-              }

-              else {

-                in_stack_000000c0 = &stack0x000000a0;

-                in_stack_000000c8 = &stack0x00000078;

-                puVar10 = (undefined8 *)

-                          NSInstrumentation::CLeakTrackingAllocator::

-                          MakeUntrackedAllocation<<lambda_992394a475252bc644037de3157b7526>,unsigned___int64_&>

-                                    (this,&stack0x000000c0,&stack0x000000a8);

-              }

-            }

-          }

-LAB_5:

-          *(undefined8 **)(lVar9 + 0x88) = puVar10;

-          if (puVar10 != (undefined8 *)0x0) {

-            *puVar10 = 0;

-            puVar10[1] = 0;

-            unaff_RSI = in_stack_00000098;

-            goto LAB_3;

-          }

-          uVar12 = 8;

-          goto LAB_7;

-        }

-        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-            ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x800) == 0)) ||

-           ((byte)WPP_GLOBAL_Control[0x29] < 3)) {

-          unaff_RDI = (undefined8 *)((ulonglong)unaff_RBX & 0xff);

-        }

-        cVar14 = (char)unaff_RDI;

-      }

-      bVar16 = (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-      if ((cVar14 != '\0') ||

-         (bVar16 = true, (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED))

-      goto LAB_0;

-    }

-    uVar12 = 0x57;

+  if (puVar5 != (ushort *)0x0) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar5);

   }

-  else {

-    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x800) == 0)) ||

-       ((byte)WPP_GLOBAL_Control[0x29] < 3)) {

-      unaff_RDI = (undefined8 *)((ulonglong)unaff_RBX & 0xff);

-    }

-    bVar16 = (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-    cVar14 = (char)unaff_RDI;

-    if ((cVar14 != '\0') || (bVar16)) {

-LAB_1:

-      WPP_RECORDER_AND_TRACE_SF_

-                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar14,bVar16,gBaseLog,3);

-    }

-LAB_2:

-    uVar12 = 5;

+  if ((!bVar1) && (puVar6 != (ushort *)0x0)) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar6);

+    puVar6 = (ushort *)0x0;

   }

-LAB_7:

-  UserSetLastError(uVar12);

-LAB_4:

-  UserSessionSwitchLeaveCrit();

-  return (ushort *)(longlong)(int)unaff_RBX;

+  return puVar6;

 }
```

## `NtUserSetSysColors`  (modified)

```diff
--- NtUserSetSysColors
+++ NtUserSetSysColors
@@ -1,45 +1,174 @@
 

-/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

 

-undefined8 NtUserSetSysColors(undefined8 param_1,longlong param_2,longlong param_3)

+longlong NtUserSetSysColors(uint param_1,CLeakTrackingAllocator *param_2,

+                           CLeakTrackingAllocator *param_3,undefined4 param_4)

 

 {

-  int *piVar1;

-  int iVar2;

-  longlong lVar3;

-  int in_EAX;

-  undefined4 uVar4;

-  longlong lVar5;

-  longlong unaff_RBP;

-  undefined4 unaff_ESI;

-  longlong unaff_RDI;

-  undefined4 unaff_R14D;

-  undefined4 unaff_R15D;

+  tagKERNELHANDLETABLEENTRY *ptVar1;

+  __uint64 _Size;

+  bool bVar2;

+  tagKERNELHANDLETABLEENTRY *ptVar3;

+  char cVar4;

+  int iVar5;

+  uint uVar6;

+  longlong *plVar7;

+  longlong lVar8;

+  CLeakTrackingAllocator *_Dst;

+  void *_Dst_00;

+  CLeakTrackingAllocator *pCVar9;

+  ulonglong uVar10;

+  CLeakTrackingAllocator *pCVar11;

+  ulonglong uVar12;

+  undefined4 extraout_XMM0_Da;

+  undefined4 local_90;

+  undefined4 local_8c;

+  CLeakTrackingAllocator *local_88;

+  void *local_80;

+  undefined8 local_70;

+  undefined8 uStack_68;

+  undefined8 local_60;

+  undefined8 local_58;

+  undefined8 uStack_50;

+  undefined8 local_48;

+  undefined8 local_40;

+  undefined8 uStack_38;

+  undefined8 local_30;

   

-  *(ulonglong *)(param_3 + 0x28) = (ulonglong)(in_EAX * 4 + 0x10) + param_2;

-  lVar3 = *(longlong *)(unaff_RDI + 0x460);

-  lVar5 = SGDGetSessionState();

-  LOCK();

-  piVar1 = (int *)(*(longlong *)(lVar5 + 0x18) + 0x18f0);

-  iVar2 = *piVar1;

-  *piVar1 = *piVar1 + 1;

-  UNLOCK();

-  *(int *)(lVar3 + 0x48) = iVar2 + 1;

-  *(undefined4 *)(unaff_RDI + 1000) = *(undefined4 *)(unaff_RBP + -0x30);

-  *(undefined4 *)(unaff_RDI + 0x3ec) = *(undefined4 *)(unaff_RBP + -0x2c);

-  *(undefined4 *)(unaff_RDI + 0x3f0) = *(undefined4 *)(unaff_RBP + -0x28);

-  *(undefined4 *)(unaff_RDI + 0x3f4) = *(undefined4 *)(unaff_RBP + -0x24);

-  *(undefined8 *)(unaff_RDI + 0x3f8) = 0;

-  *(undefined8 *)(unaff_RDI + 0x408) = 0;

-  *(undefined4 *)(unaff_RDI + 0x410) = unaff_R15D;

-  *(undefined4 *)(unaff_RDI + 0x414) = unaff_R14D;

-  uVar4 = unaff_ESI;

-  if ((*(uint *)(unaff_RDI + 0x28) & 1) != 0) {

-    unaff_ESI = *(undefined4 *)(unaff_RDI + 0x400);

-    uVar4 = *(undefined4 *)(unaff_RDI + 0x404);

+                    /* 0x2e040  1724  NtUserSetSysColors */

+  uVar12 = (ulonglong)param_1;

+  _Dst = (CLeakTrackingAllocator *)0x0;

+  local_88 = (CLeakTrackingAllocator *)0x0;

+  _Dst_00 = (void *)0x0;

+  local_80 = (void *)0x0;

+  local_70 = 0;

+  uStack_68 = 0;

+  local_60 = 0;

+  local_40 = 0;

+  uStack_38 = 0;

+  local_30 = 0;

+  local_58 = 0;

+  uStack_50 = 0;

+  local_48 = 0;

+  local_90 = 0x2000;

+  local_8c = 0xffffffff;

+  gptiCurrent = PrivateAPI::`anonymous_namespace'::EnterCritInternal();

+  if (gptiCurrent != 0) {

+    *(undefined4 *)(gptiCurrent + 0x5ec) = 1;

+    plVar7 = (longlong *)PsGetCurrentProcessWin32Process();

+    uVar10 = 0;

+    if (plVar7 != (longlong *)0x0) {

+      uVar10 = (ulonglong)plVar7 & -(ulonglong)(*plVar7 != 0);

+    }

+    if ((uVar10 != 0) && ((*(uint *)(uVar10 + 0xc) & 0x8000) != 0)) {

+      if ((*(uint *)(gptiCurrent + 0x1e8) & 0x1000000) == 0) {

+LAB_0:

+        bVar2 = false;

+      }

+      else {

+        if ((char)*(undefined4 *)(gptiCurrent + 0x4f0) < '\0') goto LAB_0;

+        bVar2 = true;

+      }

+      if (bVar2) {

+        while (ptVar3 = gpSharedUserCritDeferredUnlockListHead,

+              gpSharedUserCritDeferredUnlockListHead != (tagKERNELHANDLETABLEENTRY *)0x0) {

+          ptVar1 = gpSharedUserCritDeferredUnlockListHead + 0x10;

+          gpSharedUserCritDeferredUnlockListHead =

+               *(tagKERNELHANDLETABLEENTRY **)(gpSharedUserCritDeferredUnlockListHead + 0x10);

+          *(undefined8 *)ptVar1 = 0;

+          if (*(int *)(*(longlong *)ptVar3 + 8) == 0) {

+            MicrosoftTelemetryAssertTriggeredNoArgsKM();

+          }

+          HMUnlockObject(*(undefined8 *)ptVar3);

+        }

+      }

+    }

   }

-  *(undefined4 *)(unaff_RDI + 0x49c) = uVar4;

-  *(undefined4 *)(unaff_RDI + 0x498) = unaff_ESI;

-  return 1;

+  if ((*(uint *)(gptiCurrent + 0x1e8) & 0x20000000) == 0) {

+    uVar6 = 0;

+  }

+  else {

+    uVar6 = *(uint *)(*(longlong *)(*(longlong *)(gptiCurrent + 0x1a8) + 0x2f8) + 0x18) & 8;

+  }

+  if (uVar6 == 0) {

+    pCVar9 = (CLeakTrackingAllocator *)(*(longlong *)(gptiCurrent + 0x1a8) + 0x360);

+    pCVar11 = (CLeakTrackingAllocator *)&local_90;

+    cVar4 = CheckAccessEx(pCVar9,pCVar11,0);

+    if (cVar4 != '\0') {

+      if (param_1 != 0) {

+        _Size = uVar12 * 4;

+        if (uVar12 != 0) {

+          lVar8 = PsGetCurrentProcessWow64Process();

+          if (((ulonglong)param_2 & (ulonglong)(~-(uint)(lVar8 != 0) & 3)) != 0) {

+                    /* WARNING: Subroutine does not return */

+            ExRaiseDatatypeMisalignment();

+          }

+          pCVar9 = param_2 + _Size;

+          pCVar11 = *(CLeakTrackingAllocator **)MmUserProbeAddress_exref;

+          if ((pCVar11 < pCVar9) || (pCVar9 < param_2)) {

+            *pCVar11 = (CLeakTrackingAllocator)0x0;

+          }

+          if (uVar12 != 0) {

+            lVar8 = PsGetCurrentProcessWow64Process();

+            if (((ulonglong)param_3 & (ulonglong)(~-(uint)(lVar8 != 0) & 3)) != 0) {

+                    /* WARNING: Subroutine does not return */

+              ExRaiseDatatypeMisalignment();

+            }

+            pCVar9 = param_3 + _Size;

+            pCVar11 = *(CLeakTrackingAllocator **)MmUserProbeAddress_exref;

+            if ((pCVar11 < pCVar9) || (pCVar9 < param_3)) {

+              *pCVar11 = (CLeakTrackingAllocator)0x0;

+            }

+          }

+        }

+        _Dst = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (pCVar9,(__uint64)pCVar11,_Size,0x72637355);

+        local_88 = _Dst;

+        if (_Dst == (CLeakTrackingAllocator *)0x0) {

+                    /* WARNING: Subroutine does not return */

+          ExRaiseStatus(0xc0000017);

+        }

+        pCVar9 = _Dst;

+        memcpy(_Dst,param_2,_Size);

+        _Dst_00 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                            (pCVar9,(__uint64)param_2,_Size,0x76637355);

+        local_80 = _Dst_00;

+        if (_Dst_00 == (void *)0x0) {

+                    /* WARNING: Subroutine does not return */

+          ExRaiseStatus(0xc0000017);

+        }

+        memcpy(_Dst_00,param_3,_Size);

+      }

+      if (DAT_1 != 0) {

+        (*(code *)DAT_1)(_Dst,&local_40,Win32FreePool);

+      }

+      if (DAT_1 != 0) {

+        (*(code *)DAT_1)(_Dst_00,&local_58,Win32FreePool);

+      }

+      lVar8 = CreateProfileUserName(&local_70);

+      iVar5 = xxxSetSysColors(extraout_XMM0_Da,uVar12,_Dst,_Dst_00,param_4);

+      if ((lVar8 != 0) && (DAT_2 != 0)) {

+        (*(code *)DAT_2)(&local_70);

+      }

+      if (DAT_3 != 0) {

+        (*(code *)DAT_3)(&local_58);

+      }

+      if (DAT_3 != 0) {

+        (*(code *)DAT_3)(&local_40);

+      }

+      if (_Dst != (CLeakTrackingAllocator *)0x0) {

+        NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,_Dst);

+      }

+      if (_Dst_00 != (void *)0x0) {

+        NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,_Dst_00);

+      }

+      goto LAB_4;

+    }

+  }

+  iVar5 = 0;

+  UserSetLastError(5);

+LAB_4:

+  UserSessionSwitchLeaveCrit();

+  return (longlong)iVar5;

 }
```

## `InitSystemThread`  (modified)

```diff
--- InitSystemThread
+++ InitSystemThread
@@ -1,34 +1,217 @@
 

-/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

-

-undefined4 InitSystemThread(void)

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

+

+CritAcquire * InitSystemThread(ushort *param_1)

 

 {

-  int in_EAX;

-  undefined4 uVar1;

-  char cVar2;

-  char unaff_BL;

-  short unaff_BP;

-  longlong unaff_R12;

-  undefined *unaff_R15;

+  tagKERNELHANDLETABLEENTRY *ptVar1;

+  tagKERNELHANDLETABLEENTRY *ptVar2;

+  char cVar3;

+  int iVar4;

+  longlong lVar5;

+  undefined8 uVar6;

+  undefined8 *puVar7;

+  longlong *plVar8;

+  tagTHREADINFO *ptVar9;

+  void *pvVar10;

+  tagTHREADINFO *this;

+  CritAcquire *pCVar11;

+  undefined *puVar12;

+  CritAcquire *pCVar13;

+  CritAcquire *pCVar14;

+  uint uVar15;

+  undefined1 auStack_108 [32];

+  undefined4 local_e8;

+  undefined1 *local_e0;

+  uint local_d8 [2];

+  CritAcquire *local_d0;

+  int local_c8;

+  undefined4 local_c4;

+  undefined4 uStack_c0;

+  undefined4 uStack_bc;

+  undefined4 uStack_b8;

+  undefined1 local_b0 [32];

+  uint *local_90;

+  undefined8 local_88;

+  undefined1 local_80 [32];

+  uint *local_60;

+  undefined8 local_58;

+  undefined1 local_50 [32];

+  uint *local_30;

+  undefined8 local_28;

+  ulonglong local_20;

   

-  if ((code *)(ulonglong)(in_EAX + 0x2072f3) == (code *)0x0) {

-    uVar1 = 0xc00000bb;

-  }

-  else {

-    uVar1 = (*(code *)(ulonglong)(in_EAX + 0x2072f3))();

-  }

-  if (((WPP_GLOBAL_Control == unaff_R15) || ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x200) == 0))

-     || (cVar2 = unaff_BL, (byte)WPP_GLOBAL_Control[0x29] < 5)) {

-    cVar2 = (char)unaff_BP;

-  }

-  if ((WPP_RECORDER_INITIALIZED == unaff_R12) || (*(short *)(WPP_GLOBAL_Control + 0x48) == unaff_BP)

-     ) {

-    unaff_BL = (char)unaff_BP;

-  }

-  if ((cVar2 != '\0') || (unaff_BL != '\0')) {

-    WPP_RECORDER_AND_TRACE_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x18));

-  }

-  return uVar1;

+                    /* 0xc7dd0  1395  InitSystemThread */

+  local_20 = __security_cookie ^ (ulonglong)auStack_108;

+  PsGetThreadProcess(SystemReserved1[0xf]);

+  pCVar13 = (CritAcquire *)0x0;

+  if (InputTraceLogging::Perf::s_userCritLoggingEnabled == false) {

+    local_d0 = (CritAcquire *)0x0;

+  }

+  else {

+    local_d0 = (CritAcquire *)PsGetCurrentThreadWin32Thread();

+  }

+  local_c8 = 1;

+  if ((local_d0 != (CritAcquire *)0x0) &&

+     ((((0 < *(int *)(local_d0 + 0x18) || ((*(uint *)(local_d0 + 0x2c) & 2) != 0)) &&

+       (EtwActivityIdControl(3,&local_c4), 6 < DAT_0)) &&

+      (cVar3 = _tlgKeywordOn(&DAT_0,0x2000), cVar3 != '\0')))) {

+    local_88 = 4;

+    local_d8[0] = (uint)(local_c8 == 1);

+    local_90 = local_d8;

+    local_e0 = local_b0;

+    local_e8 = 3;

+    _tlgWriteTransfer_EtwWriteTransfer(&DAT_0,&DAT_1c028f0cb,&local_c4,0);

+  }

+  if (DAT_1 == 0) {

+LAB_2:

+    puVar12 = W32kEtwEnabledKeyword;

+    if ((((((ulonglong)W32kEtwEnabledKeyword & 0x8000002010000000) == 0) ||

+         ((byte)(DAT_3 - 1U) < 3)) ||

+        (((_DAT_4 & 0x8000002010000000) == 0 ||

+         ((DAT_5 & 0x8000002010000000) != DAT_5)))) &&

+       (((((ulonglong)W32kEtwEnabledKeyword & 0x200000010000000) == 0 ||

+         ((byte)(DAT_3 - 1U) < 3)) ||

+        (((_DAT_4 & 0x200000010000000) == 0 ||

+         ((DAT_5 & 0x200000010000000) != DAT_5)))))) goto LAB_1c00c7e96;

+  }

+  else {

+    puVar12 = (undefined *)0x400000000000;

+    cVar3 = _tlgKeywordOn(&DAT_1);

+    if (cVar3 == '\0') goto LAB_2;

+  }

+  lVar5 = PsGetCurrentThreadWin32Thread();

+  if (lVar5 != 0) {

+    uVar6 = KeQueryPerformanceCounter(0);

+    *(undefined8 *)(lVar5 + 8) = uVar6;

+  }

+LAB_6:

+  lVar5 = SGDGetUserSessionState();

+  pCVar11 = *(CritAcquire **)(lVar5 + 8);

+  puVar7 = (undefined8 *)ExEnterCriticalRegionAndAcquireResourceExclusive();

+  if (puVar7 == (undefined8 *)0x0) {

+    EtwTraceAcquiredExclusiveUserCrit();

+    pCVar11 = (CritAcquire *)&local_d0;

+    InputTraceLogging::Perf::CritAcquire::~CritAcquire(pCVar11);

+    gptiCurrent = (CritAcquire *)0x0;

+  }

+  else {

+    EtwTraceAcquiredExclusiveUserCrit();

+    pCVar14 = (CritAcquire *)*puVar7;

+    iVar4 = IsThreadCrossSessionAttached();

+    if (iVar4 != 0) {

+      pCVar14 = pCVar13;

+    }

+    if (local_d0 != (CritAcquire *)0x0) {

+      puVar12 = (undefined *)(ulonglong)*(uint *)(local_d0 + 0x18);

+      pCVar11 = local_d0;

+      if (((*(uint *)(local_d0 + 0x2c) & 2) != 0) || (0 < (int)*(uint *)(local_d0 + 0x18))) {

+        *(uint *)(local_d0 + 0x2c) = *(uint *)(local_d0 + 0x2c) | 1;

+        *(undefined4 *)(local_d0 + 0x1c) = local_c4;

+        *(undefined4 *)(local_d0 + 0x20) = uStack_c0;

+        *(undefined4 *)(local_d0 + 0x24) = uStack_bc;

+        *(undefined4 *)(local_d0 + 0x28) = uStack_b8;

+        if (6 < DAT_0) {

+          puVar12 = (undefined *)0x2000;

+          pCVar11 = (CritAcquire *)&DAT_0;

+          uVar15 = DAT_0;

+          cVar3 = _tlgKeywordOn();

+          if (cVar3 != '\0') {

+            local_58 = 4;

+            puVar12 = &DAT_7;

+            local_d8[0] = (uint)(local_c8 == 1);

+            local_60 = local_d8;

+            pCVar11 = (CritAcquire *)&DAT_0;

+            local_e0 = local_80;

+            local_e8 = 3;

+            _tlgWriteTransfer_EtwWriteTransfer(&DAT_0,&DAT_1c028f074,&local_c4,0);

+            uVar15 = DAT_0;

+          }

+          if (6 < uVar15) {

+            puVar12 = (undefined *)0x2000;

+            pCVar11 = (CritAcquire *)&DAT_0;

+            cVar3 = _tlgKeywordOn();

+            if (cVar3 != '\0') {

+              local_28 = 4;

+              puVar12 = &DAT_8;

+              local_d8[0] = (uint)(local_c8 == 1);

+              local_30 = local_d8;

+              pCVar11 = (CritAcquire *)&DAT_0;

+              local_e0 = local_50;

+              local_e8 = 3;

+              _tlgWriteTransfer_EtwWriteTransfer(&DAT_0,&DAT_1c028f0a1,&local_c4,0);

+            }

+          }

+        }

+      }

+    }

+    gptiCurrent = pCVar14;

+    if (pCVar14 != (CritAcquire *)0x0) {

+      *(undefined4 *)(pCVar14 + 0x5ec) = 1;

+      plVar8 = (longlong *)PsGetCurrentProcessWin32Process();

+      if ((((plVar8 != (longlong *)0x0) && (*plVar8 != 0)) &&

+          ((*(uint *)((longlong)plVar8 + 0xc) & 0x8000) != 0)) &&

+         ((pCVar11 = gptiCurrent, (*(uint *)(gptiCurrent + 0x1e8) & 0x1000000) != 0 &&

+          (-1 < (char)*(undefined4 *)(gptiCurrent + 0x4f0))))) {

+        while (ptVar2 = gpSharedUserCritDeferredUnlockListHead,

+              gpSharedUserCritDeferredUnlockListHead != (tagKERNELHANDLETABLEENTRY *)0x0) {

+          lVar5 = *(longlong *)gpSharedUserCritDeferredUnlockListHead;

+          ptVar1 = gpSharedUserCritDeferredUnlockListHead + 0x10;

+          gpSharedUserCritDeferredUnlockListHead =

+               *(tagKERNELHANDLETABLEENTRY **)(gpSharedUserCritDeferredUnlockListHead + 0x10);

+          *(undefined8 *)ptVar1 = 0;

+          if (*(int *)(lVar5 + 8) == 0) {

+            MicrosoftTelemetryAssertTriggeredNoArgsKM();

+          }

+          pCVar11 = *(CritAcquire **)ptVar2;

+          HMUnlockObject();

+        }

+      }

+    }

+  }

+  ptVar9 = PtiCurrentShared();

+  pvVar10 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                      ((CLeakTrackingAllocator *)pCVar11,(__uint64)puVar12,0x118,0x69637355);

+  *(void **)(ptVar9 + 0x1e0) = pvVar10;

+  if (pvVar10 == (void *)0x0) {

+    pCVar13 = (CritAcquire *)0xc0000017;

+  }

+  else {

+    *(uint *)(ptVar9 + 0x1e8) = *(uint *)(ptVar9 + 0x1e8) & 0xfffffff7 | 4;

+    this = ptVar9;

+    iVar4 = InitClientInfo();

+    if (iVar4 == 0) {

+      pCVar13 = (CritAcquire *)0xc0000001;

+    }

+    else {

+      if (param_1 != (ushort *)0x0) {

+        pvVar10 = *(void **)(ptVar9 + 0x1f0);

+        if (pvVar10 != (void *)0x0) {

+          this = (tagTHREADINFO *)gpLeakTrackingAllocator;

+          NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,pvVar10);

+        }

+        pvVar10 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                            ((CLeakTrackingAllocator *)this,(__uint64)pvVar10,

+                             (ulonglong)*param_1 + 0x12,0x78747355);

+        *(void **)(ptVar9 + 0x1f0) = pvVar10;

+        if (pvVar10 != (void *)0x0) {

+          *(longlong *)((longlong)pvVar10 + 8) = (longlong)pvVar10 + 0x10;

+          memcpy(*(void **)(*(longlong *)(ptVar9 + 0x1f0) + 8),*(void **)(param_1 + 4),

+                 (ulonglong)*param_1);

+          *(undefined2 *)

+           (*(longlong *)(*(longlong *)(ptVar9 + 0x1f0) + 8) + (ulonglong)(*param_1 >> 1) * 2) = 0;

+          *(ushort *)(*(longlong *)(ptVar9 + 0x1f0) + 2) = *param_1 + 2;

+          **(ushort **)(ptVar9 + 0x1f0) = *param_1;

+        }

+      }

+      if ((*(longlong *)(ptVar9 + 0x1a8) != 0) &&

+         ((*(uint *)(*(longlong *)(ptVar9 + 0x1a8) + 0xc) & 0x40) != 0)) {

+        MicrosoftTelemetryAssertTriggeredNoArgsKM();

+      }

+    }

+  }

+  UserSessionSwitchLeaveCrit();

+  return pCVar13;

 }
```

## `UserReAllocPoolWithQuota`  (modified)

```diff
--- UserReAllocPoolWithQuota
+++ UserReAllocPoolWithQuota
@@ -1,10 +1,22 @@
 

-void UserReAllocPoolWithQuota(longlong param_1)

+void * UserReAllocPoolWithQuota

+                 (CLeakTrackingAllocator *param_1,__uint64 param_2,__uint64 param_3,uint param_4)

 

 {

-  char in_AL;

+  void *_Dst;

   

-  *(char *)(param_1 + 0x5e) = *(char *)(param_1 + 0x5e) + in_AL;

-  return;

+                    /* 0xc6fc0  1994  UserReAllocPoolWithQuota */

+  _Dst = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                   (param_1,param_2,param_3,param_4);

+  if (_Dst != (void *)0x0) {

+    if (param_2 <= param_3) {

+      param_3 = param_2;

+    }

+    memcpy(_Dst,param_1,param_3);

+    if (param_1 != (CLeakTrackingAllocator *)0x0) {

+      NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,param_1);

+    }

+  }

+  return _Dst;

 }
```

## `SynthesizeMitTouchInput`  (modified)

```diff
--- SynthesizeMitTouchInput
+++ SynthesizeMitTouchInput
@@ -1,12 +1,161 @@
 

-void SynthesizeMitTouchInput(CWheelEvent *param_1)

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+

+undefined1 SynthesizeMitTouchInput(CLeakTrackingAllocator *param_1,__uint64 param_2)

 

 {

-  CInputDest *unaff_RDI;

+  undefined2 uVar1;

+  undefined8 uVar2;

+  int iVar3;

+  longlong lVar4;

+  void *pvVar5;

+  void *pvVar6;

+  RIMDEV *pRVar7;

+  CLeakTrackingAllocator *this;

+  undefined1 uVar8;

+  undefined1 uVar9;

+  uint uVar10;

+  ulonglong uVar11;

+  undefined8 local_res8;

+  tagRECT local_78;

+  tagRECT local_68;

+  undefined8 local_58;

+  undefined8 uStack_50;

+  undefined8 local_48;

+  undefined8 local_40;

+  undefined8 uStack_38;

+  undefined8 local_30;

   

-  CMouseProcessor::CWheelEvent::GetWheelMessage(param_1);

-  CInputDest::IsCompositionInput(unaff_RDI);

-  ApiSetEditionPostInputMessage();

-  return;

+  local_30 = 0;

+  local_48 = 0;

+  local_40 = 0;

+  uStack_38 = 0;

+  local_58 = 0;

+  uStack_50 = 0;

+  if (9 < *(uint *)param_1 - 1) {

+    return 0;

+  }

+  this = param_1;

+  if (TouchExtensibility::ghInjectionDevice == (void *)0x0) {

+LAB_0:

+    iVar3 = CreateInjectionDevice();

+    if (iVar3 == 0) {

+      return 0;

+    }

+  }

+  else {

+    param_2 = CONCAT71((int7)(param_2 >> 8),0x13);

+    this = TouchExtensibility::hDeviceUser;

+    lVar4 = HMValidateHandleNoSecure();

+    if (lVar4 == 0) {

+      TouchExtensibility::ghInjectionDevice = (void *)0x0;

+    }

+    if (TouchExtensibility::ghInjectionDevice == (void *)0x0) goto LAB_0;

+  }

+  pvVar5 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     (this,param_2,0xf0,0x7a747355);

+  pvVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     ((CLeakTrackingAllocator *)(ulonglong)*(uint *)param_1,param_2,

+                      (longlong)(ulonglong)*(uint *)param_1 * 0xc0,0x7a747355);

+  if ((pvVar5 == (void *)0x0) || (pvVar6 == (void *)0x0)) {

+    uVar9 = 0;

+    uVar8 = 0;

+    if (pvVar5 == (void *)0x0) goto LAB_1;

+  }

+  else {

+    *(void **)((longlong)pvVar5 + 0xe8) = pvVar6;

+    *(void **)((longlong)pvVar5 + 0x20) = TouchExtensibility::ghInjectionDevice;

+    *(undefined4 *)((longlong)pvVar5 + 0xc0) = 1;

+    uVar2 = *(undefined8 *)(param_1 + 0x60);

+    *(undefined4 *)((longlong)pvVar5 + 0x1c) = 0;

+    *(undefined8 *)((longlong)pvVar5 + 0x30) = uVar2;

+    *(uint *)((longlong)pvVar5 + 0x18) = *(uint *)param_1;

+    uVar11 = 0;

+    if (*(uint *)param_1 != 0) {

+      do {

+        local_res8 = 0;

+        lVar4 = uVar11 * 0xc0;

+        uVar2 = *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x18);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x10) =

+             *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x10);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x18) = uVar2;

+        uVar2 = *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x28);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x20) =

+             *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x20);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x28) = uVar2;

+        uVar2 = *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x38);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x30) =

+             *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x30);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x38) = uVar2;

+        uVar2 = *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x48);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x40) =

+             *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x40);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x48) = uVar2;

+        uVar2 = *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x58);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x50) =

+             *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x50);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x58) = uVar2;

+        uVar2 = *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x68);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x60) =

+             *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x60);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x68) = uVar2;

+        uVar2 = *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x78);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x70) =

+             *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x70);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x78) = uVar2;

+        uVar2 = *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x88);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x80) =

+             *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x80);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x88) = uVar2;

+        uVar2 = *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x98);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x90) =

+             *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x90);

+        *(undefined8 *)((longlong)pvVar6 + lVar4 + 0x98) = uVar2;

+        uVar2 = *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x40);

+        *(undefined8 *)(lVar4 + 0x30 + (longlong)pvVar6) = uVar2;

+        local_78 = TouchExtensibility::rcHimetricRect;

+        local_68 = TouchExtensibility::rcLogicalRect;

+        iVar3 = ConvertPointCoordinates(uVar2,&local_68,&local_78,&local_res8);

+        if (iVar3 == 0) {

+          uVar8 = 0;

+          goto LAB_2;

+        }

+        uVar10 = (int)uVar11 + 1;

+        *(undefined8 *)(lVar4 + 0x38 + (longlong)pvVar6) = local_res8;

+        *(undefined8 *)(lVar4 + 0x48 + (longlong)pvVar6) = local_res8;

+        *(undefined8 *)(lVar4 + 0x20 + (longlong)pvVar6) = *(undefined8 *)((longlong)pvVar5 + 0x20);

+        *(undefined4 *)(lVar4 + 0x50 + (longlong)pvVar6) =

+             *(undefined4 *)(param_1 + uVar11 * 0x90 + 0x50);

+        *(undefined8 *)(lVar4 + 0x60 + (longlong)pvVar6) =

+             *(undefined8 *)(param_1 + uVar11 * 0x90 + 0x60);

+        uVar1 = *(undefined2 *)(param_1 + uVar11 * 0x90 + 0x14);

+        *(undefined4 *)(lVar4 + 0x14 + (longlong)pvVar6) = 0;

+        *(undefined2 *)(lVar4 + 8 + (longlong)pvVar6) = uVar1;

+        uVar11 = (ulonglong)uVar10;

+      } while (uVar10 < *(uint *)param_1);

+    }

+    if ((DAT_3 != 0) &&

+       ((*(code *)DAT_3)(pvVar5,&local_40,Win32FreePool), DAT_3 != 0)) {

+      (*(code *)DAT_3)(pvVar6,&local_58,Win32FreePool);

+    }

+    pRVar7 = (RIMDEV *)HMValidateHandleNoSecure(TouchExtensibility::hDeviceUser);

+    InputTraceLogging::RIM::InjectInput(pRVar7,0,1);

+    lVar4 = SGDGetUserSessionState();

+    CTouchProcessor::ProcessInjectedInput

+              (*(CTouchProcessor **)(lVar4 + 0xd48),TouchExtensibility::ghInjectionDevice,pvVar5,

+               *(uint *)(param_1 + 4) != 0,*(ulong *)(param_1 + 0xc),*(uint *)(param_1 + 8) != 0);

+    uVar8 = 1;

+    if ((DAT_4 != 0) && ((*(code *)DAT_4)(&local_58), DAT_4 != 0)) {

+      (*(code *)DAT_4)(&local_40);

+    }

+  }

+LAB_2:

+  uVar9 = uVar8;

+  NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,pvVar5);

+LAB_1:

+  if (pvVar6 != (void *)0x0) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,pvVar6);

+  }

+  return uVar9;

 }
```

## `NtUserQueryDisplayConfig`  (modified)

```diff
--- NtUserQueryDisplayConfig
+++ NtUserQueryDisplayConfig
@@ -1,10 +1,113 @@
 

-/* WARNING: Control flow encountered bad instruction data */

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

 

-void NtUserQueryDisplayConfig(void)

+void NtUserQueryDisplayConfig

+               (uint param_1,uint *param_2,CLeakTrackingAllocator *param_3,undefined4 *param_4,

+               undefined8 *param_5)

 

 {

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+  uint uVar1;

+  int iVar2;

+  longlong lVar3;

+  void *_Src;

+  CLeakTrackingAllocator *this;

+  uint *puVar4;

+  __uint64 _Var5;

+  uint local_98;

+  int local_94;

+  undefined4 local_90 [2];

+  void *local_88;

+  undefined8 local_70;

+  undefined4 local_68;

+  undefined8 local_58;

+  undefined8 uStack_50;

+  undefined8 local_48;

+  

+                    /* 0x3bee0  1700  NtUserQueryDisplayConfig */

+  local_88 = (void *)0x0;

+  local_58 = 0;

+  uStack_50 = 0;

+  local_48 = 0;

+  local_98 = 0;

+  local_90[0] = 0xffffffff;

+  local_70 = 0;

+  local_68 = 0;

+  PrivateAPI::`anonymous_namespace'::EnterSharedCritInternal();

+  if (gbVideoInitialized == 0) {

+    FUN_1c003c161();

+    return;

+  }

+  if ((((param_1 & 0xffffff88) != 0) || (((param_1 & 7) - 1 & 0xfffffffc) != 0)) ||

+     ((param_1 & 7) == 3)) {

+    FUN_1c003c161();

+    return;

+  }

+  PtiCurrentShared();

+  puVar4 = param_2;

+  if (*(uint **)MmUserProbeAddress_exref <= param_2) {

+    puVar4 = *(uint **)MmUserProbeAddress_exref;

+  }

+  *puVar4 = *puVar4;

+  local_98 = *param_2;

+  if (local_98 == 0) {

+    local_94 = 0xc000000d;

+    FUN_1c003c161();

+    return;

+  }

+  lVar3 = PsGetCurrentProcessWow64Process();

+  _Var5 = (ulonglong)local_98 * 0xd8;

+  this = param_3;

+  ProbeForWrite(param_3,_Var5,(-(uint)(lVar3 != 0) & 0xfffffffd) + 4);

+  _Src = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                   (this,_Var5,(ulonglong)local_98 * 0xd8,0x63447355);

+  local_88 = _Src;

+  if (_Src == (void *)0x0) {

+                    /* WARNING: Subroutine does not return */

+    ExRaiseStatus(0xc0000017);

+  }

+  if (DAT_0 != 0) {

+    (*(code *)DAT_0)(_Src,&local_58,Win32FreePool);

+  }

+  if ((param_1 & 4) == 0) {

+    if (param_4 != (undefined4 *)0x0) {

+      local_94 = 0xc000000d;

+      FUN_1c003c161();

+      return;

+    }

+  }

+  else {

+    ProbeForWrite(param_4,4,4);

+  }

+  if (param_5 != (undefined8 *)0x0) {

+    lVar3 = PsGetCurrentProcessWow64Process();

+    ProbeForWrite(param_5,0xc,(-(uint)(lVar3 != 0) & 0xfffffffd) + 4);

+  }

+  iVar2 = UserIsWddmConnectedSession();

+  if (iVar2 != 0) {

+    if (param_5 != (undefined8 *)0x0) {

+      DrvSampleDisplayState(&local_70);

+    }

+    local_94 = DrvQueryDisplayConfig(param_1,&local_98,_Src,local_90);

+    if (local_94 == -0x7ffffffb) {

+      local_94 = -0x3fffffdd;

+    }

+    else if (local_94 != -0x3fffffdd) {

+      local_94 = _QdcSdcTranslateStatusDefault(local_94);

+    }

+    uVar1 = local_98;

+    memcpy(param_3,_Src,(ulonglong)local_98 * 0xd8);

+    *param_2 = uVar1;

+    if ((param_1 & 4) != 0) {

+      *param_4 = local_90[0];

+    }

+    if (param_5 != (undefined8 *)0x0) {

+      *param_5 = local_70;

+      *(undefined4 *)(param_5 + 1) = local_68;

+    }

+    FUN_1c003c161();

+    return;

+  }

+  FUN_1c003c161();

+  return;

 }
```

## `SetHandleFlag`  (modified)

```diff
--- SetHandleFlag
+++ SetHandleFlag
@@ -1,166 +1,51 @@
 

-void SetHandleFlag(undefined8 param_1,ulonglong param_2,longlong param_3,uint param_4)

+undefined8 SetHandleFlag(uint param_1,__uint64 param_2,int param_3)

 

 {

-  GdiHandleManager *pGVar1;

-  GdiHandleManager *pGVar2;

-  undefined8 uVar3;

+  uint *puVar1;

+  uint uVar2;

+  longlong *plVar3;

+  void *_Dst;

+  CLeakTrackingAllocator *this;

   uint uVar4;

-  longlong in_RAX;

-  longlong lVar5;

-  ReferenceTrackerCountedType RVar6;

-  uint uVar7;

-  uint uVar8;

-  uint *puVar9;

-  void *pvVar10;

-  _VIS_REGION_SELECT _Var11;

-  uint *unaff_RBX;

-  longlong unaff_RBP;

-  uint *unaff_RSI;

-  longlong *plVar12;

-  _VIS_REGION_SELECT unaff_R13D;

-  undefined8 *unaff_R14;

+  undefined8 uVar5;

   

-  if ((uint)in_RAX < (*(int *)(in_RAX + 0x808) + 0xffff) * 0x10000 + param_4) {

-    uVar8 = (uint)param_2;

-    if (uVar8 < param_4) {

-      lVar5 = *(longlong *)(param_3 + 8);

+                    /* 0x1ab90  1889  SetHandleFlag */

+  uVar5 = 1;

+  uVar2 = (int)param_2 + (param_1 >> 2) * 3;

+  this = gpHandleFlagsMutex;

+  ExEnterCriticalRegionAndAcquireFastMutexUnsafe();

+  plVar3 = (longlong *)PsGetCurrentProcessWin32Process();

+  if ((plVar3 != (longlong *)0x0) && (*plVar3 != 0)) {

+    puVar1 = (uint *)(plVar3 + 0x59);

+    if (param_3 == 0) {

+      if (uVar2 < *puVar1) {

+        RtlClearBits(puVar1,uVar2,1);

+      }

     }

     else {

-      uVar4 = (uVar8 - param_4 >> 0x10) + 1;

-      lVar5 = *(longlong *)(param_3 + 8 + (ulonglong)uVar4 * 8);

-      param_2 = (ulonglong)(uVar8 + ((unaff_R13D - uVar4) * 0x10000 - param_4));

-    }

-    if ((uint)param_2 < *(uint *)(lVar5 + 0x14)) {

-      unaff_R14 = *(undefined8 **)

-                   (*(longlong *)(**(longlong **)(lVar5 + 0x18) + (param_2 >> 8) * 8) + 8 +

-                   (param_2 & 0xff) * 0x10);

+      if (*puVar1 <= uVar2) {

+        uVar4 = uVar2 + 0x20 & 0xffffffe0;

+        _Dst = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this,param_2,(ulonglong)(uVar4 >> 3),0x69707355);

+        if (_Dst == (void *)0x0) {

+          uVar5 = 0;

+          goto LAB_0;

+        }

+        if ((void *)plVar3[0x5a] != (void *)0x0) {

+          memcpy(_Dst,(void *)plVar3[0x5a],(ulonglong)(*puVar1 >> 3));

+          if ((void *)plVar3[0x5a] != (void *)0x0) {

+            NSInstrumentation::CLeakTrackingAllocator::Free

+                      (gpLeakTrackingAllocator,(void *)plVar3[0x5a]);

+          }

+        }

+        RtlInitializeBitMap(puVar1,_Dst,uVar4);

+      }

+      RtlSetBits(puVar1,uVar2,1);

     }

   }

-  *(int *)(unaff_R14 + 1) = *(int *)(unaff_R14 + 1) + 1;

-  lVar5 = SGDGetSessionState();

-  pGVar1 = *(GdiHandleManager **)(*(longlong *)(lVar5 + 0x18) + 0x1f48);

-  lVar5 = SGDGetSessionState();

-  pGVar2 = *(GdiHandleManager **)(*(longlong *)(lVar5 + 0x18) + 0x1f48);

-  uVar4 = GdiHandleManager::DecodeIndex(pGVar2,*unaff_RSI & 0xffffff);

-  lVar5 = *(longlong *)(pGVar2 + 0x10);

-  uVar8 = *(uint *)(lVar5 + 0x808);

-  puVar9 = unaff_RBX;

-  if (uVar4 < (*(ushort *)(lVar5 + 2) + 0xffff) * 0x10000 + uVar8) {

-    if (uVar4 < uVar8) {

-      lVar5 = *(longlong *)(lVar5 + 8);

-    }

-    else {

-      uVar7 = (uVar4 - uVar8 >> 0x10) + 1;

-      lVar5 = *(longlong *)(lVar5 + 8 + (ulonglong)uVar7 * 8);

-      uVar4 = uVar4 + ((unaff_R13D - uVar7) * 0x10000 - uVar8);

-    }

-    if (uVar4 < *(uint *)(lVar5 + 0x14)) {

-      puVar9 = *(uint **)(*(longlong *)(**(longlong **)(lVar5 + 0x18) + (ulonglong)(uVar4 >> 8) * 8)

-                          + 8 + ((ulonglong)uVar4 & 0xff) * 0x10);

-    }

-  }

-  uVar4 = GdiHandleManager::DecodeIndex(pGVar1,*puVar9 >> 8 & 0xff0000 | *puVar9 & 0xffff);

-  lVar5 = *(longlong *)(pGVar1 + 0x10);

-  uVar8 = *(uint *)(lVar5 + 0x808);

-  if (uVar4 < (*(ushort *)(lVar5 + 2) + 0xffff) * 0x10000 + uVar8) {

-    if (uVar4 < uVar8) {

-      plVar12 = *(longlong **)(lVar5 + 8);

-    }

-    else {

-      uVar7 = (uVar4 - uVar8 >> 0x10) + 1;

-      plVar12 = *(longlong **)(lVar5 + 8 + (ulonglong)uVar7 * 8);

-      uVar4 = uVar4 + ((unaff_R13D - uVar7) * 0x10000 - uVar8);

-    }

-    puVar9 = (uint *)(*plVar12 + 8 + (ulonglong)uVar4 * 0x18);

-    *puVar9 = *puVar9 & 0xfffffffe;

-    ExReleasePushLockExclusiveEx

-              (((ulonglong)uVar4 & 0xff) * 0x10 +

-               *(longlong *)(*(longlong *)plVar12[3] + (ulonglong)(uVar4 >> 8) * 8),0);

-    KeLeaveCriticalRegion();

-  }

-  _Var11 = (_VIS_REGION_SELECT)unaff_RBX;

-  *(_VIS_REGION_SELECT *)(unaff_RBP + -0x39) = _Var11;

-  *(uint **)(unaff_RBP + -0x41) = unaff_RBX;

-  KeLeaveCriticalRegion();

-  if (_Var11 != 0) {

-    HANDLELOCK::vUnlock((HANDLELOCK *)(unaff_RBP + -0x41));

-  }

-  *(undefined8 **)(unaff_RBP + -0x11) = unaff_R14;

-  GreSelectVisRgnInternal((DCOBJA *)(unaff_RBP + -0x11),*(HRGN__ **)(unaff_RBP + 0x67),unaff_R13D);

-  if (unaff_R14 == (undefined8 *)0x0) {

-    return;

-  }

-  uVar3 = *unaff_R14;

-  *(uint **)(unaff_RBP + -1) = unaff_RBX;

-  *(_VIS_REGION_SELECT *)(unaff_RBP + 7) = _Var11;

-  HANDLELOCK::vLockHandle

-            ((HANDLELOCK *)(unaff_RBP + -1),

-             (uint)((ulonglong)uVar3 >> 8) & 0xff0000 | (uint)uVar3 & 0xffff,0,0,unaff_R13D);

-  if (*(_VIS_REGION_SELECT *)(unaff_RBP + 7) == _Var11) {

-    return;

-  }

-  puVar9 = *(uint **)(unaff_RBP + -1);

-  if ((*(byte *)((longlong)puVar9 + 0xf) & 8) != 0) {

-    _Var11 = unaff_R13D;

-  }

-  if (*(char *)((longlong)puVar9 + 0xe) == '\x05') {

-    pvVar10 = (void *)unaff_R14[0x55];

-    RVar6 = 0;

-  }

-  else {

-    if (*(char *)((longlong)puVar9 + 0xe) != '\x10') goto LAB_0;

-    pvVar10 = (void *)unaff_R14[0x11];

-    RVar6 = 2;

-  }

-  TrackObjectReferenceDecrement(RVar6,pvVar10);

 LAB_0:

-  *(int *)(unaff_R14 + 1) = *(int *)(unaff_R14 + 1) + -1;

-  lVar5 = SGDGetSessionState();

-  pGVar1 = *(GdiHandleManager **)(*(longlong *)(lVar5 + 0x18) + 0x1f48);

-  lVar5 = SGDGetSessionState();

-  pGVar2 = *(GdiHandleManager **)(*(longlong *)(lVar5 + 0x18) + 0x1f48);

-  uVar4 = GdiHandleManager::DecodeIndex(pGVar2,*puVar9 & 0xffffff);

-  lVar5 = *(longlong *)(pGVar2 + 0x10);

-  uVar8 = *(uint *)(lVar5 + 0x808);

-  if (uVar4 < (*(ushort *)(lVar5 + 2) + 0xffff) * 0x10000 + uVar8) {

-    if (uVar4 < uVar8) {

-      lVar5 = *(longlong *)(lVar5 + 8);

-    }

-    else {

-      uVar7 = (uVar4 - uVar8 >> 0x10) + 1;

-      lVar5 = *(longlong *)(lVar5 + 8 + (ulonglong)uVar7 * 8);

-      uVar4 = uVar4 + ((unaff_R13D - uVar7) * 0x10000 - uVar8);

-    }

-    if (uVar4 < *(uint *)(lVar5 + 0x14)) {

-      unaff_RBX = *(uint **)(*(longlong *)

-                              (**(longlong **)(lVar5 + 0x18) + (ulonglong)(uVar4 >> 8) * 8) + 8 +

-                            ((ulonglong)uVar4 & 0xff) * 0x10);

-    }

-  }

-  uVar4 = GdiHandleManager::DecodeIndex(pGVar1,*unaff_RBX >> 8 & 0xff0000 | *unaff_RBX & 0xffff);

-  lVar5 = *(longlong *)(pGVar1 + 0x10);

-  uVar8 = *(uint *)(lVar5 + 0x808);

-  if (uVar4 < (*(ushort *)(lVar5 + 2) + 0xffff) * 0x10000 + uVar8) {

-    if (uVar4 < uVar8) {

-      plVar12 = *(longlong **)(lVar5 + 8);

-    }

-    else {

-      uVar7 = (uVar4 - uVar8 >> 0x10) + 1;

-      plVar12 = *(longlong **)(lVar5 + 8 + (ulonglong)uVar7 * 8);

-      uVar4 = uVar4 + ((unaff_R13D - uVar7) * 0x10000 - uVar8);

-    }

-    puVar9 = (uint *)(*plVar12 + 8 + (ulonglong)uVar4 * 0x18);

-    *puVar9 = *puVar9 & 0xfffffffe;

-    ExReleasePushLockExclusiveEx

-              ((ulonglong)(uVar4 & 0xff) * 0x10 +

-               *(longlong *)(*(longlong *)plVar12[3] + (ulonglong)(uVar4 >> 8) * 8),0);

-    KeLeaveCriticalRegion();

-  }

-  KeLeaveCriticalRegion();

-  if (_Var11 != 0) {

-    GrepDeleteDC(uVar3,0x2000000);

-  }

-  return;

+  ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(gpHandleFlagsMutex);

+  return uVar5;

 }
```

## `UserAllocDefaultCompositionSecurityDescriptor`  (modified)

```diff
--- UserAllocDefaultCompositionSecurityDescriptor
+++ UserAllocDefaultCompositionSecurityDescriptor
@@ -1,91 +1,302 @@
 

-longlong UserAllocDefaultCompositionSecurityDescriptor

-                   (longlong param_1,undefined8 param_2,char param_3,undefined8 param_4,

-                   undefined8 param_5,void *param_6)

+long UserAllocDefaultCompositionSecurityDescriptor(int param_1,longlong *param_2)

 

 {

-  undefined8 *puVar1;

-  undefined8 *puVar2;

-  code *pcVar3;

-  longlong lVar4;

-  longlong *in_RAX;

-  void *pvVar5;

-  longlong *plVar6;

-  longlong lVar7;

-  int iVar8;

-  longlong *plVar9;

-  void *unaff_RBX;

-  longlong unaff_RBP;

-  ulonglong uVar10;

+  int iVar1;

+  bool bVar2;

+  bool bVar3;

+  long lVar4;

+  int iVar5;

+  undefined8 *puVar6;

+  undefined8 *puVar7;

+  undefined8 *puVar8;

+  longlong lVar9;

+  CLeakTrackingAllocator *pCVar10;

+  undefined4 uVar11;

+  __uint64 _Var12;

+  ulonglong uVar13;

+  undefined8 uVar14;

+  ulonglong uVar15;

+  uint uVar16;

+  uint local_res18 [2];

+  uint local_res20 [2];

+  uint local_1f8 [2];

+  CLeakTrackingAllocator *local_1f0;

+  undefined4 local_1e8 [2];

+  int local_1e0 [2];

+  undefined4 local_1d8 [2];

+  __uint64 local_1d0;

+  void *local_1c8;

+  undefined4 local_1c0;

+  undefined4 local_1bc;

+  __uint64 local_1b8;

+  void *local_1b0;

+  ulonglong local_1a8;

+  ulonglong local_1a0;

+  ulonglong local_198;

+  ulonglong local_190;

+  ulonglong *local_188;

+  undefined4 *local_180;

+  CBackTrace local_178 [160];

+  CBackTrace local_d8 [160];

   

-  *(char *)in_RAX = (char)*in_RAX + param_3;

-  uVar10 = 0;

-  if (in_RAX != (longlong *)0x0) {

-    param_1 = -*in_RAX;

-    uVar10 = (ulonglong)in_RAX & -(ulonglong)(*in_RAX != 0);

-  }

-  GreAcquireHmgrSemaphore(param_1);

-  if ((*(void **)(uVar10 + 0x30) == unaff_RBX) &&

-     (param_6 = unaff_RBX, pvVar5 = HmgAllocateSecureUserMemory((void **)&stack0x00000030),

-     pvVar5 != (void *)0x0)) {

-    plVar6 = NSInstrumentation::CLeakTrackingAllocator::Allocate

-                       (gpLeakTrackingAllocator,0x104,0x568,0x66616247);

-    if (plVar6 == (longlong *)0x0) {

-      HmgFreeAllocateSecureUserMemory(pvVar5,param_6);

-      GreReleaseHmgrSemaphore();

-      return 0;

-    }

-    plVar9 = (longlong *)(uVar10 + 0xd0);

-    lVar7 = *plVar9;

-    if (*(longlong **)(lVar7 + 8) != plVar9) goto LAB_0;

-    *plVar6 = lVar7;

-    plVar6[1] = (longlong)plVar9;

-    *(longlong **)(lVar7 + 8) = plVar6;

-    lVar7 = 0xaa;

-    *plVar9 = (longlong)plVar6;

-    plVar9 = plVar6 + 3;

-    *(undefined4 *)(plVar6 + 2) = 0xaa;

-    *(longlong *)(uVar10 + 0x30) = (longlong)pvVar5 + 0xfd8;

-    do {

-      *plVar9 = (longlong)pvVar5;

-      pvVar5 = (void *)((longlong)pvVar5 + 0x18);

-      plVar9 = plVar9 + 1;

-      lVar7 = lVar7 + -1;

-    } while (lVar7 != 0);

-  }

-  lVar7 = *(longlong *)(uVar10 + 0x30);

-  if (lVar7 != 0) {

-    puVar1 = (undefined8 *)(uVar10 + 0xd0);

-    plVar6 = (longlong *)*puVar1;

-    lVar4 = plVar6[2];

-    iVar8 = (int)lVar4 + -1;

-    *(int *)(plVar6 + 2) = iVar8;

-    unaff_RBP = lVar7;

-    if (iVar8 == 0) {

-      lVar7 = *plVar6;

-      if ((*(longlong **)(lVar7 + 8) != plVar6) ||

-         (plVar9 = (longlong *)plVar6[1], (longlong *)*plVar9 != plVar6)) {

+                    /* 0x5c940  1940  UserAllocDefaultCompositionSecurityDescriptor */

+  puVar7 = (undefined8 *)0x0;

+  local_1c8 = (void *)0x0;

+  bVar2 = false;

+  local_1b0 = (void *)0x0;

+  local_1f0 = (CLeakTrackingAllocator *)0x0;

+  *param_2 = 0;

+  lVar4 = AllocateLocalSystemSid(&local_1c8);

+  if (lVar4 < 0) goto LAB_0;

+  iVar5 = RtlLengthSid(local_1c8);

+  pCVar10 = gpLeakTrackingAllocator;

+  local_1e8[0] = 0x65737355;

+  local_1a0 = 0x104;

+  uVar14 = 0x105;

+  uVar16 = iVar5 + 8;

+  uVar13 = (ulonglong)uVar16;

+  iVar1 = *(int *)gpLeakTrackingAllocator;

+  puVar8 = puVar7;

+  local_198 = uVar13;

+  if (iVar1 == 0) {

+    puVar6 = (undefined8 *)ExAllocatePool2(0x105,uVar13,0x65737355);

+    if (puVar6 != (undefined8 *)0x0) {

+      LOCK();

+      *(longlong *)(pCVar10 + 0x70) = *(longlong *)(pCVar10 + 0x70) + 1;

+      UNLOCK();

+    }

+LAB_1:

+    if (puVar6 != (undefined8 *)0x0) {

+LAB_2:

+      *(undefined2 *)puVar6 = 0;

+      *(short *)((longlong)puVar6 + 2) = (short)uVar16;

+      *(undefined4 *)((longlong)puVar6 + 4) = 0x10000000;

+      local_res18[0] = uVar16;

+      RtlCopySid(iVar5,puVar6 + 1,local_1c8);

+      lVar4 = AllocateWindowManagerSid(&local_1b0);

+      puVar7 = puVar6;

+      if (lVar4 < 0) goto LAB_0;

+      puVar7 = (undefined8 *)AllocAce(puVar6,0,0,3,local_1b0,local_res18);

+      puVar8 = puVar6;

+      if (puVar7 != (undefined8 *)0x0) {

+        if (param_1 != 0) {

+          local_1e0[0] = 0;

+          lVar4 = ZwOpenProcessTokenEx(0xffffffffffffffff,8,0x200,&local_1f0);

+          if (lVar4 < 0) goto LAB_0;

+          local_1c0 = 0;

+          ZwQueryInformationToken(local_1f0,0x1d,local_1e0,4,&local_1c0);

+          if (local_1e0[0] != 0) {

+            local_res20[0] = 0;

+            _Var12 = 0x1f;

+            pCVar10 = local_1f0;

+            ZwQueryInformationToken(local_1f0,0x1f,0,0,local_res20);

+            puVar8 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               (pCVar10,_Var12,(ulonglong)local_res20[0],0x65737355);

+            if (puVar8 == (undefined8 *)0x0) {

+              lVar4 = -0x3fffffe9;

+              goto LAB_0;

+            }

+            local_1bc = 0;

+            lVar4 = ZwQueryInformationToken(local_1f0,0x1f,puVar8,local_res20[0],&local_1bc);

+            puVar6 = puVar7;

+            if ((-1 < lVar4) &&

+               (puVar6 = (undefined8 *)AllocAce(puVar7,0,0,param_1,*puVar8,local_res18),

+               puVar6 == (undefined8 *)0x0)) {

+              lVar4 = -0x3fffffe9;

+              puVar6 = puVar7;

+            }

+            NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar8);

+            puVar7 = puVar6;

+            if (lVar4 < 0) goto LAB_0;

+          }

+          local_1f8[0] = 0;

+          lVar4 = ZwQueryInformationToken(local_1f0,1,0,0,local_1f8);

+          uVar16 = local_1f8[0];

+          pCVar10 = gpLeakTrackingAllocator;

+          uVar15 = 0x65737355;

+          uVar13 = (ulonglong)local_1f8[0];

+          local_1d8[0] = 0x65737355;

+          local_190 = 0x104;

+          iVar1 = *(int *)gpLeakTrackingAllocator;

+          local_1a8 = uVar13;

+          if (iVar1 == 0) {

+            puVar8 = (undefined8 *)ExAllocatePool2(0x105,uVar13,0x65737355);

+            if (puVar8 != (undefined8 *)0x0) {

+              LOCK();

+              *(longlong *)(pCVar10 + 0x70) = *(longlong *)(pCVar10 + 0x70) + 1;

+              UNLOCK();

+            }

+LAB_3:

+            if (puVar8 != (undefined8 *)0x0) {

+LAB_4:

+              local_1d0 = local_1d0 & 0xffffffff00000000;

+              lVar4 = ZwQueryInformationToken(local_1f0,1,puVar8,local_1f8[0],&local_1d0);

+              puVar6 = puVar7;

+              if ((-1 < lVar4) &&

+                 (puVar6 = (undefined8 *)AllocAce(puVar7,0,0,param_1,*puVar8,local_res18),

+                 puVar6 == (undefined8 *)0x0)) {

+                lVar4 = -0x3fffffe9;

+                puVar6 = puVar7;

+              }

+              NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar8);

+              puVar7 = puVar6;

+            }

+          }

+          else if (iVar1 == 1) {

+            bVar2 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                              (gpLeakTrackingAllocator,0x65737355);

+            if ((bVar2) && (uVar13 < uVar13 + 0x10)) {

+              puVar8 = (undefined8 *)

+                       ExAllocatePool2(local_190 & 0xfffffffffffffffd | 1,uVar13 + 0x10,local_1d8[0]

+                                      );

+              if (puVar8 != (undefined8 *)0x0) {

+                LOCK();

+                *(longlong *)(pCVar10 + 0x70) = *(longlong *)(pCVar10 + 0x70) + 1;

+                UNLOCK();

+                *puVar8 = 0x65737355;

+                puVar8 = puVar8 + 2;

+                if (puVar8 != (undefined8 *)0x0) goto LAB_3;

+              }

+              NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

+                        (*(CPointerHashTable **)(pCVar10 + 8),(void *)0x65737355);

+              goto LAB_3;

+            }

+          }

+          else if (iVar1 == 2) {

+            local_1b8 = 0;

+            bVar3 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                              (gpLeakTrackingAllocator,0x65737355,&local_1b8);

+            if (!bVar3) {

+              local_188 = &local_190;

+              local_180 = local_1d8;

+              puVar8 = (undefined8 *)

+                       NSInstrumentation::CLeakTrackingAllocator::

+                       MakeUntrackedAllocation<<lambda_a6c9ad8a3ccccec93018e691c2ba1200>,unsigned___int64_&>

+                                 (pCVar10,&local_188,&local_1a8);

+              goto LAB_3;

+            }

+            if ((uVar13 < 0x1000) || ((uVar16 & 0xfff) != 0)) {

+              uVar13 = uVar13 + 0x10;

+              bVar2 = true;

+              local_1a8 = uVar13;

+            }

+            puVar8 = (undefined8 *)ExAllocatePool2(0x105,uVar13,uVar15 & 0xffffffff);

+            if (puVar8 == (undefined8 *)0x0) goto LAB_5;

+            LOCK();

+            *(longlong *)(pCVar10 + 0x80) = *(longlong *)(pCVar10 + 0x80) + 1;

+            UNLOCK();

+            NSInstrumentation::CBackTrace::CBackTrace(local_d8);

+            if ((bVar2) && (((uint)puVar8 & 0xfff) + 0x10 < 0x1000)) {

+              bVar2 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

+                                (pCVar10,puVar8,local_1b8,local_d8);

+              if (bVar2) {

+                puVar8 = puVar8 + 2;

+                goto LAB_3;

+              }

+            }

+            else {

+              bVar2 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

+                                (pCVar10,puVar8,local_1b8,local_d8);

+              if (bVar2) goto LAB_4;

+            }

+            LOCK();

+            *(longlong *)(pCVar10 + 0x88) = *(longlong *)(pCVar10 + 0x88) + 1;

+            UNLOCK();

+            ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                      (puVar8);

+          }

+LAB_5:

+          if (lVar4 < 0) goto LAB_0;

+        }

+        lVar9 = CreateSecurityDescriptor(puVar7,local_res18[0],0);

+        if (lVar9 == 0) {

+          lVar4 = -0x3fffffe9;

+        }

+        *param_2 = lVar9;

+        goto LAB_0;

+      }

+    }

+  }

+  else if (iVar1 == 1) {

+    bVar3 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                      (gpLeakTrackingAllocator,0x65737355);

+    if ((bVar3) && (uVar13 < uVar13 + 0x10)) {

+      puVar6 = (undefined8 *)

+               ExAllocatePool2(local_1a0 & 0xfffffffffffffffd | 1,uVar13 + 0x10,local_1e8[0]);

+      if (puVar6 != (undefined8 *)0x0) {

+        LOCK();

+        *(longlong *)(pCVar10 + 0x70) = *(longlong *)(pCVar10 + 0x70) + 1;

+        UNLOCK();

+        *puVar6 = 0x65737355;

+        puVar6 = puVar6 + 2;

+        if (puVar6 != (undefined8 *)0x0) goto LAB_1;

+      }

+      NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

+                (*(CPointerHashTable **)(pCVar10 + 8),(void *)0x65737355);

+      goto LAB_1;

+    }

+  }

+  else if (iVar1 == 2) {

+    local_1d0 = 0;

+    uVar11 = 0x65737355;

+    bVar3 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                      (gpLeakTrackingAllocator,0x65737355,&local_1d0);

+    if (!bVar3) {

+      local_188 = &local_1a0;

+      local_180 = local_1e8;

+      puVar6 = (undefined8 *)

+               NSInstrumentation::CLeakTrackingAllocator::

+               MakeUntrackedAllocation<<lambda_a6c9ad8a3ccccec93018e691c2ba1200>,unsigned___int64_&>

+                         (pCVar10,&local_188,&local_198);

+      goto LAB_1;

+    }

+    bVar3 = false;

+    if ((uVar13 < 0x1000) || ((uVar16 & 0xfff) != 0)) {

+      uVar13 = uVar13 + 0x10;

+      bVar3 = true;

+      local_198 = uVar13;

+    }

+    puVar6 = (undefined8 *)ExAllocatePool2(uVar14,uVar13,uVar11);

+    if (puVar6 == (undefined8 *)0x0) goto LAB_6;

+    LOCK();

+    *(longlong *)(pCVar10 + 0x80) = *(longlong *)(pCVar10 + 0x80) + 1;

+    UNLOCK();

+    NSInstrumentation::CBackTrace::CBackTrace(local_178);

+    if ((bVar3) && (((uint)puVar6 & 0xfff) + 0x10 < 0x1000)) {

+      bVar3 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

+                        (pCVar10,puVar6,local_1d0,local_178);

+      if (bVar3) {

+        puVar6 = puVar6 + 2;

+        goto LAB_1;

+      }

+    }

+    else {

+      bVar3 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

+                        (pCVar10,puVar6,local_1d0,local_178);

+      if (bVar3) goto LAB_2;

+    }

+    LOCK();

+    *(longlong *)(pCVar10 + 0x88) = *(longlong *)(pCVar10 + 0x88) + 1;

+    UNLOCK();

+    ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z(puVar6);

+  }

+LAB_6:

+  puVar7 = puVar8;

+  lVar4 = -0x3fffffe9;

 LAB_0:

-        pcVar3 = (code *)swi(0x29);

-        (*pcVar3)(3);

-        pcVar3 = (code *)swi(3);

-        lVar7 = (*pcVar3)();

-        return lVar7;

-      }

-      *plVar9 = lVar7;

-      *(longlong **)(lVar7 + 8) = plVar9;

-      NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,plVar6);

-      puVar2 = (undefined8 *)*puVar1;

-      if (puVar2 != puVar1) {

-        unaff_RBX = (void *)puVar2[(ulonglong)(*(int *)(puVar2 + 2) - 1) + 3];

-      }

-      *(void **)(uVar10 + 0x30) = unaff_RBX;

-    }

-    else {

-      *(longlong *)(uVar10 + 0x30) = plVar6[(ulonglong)((int)lVar4 - 2) + 3];

-    }

-  }

-  GreReleaseHmgrSemaphore();

-  return unaff_RBP;

+  if (local_1f0 != (CLeakTrackingAllocator *)0x0) {

+    ZwClose();

+  }

+  if (local_1c8 != (void *)0x0) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,local_1c8);

+  }

+  if (local_1b0 != (void *)0x0) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,local_1b0);

+  }

+  if (puVar7 != (undefined8 *)0x0) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar7);

+  }

+  return lVar4;

 }
```

## `NtUserSetAdditionalForegroundBoostProcesses`  (modified)

```diff
--- NtUserSetAdditionalForegroundBoostProcesses
+++ NtUserSetAdditionalForegroundBoostProcesses
@@ -1,48 +1,120 @@
 

-/* WARNING: Instruction at (ram,0x0001c0009833) overlaps instruction at (ram,0x0001c0009832)

-    */

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

 

-undefined4 NtUserSetAdditionalForegroundBoostProcesses(CResourceMarshaler *param_1)

+longlong NtUserSetAdditionalForegroundBoostProcesses

+                   (CLeakTrackingAllocator *param_1,uint param_2,longlong param_3)

 

 {

-  longlong lVar1;

-  uint uVar2;

-  ulonglong unaff_RBX;

-  int unaff_EBP;

-  uint *unaff_RSI;

-  undefined4 unaff_EDI;

-  longlong unaff_R12;

-  uint unaff_R13D;

-  longlong unaff_R14;

-  longlong unaff_R15;

-  bool in_OF;

-  uint in_stack_00000070;

-  undefined1 *in_stack_00000078;

+  bool bVar1;

+  int iVar2;

+  tagWND *ptVar3;

+  longlong *plVar4;

+  tagWND *ptVar5;

+  _EPROCESS **pp_Var6;

+  longlong lVar7;

+  undefined8 uVar8;

+  ulonglong uVar9;

+  __uint64 _Var10;

+  uint uVar11;

+  undefined1 auStack_198 [32];

+  undefined8 *local_178;

+  undefined8 local_170;

+  AtomicExecutionCheck local_168 [8];

+  undefined8 local_160;

+  uint local_158;

+  undefined8 local_140;

+  undefined8 local_128 [32];

+  ulonglong local_28;

   

-  if (in_OF) {

-    func_0x0001c000987c();

-    *(uint *)(unaff_R14 + 0x10) = *(uint *)(unaff_R14 + 0x10) | unaff_R13D;

-    lVar1 = 0x48;

-    if (unaff_EBP != 1) {

-      lVar1 = 0x58;

-    }

-    *(longlong *)(lVar1 + unaff_R14) = unaff_R15;

-    *unaff_RSI = in_stack_00000070;

-    *(uint *)(unaff_R12 + unaff_R14) = (uint)unaff_RBX;

-    *in_stack_00000078 = 1;

-    if ((uint)unaff_RBX < *unaff_RSI) goto LAB_0;

+                    /* 0x9930  1710  NtUserSetAdditionalForegroundBoostProcesses */

+  local_28 = __security_cookie ^ (ulonglong)auStack_198;

+  pp_Var6 = (_EPROCESS **)0x0;

+  local_140 = 0;

+  memset(local_128,0,0x100);

+  if (DAT_0 == 0) {

+    iVar2 = 0x32;

   }

   else {

-    while( true ) {

-      *(byte *)(unaff_RBX + 0xc8b49cb) = *(byte *)(unaff_RBX + 0xc8b49cb) | 0xcf;

-      DirectComposition::CResourceMarshaler::AddRef(param_1);

-      uVar2 = (int)unaff_RBX + 1;

-      unaff_RBX = (ulonglong)uVar2;

-      if (*unaff_RSI <= uVar2) break;

-LAB_0:

-      param_1 = *(CResourceMarshaler **)(unaff_R15 + (unaff_RBX & 0xffffffff) * 8);

+    iVar2 = (*(code *)DAT_0)();

+  }

+  if (iVar2 != 0) {

+    UserSetLastError(iVar2);

+    return 0;

+  }

+  local_160 = (_EPROCESS *)((ulonglong)local_160._4_4_ << 0x20);

+  PrivateAPI::`anonymous_namespace'::EnterSharedCritInternal();

+  AtomicExecutionCheck::AtomicExecutionCheck(local_168);

+  ptVar3 = (tagWND *)ValidateHwndEx(param_1,1);

+  if (ptVar3 == (tagWND *)0x0) {

+    uVar11 = 0;

+    goto LAB_1;

+  }

+  plVar4 = (longlong *)PsGetCurrentProcessWin32Process();

+  uVar9 = 0;

+  if (plVar4 != (longlong *)0x0) {

+    param_1 = (CLeakTrackingAllocator *)-(ulonglong)(*plVar4 != 0);

+    uVar9 = (ulonglong)plVar4 & (ulonglong)param_1;

+  }

+  if (*(ulonglong *)(*(longlong *)(ptVar3 + 0x10) + 0x1a8) == uVar9) {

+    ptVar5 = (tagWND *)0x0;

+    if (DAT_2 != 0) {

+      param_1 = (CLeakTrackingAllocator *)ptVar3;

+      ptVar5 = (tagWND *)(*(code *)DAT_2)();

     }

+    if ((ptVar5 != ptVar3) || (0x20 < param_2)) goto LAB_3;

+    if (param_2 == 0) {

+LAB_4:

+      bVar1 = GroupedProcessForegroundBoost::Update(ptVar3,param_2,pp_Var6);

+      uVar11 = (uint)bVar1;

+      if (!bVar1) {

+        lVar7 = FUN_1c011a507();

+        return lVar7;

+      }

+      goto LAB_5;

+    }

+    _Var10 = 0;

+    while (local_158 = (uint)_Var10, local_158 < param_2) {

+      local_128[_Var10] = *(undefined8 *)(param_3 + _Var10 * 8);

+      _Var10 = (__uint64)(local_158 + 1);

+    }

+    pp_Var6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                        (param_1,_Var10,(ulonglong)param_2 << 3,0x67667355);

+    if (pp_Var6 != (_EPROCESS **)0x0) {

+      for (uVar9 = 0; (uint)uVar9 < param_2; uVar9 = (ulonglong)((uint)uVar9 + 1)) {

+        local_160 = (_EPROCESS *)0x0;

+        local_170 = 0;

+        local_178 = &local_160;

+        iVar2 = ObReferenceObjectByHandle

+                          (local_128[uVar9],0x200,*(undefined8 *)PsProcessType_exref,1);

+        pp_Var6[uVar9] = local_160;

+        if (iVar2 < 0) goto LAB_6;

+      }

+      goto LAB_4;

+    }

+    uVar8 = 8;

   }

-  return unaff_EDI;

+  else {

+LAB_3:

+    uVar8 = 0x57;

+  }

+  uVar11 = 0;

+  UserSetLastError(uVar8);

+LAB_1:

+  AtomicExecutionCheck::Disarm(local_168);

+  UserSessionSwitchLeaveCrit();

+  return (longlong)(int)uVar11;

+LAB_6:

+  while ((int)uVar9 != 0) {

+    uVar9 = (ulonglong)((int)uVar9 - 1);

+    ObfDereferenceObject(pp_Var6[uVar9]);

+  }

+  uVar11 = 0;

+  UserSetLastError(0x57);

+LAB_5:

+  if (pp_Var6 != (_EPROCESS **)0x0) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,pp_Var6);

+  }

+  goto LAB_1;

 }
```

## `NtUserInjectKeyboardInput`  (modified)

```diff
--- NtUserInjectKeyboardInput
+++ NtUserInjectKeyboardInput
@@ -1,13 +1,357 @@
 

-/* WARNING: Control flow encountered bad instruction data */

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

 

-void NtUserInjectKeyboardInput(char param_1)

+longlong NtUserInjectKeyboardInput(CLeakTrackingAllocator *param_1,uint param_2)

 

 {

-  char *unaff_RDI;

+  __uint64 _Size;

+  bool bVar1;

+  char cVar2;

+  int iVar3;

+  uint uVar4;

+  undefined4 uVar5;

+  longlong *plVar6;

+  longlong lVar7;

+  longlong lVar8;

+  tagTHREADINFO *ptVar9;

+  CLeakTrackingAllocator *this;

+  undefined8 uVar10;

+  char *pcVar11;

+  int iVar12;

+  undefined2 uVar13;

+  ulonglong uVar14;

+  void *pvVar15;

+  ulonglong uVar16;

+  undefined1 auStack_d8 [32];

+  undefined8 local_b8;

+  undefined1 *local_b0;

+  undefined8 local_a8;

+  undefined *local_a0;

+  CLeakTrackingAllocator *local_98;

+  uint local_90;

+  EnterLeaveCritMitRitHandOffHazard local_88 [8];

+  void *local_80;

+  longlong local_78 [3];

+  ThreadLockedPerfRegion local_60 [16];

+  undefined1 auStack_50 [32];

+  ulonglong local_30;

   

-  *unaff_RDI = *unaff_RDI + param_1;

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+                    /* 0x4720  1690  NtUserInjectKeyboardInput */

+  local_30 = __security_cookie ^ (ulonglong)auStack_d8;

+  uVar14 = (ulonglong)param_2;

+  if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x100000) == 0)) ||

+     ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

+    cVar2 = '\0';

+  }

+  else {

+    cVar2 = '\x01';

+  }

+  lVar8 = 0;

+  if ((cVar2 != '\0') || ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

+    local_a0 = &WPP_7301d1d6eaf03b4137566f470f1e6436_Traceguids;

+    local_a8 = CONCAT62(local_a8._2_6_,0x2a);

+    local_b0 = (undefined1 *)CONCAT44(local_b0._4_4_,0x15);

+    local_b8 = CONCAT71(local_b8._1_7_,4);

+    local_98 = param_1;

+    local_90 = param_2;

+    WPP_RECORDER_AND_TRACE_SF_qd

+              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,

+               (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog);

+  }

+  pcVar11 = s_InjectKeyboardInput;

+  InputTraceLogging::ThreadLockedPerfRegion::ThreadLockedPerfRegion

+            (local_60,s_InjectKeyboardInput,(ThreadLockedPerfRegion *)0x0);

+  local_88[0] = (EnterLeaveCritMitRitHandOffHazard)0x0;

+  EnterLeaveCritMitRitHandOffHazard::Enter(local_88);

+  local_80 = (void *)0x0;

+  local_78[0] = 0;

+  plVar6 = (longlong *)PsGetCurrentProcessWin32Process();

+  uVar16 = 0;

+  if (plVar6 != (longlong *)0x0) {

+    uVar16 = (ulonglong)plVar6 & -(ulonglong)(*plVar6 != 0);

+  }

+  iVar12 = 0;

+  if (local_88[0] != (EnterLeaveCritMitRitHandOffHazard)0x0) {

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x100000) == 0)) ||

+       (cVar2 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 2)) {

+      cVar2 = '\0';

+    }

+    if ((cVar2 != '\0') || ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

+      local_a0 = &WPP_7301d1d6eaf03b4137566f470f1e6436_Traceguids;

+      local_a8 = CONCAT62(local_a8._2_6_,0x2b);

+      local_b0 = (undefined1 *)CONCAT44(local_b0._4_4_,0x15);

+      local_b8 = CONCAT71(local_b8._1_7_,2);

+      WPP_RECORDER_AND_TRACE_SF_

+                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,

+                 (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog);

+    }

+    UserSetLastError(5);

+    goto LAB_0;

+  }

+  if (param_2 - 1 < 0x10) {

+    _Size = uVar14 * 0x18;

+    this = (CLeakTrackingAllocator *)0x0;

+    if (uVar14 * 3 != 0) {

+      lVar7 = PsGetCurrentProcessWow64Process();

+      if (((ulonglong)param_1 & (ulonglong)(~-(uint)(lVar7 != 0) & 3)) != 0) {

+                    /* WARNING: Subroutine does not return */

+        ExRaiseDatatypeMisalignment();

+      }

+      this = param_1 + _Size;

+      pcVar11 = *(char **)MmUserProbeAddress_exref;

+      if ((pcVar11 < this) || (this < param_1)) {

+        *pcVar11 = '\0';

+      }

+    }

+    local_80 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this,(__uint64)pcVar11,_Size,0x6b697355);

+    if (local_80 == (void *)0x0) {

+                    /* WARNING: Subroutine does not return */

+      ExRaiseStatus(0xc0000017);

+    }

+    memcpy(local_80,param_1,_Size);

+    plVar6 = (longlong *)(uVar16 + 0x380);

+    if (*plVar6 == -1) {

+      iVar3 = RIMIDECheckCurrentProcessForInjectionCapability();

+      if (iVar3 == 0) {

+        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+            ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x100000) == 0)) ||

+           (cVar2 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 2)) {

+          cVar2 = '\0';

+        }

+        if ((cVar2 != '\0') ||

+           ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

+          local_a0 = &WPP_7301d1d6eaf03b4137566f470f1e6436_Traceguids;

+          local_a8 = CONCAT62(local_a8._2_6_,0x2e);

+          local_b0 = (undefined1 *)CONCAT44(local_b0._4_4_,0x15);

+          local_b8 = CONCAT71(local_b8._1_7_,2);

+          WPP_RECORDER_AND_TRACE_SF_

+                    (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,

+                     (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog);

+        }

+        UserSetLastError(5);

+        pvVar15 = local_80;

+        goto LAB_1;

+      }

+      iVar3 = RIMIDECreatePseudoMouseOrKeyboardDevice(1,plVar6);

+      if (iVar3 < 0) {

+        lVar8 = FUN_1c0117031();

+        return lVar8;

+      }

+    }

+    iVar3 = RawInputManagerDeviceObjectResolveHandle(*plVar6,3,1,local_78);

+    lVar8 = local_78[0];

+    if (iVar3 < 0) {

+      if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+          ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x100000) == 0)) ||

+         (cVar2 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 2)) {

+        cVar2 = '\0';

+      }

+      if ((cVar2 != '\0') || ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED))

+      {

+        local_98 = (CLeakTrackingAllocator *)CONCAT44(local_98._4_4_,iVar3);

+        local_a0 = &WPP_7301d1d6eaf03b4137566f470f1e6436_Traceguids;

+        local_a8 = CONCAT62(local_a8._2_6_,0x30);

+        local_b0 = (undefined1 *)CONCAT44(local_b0._4_4_,0x15);

+        local_b8 = CONCAT71(local_b8._1_7_,2);

+        WPP_RECORDER_AND_TRACE_SF_d

+                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,

+                   (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog);

+      }

+      uVar10 = 6;

+    }

+    else {

+      if ((*(uint *)(local_78[0] + 0x100) & 0x2000) == 0) {

+        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+            ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x100000) == 0)) ||

+           (cVar2 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 2)) {

+          cVar2 = '\0';

+        }

+        bVar1 = (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+        if ((cVar2 != '\0') || (bVar1)) {

+          uVar13 = 0x31;

+LAB_2:

+          local_a0 = &WPP_7301d1d6eaf03b4137566f470f1e6436_Traceguids;

+          local_a8 = CONCAT62(local_a8._2_6_,uVar13);

+          local_b0 = (undefined1 *)CONCAT44(local_b0._4_4_,0x15);

+          local_b8 = CONCAT71(local_b8._1_7_,2);

+          WPP_RECORDER_AND_TRACE_SF_

+                    (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,bVar1,gBaseLog);

+        }

+      }

+      else {

+        iVar3 = ApiSetEditionIsRIMInjectionBlocked(local_78[0] + 0x48);

+        pvVar15 = local_80;

+        if (iVar3 != 0) {

+          if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+              ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x100000) == 0)) ||

+             (cVar2 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 2)) {

+            cVar2 = '\0';

+          }

+          if ((cVar2 != '\0') ||

+             ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

+            local_a0 = &WPP_7301d1d6eaf03b4137566f470f1e6436_Traceguids;

+            local_a8 = CONCAT62(local_a8._2_6_,0x32);

+            local_b0 = (undefined1 *)CONCAT44(local_b0._4_4_,0x15);

+            local_b8 = CONCAT71(local_b8._1_7_,2);

+            WPP_RECORDER_AND_TRACE_SF_

+                      (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,

+                       (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog

+                      );

+          }

+          uVar10 = 5;

+          goto LAB_3;

+        }

+        if (*(char *)(lVar8 + 0x78) == '\x01') {

+          iVar3 = RIMIDEInjectKeyboardFromKeybdInputStruct(lVar8,local_80,uVar14);

+          if (iVar3 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x100000) == 0)) ||

+               (cVar2 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 2)) {

+              cVar2 = '\0';

+            }

+            if ((cVar2 != '\0') ||

+               ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

+              local_98 = (CLeakTrackingAllocator *)CONCAT44(local_98._4_4_,iVar3);

+              local_a0 = &WPP_7301d1d6eaf03b4137566f470f1e6436_Traceguids;

+              local_a8 = CONCAT62(local_a8._2_6_,0x34);

+              local_b0 = (undefined1 *)CONCAT44(local_b0._4_4_,0x15);

+              local_b8 = CONCAT71(local_b8._1_7_,2);

+              WPP_RECORDER_AND_TRACE_SF_d

+                        (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,

+                         (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,

+                         gBaseLog);

+            }

+            uVar5 = RtlNtStatusToDosError(iVar3);

+            UserSetLastError(uVar5);

+            lVar8 = local_78[0];

+          }

+          else {

+            iVar12 = 1;

+            lVar8 = local_78[0];

+          }

+          goto LAB_1;

+        }

+        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+            ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x100000) == 0)) ||

+           (cVar2 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 2)) {

+          cVar2 = '\0';

+        }

+        bVar1 = (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+        if ((cVar2 != '\0') || (bVar1)) {

+          uVar13 = 0x33;

+          goto LAB_2;

+        }

+      }

+      uVar10 = 0x57;

+    }

+LAB_3:

+    UserSetLastError(uVar10);

+    lVar8 = local_78[0];

+    pvVar15 = local_80;

+  }

+  else {

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x100000) == 0)) ||

+       (cVar2 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 2)) {

+      cVar2 = '\0';

+    }

+    if ((cVar2 != '\0') || ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

+      local_98 = (CLeakTrackingAllocator *)CONCAT44(local_98._4_4_,param_2);

+      local_a0 = &WPP_7301d1d6eaf03b4137566f470f1e6436_Traceguids;

+      local_a8 = CONCAT62(local_a8._2_6_,0x2c);

+      local_b0 = (undefined1 *)CONCAT44(local_b0._4_4_,0x15);

+      local_b8 = CONCAT71(local_b8._1_7_,2);

+      WPP_RECORDER_AND_TRACE_SF_d

+                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,

+                 (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog);

+    }

+    UserSetLastError(0x57);

+    pvVar15 = local_80;

+  }

+LAB_1:

+  if (lVar8 != 0) {

+    ObfDereferenceObject();

+  }

+  if (pvVar15 != (void *)0x0) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,pvVar15);

+  }

+  if (iVar12 == 0) {

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x100000) == 0)) ||

+       (cVar2 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 2)) {

+      cVar2 = '\0';

+    }

+    bVar1 = (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+    if ((cVar2 != '\0') || (bVar1)) {

+      uVar5 = UserGetLastError();

+      local_98 = (CLeakTrackingAllocator *)CONCAT44(local_98._4_4_,uVar5);

+      local_a0 = &WPP_7301d1d6eaf03b4137566f470f1e6436_Traceguids;

+      local_a8 = CONCAT62(local_a8._2_6_,0x35);

+      local_b0 = (undefined1 *)CONCAT44(local_b0._4_4_,0x15);

+      local_b8 = CONCAT71(local_b8._1_7_,2);

+      WPP_RECORDER_AND_TRACE_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,bVar1,gBaseLog);

+    }

+  }

+LAB_0:

+  if (DAT_4 != 0) {

+    (*(code *)DAT_4)();

+  }

+  bVar1 = IS_USERCRIT_OWNED_EXCLUSIVE();

+  if (bVar1) {

+    if (gcInHMDestroyUnlockedObjectWorker != 0) {

+      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+    }

+    if (gphePrimaryDestroyTarget != (_HANDLEENTRY *)0x0) {

+      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+    }

+    if (gcSecondaryDestroyTargets < gcDeferredDestroyTargets) {

+      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+    }

+    gcInHMDestroyUnlockedObjectWorker = 0;

+    gphePrimaryDestroyTarget = (_HANDLEENTRY *)0x0;

+    DestroyExclusiveUserCritDeferredUnlockList();

+  }

+  uVar4 = AtomicExecutionCheck::GetCount();

+  if (uVar4 != 0) {

+    if ((gdwExtraInstrumentations & 1) != 0) {

+      local_b8 = 0;

+                    /* WARNING: Subroutine does not return */

+      KeBugCheckEx(0x160,uVar4,0);

+    }

+    local_98 = (CLeakTrackingAllocator *)((ulonglong)local_98 & 0xffffffff00000000);

+    local_a0 = (undefined *)0x0;

+    local_a8 = 0;

+    local_b0 = (undefined1 *)0x0;

+    local_b8 = 0;

+    DbgkWerCaptureLiveKernelDump(L"NTUSER",400,0x25,0);

+  }

+  if ((gptiCurrent != 0) && (lVar8 = W32GetThreadWin32Thread(SystemReserved1[0xf]), lVar8 != 0)) {

+    ptVar9 = PtiCurrentShared();

+    *(undefined4 *)(ptVar9 + 0x5ec) = 0;

+  }

+  gptiCurrent = 0;

+  if ((InputTraceLogging::Perf::s_userCritLoggingEnabled != false) &&

+     (lVar8 = PsGetCurrentThreadWin32Thread(), lVar8 != 0)) {

+    uVar4 = *(uint *)(lVar8 + 0x2c);

+    if (((((uVar4 & 1) != 0) || (((uVar4 & 2) != 0 || (0 < *(int *)(lVar8 + 0x18))))) &&

+        (6 < DAT_5)) && (cVar2 = _tlgKeywordOn(&DAT_5,0x2000), cVar2 != '\0')) {

+      local_b0 = auStack_50;

+      local_b8 = CONCAT44(local_b8._4_4_,2);

+      _tlgWriteTransfer_EtwWriteTransfer(&DAT_5,&DAT_1c028f055,lVar8 + 0x1c,0);

+      uVar4 = *(uint *)(lVar8 + 0x2c);

+    }

+    *(uint *)(lVar8 + 0x2c) = uVar4 & 0xfffffffe;

+    *(undefined8 *)(lVar8 + 0x1c) = 0;

+    *(undefined8 *)(lVar8 + 0x24) = 0;

+  }

+  EtwTraceReleaseUserCrit();

+  lVar8 = SGDGetUserSessionState();

+  ExReleaseResourceAndLeaveCriticalRegion(*(undefined8 *)(lVar8 + 8));

+  InputTraceLogging::ThreadLockedPerfRegion::~ThreadLockedPerfRegion(local_60);

+  return (longlong)iVar12;

 }
```

## `NtSetShellCursorState`  (modified)

```diff
--- NtSetShellCursorState
+++ NtSetShellCursorState
@@ -1,84 +1,142 @@
 

-/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

-/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

-

-undefined4 NtSetShellCursorState(longlong param_1)

+int NtSetShellCursorState

+              (CLeakTrackingAllocator *param_1,CLeakTrackingAllocator *param_2,uint param_3)

 

 {

-  bool bVar1;

-  char cVar2;

-  uint uVar3;

-  longlong lVar4;

-  tagTHREADINFO *ptVar5;

-  undefined4 unaff_EDI;

-  uint uVar6;

-  _HANDLEENTRY *unaff_R14;

-  undefined8 in_stack_00000020;

-  _HANDLEENTRY *p_Var7;

-  undefined4 uVar8;

+  tagKERNELHANDLETABLEENTRY *ptVar1;

+  bool bVar2;

+  tagKERNELHANDLETABLEENTRY *ptVar3;

+  int iVar4;

+  undefined4 uVar5;

+  longlong *plVar6;

+  tagRECT *_Dst;

+  longlong lVar7;

+  wchar_t *this;

+  CCursorClip *this_00;

+  CLeakTrackingAllocator *pCVar8;

+  int iVar9;

+  ulonglong uVar10;

   

-  uVar8 = (undefined4)((ulonglong)in_stack_00000020 >> 0x20);

-  WPP_RECORDER_AND_TRACE_SF_D(*(undefined8 *)(param_1 + 0x18));

-  if (DAT_0 != 0) {

-    (*(code *)DAT_0)();

+                    /* 0x169630  1620  NtSetShellCursorState */

+  _Dst = (tagRECT *)0x0;

+  this = (wchar_t *)param_1;

+  pCVar8 = param_2;

+  if (gbOSTestSigningEnabled != '\0') goto LAB_0;

+  this = L"shellExperienceComposer";

+  iVar4 = CheckCapability();

+  if (iVar4 < 0) {

+LAB_1:

+    uVar5 = RtlNtStatusToDosError(iVar4);

   }

-  bVar1 = IS_USERCRIT_OWNED_EXCLUSIVE();

-  uVar6 = (uint)unaff_R14;

-  if (bVar1) {

-    if (uVar6 < gcInHMDestroyUnlockedObjectWorker) {

-      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+  else {

+    plVar6 = (longlong *)PsGetCurrentProcessWin32Process();

+    pCVar8 = (CLeakTrackingAllocator *)0x0;

+    if (plVar6 != (longlong *)0x0) {

+      this = (wchar_t *)-(ulonglong)(*plVar6 != 0);

+      pCVar8 = (CLeakTrackingAllocator *)((ulonglong)plVar6 & (ulonglong)this);

     }

-    if (gphePrimaryDestroyTarget != unaff_R14) {

-      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+    if ((*(uint *)(pCVar8 + 0x32c) & 0x30) == 0) {

+      plVar6 = (longlong *)PsGetCurrentProcessWin32Process();

+      this = (wchar_t *)0x0;

+      if (plVar6 != (longlong *)0x0) {

+        this = (wchar_t *)((ulonglong)plVar6 & -(ulonglong)(*plVar6 != 0));

+      }

+      pCVar8 = (CLeakTrackingAllocator *)this;

+      iVar4 = IsShellProcess();

+      if (iVar4 != 0) goto LAB_0;

+      uVar5 = 5;

     }

-    if (gcSecondaryDestroyTargets < gcDeferredDestroyTargets) {

-      MicrosoftTelemetryAssertTriggeredNoArgsKM();

-    }

-    gcInHMDestroyUnlockedObjectWorker = uVar6;

-    gphePrimaryDestroyTarget = unaff_R14;

-    DestroyExclusiveUserCritDeferredUnlockList();

-  }

-  uVar3 = AtomicExecutionCheck::GetCount();

-  if (uVar3 != 0) {

-    if ((gdwExtraInstrumentations & 1) != 0) {

+    else {

+LAB_0:

+      if ((int)param_1 - 1U < 4) {

+        if (param_3 == 0) {

+          if (param_2 == (CLeakTrackingAllocator *)0x0) {

+LAB_2:

+            this_00 = (CCursorClip *)0x0;

+            gptiCurrent = (CCursorClip *)PrivateAPI::`anonymous_namespace'::EnterCritInternal();

+            iVar9 = 1;

+            if (gptiCurrent != (CCursorClip *)0x0) {

+              *(undefined4 *)(gptiCurrent + 0x5ec) = 1;

+              plVar6 = (longlong *)PsGetCurrentProcessWin32Process();

+              if (plVar6 != (longlong *)0x0) {

+                this_00 = (CCursorClip *)-*plVar6;

+                uVar10 = (ulonglong)plVar6 & -(ulonglong)(*plVar6 != 0);

+                if ((uVar10 != 0) && ((*(uint *)(uVar10 + 0xc) & 0x8000) != 0)) {

+                  if (((*(uint *)(gptiCurrent + 0x1e8) & 0x1000000) == 0) ||

+                     ((char)*(undefined4 *)(gptiCurrent + 0x4f0) < '\0')) {

+                    bVar2 = false;

+                  }

+                  else {

+                    bVar2 = true;

+                  }

+                  this_00 = gptiCurrent;

+                  if (bVar2) {

+                    while (ptVar3 = gpSharedUserCritDeferredUnlockListHead,

+                          gpSharedUserCritDeferredUnlockListHead != (tagKERNELHANDLETABLEENTRY *)0x0

+                          ) {

+                      ptVar1 = gpSharedUserCritDeferredUnlockListHead + 0x10;

+                      gpSharedUserCritDeferredUnlockListHead =

+                           *(tagKERNELHANDLETABLEENTRY **)

+                            (gpSharedUserCritDeferredUnlockListHead + 0x10);

+                      *(undefined8 *)ptVar1 = 0;

+                      if (*(int *)(*(longlong *)ptVar3 + 8) == 0) {

+                        MicrosoftTelemetryAssertTriggeredNoArgsKM();

+                      }

+                      this_00 = *(CCursorClip **)ptVar3;

+                      HMUnlockObject();

+                    }

+                  }

+                }

+              }

+            }

+            iVar4 = CCursorClip::SetShellClip(this_00,_Dst,param_3);

+            if (-1 < iVar4) {

+              SetContentOrientation((ulonglong)param_1 & 0xffffffff);

+            }

+            UserSessionSwitchLeaveCrit();

+            if (-1 < iVar4) goto LAB_3;

+            goto LAB_1;

+          }

+        }

+        else {

+          uVar10 = (ulonglong)param_3 * 0x10;

+          if (uVar10 < 0x100000000) {

+            if ((uint)uVar10 < 0x2710000) {

+              _Dst = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar8,uVar10 & 0xffffffff,

+                                0x63736355);

+              if (_Dst != (tagRECT *)0x0) {

+                if ((ulonglong)param_3 != 0) {

+                  lVar7 = PsGetCurrentProcessWow64Process();

+                  if (((ulonglong)param_2 & (ulonglong)(~-(uint)(lVar7 != 0) & 3)) != 0) {

                     /* WARNING: Subroutine does not return */

-      KeBugCheckEx(0x160,uVar3,0);

-    }

-    p_Var7 = unaff_R14;

-    DbgkWerCaptureLiveKernelDump(L"NTUSER",400,0x25,0);

-    uVar8 = (undefined4)((ulonglong)p_Var7 >> 0x20);

-  }

-  if (gptiCurrent != unaff_R14) {

-    lVar4 = W32GetThreadWin32Thread(SystemReserved1[0xf]);

-    if (lVar4 != 0) {

-      ptVar5 = PtiCurrentShared();

-      *(uint *)(ptVar5 + 0x5ec) = uVar6;

+                    ExRaiseDatatypeMisalignment();

+                  }

+                  if ((*(CLeakTrackingAllocator **)MmUserProbeAddress_exref < param_2 + uVar10) ||

+                     (param_2 + uVar10 < param_2)) {

+                    **(CLeakTrackingAllocator **)MmUserProbeAddress_exref =

+                         (CLeakTrackingAllocator)0x0;

+                  }

+                }

+                memcpy(_Dst,param_2,uVar10 & 0xffffffff);

+                goto LAB_2;

+              }

+            }

+            uVar5 = 8;

+            goto LAB_4;

+          }

+        }

+      }

+      uVar5 = 0x57;

     }

   }

-  gptiCurrent = unaff_R14;

-  if (InputTraceLogging::Perf::s_userCritLoggingEnabled != (bool)(char)unaff_R14) {

-    lVar4 = PsGetCurrentThreadWin32Thread();

-    if (lVar4 != 0) {

-      uVar6 = *(uint *)(lVar4 + 0x2c);

-      if (((((uVar6 & 1) != 0) || ((uVar6 & 2) != 0)) || (0 < *(int *)(lVar4 + 0x18))) &&

-         (6 < DAT_1)) {

-        cVar2 = _tlgKeywordOn(&DAT_1,0x2000);

-        if (cVar2 != '\0') {

-          _tlgWriteTransfer_EtwWriteTransfer

-                    (&DAT_1,&DAT_1c028f055,lVar4 + 0x1c,0,CONCAT44(uVar8,2));

-          uVar6 = *(uint *)(lVar4 + 0x2c);

-        }

-      }

-      *(uint *)(lVar4 + 0x2c) = uVar6 & 0xfffffffe;

-      *(undefined8 *)(lVar4 + 0x1c) = 0;

-      *(undefined8 *)(lVar4 + 0x24) = 0;

-    }

+LAB_4:

+  iVar9 = 0;

+  UserSetLastError(uVar5);

+LAB_3:

+  if ((iVar9 == 0) && (_Dst != (tagRECT *)0x0)) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,_Dst);

   }

-  EtwTraceReleaseUserCrit();

-  lVar4 = SGDGetUserSessionState();

-  ExReleaseResourceAndLeaveCriticalRegion(*(undefined8 *)(lVar4 + 8));

-  InputTraceLogging::ThreadLockedPerfRegion::~ThreadLockedPerfRegion

-            ((ThreadLockedPerfRegion *)&stack0x00000070);

-  return unaff_EDI;

+  return iVar9;

 }
```

## `NtUserDisplayConfigGetDeviceInfo`  (modified)

```diff
--- NtUserDisplayConfigGetDeviceInfo
+++ NtUserDisplayConfigGetDeviceInfo
@@ -1,13 +1,209 @@
 

-/* WARNING: Control flow encountered bad instruction data */

-

-void NtUserDisplayConfigGetDeviceInfo(longlong param_1)

+int NtUserDisplayConfigGetDeviceInfo(int *param_1)

 

 {

-  longlong in_RAX;

+  bool bVar1;

+  bool bVar2;

+  bool bVar3;

+  ulong uVar4;

+  uint uVar5;

+  int iVar6;

+  DISPLAYCONFIG_DEVICE_INFO_HEADER *_Dst;

+  int *piVar7;

+  longlong lVar8;

+  DISPLAYCONFIG_DEVICE_INFO_TYPE DVar9;

+  uint *puVar10;

+  DISPLAYCONFIG_DEVICE_INFO_HEADER *pDVar11;

+  ulonglong _Size;

+  DISPLAYCONFIG_DEVICE_INFO_HEADER *pDVar12;

+  DISPLAYCONFIG_DEVICE_INFO_HEADER *_Src;

+  void *local_res20;

+  _DISPLAY_INFO_FAILURE_POINT local_a8;

+  int local_a0;

+  int local_9c;

+  ulonglong local_78;

+  int local_70;

   

-  *(undefined1 *)(in_RAX + param_1 * 2) = 0;

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+                    /* 0x16aab0  1640  NtUserDisplayConfigGetDeviceInfo */

+  pDVar11 = (DISPLAYCONFIG_DEVICE_INFO_HEADER *)0x0;

+  pDVar12 = (DISPLAYCONFIG_DEVICE_INFO_HEADER *)0x0;

+  local_res20 = (void *)0x0;

+  local_a8 = 0;

+  local_9c = 0;

+  local_a0 = 0;

+  bVar1 = false;

+  if (gbVideoInitialized == 0) {

+    iVar6 = -0x3fffffff;

+    _Dst = pDVar11;

+    pDVar12 = pDVar11;

+    goto LAB_0;

+  }

+  puVar10 = (uint *)(param_1 + 1);

+  if (*(uint **)MmUserProbeAddress_exref <= param_1 + 1) {

+    puVar10 = *(uint **)MmUserProbeAddress_exref;

+  }

+  uVar5 = *puVar10;

+  _Size = (ulonglong)uVar5;

+  if (uVar5 < 0x14) {

+                    /* WARNING: Subroutine does not return */

+    ExRaiseStatus(0xc000000d);

+  }

+  _Dst = (DISPLAYCONFIG_DEVICE_INFO_HEADER *)Win32AllocPoolWithQuotaZInit(_Size,0x63447355);

+  if (_Dst == (DISPLAYCONFIG_DEVICE_INFO_HEADER *)0x0) {

+    piVar7 = param_1;

+    if (*(int **)MmUserProbeAddress_exref <= param_1) {

+      piVar7 = *(int **)MmUserProbeAddress_exref;

+    }

+    if ((*piVar7 == -0x15) && (uVar5 == 0x808)) {

+      if ((param_1 + 0x1f9 < param_1 + 0x1f8) ||

+         (*(int **)MmUserProbeAddress_exref < param_1 + 0x1f9)) {

+        **(undefined1 **)MmUserProbeAddress_exref = 0;

+      }

+      param_1[0x1f8] = 0;

+      if ((param_1 + 0x1fa < param_1 + 0x1f9) ||

+         (*(int **)MmUserProbeAddress_exref < param_1 + 0x1fa)) {

+        **(undefined1 **)MmUserProbeAddress_exref = 0;

+      }

+      param_1[0x1f9] = 0;

+      if ((param_1 + 0x1fb < param_1 + 0x1fa) ||

+         (*(int **)MmUserProbeAddress_exref < param_1 + 0x1fb)) {

+        **(undefined1 **)MmUserProbeAddress_exref = 0;

+      }

+      param_1[0x1fa] = 0x44315706;

+    }

+    WdLogSingleEntry2(2,_Size,0x44315706);

+                    /* WARNING: Subroutine does not return */

+    ExRaiseStatus(0xc0000017);

+  }

+  lVar8 = PsGetCurrentProcessWow64Process();

+  if (((ulonglong)param_1 & (ulonglong)(~-(uint)(lVar8 != 0) & 3)) != 0) {

+                    /* WARNING: Subroutine does not return */

+    ExRaiseDatatypeMisalignment();

+  }

+  if ((*(int **)MmUserProbeAddress_exref < (int *)((longlong)param_1 + _Size)) ||

+     ((int *)((longlong)param_1 + _Size) < param_1)) {

+    *(undefined1 *)*(int **)MmUserProbeAddress_exref = 0;

+  }

+  memcpy(_Dst,param_1,_Size);

+  *(uint *)(_Dst + 4) = uVar5;

+  DVar9 = *(DISPLAYCONFIG_DEVICE_INFO_TYPE *)_Dst;

+  if (DVar9 == 0xffffffeb) {

+    if (uVar5 != 0x808) {

+LAB_1:

+      iVar6 = -0x3ffffff3;

+      goto LAB_0;

+    }

+    local_9c = *(int *)(_Dst + 0x7e0);

+    local_a0 = *(int *)(_Dst + 0x7e4);

+    *(undefined8 *)(_Dst + 0x7e0) = 0;

+    bVar1 = true;

+    _Src = pDVar12;

+  }

+  else {

+    _Src = pDVar11;

+    if (DVar9 == 0xfffffff1) {

+      if (uVar5 != 0x20) goto LAB_1;

+      _Src = pDVar12;

+      if (*(int *)(_Dst + 0x14) != 0) {

+        pDVar12 = (DISPLAYCONFIG_DEVICE_INFO_HEADER *)

+                  Win32AllocPoolWithQuotaZInit(*(int *)(_Dst + 0x14),0x63447355);

+        if (pDVar12 == (DISPLAYCONFIG_DEVICE_INFO_HEADER *)0x0) {

+          iVar6 = -0x3fffffe9;

+          goto LAB_0;

+        }

+        local_res20 = *(void **)(_Dst + 0x18);

+        *(DISPLAYCONFIG_DEVICE_INFO_HEADER **)(_Dst + 0x18) = pDVar12;

+        DVar9 = *(DISPLAYCONFIG_DEVICE_INFO_TYPE *)_Dst;

+        _Src = pDVar12;

+      }

+    }

+  }

+  bVar2 = DispConfigTypes::RequiresUserCritShared(DVar9);

+  if (bVar2) {

+    EnterSharedCrit();

+  }

+  DVar9 = *(DISPLAYCONFIG_DEVICE_INFO_TYPE *)_Dst;

+  bVar3 = DispConfigTypes::AllowInAnySession(DVar9);

+  if (bVar3) {

+LAB_2:

+    if (-1 < (int)pDVar11) {

+      uVar4 = DispConfigTypes::GetGetterTypeSize(DVar9);

+      if ((uVar4 == 0) || (*(ulong *)(_Dst + 4) != uVar4)) {

+        pDVar11 = (DISPLAYCONFIG_DEVICE_INFO_HEADER *)0xc000000d;

+      }

+      if (-1 < (int)pDVar11) {

+        uVar5 = DrvDisplayConfigGetDeviceInfoInternal(_Dst,true);

+        pDVar11 = (DISPLAYCONFIG_DEVICE_INFO_HEADER *)(ulonglong)uVar5;

+      }

+    }

+  }

+  else {

+    if (gfSwitchInProgress == 0) {

+      iVar6 = UserIsWddmConnectedSession();

+      if (iVar6 == 0) {

+        pDVar11 = (DISPLAYCONFIG_DEVICE_INFO_HEADER *)0xc0000022;

+      }

+      goto LAB_2;

+    }

+    pDVar11 = (DISPLAYCONFIG_DEVICE_INFO_HEADER *)0xc0000001;

+  }

+  iVar6 = (int)pDVar11;

+  if (bVar2) {

+    UserSessionSwitchLeaveCrit();

+  }

+  if ((iVar6 < 0) && (bVar1)) {

+    local_a8 = *(_DISPLAY_INFO_FAILURE_POINT *)(_Dst + 0x7e8);

+  }

+  if (iVar6 == -0x7ffffffb) {

+    iVar6 = -0x3fffffdd;

+  }

+  else if (iVar6 != -0x3fffffdd) {

+    iVar6 = _DeviceInfoTranslateStatusDefault(*(undefined4 *)_Dst,pDVar11);

+  }

+  if (((*(int *)_Dst == -0xf) && (*(void **)(_Dst + 0x18) = local_res20, -1 < iVar6)) &&

+     (*(int *)(_Dst + 0x14) != 0)) {

+    lVar8 = PsGetCurrentProcessWow64Process();

+    ProbeForWrite(local_res20,*(undefined4 *)(_Dst + 0x14),(-(uint)(lVar8 != 0) & 0xfffffffd) + 4);

+    memcpy(local_res20,_Src,(ulonglong)*(uint *)(_Dst + 0x14));

+  }

+  if ((*(int *)_Dst == 3) && (-1 < iVar6)) {

+    *(undefined4 *)(_Dst + 0x1c) = 0;

+  }

+  lVar8 = PsGetCurrentProcessWow64Process();

+  ProbeForWrite(param_1,*(undefined4 *)(_Dst + 4),(-(uint)(lVar8 != 0) & 0xfffffffd) + 4);

+  memcpy(param_1,_Dst,(ulonglong)*(uint *)(_Dst + 4));

+  pDVar12 = _Src;

+LAB_0:

+  if ((iVar6 < 0) && (bVar1)) {

+    local_78 = 0;

+    local_70 = 0;

+    DrvSampleDisplayState(&local_78);

+    if ((local_9c != (int)local_78) || (bVar1 = true, local_a0 != local_70)) {

+      bVar1 = false;

+    }

+    if (!bVar1) {

+      if ((param_1 + 0x1fb < param_1 + 0x1fa) ||

+         (*(int **)MmUserProbeAddress_exref < param_1 + 0x1fb)) {

+        **(undefined1 **)MmUserProbeAddress_exref = 0;

+      }

+      param_1[0x1fa] = 0;

+      WdLogSingleEntry5(2,local_9c,local_a0,local_78 & 0xffffffff,local_70,(longlong)(int)local_a8);

+      WdLogSingleEntry2(2,(longlong)iVar6,(longlong)(int)local_a8);

+    }

+    if ((DAT_3 == 0) && (bVar1)) {

+      DAT_3 = 1;

+      HelperCreateLiveDumpWithWdLogs(iVar6,local_a8);

+    }

+    else {

+      WdLogSingleEntry2(2,(longlong)iVar6,(longlong)(int)local_a8);

+    }

+  }

+  if (pDVar12 != (DISPLAYCONFIG_DEVICE_INFO_HEADER *)0x0) {

+    Win32FreePool(pDVar12);

+  }

+  if (_Dst != (DISPLAYCONFIG_DEVICE_INFO_HEADER *)0x0) {

+    Win32FreePool(_Dst);

+  }

+  return iVar6;

 }
```

## `CreateProfileUserName`  (modified)

```diff
--- CreateProfileUserName
+++ CreateProfileUserName
@@ -1,129 +1,29 @@
 

-REGION * CreateProfileUserName(void)

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+

+undefined2 * CreateProfileUserName(CLeakTrackingAllocator *param_1,__uint64 param_2)

 

 {

-  int iVar1;

-  CLeakTrackingAllocator *this;

-  bool bVar2;

-  longlong lVar3;

-  void *pvVar4;

-  undefined8 *puVar5;

-  undefined4 uVar6;

-  REGION *unaff_RSI;

-  undefined8 unaff_RDI;

-  ulonglong unaff_R12;

-  longlong unaff_R14;

-  undefined8 *in_stack_00000030;

-  undefined4 *in_stack_00000038;

-  undefined4 in_stack_00000128;

-  __uint64 in_stack_00000130;

-  ulonglong in_stack_00000138;

+  void *pvVar1;

+  undefined2 *puVar2;

   

-  *(int *)(unaff_R14 + 0x20) = *(int *)(unaff_R14 + 0x20) + 0x100;

-  *(undefined8 *)(unaff_R14 + 8) = unaff_RDI;

-  ExReleasePushLockExclusiveEx();

-  KeLeaveCriticalRegion();

-  this = gpLeakTrackingAllocator;

-  if (unaff_RSI == (REGION *)0x0) {

-    return (REGION *)0x0;

-  }

-  if ((uint)unaff_R12 == 0x70) {

-    lVar3 = SGDGetSessionState();

-    pvVar4 = NSInstrumentation::CLeakTrackingAllocator::AllocateFromPagedLookasideList

-                       (*(CLeakTrackingAllocator **)(lVar3 + 0x18),

-                        *(void **)(*(CLeakTrackingAllocator **)(lVar3 + 0x18) + 0x18e8));

-    *(void **)(unaff_RSI + 0x20) = pvVar4;

-    goto LAB_0;

-  }

-  if ((uint)unaff_R12 < 0x71) goto LAB_0;

-  in_stack_00000128 = 0x6e637347;

-  in_stack_00000138 = 0x104;

-  iVar1 = *(int *)gpLeakTrackingAllocator;

-  if (iVar1 == 0) {

-    puVar5 = (undefined8 *)ExAllocatePool2(0x106);

-    if (puVar5 != (undefined8 *)0x0) {

-      LOCK();

-      *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + 1;

-      UNLOCK();

-    }

+                    /* 0x2e3e0  682  CreateProfileUserName */

+  pvVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     (param_1,param_2,0x210,0x6e707355);

+  if (pvVar1 == (void *)0x0) {

+    puVar2 = (undefined2 *)0x0;

   }

   else {

-    if (iVar1 == 1) {

-      bVar2 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

-                        (gpLeakTrackingAllocator,0x6e637347);

-      if ((bVar2) && (unaff_R12 < unaff_R12 + 0x10)) {

-        puVar5 = (undefined8 *)

-                 ExAllocatePool2(in_stack_00000138 | 2,unaff_R12 + 0x10,in_stack_00000128);

-        if (puVar5 != (undefined8 *)0x0) {

-          LOCK();

-          *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + 1;

-          UNLOCK();

-          *puVar5 = 0x6e637347;

-          puVar5 = puVar5 + 2;

-          if (puVar5 != (undefined8 *)0x0) goto LAB_1;

-        }

-        NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

-                  (*(CPointerHashTable **)(this + 8),(void *)0x6e637347);

-        goto LAB_1;

-      }

+    if (DAT_0 != 0) {

+      (*(code *)DAT_0)(pvVar1,param_1,Win32FreePool);

     }

-    else if (iVar1 == 2) {

-      in_stack_00000130 = 0;

-      uVar6 = 0x6e637347;

-      bVar2 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

-                        (gpLeakTrackingAllocator,0x6e637347,&stack0x00000130);

-      if (!bVar2) {

-        in_stack_00000030 = &stack0x00000138;

-        in_stack_00000038 = &stack0x00000128;

-        puVar5 = (undefined8 *)

-                 NSInstrumentation::CLeakTrackingAllocator::

-                 MakeUntrackedAllocation<<lambda_4d7361c25cefbba13618e79d09554cff>,unsigned___int64_&>

-                           (this,&stack0x00000030,&stack0x00000020);

-        goto LAB_1;

-      }

-      bVar2 = false;

-      if ((unaff_R12 < 0x1000) || ((unaff_R12 & 0xfff) != 0)) {

-        unaff_R12 = unaff_R12 + 0x10;

-        bVar2 = true;

-      }

-      puVar5 = (undefined8 *)ExAllocatePool2(0x106,unaff_R12,uVar6);

-      if (puVar5 != (undefined8 *)0x0) {

-        LOCK();

-        *(longlong *)(this + 0x80) = *(longlong *)(this + 0x80) + 1;

-        UNLOCK();

-        NSInstrumentation::CBackTrace::CBackTrace((CBackTrace *)&stack0x00000040);

-        if ((bVar2) && (((uint)puVar5 & 0xfff) + 0x10 < 0x1000)) {

-          bVar2 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

-                            (this,puVar5,in_stack_00000130,(CBackTrace *)&stack0x00000040);

-          if (!bVar2) {

-LAB_2:

-            LOCK();

-            *(longlong *)(this + 0x88) = *(longlong *)(this + 0x88) + 1;

-            UNLOCK();

-            ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

-                      (puVar5);

-            goto LAB_3;

-          }

-          puVar5 = puVar5 + 2;

-        }

-        else {

-          bVar2 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

-                            (this,puVar5,in_stack_00000130,(CBackTrace *)&stack0x00000040);

-          if (!bVar2) goto LAB_2;

-        }

-        goto LAB_1;

-      }

-    }

-LAB_3:

-    puVar5 = (undefined8 *)0x0;

+    *(void **)((longlong)pvVar1 + 0x208) = pvVar1;

+    puVar2 = (undefined2 *)((longlong)pvVar1 + 0x200);

+    *(undefined2 *)((longlong)pvVar1 + 0x202) = 0x200;

+    *puVar2 = 0;

+    InitPreviousUserString();

+    RtlCopyUnicodeString(puVar2,&PreviousUserString);

   }

-LAB_1:

-  *(undefined8 **)(unaff_RSI + 0x20) = puVar5;

-LAB_0:

-  if (*(longlong *)(unaff_RSI + 0x20) == 0) {

-    REGION::vDeleteREGION(unaff_RSI);

-    unaff_RSI = (REGION *)0x0;

-  }

-  return unaff_RSI;

+  return puVar2;

 }
```

## `UninitializeTelemetryAssertsKM`  (modified)

```diff
--- UninitializeTelemetryAssertsKM
+++ UninitializeTelemetryAssertsKM
@@ -1,14 +1,99 @@
 

-/* public: virtual void * __ptr64 __cdecl CKernelSensorThread::`vector deleting destructor'(unsigned

-   int) __ptr64 */

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

+/* WARNING: Exceeded maximum restarts with more pending */

 

-CKernelSensorThread * UninitializeTelemetryAssertsKM(CKernelSensorThread *param_1,uint param_2)

+void UninitializeTelemetryAssertsKM(void)

 

 {

-  CKernelSensorThread::~CKernelSensorThread(param_1);

-  if (((param_2 & 1) != 0) && (param_1 != (CKernelSensorThread *)0x0)) {

-    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,param_1);

+  longlong *plVar1;

+  code *pcVar2;

+  undefined8 uVar3;

+  int iVar4;

+  longlong lVar5;

+  undefined8 *puVar6;

+  undefined8 *puVar7;

+  longlong *plVar8;

+  longlong lVar9;

+  ApiSetEditionCrit aAStackX_10 [24];

+  

+  LOCK();

+  UNLOCK();

+  if (g_AssertsOperational != 0) {

+    LOCK();

+    g_AssertsOperational = g_AssertsOperational + -1;

+    UNLOCK();

+    iVar4 = TakeTelemetryAssertsLock();

+    if (iVar4 == 0) {

+      while ((undefined8 **)g_MicrosoftTelemetryAssertsTriggeredList !=

+             &g_MicrosoftTelemetryAssertsTriggeredList) {

+        if (((undefined8 **)g_MicrosoftTelemetryAssertsTriggeredList[1] !=

+             &g_MicrosoftTelemetryAssertsTriggeredList) ||

+           (puVar7 = (undefined8 *)*g_MicrosoftTelemetryAssertsTriggeredList,

+           (undefined8 *)puVar7[1] != g_MicrosoftTelemetryAssertsTriggeredList)) {

+          pcVar2 = (code *)swi(0x29);

+          (*pcVar2)(3);

+          if (gpfnIVUninitialize != (_func_long *)0x0) {

+            (*gpfnIVUninitialize)();

+          }

+          if ((ghModwin32kns != (void *)0x0) && (*(longlong *)((longlong)ghModwin32kns + 0x18) != 0)

+             ) {

+            ZwSetSystemInformation(0x1b,(longlong *)((longlong)ghModwin32kns + 0x18),8);

+          }

+          lVar5 = SGDGetUserSessionState();

+          lVar9 = 3;

+          puVar7 = (undefined8 *)(lVar5 + 0xcc0);

+          do {

+            (*(code *)*puVar7)();

+            puVar7 = puVar7 + 6;

+            lVar9 = lVar9 + -1;

+          } while (lVar9 != 0);

+          lVar5 = SGDGetUserSessionState();

+          *(undefined1 *)(lVar5 + 0xca0) = 0;

+          lVar5 = SGDGetUserSessionState();

+          if (*(longlong *)(lVar5 + 0xc90) != 0) {

+            MicrosoftTelemetryAssertTriggeredNoArgsKM();

+          }

+          lVar5 = SGDGetUserSessionState();

+          lVar9 = 2;

+          plVar8 = (longlong *)(lVar5 + 0x3e70);

+          do {

+            plVar1 = (longlong *)*plVar8;

+            if (plVar1 != (longlong *)0x0) {

+              (**(code **)(*plVar1 + 0x10))(plVar1,1);

+            }

+            *plVar8 = 0;

+            plVar8 = plVar8 + 3;

+            lVar9 = lVar9 + -1;

+          } while (lVar9 != 0);

+          ApiSetEditionCrit::~ApiSetEditionCrit(aAStackX_10);

+          return;

+        }

+        puVar6 = g_MicrosoftTelemetryAssertsTriggeredList + -4;

+        g_MicrosoftTelemetryAssertsTriggeredList = puVar7;

+        puVar7[1] = &g_MicrosoftTelemetryAssertsTriggeredList;

+        ExFreePoolWithTag(puVar6,0x74727341);

+      }

+      ExReleaseFastMutex(g_AssertFastMutex);

+    }

+    UninitializeTelemetryAssertsLocks();

+    if (g_ModuleName != 0) {

+      ExFreePoolWithTag(g_ModuleName,0x74727341);

+      g_ModuleName = 0;

+    }

+    uVar3 = DAT_0;

+    DAT_0 = 0;

+    DAT_1 = 0;

+    EtwUnregister(uVar3);

+    uVar3 = DAT_2;

+    DAT_2 = 0;

+    _DAT_3 = 0;

+    EtwUnregister(uVar3);

+    uVar3 = DAT_4;

+    DAT_4 = 0;

+    DAT_5 = 0;

+    EtwUnregister(uVar3);

   }

-  return param_1;

+  return;

 }
```

## `AllocAce`  (modified)

```diff
--- AllocAce
+++ AllocAce
@@ -1,124 +1,152 @@
 

-ulonglong AllocAce(ulonglong param_1)

+undefined8 *

+AllocAce(void *param_1,__uint64 param_2,undefined1 param_3,undefined4 param_4,

+        CLeakTrackingAllocator *param_5,uint *param_6)

 

 {

-  longlong lVar1;

+  uint uVar1;

   int iVar2;

-  uint *puVar3;

-  char cVar4;

+  CLeakTrackingAllocator *this;

+  bool bVar3;

+  int iVar4;

   uint uVar5;

-  int iVar6;

-  longlong *plVar7;

-  longlong lVar8;

-  longlong lVar9;

-  int *piVar10;

-  undefined8 uVar11;

-  _ENTRY *p_Var12;

-  OBJECT *pOVar13;

-  ulonglong uVar14;

-  uint uVar15;

-  HANDLELOCK *this;

-  uint unaff_EBP;

-  uint uVar16;

-  longlong lVar17;

-  longlong lVar18;

-  char unaff_R13B;

-  undefined1 in_ZF;

-  undefined8 local_res20;

+  undefined8 *_Dst;

+  CLeakTrackingAllocator *this_00;

+  undefined1 *puVar6;

+  ulonglong uVar7;

+  uint uVar8;

+  ulonglong _Size;

+  undefined4 local_res8 [2];

+  undefined1 local_res10;

+  undefined1 local_res18;

+  undefined4 local_res20;

+  ulonglong *local_108;

+  undefined4 *local_100;

+  ulonglong local_f8;

+  ulonglong local_f0;

+  CBackTrace local_e8 [168];

   

-  func_0x000208edad6d();

-  this = (HANDLELOCK *)(param_1 & 0xffffffff);

-  if (!(bool)in_ZF) {

-    return 0;

+                    /* 0x5cd60  627  AllocAce */

+  local_res10 = (undefined1)param_2;

+  this_00 = param_5;

+  local_res18 = param_3;

+  local_res20 = param_4;

+  iVar4 = RtlLengthSid();

+  this = gpLeakTrackingAllocator;

+  uVar8 = iVar4 + 8;

+  if (param_1 == (void *)0x0) {

+    _Size = 0;

+    _Dst = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     (this_00,param_2,(ulonglong)uVar8,0x65737355);

+    if (_Dst == (undefined8 *)0x0) {

+      return (undefined8 *)0x0;

+    }

+    goto LAB_0;

   }

-  local_res20 = 0;

-  plVar7 = (longlong *)PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion(&local_res20);

-  cVar4 = KeIsAttachedProcess();

-  if (cVar4 == '\0') {

-LAB_0:

-    if ((plVar7 == (longlong *)0x0) || (*plVar7 == 0)) goto LAB_1;

-    lVar18 = *(longlong *)(*plVar7 + 0x48);

+  uVar1 = *param_6;

+  _Size = (ulonglong)uVar1;

+  uVar5 = uVar8 + uVar1;

+  if (uVar5 < uVar1) {

+    return (undefined8 *)0x0;

   }

-  else {

-    piVar10 = (int *)SGDGetUserSessionState();

-    iVar2 = *piVar10;

-    uVar11 = PsGetCurrentThreadProcess();

-    iVar6 = PsGetProcessSessionIdEx(uVar11);

-    if (iVar2 == iVar6) goto LAB_0;

+  uVar7 = (ulonglong)uVar5;

+  local_res8[0] = 0x65737355;

+  local_f8 = 0x104;

+  iVar2 = *(int *)gpLeakTrackingAllocator;

+  local_f0 = uVar7;

+  if (iVar2 == 0) {

+    _Dst = (undefined8 *)ExAllocatePool2(0x105,uVar7,0x65737355);

+    if (_Dst != (undefined8 *)0x0) {

+      LOCK();

+      *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + 1;

+      UNLOCK();

+    }

 LAB_1:

-    lVar18 = 0;

-  }

-  *(undefined4 *)(this + 8) = 1;

-  lVar8 = SGDGetSessionState();

-  uVar5 = unaff_EBP & 0xffff;

-  uVar16 = unaff_EBP >> 8 & 0xff0000 | uVar5;

-  puVar3 = *(uint **)(*(longlong *)(lVar8 + 0x18) + 0x1f48);

-  uVar15 = uVar16;

-  if (((0xffff < uVar16) && (uVar15 = uVar5, 0x10000 < *puVar3)) &&

-     (p_Var12 = GdiHandleEntryDirectory::GetEntry

-                          (*(GdiHandleEntryDirectory **)(puVar3 + 4),uVar5,true), uVar15 = uVar16,

-     (uint)(byte)p_Var12[0xd] == unaff_EBP >> 0x18)) {

-    uVar15 = uVar5;

-  }

-  lVar8 = *(longlong *)(puVar3 + 4);

-  uVar5 = *(uint *)(lVar8 + 0x808);

-  if (uVar15 < (*(ushort *)(lVar8 + 2) + 0xffff) * 0x10000 + uVar5) {

-    if (uVar15 < uVar5) {

-      plVar7 = *(longlong **)(lVar8 + 8);

-    }

-    else {

-      uVar16 = (uVar15 - uVar5 >> 0x10) + 1;

-      plVar7 = *(longlong **)(lVar8 + 8 + (ulonglong)uVar16 * 8);

-      uVar15 = uVar15 + ((1 - uVar16) * 0x10000 - uVar5);

-    }

-    lVar8 = 0;

-    if (uVar15 < *(uint *)((longlong)plVar7 + 0x14)) {

-      lVar17 = (ulonglong)(uVar15 & 0xff) * 0x10;

-      lVar1 = (ulonglong)(uVar15 >> 8) * 8;

-      lVar9 = *(longlong *)(*(longlong *)plVar7[3] + lVar1) + lVar17;

-      KeEnterCriticalRegion();

-      ExAcquirePushLockExclusiveEx(lVar9,0);

-      if ((uVar15 < *(uint *)((longlong)plVar7 + 0x14)) &&

-         (*(longlong *)(*(longlong *)(*(longlong *)plVar7[3] + lVar1) + 8 + lVar17) != 0)) {

-        puVar3 = (uint *)((ulonglong)uVar15 * 0x18 + 8 + *plVar7);

-        *puVar3 = *puVar3 | 1;

-        lVar8 = *plVar7 + (ulonglong)uVar15 * 0x18;

-      }

-      else {

-        ExReleasePushLockExclusiveEx(lVar9,0);

-        KeLeaveCriticalRegion();

-      }

-    }

-    *(longlong *)this = lVar8;

-    if (lVar8 != 0) {

-      uVar15 = *(uint *)(lVar8 + 8);

-      *(uint *)(this + 0xc) = uVar15;

-      uVar15 = uVar15 & 0xfffffffe;

-      if ((((uVar15 == ((uint)local_res20 & 0xfffffffc)) || (uVar15 == 0)) ||

-          ((lVar18 != 0 && (uVar15 == *(uint *)(lVar18 + 8))))) &&

-         ((*(byte *)(lVar8 + 0xf) & 0x20) == 0)) {

-        if ((*(byte *)(lVar8 + 0xf) & 0x40) == 0) goto LAB_2;

-        pOVar13 = HANDLELOCK::pObj(this);

-        if (*(short *)(pOVar13 + 0xc) != 0) {

-          uVar14 = FUN_1c003243a();

-          return uVar14;

-        }

-      }

-      HANDLELOCK::vUnlock(this);

-      goto LAB_2;

+    if (_Dst == (undefined8 *)0x0) {

+      return (undefined8 *)0x0;

     }

   }

   else {

-    *(undefined8 *)this = 0;

+    if (iVar2 == 1) {

+      bVar3 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                        (gpLeakTrackingAllocator,0x65737355);

+      if (!bVar3) {

+        return (undefined8 *)0x0;

+      }

+      if (uVar7 + 0x10 <= uVar7) {

+        return (undefined8 *)0x0;

+      }

+      _Dst = (undefined8 *)

+             ExAllocatePool2(local_f8 & 0xfffffffffffffffd | 1,uVar7 + 0x10,local_res8[0]);

+      if (_Dst != (undefined8 *)0x0) {

+        LOCK();

+        *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + 1;

+        UNLOCK();

+        *_Dst = 0x65737355;

+        _Dst = _Dst + 2;

+        if (_Dst != (undefined8 *)0x0) goto LAB_1;

+      }

+      NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

+                (*(CPointerHashTable **)(this + 8),(void *)0x65737355);

+      goto LAB_1;

+    }

+    if (iVar2 != 2) {

+      return (undefined8 *)0x0;

+    }

+    local_108 = (ulonglong *)0x0;

+    bVar3 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                      (gpLeakTrackingAllocator,0x65737355,(__uint64 *)&local_108);

+    if (!bVar3) {

+      local_108 = &local_f8;

+      local_100 = local_res8;

+      _Dst = (undefined8 *)

+             NSInstrumentation::CLeakTrackingAllocator::

+             MakeUntrackedAllocation<<lambda_a6c9ad8a3ccccec93018e691c2ba1200>,unsigned___int64_&>

+                       (this,&local_108,&local_f0);

+      goto LAB_1;

+    }

+    bVar3 = false;

+    if ((uVar7 < 0x1000) || ((uVar5 & 0xfff) != 0)) {

+      uVar7 = uVar7 + 0x10;

+      bVar3 = true;

+      local_f0 = uVar7;

+    }

+    _Dst = (undefined8 *)ExAllocatePool2(0x105,uVar7,0x65737355);

+    if (_Dst == (undefined8 *)0x0) {

+      return (undefined8 *)0x0;

+    }

+    LOCK();

+    *(longlong *)(this + 0x80) = *(longlong *)(this + 0x80) + 1;

+    UNLOCK();

+    NSInstrumentation::CBackTrace::CBackTrace(local_e8);

+    if ((bVar3) && (((uint)_Dst & 0xfff) + 0x10 < 0x1000)) {

+      bVar3 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

+                        (this,_Dst,(__uint64)local_108,local_e8);

+      if (!bVar3) goto LAB_2;

+      _Dst = _Dst + 2;

+      goto LAB_1;

+    }

+    bVar3 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

+                      (this,_Dst,(__uint64)local_108,local_e8);

+    if (!bVar3) {

+LAB_2:

+      LOCK();

+      *(longlong *)(this + 0x88) = *(longlong *)(this + 0x88) + 1;

+      UNLOCK();

+      ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z(_Dst);

+      return (undefined8 *)0x0;

+    }

   }

-  *(undefined4 *)(this + 8) = 0;

-  KeLeaveCriticalRegion();

-LAB_2:

-  if ((*(int *)(this + 8) != 0) &&

-     ((*(char *)(*(longlong *)this + 0xe) != unaff_R13B ||

-      (*(short *)(*(longlong *)this + 0xc) != (short)(unaff_EBP >> 0x10))))) {

-    HANDLELOCK::vUnlock(this);

-  }

-  return (ulonglong)*(uint *)(this + 8);

+  memcpy(_Dst,param_1,_Size);

+  NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,param_1);

+LAB_0:

+  puVar6 = (undefined1 *)(_Size + (longlong)_Dst);

+  *param_6 = uVar8 + (int)_Size;

+  *puVar6 = local_res10;

+  puVar6[1] = local_res18;

+  *(undefined4 *)(puVar6 + 4) = local_res20;

+  *(short *)(puVar6 + 2) = (short)uVar8;

+  RtlCopySid(iVar4,puVar6 + 8,param_5);

+  return _Dst;

 }
```

## `xxxDispBrokerSetDisplayConfig`  (modified)

```diff
--- xxxDispBrokerSetDisplayConfig
+++ xxxDispBrokerSetDisplayConfig
@@ -1,319 +1,65 @@
 

-/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

-/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* long __cdecl xxxDispBrokerSetDisplayConfig(unsigned int,struct DISPLAYCONFIG_PATH_INFO_INTERNAL *

+   __ptr64,unsigned int,unsigned int,bool) */

 

 long __cdecl

 xxxDispBrokerSetDisplayConfig

           (uint param_1,DISPLAYCONFIG_PATH_INFO_INTERNAL *param_2,uint param_3,uint param_4,

           bool param_5)

 

 {

-  DispBrokerClient DVar1;

-  undefined8 uVar2;

-  int iVar3;

-  int iVar4;

-  char *in_RAX;

-  longlong lVar5;

-  DispBrokerClient *pDVar6;

-  tagMONITOR *ptVar7;

-  ulonglong uVar8;

-  uint uVar9;

+  long lVar1;

+  AlpcRequest<7> *pAVar2;

   undefined4 in_register_0000000c;

-  DispBrokerClient *pDVar10;

-  byte bVar11;

-  undefined4 uVar12;

-  byte unaff_BL;

-  uint uVar13;

-  longlong unaff_RBP;

-  byte bVar14;

-  int unaff_ESI;

-  uint uVar15;

-  undefined8 uVar16;

-  undefined4 in_register_00000084;

-  undefined4 in_register_0000008c;

-  int unaff_R12D;

-  longlong unaff_R13;

-  uint unaff_R14D;

-  _UNICODE_STRING *p_Var17;

-  int unaff_R15D;

-  undefined8 in_stack_00000020;

-  undefined8 uVar18;

-  uint uVar20;

-  ulonglong uVar19;

+  uint uVar3;

+  DISPLAYCONFIG_PATH_INFO_INTERNAL *local_res10;

+  uint local_res18 [2];

+  uint local_res20 [2];

+  undefined1 auStack_d8 [32];

+  uint local_b8 [2];

+  uint *local_b0;

+  uint *local_a8;

+  uint *local_a0;

+  bool *local_98;

+  DISPLAYCONFIG_PATH_INFO_INTERNAL **local_90;

+  AlpcReply<7> local_88 [64];

+  long local_48;

+  ulonglong local_38;

   

-  *in_RAX = *in_RAX + (char)in_RAX;

-  uVar16 = CONCAT71((int7)((ulonglong)in_stack_00000020 >> 8),unaff_BL);

-  WPP_RECORDER_AND_TRACE_SF_

-            (CONCAT44(in_register_0000000c,param_1),param_2,CONCAT44(in_register_00000084,param_3),

-             CONCAT44(in_register_0000008c,param_4),uVar16);

-  uVar15 = unaff_R14D & 0x100;

-  bVar14 = (byte)unaff_ESI;

-  if (uVar15 != 0) {

-    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x2000) == 0)) ||

-       (bVar11 = bVar14, (byte)WPP_GLOBAL_Control[0x29] < unaff_BL)) {

-      bVar11 = 0;

+  local_38 = __security_cookie ^ (ulonglong)auStack_d8;

+  uVar3 = param_1 * 0xd8 + 0x50;

+  if (uVar3 < 0x7fff) {

+    local_res10 = param_2;

+    local_res18[0] = param_3;

+    local_res20[0] = param_4;

+    local_b8[0] = param_1;

+    pAVar2 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)CONCAT44(in_register_0000000c,param_1),

+                        (__uint64)param_2,(ulonglong)uVar3,0x44535042);

+    if (pAVar2 == (AlpcRequest<7> *)0x0) {

+      local_48 = -0x3fffffe9;

     }

-    if ((bVar11 != 0) || ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

-      uVar16 = CONCAT71((int7)((ulonglong)uVar16 >> 8),unaff_BL);

-      WPP_RECORDER_AND_TRACE_SF_

-                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),bVar11,

-                 (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog,

-                 uVar16);

+    else {

+      local_b0 = local_b8;

+      local_a8 = local_res18;

+      local_a0 = local_res20;

+      local_98 = &param_5;

+      local_90 = &local_res10;

+      InitDisplayBrokerMessage<DispBroker::AlpcRequest<8>,<lambda_38c6dc7437b728cc1d00ec4d9055c622>,&DrvSampleDisplayState>

+                (pAVar2,&local_b0,(short)uVar3 + -0x50);

+      memset(local_88,0,0x48);

+      lVar1 = DispBroker::DispBrokerClient::SyncMessage<7>

+                        (DispBroker::DispBrokerClient::s_pSessionBroker,pAVar2,local_88);

+      NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,pAVar2);

+      if (lVar1 < 0) {

+        local_48 = lVar1;

+      }

     }

   }

-  uVar20 = (uint)((ulonglong)uVar16 >> 0x20);

-  uVar13 = unaff_R14D & 0x200;

-  if (uVar13 != 0) {

-    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x2000) == 0)) ||

-       (bVar11 = bVar14, (byte)WPP_GLOBAL_Control[0x29] < 4)) {

-      bVar11 = 0;

-    }

-    if ((bVar11 != 0) || ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

-      uVar16 = CONCAT71((int7)((ulonglong)uVar16 >> 8),4);

-      WPP_RECORDER_AND_TRACE_SF_

-                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),bVar11,

-                 (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog,

-                 uVar16);

-      uVar20 = (uint)((ulonglong)uVar16 >> 0x20);

-    }

+  else {

+    local_48 = -0x7ffffffb;

   }

-  if ((unaff_R14D & 0x7fff800) != 0) goto LAB_0;

-  iVar3 = DrvQueryMDEVPowerState(*(undefined8 *)(gpDispInfo + 0x10));

-  if (iVar3 == 0) {

-    if ((unaff_R12D == 0) ||

-       (iVar3 = DrvSetVideoParameters

-                          (*(undefined8 *)(unaff_RBP + 0x4f),

-                           *(undefined8 *)(*(longlong *)(gpDispInfo + 0x60) + 0x50),

-                           *(undefined8 *)(unaff_RBP + 0x6f),unaff_ESI,CONCAT44(uVar20,unaff_ESI)),

-       iVar3 < 0)) {

-      iVar3 = -5;

-    }

-    goto LAB_1;

-  }

-  if (gbMDEVDisabled != 0) {

-    if (unaff_R12D == 0) goto LAB_2;

-    lVar5 = CONCAT44(uVar20,unaff_ESI);

-LAB_3:

-    iVar3 = DrvSetVideoParameters

-                      (*(undefined8 *)(unaff_RBP + 0x4f),

-                       *(undefined8 *)(*(longlong *)(gpDispInfo + 0x60) + 0x50),

-                       *(undefined8 *)(unaff_RBP + 0x6f),unaff_ESI,lVar5);

-    if (-1 < iVar3) goto LAB_1;

-    goto LAB_2;

-  }

-  if (((bVar14 & (byte)unaff_R14D) != 0 || (unaff_R14D & 0x10000008) == 0) &&

-     ((uVar9 = unaff_R14D & 0x60000000, unaff_R15D == 0 || (uVar9 == 0)))) {

-    if ((unaff_R14D & 0x80000004) == 0x80000004) {

-      if (uVar9 == 0) {

-LAB_4:

-        if (((uVar15 == 0) || (unaff_R14D == 0x100)) && ((uVar13 == 0 || (unaff_R14D == 0x200)))) {

-          if (((gdwPUDFlags & 0x20000000) != 0) &&

-             (((lVar5 = PsGetCurrentProcess(), lVar5 != gpepCSRSS || (DAT_5 == 0)) ||

-              (iVar3 = (*(code *)DAT_5)(), iVar3 == 0)))) {

-LAB_2:

-            iVar3 = -1;

-            goto LAB_1;

-          }

-          if ((unaff_R13 == 0) || ((*(uint *)(unaff_R13 + 0x30) & 8) != 0)) {

-            unaff_R13 = *(longlong *)(gptiCurrent + 0x1c8);

-            *(longlong *)(unaff_RBP + 0x5f) = unaff_R13;

-          }

-          lVar5 = PsGetCurrentProcess();

-          if (lVar5 == gpepCSRSS) {

-            if (unaff_R13 == 0) {

-              *(longlong *)(unaff_RBP + 0x5f) = grpdeskRitInput;

-            }

-          }

-          else if (unaff_R13 != grpdeskRitInput) {

-            if (unaff_R12D != 0) {

-              lVar5 = (ulonglong)uVar20 << 0x20;

-              goto LAB_3;

-            }

-            goto LAB_2;

-          }

-          pDVar6 = DispBroker::DispBrokerClient::s_pSessionBroker;

-          if (uVar15 == 0) {

-            uVar16 = 0;

-            if (uVar13 == 0) {

-              uVar15 = unaff_R14D & 0x10000002;

-              DVar1 = DispBroker::DispBrokerClient::s_pSessionBroker[8];

-              pDVar10 = DispBroker::DispBrokerClient::s_pSessionBroker + 4;

-              *(uint *)(unaff_RBP + -0x41) = (uint)(uVar15 == 0);

-              lVar5 = gpDispInfo;

-              if (DVar1 == (DispBrokerClient)0x0) {

-                pDVar10 = pDVar6;

-              }

-              iVar4 = *(int *)(unaff_RBP + 0x77);

-              if (*(int *)pDVar10 == 3) {

-                *(undefined8 *)(unaff_RBP + -0x21) = 0;

-                uVar2 = *(undefined8 *)(*(longlong *)(lVar5 + 0x60) + 0x50);

-                uVar18 = CONCAT44(uVar20,*(undefined4 *)(unaff_RBP + -0x4d));

-                *(int *)(unaff_RBP + -0x45) = unaff_ESI;

-                iVar3 = DrvChangeDisplaySettingsPreValidate

-                                  (*(undefined8 *)(unaff_RBP + 0x4f),uVar2,

-                                   *(undefined8 *)(unaff_RBP + 0x57),iVar4,uVar18);

-                uVar20 = (uint)((ulonglong)uVar18 >> 0x20);

-                if (iVar3 != 0) goto LAB_1;

-                if (*(int *)(unaff_RBP + -0x45) == 0) goto LAB_6;

-                KeQueryTimeIncrement();

-                p_Var17 = *(_UNICODE_STRING **)(unaff_RBP + 0x4f);

-                iVar3 = xxxDispBrokerChangeDisplaySettings

-                                  (p_Var17,*(_devicemodeW **)(unaff_RBP + 0x57),unaff_R14D,

-                                   iVar4 == unaff_ESI);

-                uVar19 = CONCAT44(uVar20,*(undefined4 *)(unaff_RBP + -0x4d));

-                LogDiagCDS(p_Var17,*(undefined8 *)(unaff_RBP + 0x57),

-                           *(undefined8 *)(unaff_RBP + -0x21),iVar4,uVar19);

-              }

-              else {

-                if (DVar1 != (DispBrokerClient)0x0) {

-                  pDVar6 = pDVar6 + 4;

-                }

-                if (*(int *)pDVar6 == 2) {

-                  if (*(int *)(unaff_RBP + -0x39) != 0) {

-                    lVar5 = (ulonglong)uVar20 << 0x20;

-                    unaff_ESI = 0;

-                    goto LAB_3;

-                  }

-                  goto LAB_2;

-                }

-LAB_6:

-                if (uVar15 == 0) {

-                  ptVar7 = CreateCachedMonitor();

-                  if (ptVar7 == (tagMONITOR *)0x0) goto LAB_2;

-                  if (DAT_7 != 0) {

-                    (*(code *)DAT_7)(0);

-                  }

-                  if (((DAT_8 != 0) && (iVar3 = (*(code *)DAT_8)(), -1 < iVar3)) &&

-                     (DAT_9 != 0)) {

-                    (*(code *)DAT_9)();

-                  }

-                }

-                if ((((DAT_10 != 0) && (DAT_1c02ced30 != 0)) &&

-                    (iVar3 = (*(code *)DAT_11)(), -1 < iVar3)) && (DAT_1c02ced38 != 0)) {

-                  (*(code *)DAT_12)();

-                }

-                if (((DAT_13 != 0) && (iVar3 = (*(code *)DAT_13)(), -1 < iVar3)) &&

-                   (DAT_14 != 0)) {

-                  (*(code *)DAT_14)(*(undefined8 *)(gpDispInfo + 0x28),0,0,0);

-                }

-                lVar5 = *(longlong *)(unaff_RBP + 0x5f);

-                if (lVar5 != 0) {

-                  uVar16 = *(undefined8 *)**(undefined8 **)(lVar5 + 8);

-                }

-                uVar19 = CONCAT44(uVar20,iVar4);

-                iVar3 = DrvChangeDisplaySettings

-                                  (*(undefined8 *)(unaff_RBP + 0x4f),

-                                   *(undefined8 *)(*(longlong *)(gpDispInfo + 0x60) + 0x50),

-                                   *(undefined8 *)(unaff_RBP + 0x57),uVar16,uVar19);

-                uVar8 = 0;

-                if (DAT_15 != 0) {

-                  (*(code *)DAT_15)(lVar5,unaff_RBP + -0x19,CompositionObject::Release);

-                }

-                if (lVar5 != 0) {

-                  ObfReferenceObject(lVar5);

-                }

-                if (uVar15 == 0) {

-                  if (iVar3 == 2) {

-                    TrackFullscreenMode(*(int *)(unaff_RBP + -0x49));

-                    if (*(int *)(unaff_RBP + -0x29) != 0) {

-                      iVar3 = SafeDisableMDEV(unaff_ESI);

-                      if (iVar3 != 0) {

-                        SafeEnableMDEV(unaff_ESI);

-                      }

-                      if (DAT_16 != 0) {

-                        (*(code *)DAT_16)();

-                      }

-                    }

-                    iVar3 = 0;

-                  }

-                  else if (iVar3 == 0) {

-                    TrackFullscreenMode(*(int *)(unaff_RBP + -0x49));

-                    *(undefined8 *)(gpDispInfo + 0x10) = *(undefined8 *)(unaff_RBP + -0x31);

-                    PowerDimUndimResend();

-                    uVar12 = *(undefined4 *)(unaff_RBP + -0x49);

-                    uVar8 = uVar19;

-LAB_17:

-                    xxxResetDisplayDevice(lVar5,uVar12,0,0);

-                    uVar19 = uVar8;

-                  }

-                  else if (iVar3 < 0) {

-                    if (DAT_16 != 0) {

-                      (*(code *)DAT_16)();

-                    }

-                    if (*(char *)(unaff_RBP + 0x67) != '\0') {

-                      *(undefined1 *)(unaff_RBP + -0x51) = 0;

-                      if (lVar5 != 0) {

-                        uVar8 = *(ulonglong *)**(undefined8 **)(lVar5 + 8);

-                      }

-                      iVar4 = DrvSetDisplayConfig(0,0,0x98f,2,uVar8);

-                      uVar19 = uVar8;

-                      if ((-1 < iVar4) &&

-                         (TrackFullscreenMode(0), uVar19 = uVar8,

-                         *(char *)(unaff_RBP + -0x51) == '\0')) {

-                        uVar12 = 0;

-                        *(undefined8 *)(gpDispInfo + 0x10) = *(undefined8 *)(unaff_RBP + -0x31);

-                        goto LAB_17;

-                      }

-                    }

-                  }

-                  if (((lVar5 != 0) &&

-                      ((bVar14 & (byte)*(undefined4 *)(**(longlong **)(lVar5 + 8) + 0x40)) == 0)) &&

-                     (DAT_18 != 0)) {

-                    (*(code *)DAT_18)((*(longlong **)(lVar5 + 8))[3]);

-                  }

-                  if (DAT_7 != 0) {

-                    (*(code *)DAT_7)(unaff_ESI);

-                  }

-                  iVar4 = IszzzUpdateCursorImageSupported();

-                  if ((-1 < iVar4) && (DAT_19 != 0)) {

-                    (*(code *)DAT_19)();

-                  }

-                }

-                if (DAT_20 != 0) {

-                  (*(code *)DAT_20)(unaff_RBP + -0x19);

-                }

-                p_Var17 = *(_UNICODE_STRING **)(unaff_RBP + 0x4f);

-              }

-              if ((-1 < iVar3) && (*(int *)(unaff_RBP + -0x39) != 0)) {

-                iVar3 = DrvSetVideoParameters

-                                  (p_Var17,*(undefined8 *)(*(longlong *)(gpDispInfo + 0x60) + 0x50),

-                                   *(undefined8 *)(unaff_RBP + 0x6f),0,uVar19 & 0xffffffff00000000);

-              }

-              if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-                  ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x2000) == 0)) ||

-                 ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

-                unaff_ESI = 0;

-              }

-              if (((char)unaff_ESI != '\0') ||

-                 ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

-                WPP_RECORDER_AND_TRACE_SF_D

-                          (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),

-                           CONCAT71(0x1c02824,(char)unaff_ESI),

-                           (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,

-                           gBaseLog,4);

-              }

-              goto LAB_1;

-            }

-          }

-          else {

-            bVar14 = 0;

-          }

-          iVar3 = DrvSetPruneFlag(*(undefined8 *)(unaff_RBP + 0x4f),bVar14,

-                                  *(undefined4 *)(unaff_RBP + 0x77));

-          goto LAB_1;

-        }

-      }

-    }

-    else if (uVar9 != 0x60000000) goto LAB_4;

-  }

-LAB_0:

-  iVar3 = -4;

-LAB_1:

-  if ((DAT_21 & 8) != 0) {

-    McTemplateK0_EtwWriteTransfer();

-  }

-  return iVar3;

+  return local_48;

 }
```

## `xxxUserChangeDisplaySettings`  (modified)

```diff
--- xxxUserChangeDisplaySettings
+++ xxxUserChangeDisplaySettings
@@ -1,10 +1,366 @@
 

-/* WARNING: Control flow encountered bad instruction data */

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

 

-void xxxUserChangeDisplaySettings(void)

+long xxxUserChangeDisplaySettings

+               (ulonglong *param_1,undefined1 *param_2,tagDESKTOP *param_3,ulong param_4,

+               void *param_5,_MODE param_6,_DXGK_DISPLAY_SCENARIO_CONTEXT *param_7)

 

 {

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+  ushort uVar1;

+  ushort uVar2;

+  short sVar3;

+  int iVar4;

+  uint uVar5;

+  CLeakTrackingAllocator *this;

+  char cVar6;

+  uint uVar7;

+  long lVar8;

+  uint uVar9;

+  undefined8 *puVar10;

+  undefined8 *puVar11;

+  short *psVar12;

+  short *psVar13;

+  uint *puVar14;

+  undefined1 *puVar15;

+  longlong lVar16;

+  _GUID *p_Var17;

+  ulonglong uVar18;

+  undefined8 uVar19;

+  bool bVar20;

+  undefined1 auStackY_288 [32];

+  _tlgWrapperByVal<1> local_218 [4];

+  ushort local_214;

+  ushort local_210;

+  ulong local_20c;

+  undefined4 local_208 [4];

+  _UNICODE_STRING *local_1f8;

+  undefined8 uStack_1f0;

+  undefined8 local_1e8;

+  undefined8 uStack_1e0;

+  _devicemodeW *local_1d8;

+  undefined8 local_1d0;

+  undefined8 uStack_1c8;

+  undefined8 local_1c0;

+  undefined8 local_1b8;

+  long local_1a8;

+  ulong local_1a4;

+  uint local_1a0;

+  undefined4 local_19c;

+  undefined4 local_198;

+  undefined4 local_194;

+  undefined4 local_190;

+  undefined4 local_18c;

+  undefined4 local_188;

+  undefined4 local_184;

+  undefined4 local_180;

+  undefined4 local_17c;

+  undefined4 local_178 [2];

+  __uint64 local_170;

+  void *local_168;

+  ulonglong *local_158;

+  undefined4 *local_150;

+  ulonglong local_148;

+  longlong local_140;

+  ulonglong *local_138;

+  undefined8 local_130;

+  ulonglong *local_128;

+  longlong local_120;

+  longlong local_118;

+  ulonglong local_110;

+  undefined1 *puStack_108;

+  CBackTrace local_f8 [160];

+  _GUID local_58;

+  ulonglong local_48;

+  

+                    /* 0x15c810  2467  xxxUserChangeDisplaySettings */

+  local_48 = __security_cookie ^ (ulonglong)auStackY_288;

+  local_168 = param_5;

+  local_58.Data1 = 0;

+  local_58.Data2 = 0;

+  local_58.Data3 = 0;

+  local_58.Data4[0] = '\0';

+  local_58.Data4[1] = '\0';

+  local_58.Data4[2] = '\0';

+  local_58.Data4[3] = '\0';

+  local_58.Data4[4] = '\0';

+  local_58.Data4[5] = '\0';

+  local_58.Data4[6] = '\0';

+  local_58.Data4[7] = '\0';

+  local_138 = _DAT_0;

+  puVar15 = param_2;

+  local_20c = param_4;

+  local_128 = param_1;

+  uVar7 = KeQueryTimeIncrement();

+  local_140 = (ulonglong)uVar7 * (longlong)local_138;

+  local_1f8 = (_UNICODE_STRING *)0x0;

+  uStack_1f0 = 0;

+  local_1e8 = 0;

+  uStack_1e0 = 0;

+  local_1d8 = (_devicemodeW *)0x0;

+  local_1d0 = 0;

+  uStack_1c8 = 0;

+  local_1c0 = 0;

+  local_1b8 = gptiCurrent;

+  if (param_1 != (ulonglong *)0x0) {

+    local_110 = *param_1;

+    puStack_108 = (undefined1 *)param_1[1];

+    uVar1 = (ushort)local_110;

+    uVar18 = local_110 & 0xffff;

+    local_1f8 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                          (*(CLeakTrackingAllocator **)MmUserProbeAddress_exref,(__uint64)puVar15,

+                           uVar18 + 0x12,0x73726447);

+    if (local_1f8 != (_UNICODE_STRING *)0x0) {

+      if (DAT_1 != 0) {

+        (*(code *)DAT_1)(local_1f8,&uStack_1f0,Win32FreePool);

+      }

+      *(_UNICODE_STRING **)(local_1f8 + 8) = local_1f8 + 0x10;

+      *(ushort *)local_1f8 = uVar1;

+      *(ushort *)(local_1f8 + 2) = uVar1 + 2;

+      if (uVar1 != 0) {

+        if ((*(undefined1 **)MmUserProbeAddress_exref < puStack_108 + uVar18) ||

+           (puStack_108 + uVar18 < puStack_108)) {

+          **(undefined1 **)MmUserProbeAddress_exref = 0;

+        }

+        memcpy(*(void **)(local_1f8 + 8),puStack_108,uVar18);

+      }

+      puVar15 = (undefined1 *)(ulonglong)(uVar1 >> 1);

+      *(undefined2 *)(*(longlong *)(local_1f8 + 8) + (longlong)puVar15 * 2) = 0;

+      goto LAB_2;

+    }

+LAB_3:

+    lVar8 = -1;

+LAB_4:

+    `xxxUserChangeDisplaySettings'::__l2::_AUTO_KM::~_AUTO_KM(&local_1f8);

+    return lVar8;

+  }

+LAB_2:

+  if (param_2 != (undefined1 *)0x0) {

+    local_214 = 0;

+    local_210 = 0;

+    if (((ulonglong)param_2 & 3) != 0) {

+                    /* WARNING: Subroutine does not return */

+      ExRaiseDatatypeMisalignment();

+    }

+    uVar1 = *(ushort *)(param_2 + 0x44);

+    uVar2 = *(ushort *)(param_2 + 0x46);

+    local_214 = uVar1;

+    local_210 = uVar2;

+    if (0x20 < (ushort)(uVar1 - 0xbc)) {

+      lVar8 = -2;

+      goto LAB_4;

+    }

+    local_1d8 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                          ((CLeakTrackingAllocator *)0xbc,(__uint64)puVar15,(ulonglong)uVar2 + 0xdc,

+                           0x73726447);

+    if (local_1d8 == (_devicemodeW *)0x0) goto LAB_3;

+    if (DAT_1 != 0) {

+      (*(code *)DAT_1)(local_1d8,&local_1d0);

+    }

+    if ((uint)uVar2 + (uint)uVar1 != 0) {

+      if ((*(undefined1 **)MmUserProbeAddress_exref < param_2 + ((uint)uVar2 + (uint)uVar1)) ||

+         (param_2 + ((uint)uVar2 + (uint)uVar1) < param_2)) {

+        **(undefined1 **)MmUserProbeAddress_exref = 0;

+      }

+    }

+    memcpy(local_1d8,param_2,(ulonglong)uVar1);

+    memcpy(local_1d8 + 0xdc,param_2 + uVar1,(ulonglong)uVar2);

+    *(undefined2 *)(local_1d8 + 0x44) = 0xdc;

+    *(ushort *)(local_1d8 + 0x46) = uVar2;

+  }

+  puVar10 = (undefined8 *)0x0;

+  lVar8 = xxxUserChangeDisplaySettingsInternal

+                    (local_1f8,local_1d8,param_3,local_20c,local_168,param_6,param_7);

+  this = gpLeakTrackingAllocator;

+  uVar18 = 0x64437355;

+  local_208[0] = 0x64437355;

+  uVar19 = 0x104;

+  local_148 = 0x104;

+  local_130 = 0x90;

+  iVar4 = *(int *)gpLeakTrackingAllocator;

+  if (iVar4 == 0) {

+    puVar10 = (undefined8 *)ExAllocatePool2(0x104,0x90,0x64437355);

+    if (puVar10 != (undefined8 *)0x0) {

+      LOCK();

+      *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + 1;

+      UNLOCK();

+    }

+  }

+  else if (iVar4 == 1) {

+    bVar20 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                       (gpLeakTrackingAllocator,0x64437355);

+    if (bVar20) {

+      puVar10 = (undefined8 *)ExAllocatePool2(local_148 & 0xfffffffffffffffd,0xa0,local_208[0]);

+      if (puVar10 != (undefined8 *)0x0) {

+        LOCK();

+        *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + 1;

+        UNLOCK();

+        *puVar10 = 0x64437355;

+        puVar10 = puVar10 + 2;

+        if (puVar10 != (undefined8 *)0x0) goto LAB_5;

+      }

+      NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

+                (*(CPointerHashTable **)(this + 8),(void *)0x64437355);

+    }

+  }

+  else {

+    if (iVar4 == 2) {

+      local_170 = 0;

+      bVar20 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                         (gpLeakTrackingAllocator,0x64437355,&local_170);

+      if (!bVar20) {

+        local_158 = &local_148;

+        local_150 = local_208;

+        puVar10 = (undefined8 *)

+                  NSInstrumentation::CLeakTrackingAllocator::

+                  MakeUntrackedAllocation<<lambda_992394a475252bc644037de3157b7526>,unsigned___int64_&>

+                            (this,&local_158,&local_130);

+        goto LAB_5;

+      }

+      puVar11 = (undefined8 *)ExAllocatePool2(uVar19,0xa0,uVar18 & 0xffffffff);

+      if (puVar11 == (undefined8 *)0x0) goto LAB_5;

+      LOCK();

+      *(longlong *)(this + 0x80) = *(longlong *)(this + 0x80) + 1;

+      UNLOCK();

+      NSInstrumentation::CBackTrace::CBackTrace(local_f8);

+      if (((uint)puVar11 & 0xfff) + 0x10 < 0x1000) {

+        bVar20 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

+                           (this,puVar11,local_170,local_f8);

+        if (bVar20) {

+          puVar10 = puVar11 + 2;

+          goto LAB_5;

+        }

+      }

+      else {

+        bVar20 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

+                           (this,puVar11,local_170,local_f8);

+        puVar10 = puVar11;

+        if (bVar20) goto LAB_5;

+      }

+      LOCK();

+      *(longlong *)(this + 0x88) = *(longlong *)(this + 0x88) + 1;

+      UNLOCK();

+      ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                (puVar11);

+    }

+    puVar10 = (undefined8 *)0x0;

+  }

+LAB_5:

+  p_Var17 = (_GUID *)0x0;

+  lVar16 = 0x10;

+  if (puVar10 != (undefined8 *)0x0) {

+    *(undefined4 *)puVar10 = 4;

+    *(undefined4 *)((longlong)puVar10 + 4) = 0x90;

+    *(undefined4 *)(puVar10 + 5) = 0;

+    puVar10[4] = 0;

+    puVar10[1] = 0;

+    puVar10[2] = 0;

+    puVar10[3] = 0;

+    puVar10[7] = local_140;

+    if ((param_2 == (undefined1 *)0x0) || (uVar7 = 1, local_1d8 == (_devicemodeW *)0x0)) {

+      uVar7 = 0;

+    }

+    uVar5 = *(uint *)((longlong)puVar10 + 0x8c);

+    *(uint *)((longlong)puVar10 + 0x8c) = uVar5 & 0xfffffffe | uVar7;

+    if ((((local_128 == (ulonglong *)0x0) || (local_1f8 == (_UNICODE_STRING *)0x0)) ||

+        (*(short *)local_1f8 == 0)) || (uVar9 = 2, *(longlong *)(local_1f8 + 8) == 0)) {

+      uVar9 = 0;

+    }

+    bVar20 = local_168 != (void *)0x0;

+    local_168 = (void *)-(longlong)local_168;

+    *(uint *)((longlong)puVar10 + 0x8c) =

+         uVar5 & 0xfffffff0 | uVar7 | uVar9 | ~-(uint)(param_6 != 0) & 4 | ~-(uint)bVar20 & 8;

+    *(ulong *)(puVar10 + 6) = local_20c;

+    *(long *)((longlong)puVar10 + 0x34) = lVar8;

+    if (uVar9 != 0) {

+      psVar12 = *(short **)(local_1f8 + 8);

+      psVar13 = (short *)((longlong)puVar10 + 0x6c);

+      do {

+        if ((lVar16 == -0x7fffffee) || (sVar3 = *psVar12, sVar3 == 0)) break;

+        psVar12 = psVar12 + 1;

+        *psVar13 = sVar3;

+        psVar13 = psVar13 + 1;

+        lVar16 = lVar16 + -1;

+      } while (lVar16 != 0);

+      psVar12 = psVar13 + -1;

+      if (lVar16 != 0) {

+        psVar12 = psVar13;

+      }

+      *psVar12 = 0;

+      if (lVar16 == 0) {

+        *(undefined2 *)((longlong)puVar10 + 0x6c) = 0;

+      }

+    }

+    if (((*(uint *)((longlong)puVar10 + 0x8c) & 1) != 0) && (0xb3 < *(ushort *)(local_1d8 + 0x44)))

+    {

+      *(undefined4 *)(puVar10 + 8) = *(undefined4 *)(local_1d8 + 0x48);

+      *(undefined8 *)((longlong)puVar10 + 0x44) = *(undefined8 *)(local_1d8 + 0x4c);

+      *(undefined4 *)((longlong)puVar10 + 0x4c) = *(undefined4 *)(local_1d8 + 0xa8);

+      *(undefined4 *)(puVar10 + 10) = *(undefined4 *)(local_1d8 + 0xac);

+      *(undefined4 *)((longlong)puVar10 + 0x54) = *(undefined4 *)(local_1d8 + 0xb0);

+      *(undefined4 *)(puVar10 + 0xb) = *(undefined4 *)(local_1d8 + 0xb8);

+      *(uint *)((longlong)puVar10 + 0x5c) = (uint)*(ushort *)(local_1d8 + 0x46);

+      *(undefined4 *)(puVar10 + 0xc) = *(undefined4 *)(local_1d8 + 0x54);

+      *(undefined4 *)((longlong)puVar10 + 100) = *(undefined4 *)(local_1d8 + 0x58);

+      *(undefined4 *)(puVar10 + 0xd) = *(undefined4 *)(local_1d8 + 0xb4);

+    }

+    lVar16 = DxDdGetDxgkWin32kInterface();

+    (**(code **)(lVar16 + 0x130))(puVar10);

+    local_158 = _DAT_0;

+    uVar7 = KeQueryTimeIncrement();

+    lVar16 = (ulonglong)uVar7 * (longlong)local_158;

+    EtwActivityIdControl(3,&local_58);

+    uVar7 = DAT_6;

+    if (5 < DAT_6) {

+      puVar14 = &DAT_6;

+      cVar6 = _tlgKeywordOn(&DAT_6,0x200000000004);

+      if (cVar6 != '\0') {

+        local_218[0] = SUB41(param_6,0);

+        local_118 = local_140;

+        local_1a4 = local_20c;

+        local_1a0 = (uint)(param_2 == (undefined1 *)0x0);

+        local_158 = (ulonglong *)((longlong)puVar10 + 0x6c);

+        local_1a8 = lVar8;

+        local_120 = lVar16;

+        _tlgWriteTemplate<long___cdecl(_tlgProvider_t_const*___ptr64,void_const*___ptr64,_GUID_const*___ptr64,_GUID_const*___ptr64,unsigned_int,_EVENT_DATA_DESCRIPTOR*___ptr64),&long___cdecl__tlgWriteTransfer_EtwWriteTransfer(struct__tlgProvider_t_const*___ptr64,void_const*___ptr64,struct__GUID_const*___ptr64,struct__GUID_const*___ptr64,unsigned_int,struct__EVENT_DATA_DESCRIPTOR*___ptr64),_GUID_const*___ptr64,_GUID_const*___ptr64>

+        ::

+        Write<_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<8>,_tlgWrapperByVal<8>,_tlgWrapperByVal<1>_>

+                  ((_tlgProvider_t *)puVar14,&DAT_7,&local_58,p_Var17,

+                   (_tlgWrapSz<unsigned_short> *)&local_158,(_tlgWrapperByVal<4> *)&local_1a0,

+                   (_tlgWrapperByVal<4> *)&local_1a4,(_tlgWrapperByVal<4> *)&local_1a8,

+                   (_tlgWrapperByVal<8> *)&local_118,(_tlgWrapperByVal<8> *)&local_120,local_218);

+        uVar7 = DAT_6;

+      }

+    }

+    if (((*(uint *)((longlong)puVar10 + 0x8c) & 1) != 0) && (5 < uVar7)) {

+      puVar14 = &DAT_6;

+      cVar6 = _tlgKeywordOn(&DAT_6,0x200000000004);

+      if (cVar6 != '\0') {

+        local_19c = *(undefined4 *)(puVar10 + 0xd);

+        local_198 = *(undefined4 *)((longlong)puVar10 + 100);

+        local_194 = *(undefined4 *)(puVar10 + 0xc);

+        local_190 = *(undefined4 *)((longlong)puVar10 + 0x5c);

+        local_18c = *(undefined4 *)(puVar10 + 0xb);

+        local_188 = *(undefined4 *)((longlong)puVar10 + 0x54);

+        local_184 = *(undefined4 *)(puVar10 + 10);

+        local_180 = *(undefined4 *)(puVar10 + 9);

+        local_17c = *(undefined4 *)((longlong)puVar10 + 0x44);

+        local_178[0] = *(undefined4 *)(puVar10 + 8);

+        _tlgWriteTemplate<long___cdecl(_tlgProvider_t_const*___ptr64,void_const*___ptr64,_GUID_const*___ptr64,_GUID_const*___ptr64,unsigned_int,_EVENT_DATA_DESCRIPTOR*___ptr64),&long___cdecl__tlgWriteTransfer_EtwWriteTransfer(struct__tlgProvider_t_const*___ptr64,void_const*___ptr64,struct__GUID_const*___ptr64,struct__GUID_const*___ptr64,unsigned_int,struct__EVENT_DATA_DESCRIPTOR*___ptr64),_GUID_const*___ptr64,_GUID_const*___ptr64>

+        ::

+        Write<_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>_>

+                  ((_tlgProvider_t *)puVar14,&DAT_8,&local_58,p_Var17,

+                   (_tlgWrapperByVal<4> *)local_178,(_tlgWrapperByVal<4> *)&local_17c,

+                   (_tlgWrapperByVal<4> *)&local_180,(_tlgWrapperByVal<4> *)&local_184,

+                   (_tlgWrapperByVal<4> *)&local_188,(_tlgWrapperByVal<4> *)&local_18c,

+                   (_tlgWrapperByVal<4> *)&local_190,(_tlgWrapperByVal<4> *)&local_194,

+                   (_tlgWrapperByVal<4> *)&local_198,(_tlgWrapperByVal<4> *)&local_19c);

+      }

+    }

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar10);

+  }

+  `xxxUserChangeDisplaySettings'::__l2::_AUTO_KM::~_AUTO_KM(&local_1f8);

+  return lVar8;

 }
```

## `NtUserDisplayConfigGetDeviceInfo$filt$2`  (modified)

```diff
--- NtUserDisplayConfigGetDeviceInfo$filt$2
+++ NtUserDisplayConfigGetDeviceInfo$filt$2
@@ -1,116 +1,14 @@
 

-void NtUserDisplayConfigGetDeviceInfo_filt_2(void)

+undefined8 NtUserDisplayConfigGetDeviceInfo_filt_2(undefined8 *param_1,longlong param_2)

 

 {

-  uint uVar1;

-  uint *puVar2;

-  GdiHandleManager *this;

-  undefined1 *puVar3;

-  uint uVar4;

-  uint uVar5;

-  longlong lVar6;

-  undefined4 *in_RAX;

-  _ENTRY *p_Var7;

-  uint uVar8;

-  uint unaff_EBX;

-  longlong *unaff_RSI;

-  bool bVar9;

-  longlong *plVar10;

-  ulonglong uVar11;

-  ulonglong uVar12;

-  uint unaff_R12D;

-  uint *unaff_R13;

-  uint *puVar13;

-  undefined4 uStack0000000000000028;

+  undefined4 uVar1;

   

-  uStack0000000000000028 = *in_RAX;

-  McTemplateK0pqqq_EtwWriteTransfer(uStack0000000000000028,0xc0284408);

-  *(char *)(*unaff_RSI + 0xe) = (char)unaff_R13;

-  *(uint **)(*unaff_RSI + 0x10) = unaff_R13;

-  *(uint *)(*unaff_RSI + 8) = unaff_EBX & unaff_R12D;

-  lVar6 = SGDGetSessionState();

-  puVar2 = *(uint **)(*(longlong *)(lVar6 + 0x18) + 0x1f48);

-  lVar6 = SGDGetSessionState();

-  this = *(GdiHandleManager **)(*(longlong *)(lVar6 + 0x18) + 0x1f48);

-  uVar4 = GdiHandleManager::DecodeIndex(this,*(uint *)*unaff_RSI & 0xffffff);

-  lVar6 = *(longlong *)(this + 0x10);

-  uVar1 = *(uint *)(lVar6 + 0x808);

-  puVar13 = unaff_R13;

-  if (uVar4 < (*(ushort *)(lVar6 + 2) + 0xffff) * 0x10000 + uVar1) {

-    if (uVar4 < uVar1) {

-      lVar6 = *(longlong *)(lVar6 + 8);

-    }

-    else {

-      uVar5 = (uVar4 - uVar1 >> 0x10) + 1;

-      lVar6 = *(longlong *)(lVar6 + 8 + (ulonglong)uVar5 * 8);

-      uVar4 = uVar4 + ((unaff_R12D - uVar5) * 0x10000 - uVar1);

-    }

-    if (uVar4 < *(uint *)(lVar6 + 0x14)) {

-      puVar13 = *(uint **)(*(longlong *)

-                            (**(longlong **)(lVar6 + 0x18) + (ulonglong)(uVar4 >> 8) * 8) + 8 +

-                          ((ulonglong)uVar4 & 0xff) * 0x10);

-    }

-  }

-  uVar1 = *puVar13;

-  uVar5 = uVar1 & 0xffff;

-  uVar8 = uVar1 >> 8 & 0xff0000 | uVar5;

-  bVar9 = SUB41(unaff_R12D,0);

-  uVar4 = uVar8;

-  if (((0xffff < uVar8) && (uVar4 = uVar5, 0x10000 < *puVar2)) &&

-     (p_Var7 = GdiHandleEntryDirectory::GetEntry

-                         (*(GdiHandleEntryDirectory **)(puVar2 + 4),uVar5,bVar9), uVar4 = uVar8,

-     (uint)(byte)p_Var7[0xd] == uVar1 >> 0x18)) {

-    uVar4 = uVar5;

-  }

-  if (*(longlong *)(puVar2 + 6) != 0) {

-    lVar6 = (ulonglong)(uVar4 & 0xffff) * 4;

-    uVar1 = *(uint *)(lVar6 + *(longlong *)(puVar2 + 6));

-    if (uVar1 != 0) {

-      p_Var7 = GdiHandleEntryDirectory::AcquireEntryLock

-                         (*(GdiHandleEntryDirectory **)(puVar2 + 4),uVar1,bVar9);

-      if (p_Var7 != (_ENTRY *)0x0) {

-        GdiHandleEntryDirectory::ReleaseLockAndEntry

-                  (*(GdiHandleEntryDirectory **)(puVar2 + 4),uVar1,bVar9);

-      }

-      *(int *)(lVar6 + *(longlong *)(puVar2 + 6)) = (int)unaff_R13;

-      puVar2[1] = puVar2[1] - 1;

-    }

-  }

-  puVar3 = *(undefined1 **)(puVar2 + 4);

-  uVar1 = *(uint *)(puVar3 + 0x808);

-  if (uVar4 < (*(ushort *)(puVar3 + 2) + 0xffff) * 0x10000 + uVar1) {

-    if (uVar4 < uVar1) {

-      plVar10 = *(longlong **)(puVar3 + 8);

-    }

-    else {

-      uVar5 = (uVar4 - uVar1 >> 0x10) + 1;

-      plVar10 = *(longlong **)(puVar3 + (ulonglong)uVar5 * 8 + 8);

-      uVar4 = uVar4 + ((unaff_R12D - uVar5) * 0x10000 - uVar1);

-    }

-    uVar11 = (ulonglong)uVar4;

-    if ((uVar4 < *(uint *)((longlong)plVar10 + 0x14)) &&

-       (*(uint **)(*(longlong *)(*(longlong *)plVar10[3] + (ulonglong)(uVar4 >> 8) * 8) + 8 +

-                  (uVar11 & 0xff) * 0x10) != unaff_R13)) {

-      uVar12 = (ulonglong)(uVar4 >> 8);

-      *(uint **)(*(longlong *)(*(longlong *)plVar10[3] + uVar12 * 8) + 8 + (uVar11 & 0xff) * 0x10) =

-           unaff_R13;

-      *(ulonglong *)(*plVar10 + uVar11 * 0x18) = (ulonglong)*(uint *)((longlong)plVar10 + 0xc);

-      *(int *)(plVar10 + 2) = (int)plVar10[2] + -1;

-      *(uint *)((longlong)plVar10 + 0xc) = uVar4;

-    }

-    else {

-      uVar12 = (ulonglong)(uVar4 >> 8);

-    }

-    ExReleasePushLockExclusiveEx

-              ((uVar11 & 0xff) * 0x10 + *(longlong *)(*(longlong *)plVar10[3] + uVar12 * 8),0);

-    KeLeaveCriticalRegion();

-    *puVar3 = (char)unaff_R13;

-  }

-  *(uint **)puVar13 = unaff_R13;

-  puVar2[1] = puVar2[1] - 1;

-  *(int *)(unaff_RSI + 1) = (int)unaff_R13;

-  *unaff_RSI = (longlong)unaff_R13;

-  KeLeaveCriticalRegion();

-  return;

+  *(undefined8 **)(param_2 + 0x90) = param_1;

+  uVar1 = *(undefined4 *)*param_1;

+  *(undefined4 *)(param_2 + 0x78) = uVar1;

+  *(undefined4 *)(param_2 + 0x58) = uVar1;

+  SetLastNtError(*(undefined4 *)(param_2 + 0x58));

+  return 1;

 }
```

## `NtUserDisplayConfigGetDeviceInfo$filt$1`  (modified)

```diff
--- NtUserDisplayConfigGetDeviceInfo$filt$1
+++ NtUserDisplayConfigGetDeviceInfo$filt$1
@@ -1,119 +1,14 @@
 

-void NtUserDisplayConfigGetDeviceInfo_filt_1(void)

+undefined8 NtUserDisplayConfigGetDeviceInfo_filt_1(undefined8 *param_1,longlong param_2)

 

 {

-  uint uVar1;

-  uint *puVar2;

-  GdiHandleManager *this;

-  undefined1 *puVar3;

-  uint uVar4;

-  uint uVar5;

-  longlong lVar6;

-  undefined4 *puVar7;

-  _ENTRY *p_Var8;

-  uint uVar9;

-  uint unaff_EBX;

-  longlong *unaff_RSI;

-  longlong *plVar10;

-  ulonglong uVar11;

-  ulonglong uVar12;

-  uint *unaff_R13;

-  uint *puVar13;

+  undefined4 uVar1;

   

-  GetEtwGdiHandleType(*(uchar *)(*unaff_RSI + 0xe));

-  lVar6 = SGDGetSessionState();

-  GdiHandleManager::DecodeIndex

-            (*(GdiHandleManager **)(*(longlong *)(lVar6 + 0x18) + 0x1f48),

-             *(uint *)*unaff_RSI & 0xffffff);

-  if ((DAT_0 & 4) != 0) {

-    puVar7 = (undefined4 *)SGDGetUserSessionState();

-    McTemplateK0pqqq_EtwWriteTransfer(*puVar7,&GdiDestroyHandle);

-  }

-  *(char *)(*unaff_RSI + 0xe) = (char)unaff_R13;

-  *(uint **)(*unaff_RSI + 0x10) = unaff_R13;

-  *(uint *)(*unaff_RSI + 8) = unaff_EBX & 1;

-  lVar6 = SGDGetSessionState();

-  puVar2 = *(uint **)(*(longlong *)(lVar6 + 0x18) + 0x1f48);

-  lVar6 = SGDGetSessionState();

-  this = *(GdiHandleManager **)(*(longlong *)(lVar6 + 0x18) + 0x1f48);

-  uVar4 = GdiHandleManager::DecodeIndex(this,*(uint *)*unaff_RSI & 0xffffff);

-  lVar6 = *(longlong *)(this + 0x10);

-  uVar1 = *(uint *)(lVar6 + 0x808);

-  puVar13 = unaff_R13;

-  if (uVar4 < (*(ushort *)(lVar6 + 2) + 0xffff) * 0x10000 + uVar1) {

-    if (uVar4 < uVar1) {

-      lVar6 = *(longlong *)(lVar6 + 8);

-    }

-    else {

-      uVar5 = (uVar4 - uVar1 >> 0x10) + 1;

-      lVar6 = *(longlong *)(lVar6 + 8 + (ulonglong)uVar5 * 8);

-      uVar4 = uVar4 + ((1 - uVar5) * 0x10000 - uVar1);

-    }

-    if (uVar4 < *(uint *)(lVar6 + 0x14)) {

-      puVar13 = *(uint **)(*(longlong *)

-                            (**(longlong **)(lVar6 + 0x18) + (ulonglong)(uVar4 >> 8) * 8) + 8 +

-                          ((ulonglong)uVar4 & 0xff) * 0x10);

-    }

-  }

-  uVar1 = *puVar13;

-  uVar5 = uVar1 & 0xffff;

-  uVar9 = uVar1 >> 8 & 0xff0000 | uVar5;

-  uVar4 = uVar9;

-  if (((0xffff < uVar9) && (uVar4 = uVar5, 0x10000 < *puVar2)) &&

-     (p_Var8 = GdiHandleEntryDirectory::GetEntry

-                         (*(GdiHandleEntryDirectory **)(puVar2 + 4),uVar5,true), uVar4 = uVar9,

-     (uint)(byte)p_Var8[0xd] == uVar1 >> 0x18)) {

-    uVar4 = uVar5;

-  }

-  if (*(longlong *)(puVar2 + 6) != 0) {

-    lVar6 = (ulonglong)(uVar4 & 0xffff) * 4;

-    uVar1 = *(uint *)(lVar6 + *(longlong *)(puVar2 + 6));

-    if (uVar1 != 0) {

-      p_Var8 = GdiHandleEntryDirectory::AcquireEntryLock

-                         (*(GdiHandleEntryDirectory **)(puVar2 + 4),uVar1,true);

-      if (p_Var8 != (_ENTRY *)0x0) {

-        GdiHandleEntryDirectory::ReleaseLockAndEntry

-                  (*(GdiHandleEntryDirectory **)(puVar2 + 4),uVar1,true);

-      }

-      *(int *)(lVar6 + *(longlong *)(puVar2 + 6)) = (int)unaff_R13;

-      puVar2[1] = puVar2[1] - 1;

-    }

-  }

-  puVar3 = *(undefined1 **)(puVar2 + 4);

-  uVar1 = *(uint *)(puVar3 + 0x808);

-  if (uVar4 < (*(ushort *)(puVar3 + 2) + 0xffff) * 0x10000 + uVar1) {

-    if (uVar4 < uVar1) {

-      plVar10 = *(longlong **)(puVar3 + 8);

-    }

-    else {

-      uVar5 = (uVar4 - uVar1 >> 0x10) + 1;

-      plVar10 = *(longlong **)(puVar3 + (ulonglong)uVar5 * 8 + 8);

-      uVar4 = uVar4 + ((1 - uVar5) * 0x10000 - uVar1);

-    }

-    uVar11 = (ulonglong)uVar4;

-    if ((uVar4 < *(uint *)((longlong)plVar10 + 0x14)) &&

-       (*(uint **)(*(longlong *)(*(longlong *)plVar10[3] + (ulonglong)(uVar4 >> 8) * 8) + 8 +

-                  (uVar11 & 0xff) * 0x10) != unaff_R13)) {

-      uVar12 = (ulonglong)(uVar4 >> 8);

-      *(uint **)(*(longlong *)(*(longlong *)plVar10[3] + uVar12 * 8) + 8 + (uVar11 & 0xff) * 0x10) =

-           unaff_R13;

-      *(ulonglong *)(*plVar10 + uVar11 * 0x18) = (ulonglong)*(uint *)((longlong)plVar10 + 0xc);

-      *(int *)(plVar10 + 2) = (int)plVar10[2] + -1;

-      *(uint *)((longlong)plVar10 + 0xc) = uVar4;

-    }

-    else {

-      uVar12 = (ulonglong)(uVar4 >> 8);

-    }

-    ExReleasePushLockExclusiveEx

-              ((uVar11 & 0xff) * 0x10 + *(longlong *)(*(longlong *)plVar10[3] + uVar12 * 8),0);

-    KeLeaveCriticalRegion();

-    *puVar3 = (char)unaff_R13;

-  }

-  *(uint **)puVar13 = unaff_R13;

-  puVar2[1] = puVar2[1] - 1;

-  *(int *)(unaff_RSI + 1) = (int)unaff_R13;

-  *unaff_RSI = (longlong)unaff_R13;

-  KeLeaveCriticalRegion();

-  return;

+  *(undefined8 **)(param_2 + 0x88) = param_1;

+  uVar1 = *(undefined4 *)*param_1;

+  *(undefined4 *)(param_2 + 0x74) = uVar1;

+  *(undefined4 *)(param_2 + 0x50) = uVar1;

+  SetLastNtError(*(undefined4 *)(param_2 + 0x50));

+  return 1;

 }
```

## `NtUserDisplayConfigGetDeviceInfo$filt$0`  (modified)

```diff
--- NtUserDisplayConfigGetDeviceInfo$filt$0
+++ NtUserDisplayConfigGetDeviceInfo$filt$0
@@ -1,9 +1,14 @@
 

-void NtUserDisplayConfigGetDeviceInfo_filt_0

-               (_UNICODE_STRING *param_1,ulong param_2,_devicemodeW *param_3,ulong param_4)

+undefined8 NtUserDisplayConfigGetDeviceInfo_filt_0(undefined8 *param_1,longlong param_2)

 

 {

-  NtUserEnumDisplaySettingsExclusive(param_1,param_2,param_3,param_4);

-  return;

+  undefined4 uVar1;

+  

+  *(undefined8 **)(param_2 + 0x80) = param_1;

+  uVar1 = *(undefined4 *)*param_1;

+  *(undefined4 *)(param_2 + 0x70) = uVar1;

+  *(undefined4 *)(param_2 + 0x48) = uVar1;

+  SetLastNtError(*(undefined4 *)(param_2 + 0x48));

+  return 1;

 }
```

## `SetHandleFlag`  (modified)

```diff
--- SetHandleFlag
+++ DirectComposition::CDwmChannel::Create
@@ -1,51 +1,56 @@
 

-undefined8 SetHandleFlag(uint param_1,__uint64 param_2,int param_3)

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: static long __cdecl DirectComposition::CDwmChannel::Create(unsigned int * __ptr64) */

+

+long __cdecl DirectComposition::CDwmChannel::Create(uint *param_1)

 

 {

-  uint *puVar1;

-  uint uVar2;

-  longlong *plVar3;

-  void *_Dst;

-  CLeakTrackingAllocator *this;

-  uint uVar4;

-  undefined8 uVar5;

+  undefined8 uVar1;

+  long lVar2;

+  CConnection *this;

+  CApplicationChannel *this_00;

+  CProcessData *pCVar3;

+  CLeakTrackingAllocator *this_01;

+  __uint64 in_RDX;

   

-                    /* 0x1ab90  1889  SetHandleFlag */

-  uVar5 = 1;

-  uVar2 = (int)param_2 + (param_1 >> 2) * 3;

-  this = gpHandleFlagsMutex;

-  ExEnterCriticalRegionAndAcquireFastMutexUnsafe();

-  plVar3 = (longlong *)PsGetCurrentProcessWin32Process();

-  if ((plVar3 != (longlong *)0x0) && (*plVar3 != 0)) {

-    puVar1 = (uint *)(plVar3 + 0x59);

-    if (param_3 == 0) {

-      if (uVar2 < *puVar1) {

-        RtlClearBits(puVar1,uVar2,1);

+  this_01 = (CLeakTrackingAllocator *)param_1;

+  this = CConnection::GetDefaultConnection();

+  if (this == (CConnection *)0x0) {

+    return -0x3fffffde;

+  }

+  this_00 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                      (this_01,in_RDX,0xaf0,0x63644344);

+  if (this_00 == (CApplicationChannel *)0x0) {

+    lVar2 = -0x3fffffe9;

+  }

+  else {

+    CApplicationChannel::CApplicationChannel(this_00,this,true,0);

+    *(undefined ***)this_00 = &_vftable_;

+    lVar2 = CApplicationChannel::Initialize(this_00,(uint *)0x0,(void **)0x0);

+    if (-1 < lVar2) {

+      pCVar3 = CProcessData::Current();

+      if (pCVar3 == (CProcessData *)0x0) {

+        lVar2 = -0x3fffffff;

+      }

+      else {

+        uVar1 = *(undefined8 *)(pCVar3 + 8);

+        KeEnterCriticalRegion();

+        ExAcquireResourceExclusiveLite(uVar1,1);

+        lVar2 = CGenericTable<unsigned_int,DirectComposition::CChannel,1952662340,1>::InsertObject

+                          (*(CGenericTable<unsigned_int,DirectComposition::CChannel,1952662340,1> **

+                            )pCVar3,*(uint *)(this_00 + 0x1c),(CChannel *)this_00);

+        ExReleaseResourceLite(*(undefined8 *)(pCVar3 + 8));

+        KeLeaveCriticalRegion();

+        if (-1 < lVar2) {

+          *param_1 = *(uint *)(this_00 + 0x1c);

+          goto LAB_0;

+        }

       }

     }

-    else {

-      if (*puVar1 <= uVar2) {

-        uVar4 = uVar2 + 0x20 & 0xffffffe0;

-        _Dst = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

-                         (this,param_2,(ulonglong)(uVar4 >> 3),0x69707355);

-        if (_Dst == (void *)0x0) {

-          uVar5 = 0;

-          goto LAB_0;

-        }

-        if ((void *)plVar3[0x5a] != (void *)0x0) {

-          memcpy(_Dst,(void *)plVar3[0x5a],(ulonglong)(*puVar1 >> 3));

-          if ((void *)plVar3[0x5a] != (void *)0x0) {

-            NSInstrumentation::CLeakTrackingAllocator::Free

-                      (gpLeakTrackingAllocator,(void *)plVar3[0x5a]);

-          }

-        }

-        RtlInitializeBitMap(puVar1,_Dst,uVar4);

-      }

-      RtlSetBits(puVar1,uVar2,1);

-    }

+    (**(code **)(*(longlong *)this_00 + 0x20))(this_00,1);

   }

 LAB_0:

-  ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(gpHandleFlagsMutex);

-  return uVar5;

+  CConnection::Release(this);

+  return lVar2;

 }
```

## `HMAllocObjectEx`  (modified)

```diff
--- HMAllocObjectEx
+++ HMAllocObjectEx
@@ -1,91 +1,634 @@
 

-ulonglong HMAllocObjectEx(longlong param_1,ulonglong param_2)

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+

+undefined8

+HMAllocObjectEx(undefined8 *param_1,ulonglong *param_2,byte param_3,uint param_4,int param_5)

 

 {

-  SynchronizationObject *pSVar1;

-  longlong lVar2;

-  undefined8 uVar3;

-  char cVar4;

-  uint in_EAX;

-  undefined4 uVar5;

-  undefined8 *unaff_RBX;

-  longlong unaff_RBP;

-  ulonglong uVar6;

-  CApplicationChannel *unaff_RDI;

-  char cVar7;

-  uint unaff_R13D;

-  char unaff_R14B;

+  ushort uVar1;

+  CPointerHashTable *pCVar2;

+  code *pcVar3;

+  CLeakTrackingAllocator *pCVar4;

+  char cVar5;

+  bool bVar6;

+  uint uVar7;

+  int iVar8;

+  EtwUserHandleType EVar9;

+  longlong lVar10;

+  ulonglong *puVar11;

+  ulonglong uVar12;

+  void *pvVar13;

+  undefined8 uVar14;

+  undefined8 *puVar15;

+  undefined4 *puVar16;

+  uint uVar17;

+  CLeakTrackingAllocator *this;

+  ulonglong *puVar18;

+  undefined1 *puVar19;

+  longlong lVar20;

+  undefined4 uVar21;

+  ulonglong *puVar22;

+  undefined1 auStack_2d8 [8];

+  undefined1 auStack_2d0 [116];

+  undefined4 local_25c;

+  uint local_258 [2];

+  int *local_250;

+  ulonglong local_248;

+  ulonglong local_240;

+  longlong *local_238;

+  longlong local_230;

+  CBackTrace aCStack_228 [160];

+  CBackTrace aCStack_188 [160];

+  CBackTrace aCStack_e8 [168];

   

-  *(longlong *)(unaff_RBP + -0x39) = param_1;

-  *(undefined8 **)(unaff_RBP + -0x31) = unaff_RBX;

-  *(ulonglong *)(unaff_RBP + -0x29) = param_2;

-  uVar5 = (undefined4)param_2;

-  *(undefined4 *)(unaff_RBP + -0x21) = uVar5;

-  *(ulonglong *)(unaff_RBP + -0x19) = param_2;

-  *(undefined4 *)(unaff_RBP + -0x11) = uVar5;

-  *(ulonglong *)(unaff_RBP + -9) = param_2;

-  *(undefined4 *)(unaff_RBP + -1) = uVar5;

-  if ((unaff_RBX != (undefined8 *)0x0) || (*(ulonglong *)(unaff_RBP + 0x77) != param_2)) {

-    if ((*(byte *)(param_1 + 0xf1) & 0x20) == 0) {

-      in_EAX = 0xc0000022;

+  lVar20 = 0;

+  local_25c = 0;

+  puVar22 = param_2;

+  puVar19 = auStack_2d8;

+  if (gbInDestroyHandleTableObjects == 0) {

+    lVar10 = SGDGetUserSessionState();

+    cVar5 = ExIsResourceAcquiredExclusiveLite(*(undefined8 *)(lVar10 + 8));

+    puVar19 = auStack_2d8;

+    if (cVar5 != '\x01') {

+      bVar6 = IS_USERCRIT_OWNED_AT_ALL();

+      if (bVar6) {

+        bVar6 = tagDomLock::IsLockedExclusive(&gDomainHandleManagerLock);

+        puVar19 = auStack_2d8;

+        if (!bVar6) {

+          uVar14 = FUN_1c01328ac();

+          return uVar14;

+        }

+      }

+      else {

+        pcVar3 = (code *)swi(0x2c);

+        (*pcVar3)();

+        puVar19 = auStack_2d0;

+      }

+    }

+  }

+  lVar10 = (ulonglong)param_3 * 0x18;

+  uVar1 = *(ushort *)(&DAT_0 + lVar10);

+  *(ushort *)(puVar19 + 0x7a) = uVar1 & 3;

+  local_230 = lVar10;

+  if ((uVar1 & 3) != 0) {

+    if (((uVar1 & 2) != 0) && ((*(uint *)(param_1 + 0x3d) & 1) != 0)) {

+      *(undefined8 *)(puVar19 + -8) = 0x1c01328b8;

+      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+    }

+    if (((uVar1 & 1) != 0) && ((*(uint *)(param_1 + 0x3d) & 1) != 0)) {

+      uVar14 = FUN_1c01328be();

+      return uVar14;

+    }

+    lVar20 = param_1[0x35];

+    if (gUserProcessHandleQuota <= *(int *)(lVar20 + 0x44)) {

+      *(undefined8 *)(puVar19 + -8) = 0x1c01328d3;

+      UserSetLastError(0x486);

+      return 0;

+    }

+  }

+  while ((pCVar4 = gpLeakTrackingAllocator, param_3 == 1 || (DAT_1 == 0))) {

+    if (DAT_2 != 0) {

+      local_238 = &DAT_2;

+      goto LAB_3;

+    }

+    *(undefined8 *)(puVar19 + -8) = 0x1c0082541;

+    iVar8 = HMGrowHandleTable();

+    if (iVar8 == 0) {

+      uVar14 = FUN_1c01328c9();

+      return uVar14;

+    }

+  }

+  local_238 = &DAT_1;

+LAB_3:

+  *(ushort *)(puVar19 + 0x78) = uVar1 & 0x10;

+  if (((uVar1 & 0x10) != 0) && (param_2 != (ulonglong *)0x0)) {

+    if (DAT_4 != 0) {

+      *(undefined8 *)(puVar19 + -8) = 0x1c0082389;

+      iVar8 = (*(code *)DAT_4)();

+      pCVar4 = gpLeakTrackingAllocator;

+      if (-1 < iVar8) {

+        if ((uVar1 >> 9 & 1) == 0) {

+          uVar7 = *(uint *)(&DAT_5 + lVar10);

+          uVar12 = (ulonglong)param_4;

+          *(uint *)(puVar19 + 0x48) = uVar7;

+          *(uint *)(puVar19 + 0x50) = uVar7;

+          iVar8 = *(int *)gpLeakTrackingAllocator;

+          local_248 = 0x104;

+          *(ulonglong *)(puVar19 + 0x70) = uVar12;

+          if (iVar8 == 0) {

+            *(undefined8 *)(puVar19 + -8) = 0x1c00824b8;

+            puVar11 = (ulonglong *)ExAllocatePool2(0x104,uVar12,uVar7);

+            if (puVar11 != (ulonglong *)0x0) {

+              LOCK();

+              *(longlong *)(pCVar4 + 0x70) = *(longlong *)(pCVar4 + 0x70) + 1;

+              UNLOCK();

+            }

+          }

+          else {

+            if (iVar8 == 1) {

+              *(undefined8 *)(puVar19 + -8) = 0x1c01328e7;

+              bVar6 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                                (gpLeakTrackingAllocator,uVar7);

+              if ((bVar6) && (uVar12 < uVar12 + 0x10)) {

+                *(undefined8 *)(puVar19 + -8) = 0x1c0132914;

+                puVar11 = (ulonglong *)

+                          ExAllocatePool2(local_248 & 0xfffffffffffffffd,uVar12 + 0x10,

+                                          *(undefined4 *)(puVar19 + 0x50));

+                if (puVar11 == (ulonglong *)0x0) {

+                  pvVar13 = (void *)(ulonglong)*(uint *)(puVar19 + 0x48);

+                  puVar11 = (ulonglong *)0x0;

+                }

+                else {

+                  LOCK();

+                  *(longlong *)(pCVar4 + 0x70) = *(longlong *)(pCVar4 + 0x70) + 1;

+                  UNLOCK();

+                  pvVar13 = (void *)(ulonglong)*(uint *)(puVar19 + 0x48);

+                  *puVar11 = (ulonglong)pvVar13;

+                  puVar11 = puVar11 + 2;

+                  if (puVar11 != (ulonglong *)0x0) goto LAB_6;

+                }

+                pCVar2 = *(CPointerHashTable **)(pCVar4 + 8);

+                *(undefined8 *)(puVar19 + -8) = 0x1c0132946;

+                NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement(pCVar2,pvVar13);

+                goto LAB_6;

+              }

+            }

+            else if (iVar8 == 2) {

+              *(undefined8 *)(puVar19 + 0x60) = 0;

+              *(undefined8 *)(puVar19 + -8) = 0x1c013296b;

+              bVar6 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                                (gpLeakTrackingAllocator,uVar7,(__uint64 *)(puVar19 + 0x60));

+              if (!bVar6) {

+                *(ulonglong **)(puVar19 + 0x60) = &local_248;

+                *(undefined1 **)(puVar19 + 0x68) = puVar19 + 0x50;

+                *(undefined8 *)(puVar19 + -8) = 0x1c0132994;

+                puVar11 = (ulonglong *)

+                          NSInstrumentation::CLeakTrackingAllocator::

+                          MakeUntrackedAllocation<<lambda_992394a475252bc644037de3157b7526>,unsigned___int64_&>

+                                    (pCVar4,puVar19 + 0x60,puVar19 + 0x70);

+                goto LAB_6;

+              }

+              puVar19[0x40] = 0;

+              if ((uVar12 < 0x1000) || ((param_4 & 0xfff) != 0)) {

+                uVar12 = uVar12 + 0x10;

+                puVar19[0x40] = 1;

+                *(ulonglong *)(puVar19 + 0x70) = uVar12;

+              }

+              *(undefined8 *)(puVar19 + -8) = 0x1c01329d3;

+              puVar11 = (ulonglong *)ExAllocatePool2(0x104,uVar12,uVar7);

+              if (puVar11 != (ulonglong *)0x0) {

+                LOCK();

+                *(longlong *)(pCVar4 + 0x80) = *(longlong *)(pCVar4 + 0x80) + 1;

+                UNLOCK();

+                *(undefined8 *)(puVar19 + -8) = 0x1c01329f1;

+                NSInstrumentation::CBackTrace::CBackTrace(aCStack_228);

+                if ((puVar19[0x40] == '\0') || (0xfff < ((uint)puVar11 & 0xfff) + 0x10)) {

+                  *(undefined8 *)(puVar19 + -8) = 0x1c0132a41;

+                  bVar6 = NSInstrumentation::CLeakTrackingAllocator::

+                          AssociateAllocationWithBacktrace<0>

+                                    (pCVar4,puVar11,*(__uint64 *)(puVar19 + 0x60),aCStack_228);

+                  if (!bVar6) goto LAB_7;

+                }

+                else {

+                  *(undefined8 *)(puVar19 + -8) = 0x1c0132a20;

+                  bVar6 = NSInstrumentation::CLeakTrackingAllocator::

+                          AssociateAllocationWithBacktrace<1>

+                                    (pCVar4,puVar11,*(__uint64 *)(puVar19 + 0x60),aCStack_228);

+                  if (!bVar6) {

+LAB_7:

+                    LOCK();

+                    *(longlong *)(pCVar4 + 0x88) = *(longlong *)(pCVar4 + 0x88) + 1;

+                    UNLOCK();

+                    *(undefined8 *)(puVar19 + -8) = 0x1c0132a59;

+                    ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                              (puVar11);

+                    goto LAB_8;

+                  }

+                  puVar11 = puVar11 + 2;

+                }

+                goto LAB_6;

+              }

+            }

+LAB_8:

+            puVar11 = (ulonglong *)0x0;

+          }

+        }

+        else {

+          *(undefined8 *)(puVar19 + -8) = 0x1c00823a5;

+          puVar11 = HMAllocateIsolatedType(param_3);

+        }

+LAB_6:

+        if (puVar11 == (ulonglong *)0x0) goto LAB_9;

+        uVar21 = *(undefined4 *)(&DAT_10 + lVar10);

+        if (DAT_11 == 0) {

+          puVar11[5] = 0;

+        }

+        else {

+          *(undefined8 *)(puVar19 + -8) = 0x1c00823d6;

+          uVar12 = (*(code *)DAT_11)(param_2,uVar21,(uint)param_3 << 0x10 | 5);

+          puVar11[5] = uVar12;

+          if (uVar12 != 0) {

+            uVar12 = puVar11[3];

+            *(undefined8 *)(puVar19 + -8) = 0x1c00823f1;

+            ObfReferenceObject(param_2);

+            puVar11[3] = (ulonglong)param_2;

+            if (uVar12 != 0) {

+              *(undefined8 *)(puVar19 + -8) = 0x1c0132a6a;

+              ObfDereferenceObject(uVar12);

+            }

+            puVar11[4] = (ulonglong)puVar11;

+            puVar11[6] = puVar11[5] - param_2[0x10];

+            goto LAB_9;

+          }

+        }

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132a8c;

+        HMFreeUserOrIsolatedType(uVar1,param_3,puVar11);

+      }

+    }

+    puVar11 = (ulonglong *)0x0;

+    goto LAB_9;

+  }

+  if ((uVar1 & 0x40) == 0) {

+    if ((param_2 == (ulonglong *)0x0) && ((uVar1 & 0x20) != 0)) {

+      *(undefined4 *)(puVar19 + 0x7c) = 1;

     }

     else {

-      do {

-        if (unaff_RBX == (undefined8 *)0x0) break;

-        in_EAX = DirectComposition::CApplicationChannel::CMilCommandBatchParser::

-                 ValidateAndTranslateCommandBlock

-                           ((CMilCommandBatchParser *)(unaff_RBP + -0x39),unaff_RBX + 3,

-                            *(uint *)((longlong)unaff_RBX + 0x14));

-        unaff_RBX = (undefined8 *)*unaff_RBX;

-        param_2 = 0;

-      } while (-1 < (int)in_EAX);

-      unaff_RBX = *(undefined8 **)(unaff_RBP + -0x31);

-    }

+      *(undefined4 *)(puVar19 + 0x7c) = 0;

+    }

+    if ((uVar1 >> 9 & 1) == 0) {

+      puVar18 = (ulonglong *)(ulonglong)param_4;

+      local_250 = (int *)0x104;

+      this = (CLeakTrackingAllocator *)(&DAT_5 + lVar10);

+      *(ulonglong **)(puVar19 + 0x70) = puVar18;

+      *(CLeakTrackingAllocator **)(puVar19 + 0x48) = this;

+      uVar7 = *(uint *)this;

+      puVar22 = (ulonglong *)(ulonglong)uVar7;

+      iVar8 = *(int *)gpLeakTrackingAllocator;

+      *(uint *)(puVar19 + 0x50) = uVar7;

+      local_258[0] = uVar7;

+      if (iVar8 == 0) {

+        *(undefined8 *)(puVar19 + -8) = 0x1c0082133;

+        puVar11 = (ulonglong *)ExAllocatePool2(0x104,puVar18,puVar22);

+        if (puVar11 != (ulonglong *)0x0) {

+          LOCK();

+          *(longlong *)(pCVar4 + 0x70) = *(longlong *)(pCVar4 + 0x70) + 1;

+          UNLOCK();

+        }

+LAB_12:

+        this = *(CLeakTrackingAllocator **)(puVar19 + 0x48);

+        puVar22 = puVar18;

+        lVar10 = local_230;

+      }

+      else if (iVar8 == 1) {

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132c8a;

+        bVar6 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                          (gpLeakTrackingAllocator,uVar7);

+        if ((bVar6) && (puVar18 < puVar18 + 2)) {

+          *(undefined8 *)(puVar19 + -8) = 0x1c0132cb6;

+          puVar15 = (undefined8 *)

+                    ExAllocatePool2((ulonglong)local_250 & 0xfffffffffffffffd,puVar18 + 2,

+                                    local_258[0]);

+          if (puVar15 == (undefined8 *)0x0) {

+            puVar18 = (ulonglong *)(ulonglong)*(uint *)(puVar19 + 0x50);

+            puVar11 = (ulonglong *)0x0;

+          }

+          else {

+            LOCK();

+            *(longlong *)(pCVar4 + 0x70) = *(longlong *)(pCVar4 + 0x70) + 1;

+            UNLOCK();

+            puVar18 = (ulonglong *)(ulonglong)*(uint *)(puVar19 + 0x50);

+            *puVar15 = puVar18;

+            puVar11 = puVar15 + 2;

+            if (puVar11 != (ulonglong *)0x0) goto LAB_12;

+          }

+          pCVar2 = *(CPointerHashTable **)(pCVar4 + 8);

+          *(undefined8 *)(puVar19 + -8) = 0x1c0132cea;

+          NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement(pCVar2,puVar18);

+          this = *(CLeakTrackingAllocator **)(puVar19 + 0x48);

+          puVar22 = puVar18;

+          lVar10 = local_230;

+        }

+        else {

+LAB_13:

+          this = *(CLeakTrackingAllocator **)(puVar19 + 0x48);

+LAB_14:

+          puVar11 = (ulonglong *)0x0;

+          lVar10 = local_230;

+        }

+      }

+      else {

+        if (iVar8 != 2) goto LAB_14;

+        *(undefined8 *)(puVar19 + 0x60) = 0;

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132d13;

+        bVar6 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                          (gpLeakTrackingAllocator,uVar7,(__uint64 *)(puVar19 + 0x60));

+        if (!bVar6) {

+          *(int ***)(puVar19 + 0x60) = &local_250;

+          puVar22 = (ulonglong *)(puVar19 + 0x60);

+          *(uint **)(puVar19 + 0x68) = local_258;

+          *(undefined8 *)(puVar19 + -8) = 0x1c0132d3b;

+          puVar11 = (ulonglong *)

+                    NSInstrumentation::CLeakTrackingAllocator::

+                    MakeUntrackedAllocation<<lambda_992394a475252bc644037de3157b7526>,unsigned___int64_&>

+                              (pCVar4,puVar22,puVar19 + 0x70);

+          this = *(CLeakTrackingAllocator **)(puVar19 + 0x48);

+          lVar10 = local_230;

+          goto LAB_15;

+        }

+        puVar19[0x40] = 0;

+        if ((puVar18 < (ulonglong *)0x1000) || (puVar22 = puVar18, (param_4 & 0xfff) != 0)) {

+          puVar22 = puVar18 + 2;

+          puVar19[0x40] = 1;

+          *(ulonglong **)(puVar19 + 0x70) = puVar22;

+        }

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132d7f;

+        puVar11 = (ulonglong *)ExAllocatePool2(0x104,puVar22,uVar7);

+        if (puVar11 == (ulonglong *)0x0) goto LAB_13;

+        LOCK();

+        *(longlong *)(pCVar4 + 0x80) = *(longlong *)(pCVar4 + 0x80) + 1;

+        UNLOCK();

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132da5;

+        NSInstrumentation::CBackTrace::CBackTrace(aCStack_e8);

+        puVar22 = puVar11;

+        if ((puVar19[0x40] == '\0') || (0xfff < ((uint)puVar11 & 0xfff) + 0x10)) {

+          *(undefined8 *)(puVar19 + -8) = 0x1c0132e00;

+          bVar6 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

+                            (pCVar4,puVar11,*(__uint64 *)(puVar19 + 0x60),aCStack_e8);

+          if (!bVar6) goto LAB_16;

+          this = *(CLeakTrackingAllocator **)(puVar19 + 0x48);

+          lVar10 = local_230;

+        }

+        else {

+          *(undefined8 *)(puVar19 + -8) = 0x1c0132dd7;

+          bVar6 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

+                            (pCVar4,puVar11,*(__uint64 *)(puVar19 + 0x60),aCStack_e8);

+          if (!bVar6) {

+LAB_16:

+            LOCK();

+            *(longlong *)(pCVar4 + 0x88) = *(longlong *)(pCVar4 + 0x88) + 1;

+            UNLOCK();

+            *(undefined8 *)(puVar19 + -8) = 0x1c0132e1f;

+            ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                      (puVar11);

+            goto LAB_13;

+          }

+          this = *(CLeakTrackingAllocator **)(puVar19 + 0x48);

+          puVar11 = puVar11 + 2;

+          lVar10 = local_230;

+        }

+      }

+    }

+    else {

+      *(undefined8 *)(puVar19 + -8) = 0x1c00824eb;

+      puVar11 = HMAllocateIsolatedType(param_3);

+      this = (CLeakTrackingAllocator *)(&DAT_5 + lVar10);

+    }

+LAB_15:

+    if (puVar11 != (ulonglong *)0x0) {

+      if (param_3 == 1) {

+        uVar7 = *(uint *)this;

+        uVar17 = *(uint *)(&DAT_10 + lVar10);

+        *(undefined8 *)(puVar19 + -8) = 0x1c0082656;

+        pvVar13 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                            (this,(__uint64)puVar22,(ulonglong)uVar17,uVar7);

+        puVar11[5] = (ulonglong)pvVar13;

+        if (pvVar13 == (void *)0x0) {

+          uVar14 = FUN_1c0132e2b();

+          return uVar14;

+        }

+      }

+      if ((uVar1 >> 8 & 1) != 0) {

+        *(undefined8 *)(puVar19 + -8) = 0x1c0082533;

+        LockObjectAssignment(puVar11 + 3,param_2);

+        puVar11[4] = (ulonglong)puVar11;

+      }

+      goto LAB_9;

+    }

+    goto LAB_17;

   }

-  uVar6 = param_2 & 0xffffffff;

-  if ((int)in_EAX < 0) {

-    uVar6 = (ulonglong)in_EAX;

+  uVar12 = (ulonglong)param_4;

+  local_250 = (int *)(&DAT_10 + lVar10);

+  if (*local_250 == 0) {

+    *(undefined8 *)(puVar19 + -8) = 0x1c0132aa6;

+    puVar11 = (ulonglong *)RtlAllocateHeap(gpvSharedAlloc,0,uVar12);

+    if (puVar11 == (ulonglong *)0x0) goto LAB_9;

+    puVar11[3] = 0;

+    puVar11[4] = 0;

+    puVar11[6] = (longlong)puVar11 - gpvSharedAlloc;

+    puVar11[5] = 0;

+LAB_18:

+    uVar7 = giheLast;

+    lVar10 = *local_238;

+    puVar22 = (ulonglong *)(lVar10 * 0x20 + DAT_19);

+    uVar17 = (uint)lVar10;

+    puVar15 = (undefined8 *)(gpKernelHandleTable + lVar10 * 0x18);

+    *local_238 = *(longlong *)(gpKernelHandleTable + lVar10 * 0x18);

+    if (uVar7 < uVar17) {

+      giheLast = uVar17;

+    }

+    *(byte *)(puVar22 + 3) = param_3;

+    *puVar15 = puVar11;

+    if ((uVar1 & 0x40) == 0) {

+      if ((*(short *)(puVar19 + 0x78) == 0) || (param_2 == (ulonglong *)0x0)) {

+        *puVar22 = 0;

+      }

+      else {

+        *puVar22 = puVar11[6];

+        puVar22[2] = **(ulonglong **)param_2[1];

+      }

+    }

+    else {

+      *puVar22 = puVar11[6];

+    }

+    if (*(int *)(puVar19 + 0x7c) != 0) {

+      *(byte *)((longlong)puVar22 + 0x19) = *(byte *)((longlong)puVar22 + 0x19) | 0x40;

+    }

+    if (param_5 != 0) {

+      *(byte *)((longlong)puVar22 + 0x19) = *(byte *)((longlong)puVar22 + 0x19) | 0x80;

+    }

+    if ((uVar1 & 2) == 0) {

+      if ((uVar1 & 1) != 0) {

+        puVar15[1] = param_1;

+        uVar14 = *param_1;

+        *(undefined8 *)(puVar19 + -8) = 0x1c0082263;

+        uVar12 = PsGetThreadId(uVar14);

+        puVar22[1] = uVar12;

+        puVar11[2] = puVar15[1];

+      }

+    }

+    else {

+      puVar11[2] = 0;

+      puVar15[1] = param_1[0x35];

+      uVar14 = *(undefined8 *)param_1[0x35];

+      *(undefined8 *)(puVar19 + -8) = 0x1c0082232;

+      uVar12 = PsGetProcessId(uVar14);

+      puVar22[1] = uVar12;

+      if ((uVar1 & 4) != 0) {

+        puVar11[3] = param_1[0x35];

+      }

+    }

+    lVar10 = (ulonglong)DAT_20 * lVar10 + DAT_1c02c9e28;

+    uVar17 = (uint)*(ushort *)(lVar10 + 0x1a) << 0x10 | uVar17;

+    if (*(char *)(lVar10 + 0x19) < '\0') {

+      uVar17 = uVar17 | 0x80000000;

+    }

+    *puVar11 = (longlong)(int)uVar17;

+    if (*(int *)(&DAT_10 + local_230) != 0) {

+      puVar22 = (ulonglong *)puVar11[5];

+      *puVar22 = (longlong)(int)uVar17;

+      puVar22[1] = puVar11[6];

+    }

+    if (lVar20 != 0) {

+      uVar7 = *(int *)(lVar20 + 0x44) + 1;

+      *(uint *)(lVar20 + 0x44) = uVar7;

+      if (*(uint *)(lVar20 + 0x48) < uVar7) {

+        *(uint *)(lVar20 + 0x48) = uVar7;

+      }

+    }

+    giheCount = giheCount + 1;

+    if (giheCountPeak < giheCount) {

+      giheCountPeak = giheCount;

+    }

+    if (*(short *)(puVar19 + 0x7a) == 0) {

+      *(undefined8 *)(puVar19 + -8) = 0x1c008255a;

+      EVar9 = GetEtwUserHandleType(param_3);

+      uVar12 = *puVar11;

+      *(undefined8 *)(puVar19 + -8) = 0x1c0082567;

+      EtwTraceUserCreateHandle(uVar12,EVar9,0);

+    }

+    else {

+      uVar14 = *(undefined8 *)param_1[0x35];

+      *(undefined8 *)(puVar19 + -8) = 0x1c0082303;

+      uVar7 = PsGetProcessId(uVar14);

+      if ((DAT_21 & 2) != 0) {

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132e5c;

+        puVar16 = (undefined4 *)SGDGetUserSessionState();

+        uVar21 = *puVar16;

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132e73;

+        EVar9 = GetEtwUserHandleType(param_3);

+        *(uint *)(puVar19 + 0x30) = uVar7 & 0xfffffffc;

+        *(undefined4 *)(puVar19 + 0x28) = uVar21;

+        *(EtwUserHandleType *)(puVar19 + 0x20) = EVar9;

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132e8f;

+        McTemplateK0pqqq_EtwWriteTransfer();

+      }

+    }

+    uVar14 = *puVar15;

+    puVar15[2] = 0;

   }

-  *(int *)(unaff_RBP + 0x6f) = (int)uVar6;

-  if (-1 < (int)uVar6) {

-    if (unaff_R14B != '\0') {

-      unaff_RDI[0xf0] = (CApplicationChannel)((byte)unaff_RDI[0xf0] | 0x30);

-    }

-    if (unaff_RBX != (undefined8 *)0x0) {

-      *(undefined8 **)(unaff_RBP + -0x29) = unaff_RBX;

-      *(undefined4 *)(unaff_RBP + -0x21) = *(undefined4 *)((longlong)unaff_RBX + 0x14);

-      *(undefined8 **)(unaff_RBP + -0x19) = unaff_RBX + 3;

-      *(undefined4 *)(unaff_RBP + -0x11) = *(undefined4 *)(unaff_RBX + 3);

-    }

-    pSVar1 = *(SynchronizationObject **)(unaff_RBP + 0x67);

-    cVar7 = *(char *)(unaff_RBP + 0x47);

-    do {

-      *(ulonglong *)(unaff_RBP + 0x47) = param_2;

-      *(ulonglong *)(unaff_RBP + -0x49) = param_2;

-      cVar4 = func_0x0001c0057a10();

-      if (*(CBatch **)(unaff_RBP + 0x47) != (CBatch *)0x0) {

-        DirectComposition::CApplicationChannel::SubmitBatch

-                  (unaff_RDI,*(CBatch **)(unaff_RBP + 0x47),*(CBatch **)(unaff_RBP + -0x49),

-                   (bool)((byte)unaff_RDI[0x30] & 1),pSVar1);

-        cVar7 = '\x01';

-      }

-      param_2 = 0;

-    } while (cVar4 == '\0');

-    uVar6 = (ulonglong)*(uint *)(unaff_RBP + 0x6f);

-    lVar2 = *(longlong *)(unaff_RBP + 0x4f);

-    if (cVar7 == '\0') {

-      *(uint *)(unaff_RBP + -0x49) = unaff_R13D;

-      *(undefined4 *)(unaff_RBP + -0x45) = 0;

-      *(undefined8 *)(unaff_RBP + -0x41) = *(undefined8 *)(unaff_RDI + 0x178);

-      uVar3 = *(undefined8 *)(unaff_RBP + -0x41);

-      *(undefined8 *)(unaff_RDI + (ulonglong)(unaff_R13D & 0x7f) * 0x10 + 0x218) =

-           *(undefined8 *)(unaff_RBP + -0x49);

-      *(undefined8 *)(unaff_RDI + (ulonglong)(unaff_R13D & 0x7f) * 0x10 + 0x218 + 8) = uVar3;

-    }

-    if (lVar2 != 0) {

-      *(bool *)lVar2 = *(int *)(unaff_RDI + 0x20c) != 0;

-    }

+  else {

+    uVar7 = *(uint *)(&DAT_5 + lVar10);

+    pvVar13 = (void *)(ulonglong)uVar7;

+    *(uint *)(puVar19 + 0x48) = uVar7;

+    local_240 = 0x104;

+    iVar8 = *(int *)gpLeakTrackingAllocator;

+    *(ulonglong *)(puVar19 + 0x70) = uVar12;

+    if (iVar8 == 0) {

+      *(undefined8 *)(puVar19 + -8) = 0x1c00825c8;

+      puVar11 = (ulonglong *)ExAllocatePool2(0x104,uVar12,pvVar13);

+      if (puVar11 != (ulonglong *)0x0) {

+        LOCK();

+        *(longlong *)(pCVar4 + 0x70) = *(longlong *)(pCVar4 + 0x70) + 1;

+        UNLOCK();

+      }

+LAB_22:

+      if (puVar11 != (ulonglong *)0x0) {

+LAB_23:

+        iVar8 = *local_250;

+        *(undefined8 *)(puVar19 + -8) = 0x1c00825fd;

+        uVar12 = RtlAllocateHeap(gpvSharedAlloc,0,iVar8);

+        puVar11[5] = uVar12;

+        if (uVar12 == 0) {

+          *(undefined8 *)(puVar19 + -8) = 0x1c0132c5a;

+          NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar11);

+          goto LAB_17;

+        }

+        puVar11[3] = 0;

+        puVar11[4] = 0;

+        puVar11[6] = uVar12 - gpvSharedAlloc;

+      }

+LAB_9:

+      if (puVar11 != (ulonglong *)0x0) goto LAB_18;

+    }

+    else if (iVar8 == 1) {

+      *(undefined8 *)(puVar19 + -8) = 0x1c0132aef;

+      bVar6 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                        (gpLeakTrackingAllocator,uVar7);

+      if ((bVar6) && (uVar12 < uVar12 + 0x10)) {

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132b1c;

+        puVar11 = (ulonglong *)

+                  ExAllocatePool2(local_240 & 0xfffffffffffffffd,uVar12 + 0x10,

+                                  *(undefined4 *)(puVar19 + 0x48));

+        if (puVar11 != (ulonglong *)0x0) {

+          LOCK();

+          *(longlong *)(pCVar4 + 0x70) = *(longlong *)(pCVar4 + 0x70) + 1;

+          UNLOCK();

+          *puVar11 = (ulonglong)pvVar13;

+          puVar11 = puVar11 + 2;

+          if (puVar11 != (ulonglong *)0x0) goto LAB_22;

+        }

+        pCVar2 = *(CPointerHashTable **)(pCVar4 + 8);

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132b47;

+        NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement(pCVar2,pvVar13);

+        goto LAB_22;

+      }

+    }

+    else if (iVar8 == 2) {

+      *(undefined8 *)(puVar19 + 0x60) = 0;

+      *(undefined8 *)(puVar19 + -8) = 0x1c0132b6f;

+      bVar6 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                        (gpLeakTrackingAllocator,uVar7,(__uint64 *)(puVar19 + 0x60));

+      if (!bVar6) {

+        *(ulonglong **)(puVar19 + 0x60) = &local_240;

+        *(undefined1 **)(puVar19 + 0x68) = puVar19 + 0x48;

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132b98;

+        puVar11 = (ulonglong *)

+                  NSInstrumentation::CLeakTrackingAllocator::

+                  MakeUntrackedAllocation<<lambda_992394a475252bc644037de3157b7526>,unsigned___int64_&>

+                            (pCVar4,puVar19 + 0x60,puVar19 + 0x70);

+        goto LAB_22;

+      }

+      bVar6 = false;

+      if ((uVar12 < 0x1000) || ((param_4 & 0xfff) != 0)) {

+        uVar12 = uVar12 + 0x10;

+        bVar6 = true;

+        *(ulonglong *)(puVar19 + 0x70) = uVar12;

+      }

+      *(undefined8 *)(puVar19 + -8) = 0x1c0132bd3;

+      puVar11 = (ulonglong *)ExAllocatePool2(0x104,uVar12,pvVar13);

+      if (puVar11 == (ulonglong *)0x0) goto LAB_17;

+      LOCK();

+      *(longlong *)(pCVar4 + 0x80) = *(longlong *)(pCVar4 + 0x80) + 1;

+      UNLOCK();

+      *(undefined8 *)(puVar19 + -8) = 0x1c0132bf1;

+      NSInstrumentation::CBackTrace::CBackTrace(aCStack_188);

+      if ((bVar6) && (((uint)puVar11 & 0xfff) + 0x10 < 0x1000)) {

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132c1e;

+        bVar6 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

+                          (pCVar4,puVar11,*(__uint64 *)(puVar19 + 0x60),aCStack_188);

+        if (bVar6) {

+          puVar11 = puVar11 + 2;

+          goto LAB_22;

+        }

+      }

+      else {

+        *(undefined8 *)(puVar19 + -8) = 0x1c0132c3f;

+        bVar6 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

+                          (pCVar4,puVar11,*(__uint64 *)(puVar19 + 0x60),aCStack_188);

+        if (bVar6) goto LAB_23;

+      }

+      LOCK();

+      *(longlong *)(pCVar4 + 0x88) = *(longlong *)(pCVar4 + 0x88) + 1;

+      UNLOCK();

+      *(undefined8 *)(puVar19 + -8) = 0x1c0132c7b;

+      ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                (puVar11);

+    }

+LAB_17:

+    *(undefined8 *)(puVar19 + -8) = 0x1c0132c64;

+    UserSetLastError(8);

+    uVar14 = 0;

   }

-  return uVar6;

+  return uVar14;

 }
```

## `xxxCreateThreadInfo`  (modified)

```diff
--- xxxCreateThreadInfo
+++ xxxCreateThreadInfo
@@ -1,13 +1,924 @@
 

-byte xxxCreateThreadInfo(char param_1)

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

+

+int xxxCreateThreadInfo(undefined8 param_1)

 

 {

-  char *pcVar1;

-  byte in_AL;

-  undefined7 in_register_00000001;

+  void *_Src;

+  undefined8 uVar1;

+  tagQ *ptVar2;

+  code *pcVar3;

+  bool bVar4;

+  bool bVar5;

+  undefined4 uVar6;

+  int iVar7;

+  ulong uVar8;

+  int iVar9;

+  int iVar10;

+  longlong lVar11;

+  longlong *plVar12;

+  undefined8 *puVar13;

+  _EPROCESS *p_Var14;

+  undefined8 uVar15;

+  longlong lVar16;

+  tagQ *ptVar17;

+  tagTHREADINFO *ptVar18;

+  uint uVar19;

+  undefined1 *puVar20;

+  char cVar21;

+  void *pvVar22;

+  uint *puVar23;

+  ulonglong uVar24;

+  tagTHREADINFO *this;

+  undefined1 *puVar25;

+  uint *puVar26;

+  uint uVar27;

+  uint uVar28;

+  longlong lVar29;

+  ushort uStackX_22;

+  undefined1 auStack_1b8 [8];

+  undefined1 auStack_1b0 [72];

+  undefined8 local_168;

+  longlong local_160;

+  undefined8 local_158;

+  longlong local_150;

+  undefined8 local_148;

+  undefined8 local_140;

+  longlong local_138;

+  uint *local_130;

+  void *local_128;

+  undefined8 local_118;

+  undefined8 local_110;

+  undefined8 local_108;

+  undefined8 uStack_100;

+  undefined8 local_f8;

+  ulonglong uStack_f0;

+  void *local_e8;

+  undefined8 local_e0;

+  ulonglong local_d8;

+  undefined8 *local_c8;

+  undefined8 local_b8;

+  undefined8 uStack_b0;

+  undefined8 local_a8;

+  undefined8 uStack_a0;

+  undefined8 local_98;

+  undefined8 uStack_90;

+  undefined8 local_88;

+  undefined8 local_80;

+  undefined8 uStack_78;

+  undefined8 local_70;

   

-  pcVar1 = (char *)(CONCAT71(in_register_00000001,in_AL) + -0x75);

-  *pcVar1 = *pcVar1 + param_1;

-  return in_AL & 0x30;

+  puVar25 = auStack_1b8;

+  this = (tagTHREADINFO *)0x0;

+  uVar27 = 0;

+  lVar11 = PsGetThreadProcess();

+  local_118 = 0;

+  local_110 = 0;

+  local_108 = 0;

+  uStack_100 = 0;

+  local_f8 = 0;

+  uStack_f0 = 0;

+  local_e0 = 0;

+  local_d8 = 0;

+  local_168 = 0;

+  local_148 = 0;

+  local_158 = 0;

+  local_140 = 0;

+  local_98 = 0;

+  uStack_90 = 0;

+  local_88 = 0;

+  local_80 = 0;

+  uStack_78 = 0;

+  local_70 = 0;

+  local_128 = (void *)0x0;

+  local_b8 = 0;

+  uStack_b0 = 0;

+  local_a8 = 0;

+  uStack_a0 = 0;

+  local_150 = lVar11;

+  if (DAT_0 < '\0') {

+    McTemplateK0_EtwWriteTransfer(0,&InitiateGuiThreadExecution,&W32kControlGuid);

+  }

+  if ((((gbCleanedUpResources != 0) ||

+       (plVar12 = (longlong *)PsGetCurrentProcessWin32Process(), plVar12 == (longlong *)0x0)) ||

+      (*plVar12 == 0)) || (plVar12 == (longlong *)0x0)) {

+    return -0x3ffffef6;

+  }

+  gdwGuiThreads = gdwGuiThreads + 1;

+  if (lVar11 == gpepCSRSS) {

+    uVar27 = 0x2000048;

+  }

+  puVar13 = (undefined8 *)PsGetThreadWin32Thread(param_1);

+  if (puVar13 != (undefined8 *)0x0) {

+    this = (tagTHREADINFO *)*puVar13;

+  }

+  tagTHREADINFO::Initialize(this);

+  local_e8 = (void *)0x0;

+  lVar11 = PsGetProcessPeb(lVar11);

+  local_160 = *(longlong *)(lVar11 + 0x20);

+  local_c8 = &local_118;

+  local_118 = *(undefined8 *)(local_160 + 0x20);

+  local_110 = *(undefined8 *)(local_160 + 0x28);

+  local_108 = *(undefined8 *)(local_160 + 0x88);

+  uStack_100 = *(undefined8 *)(local_160 + 0x90);

+  local_f8 = *(undefined8 *)(local_160 + 0xa4);

+  puVar23 = (uint *)(local_160 + 0xc0);

+  if (*(uint **)MmUserProbeAddress_exref <= (uint *)(local_160 + 0xc0)) {

+    puVar23 = *(uint **)MmUserProbeAddress_exref;

+  }

+  uVar28 = *puVar23;

+  uStack_f0 = CONCAT44(uStack_f0._4_4_,uVar28);

+  _Src = *(void **)(puVar23 + 2);

+  if ((ushort)uVar28 != 0) {

+    local_e8 = _Src;

+    if (((ulonglong)_Src & 1) != 0) {

+                    /* WARNING: Subroutine does not return */

+      ExRaiseDatatypeMisalignment();

+    }

+    pvVar22 = (void *)((longlong)_Src + (ulonglong)(uVar28 & 0xffff) + 2);

+    if ((pvVar22 <= _Src) || (*(void **)MmUserProbeAddress_exref <= pvVar22)) {

+                    /* WARNING: Subroutine does not return */

+      ExRaiseAccessViolation();

+    }

+    uStackX_22 = (ushort)(uVar28 >> 0x10);

+    if (uStackX_22 < (ushort)uVar28) {

+      if ((uVar28 & 1) == 0) goto LAB_1;

+    }

+    else if ((uVar28 & 1) == 0) {

+      local_128 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                            ((CLeakTrackingAllocator *)(ulonglong)uVar28,(__uint64)pvVar22,

+                             (ulonglong)(uVar28 & 0xffff),0x79747355);

+      local_e8 = local_128;

+      if (local_128 == (void *)0x0) {

+                    /* WARNING: Subroutine does not return */

+        ExRaiseStatus(0xc0000017);

+      }

+      if (DAT_2 != 0) {

+        (*(code *)DAT_2)(local_128,&local_80,Win32FreePool);

+      }

+      memcpy(local_e8,_Src,uStack_f0 & 0xffff);

+      goto LAB_3;

+    }

+    MicrosoftTelemetryAssertTriggeredNoArgsKM();

+LAB_1:

+                    /* WARNING: Subroutine does not return */

+    ExRaiseAccessViolation();

+  }

+  local_e8 = (void *)0x0;

+LAB_3:

+  puVar23 = (uint *)(local_160 + 0xd0);

+  if (*(uint **)MmUserProbeAddress_exref <= (uint *)(local_160 + 0xd0)) {

+    puVar23 = *(uint **)MmUserProbeAddress_exref;

+  }

+  uVar28 = *puVar23;

+  local_e0 = CONCAT44(local_e0._4_4_,uVar28);

+  local_d8 = *(ulonglong *)(puVar23 + 2);

+  if ((local_d8 & 1) != 0) {

+                    /* WARNING: Subroutine does not return */

+    ExRaiseDatatypeMisalignment();

+  }

+  uVar24 = local_d8 + 2 + ((ulonglong)uVar28 & 0xffff);

+  if ((uVar24 <= local_d8) || (*(ulonglong *)MmUserProbeAddress_exref <= uVar24)) {

+                    /* WARNING: Subroutine does not return */

+    ExRaiseAccessViolation();

+  }

+  uStackX_22 = (ushort)(uVar28 >> 0x10);

+  if (uStackX_22 < (ushort)uVar28) {

+    if ((uVar28 & 1) == 0) goto LAB_4;

+  }

+  else if ((uVar28 & 1) == 0) {

+    plVar12 = (longlong *)PsGetCurrentProcessWin32Process();

+    if ((plVar12 != (longlong *)0x0) && (*plVar12 == 0)) {

+      plVar12 = (longlong *)0x0;

+    }

+    uVar28 = uVar27 | 0x100;

+    if ((*(uint *)((longlong)plVar12 + 0xc) & 0x80) == 0) {

+      uVar28 = uVar27;

+    }

+    lVar11 = PsGetThreadProcessId(param_1);

+    if (gpidLogon == lVar11) {

+      uVar28 = uVar28 | 0x2000000;

+    }

+    *(uint *)(this + 0x1e8) = uVar28;

+    p_Var14 = (_EPROCESS *)PsGetCurrentProcess();

+    bVar4 = false;

+    if ((p_Var14 != (_EPROCESS *)0x0) && (bVar4 = false, p_Var14 == g_pepDwm)) {

+      bVar4 = true;

+    }

+    if (bVar4) {

+      *(uint *)(this + 0x4f0) = *(uint *)(this + 0x4f0) | 4;

+    }

+    puVar23 = gspklBaseLayout;

+    if ((char)DAT_5 < '\0') {

+      if (gspklBaseLayout != (uint *)0x0) {

+        puVar25 = auStack_1b8;

+        if ((gbInDestroyHandleTableObjects == 0) &&

+           (bVar4 = IS_USERCRIT_OWNED_EXCLUSIVE(), puVar25 = auStack_1b8, !bVar4)) {

+          bVar4 = IS_USERCRIT_OWNED_AT_ALL();

+          if (bVar4) {

+            bVar4 = tagDomLock::IsLockedExclusive(&gDomainHandleManagerLock);

+            if (bVar4) {

+LAB_6:

+              bVar4 = true;

+            }

+            else {

+              bVar5 = tagDomLock::IsLockedShared(&gDomainHandleManagerLock);

+              bVar4 = false;

+              if (bVar5) goto LAB_6;

+            }

+            puVar25 = auStack_1b8;

+            if (bVar4) goto LAB_7;

+          }

+          pcVar3 = (code *)swi(0x2c);

+          (*pcVar3)();

+          puVar25 = auStack_1b0;

+        }

+LAB_7:

+        if ((*(byte *)((ulonglong)((*puVar23 & 0xffff) * DAT_8) + 0x19 + DAT_1c02c9e28) & 1)

+            != 0) {

+          *(undefined8 *)(puVar25 + -8) = 0x1c0087c1d;

+          MicrosoftTelemetryAssertTriggeredNoArgsKM();

+        }

+      }

+      *(tagTHREADINFO **)(puVar25 + 0x80) = this + 0x1b8;

+      *(uint **)(puVar25 + 0x88) = gspklBaseLayout;

+      puVar20 = puVar25 + 0x80;

+    }

+    else {

+      lVar11 = SGDGetUserSessionState();

+      puVar26 = gspklWinstaLessSessionLayouts;

+      puVar23 = gspklBaseLayout;

+      if (*(longlong *)(lVar11 + 0x3640) == 0) {

+        if (gspklBaseLayout == (uint *)0x0) {

+          if (gspklWinstaLessSessionLayouts == (uint *)0x0) goto LAB_9;

+          local_138 = SGDGetUserSessionState();

+          uVar15 = 0;

+        }

+        else {

+          local_138 = SGDGetUserSessionState();

+          uVar15 = 1;

+          puVar26 = puVar23;

+        }

+        local_138 = local_138 + 0x3640;

+        local_130 = puVar26;

+        HMAssignmentLock(&local_138,uVar15);

+      }

+LAB_9:

+      puVar25 = auStack_1b8;

+      lVar11 = SGDGetUserSessionState();

+      if (*(longlong *)(lVar11 + 0x3640) != 0) {

+        lVar11 = SGDGetUserSessionState();

+        puVar23 = *(uint **)(lVar11 + 0x3640);

+        puVar25 = auStack_1b8;

+        if ((gbInDestroyHandleTableObjects == 0) &&

+           (bVar4 = IS_USERCRIT_OWNED_EXCLUSIVE(), puVar25 = auStack_1b8, !bVar4)) {

+          bVar4 = IS_USERCRIT_OWNED_AT_ALL();

+          if (bVar4) {

+            bVar4 = tagDomLock::IsLockedExclusive(&gDomainHandleManagerLock);

+            if (bVar4) {

+LAB_10:

+              bVar4 = true;

+            }

+            else {

+              bVar5 = tagDomLock::IsLockedShared(&gDomainHandleManagerLock);

+              bVar4 = false;

+              if (bVar5) goto LAB_10;

+            }

+            puVar25 = auStack_1b8;

+            if (bVar4) goto LAB_11;

+          }

+          pcVar3 = (code *)swi(0x2c);

+          (*pcVar3)();

+          puVar25 = auStack_1b0;

+        }

+LAB_11:

+        if ((*(byte *)((ulonglong)((*puVar23 & 0xffff) * DAT_8) + 0x19 + DAT_1c02c9e28) & 1)

+            != 0) {

+          *(undefined8 *)(puVar25 + -8) = 0x1c0087d41;

+          MicrosoftTelemetryAssertTriggeredNoArgsKM();

+        }

+      }

+      *(undefined8 *)(puVar25 + -8) = 0x1c0087d48;

+      lVar11 = SGDGetUserSessionState();

+      uVar15 = *(undefined8 *)(lVar11 + 0x3640);

+      *(tagTHREADINFO **)(puVar25 + 0x150) = this + 0x1b8;

+      *(undefined8 *)(puVar25 + 0x158) = uVar15;

+      puVar20 = puVar25 + 0x150;

+    }

+    *(undefined8 *)(puVar25 + -8) = 0x1c0087d7a;

+    HMAssignmentLock(puVar20,0);

+    *(tagTHREADINFO **)(this + 0x1c0) = this + 0x420;

+    if ((*(uint *)((longlong)plVar12 + 0xc) & 0x800000) != 0) {

+      *(uint *)(this + 0x1e8) = *(uint *)(this + 0x1e8) | 0x2000000;

+    }

+    if ((*(uint *)((longlong)plVar12 + 0x32c) & 0x400) != 0) {

+      *(uint *)(this + 0x4f0) = *(uint *)(this + 0x4f0) | 0x20;

+    }

+    *(longlong **)(this + 0x1a8) = plVar12;

+    *(longlong *)(this + 0x298) = plVar12[0x28];

+    plVar12[0x28] = (longlong)this;

+    *(int *)(plVar12 + 0x2f) = (int)plVar12[0x2f] + 1;

+    uVar15 = *(undefined8 *)this;

+    *(undefined8 *)(puVar25 + -8) = 0x1c0087ddf;

+    Win32ThreadInfo = (void *)PsGetThreadId(uVar15);

+    *(void ***)(this + 0x1e0) = Win32ClientInfo;

+    Win32ClientInfo[0x1d]._0_4_ = *(undefined4 *)(this + 0x154);

+    *(undefined4 *)(*(longlong *)(this + 0x1e0) + 0xec) = 0;

+    *(longlong *)(this + 0x168) = *(longlong *)(this + 0x1e0) + 0xe8;

+    *(undefined4 *)(*(longlong *)(this + 0x1e0) + 0xf0) = *(undefined4 *)(this + 0x158);

+    *(undefined4 *)(*(longlong *)(this + 0x1e0) + 0xf4) = 0;

+    *(longlong *)(this + 0x170) = *(longlong *)(this + 0x1e0) + 0xf0;

+    if (((*(uint *)((longlong)plVar12 + 0xc) & 0x2000000) != 0) &&

+       (*(uint *)(this + 0x1e8) = *(uint *)(this + 0x1e8) | 0x20000000, plVar12[0x5f] == 0)) {

+      *(undefined8 *)(puVar25 + -8) = 0x1c0087e83;

+      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+    }

+    p_Var14 = *(_EPROCESS **)(puVar25 + 0x68);

+    if (*(int *)(this + 0x278) == 0) {

+      *(undefined8 *)(puVar25 + -8) = 0x1c0087e9b;

+      lVar11 = PsGetProcessPeb(p_Var14);

+      if (lVar11 == 0) {

+        *(undefined4 *)(this + 0x278) = 0x600;

+      }

+      else {

+        *(undefined8 *)(puVar25 + -8) = 0x1c0087eaf;

+        uVar15 = PsGetProcessSectionBaseAddress(p_Var14);

+        *(undefined8 *)(puVar25 + -8) = 0x1c0087ebc;

+        uVar6 = RtlGetExpWinVer(uVar15);

+        *(undefined4 *)(this + 0x278) = uVar6;

+      }

+    }

+    if (DAT_12 != 0) {

+      *(undefined8 *)(puVar25 + -8) = 0x1c0087ee0;

+      iVar7 = (*(code *)DAT_12)();

+      if ((-1 < iVar7) && (DAT_13 != 0)) {

+        *(undefined8 *)(puVar25 + -8) = 0x1c0087ef6;

+        (*(code *)DAT_13)();

+      }

+    }

+    uVar28 = uVar28 & 0xc;

+    *(uint *)(puVar25 + 0x1d8) = uVar28;

+    if ((uVar28 == 0) && (DAT_14 != 0)) {

+      *(undefined8 *)(puVar25 + -8) = 0x1c0087f16;

+      iVar7 = (*(code *)DAT_14)();

+      if ((-1 < iVar7) && (DAT_15 != 0)) {

+        *(undefined8 *)(puVar25 + -8) = 0x1c0087f2f;

+        iVar7 = (*(code *)DAT_15)(this);

+        if (iVar7 != 0) {

+          *(uint *)((longlong)plVar12 + 0xc) = *(uint *)((longlong)plVar12 + 0xc) | 0x1000000;

+        }

+      }

+    }

+    ptVar18 = this + 0x2d8;

+    puVar25[0x20] = 0;

+    *(undefined8 *)(puVar25 + -8) = 0x1c0087f5b;

+    iVar7 = ZwCreateEvent(ptVar18,0x1f0003,0,1);

+    if (-1 < iVar7) {

+      uVar15 = *(undefined8 *)ExEventObjectType_exref;

+      uVar1 = *(undefined8 *)ptVar18;

+      *(undefined8 *)(puVar25 + 0x58) = 0;

+      *(undefined8 *)(puVar25 + 0x28) = 0;

+      *(undefined1 **)(puVar25 + 0x20) = puVar25 + 0x58;

+      *(undefined8 *)(puVar25 + -8) = 0x1c0087f9d;

+      iVar7 = ObReferenceObjectByHandle(uVar1,0x1f0003,uVar15,1);

+      *(undefined8 *)(this + 0x2e0) = *(undefined8 *)(puVar25 + 0x58);

+      if (iVar7 < 0) {

+        if (iVar7 != -0x3ffffff8) {

+          uVar15 = *(undefined8 *)ptVar18;

+          *(undefined8 *)(puVar25 + -8) = 0x1c008806b;

+          ObCloseHandle(uVar15,1);

+        }

+      }

+      else {

+        uVar15 = *(undefined8 *)ExEventObjectType_exref;

+        uVar1 = *(undefined8 *)ptVar18;

+        *(undefined8 *)(puVar25 + 0x70) = 0;

+        *(undefined8 *)(puVar25 + 0x58) = 0;

+        *(undefined1 **)(puVar25 + 0x28) = puVar25 + 0x70;

+        *(undefined1 **)(puVar25 + 0x20) = puVar25 + 0x58;

+        *(undefined8 *)(puVar25 + -8) = 0x1c0087ff7;

+        iVar7 = ObReferenceObjectByHandle(uVar1,0x1f0003,uVar15,1);

+        if (-1 < iVar7) {

+          puVar25[0x1d0] = (byte)puVar25[0x70] >> 1 & 1;

+          puVar25[0x1d1] = 1;

+          *(undefined8 *)(puVar25 + -8) = 0x1c0088034;

+          iVar7 = ObSetHandleAttributes(uVar1,puVar25 + 0x1d0,1);

+          *(undefined8 *)(puVar25 + -8) = 0x1c0088045;

+          ObfDereferenceObject();

+        }

+        uVar28 = *(uint *)(puVar25 + 0x1d8);

+      }

+    }

+    if (iVar7 < 0) {

+      *(undefined8 *)ptVar18 = 0;

+      goto LAB_16;

+    }

+    puVar25[0x38] = 0;

+    *(undefined4 *)(puVar25 + 0x30) = 2;

+    *(undefined4 *)(puVar25 + 0x28) = 0x200;

+    *(undefined4 *)(puVar25 + 0x20) = 0;

+    uVar15 = *(undefined8 *)ptVar18;

+    *(undefined8 *)(puVar25 + -8) = 0x1c00880ae;

+    iVar7 = ObDuplicateObject(p_Var14,uVar15,p_Var14,this + 0x5a8);

+    if (iVar7 < 0) {

+      *(undefined8 *)(this + 0x5a8) = 0;

+      lVar11 = 0;

+      goto LAB_17;

+    }

+    *(undefined8 *)(puVar25 + -8) = 0x1c00880d5;

+    ptVar18 = this;

+    iVar7 = InitializeThreadInfoIocp(p_Var14,this);

+    if (-1 < iVar7) {

+      uVar27 = *(uint *)((longlong)plVar12 + 0xc);

+      uVar19 = uVar27 & 0x4000;

+      *(uint *)(puVar25 + 0x1d8) = uVar19;

+      *(uint *)((longlong)plVar12 + 0xc) = uVar27 | 0x4000;

+      if ((*(int *)((longlong)plVar12 + 0x30c) == 0) && (*(int *)(puVar25 + 0xc0) != 0)) {

+        *(undefined4 *)((longlong)plVar12 + 0x30c) = 0x1c;

+        *(undefined4 *)(plVar12 + 0x62) = *(undefined4 *)(puVar25 + 0xb0);

+        *(undefined4 *)((longlong)plVar12 + 0x314) = *(undefined4 *)(puVar25 + 0xb4);

+        *(undefined4 *)(plVar12 + 99) = *(undefined4 *)(puVar25 + 0xb8);

+        *(undefined4 *)((longlong)plVar12 + 0x31c) = *(undefined4 *)(puVar25 + 0xbc);

+        *(undefined4 *)(plVar12 + 100) = *(undefined4 *)(puVar25 + 0xc0);

+        *(undefined2 *)((longlong)plVar12 + 0x324) = *(undefined2 *)(puVar25 + 0xc4);

+      }

+      if (uVar19 == 0) {

+        if ((*(uint *)(puVar25 + 0xc0) & 0x200) == 0) {

+          if (*(short *)(puVar25 + 0xd8) == 0) {

+            uVar8 = 0;

+          }

+          else {

+            *(undefined8 *)(puVar25 + -8) = 0x1c0088197;

+            uVar8 = ParseReserved(*(ushort **)(puVar25 + 0xe0),(ushort *)ptVar18);

+          }

+        }

+        else {

+          uVar8 = *(ulong *)(puVar25 + 0xa0);

+        }

+        *(ulong *)((longlong)plVar12 + 0x2ac) = uVar8;

+        lVar29 = *(longlong *)(puVar25 + 0xf0);

+        if ((*(uint *)(lVar29 + 0x20) & 0x400) != 0) {

+          lVar11 = *(longlong *)(lVar29 + 8);

+          *(undefined8 *)(puVar25 + -8) = 0x1c00881bf;

+          lVar16 = HMValidateSharedHandle(lVar11);

+          if (lVar16 != 0) {

+            plVar12[0x56] = lVar11;

+          }

+        }

+      }

+      else {

+        lVar29 = *(longlong *)(puVar25 + 0xf0);

+      }

+      *(undefined8 *)(puVar25 + -8) = 0x1c00881de;

+      ptVar17 = (tagQ *)AllocQueue(0);

+      if (ptVar17 == (tagQ *)0x0) {

+        iVar7 = -0x3fffffe9;

+      }

+      else {

+        ptVar2 = *(tagQ **)(this + 0x1b0);

+        if (ptVar2 != ptVar17) {

+          if (ptVar2 != (tagQ *)0x0) {

+            *(undefined8 *)(puVar25 + -8) = 0x1c008821c;

+            bVar4 = tagTHREADINFO::RemoveThreadFromListWorker

+                              (this,ptVar2,(tagTHREADINFO **)0x1e0,(tagTHREADINFO **)0x5d8,

+                               *(tagQ ***)(puVar25 + 0x20));

+            if (!bVar4) {

+              *(tagQ **)(puVar25 + 0x20) = ptVar2;

+                    /* WARNING: Subroutine does not return */

+              *(undefined8 *)(puVar25 + -8) = 0x1c008823c;

+              KeBugCheckEx(0x164,0x12,this,ptVar17);

+            }

+          }

+          *(tagQ **)(this + 0x1b0) = ptVar17;

+          for (ptVar18 = *(tagTHREADINFO **)(ptVar17 + 0x1e0); ptVar18 != (tagTHREADINFO *)0x0;

+              ptVar18 = *(tagTHREADINFO **)(ptVar18 + 0x5d8)) {

+            if (ptVar18 == this) goto LAB_18;

+          }

+          if (*(longlong *)(this + 0x5d8) != 0) {

+LAB_18:

+            *(undefined8 *)(puVar25 + 0x20) = 0;

+                    /* WARNING: Subroutine does not return */

+            *(undefined8 *)(puVar25 + -8) = 0x1c0088329;

+            KeBugCheckEx(0x164,0x12,ptVar17,this);

+          }

+          *(tagTHREADINFO **)(this + 0x5d8) = *(tagTHREADINFO **)(ptVar17 + 0x1e0);

+          *(tagTHREADINFO **)(ptVar17 + 0x1e0) = this;

+          if (*(undefined8 **)(*(longlong *)(this + 0x1b0) + 0x78) == (undefined8 *)0x0) {

+            uVar15 = 0;

+          }

+          else {

+            uVar15 = **(undefined8 **)(*(longlong *)(this + 0x1b0) + 0x78);

+          }

+          *(undefined8 *)(*(longlong *)(this + 0x1c0) + 0x20) = uVar15;

+          if (ptVar17 == *(tagQ **)(this + 0x290)) {

+            *(undefined4 *)(puVar25 + 0x20) = 0x290;

+            *(undefined8 *)(puVar25 + -8) = 0x1c00882dc;

+            tagTHREADINFO::AssignQueueWorker

+                      (this,(tagQ *)0x0,(tagTHREADINFO **)&DAT_19,(tagTHREADINFO **)0x5e0,

+                       *(tagQ ***)(puVar25 + 0x20));

+          }

+        }

+        *(tagTHREADINFO **)(ptVar17 + 0x68) = this;

+        *(tagTHREADINFO **)(ptVar17 + 0x60) = this;

+        *(undefined8 *)(puVar25 + -8) = 0x1c00882ec;

+        ApiSetEditionUpdateRawMouseMode(ptVar17);

+        uVar6 = 0;

+        if (*(longlong *)(puVar25 + 0x68) == gpepCSRSS) {

+          *(undefined4 *)(ptVar17 + 0x1b0) = 0x2000;

+        }

+        else {

+          *(undefined4 *)(ptVar17 + 0x1b0) = *(undefined4 *)(*(longlong *)(this + 0x1a8) + 0x360);

+          uVar6 = *(undefined4 *)(*(longlong *)(this + 0x1a8) + 0x364);

+        }

+        *(undefined4 *)(ptVar17 + 0x1b4) = uVar6;

+        if (((*(uint *)(this + 0x1e8) & 0xc) != 0) || (grpWinStaList == 0)) {

+          *(uint *)(this + 0x4f0) = *(uint *)(this + 0x4f0) | 0x10;

+          *(undefined8 *)(puVar25 + -8) = 0x1c00886c8;

+          iVar9 = IsEditionSetProcessWindowStationAtProcessInitSupported();

+          if (-1 < iVar9) {

+            *(undefined8 *)(puVar25 + -8) = 0x1c00886df;

+            iVar7 = ApiSetEditionSetProcessWindowStationAtProcessInit(lVar29 + 0x28);

+            if (iVar7 < 0) goto LAB_16;

+            *(uint *)((longlong)plVar12 + 0xc) = *(uint *)((longlong)plVar12 + 0xc) | 0x40010;

+          }

+          *(undefined8 *)(puVar25 + -8) = 0x1c00886f5;

+          iVar9 = IsEditionSetThreadDesktopAtThreadInitSupported();

+          if (-1 < iVar9) {

+            *(undefined8 *)(puVar25 + -8) = 0x1c00886fe;

+            ApiSetEditionSetThreadDesktopAtThreadInit();

+          }

+          lVar11 = *(longlong *)(puVar25 + 0x50);

+LAB_20:

+          ptVar17 = (tagQ *)0x0;

+          *(undefined8 *)(puVar25 + -8) = 0x1c008870e;

+          iVar9 = InitClientInfo(this);

+          if (iVar9 == 0) goto LAB_17;

+          *(undefined8 *)(puVar25 + -8) = 0x1c0088723;

+          AtomicExecutionCheck::AtomicExecutionCheck((AtomicExecutionCheck *)(puVar25 + 0x1c8));

+          if (DAT_21 == 0) {

+LAB_22:

+            iVar7 = -0x3fffff45;

+          }

+          else {

+            *(undefined8 *)(puVar25 + -8) = 0x1c0088739;

+            iVar7 = (*(code *)DAT_21)();

+            if (-1 < iVar7) {

+              if (DAT_23 == 0) goto LAB_1c0088b6a;

+              *(undefined8 *)(puVar25 + -8) = 0x1c0088760;

+              iVar7 = (*(code *)DAT_23)(this,lVar11,*(undefined8 *)(puVar25 + 0x60));

+            }

+            if (-1 < iVar7) {

+              *(undefined8 *)(puVar25 + -8) = 0x1c0088777;

+              AtomicExecutionCheck::Disarm((AtomicExecutionCheck *)(puVar25 + 0x1c8));

+              if (lVar11 == grpdeskRitInput) {

+                if (DAT_24 != 0) {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c0088792;

+                  iVar9 = (*(code *)DAT_24)();

+                  if (-1 < iVar9) {

+                    if (DAT_26 == 0) goto LAB_1c00887ee;

+                    *(undefined8 *)(puVar25 + -8) = 0x1c00887ab;

+                    ptVar17 = (tagQ *)(*(code *)DAT_26)();

+                  }

+                }

+                if ((ptVar17 != (tagQ *)0x0) && (ptVar17 != *(tagQ **)(this + 0x1b0))) {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c00887c1;

+                  iVar9 = IsDestroyThreadsMessagesSupported();

+                  if (-1 < iVar9) {

+                    uVar15 = *(undefined8 *)(this + 0x1b0);

+                    *(undefined8 *)(puVar25 + -8) = 0x1c00887d4;

+                    DestroyThreadsMessages(uVar15,this);

+                  }

+                  uVar15 = *(undefined8 *)(this + 0x1b0);

+                  *(undefined8 *)(puVar25 + -8) = 0x1c00887e3;

+                  zzzDestroyQueue(uVar15,this);

+                  *(undefined8 *)(puVar25 + -8) = 0x1c00887ee;

+                  tagTHREADINFO::AssignQueue(this,ptVar17);

+                }

+              }

+LAB_25:

+              iVar9 = *(int *)(puVar25 + 0x1d8);

+              if (*(int *)(lVar29 + 0x20) < 0) {

+                if (iVar9 == 0) {

+                  if (gpidLogon != 0) {

+                    *(undefined8 *)(puVar25 + -8) = 0x1c0088820;

+                    lVar16 = PsGetProcessInheritedFromUniqueProcessId();

+                    if (lVar16 == gpidLogon) {

+                      _gptSSCursor = *(undefined8 *)(gpsi + 0x4d8);

+                      gppiScreenSaver = plVar12;

+                      *(uint *)((longlong)plVar12 + 0xc) =

+                           *(uint *)((longlong)plVar12 + 0xc) | 0x200000;

+                      *(undefined8 *)(puVar25 + -8) = 0x1c008885e;

+                      EtwTraceScreenSaverProcessEvent(1);

+                      goto LAB_27;

+                    }

+                  }

+                  *(uint *)(lVar29 + 0x20) = *(uint *)(lVar29 + 0x20) & 0x7fffffff;

+                }

+                else {

+LAB_27:

+                  *(undefined8 *)(puVar25 + -8) = 0x1c008886b;

+                  ForegroundBoost::SetForegroundPriority(this,1);

+                  if (iVar9 == 0) {

+                    *(uint *)((longlong)plVar12 + 0xc) =

+                         *(uint *)((longlong)plVar12 + 0xc) | 0x400000;

+                  }

+                  *(uint *)(this + 0x1e8) = *(uint *)(this + 0x1e8) | 0x2000000;

+                }

+              }

+              if (((*(uint *)(this + 0x1e8) & 0xc) == 0) && (iVar9 == 0)) {

+                gdwDeferWinEvent = gdwDeferWinEvent + 1;

+                *(undefined8 *)(puVar25 + -8) = 0x1c008889f;

+                iVar10 = IszzzCalcStartCursorHideSupported();

+                if (-1 < iVar10) {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c00888af;

+                  PsGetProcessWin32Process(*(undefined8 *)(puVar25 + 0x68));

+                  *(undefined8 *)(puVar25 + -8) = 0x1c00888d3;

+                  zzzCalcStartCursorHide();

+                }

+                gdwDeferWinEvent = gdwDeferWinEvent + -1;

+                if ((grpWinStaList != 0) && (plVar12[0x52] == 0)) {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c00888f7;

+                  UserSetLastError(0x3eb);

+                  iVar7 = -0x3fffffff;

+                  goto LAB_17;

+                }

+              }

+              if (DAT_28 != 0) {

+                *(undefined8 *)(puVar25 + -8) = 0x1c0088920;

+                iVar10 = (*(code *)DAT_28)();

+                if ((-1 < iVar10) && (DAT_29 != 0)) {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c0088936;

+                  (*(code *)DAT_29)();

+                }

+              }

+              if (this + 0x500 != (tagTHREADINFO *)0x0) {

+                *(undefined8 *)(this + 0x500) = 0;

+              }

+              if ((*(longlong *)(this + 0x1b0) != 0) &&

+                 (puVar13 = (undefined8 *)(*(longlong *)(this + 0x1b0) + 0x1a4),

+                 puVar13 != (undefined8 *)0x0)) {

+                *puVar13 = 0;

+              }

+              if ((*(uint *)((longlong)plVar12 + 0xc) & 0x20000) != 0) {

+                *(uint *)(this + 0x1e8) = *(uint *)(this + 0x1e8) | 0x4000;

+              }

+              *(uint *)(this + 0x1e8) = *(uint *)(this + 0x1e8) | 0x1000000;

+              if ((*(uint *)((longlong)plVar12 + 0xc) & 0x140) == 0) {

+                if ((gptiForeground == 0) || (plVar12 != *(longlong **)(gptiForeground + 0x1a8))) {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c00889ad;

+                  ptVar18 = CInputGlobals::GetPtiLastWoken(gpInputGlobals);

+                  if (ptVar18 != (tagTHREADINFO *)0x0) {

+                    *(undefined8 *)(puVar25 + -8) = 0x1c00889c2;

+                    ptVar18 = CInputGlobals::GetPtiLastWoken(gpInputGlobals);

+                    if ((plVar12 == *(longlong **)(ptVar18 + 0x1a8)) &&

+                       (((byte)*(undefined4 *)((longlong)plVar12 + 0x32c) & 0x30) != 0x10))

+                    goto LAB_30;

+                  }

+                }

+                else {

+LAB_30:

+                  *(uint *)(this + 0x1e8) = *(uint *)(this + 0x1e8) | 0x20;

+                  if (((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                     (((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x1000) == 0 ||

+                      ((byte)WPP_GLOBAL_Control[0x29] < 4)))) {

+                    cVar21 = '\0';

+                  }

+                  else {

+                    cVar21 = '\x01';

+                  }

+                  if ((cVar21 != '\0') ||

+                     ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

+                    *(tagTHREADINFO **)(puVar25 + 0x40) = this;

+                    *(undefined **)(puVar25 + 0x38) =

+                         &WPP_fb57c89ce8a23a113d44b45d59c9d559_Traceguids;

+                    *(undefined2 *)(puVar25 + 0x30) = 10;

+                    *(undefined4 *)(puVar25 + 0x28) = 0xd;

+                    puVar25[0x20] = 4;

+                    uVar15 = *(undefined8 *)(WPP_GLOBAL_Control + 0x18);

+                    *(undefined8 *)(puVar25 + -8) = 0x1c0088a63;

+                    WPP_RECORDER_AND_TRACE_SF_q

+                              (uVar15,cVar21,

+                               (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,

+                               gBaseLog);

+                  }

+                }

+              }

+              if (((*gpsi & 4) != 0) && (DAT_31 != 0)) {

+                *(undefined8 *)(puVar25 + -8) = 0x1c0088a83;

+                iVar10 = (*(code *)DAT_31)();

+                if ((-1 < iVar10) && (DAT_32 != 0)) {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c0088a9b;

+                  (*(code *)DAT_32)(0);

+                }

+              }

+              if (uVar28 == 0) {

+                if (DAT_33 == 0) {

+LAB_34:

+                  iVar7 = -0x3fffff45;

+                  goto LAB_17;

+                }

+                *(undefined8 *)(puVar25 + -8) = 0x1c0088ab6;

+                iVar7 = (*(code *)DAT_33)();

+                if (-1 < iVar7) {

+                  if (DAT_35 == 0) goto LAB_1c0088653;

+                  *(undefined8 *)(puVar25 + -8) = 0x1c0088ad2;

+                  iVar7 = (*(code *)DAT_35)();

+                }

+                if (iVar7 < 0) goto LAB_17;

+              }

+              if (((iVar9 == 0) && ((*(uint *)((longlong)plVar12 + 0xc) & 1) == 0)) &&

+                 (DAT_36 != 0)) {

+                *(undefined8 *)(puVar25 + -8) = 0x1c0088afa;

+                iVar9 = (*(code *)DAT_36)();

+                if ((-1 < iVar9) && (DAT_37 != 0)) {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c0088b14;

+                  (*(code *)DAT_37)(7);

+                }

+              }

+              if (lVar11 == 0) {

+LAB_38:

+                if (*(longlong *)(puVar25 + 0x90) != 0) {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c0088b50;

+                  PopAndFreeAlwaysW32ThreadLock(puVar25 + 0x138);

+                }

+                if ((*(uint *)(this + 0x4f0) & 1) == 0) {

+                  return iVar7;

+                }

+                *(uint *)(this + 0x4f0) = *(uint *)(this + 0x4f0) & 0xfffffffe;

+                return iVar7;

+              }

+              if ((*(uint *)(lVar11 + 0x30) & 8) == 0) {

+                *(undefined8 *)(puVar25 + -8) = 0x1c0088b38;

+                PopAndFreeW32ThreadLock(puVar25 + 0x120);

+                goto LAB_38;

+              }

+              iVar7 = -0x3fffffff;

+              goto LAB_17;

+            }

+          }

+          *(undefined8 *)(puVar25 + -8) = 0x1c0088b7c;

+          AtomicExecutionCheck::Disarm((AtomicExecutionCheck *)(puVar25 + 0x1c8));

+          *(undefined8 *)(puVar25 + -8) = 0x1c0088b89;

+          AtomicExecutionCheck::Disarm((AtomicExecutionCheck *)(puVar25 + 0x1c8));

+          goto LAB_17;

+        }

+        if (DAT_39 == 0) {

+LAB_40:

+          iVar7 = -0x3fffff45;

+        }

+        else {

+          *(undefined8 *)(puVar25 + -8) = 0x1c0088389;

+          iVar7 = (*(code *)DAT_39)();

+          if (-1 < iVar7) {

+            uVar27 = *(uint *)(lVar29 + 0x20);

+            if (DAT_41 == 0) goto LAB_1c0088685;

+            *(undefined1 **)(puVar25 + 0x20) = puVar25 + 0x60;

+            *(undefined8 *)(puVar25 + -8) = 0x1c00883ca;

+            iVar7 = (*(code *)DAT_41)

+                              (0xffffffffffffffff,lVar29 + 0x28,puVar25 + 0x78,uVar27 & 0x40000000);

+          }

+          if (-1 < iVar7) {

+            if (DAT_42 == 0) {

+              iVar7 = -0x3fffff45;

+            }

+            else {

+              *(undefined8 *)(puVar25 + -8) = 0x1c0088426;

+              iVar7 = (*(code *)DAT_42)();

+              if (-1 < iVar7) {

+                *(undefined8 *)(puVar25 + -8) = 0x1c0088437;

+                lVar11 = SGDGetUserSessionState();

+                if (*(longlong *)(lVar11 + 8) == 0) {

+LAB_43:

+                  *(undefined8 *)(puVar25 + -8) = 0x1c0088451;

+                  MicrosoftTelemetryAssertTriggeredNoArgsKM();

+                  if ((gdwExtraInstrumentations & 1) != 0) {

+                    *(undefined8 *)(puVar25 + 0x20) = 0;

+                    /* WARNING: Subroutine does not return */

+                    *(undefined8 *)(puVar25 + -8) = 0x1c0088476;

+                    KeBugCheckEx(0x164,0x2a,0);

+                  }

+                  *(undefined4 *)(puVar25 + 0x40) = 0;

+                  *(undefined8 *)(puVar25 + 0x38) = 0;

+                  *(undefined8 *)(puVar25 + 0x30) = 0;

+                  *(undefined8 *)(puVar25 + 0x28) = 0;

+                  *(undefined8 *)(puVar25 + 0x20) = 0;

+                  *(undefined8 *)(puVar25 + -8) = 0x1c00884ae;

+                  DbgkWerCaptureLiveKernelDump(L"NTUSER",400,0x2a);

+                }

+                else {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c0088448;

+                  bVar4 = IS_USERCRIT_OWNED_AT_ALL();

+                  if (!bVar4) goto LAB_43;

+                }

+                *(undefined8 *)(puVar25 + -8) = 0x1c00884ba;

+                lVar11 = PsGetCurrentThreadWin32Thread();

+                *(int *)(lVar11 + 0x30) = *(int *)(lVar11 + 0x30) + 1;

+                puVar25[0x1d0] = 1;

+                if (DAT_44 == 0) {

+                  iVar7 = -0x3fffff45;

+                }

+                else {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c00884eb;

+                  iVar7 = (*(code *)DAT_44)(*(undefined8 *)(puVar25 + 0x78),1);

+                }

+                *(undefined8 *)(puVar25 + -8) = 0x1c0088501;

+                AtomicExecutionCheck::Disarm((AtomicExecutionCheck *)(puVar25 + 0x1d0));

+              }

+              if (-1 < iVar7) {

+                uVar15 = *(undefined8 *)ExDesktopObjectType_exref;

+                *(undefined8 *)(puVar25 + 0xf8) = 0;

+                *(undefined8 *)(puVar25 + 0x28) = 0;

+                *(undefined1 **)(puVar25 + 0x20) = puVar25 + 0xf8;

+                *(undefined8 *)(puVar25 + -8) = 0x1c008853e;

+                iVar7 = ObReferenceObjectByHandle(*(undefined8 *)(puVar25 + 0x60),0,uVar15,1);

+                lVar11 = *(longlong *)(puVar25 + 0xf8);

+                if (iVar7 < 0) goto LAB_17;

+                *(undefined8 *)(puVar25 + -8) = 0x1c008856c;

+                PushW32ThreadLock(lVar11,puVar25 + 0x120,CompositionObject::Release);

+                if (lVar11 != 0) {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c008857b;

+                  ObfReferenceObject(lVar11);

+                }

+                *(undefined8 *)(puVar25 + -8) = 0x1c008858a;

+                ObfDereferenceObject(lVar11);

+                *(undefined4 *)(puVar25 + 0x100) = 1;

+                *(undefined8 *)(puVar25 + -8) = 0x1c00885a1;

+                uVar15 = PsGetCurrentProcess();

+                *(undefined8 *)(puVar25 + 0x108) = uVar15;

+                *(longlong *)(puVar25 + 0x110) = lVar11;

+                *(undefined4 *)(puVar25 + 0x118) = 0;

+                *(undefined4 *)(puVar25 + 0x11c) = 1;

+                if (DAT_45 != 0) {

+                  *(undefined8 *)(puVar25 + -8) = 0x1c00885de;

+                  iVar7 = (*(code *)DAT_45)();

+                  if (-1 < iVar7) {

+                    if (DAT_46 == 0) goto LAB_1c0088653;

+                    *(undefined8 *)(puVar25 + -8) = 0x1c00885fe;

+                    iVar7 = (*(code *)DAT_46)(puVar25 + 0x100);

+                  }

+                  if (iVar7 < 0) goto LAB_17;

+                  if (plVar12[0x30] == 0) {

+                    *(undefined8 *)(puVar25 + -8) = 0x1c0088621;

+                    lVar16 = PsGetProcessId(*(undefined8 *)(puVar25 + 0x68));

+                    if (lVar16 != gpidLogon) {

+                      *(undefined8 *)(puVar25 + -8) = 0x1c0088642;

+                      LockObjectAssignment(plVar12 + 0x2a);

+                      plVar12[0x30] = *(longlong *)(puVar25 + 0x60);

+                    }

+                  }

+                  goto LAB_20;

+                }

+                goto LAB_34;

+              }

+            }

+            *(undefined8 *)(puVar25 + -8) = 0x1c008866c;

+            CloseProtectedHandle(*(undefined8 *)(puVar25 + 0x60));

+            *(undefined8 *)(puVar25 + -8) = 0x1c0088676;

+            CloseProtectedHandle(*(undefined8 *)(puVar25 + 0x78));

+            *(undefined8 *)(puVar25 + 0x60) = 0;

+            *(undefined8 *)(puVar25 + 0x78) = 0;

+            goto LAB_16;

+          }

+          if (iVar7 == -0x3ffffd95) {

+            *(undefined8 *)(puVar25 + -8) = 0x1c00883e9;

+            LeaveEnterCrit::LeaveEnterCrit((LeaveEnterCrit *)(puVar25 + 0x1c8));

+            *(undefined8 *)(puVar25 + -8) = 0x1c00883f9;

+            ZwTerminateProcess(0xffffffffffffffff,0xc000026b);

+            *(undefined8 *)(puVar25 + -8) = 0x1c008840b;

+            LeaveEnterCrit::~LeaveEnterCrit((LeaveEnterCrit *)(puVar25 + 0x1c8));

+            iVar7 = -0x3ffffd95;

+            goto LAB_16;

+          }

+        }

+        *(undefined8 *)(puVar25 + -8) = 0x1c0088691;

+        uVar6 = PsGetCurrentProcessId();

+        if ((Microsoft_Windows_Win32kEnableBits & 1) != 0) {

+          *(int *)(puVar25 + 0x20) = iVar7;

+          *(undefined8 *)(puVar25 + -8) = 0x1c00886b2;

+          McTemplateK0qq_EtwWriteTransfer(uVar6,&DesktopResolutionFailure);

+        }

+        iVar7 = -0x3ffffebe;

+      }

+    }

+LAB_16:

+    lVar11 = *(longlong *)(puVar25 + 0x50);

+LAB_17:

+    if (lVar11 != 0) {

+      *(undefined8 *)(puVar25 + -8) = 0x1c0088bd7;

+      PopAndFreeW32ThreadLock(puVar25 + 0x120);

+    }

+    if (*(longlong *)(puVar25 + 0x90) != 0) {

+      *(undefined8 *)(puVar25 + -8) = 0x1c0088bef;

+      PopAndFreeAlwaysW32ThreadLock(puVar25 + 0x138);

+    }

+    *(undefined8 *)(puVar25 + -8) = 0x1c0088bf4;

+    xxxDestroyThreadInfo();

+    return iVar7;

+  }

+  MicrosoftTelemetryAssertTriggeredNoArgsKM();

+LAB_4:

+                    /* WARNING: Subroutine does not return */

+  ExRaiseAccessViolation();

 }
```

## `FUN_1c008bcef`  (modified)

```diff
--- FUN_1c008bcef
+++ FUN_1c003c161
@@ -1,254 +1,16 @@
 

-/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

 

-void FUN_1c008bcef(longlong param_1,undefined4 param_2)

+undefined4 FUN_1c003c161(void)

 

 {

-  uint uVar1;

-  char cVar2;

-  ulong uVar3;

-  int iVar4;

-  ISMForwardingDecision IVar5;

-  longlong lVar6;

-  HWND__ *pHVar7;

-  DropReason DVar8;

-  ISMForwardingDecision IVar9;

-  ulonglong unaff_RBX;

-  longlong unaff_RBP;

-  CMouseProcessor *unaff_RSI;

-  CMouseEvent *unaff_RDI;

-  LONG LVar10;

-  tagPOINT tVar11;

-  ulonglong unaff_R12;

-  uint uVar12;

-  _mouseCursorEvent *unaff_R13;

-  int unaff_R14D;

-  int iVar13;

-  char unaff_R15B;

-  bool bVar14;

-  undefined8 in_stack_00000020;

-  undefined4 uVar16;

-  uint *puVar15;

-  tagPOINT in_stack_00000038;

-  _mouseCursorEvent *in_stack_00000040;

-  _mouseCursorEvent *in_stack_00000048;

-  undefined4 in_stack_00000058;

-  int iStack0000000000000060;

-  int iStack0000000000000064;

-  tagPOINT in_stack_00000068;

-  LONG LStack0000000000000070;

-  int iStack0000000000000074;

+  longlong unaff_RSI;

+  undefined4 unaff_EDI;

   

-  uVar16 = (undefined4)((ulonglong)in_stack_00000020 >> 0x20);

-  *(char *)(param_1 + -0x75) = *(char *)(param_1 + -0x75) + (char)param_1;

-  *(undefined4 *)(param_1 + 0x1360) = param_2;

-  *(undefined8 *)(gpsi + 0x1358) = *(undefined8 *)(*(longlong *)(unaff_RDI + 8) + 0x3c);

-  CMouseProcessor::CMouseRawInput::PostRawMouse

-            ((CMouseRawInput *)(unaff_RSI + 0xd88),(tagINPUTDEST *)0x0,0);

-  lVar6 = *(longlong *)(unaff_RDI + 8);

-  if ((*(uint *)(lVar6 + 0x70) & 0x4000) != 0) {

-    CMouseProcessor::InformUMObservers

-              (unaff_RSI,unaff_RDI,(tagPOINT *)(lVar6 + 0x34),(tagPOINT *)(lVar6 + 0x44));

+  if ((unaff_RSI != 0) && (DAT_0 != 0)) {

+    (*(code *)DAT_0)(&stack0x00000060);

   }

-  if (unaff_R14D == 0) {

-    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) ||

-       ((byte)WPP_GLOBAL_Control[0x29] < 3)) {

-      unaff_RBX = (ulonglong)unaff_R13 & 0xff;

-    }

-    if (((char)unaff_RBX != '\0') ||

-       ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

-      WPP_RECORDER_AND_TRACE_SF_

-                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),CONCAT71(0x1c02827,(char)unaff_RBX),

-                 (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog,3,6);

-    }

-    lVar6 = *(longlong *)(unaff_RDI + 8);

-    if ((*(uint *)(lVar6 + 0x70) & 0x2000) != 0) goto LAB_0;

-    DVar8 = 0xb;

-LAB_1:

-    InputTraceLogging::Mouse::DropMove(*(__uint64 *)(lVar6 + 0x58),DVar8);

-    goto LAB_0;

-  }

-  *(ulonglong *)(unaff_RSI + 0xd80) = (ulonglong)*(uint *)(*(longlong *)(unaff_RDI + 8) + 0x28);

-  lVar6 = *(longlong *)(unaff_RDI + 8);

-  *(undefined8 *)(unaff_RSI + 0xd70) = *(undefined8 *)(lVar6 + 0x34);

-  *(undefined8 *)(unaff_RSI + 0xd78) = *(undefined8 *)(lVar6 + 0x3c);

-  IVar9 = (ISMForwardingDecision)unaff_RBX;

-  if ((*(uint *)(*(longlong *)(unaff_RDI + 8) + 0x70) & 0x800) == 0) {

-    cVar2 = `anonymous_namespace'::InMouseRawInputMode

-                      (0,unaff_RBX & 0xffffffff,unaff_RBX & 0xffffffff);

-    if (cVar2 != '\0') {

-      lVar6 = `anonymous_namespace'::GetPtiFromInputDest(0,unaff_RBX & 0xffffffff);

-      if (lVar6 != 0) {

-        iVar13 = *(int *)(lVar6 + 0x154);

-        if (iVar13 < 0) {

-          iVar13 = *(int *)(*(longlong *)(lVar6 + 0x1a8) + 0x118);

-        }

-        in_stack_00000040 = unaff_R13;

-        PhysicalToLogicalDPIPoint(&stack0x00000040,gpsi + 0x1360,iVar13,0);

-        in_stack_00000048 = in_stack_00000040;

-        *(_mouseCursorEvent **)(unaff_RSI + 0x3c) = in_stack_00000040;

-        *(int *)(unaff_RSI + 0x44) = iVar13;

-      }

-      if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-          ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) ||

-         ((byte)WPP_GLOBAL_Control[0x29] < 3)) {

-        unaff_RBX = (ulonglong)unaff_R13 & 0xff;

-      }

-      if (((char)unaff_RBX != '\0') ||

-         ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

-        WPP_RECORDER_AND_TRACE_SF_

-                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),CONCAT71(0x1c02827,(char)unaff_RBX),

-                   (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog,3,

-                   CONCAT44(uVar16,6));

-      }

-      lVar6 = *(longlong *)(unaff_RDI + 8);

-      DVar8 = 0xc;

-      goto LAB_1;

-    }

-  }

-  in_stack_00000038 = *(tagPOINT *)(gpsi + 0x1360);

-  *(undefined8 *)(unaff_RBP + -0x60) = *(undefined8 *)(gpsi + 0x1358);

-  LOCK();

-  IVar5 = *(ISMForwardingDecision *)(unaff_RSI + 0xe70);

-  if (IVar9 == IVar5) {

-    *(ISMForwardingDecision *)(unaff_RSI + 0xe70) = IVar9;

-    IVar5 = IVar9;

-  }

-  UNLOCK();

-  uVar12 = (uint)unaff_R13;

-  puVar15 = (uint *)CONCAT44(uVar16,(int)CONCAT71((int7)((ulonglong)unaff_R13 >> 8),IVar5 != 0));

-  CMouseProcessor::MouseHitTest

-            (unaff_RSI,(tagPOINT *)(unaff_RBP + -0x50),(_SUBPIXELS *)&stack0x00000038,

-             (CMouseEvent *)(unaff_RBP + -0x60),(MouseHitTestOptions)unaff_RDI,puVar15);

-  uVar1 = DAT_2;

-  uVar16 = (undefined4)((ulonglong)puVar15 >> 0x20);

-  lVar6 = *(longlong *)(unaff_RDI + 8);

-  *(undefined4 *)(unaff_RBP + -100) = *(undefined4 *)(unaff_RBP + -0x4c);

-  *(char *)(unaff_RBP + -0x68) = (char)unaff_RBX;

-  if (((uint)unaff_R12 < uVar1) && (cVar2 = _tlgKeywordOn(&DAT_2,0x40), cVar2 != '\0')) {

-    pHVar7 = CInputDest::GetWindowHandle((CInputDest *)(unaff_RBP + -0x50));

-    *(HWND__ **)(unaff_RBP + -0x58) = pHVar7;

-    in_stack_00000058 = *(undefined4 *)(lVar6 + 0x38);

-    in_stack_00000040 =

-         (_mouseCursorEvent *)CONCAT44(in_stack_00000040._4_4_,*(undefined4 *)(lVar6 + 0x34));

-    in_stack_00000048 = *(_mouseCursorEvent **)(lVar6 + 0x58);

-    *(longlong *)(unaff_RBP + 0x80) = unaff_RBP + -0x58;

-    *(undefined4 **)(unaff_RBP + 0x70) = &stack0x00000058;

-    *(_mouseCursorEvent ***)(unaff_RBP + 0x60) = &stack0x00000040;

-    *(_mouseCursorEvent ***)(unaff_RBP + 0x50) = &stack0x00000048;

-    lVar6 = unaff_RBP + 0x30;

-    *(undefined8 *)(unaff_RBP + 0x88) = 8;

-    *(ulonglong *)(unaff_RBP + 0x78) = unaff_R12;

-    *(ulonglong *)(unaff_RBP + 0x68) = unaff_R12;

-    *(undefined8 *)(unaff_RBP + 0x58) = 8;

-    _tlgWriteTransfer_EtwWriteTransfer(&DAT_2,&DAT_1c0298477,0,0,6,lVar6);

-    uVar16 = (undefined4)((ulonglong)lVar6 >> 0x20);

-  }

-  if (*(uint *)(unaff_RBP + -0x50) == uVar12) {

-    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) ||

-       ((byte)WPP_GLOBAL_Control[0x29] < (byte)unaff_R12)) {

-      unaff_RBX = (ulonglong)unaff_R13 & 0xff;

-    }

-    if (((char)unaff_RBX != '\0') ||

-       ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

-      WPP_RECORDER_AND_TRACE_SF_

-                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),CONCAT71(0x1c02827,(char)unaff_RBX),

-                 (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog,

-                 unaff_R12 & 0xff,CONCAT44(uVar16,6));

-    }

-    DVar8 = 0xd;

-LAB_3:

-    InputTraceLogging::Mouse::DropMove(*(__uint64 *)(*(longlong *)(unaff_RDI + 8) + 0x58),DVar8);

-  }

-  else {

-    if (unaff_R15B == '\0') {

-      iVar13 = in_stack_00000038.y;

-    }

-    else {

-      CInputDest::GetDpiAwarenessContext((CInputDest *)(unaff_RBP + -0x50));

-      CMouseProcessor::LogicalCursorPosFromDpiAwarenessContext(unaff_RSI,(ulong)&stack0x00000060);

-      iVar13 = in_stack_00000038.y;

-      if ((iStack0000000000000060 == in_stack_00000038.x) &&

-         (iStack0000000000000064 == in_stack_00000038.y)) {

-        if (((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-           (((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0 ||

-            ((byte)WPP_GLOBAL_Control[0x29] < (byte)unaff_R12)))) {

-          unaff_RBX = (ulonglong)unaff_R13 & 0xff;

-        }

-        if (((char)unaff_RBX != '\0') ||

-           ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED)) {

-          WPP_RECORDER_AND_TRACE_SF_

-                    (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),CONCAT71(0x1c02827,(char)unaff_RBX),

-                     (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog,

-                     unaff_R12 & 0xff,6);

-        }

-        DVar8 = 0xb;

-        goto LAB_3;

-      }

-    }

-    LVar10 = in_stack_00000038.x;

-    in_stack_00000048 = (_mouseCursorEvent *)CONCAT44(iVar13,LVar10);

-    tVar11 = in_stack_00000038;

-    uVar3 = CInputDest::GetDpiAwarenessContext((CInputDest *)(unaff_RBP + -0x50));

-    *(_mouseCursorEvent **)(unaff_RSI + 0x3c) = in_stack_00000048;

-    *(ulong *)(unaff_RSI + 0x44) = uVar3;

-    iVar4 = IsPointerPromotedMouseMessage(0x200,*(longlong *)(unaff_RDI + 8) + 0x68);

-    if ((iVar4 != 0) &&

-       (cVar2 = `anonymous_namespace'::ValidateUIPI

-                          (*(undefined8 *)(*(longlong *)(gptiCurrent + 0x1a8) + 0x360),

-                           unaff_RBP + -0x50), tVar11 = in_stack_00000038, cVar2 == '\0')) {

-      if (((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-         (((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0 ||

-          ((byte)WPP_GLOBAL_Control[0x29] < 3)))) {

-        unaff_RBX = (ulonglong)unaff_R13 & 0xff;

-      }

-      bVar14 = (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-      cVar2 = (char)unaff_RBX;

-      if ((cVar2 != '\0') || (bVar14)) {

-LAB_4:

-        WPP_RECORDER_AND_TRACE_SF_

-                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),CONCAT71(0x1c02827,cVar2),bVar14,

-                   gBaseLog,3,CONCAT44(uVar16,6));

-      }

-LAB_5:

-      DVar8 = 10;

-      goto LAB_3;

-    }

-    bVar14 = CMouseProcessor::CMouseEvent::UsingInjectorUIPI(unaff_RDI);

-    if ((bVar14) &&

-       (cVar2 = `anonymous_namespace'::ValidateUIPI

-                          (*(undefined8 *)(*(longlong *)(unaff_RDI + 8) + 0x84),unaff_RBP + -0x50),

-       tVar11 = in_stack_00000038, cVar2 == '\0')) {

-      if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

-          ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) ||

-         ((byte)WPP_GLOBAL_Control[0x29] < 3)) {

-        unaff_RBX = (ulonglong)unaff_R13 & 0xff;

-      }

-      bVar14 = (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-      cVar2 = (char)unaff_RBX;

-      if ((cVar2 != '\0') || (bVar14)) goto LAB_4;

-      goto LAB_5;

-    }

-    *(uint *)(unaff_RBP + -0x7c) = uVar12;

-    *(ulong *)(unaff_RBP + -0x80) = uVar3;

-    in_stack_00000068 = tVar11;

-    LStack0000000000000070 = LVar10;

-    iStack0000000000000074 = iVar13;

-    IVar5 = CMouseProcessor::ForwardInputToISM

-                      (unaff_RSI,(CInputDest *)(unaff_RBP + -0x50),unaff_RDI,

-                       (InputDeliveryContext *)&stack0x00000068,&stack0x00000038,uVar12,0x200,

-                       (__uint64)unaff_R13);

-    if (IVar5 == IVar9) {

-      CMouseProcessor::DeliverMouseMoveToInputDest

-                (unaff_RSI,(CMoveEvent *)unaff_RDI,(CInputDest *)(unaff_RBP + -0x50),

-                 (InputDeliveryContext *)&stack0x00000068,unaff_R13);

-    }

-  }

-  CInputDest::SetEmpty((CInputDest *)(unaff_RBP + -0x50));

-LAB_0:

-  CMouseProcessor::EndStreamToken::~EndStreamToken((EndStreamToken *)(unaff_RBP + -0x78));

-  return;

+  UserSessionSwitchLeaveCrit();

+  return unaff_EDI;

 }
```

## `FUN_1c01128f0`  (modified)

```diff
--- FUN_1c01128f0
+++ FUN_1c0125b07
@@ -1,11 +1,35 @@
 

-/* WARNING: Control flow encountered bad instruction data */

-

-void FUN_1c01128f0(longlong param_1)

+int FUN_1c0125b07(CLeakTrackingAllocator *param_1,__uint64 param_2)

 

 {

-  *(int *)(param_1 + -0x75) = *(int *)(param_1 + -0x75) + -1;

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+  undefined8 *puVar1;

+  int unaff_ESI;

+  undefined8 *unaff_R14;

+  undefined4 uVar2;

+  undefined8 *unaff_R15;

+  

+  puVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     (param_1,param_2,0x80,0x65664344);

+  if (puVar1 != (undefined8 *)0x0) {

+    uVar2 = SUB84(unaff_R15,0);

+    *(undefined4 *)(puVar1 + 4) = uVar2;

+    puVar1[6] = unaff_R15;

+    puVar1[3] = 1;

+    *(undefined4 *)((longlong)puVar1 + 0x24) = 0x40;

+    *(undefined4 *)(puVar1 + 9) = uVar2;

+    puVar1[10] = unaff_R15;

+    puVar1[0xb] = unaff_R15;

+    puVar1[0xc] = unaff_R15;

+    *(undefined4 *)(puVar1 + 0xd) = uVar2;

+    *puVar1 = &DirectComposition::CGaussianBlurEffectMarshaler::_vftable_;

+    unaff_R15 = puVar1;

+  }

+  if (unaff_R15 == (undefined8 *)0x0) {

+    unaff_ESI = -0x3fffffe9;

+  }

+  else if (-1 < unaff_ESI) {

+    *unaff_R14 = unaff_R15;

+  }

+  return unaff_ESI;

 }
```

## `FUN_1c00f66a6`  (modified)

```diff
--- FUN_1c00f66a6
+++ FUN_1c0117031
@@ -1,11 +1,127 @@
 

-void FUN_1c00f66a6(void)

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+

+longlong FUN_1c0117031(void)

 

 {

-  code *pcVar1;

+  bool bVar1;

+  char cVar2;

+  uint uVar3;

+  tagTHREADINFO *ptVar4;

+  longlong lVar5;

+  ulonglong uVar6;

+  int iVar7;

+  _HANDLEENTRY *unaff_RBX;

+  undefined *unaff_R12;

+  uint unaff_R15D;

+  undefined8 in_stack_00000020;

+  undefined8 uVar8;

+  _HANDLEENTRY *p_Var9;

+  undefined4 uVar10;

+  void *in_stack_00000058;

   

-  pcVar1 = (code *)swi(1);

-  (*pcVar1)();

-  return;

+  if (((WPP_GLOBAL_Control == unaff_R12) ||

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & unaff_R15D) == 0)) ||

+     (uVar6 = 1, (byte)WPP_GLOBAL_Control[0x29] < 2)) {

+    uVar6 = (ulonglong)unaff_RBX & 0xff;

+  }

+  if ((char)uVar6 == '\0') {

+    if ((undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED) {

+      lVar5 = FUN_1c0116fe9();

+      return lVar5;

+    }

+  }

+  else {

+    in_stack_00000020 = CONCAT71((int7)((ulonglong)in_stack_00000020 >> 8),2);

+    WPP_RECORDER_AND_TRACE_SF_d

+              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),uVar6,

+               (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED,gBaseLog,

+               in_stack_00000020);

+  }

+  iVar7 = (int)unaff_RBX;

+  UserSetLastError(0x54f);

+  if (unaff_RBX != (_HANDLEENTRY *)0x0) {

+    ObfDereferenceObject();

+  }

+  if (in_stack_00000058 != (void *)0x0) {

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,in_stack_00000058);

+  }

+  uVar10 = (undefined4)((ulonglong)in_stack_00000020 >> 0x20);

+  if (iVar7 == 0) {

+    if (((WPP_GLOBAL_Control == unaff_R12) ||

+        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & unaff_R15D) == 0)) ||

+       (cVar2 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 2)) {

+      cVar2 = (char)unaff_RBX;

+    }

+    bVar1 = (undefined8 **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+    if ((cVar2 != '\0') || (bVar1)) {

+      UserGetLastError();

+      uVar8 = CONCAT71((int7)((ulonglong)in_stack_00000020 >> 8),2);

+      WPP_RECORDER_AND_TRACE_SF_D

+                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,bVar1,gBaseLog,uVar8);

+      uVar10 = (undefined4)((ulonglong)uVar8 >> 0x20);

+    }

+  }

+  if (DAT_0 != 0) {

+    (*(code *)DAT_0)();

+  }

+  bVar1 = IS_USERCRIT_OWNED_EXCLUSIVE();

+  if (bVar1) {

+    if (gcInHMDestroyUnlockedObjectWorker != 0) {

+      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+    }

+    if (gphePrimaryDestroyTarget != (_HANDLEENTRY *)0x0) {

+      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+    }

+    if (gcSecondaryDestroyTargets < gcDeferredDestroyTargets) {

+      MicrosoftTelemetryAssertTriggeredNoArgsKM();

+    }

+    gcInHMDestroyUnlockedObjectWorker = iVar7;

+    gphePrimaryDestroyTarget = unaff_RBX;

+    DestroyExclusiveUserCritDeferredUnlockList();

+  }

+  uVar3 = AtomicExecutionCheck::GetCount();

+  if (uVar3 != 0) {

+    if ((gdwExtraInstrumentations & 1) != 0) {

+                    /* WARNING: Subroutine does not return */

+      KeBugCheckEx(0x160,uVar3,0);

+    }

+    p_Var9 = unaff_RBX;

+    DbgkWerCaptureLiveKernelDump(L"NTUSER",400,0x25,0);

+    uVar10 = (undefined4)((ulonglong)p_Var9 >> 0x20);

+  }

+  if (gptiCurrent != (_HANDLEENTRY *)0x0) {

+    lVar5 = W32GetThreadWin32Thread(SystemReserved1[0xf]);

+    if (lVar5 != 0) {

+      ptVar4 = PtiCurrentShared();

+      *(int *)(ptVar4 + 0x5ec) = iVar7;

+    }

+  }

+  gptiCurrent = unaff_RBX;

+  if (InputTraceLogging::Perf::s_userCritLoggingEnabled != false) {

+    lVar5 = PsGetCurrentThreadWin32Thread();

+    if (lVar5 != 0) {

+      uVar3 = *(uint *)(lVar5 + 0x2c);

+      if (((((uVar3 & 1) != 0) || ((uVar3 & 2) != 0)) || (0 < *(int *)(lVar5 + 0x18))) &&

+         (6 < DAT_1)) {

+        cVar2 = _tlgKeywordOn(&DAT_1,0x2000);

+        if (cVar2 != '\0') {

+          _tlgWriteTransfer_EtwWriteTransfer

+                    (&DAT_1,&DAT_1c028f055,lVar5 + 0x1c,0,CONCAT44(uVar10,2));

+          uVar3 = *(uint *)(lVar5 + 0x2c);

+        }

+      }

+      *(uint *)(lVar5 + 0x2c) = uVar3 & 0xfffffffe;

+      *(undefined8 *)(lVar5 + 0x1c) = 0;

+      *(undefined8 *)(lVar5 + 0x24) = 0;

+    }

+  }

+  EtwTraceReleaseUserCrit();

+  lVar5 = SGDGetUserSessionState();

+  ExReleaseResourceAndLeaveCriticalRegion(*(undefined8 *)(lVar5 + 8));

+  InputTraceLogging::ThreadLockedPerfRegion::~ThreadLockedPerfRegion

+            ((ThreadLockedPerfRegion *)&stack0x00000078);

+  return (longlong)iVar7;

 }
```

## `FUN_1c011ec76`  (modified)

```diff
--- FUN_1c011ec76
+++ FUN_1c01328be
@@ -1,52 +1,525 @@
 

-/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

 

-REGION * FUN_1c011ec76(void)

+undefined8 FUN_1c01328be(undefined8 param_1,ulonglong *param_2)

 

 {

-  REGION *pRVar1;

+  longlong lVar1;

+  undefined8 *puVar2;

+  longlong lVar3;

+  bool bVar4;

+  uint uVar5;

+  int iVar6;

+  EtwUserHandleType EVar7;

+  longlong *plVar8;

+  ulonglong *puVar9;

+  ulonglong uVar10;

+  longlong lVar11;

+  void *pvVar12;

+  undefined8 uVar13;

+  undefined8 *puVar14;

+  uint uVar15;

+  CLeakTrackingAllocator *pCVar16;

+  longlong unaff_RBX;

   longlong unaff_RBP;

-  REGION *unaff_RSI;

-  _RECTL *in_R9;

-  undefined4 unaff_R14D;

-  REGION *in_stack_00000028;

-  REGION *in_stack_00000030;

+  ushort unaff_DI;

+  ulonglong *puVar17;

+  longlong unaff_R12;

+  ulonglong unaff_R13;

+  uchar unaff_R14B;

+  longlong unaff_R15;

+  CLeakTrackingAllocator *in_stack_00000048;

+  uint in_stack_00000050;

+  __uint64 in_stack_00000060;

+  undefined8 *in_stack_00000068;

+  ulonglong *in_stack_00000070;

+  ushort uStack0000000000000078;

+  short sStack000000000000007a;

+  int iStack000000000000007c;

   

-  RGNMEMOBJ::vCreate((RGNMEMOBJ *)&stack0x00000030,(EPATHOBJ *)(unaff_RBP + -0x69),(int)in_R9 + 1,

-                     in_R9);

-  RGNMEMOBJ::vPushThreadGuardedObject((RGNMEMOBJ *)&stack0x00000030);

-  pRVar1 = unaff_RSI;

-  if ((in_stack_00000030 == unaff_RSI) ||

-     (RGNMEMOBJ::vInitialize((RGNMEMOBJ *)&stack0x00000028,0x70), in_stack_00000028 == unaff_RSI)) {

-    EngSetLastError(unaff_R14D);

+  MicrosoftTelemetryAssertTriggeredNoArgsKM();

+  lVar1 = *(longlong *)(unaff_RBX + 0x1a8);

+  if (gUserProcessHandleQuota <= *(int *)(lVar1 + 0x44)) {

+    UserSetLastError(0x486);

+    return 0;

+  }

+  while ((unaff_R14B == '\x01' || (DAT_0 == 0))) {

+    if (DAT_1 != 0) {

+      plVar8 = &DAT_1;

+      goto LAB_2;

+    }

+    iVar6 = HMGrowHandleTable();

+    if (iVar6 == 0) {

+      uVar13 = FUN_1c01328c9();

+      return uVar13;

+    }

+  }

+  plVar8 = &DAT_0;

+LAB_2:

+  *(longlong **)(unaff_RBP + -0x60) = plVar8;

+  uStack0000000000000078 = unaff_DI & 0x10;

+  if ((uStack0000000000000078 == 0) || (unaff_R13 == 0)) {

+    if ((unaff_DI & 0x40) == 0) {

+      if ((unaff_R13 == 0) && ((unaff_DI & 0x20) != 0)) {

+        iStack000000000000007c = 1;

+      }

+      else {

+        iStack000000000000007c = 0;

+      }

+      if ((unaff_DI >> 9 & 1) == 0) {

+        uVar5 = *(uint *)(unaff_RBP + 0x1f8);

+        param_2 = (ulonglong *)(ulonglong)uVar5;

+        *(undefined8 *)(unaff_RBP + -0x78) = 0x104;

+        pCVar16 = gpLeakTrackingAllocator;

+        in_stack_00000048 = (CLeakTrackingAllocator *)(&DAT_3 + unaff_R12);

+        uVar15 = *(uint *)in_stack_00000048;

+        puVar17 = (ulonglong *)(ulonglong)uVar15;

+        iVar6 = *(int *)gpLeakTrackingAllocator;

+        *(uint *)(unaff_RBP + -0x80) = uVar15;

+        in_stack_00000050 = uVar15;

+        in_stack_00000070 = param_2;

+        if (iVar6 == 0) {

+          puVar9 = (ulonglong *)ExAllocatePool2(0x104,param_2,puVar17);

+          if (puVar9 != (ulonglong *)0x0) {

+            LOCK();

+            *(longlong *)(pCVar16 + 0x70) = *(longlong *)(pCVar16 + 0x70) + 1;

+            UNLOCK();

+          }

+        }

+        else {

+          if (iVar6 == 1) {

+            bVar4 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                              (pCVar16,uVar15);

+            if ((bVar4) && (param_2 < param_2 + 2)) {

+              puVar14 = (undefined8 *)

+                        ExAllocatePool2(*(ulonglong *)(unaff_RBP + -0x78) & 0xfffffffffffffffd,

+                                        param_2 + 2,*(undefined4 *)(unaff_RBP + -0x80));

+              if (puVar14 == (undefined8 *)0x0) {

+                puVar9 = (ulonglong *)0x0;

+              }

+              else {

+                LOCK();

+                *(longlong *)(pCVar16 + 0x70) = *(longlong *)(pCVar16 + 0x70) + 1;

+                UNLOCK();

+                param_2 = (ulonglong *)(ulonglong)in_stack_00000050;

+                *puVar14 = param_2;

+                puVar9 = puVar14 + 2;

+                if (puVar9 != (ulonglong *)0x0) goto LAB_4;

+              }

+              param_2 = (ulonglong *)(ulonglong)in_stack_00000050;

+              NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

+                        (*(CPointerHashTable **)(pCVar16 + 8),param_2);

+              goto LAB_4;

+            }

+          }

+          else if (iVar6 == 2) {

+            in_stack_00000060 = 0;

+            bVar4 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                              (pCVar16,uVar15,&stack0x00000060);

+            if (!bVar4) {

+              in_stack_00000060 = unaff_RBP - 0x78;

+              in_stack_00000068 = (undefined8 *)(unaff_RBP + -0x80);

+              param_2 = &stack0x00000060;

+              puVar9 = (ulonglong *)

+                       NSInstrumentation::CLeakTrackingAllocator::

+                       MakeUntrackedAllocation<<lambda_992394a475252bc644037de3157b7526>,unsigned___int64_&>

+                                 (pCVar16,param_2,&stack0x00000070);

+              goto LAB_4;

+            }

+            bVar4 = false;

+            if ((param_2 < (ulonglong *)0x1000) || ((uVar5 & 0xfff) != 0)) {

+              param_2 = param_2 + 2;

+              bVar4 = true;

+              in_stack_00000070 = param_2;

+            }

+            puVar9 = (ulonglong *)ExAllocatePool2(0x104,param_2,uVar15);

+            puVar17 = param_2;

+            if (puVar9 != (ulonglong *)0x0) {

+              LOCK();

+              *(longlong *)(pCVar16 + 0x80) = *(longlong *)(pCVar16 + 0x80) + 1;

+              UNLOCK();

+              NSInstrumentation::CBackTrace::CBackTrace((CBackTrace *)(unaff_RBP + 0xf0));

+              param_2 = puVar9;

+              if ((bVar4) && (((uint)puVar9 & 0xfff) + 0x10 < 0x1000)) {

+                bVar4 = NSInstrumentation::CLeakTrackingAllocator::

+                        AssociateAllocationWithBacktrace<1>

+                                  (pCVar16,puVar9,in_stack_00000060,(CBackTrace *)(unaff_RBP + 0xf0)

+                                  );

+                if (!bVar4) {

+LAB_5:

+                  LOCK();

+                  *(longlong *)(pCVar16 + 0x88) = *(longlong *)(pCVar16 + 0x88) + 1;

+                  UNLOCK();

+                  ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                            (puVar9);

+                  puVar17 = param_2;

+                  goto LAB_6;

+                }

+                puVar9 = puVar9 + 2;

+              }

+              else {

+                bVar4 = NSInstrumentation::CLeakTrackingAllocator::

+                        AssociateAllocationWithBacktrace<0>

+                                  (pCVar16,puVar9,in_stack_00000060,(CBackTrace *)(unaff_RBP + 0xf0)

+                                  );

+                if (!bVar4) goto LAB_5;

+              }

+              goto LAB_4;

+            }

+          }

+LAB_6:

+          param_2 = puVar17;

+          puVar9 = (ulonglong *)0x0;

+        }

+LAB_4:

+        unaff_R12 = *(longlong *)(unaff_RBP + -0x58);

+        pCVar16 = in_stack_00000048;

+      }

+      else {

+        puVar9 = HMAllocateIsolatedType(unaff_R14B);

+        pCVar16 = (CLeakTrackingAllocator *)(&DAT_3 + unaff_R12);

+      }

+      if (puVar9 == (ulonglong *)0x0) goto LAB_7;

+      if (unaff_R14B == '\x01') {

+        pvVar12 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                            (pCVar16,(__uint64)param_2,

+                             (ulonglong)*(uint *)(&DAT_8 + unaff_R12),*(uint *)pCVar16);

+        puVar9[5] = (ulonglong)pvVar12;

+        if (pvVar12 == (void *)0x0) {

+          uVar13 = FUN_1c0132e2b();

+          return uVar13;

+        }

+      }

+      if ((unaff_DI >> 8 & 1) != 0) {

+        LockObjectAssignment(puVar9 + 3);

+        puVar9[4] = (ulonglong)puVar9;

+      }

+    }

+    else {

+      uVar5 = *(uint *)(unaff_RBP + 0x1f8);

+      puVar9 = (ulonglong *)(ulonglong)uVar5;

+      *(undefined **)(unaff_RBP + -0x78) = &DAT_8 + unaff_R12;

+      pCVar16 = gpLeakTrackingAllocator;

+      if (*(int *)(&DAT_8 + unaff_R12) == 0) {

+        puVar9 = (ulonglong *)RtlAllocateHeap(gpvSharedAlloc,0,puVar9);

+        if (puVar9 != (ulonglong *)0x0) {

+          puVar9[3] = 0;

+          puVar9[4] = 0;

+          puVar9[6] = (longlong)puVar9 - gpvSharedAlloc;

+          puVar9[5] = 0;

+          goto LAB_9;

+        }

+      }

+      else {

+        uVar15 = *(uint *)(&DAT_3 + unaff_R12);

+        pvVar12 = (void *)(ulonglong)uVar15;

+        in_stack_00000048 = (CLeakTrackingAllocator *)CONCAT44(in_stack_00000048._4_4_,uVar15);

+        *(undefined8 *)(unaff_RBP + -0x68) = 0x104;

+        iVar6 = *(int *)pCVar16;

+        in_stack_00000070 = puVar9;

+        if (iVar6 == 0) {

+          puVar9 = (ulonglong *)ExAllocatePool2(0x104,puVar9,pvVar12);

+          if (puVar9 != (ulonglong *)0x0) {

+            LOCK();

+            *(longlong *)(pCVar16 + 0x70) = *(longlong *)(pCVar16 + 0x70) + 1;

+            UNLOCK();

+          }

+LAB_10:

+          if (puVar9 == (ulonglong *)0x0) goto LAB_11;

+        }

+        else {

+          if (iVar6 == 1) {

+            bVar4 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                              (pCVar16,uVar15);

+            if ((!bVar4) || (puVar9 + 2 <= puVar9)) goto LAB_7;

+            puVar9 = (ulonglong *)

+                     ExAllocatePool2(*(ulonglong *)(unaff_RBP + -0x68) & 0xfffffffffffffffd,

+                                     puVar9 + 2,(ulonglong)in_stack_00000048 & 0xffffffff);

+            if (puVar9 != (ulonglong *)0x0) {

+              LOCK();

+              *(longlong *)(pCVar16 + 0x70) = *(longlong *)(pCVar16 + 0x70) + 1;

+              UNLOCK();

+              *puVar9 = (ulonglong)pvVar12;

+              puVar9 = puVar9 + 2;

+              if (puVar9 != (ulonglong *)0x0) goto LAB_10;

+            }

+            NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

+                      (*(CPointerHashTable **)(pCVar16 + 8),pvVar12);

+            goto LAB_10;

+          }

+          if (iVar6 != 2) goto LAB_7;

+          in_stack_00000060 = 0;

+          bVar4 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                            (pCVar16,uVar15,&stack0x00000060);

+          if (!bVar4) {

+            in_stack_00000060 = unaff_RBP - 0x68;

+            in_stack_00000068 = &stack0x00000048;

+            puVar9 = (ulonglong *)

+                     NSInstrumentation::CLeakTrackingAllocator::

+                     MakeUntrackedAllocation<<lambda_992394a475252bc644037de3157b7526>,unsigned___int64_&>

+                               (pCVar16,&stack0x00000060,&stack0x00000070);

+            goto LAB_10;

+          }

+          bVar4 = false;

+          if ((puVar9 < (ulonglong *)0x1000) || ((uVar5 & 0xfff) != 0)) {

+            puVar9 = puVar9 + 2;

+            bVar4 = true;

+            in_stack_00000070 = puVar9;

+          }

+          puVar9 = (ulonglong *)ExAllocatePool2(0x104,puVar9,pvVar12);

+          if (puVar9 == (ulonglong *)0x0) goto LAB_7;

+          LOCK();

+          *(longlong *)(pCVar16 + 0x80) = *(longlong *)(pCVar16 + 0x80) + 1;

+          UNLOCK();

+          NSInstrumentation::CBackTrace::CBackTrace((CBackTrace *)(unaff_RBP + 0x50));

+          if ((bVar4) && (((uint)puVar9 & 0xfff) + 0x10 < 0x1000)) {

+            bVar4 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

+                              (pCVar16,puVar9,in_stack_00000060,(CBackTrace *)(unaff_RBP + 0x50));

+            if (bVar4) {

+              puVar9 = puVar9 + 2;

+              goto LAB_10;

+            }

+LAB_12:

+            LOCK();

+            *(longlong *)(pCVar16 + 0x88) = *(longlong *)(pCVar16 + 0x88) + 1;

+            UNLOCK();

+            ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                      (puVar9);

+            goto LAB_7;

+          }

+          bVar4 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

+                            (pCVar16,puVar9,in_stack_00000060,(CBackTrace *)(unaff_RBP + 0x50));

+          if (!bVar4) goto LAB_12;

+        }

+        uVar10 = RtlAllocateHeap(gpvSharedAlloc,0,**(undefined4 **)(unaff_RBP + -0x78));

+        puVar9[5] = uVar10;

+        if (uVar10 == 0) {

+          NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,puVar9);

+          goto LAB_7;

+        }

+        puVar9[3] = 0;

+        puVar9[4] = 0;

+        puVar9[6] = uVar10 - gpvSharedAlloc;

+      }

+    }

   }

   else {

-    RGNMEMOBJ::iReduce((RGNMEMOBJ *)&stack0x00000028,(RGNOBJ *)&stack0x00000030);

-    RGNOBJ::vTighten((RGNOBJ *)&stack0x00000028);

-    if (((((*(uint *)(in_stack_00000028 + 0x38) & 0xf8000000) == 0xf8000000 ||

-           (*(uint *)(in_stack_00000028 + 0x38) & 0xf8000000) == 0) &&

-         ((*(uint *)(in_stack_00000028 + 0x44) & 0xf8000000) == 0xf8000000 ||

-          (*(uint *)(in_stack_00000028 + 0x44) & 0xf8000000) == 0)) &&

-        ((*(uint *)(in_stack_00000028 + 0x40) & 0xf8000000) == 0xf8000000 ||

-         (*(uint *)(in_stack_00000028 + 0x40) & 0xf8000000) == 0)) &&

-       ((*(uint *)(in_stack_00000028 + 0x3c) & 0xf8000000) == 0xf8000000 ||

-        (*(uint *)(in_stack_00000028 + 0x3c) & 0xf8000000) == 0)) {

-      pRVar1 = (REGION *)RGNOBJ::hrgnAssociate((RGNOBJ *)&stack0x00000028);

-      if (pRVar1 == (REGION *)0x0) {

-        REGION::vDeleteREGION(in_stack_00000028);

-        in_stack_00000028 = unaff_RSI;

+    if ((DAT_13 != 0) &&

+       (iVar6 = (*(code *)DAT_13)(), pCVar16 = gpLeakTrackingAllocator, -1 < iVar6)) {

+      if ((unaff_DI >> 9 & 1) == 0) {

+        uVar5 = *(uint *)(unaff_R12 + 8 + unaff_R15);

+        uVar15 = *(uint *)(unaff_RBP + 0x1f8);

+        puVar9 = (ulonglong *)(ulonglong)uVar15;

+        in_stack_00000048 = (CLeakTrackingAllocator *)CONCAT44(in_stack_00000048._4_4_,uVar5);

+        iVar6 = *(int *)gpLeakTrackingAllocator;

+        *(undefined8 *)(unaff_RBP + -0x70) = 0x104;

+        in_stack_00000050 = uVar5;

+        in_stack_00000070 = puVar9;

+        if (iVar6 == 0) {

+          puVar9 = (ulonglong *)ExAllocatePool2(0x104,puVar9,uVar5);

+          if (puVar9 != (ulonglong *)0x0) {

+            LOCK();

+            *(longlong *)(pCVar16 + 0x70) = *(longlong *)(pCVar16 + 0x70) + 1;

+            UNLOCK();

+          }

+        }

+        else {

+          if (iVar6 == 1) {

+            bVar4 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement(pCVar16,uVar5)

+            ;

+            if ((bVar4) && (puVar9 < puVar9 + 2)) {

+              puVar9 = (ulonglong *)

+                       ExAllocatePool2(*(ulonglong *)(unaff_RBP + -0x70) & 0xfffffffffffffffd,

+                                       puVar9 + 2,in_stack_00000050);

+              if (puVar9 == (ulonglong *)0x0) {

+                puVar9 = (ulonglong *)0x0;

+              }

+              else {

+                LOCK();

+                *(longlong *)(pCVar16 + 0x70) = *(longlong *)(pCVar16 + 0x70) + 1;

+                UNLOCK();

+                *puVar9 = (ulonglong)in_stack_00000048 & 0xffffffff;

+                puVar9 = puVar9 + 2;

+                if (puVar9 != (ulonglong *)0x0) goto LAB_14;

+              }

+              NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

+                        (*(CPointerHashTable **)(pCVar16 + 8),

+                         (void *)((ulonglong)in_stack_00000048 & 0xffffffff));

+              goto LAB_14;

+            }

+          }

+          else if (iVar6 == 2) {

+            in_stack_00000060 = 0;

+            bVar4 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                              (pCVar16,uVar5,&stack0x00000060);

+            if (!bVar4) {

+              in_stack_00000060 = unaff_RBP - 0x70;

+              in_stack_00000068 = (undefined8 *)&stack0x00000050;

+              puVar9 = (ulonglong *)

+                       NSInstrumentation::CLeakTrackingAllocator::

+                       MakeUntrackedAllocation<<lambda_992394a475252bc644037de3157b7526>,unsigned___int64_&>

+                                 (pCVar16,&stack0x00000060,&stack0x00000070);

+              goto LAB_14;

+            }

+            bVar4 = false;

+            if ((puVar9 < (ulonglong *)0x1000) || ((uVar15 & 0xfff) != 0)) {

+              puVar9 = puVar9 + 2;

+              bVar4 = true;

+              in_stack_00000070 = puVar9;

+            }

+            puVar9 = (ulonglong *)ExAllocatePool2(0x104,puVar9,uVar5);

+            if (puVar9 != (ulonglong *)0x0) {

+              LOCK();

+              *(longlong *)(pCVar16 + 0x80) = *(longlong *)(pCVar16 + 0x80) + 1;

+              UNLOCK();

+              NSInstrumentation::CBackTrace::CBackTrace((CBackTrace *)(unaff_RBP + -0x50));

+              if ((bVar4) && (((uint)puVar9 & 0xfff) + 0x10 < 0x1000)) {

+                bVar4 = NSInstrumentation::CLeakTrackingAllocator::

+                        AssociateAllocationWithBacktrace<1>

+                                  (pCVar16,puVar9,in_stack_00000060,

+                                   (CBackTrace *)(unaff_RBP + -0x50));

+                if (!bVar4) {

+LAB_15:

+                  LOCK();

+                  *(longlong *)(pCVar16 + 0x88) = *(longlong *)(pCVar16 + 0x88) + 1;

+                  UNLOCK();

+                  ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                            (puVar9);

+                  goto LAB_16;

+                }

+                puVar9 = puVar9 + 2;

+              }

+              else {

+                bVar4 = NSInstrumentation::CLeakTrackingAllocator::

+                        AssociateAllocationWithBacktrace<0>

+                                  (pCVar16,puVar9,in_stack_00000060,

+                                   (CBackTrace *)(unaff_RBP + -0x50));

+                if (!bVar4) goto LAB_15;

+              }

+              goto LAB_14;

+            }

+          }

+LAB_16:

+          puVar9 = (ulonglong *)0x0;

+        }

+      }

+      else {

+        puVar9 = HMAllocateIsolatedType(unaff_R14B);

+      }

+LAB_14:

+      if (puVar9 == (ulonglong *)0x0) goto LAB_11;

+      if (DAT_17 == 0) {

+        puVar9[5] = 0;

+      }

+      else {

+        uVar10 = (*(code *)DAT_17)();

+        puVar9[5] = uVar10;

+        if (uVar10 != 0) {

+          uVar10 = puVar9[3];

+          ObfReferenceObject();

+          puVar9[3] = unaff_R13;

+          if (uVar10 != 0) {

+            ObfDereferenceObject(uVar10);

+          }

+          puVar9[4] = (ulonglong)puVar9;

+          puVar9[6] = puVar9[5] - *(longlong *)(unaff_R13 + 0x80);

+          goto LAB_11;

+        }

+      }

+      HMFreeUserOrIsolatedType(unaff_DI,unaff_R14B,puVar9);

+    }

+    puVar9 = (ulonglong *)0x0;

+  }

+LAB_11:

+  if (puVar9 != (ulonglong *)0x0) {

+LAB_9:

+    uVar5 = giheLast;

+    lVar11 = **(longlong **)(unaff_RBP + -0x60);

+    puVar17 = (ulonglong *)(lVar11 * 0x20 + DAT_18);

+    uVar15 = (uint)lVar11;

+    puVar14 = (undefined8 *)(gpKernelHandleTable + lVar11 * 0x18);

+    **(longlong **)(unaff_RBP + -0x60) = *(longlong *)(gpKernelHandleTable + lVar11 * 0x18);

+    if (uVar5 < uVar15) {

+      giheLast = uVar15;

+    }

+    *(undefined1 *)(puVar17 + 3) = *(undefined1 *)(unaff_RBP + 0x1f0);

+    *puVar14 = puVar9;

+    if ((unaff_DI & 0x40) == 0) {

+      if ((uStack0000000000000078 == 0) || (lVar3 = *(longlong *)(unaff_RBP + 0x1e8), lVar3 == 0)) {

+        *puVar17 = 0;

+      }

+      else {

+        *puVar17 = puVar9[6];

+        puVar17[2] = *(ulonglong *)**(undefined8 **)(lVar3 + 8);

       }

     }

     else {

-      REGION::vDeleteREGION(in_stack_00000028);

-      in_stack_00000028 = unaff_RSI;

-    }

+      *puVar17 = puVar9[6];

+    }

+    if (iStack000000000000007c != 0) {

+      *(byte *)((longlong)puVar17 + 0x19) = *(byte *)((longlong)puVar17 + 0x19) | 0x40;

+    }

+    if (*(int *)(unaff_RBP + 0x200) != 0) {

+      *(byte *)((longlong)puVar17 + 0x19) = *(byte *)((longlong)puVar17 + 0x19) | 0x80;

+    }

+    puVar2 = *(undefined8 **)(unaff_RBP + 0x1e0);

+    if ((unaff_DI & 2) == 0) {

+      if ((unaff_DI & 1) != 0) {

+        puVar14[1] = puVar2;

+        uVar10 = PsGetThreadId(*puVar2);

+        puVar17[1] = uVar10;

+        puVar9[2] = puVar14[1];

+      }

+    }

+    else {

+      puVar9[2] = 0;

+      puVar14[1] = puVar2[0x35];

+      uVar10 = PsGetProcessId(*(undefined8 *)puVar2[0x35]);

+      puVar17[1] = uVar10;

+      if ((unaff_DI & 4) != 0) {

+        puVar9[3] = puVar2[0x35];

+      }

+    }

+    lVar11 = (ulonglong)DAT_19 * lVar11 + DAT_1c02c9e28;

+    uVar15 = (uint)*(ushort *)(lVar11 + 0x1a) << 0x10 | uVar15;

+    if (*(char *)(lVar11 + 0x19) < '\0') {

+      uVar15 = uVar15 | 0x80000000;

+    }

+    lVar11 = *(longlong *)(unaff_RBP + -0x58);

+    *puVar9 = (longlong)(int)uVar15;

+    if (*(int *)(&DAT_8 + lVar11) != 0) {

+      puVar17 = (ulonglong *)puVar9[5];

+      *puVar17 = (longlong)(int)uVar15;

+      puVar17[1] = puVar9[6];

+    }

+    if (lVar1 != 0) {

+      uVar5 = *(int *)(lVar1 + 0x44) + 1;

+      *(uint *)(lVar1 + 0x44) = uVar5;

+      if (*(uint *)(lVar1 + 0x48) < uVar5) {

+        *(uint *)(lVar1 + 0x48) = uVar5;

+      }

+    }

+    giheCount = giheCount + 1;

+    if (giheCountPeak < giheCount) {

+      giheCountPeak = giheCount;

+    }

+    if (sStack000000000000007a == 0) {

+      EVar7 = GetEtwUserHandleType(*(uchar *)(unaff_RBP + 0x1f0));

+      EtwTraceUserCreateHandle(*puVar9,EVar7,0);

+    }

+    else {

+      PsGetProcessId(*(undefined8 *)puVar2[0x35]);

+      if ((DAT_20 & 2) != 0) {

+        SGDGetUserSessionState();

+        GetEtwUserHandleType(*(uchar *)(unaff_RBP + 0x1f0));

+        McTemplateK0pqqq_EtwWriteTransfer();

+      }

+    }

+    puVar14[2] = 0;

+    return *puVar14;

   }

-  RGNMEMOBJTMP::~RGNMEMOBJTMP((RGNMEMOBJTMP *)&stack0x00000030);

-  EPATHOBJ::vUnlock((EPATHOBJ *)(unaff_RBP + -0x69));

-  if (*(int *)(unaff_RBP + 7) != (int)unaff_RSI) {

-    PopThreadGuardedObject(unaff_RBP + -0x19);

-  }

-  return pRVar1;

+LAB_7:

+  UserSetLastError(8);

+  return 0;

 }
```

## `FUN_1c0111ea7`  (modified)

```diff
--- FUN_1c0111ea7
+++ FUN_1c0125b07
@@ -1,40 +1,35 @@
 

-long FUN_1c0111ea7(undefined8 param_1,CResourceMarshaler *param_2,CWeakReferenceBase **param_3)

+int FUN_1c0125b07(CLeakTrackingAllocator *param_1,__uint64 param_2)

 

 {

-  longlong lVar1;

-  size_t _Size;

-  longlong lVar2;

-  long lVar3;

-  longlong unaff_RBP;

-  longlong unaff_RSI;

-  CApplicationChannel *unaff_RDI;

-  CWeakReferenceBase *unaff_R12;

+  undefined8 *puVar1;

+  int unaff_ESI;

+  undefined8 *unaff_R14;

+  undefined4 uVar2;

+  undefined8 *unaff_R15;

   

-  lVar3 = DirectComposition::CApplicationChannel::GetWeakReferenceBase

-                    ((CApplicationChannel *)((ulonglong)unaff_RDI & 0xffffffff),param_2,param_3);

-  if (-1 < lVar3) {

-    lVar3 = DirectComposition::CDCompDynamicArrayBase::Grow

-                      ((CDCompDynamicArrayBase *)(unaff_RSI + 0x98),1,0x6d6c4344);

-    if (-1 < lVar3) {

-      lVar1 = *(longlong *)(unaff_RSI + 0xb0);

-      _Size = *(size_t *)(unaff_RSI + 0xb8);

-      *(undefined8 *)(unaff_RBP + 7) = *(undefined8 *)(unaff_RBP + -0x59);

-      *(undefined4 *)(unaff_RBP + 0xf) = *(undefined4 *)(unaff_RBP + -0x35);

-      *(undefined4 *)(unaff_RBP + 0x13) = *(undefined4 *)(unaff_RBP + -0x31);

-      lVar2 = *(longlong *)(unaff_RSI + 0x98);

-      *(int *)(unaff_RBP + 0x1b) = (int)unaff_R12;

-      *(undefined4 *)(unaff_RBP + 0x17) = *(undefined4 *)(unaff_RBP + -0x2d);

-      memcpy((void *)((lVar1 + -1) * _Size + lVar2),(void *)(unaff_RBP + 7),_Size);

-      **(undefined1 **)(unaff_RBP + 0x7f) = 1;

-      goto LAB_0;

-    }

+  puVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     (param_1,param_2,0x80,0x65664344);

+  if (puVar1 != (undefined8 *)0x0) {

+    uVar2 = SUB84(unaff_R15,0);

+    *(undefined4 *)(puVar1 + 4) = uVar2;

+    puVar1[6] = unaff_R15;

+    puVar1[3] = 1;

+    *(undefined4 *)((longlong)puVar1 + 0x24) = 0x40;

+    *(undefined4 *)(puVar1 + 9) = uVar2;

+    puVar1[10] = unaff_R15;

+    puVar1[0xb] = unaff_R15;

+    puVar1[0xc] = unaff_R15;

+    *(undefined4 *)(puVar1 + 0xd) = uVar2;

+    *puVar1 = &DirectComposition::CGaussianBlurEffectMarshaler::_vftable_;

+    unaff_R15 = puVar1;

   }

-  unaff_R12 = *(CWeakReferenceBase **)(unaff_RBP + -0x59);

-LAB_0:

-  if (unaff_R12 != (CWeakReferenceBase *)0x0) {

-    DirectComposition::CApplicationChannel::ReleaseWeakReference(unaff_RDI,unaff_R12);

+  if (unaff_R15 == (undefined8 *)0x0) {

+    unaff_ESI = -0x3fffffe9;

   }

-  return lVar3;

+  else if (-1 < unaff_ESI) {

+    *unaff_R14 = unaff_R15;

+  }

+  return unaff_ESI;

 }
```

## `FUN_1c01128f0`  (modified)

```diff
--- FUN_1c01128f0
+++ FUN_1c01263c2
@@ -1,11 +1,28 @@
 

-/* WARNING: Control flow encountered bad instruction data */

-

-void FUN_1c01128f0(longlong param_1)

+int FUN_1c01263c2(CLeakTrackingAllocator *param_1,__uint64 param_2)

 

 {

-  *(int *)(param_1 + -0x75) = *(int *)(param_1 + -0x75) + -1;

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+  undefined8 *puVar1;

+  int unaff_ESI;

+  undefined8 *unaff_R14;

+  undefined8 *unaff_R15;

+  

+  puVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     (param_1,param_2,0x70,0x72764344);

+  if (puVar1 != (undefined8 *)0x0) {

+    *(int *)(puVar1 + 4) = (int)unaff_R15;

+    puVar1[6] = unaff_R15;

+    puVar1[3] = 1;

+    *(undefined4 *)((longlong)puVar1 + 0x24) = 0xc6;

+    *puVar1 = &DirectComposition::CVisualCaptureMarshaler::_vftable_;

+    unaff_R15 = puVar1;

+  }

+  if (unaff_R15 == (undefined8 *)0x0) {

+    unaff_ESI = -0x3fffffe9;

+  }

+  else if (-1 < unaff_ESI) {

+    *unaff_R14 = unaff_R15;

+  }

+  return unaff_ESI;

 }
```

## `PrivateAPI::`anonymous_namespace'::EnterSharedCritInternal`  (modified)

```diff
--- PrivateAPI::`anonymous_namespace'::EnterSharedCritInternal
+++ PrivateAPI::`anonymous_namespace'::EnterSharedCritInternal
@@ -1,2 +1,36 @@
-Failed to decompile win32kbase.sys - .ProgramDB PrivateAPI::`anonymous_namespace'::EnterSharedCritInternal : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+

+undefined8 PrivateAPI::`anonymous_namespace'::EnterSharedCritInternal(void)

+

+{

+  int iVar1;

+  longlong lVar2;

+  undefined8 *puVar3;

+  undefined8 uVar4;

+  undefined8 uVar5;

+  undefined1 auStack_58 [32];

+  CritAcquire local_38 [32];

+  ulonglong local_18;

+  

+  local_18 = __security_cookie ^ (ulonglong)auStack_58;

+  InputTraceLogging::Perf::CritAcquire::CritAcquire(local_38,0);

+  iVar1 = IsEtwUserCritEnabled();

+  uVar5 = 0;

+  if (iVar1 != 0) {

+    lVar2 = PsGetCurrentThreadWin32Thread();

+    if (lVar2 != 0) {

+      uVar4 = KeQueryPerformanceCounter(0);

+      *(undefined8 *)(lVar2 + 8) = uVar4;

+    }

+  }

+  lVar2 = SGDGetUserSessionState();

+  puVar3 = (undefined8 *)ExEnterCriticalRegionAndAcquireResourceShared(*(undefined8 *)(lVar2 + 8));

+  EtwTraceAcquiredSharedUserCrit();

+  if (puVar3 != (undefined8 *)0x0) {

+    uVar5 = *puVar3;

+  }

+  InputTraceLogging::Perf::CritAcquire::~CritAcquire(local_38);

+  return uVar5;

+}

+
```

## `NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit`  (modified)

```diff
--- NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit
+++ NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit
@@ -1,2 +1,104 @@
-Failed to decompile win32kbase.sys - .ProgramDB NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: void * __ptr64 __cdecl

+   NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit(unsigned __int64,unsigned

+   __int64,unsigned int) __ptr64 */

+

+void * __thiscall

+NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+          (CLeakTrackingAllocator *this,__uint64 param_1,__uint64 param_2,uint param_3)

+

+{

+  int iVar1;

+  CLeakTrackingAllocator *this_00;

+  bool bVar2;

+  void *pvVar3;

+  undefined8 *puVar4;

+  __uint64 local_res8;

+  __uint64 local_res10 [2];

+  uint local_res20 [2];

+  ulonglong local_e8 [2];

+  ulonglong *local_d8;

+  uint *local_d0;

+  CBackTrace local_c8 [160];

+  

+  this_00 = gpLeakTrackingAllocator;

+  pvVar3 = (void *)(ulonglong)param_3;

+  local_e8[0] = 0x104;

+  iVar1 = *(int *)gpLeakTrackingAllocator;

+  local_res8 = param_2;

+  local_res10[0] = param_1;

+  local_res20[0] = param_3;

+  if (iVar1 == 0) {

+    pvVar3 = (void *)ExAllocatePool2(0x105,param_2,pvVar3);

+    if (pvVar3 != (void *)0x0) {

+      LOCK();

+      *(longlong *)(this_00 + 0x70) = *(longlong *)(this_00 + 0x70) + 1;

+      UNLOCK();

+    }

+  }

+  else {

+    if (iVar1 == 1) {

+      bVar2 = EnsurePoolTagIncrement(gpLeakTrackingAllocator,param_3);

+      if ((bVar2) && (param_2 < param_2 + 0x10)) {

+        puVar4 = (undefined8 *)

+                 ExAllocatePool2(local_e8[0] & 0xfffffffffffffffd | 1,param_2 + 0x10,local_res20[0])

+        ;

+        if (puVar4 != (undefined8 *)0x0) {

+          LOCK();

+          *(longlong *)(this_00 + 0x70) = *(longlong *)(this_00 + 0x70) + 1;

+          UNLOCK();

+          *puVar4 = pvVar3;

+          if (puVar4 + 2 != (undefined8 *)0x0) {

+            return puVar4 + 2;

+          }

+        }

+        CPointerHashTable::LookupInterlockedDecrement(*(CPointerHashTable **)(this_00 + 8),pvVar3);

+        return (void *)0x0;

+      }

+    }

+    else if (iVar1 == 2) {

+      local_res10[0] = 0;

+      bVar2 = IsTagTracked(gpLeakTrackingAllocator,param_3,local_res10);

+      if (!bVar2) {

+        local_d8 = local_e8;

+        local_d0 = local_res20;

+        pvVar3 = (void *)MakeUntrackedAllocation<<lambda_a6c9ad8a3ccccec93018e691c2ba1200>,unsigned___int64_&>

+                                   (this_00,&local_d8,&local_res8);

+        return pvVar3;

+      }

+      bVar2 = false;

+      if ((param_2 < 0x1000) || ((param_2 & 0xfff) != 0)) {

+        param_2 = param_2 + 0x10;

+        bVar2 = true;

+        local_res8 = param_2;

+      }

+      pvVar3 = (void *)ExAllocatePool2(0x105,param_2,pvVar3);

+      if (pvVar3 != (void *)0x0) {

+        LOCK();

+        *(longlong *)(this_00 + 0x80) = *(longlong *)(this_00 + 0x80) + 1;

+        UNLOCK();

+        CBackTrace::CBackTrace(local_c8);

+        if ((bVar2) && (((uint)pvVar3 & 0xfff) + 0x10 < 0x1000)) {

+          bVar2 = AssociateAllocationWithBacktrace<1>(this_00,pvVar3,local_res10[0],local_c8);

+          if (bVar2) {

+            return (void *)((longlong)pvVar3 + 0x10);

+          }

+        }

+        else {

+          bVar2 = AssociateAllocationWithBacktrace<0>(this_00,pvVar3,local_res10[0],local_c8);

+          if (bVar2) {

+            return pvVar3;

+          }

+        }

+        LOCK();

+        *(longlong *)(this_00 + 0x88) = *(longlong *)(this_00 + 0x88) + 1;

+        UNLOCK();

+        ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                  (pvVar3);

+      }

+    }

+    pvVar3 = (void *)0x0;

+  }

+  return pvVar3;

+}

+
```

## `DirectComposition::CEffectBrushMarshaler::SetReferenceProperty`  (modified)

```diff
--- DirectComposition::CEffectBrushMarshaler::SetReferenceProperty
+++ DirectComposition::CEffectBrushMarshaler::SetReferenceProperty
@@ -1,2 +1,110 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CEffectBrushMarshaler::SetReferenceProperty : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: virtual long __cdecl DirectComposition::CEffectBrushMarshaler::SetReferenceProperty(class

+   DirectComposition::CApplicationChannel * __ptr64,unsigned int,class

+   DirectComposition::CResourceMarshaler * __ptr64,bool * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CEffectBrushMarshaler::SetReferenceProperty

+          (CEffectBrushMarshaler *this,CApplicationChannel *param_1,uint param_2,

+          CResourceMarshaler *param_3,bool *param_4)

+

+{

+  undefined1 auVar1 [16];

+  bool bVar2;

+  long lVar3;

+  longlong lVar4;

+  void *pvVar5;

+  CLeakTrackingAllocator *this_00;

+  CEffectBrushMarshaler *pCVar6;

+  int iVar7;

+  bool local_res18 [16];

+  MIL_RESOURCE_TYPE in_stack_ffffffffffffffa8;

+  MIL_RESOURCE_TYPE MVar8;

+  ulong uVar9;

+  

+  if ((param_2 & 0xc0000000) == 0x80000000) {

+    if (param_3 != (CResourceMarshaler *)0x0) {

+      MVar8 = *(MIL_RESOURCE_TYPE *)(param_3 + 0x24);

+      bVar2 = CResourceMarshaler::IsDerivedResourceType(MVar8,0xb5);

+      if (((((!bVar2) && (bVar2 = CResourceMarshaler::IsDerivedResourceType(MVar8,0x16), !bVar2)) &&

+           (bVar2 = CResourceMarshaler::IsDerivedResourceType(MVar8,9), !bVar2)) &&

+          ((bVar2 = CResourceMarshaler::IsDerivedResourceType(MVar8,0xf), !bVar2 &&

+           (bVar2 = CResourceMarshaler::IsDerivedResourceType(MVar8,0x71), !bVar2)))) &&

+         ((bVar2 = CResourceMarshaler::IsDerivedResourceType(MVar8,0x49), !bVar2 &&

+          ((bVar2 = CResourceMarshaler::IsDerivedResourceType(MVar8,0xcb), !bVar2 &&

+           (bVar2 = CResourceMarshaler::IsDerivedResourceType(MVar8,0x39), !bVar2)))))) {

+        lVar3 = FUN_1c0140850();

+        return lVar3;

+      }

+    }

+    pvVar5 = *(void **)(this + 0x58);

+    iVar7 = 0;

+    if (pvVar5 == (void *)0x0) {

+      if (*(longlong *)(this + 0x48) == 0) {

+        iVar7 = -0x3ffffff3;

+      }

+      else {

+        this_00 = (CLeakTrackingAllocator *)CONCAT44(0,*(uint *)(*(longlong *)(this + 0x48) + 0x50))

+        ;

+        auVar1._8_8_ = 0;

+        auVar1._0_8_ = this_00;

+        if (SUB168(ZEXT816(8) * auVar1,8) == 0) {

+          pvVar5 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             (this_00,0,SUB168(ZEXT816(8) * auVar1,0),0x69664344);

+          *(void **)(this + 0x58) = pvVar5;

+          if (pvVar5 == (void *)0x0) {

+            iVar7 = -0x3fffffe9;

+          }

+          else {

+            *(undefined4 *)(this + 0x60) = *(undefined4 *)(*(longlong *)(this + 0x48) + 0x50);

+            iVar7 = 0;

+          }

+        }

+        else {

+          iVar7 = -0x3fffff6b;

+        }

+      }

+    }

+    local_res18[0] = false;

+    if (iVar7 < 0) {

+      return iVar7;

+    }

+    if ((ulonglong)(param_2 & 0x3fffffff) < (ulonglong)*(uint *)(this + 0x60)) {

+      lVar3 = CBrushMarshaler::SetBrushPropertyHelper

+                        ((CBrushMarshaler *)this,param_1,

+                         (CBrushMarshaler **)

+                         ((longlong)pvVar5 + (ulonglong)(param_2 & 0x3fffffff) * 8),param_3,

+                         in_stack_ffffffffffffffa8,0,local_res18);

+      if (local_res18[0] == false) {

+        return lVar3;

+      }

+      *(undefined4 *)(this + 100) = 0;

+      *param_4 = true;

+      return lVar3;

+    }

+code_r0x0001c0140850:

+    lVar3 = -0x3ffffff3;

+  }

+  else {

+    if (param_2 == 0) {

+      if ((param_3 != (CResourceMarshaler *)0x0) &&

+         (lVar4 = (**(code **)(*(longlong *)param_3 + 0x60))(param_3), lVar4 == 0))

+      goto code_r0x0001c0140850;

+      pCVar6 = this + 0x48;

+      uVar9 = 0x20;

+      MVar8 = 0x1c;

+    }

+    else {

+      if (param_2 != 1) goto code_r0x0001c0140850;

+      pCVar6 = this + 0x50;

+      uVar9 = 0x40;

+      MVar8 = 0x87;

+    }

+    lVar3 = CResourceMarshaler::SetReferencePropertyHelper

+                      (param_1,(CResourceMarshaler **)pCVar6,param_3,1,MVar8,(ulong *)(this + 0x10),

+                       uVar9,0,param_4);

+  }

+  return lVar3;

+}

+
```

## `DirectComposition::CApplicationChannel::GetWeakReferenceBase`  (modified)

```diff
--- DirectComposition::CApplicationChannel::GetWeakReferenceBase
+++ DirectComposition::CApplicationChannel::GetWeakReferenceBase
@@ -1,2 +1,58 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CApplicationChannel::GetWeakReferenceBase : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: long __cdecl DirectComposition::CApplicationChannel::GetWeakReferenceBase(class

+   DirectComposition::CResourceMarshaler * __ptr64,class DirectComposition::CWeakReferenceBase *

+   __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CApplicationChannel::GetWeakReferenceBase

+          (CApplicationChannel *this,CResourceMarshaler *param_1,CWeakReferenceBase **param_2)

+

+{

+  int iVar1;

+  int iVar2;

+  longlong lVar3;

+  CWeakReferenceBase *pCVar4;

+  long lVar5;

+  CResourceMarshaler *local_18;

+  CWeakReferenceBase *local_10;

+  

+  lVar5 = 0;

+  local_18 = param_1;

+  if ((*(uint *)(param_1 + 0x10) & 4) == 0) {

+    pCVar4 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)this,(__uint64)param_1,0x18,0x72774344);

+    if (pCVar4 != (CWeakReferenceBase *)0x0) {

+      *(CResourceMarshaler **)(pCVar4 + 0x10) = param_1;

+      *(undefined4 *)(pCVar4 + 8) = 1;

+      local_10 = pCVar4;

+      lVar3 = RtlInsertElementGenericTable(this + 0x108,&local_18,0x10);

+      if (lVar3 != 0) {

+        *(uint *)(param_1 + 0x10) = *(uint *)(param_1 + 0x10) | 4;

+        goto LAB_0;

+      }

+      NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,pCVar4);

+    }

+    lVar5 = -0x3fffffe9;

+    pCVar4 = (CWeakReferenceBase *)0x0;

+  }

+  else {

+    local_10 = (CWeakReferenceBase *)0x0;

+    pCVar4 = (CWeakReferenceBase *)0x0;

+    lVar3 = RtlLookupElementGenericTable(this + 0x108,&local_18);

+    if (lVar3 != 0) {

+      pCVar4 = *(CWeakReferenceBase **)(lVar3 + 8);

+    }

+    iVar2 = *(int *)(pCVar4 + 8);

+    iVar1 = iVar2 + 1;

+    *(int *)(pCVar4 + 8) = iVar1;

+    lVar5 = 0;

+    if (iVar1 == 0) {

+      *(int *)(pCVar4 + 8) = iVar2;

+      return -0x3fe1fefd;

+    }

+  }

+LAB_0:

+  *param_2 = pCVar4;

+  return lVar5;

+}

+
```

## `CInputSpace::AddRegion`  (modified)

```diff
--- CInputSpace::AddRegion
+++ CInputSpace::AddRegion
@@ -1,2 +1,280 @@
-Failed to decompile win32kbase.sys - .ProgramDB CInputSpace::AddRegion : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */

+/* public: long __cdecl CInputSpace::AddRegion(struct CInputSpaceRegion const & __ptr64,struct

+   CInputSpaceRegion * __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+CInputSpace::AddRegion(CInputSpace *this,CInputSpaceRegion *param_1,CInputSpaceRegion **param_2)

+

+{

+  int iVar1;

+  longlong *plVar2;

+  code *pcVar3;

+  undefined4 uVar4;

+  undefined4 uVar5;

+  undefined4 uVar6;

+  longlong lVar7;

+  undefined8 uVar8;

+  undefined8 uVar9;

+  undefined8 uVar10;

+  undefined8 uVar11;

+  CLeakTrackingAllocator *this_00;

+  bool bVar12;

+  long lVar13;

+  longlong *plVar14;

+  longlong lVar15;

+  CInputSpaceRegion *pCVar16;

+  DISPLAYCONFIG_PATH_INFO_INTERNAL *this_01;

+  CInputSpaceRegion *pCVar17;

+  CInputSpaceRegion *pCVar18;

+  uint uVar19;

+  CInputSpaceRegion *pCVar20;

+  undefined8 uVar21;

+  undefined4 local_res18 [2];

+  __uint64 local_res20;

+  ulonglong local_e8;

+  ulonglong *local_d8;

+  CInputSpaceRegion *local_d0;

+  CBackTrace local_c8 [24];

+  CInputSpaceRegion aCStack_b0 [136];

+  

+  if (param_2 != (CInputSpaceRegion **)0x0) {

+    *param_2 = (CInputSpaceRegion *)0x0;

+  }

+  this_00 = gpLeakTrackingAllocator;

+  uVar21 = 0x104;

+  local_res18[0] = 0x6f436e49;

+  local_e8 = 0x104;

+  iVar1 = *(int *)gpLeakTrackingAllocator;

+  if (iVar1 == 0) {

+    plVar14 = (longlong *)ExAllocatePool2(0x104,0x2d8,0x6f436e49);

+    if (plVar14 != (longlong *)0x0) {

+      LOCK();

+      *(longlong *)(this_00 + 0x70) = *(longlong *)(this_00 + 0x70) + 1;

+      UNLOCK();

+    }

+  }

+  else if (iVar1 == 1) {

+    bVar12 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                       (gpLeakTrackingAllocator,0x6f436e49);

+    if (!bVar12) {

+      return -0x3fffffe9;

+    }

+    plVar14 = (longlong *)ExAllocatePool2(local_e8 & 0xfffffffffffffffd,0x2e8,local_res18[0]);

+    if (plVar14 != (longlong *)0x0) {

+      LOCK();

+      *(longlong *)(this_00 + 0x70) = *(longlong *)(this_00 + 0x70) + 1;

+      UNLOCK();

+      *plVar14 = 0x6f436e49;

+      plVar14 = plVar14 + 2;

+      if (plVar14 != (longlong *)0x0) goto LAB_0;

+    }

+    NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

+              (*(CPointerHashTable **)(this_00 + 8),(void *)0x6f436e49);

+  }

+  else {

+    if (iVar1 != 2) {

+      return -0x3fffffe9;

+    }

+    local_res20 = 0;

+    bVar12 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                       (gpLeakTrackingAllocator,0x6f436e49,&local_res20);

+    if (bVar12) {

+      plVar14 = (longlong *)ExAllocatePool2(uVar21,0x2e8,0x6f436e49);

+      if (plVar14 == (longlong *)0x0) {

+        return -0x3fffffe9;

+      }

+      LOCK();

+      *(longlong *)(this_00 + 0x80) = *(longlong *)(this_00 + 0x80) + 1;

+      UNLOCK();

+      NSInstrumentation::CBackTrace::CBackTrace(local_c8);

+      if (0xfff < ((uint)plVar14 & 0xfff) + 0x10) {

+        bVar12 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

+                           (this_00,plVar14,local_res20,local_c8);

+        if (!bVar12) goto LAB_1;

+        goto LAB_2;

+      }

+      bVar12 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

+                         (this_00,plVar14,local_res20,local_c8);

+      if (!bVar12) {

+LAB_1:

+        LOCK();

+        *(longlong *)(this_00 + 0x88) = *(longlong *)(this_00 + 0x88) + 1;

+        UNLOCK();

+        ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                  (plVar14);

+        return -0x3fffffe9;

+      }

+      plVar14 = plVar14 + 2;

+    }

+    else {

+      local_d8 = &local_e8;

+      local_d0 = (CInputSpaceRegion *)local_res18;

+      plVar14 = (longlong *)

+                NSInstrumentation::CLeakTrackingAllocator::

+                MakeUntrackedAllocation<<lambda_992394a475252bc644037de3157b7526>,unsigned___int64_&>

+                          (this_00,&local_d8,&stack0xffffffffffffff20);

+    }

+  }

+LAB_0:

+  if (plVar14 == (longlong *)0x0) {

+    return -0x3fffffe9;

+  }

+LAB_2:

+  lVar15 = 5;

+  pCVar17 = (CInputSpaceRegion *)(plVar14 + 2);

+  do {

+    pCVar18 = param_1;

+    pCVar16 = pCVar17;

+    lVar7 = *(longlong *)(pCVar18 + 8);

+    *(longlong *)pCVar16 = *(longlong *)pCVar18;

+    *(longlong *)(pCVar16 + 8) = lVar7;

+    lVar7 = *(longlong *)(pCVar18 + 0x18);

+    *(longlong *)(pCVar16 + 0x10) = *(longlong *)(pCVar18 + 0x10);

+    *(longlong *)(pCVar16 + 0x18) = lVar7;

+    lVar7 = *(longlong *)(pCVar18 + 0x28);

+    *(longlong *)(pCVar16 + 0x20) = *(longlong *)(pCVar18 + 0x20);

+    *(longlong *)(pCVar16 + 0x28) = lVar7;

+    lVar7 = *(longlong *)(pCVar18 + 0x38);

+    *(longlong *)(pCVar16 + 0x30) = *(longlong *)(pCVar18 + 0x30);

+    *(longlong *)(pCVar16 + 0x38) = lVar7;

+    lVar7 = *(longlong *)(pCVar18 + 0x48);

+    *(longlong *)(pCVar16 + 0x40) = *(longlong *)(pCVar18 + 0x40);

+    *(longlong *)(pCVar16 + 0x48) = lVar7;

+    lVar7 = *(longlong *)(pCVar18 + 0x58);

+    *(longlong *)(pCVar16 + 0x50) = *(longlong *)(pCVar18 + 0x50);

+    *(longlong *)(pCVar16 + 0x58) = lVar7;

+    lVar7 = *(longlong *)(pCVar18 + 0x68);

+    *(longlong *)(pCVar16 + 0x60) = *(longlong *)(pCVar18 + 0x60);

+    *(longlong *)(pCVar16 + 0x68) = lVar7;

+    lVar7 = *(longlong *)(pCVar18 + 0x78);

+    param_1 = pCVar18 + 0x80;

+    *(longlong *)(pCVar16 + 0x70) = *(longlong *)(pCVar18 + 0x70);

+    *(longlong *)(pCVar16 + 0x78) = lVar7;

+    lVar15 = lVar15 + -1;

+    pCVar17 = pCVar16 + 0x80;

+  } while (lVar15 != 0);

+  lVar15 = *(longlong *)(pCVar18 + 0x88);

+  *(longlong *)(pCVar16 + 0x80) = *(longlong *)param_1;

+  *(longlong *)(pCVar16 + 0x88) = lVar15;

+  lVar15 = *(longlong *)(pCVar18 + 0x98);

+  *(longlong *)(pCVar16 + 0x90) = *(longlong *)(pCVar18 + 0x90);

+  *(longlong *)(pCVar16 + 0x98) = lVar15;

+  uVar4 = *(undefined4 *)(pCVar18 + 0xa4);

+  uVar5 = *(undefined4 *)(pCVar18 + 0xa8);

+  uVar6 = *(undefined4 *)(pCVar18 + 0xac);

+  *(undefined4 *)(pCVar16 + 0xa0) = *(undefined4 *)(pCVar18 + 0xa0);

+  *(undefined4 *)(pCVar16 + 0xa4) = uVar4;

+  *(undefined4 *)(pCVar16 + 0xa8) = uVar5;

+  *(undefined4 *)(pCVar16 + 0xac) = uVar6;

+  uVar4 = *(undefined4 *)(pCVar18 + 0xb4);

+  uVar5 = *(undefined4 *)(pCVar18 + 0xb8);

+  uVar6 = *(undefined4 *)(pCVar18 + 0xbc);

+  *(undefined4 *)(pCVar16 + 0xb0) = *(undefined4 *)(pCVar18 + 0xb0);

+  *(undefined4 *)(pCVar16 + 0xb4) = uVar4;

+  *(undefined4 *)(pCVar16 + 0xb8) = uVar5;

+  *(undefined4 *)(pCVar16 + 0xbc) = uVar6;

+  *(longlong *)(pCVar16 + 0xc0) = *(longlong *)(pCVar18 + 0xc0);

+  plVar2 = *(longlong **)(this + 0x5b8);

+  if ((CInputSpace *)*plVar2 != this + 0x5b0) {

+    pCVar17 = (CInputSpaceRegion *)0x3;

+    pcVar3 = (code *)swi(0x29);

+    (*pcVar3)();

+    do {

+      lVar15 = 5;

+      pCVar16 = aCStack_b0;

+      do {

+        pCVar20 = pCVar16;

+        pCVar18 = pCVar17;

+        uVar21 = *(undefined8 *)(pCVar18 + 8);

+        uVar8 = *(undefined8 *)(pCVar18 + 0x10);

+        uVar9 = *(undefined8 *)(pCVar18 + 0x18);

+        *(undefined8 *)pCVar20 = *(undefined8 *)pCVar18;

+        *(undefined8 *)(pCVar20 + 8) = uVar21;

+        uVar21 = *(undefined8 *)(pCVar18 + 0x20);

+        uVar10 = *(undefined8 *)(pCVar18 + 0x28);

+        *(undefined8 *)(pCVar20 + 0x10) = uVar8;

+        *(undefined8 *)(pCVar20 + 0x18) = uVar9;

+        uVar8 = *(undefined8 *)(pCVar18 + 0x30);

+        uVar9 = *(undefined8 *)(pCVar18 + 0x38);

+        *(undefined8 *)(pCVar20 + 0x20) = uVar21;

+        *(undefined8 *)(pCVar20 + 0x28) = uVar10;

+        uVar21 = *(undefined8 *)(pCVar18 + 0x40);

+        uVar10 = *(undefined8 *)(pCVar18 + 0x48);

+        *(undefined8 *)(pCVar20 + 0x30) = uVar8;

+        *(undefined8 *)(pCVar20 + 0x38) = uVar9;

+        uVar8 = *(undefined8 *)(pCVar18 + 0x50);

+        uVar9 = *(undefined8 *)(pCVar18 + 0x58);

+        *(undefined8 *)(pCVar20 + 0x40) = uVar21;

+        *(undefined8 *)(pCVar20 + 0x48) = uVar10;

+        uVar21 = *(undefined8 *)(pCVar18 + 0x60);

+        uVar10 = *(undefined8 *)(pCVar18 + 0x68);

+        *(undefined8 *)(pCVar20 + 0x50) = uVar8;

+        *(undefined8 *)(pCVar20 + 0x58) = uVar9;

+        uVar8 = *(undefined8 *)(pCVar18 + 0x70);

+        uVar9 = *(undefined8 *)(pCVar18 + 0x78);

+        *(undefined8 *)(pCVar20 + 0x60) = uVar21;

+        *(undefined8 *)(pCVar20 + 0x68) = uVar10;

+        *(undefined8 *)(pCVar20 + 0x70) = uVar8;

+        *(undefined8 *)(pCVar20 + 0x78) = uVar9;

+        lVar15 = lVar15 + -1;

+        pCVar17 = pCVar18 + 0x80;

+        pCVar16 = pCVar20 + 0x80;

+      } while (lVar15 != 0);

+      uVar8 = *(undefined8 *)(pCVar18 + 0x88);

+      uVar21 = *(undefined8 *)(pCVar18 + 0xc0);

+      uVar9 = *(undefined8 *)(pCVar18 + 0x90);

+      uVar10 = *(undefined8 *)(pCVar18 + 0x98);

+      *(undefined8 *)(pCVar20 + 0x80) = *(undefined8 *)(pCVar18 + 0x80);

+      *(undefined8 *)(pCVar20 + 0x88) = uVar8;

+      uVar8 = *(undefined8 *)(pCVar18 + 0xa0);

+      uVar11 = *(undefined8 *)(pCVar18 + 0xa8);

+      *(undefined8 *)(pCVar20 + 0x90) = uVar9;

+      *(undefined8 *)(pCVar20 + 0x98) = uVar10;

+      uVar9 = *(undefined8 *)(pCVar18 + 0xb0);

+      uVar10 = *(undefined8 *)(pCVar18 + 0xb8);

+      *(undefined8 *)(pCVar20 + 0xa0) = uVar8;

+      *(undefined8 *)(pCVar20 + 0xa8) = uVar11;

+      *(undefined8 *)(pCVar20 + 0xb0) = uVar9;

+      *(undefined8 *)(pCVar20 + 0xb8) = uVar10;

+      *(undefined8 *)(pCVar20 + 0xc0) = uVar21;

+      AddRegion((CInputSpace *)&stack0x000001c1,aCStack_b0,&local_d0);

+      do {

+        if (local_d0 != (CInputSpaceRegion *)0x0) {

+          CInputSpaceRegion::MapToDisplayPath(local_d0,(DISPLAYCONFIG_PATH_INFO_INTERNAL *)param_1);

+        }

+        do {

+          uVar19 = (int)plVar14 + 1;

+          plVar14 = (longlong *)(ulonglong)uVar19;

+          if (*(uint *)this_00 <= uVar19) {

+            lVar13 = CInputConfig::_ConfigureInputSpace

+                               ((CInputConfig *)param_2,(CInputSpace *)&stack0x000001c1);

+            RIMFreeQDCActivePathsData(this_00);

+            if (lVar13 < 0) {

+              FreeRegions((CInputSpace *)&stack0x000001c1);

+            }

+            return 0;

+          }

+          param_1 = (CInputSpaceRegion *)((longlong)plVar14 * 0xd8 + *(longlong *)(this_00 + 8));

+          this_01 = (DISPLAYCONFIG_PATH_INFO_INTERNAL *)param_1;

+          InputTraceLogging::InputConfig::DisplayPath((DISPLAYCONFIG_PATH_INFO_INTERNAL *)param_1);

+          local_d0 = (CInputSpaceRegion *)0x0;

+          bVar12 = CInputConfig::_FindRegionForDisplay

+                             ((CInputConfig *)this_01,(DISPLAYCONFIG_PATH_INFO_INTERNAL *)param_1,

+                              (CInputSpace *)&stack0x000001c1,(tagQDC_DATA *)this_00,&local_d0);

+        } while (!bVar12);

+        pCVar17 = local_d0;

+      } while (local_d0[0x1e8] == (CInputSpaceRegion)0x0);

+    } while( true );

+  }

+  *plVar14 = (longlong)(this + 0x5b0);

+  plVar14[1] = (longlong)plVar2;

+  *plVar2 = (longlong)plVar14;

+  *(longlong **)(this + 0x5b8) = plVar14;

+  *(int *)(this + 0x5ac) = *(int *)(this + 0x5ac) + 1;

+  if (param_2 != (CInputSpaceRegion **)0x0) {

+    *param_2 = (CInputSpaceRegion *)(plVar14 + 2);

+  }

+  return 0;

+}

+
```

## `DirectComposition::CAnimationMarshaler::EnsureTimeListEntry`  (modified)

```diff
--- DirectComposition::CAnimationMarshaler::EnsureTimeListEntry
+++ DirectComposition::CAnimationMarshaler::EnsureTimeListEntry
@@ -1,2 +1,36 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CAnimationMarshaler::EnsureTimeListEntry : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: long __cdecl DirectComposition::CAnimationMarshaler::EnsureTimeListEntry(void) __ptr64

+    */

+

+long __thiscall

+DirectComposition::CAnimationMarshaler::EnsureTimeListEntry(CAnimationMarshaler *this)

+

+{

+  longlong lVar1;

+  undefined8 *puVar2;

+  __uint64 in_RDX;

+  

+  lVar1 = *(longlong *)(this + 0x50);

+  if (lVar1 != 0) {

+    if ((*(uint *)(lVar1 + 0x18) & 2) == 0) goto LAB_0;

+    *(undefined8 *)(this + 0x50) = 0;

+  }

+  puVar2 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     ((CLeakTrackingAllocator *)this,in_RDX,0x38,0x6c614344);

+  if (puVar2 == (undefined8 *)0x0) {

+    *(undefined8 *)(this + 0x50) = 0;

+    return -0x3fffffe9;

+  }

+  *(undefined4 *)(puVar2 + 6) = 1;

+  *puVar2 = this;

+  *(undefined8 **)(this + 0x50) = puVar2;

+  if (lVar1 != 0) {

+    *(undefined8 **)(lVar1 + 0x10) = puVar2;

+  }

+LAB_0:

+  if (*(longlong *)(this + 0x48) == 0) {

+    *(undefined8 *)(this + 0x48) = *(undefined8 *)(this + 0x50);

+  }

+  return 0;

+}

+
```

## `DirectComposition::CEvent::Create`  (modified)

```diff
--- DirectComposition::CEvent::Create
+++ DirectComposition::CEvent::Create
@@ -1,2 +1,26 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CEvent::Create : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static long __cdecl DirectComposition::CEvent::Create(struct _KEVENT * __ptr64,int,class

+   DirectComposition::CEvent * __ptr64 * __ptr64) */

+

+long __cdecl DirectComposition::CEvent::Create(_KEVENT *param_1,int param_2,CEvent **param_3)

+

+{

+  CEvent *pCVar1;

+  undefined4 in_register_00000014;

+  long lVar2;

+  

+  lVar2 = 0;

+  pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     ((CLeakTrackingAllocator *)param_1,CONCAT44(in_register_00000014,param_2),0x10,

+                      0x76654344);

+  *param_3 = pCVar1;

+  if (pCVar1 == (CEvent *)0x0) {

+    lVar2 = -0x3fffffe9;

+  }

+  else {

+    *(_KEVENT **)(pCVar1 + 8) = param_1;

+    ObfReferenceObject(param_1);

+  }

+  return lVar2;

+}

+
```

## `DirectComposition::CApplicationChannel::CreatePrivateMarshaler`  (modified)

```diff
--- DirectComposition::CApplicationChannel::CreatePrivateMarshaler
+++ DirectComposition::CApplicationChannel::CreatePrivateMarshaler
@@ -1,2 +1,1476 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CApplicationChannel::CreatePrivateMarshaler : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: long __cdecl DirectComposition::CApplicationChannel::CreatePrivateMarshaler(unsigned

+   int,class DirectComposition::CResourceMarshaler * __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CApplicationChannel::CreatePrivateMarshaler

+          (CApplicationChannel *this,uint param_1,CResourceMarshaler **param_2)

+

+{

+  longlong *plVar1;

+  longlong lVar2;

+  code *pcVar3;

+  int iVar4;

+  long lVar5;

+  CGradientBrushMarshaler *pCVar6;

+  CSpriteVisualMarshaler *this_00;

+  CVisualMarshaler *this_01;

+  CShapeVisualMarshaler *this_02;

+  CInteractionMarshaler *this_03;

+  CLayerVisualMarshaler *this_04;

+  CGradientBrushMarshaler *pCVar7;

+  CAnimationLoggingManagerMarshaler *this_05;

+  CDropShadowMarshaler *this_06;

+  CProjectedShadowSceneMarshaler *this_07;

+  undefined **ppuVar8;

+  CCaptureControllerMarshaler *this_08;

+  CHolographicViewerMarshaler *this_09;

+  CHolographicInteropTextureMarshaler *this_10;

+  CInteractionTrackerMarshaler *this_11;

+  CInteractionTrackerBindingManagerMarshaler *this_12;

+  CNaturalAnimationMarshaler *this_13;

+  CRedirectVisualMarshaler *this_14;

+  undefined8 *puVar9;

+  CRemoteAppRenderTargetMarshaler *this_15;

+  CSpatialRemarshalerMarshaler *this_16;

+  CGenericMarshaler *this_17;

+  CWindowNodeMarshaler *this_18;

+  undefined4 in_register_00000014;

+  CApplicationChannel *pCVar10;

+  undefined1 *puVar11;

+  int iVar12;

+  bool bVar13;

+  undefined4 local_res10 [4];

+  CResourceMarshaler *local_res20;

+  undefined1 auStack_68 [8];

+  undefined1 auStack_60 [24];

+  undefined8 local_48 [2];

+  undefined8 *local_38;

+  undefined4 *local_30;

+  

+  pCVar10 = (CApplicationChannel *)CONCAT44(in_register_00000014,param_1);

+  puVar11 = auStack_68;

+  pCVar7 = (CGradientBrushMarshaler *)0x0;

+  iVar4 = 0;

+  local_res20 = (CResourceMarshaler *)0x0;

+  iVar12 = 0;

+  if (param_1 < 0x9f) {

+    if (param_1 == 0x9e) {

+      pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x58,0x687a4344);

+      iVar4 = iVar12;

+      if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+      *(undefined4 *)(pCVar6 + 0x20) = 0;

+      *(undefined8 *)(pCVar6 + 0x30) = 0;

+      *(undefined8 *)(pCVar6 + 0x18) = 1;

+      *(undefined4 *)(pCVar6 + 0x24) = 0x9e;

+      ppuVar8 = &CSceneMeshRendererComponentMarshaler::_vftable_;

+    }

+    else if (param_1 < 0x4c) {

+      if (param_1 == 0x4b) {

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x60,0x63684344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0x4b;

+        ppuVar8 = &CHolographicCompositionMarshaler::_vftable_;

+      }

+      else if (param_1 < 0x23) {

+        if (param_1 == 0x22) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x88,0x6c644344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x22;

+          ppuVar8 = &CCompositionDistantLightMarshaler::_vftable_;

+        }

+        else if (param_1 < 0x14) {

+          if (param_1 == 0x13) {

+            this_08 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x60,0x71634344);

+            iVar4 = iVar12;

+            if (this_08 != (CCaptureControllerMarshaler *)0x0) {

+              pCVar7 = (CGradientBrushMarshaler *)

+                       CCaptureControllerMarshaler::CCaptureControllerMarshaler(this_08);

+            }

+            goto LAB_0;

+          }

+          if (param_1 == 9) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x48,0x626a4344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 9;

+            ppuVar8 = &CWindowBackdropBrushMarshaler::_vftable_;

+          }

+          else {

+            if (param_1 < 10) {

+              if (param_1 != 1) {

+                if (param_1 != 2) {

+                  if (param_1 == 4) {

+                    this_05 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                        ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x108,

+                                         0x6d6c4344);

+                    iVar4 = iVar12;

+                    if (this_05 != (CAnimationLoggingManagerMarshaler *)0x0) {

+                      pCVar7 = (CGradientBrushMarshaler *)

+                               CAnimationLoggingManagerMarshaler::CAnimationLoggingManagerMarshaler

+                                         (this_05);

+                    }

+                    goto LAB_0;

+                  }

+                  if (param_1 != 6) {

+                    iVar4 = param_1 - 7;

+                    goto LAB_1;

+                  }

+                  pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                     ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x88,

+                                      0x65664344);

+                  iVar4 = iVar12;

+                  if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+                  CFilterEffectMarshaler::CFilterEffectMarshaler((CFilterEffectMarshaler *)pCVar6,6)

+                  ;

+                  ppuVar8 = &CArithmeticCompositeEffectMarshaler::_vftable_;

+                  goto LAB_2;

+                }

+                puVar9 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                   ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0xf8,0x6e614344

+                                   );

+                if (puVar9 == (undefined8 *)0x0) {

+                  return -0x3fffffe9;

+                }

+                *(undefined4 *)(puVar9 + 6) = 0;

+                puVar9[8] = 0;

+                pCVar10 = this + 0x150;

+                puVar9[5] = 1;

+                *(undefined4 *)((longlong)puVar9 + 0x34) = 2;

+                *puVar9 = &CAnimationMarshaler::_vftable__for__DirectComposition__CBaseAnimation__;

+                puVar9[2] = &CAnimationMarshaler::

+                             _vftable__for__DirectComposition__CResourceMarshaler__;

+                plVar1 = puVar9 + 0x10;

+                lVar2 = *(longlong *)pCVar10;

+                if (*(CApplicationChannel **)(lVar2 + 8) == pCVar10) {

+                  *plVar1 = lVar2;

+                  puVar9[0x11] = pCVar10;

+                  *(longlong **)(lVar2 + 8) = plVar1;

+                  *(longlong **)pCVar10 = plVar1;

+                  goto LAB_3;

+                }

+                this = (CApplicationChannel *)0x3;

+                pcVar3 = (code *)swi(0x29);

+                (*pcVar3)();

+                puVar11 = auStack_60;

+              }

+              *(undefined8 *)(puVar11 + -8) = 0x1c01256c9;

+              pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                 ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x98,0x65664344);

+              iVar4 = iVar12;

+              if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+              *(undefined8 *)(puVar11 + -8) = 0x1c01256df;

+              CFilterEffectMarshaler::CFilterEffectMarshaler((CFilterEffectMarshaler *)pCVar6,1);

+              ppuVar8 = &CAffineTransform2DEffectMarshaler::_vftable_;

+              goto LAB_2;

+            }

+            if (param_1 == 0xc) {

+              pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                 ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x40,0x64624344);

+              iVar4 = iVar12;

+              if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+              *(undefined4 *)(pCVar6 + 0x20) = 0;

+              *(undefined8 *)(pCVar6 + 0x30) = 0;

+              *(undefined8 *)(pCVar6 + 0x18) = 1;

+              *(undefined4 *)(pCVar6 + 0x24) = 0xc;

+              ppuVar8 = &CBatchDeferralMarshaler::_vftable_;

+            }

+            else {

+              if (param_1 == 0xd) goto LAB_4;

+              if (param_1 == 0xe) {

+                pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                   ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x78,0x65664344

+                                   );

+                iVar4 = iVar12;

+                if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+                CFilterEffectMarshaler::CFilterEffectMarshaler((CFilterEffectMarshaler *)pCVar6,0xe)

+                ;

+                ppuVar8 = &CBlendEffectMarshaler::_vftable_;

+                goto LAB_2;

+              }

+              if (param_1 == 0xf) {

+                pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                   ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x48,0x646a4344

+                                   );

+                iVar4 = iVar12;

+                if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+                *(undefined4 *)(pCVar6 + 0x20) = 0;

+                *(undefined8 *)(pCVar6 + 0x30) = 0;

+                *(undefined8 *)(pCVar6 + 0x18) = 1;

+                *(undefined4 *)(pCVar6 + 0x24) = 0xf;

+                ppuVar8 = &CWindowBackdropBrushMarshaler::_vftable_;

+              }

+              else {

+                iVar4 = param_1 - 0x10;

+                if (iVar4 != 0) goto LAB_5;

+                pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                   ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x80,0x65664344

+                                   );

+                iVar4 = iVar12;

+                if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+                *(undefined4 *)(pCVar6 + 0x20) = 0;

+                *(undefined8 *)(pCVar6 + 0x30) = 0;

+                *(undefined8 *)(pCVar6 + 0x18) = 1;

+                *(undefined4 *)(pCVar6 + 0x24) = 0x10;

+                *(undefined4 *)(pCVar6 + 0x48) = 0;

+                *(undefined8 *)(pCVar6 + 0x50) = 0;

+                *(undefined8 *)(pCVar6 + 0x58) = 0;

+                *(undefined8 *)(pCVar6 + 0x60) = 0;

+                *(undefined4 *)(pCVar6 + 0x68) = 0;

+                ppuVar8 = &CBrightnessEffectMarshaler::_vftable_;

+              }

+            }

+          }

+        }

+        else if (param_1 < 0x1d) {

+          if (param_1 == 0x1c) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x68,0x74654344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x1c;

+            ppuVar8 = &CCompiledEffectTemplateMarshaler::_vftable_;

+          }

+          else if (param_1 == 0x14) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x88,0x72634344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x14;

+            ppuVar8 = &CCaptureRenderTargetMarshaler::_vftable_;

+          }

+          else if (param_1 == 0x16) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x58,0x636a4344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x16;

+            ppuVar8 = &CColorBrushMarshaler::_vftable_;

+          }

+          else if (param_1 == 0x17) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x50,0x73674344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x17;

+            ppuVar8 = &CColorGradientStopMarshaler::_vftable_;

+          }

+          else {

+            if (param_1 != 0x18) {

+              iVar4 = param_1 - 0x1a;

+LAB_1:

+              if (iVar4 != 0) goto LAB_6;

+              goto LAB_4;

+            }

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,200,0x65664344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x18;

+            *(undefined4 *)(pCVar6 + 0x48) = 0;

+            *(undefined8 *)(pCVar6 + 0x50) = 0;

+            *(undefined8 *)(pCVar6 + 0x58) = 0;

+            *(undefined8 *)(pCVar6 + 0x60) = 0;

+            *(undefined4 *)(pCVar6 + 0x68) = 0;

+            ppuVar8 = &CColorMatrixEffectMarshaler::_vftable_;

+          }

+        }

+        else if (param_1 == 0x1d) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x88,0x32634344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x1d;

+          ppuVar8 = &CComponentTransform2DMarshaler::_vftable_;

+        }

+        else if (param_1 == 0x1e) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0xd8,0x6f634344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x1e;

+          ppuVar8 = &CComponentTransform3DMarshaler::_vftable_;

+        }

+        else {

+          if (param_1 == 0x1f) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x78,0x65664344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            CFilterEffectMarshaler::CFilterEffectMarshaler((CFilterEffectMarshaler *)pCVar6,0x1f);

+            ppuVar8 = &CCompositeEffectMarshaler::_vftable_;

+            goto LAB_2;

+          }

+          if (param_1 == 0x20) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x78,0x6d614344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x20;

+            ppuVar8 = &CCompositionAmbientLightMarshaler::_vftable_;

+          }

+          else {

+            if (param_1 != 0x21) goto LAB_7;

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x58,0x6d634344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x21;

+            ppuVar8 = &CCompositionCubeMapMarshaler::_vftable_;

+          }

+        }

+      }

+      else if (param_1 < 0x38) {

+        if (param_1 == 0x37) {

+          this_06 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                              ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x78,0x73644344);

+          iVar4 = iVar12;

+          if (this_06 != (CDropShadowMarshaler *)0x0) {

+            pCVar7 = (CGradientBrushMarshaler *)CDropShadowMarshaler::CDropShadowMarshaler(this_06);

+          }

+          goto LAB_0;

+        }

+        if (param_1 < 0x2f) {

+          if (param_1 == 0x2e) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x50,0x636f4344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x2e;

+            ppuVar8 = &CContainerShapeMarshaler::_vftable_;

+          }

+          else if (param_1 == 0x25) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x60,0x6d6d4344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x25;

+            ppuVar8 = &CCompositionMipmapSurfaceMarshaler::_vftable_;

+          }

+          else if (param_1 == 0x26) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0xa0,0x6f704344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x26;

+            ppuVar8 = &CCompositionPointLightMarshaler::_vftable_;

+          }

+          else if (param_1 == 0x28) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x70,0x62734344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x28;

+            ppuVar8 = &CCompositionSkyBoxBrushMarshaler::_vftable_;

+          }

+          else if (param_1 == 0x29) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,200,0x70734344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x29;

+            ppuVar8 = &CCompositionSpotLightMarshaler::_vftable_;

+          }

+          else if (param_1 == 0x2a) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x48,0x62634344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x2a;

+            ppuVar8 = &CCompositionSurfaceBitmapMarshaler::_vftable_;

+          }

+          else {

+            if (param_1 != 0x2d) goto LAB_7;

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0xa0,0x61634344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x2d;

+            ppuVar8 = &CConditionalExpressionMarshaler::_vftable_;

+          }

+        }

+        else if (param_1 == 0x30) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x58,0x66734344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x30;

+          ppuVar8 = &CCrossContainerGuestReadWriteSharedSectionMarshaler::_vftable_;

+        }

+        else if (param_1 == 0x31) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x68,0x67734344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0xa9;

+          ppuVar8 = &CCrossContainerHostReadOnlySharedSectionMarshaler::_vftable_;

+        }

+        else if (param_1 == 0x33) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x48,0x72734344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x33;

+          ppuVar8 = &CDataSourceReaderMarshaler::_vftable_;

+        }

+        else if (param_1 == 0x34) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0xa8,0x64644344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x34;

+          ppuVar8 = &CDDisplayRenderTargetMarshaler::_vftable_;

+        }

+        else {

+          if (param_1 != 0x35) goto LAB_7;

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x48,0x65644344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x35;

+          ppuVar8 = &CDesktopTreeMarshaler::_vftable_;

+        }

+      }

+      else if (param_1 < 0x43) {

+        if (param_1 == 0x42) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0xf0,0x69674344);

+          iVar4 = iVar12;

+          if (pCVar6 != (CGradientBrushMarshaler *)0x0) {

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x42;

+            *(undefined ***)pCVar6 = &CGenericInkMarshaler::_vftable_;

+            pCVar6[0x40] = (CGradientBrushMarshaler)0x1;

+            *(undefined8 *)(pCVar6 + 0x58) = 1;

+            pCVar6[0x68] = (CGradientBrushMarshaler)0x1;

+            *(undefined8 *)(pCVar6 + 0x80) = 1;

+            pCVar6[0xb4] = (CGradientBrushMarshaler)0x0;

+            pCVar7 = pCVar6;

+          }

+          goto LAB_0;

+        }

+        if (param_1 == 0x39) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x68,0x656a4344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x39;

+          ppuVar8 = &CEffectBrushMarshaler::_vftable_;

+        }

+        else if (param_1 == 0x3b) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x70,0x79654344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x3b;

+          ppuVar8 = &CEllipseGeometryMarshaler::_vftable_;

+        }

+        else {

+          if (param_1 != 0x3c) {

+            if (param_1 != 0x3e) {

+              if (param_1 == 0x3f) {

+                pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                   ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x80,0x65664344

+                                   );

+                iVar4 = iVar12;

+                if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+                CFilterEffectMarshaler::CFilterEffectMarshaler

+                          ((CFilterEffectMarshaler *)pCVar6,0x3f);

+                ppuVar8 = &CFloodEffectMarshaler::_vftable_;

+                goto LAB_2;

+              }

+              if (param_1 == 0x40) {

+                lVar5 = FUN_1c0125b07();

+                return lVar5;

+              }

+              goto LAB_7;

+            }

+            goto LAB_4;

+          }

+          local_38 = local_48;

+          local_30 = local_res10;

+          local_48[0] = 0x104;

+          local_res10[0] = 0x78654344;

+          pCVar6 = (CGradientBrushMarshaler *)

+                   NSInstrumentation::CLeakTrackingAllocator::

+                   AllocateCommon<<lambda_a6c9ad8a3ccccec93018e691c2ba1200>_>

+                             (gpLeakTrackingAllocator,0xe0,0x78654344,&local_38);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x3c;

+          ppuVar8 = &CExpressionMarshaler::_vftable_;

+        }

+      }

+      else {

+        if ((param_1 == 0x43) || (param_1 == 0x45)) {

+LAB_4:

+          this_17 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                              ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x50,0x6d674344);

+          iVar4 = iVar12;

+          if (this_17 != (CGenericMarshaler *)0x0) {

+            pCVar7 = (CGradientBrushMarshaler *)

+                     CGenericMarshaler::CGenericMarshaler(this_17,param_1);

+          }

+          goto LAB_0;

+        }

+        if (param_1 == 0x46) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x70,0x67634344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x46;

+          ppuVar8 = &CClipGroupMarshaler::_vftable_;

+        }

+        else {

+          if (param_1 == 0x47) goto LAB_4;

+          if (param_1 != 0x48) goto LAB_7;

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x50,0x76674344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x48;

+          ppuVar8 = &CGlobalDCompVisualMarshaler::_vftable_;

+        }

+      }

+    }

+    else if (param_1 < 0x69) {

+      if (param_1 == 0x68) goto LAB_4;

+      if (param_1 < 0x5b) {

+        if (param_1 == 0x5a) {

+          this_11 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                              ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x1d0,0x72694344);

+          iVar4 = iVar12;

+          if (this_11 != (CInteractionTrackerMarshaler *)0x0) {

+            pCVar7 = (CGradientBrushMarshaler *)

+                     CInteractionTrackerMarshaler::CInteractionTrackerMarshaler(this_11);

+          }

+          goto LAB_0;

+        }

+        if (param_1 < 0x54) {

+          if (param_1 == 0x53) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x78,0x65664344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x53;

+            *(undefined4 *)(pCVar6 + 0x48) = 0;

+            *(undefined8 *)(pCVar6 + 0x50) = 0;

+            *(undefined8 *)(pCVar6 + 0x58) = 0;

+            *(undefined8 *)(pCVar6 + 0x60) = 0;

+            *(undefined4 *)(pCVar6 + 0x68) = 0;

+            ppuVar8 = &CHueRotationEffectMarshaler::_vftable_;

+          }

+          else if (param_1 == 0x4c) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x68,0x64684344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x4c;

+            ppuVar8 = &CHolographicDisplayMarshaler::_vftable_;

+          }

+          else if (param_1 == 0x4d) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x48,0x6d684344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x4d;

+            ppuVar8 = &CHolographicExclusiveModeMarshaler::_vftable_;

+          }

+          else {

+            if (param_1 == 0x4e) {

+              pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                 ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x68,0x65684344);

+              iVar4 = iVar12;

+              if (pCVar6 != (CGradientBrushMarshaler *)0x0) {

+                *(uint *)(pCVar6 + 0x10) = *(uint *)(pCVar6 + 0x10) | 0x20;

+                *(undefined4 *)(pCVar6 + 0x20) = 0;

+                *(undefined8 *)(pCVar6 + 0x30) = 0;

+                *(undefined8 *)(pCVar6 + 0x18) = 1;

+                *(undefined4 *)(pCVar6 + 0x24) = 0x4e;

+                *(undefined ***)pCVar6 = &CHolographicExclusiveViewMarshaler::_vftable_;

+                pCVar7 = pCVar6;

+              }

+              goto LAB_0;

+            }

+            if (param_1 == 0x50) {

+              this_10 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                  ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x60,0x69684344)

+              ;

+              iVar4 = iVar12;

+              if (this_10 != (CHolographicInteropTextureMarshaler *)0x0) {

+                pCVar7 = (CGradientBrushMarshaler *)

+                         CHolographicInteropTextureMarshaler::CHolographicInteropTextureMarshaler

+                                   (this_10);

+              }

+              goto LAB_0;

+            }

+            if (param_1 == 0x51) {

+              this_09 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                  ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x88,0x78684344)

+              ;

+              iVar4 = iVar12;

+              if (this_09 != (CHolographicViewerMarshaler *)0x0) {

+                pCVar7 = (CGradientBrushMarshaler *)

+                         CHolographicViewerMarshaler::CHolographicViewerMarshaler(this_09);

+              }

+              goto LAB_0;

+            }

+            if (param_1 != 0x52) goto LAB_7;

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x38,0x70684344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x52;

+            ppuVar8 = &CHoverPointerSourceMarshaler::_vftable_;

+          }

+        }

+        else {

+          if ((param_1 == 0x54) || (param_1 == 0x56)) goto LAB_4;

+          if (param_1 != 0x57) {

+            if (param_1 == 0x58) {

+              pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                 ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0xa0,0x6b694344);

+              iVar4 = iVar12;

+              if (pCVar6 != (CGradientBrushMarshaler *)0x0) {

+                *(undefined4 *)(pCVar6 + 0x20) = 0;

+                *(undefined8 *)(pCVar6 + 0x30) = 0;

+                *(undefined8 *)(pCVar6 + 0x18) = 1;

+                *(undefined4 *)(pCVar6 + 0x24) = 0x58;

+                *(undefined ***)pCVar6 = &CInkMarshaler::_vftable_;

+                pCVar6[0x78] = (CGradientBrushMarshaler)0x1;

+                *(undefined8 *)(pCVar6 + 0x90) = 0x24;

+                pCVar7 = pCVar6;

+              }

+              goto LAB_0;

+            }

+            if (param_1 == 0x59) {

+              this_03 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                  ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x150,0x6f694344

+                                  );

+              iVar4 = iVar12;

+              if (this_03 != (CInteractionMarshaler *)0x0) {

+                pCVar7 = (CGradientBrushMarshaler *)

+                         CInteractionMarshaler::CInteractionMarshaler(this_03);

+              }

+              goto LAB_0;

+            }

+            goto LAB_7;

+          }

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x98,0x61694344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x57;

+          ppuVar8 = &CInjectionAnimationMarshaler::_vftable_;

+        }

+      }

+      else {

+        if (0x62 < param_1) {

+          if (param_1 == 99) {

+            pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x80,0x6c6a4344);

+            iVar4 = iVar12;

+            if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+            CGradientBrushMarshaler::CGradientBrushMarshaler(pCVar6,99);

+            ppuVar8 = &CLinearGradientBrushMarshaler::_vftable_;

+LAB_2:

+            *(undefined ***)pCVar6 = ppuVar8;

+            pCVar7 = pCVar6;

+            iVar4 = iVar12;

+            goto LAB_0;

+          }

+          if (param_1 != 100) {

+            if (param_1 == 0x65) {

+              pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                 ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x98,0x65664344);

+              iVar4 = iVar12;

+              if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+              CFilterEffectMarshaler::CFilterEffectMarshaler((CFilterEffectMarshaler *)pCVar6,0x65);

+              ppuVar8 = &CLinearTransferEffectMarshaler::_vftable_;

+              goto LAB_2;

+            }

+            iVar4 = param_1 - 0x66;

+            if (iVar4 == 0) {

+              pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                 ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,

+                                  (ulonglong)(param_1 + 10),0x676c4344);

+              iVar4 = iVar12;

+              if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+              *(undefined4 *)(pCVar6 + 0x20) = 0;

+              *(undefined8 *)(pCVar6 + 0x30) = 0;

+              *(undefined8 *)(pCVar6 + 0x18) = 1;

+              *(undefined4 *)(pCVar6 + 0x24) = 0x66;

+              ppuVar8 = &CLineGeometryMarshaler::_vftable_;

+              goto LAB_8;

+            }

+LAB_6:

+            bVar13 = iVar4 == 1;

+LAB_9:

+            if (!bVar13) goto LAB_7;

+          }

+          goto LAB_4;

+        }

+        if (param_1 == 0x62) goto LAB_4;

+        if (param_1 == 0x5b) {

+          this_12 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                              ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x70,0x73694344);

+          iVar4 = iVar12;

+          if (this_12 != (CInteractionTrackerBindingManagerMarshaler *)0x0) {

+            pCVar7 = (CGradientBrushMarshaler *)

+                     CInteractionTrackerBindingManagerMarshaler::

+                     CInteractionTrackerBindingManagerMarshaler(this_12);

+          }

+          goto LAB_0;

+        }

+        if (param_1 == 0x5c) {

+          local_38 = local_48;

+          local_30 = local_res10;

+          local_48[0] = 0x104;

+          local_res10[0] = 0x666b4344;

+          pCVar6 = (CGradientBrushMarshaler *)

+                   NSInstrumentation::CLeakTrackingAllocator::

+                   AllocateCommon<<lambda_a6c9ad8a3ccccec93018e691c2ba1200>_>

+                             (gpLeakTrackingAllocator,0x130,0x666b4344,&local_38);

+          iVar4 = iVar12;

+          if (pCVar6 != (CGradientBrushMarshaler *)0x0) {

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x5c;

+            *(undefined ***)pCVar6 = &CKeyframeAnimationMarshaler::_vftable_;

+            *(undefined4 *)(pCVar6 + 0x100) = 0x3f800000;

+            *(undefined4 *)(pCVar6 + 0x104) = 0x3f800000;

+            pCVar7 = pCVar6;

+            iVar4 = 0;

+          }

+          goto LAB_0;

+        }

+        if (param_1 == 0x5d) {

+          this_04 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                              ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,400,0x766c4344);

+          iVar4 = iVar12;

+          if (this_04 != (CLayerVisualMarshaler *)0x0) {

+            pCVar7 = (CGradientBrushMarshaler *)

+                     CLayerVisualMarshaler::CLayerVisualMarshaler(this_04);

+          }

+          goto LAB_0;

+        }

+        if (param_1 == 0x5e) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x40,0x74614344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x5e;

+          ppuVar8 = &CLegacyAnimationTriggerMarshaler::_vftable_;

+        }

+        else if (param_1 == 0x60) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x98,0x6b644344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x60;

+          ppuVar8 = &CLegacyRenderTargetMarshaler::_vftable_;

+        }

+        else {

+          if (param_1 != 0x61) goto LAB_7;

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x98,0x6a644344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x61;

+          ppuVar8 = &CLegacyStereoRenderTargetMarshaler::_vftable_;

+        }

+      }

+    }

+    else if (param_1 < 0x85) {

+      if (param_1 == 0x84) {

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x60,0x727a4344);

+        iVar4 = iVar12;

+        if (pCVar6 != (CGradientBrushMarshaler *)0x0) {

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x84;

+          *(undefined ***)pCVar6 = &CProjectedShadowReceiverMarshaler::_vftable_;

+          *(undefined4 *)(pCVar6 + 0x50) = 1;

+          pCVar7 = pCVar6;

+        }

+        goto LAB_0;

+      }

+      if (param_1 < 0x71) {

+        if (param_1 == 0x70) {

+          this_13 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                              ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,200,0x616e4344);

+          iVar4 = iVar12;

+          if (this_13 != (CNaturalAnimationMarshaler *)0x0) {

+            pCVar7 = (CGradientBrushMarshaler *)

+                     CNaturalAnimationMarshaler::CNaturalAnimationMarshaler(this_13);

+          }

+          goto LAB_0;

+        }

+        if (param_1 == 0x69) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x120,0x696d4344);

+          iVar4 = iVar12;

+          if (pCVar6 != (CGradientBrushMarshaler *)0x0) {

+            *(undefined4 *)(pCVar6 + 0x20) = 0;

+            pCVar6[0x6c] = (CGradientBrushMarshaler)((byte)pCVar6[0x6c] & 0xf8);

+            *(undefined8 *)(pCVar6 + 0x30) = 0;

+            *(undefined8 *)(pCVar6 + 0x18) = 1;

+            *(undefined4 *)(pCVar6 + 0x24) = 0x69;

+            *(undefined ***)pCVar6 = &CManipulationMarshaler::_vftable_;

+            *(undefined8 *)(pCVar6 + 0x70) = 0;

+            *(undefined4 *)(pCVar6 + 0x78) = 0;

+            *(undefined8 *)(pCVar6 + 0x80) = 0;

+            *(undefined8 *)(pCVar6 + 0x88) = 0;

+            pCVar7 = pCVar6;

+          }

+          goto LAB_0;

+        }

+        if (param_1 == 0x6a) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x80,0x616d4344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x6a;

+          ppuVar8 = &CManipulationTransformMarshaler::_vftable_;

+        }

+        else if (param_1 == 0x6b) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x58,0x6d6a4344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x6b;

+          ppuVar8 = &CMaskBrushMarshaler::_vftable_;

+        }

+        else if (param_1 == 0x6d) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x60,0x746d4344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x6d;

+          ppuVar8 = &CMatrixTransformMarshaler::_vftable_;

+        }

+        else {

+          iVar4 = param_1 - 0x6e;

+          if (iVar4 != 0) goto LAB_6;

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x88,0x336d4344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x6e;

+          ppuVar8 = &CMatrixTransform3DMarshaler::_vftable_;

+        }

+      }

+      else if (param_1 == 0x71) {

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x78,0x6e6a4344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0x71;

+        ppuVar8 = &CNineGridBrushMarshaler::_vftable_;

+      }

+      else if (param_1 == 0x7e) {

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x70,0x79704344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0x7e;

+        ppuVar8 = &CPathGeometryMarshaler::_vftable_;

+      }

+      else if (param_1 == 0x80) {

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x48,0x63704344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0x80;

+        ppuVar8 = &CPrimitiveColorMarshaler::_vftable_;

+      }

+      else if (param_1 == 0x81) {

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,200,0x67704344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0x81;

+        ppuVar8 = &CPrimitiveGroupMarshaler::_vftable_;

+      }

+      else {

+        if (param_1 != 0x83) goto LAB_7;

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x68,0x637a4344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0x83;

+        ppuVar8 = &CProjectedShadowCasterMarshaler::_vftable_;

+      }

+    }

+    else if (param_1 < 0x8e) {

+      if (param_1 == 0x8d) {

+        this_14 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                            ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x188,0x76724344);

+        iVar4 = iVar12;

+        if (this_14 != (CRedirectVisualMarshaler *)0x0) {

+          pCVar7 = (CGradientBrushMarshaler *)

+                   CRedirectVisualMarshaler::CRedirectVisualMarshaler(this_14);

+        }

+        goto LAB_0;

+      }

+      if (param_1 == 0x85) {

+        this_07 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                            ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x88,0x737a4344);

+        iVar4 = iVar12;

+        if (this_07 != (CProjectedShadowSceneMarshaler *)0x0) {

+          pCVar7 = (CGradientBrushMarshaler *)

+                   CProjectedShadowSceneMarshaler::CProjectedShadowSceneMarshaler(this_07);

+        }

+        goto LAB_0;

+      }

+      if (param_1 == 0x87) {

+        local_38 = local_48;

+        local_30 = local_res10;

+        local_48[0] = 0x104;

+        local_res10[0] = 0x62704344;

+        pCVar6 = (CGradientBrushMarshaler *)

+                 NSInstrumentation::CLeakTrackingAllocator::

+                 AllocateCommon<<lambda_a6c9ad8a3ccccec93018e691c2ba1200>_>

+                           (gpLeakTrackingAllocator,0x70,0x62704344,&local_38);

+        iVar4 = iVar12;

+        if (pCVar6 != (CGradientBrushMarshaler *)0x0) {

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0x87;

+          *(undefined ***)pCVar6 = &CPropertySetMarshaler::_vftable_;

+          *(undefined8 *)(pCVar6 + 0x48) = 0;

+          *(undefined8 *)(pCVar6 + 0x50) = 0;

+          *(undefined8 *)(pCVar6 + 0x58) = 0;

+          *(undefined8 *)(pCVar6 + 0x60) = 0;

+          pCVar7 = pCVar6;

+        }

+        goto LAB_0;

+      }

+      if (param_1 == 0x88) {

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x70,0x787a4344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0x88;

+        ppuVar8 = &CProxyGeometryClipMarshaler::_vftable_;

+      }

+      else {

+        if (param_1 == 0x89) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x88,0x6f6a4344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          CGradientBrushMarshaler::CGradientBrushMarshaler(pCVar6,0x89);

+          ppuVar8 = &CRadialGradientBrushMarshaler::_vftable_;

+          goto LAB_2;

+        }

+        iVar4 = param_1 - 0x8a;

+        if (iVar4 != 0) {

+LAB_5:

+          bVar13 = iVar4 == 2;

+          goto LAB_9;

+        }

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x98,0x63724344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0x8a;

+        ppuVar8 = &CRectangleClipMarshaler::_vftable_;

+      }

+    }

+    else {

+      if (param_1 == 0x8f) {

+        this_15 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                            ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x68,0x6d644344);

+        iVar4 = iVar12;

+        if (this_15 != (CRemoteAppRenderTargetMarshaler *)0x0) {

+          pCVar7 = (CGradientBrushMarshaler *)

+                   CRemoteAppRenderTargetMarshaler::CRemoteAppRenderTargetMarshaler(this_15);

+        }

+        goto LAB_0;

+      }

+      if (param_1 == 0x90) {

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x78,0x70644344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0x90;

+        ppuVar8 = &CRemoteRenderTargetMarshaler::_vftable_;

+      }

+      else {

+        if (param_1 == 0x91) goto LAB_4;

+        if (param_1 != 0x96) {

+          if (param_1 == 0x97) {

+            puVar9 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                               ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x50,0x6c734344);

+            if (puVar9 == (undefined8 *)0x0) {

+              return -0x3fffffe9;

+            }

+            *(undefined4 *)(puVar9 + 6) = 0;

+            puVar9[8] = 0;

+            puVar9[5] = 1;

+            *(undefined4 *)((longlong)puVar9 + 0x34) = 0x97;

+            *puVar9 = &CScalarMarshaler::_vftable__for__DirectComposition__CBaseAnimation__;

+            puVar9[2] = &CScalarMarshaler::_vftable__for__DirectComposition__CResourceMarshaler__;

+LAB_3:

+            pCVar7 = (CGradientBrushMarshaler *)(puVar9 + 2);

+            iVar4 = iVar12;

+            goto LAB_0;

+          }

+          goto LAB_7;

+        }

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x78,0x65664344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0x96;

+        *(undefined4 *)(pCVar6 + 0x48) = 0;

+        *(undefined8 *)(pCVar6 + 0x50) = 0;

+        *(undefined8 *)(pCVar6 + 0x58) = 0;

+        *(undefined8 *)(pCVar6 + 0x60) = 0;

+        *(undefined4 *)(pCVar6 + 0x68) = 0;

+        ppuVar8 = &CSaturationEffectMarshaler::_vftable_;

+      }

+    }

+  }

+  else if (param_1 < 0xb8) {

+    if (param_1 == 0xb7) {

+      pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0xb8,0x65664344);

+      iVar4 = iVar12;

+      if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+      CFilterEffectMarshaler::CFilterEffectMarshaler((CFilterEffectMarshaler *)pCVar6,0xb7);

+      ppuVar8 = &CTableTransferEffectMarshaler::_vftable_;

+      goto LAB_2;

+    }

+    if (param_1 < 0xaf) {

+      if (param_1 == 0xae) {

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x90,0x61734344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0xae;

+        ppuVar8 = &CSnapshotMarshaler::_vftable_;

+      }

+      else if (param_1 == 0xa5) {

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x60,0x6e6d4344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0xa5;

+        ppuVar8 = &CSceneSurfaceMaterialInputMarshaler::_vftable_;

+      }

+      else if (param_1 == 0xa7) {

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x88,0x65664344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0xa7;

+        *(undefined4 *)(pCVar6 + 0x48) = 0;

+        *(undefined8 *)(pCVar6 + 0x50) = 0;

+        *(undefined8 *)(pCVar6 + 0x58) = 0;

+        *(undefined8 *)(pCVar6 + 0x60) = 0;

+        *(undefined4 *)(pCVar6 + 0x68) = 0;

+        ppuVar8 = &CShadowEffectMarshaler::_vftable_;

+      }

+      else {

+        if (param_1 == 0xa8) {

+          this_02 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                              ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x198,0x68734344);

+          iVar4 = iVar12;

+          if (this_02 != (CShapeVisualMarshaler *)0x0) {

+            pCVar7 = (CGradientBrushMarshaler *)

+                     CShapeVisualMarshaler::CShapeVisualMarshaler(this_02);

+          }

+          goto LAB_0;

+        }

+        if (param_1 == 0xa9) {

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x48,0x73734344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0xa9;

+          ppuVar8 = &CSharedSectionMarshaler::_vftable_;

+        }

+        else {

+          iVar4 = param_1 - 0xab;

+          if (iVar4 != 0) goto LAB_6;

+          pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,

+                              (ulonglong)(param_1 - 99),0x677a4344);

+          iVar4 = iVar12;

+          if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+          *(undefined4 *)(pCVar6 + 0x20) = 0;

+          *(undefined8 *)(pCVar6 + 0x30) = 0;

+          *(undefined8 *)(pCVar6 + 0x18) = 1;

+          *(undefined4 *)(pCVar6 + 0x24) = 0xab;

+          ppuVar8 = &CSharedSectionWrapperMarshaler::_vftable_;

+        }

+      }

+    }

+    else {

+      if (param_1 == 0xaf) goto LAB_4;

+      if (param_1 == 0xb0) {

+        this_16 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                            ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x178,0x797a4344);

+        iVar4 = iVar12;

+        if (this_16 != (CSpatialRemarshalerMarshaler *)0x0) {

+          pCVar7 = (CGradientBrushMarshaler *)

+                   CSpatialRemarshalerMarshaler::CSpatialRemarshalerMarshaler(this_16);

+        }

+        goto LAB_0;

+      }

+      if (param_1 == 0xb1) {

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x88,0x736f4344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0xb1;

+        ppuVar8 = &CSpriteShapeMarshaler::_vftable_;

+      }

+      else {

+        if (param_1 == 0xb2) {

+          local_38 = local_48;

+          local_30 = local_res10;

+          local_48[0] = 0x104;

+          local_res10[0] = 0x76734344;

+          this_00 = (CSpriteVisualMarshaler *)

+                    NSInstrumentation::CLeakTrackingAllocator::

+                    AllocateCommon<<lambda_a6c9ad8a3ccccec93018e691c2ba1200>_>

+                              (gpLeakTrackingAllocator,400,0x76734344,&local_38);

+          iVar4 = iVar12;

+          if (this_00 != (CSpriteVisualMarshaler *)0x0) {

+            pCVar7 = (CGradientBrushMarshaler *)

+                     CSpriteVisualMarshaler::CSpriteVisualMarshaler(this_00);

+          }

+          goto LAB_0;

+        }

+        if (param_1 != 0xb5) goto LAB_7;

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x80,0x736a4344);

+        iVar4 = iVar12;

+        if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+        *(undefined4 *)(pCVar6 + 0x20) = 0;

+        *(undefined8 *)(pCVar6 + 0x30) = 0;

+        *(undefined8 *)(pCVar6 + 0x18) = 1;

+        *(undefined4 *)(pCVar6 + 0x24) = 0xb5;

+        ppuVar8 = &CSurfaceBrushMarshaler::_vftable_;

+      }

+    }

+  }

+  else if (param_1 < 200) {

+    if (param_1 == 199) goto LAB_4;

+    if (param_1 == 0xc0) {

+      pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x98,0x65664344);

+      iVar4 = iVar12;

+      if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+      *(undefined4 *)(pCVar6 + 0x20) = 0;

+      *(undefined8 *)(pCVar6 + 0x30) = 0;

+      *(undefined8 *)(pCVar6 + 0x18) = 1;

+      *(undefined4 *)(pCVar6 + 0x24) = 0xc0;

+      *(undefined4 *)(pCVar6 + 0x48) = 0;

+      *(undefined8 *)(pCVar6 + 0x50) = 0;

+      *(undefined8 *)(pCVar6 + 0x58) = 0;

+      *(undefined8 *)(pCVar6 + 0x60) = 0;

+      *(undefined4 *)(pCVar6 + 0x68) = 0;

+      ppuVar8 = &CTurbulenceEffectMarshaler::_vftable_;

+    }

+    else if (param_1 == 0xc2) {

+      pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x58,0x62764344);

+      iVar4 = iVar12;

+      if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+      *(undefined4 *)(pCVar6 + 0x20) = 0;

+      *(undefined8 *)(pCVar6 + 0x30) = 0;

+      *(undefined8 *)(pCVar6 + 0x18) = 1;

+      *(undefined4 *)(pCVar6 + 0x24) = 0xc2;

+      ppuVar8 = &CViewBoxMarshaler::_vftable_;

+    }

+    else {

+      if (param_1 != 0xc3) {

+        if (param_1 == 0xc4) {

+          local_38 = local_48;

+          local_30 = local_res10;

+          local_48[0] = 0x104;

+          local_res10[0] = 0x69764344;

+          this_01 = (CVisualMarshaler *)

+                    NSInstrumentation::CLeakTrackingAllocator::

+                    AllocateCommon<<lambda_a6c9ad8a3ccccec93018e691c2ba1200>_>

+                              (gpLeakTrackingAllocator,0x178,0x69764344,&local_38);

+          iVar4 = iVar12;

+          if (this_01 != (CVisualMarshaler *)0x0) {

+            pCVar7 = (CGradientBrushMarshaler *)CVisualMarshaler::CVisualMarshaler(this_01);

+          }

+          goto LAB_0;

+        }

+        if (param_1 == 0xc6) {

+          lVar5 = FUN_1c01263c2();

+          return lVar5;

+        }

+LAB_7:

+        iVar4 = GeneratedCreatePrivateMarshaler(param_1,&local_res20);

+        pCVar7 = (CGradientBrushMarshaler *)local_res20;

+        if (iVar4 < 0) {

+          return iVar4;

+        }

+        goto LAB_0;

+      }

+      pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0xd0,0x6d764344);

+      iVar4 = iVar12;

+      if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+      *(undefined4 *)(pCVar6 + 0x20) = 0;

+      *(undefined8 *)(pCVar6 + 0x30) = 0;

+      *(undefined8 *)(pCVar6 + 0x18) = 1;

+      *(undefined4 *)(pCVar6 + 0x24) = 0xc3;

+      ppuVar8 = &CVirtualMonitorCaptureRenderTargetMarshaler::_vftable_;

+    }

+  }

+  else if (param_1 == 0xc9) {

+    pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x40,0x66724344);

+    pCVar7 = (CGradientBrushMarshaler *)local_res20;

+    if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+    *(undefined4 *)(pCVar6 + 0x20) = 0;

+    *(undefined8 *)(pCVar6 + 0x30) = 0;

+    *(undefined8 *)(pCVar6 + 0x18) = 1;

+    *(undefined4 *)(pCVar6 + 0x24) = 0xc9;

+    ppuVar8 = &CVisualReferenceControllerMarshaler::_vftable_;

+  }

+  else if (param_1 == 0xca) {

+    pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x60,0x736c4344);

+    iVar4 = iVar12;

+    if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+    *(undefined4 *)(pCVar6 + 0x20) = 0;

+    *(undefined8 *)(pCVar6 + 0x30) = 0;

+    *(undefined8 *)(pCVar6 + 0x18) = 1;

+    *(undefined4 *)(pCVar6 + 0x24) = 0xca;

+    ppuVar8 = &CVisualSurfaceMarshaler::_vftable_;

+  }

+  else if (param_1 == 0xcb) {

+    pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x48,0x776a4344);

+    iVar4 = iVar12;

+    if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+    *(undefined4 *)(pCVar6 + 0x20) = 0;

+    *(undefined8 *)(pCVar6 + 0x30) = 0;

+    *(undefined8 *)(pCVar6 + 0x18) = 1;

+    *(undefined4 *)(pCVar6 + 0x24) = 0xcb;

+    ppuVar8 = &CWindowBackdropBrushMarshaler::_vftable_;

+  }

+  else {

+    if (param_1 == 0xcc) {

+      this_18 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                          ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x178,0x6e774344);

+      iVar4 = iVar12;

+      if (this_18 != (CWindowNodeMarshaler *)0x0) {

+        pCVar7 = (CGradientBrushMarshaler *)CWindowNodeMarshaler::CWindowNodeMarshaler(this_18);

+      }

+      goto LAB_0;

+    }

+    if (param_1 != 0xcd) goto LAB_7;

+    pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)this,(__uint64)pCVar10,0x50,0x73794344);

+    iVar4 = iVar12;

+    if (pCVar6 == (CGradientBrushMarshaler *)0x0) goto LAB_0;

+    *(undefined4 *)(pCVar6 + 0x20) = 0;

+    *(undefined8 *)(pCVar6 + 0x30) = 0;

+    *(undefined8 *)(pCVar6 + 0x18) = 1;

+    *(undefined4 *)(pCVar6 + 0x24) = 0xcd;

+    ppuVar8 = &CYCbCrSurfaceMarshaler::_vftable_;

+  }

+LAB_8:

+  *(undefined ***)pCVar6 = ppuVar8;

+  pCVar7 = pCVar6;

+  iVar4 = iVar12;

+LAB_0:

+  if (pCVar7 == (CGradientBrushMarshaler *)0x0) {

+    return -0x3fffffe9;

+  }

+  if (-1 < iVar4) {

+    *param_2 = (CResourceMarshaler *)pCVar7;

+    return iVar4;

+  }

+  return iVar4;

+}

+
```

## `DirectComposition::CEvent::Create`  (modified)

```diff
--- DirectComposition::CEvent::Create
+++ DirectComposition::CEvent::Create
@@ -1,2 +1,28 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CEvent::Create : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static long __cdecl DirectComposition::CEvent::Create(void * __ptr64,int,class

+   DirectComposition::CEvent * __ptr64 * __ptr64) */

+

+long __cdecl DirectComposition::CEvent::Create(void *param_1,int param_2,CEvent **param_3)

+

+{

+  long lVar1;

+  CEvent *this;

+  undefined4 in_register_00000014;

+  

+  this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                   (param_1,CONCAT44(in_register_00000014,param_2),0x10,0x76654344);

+  if (this == (CEvent *)0x0) {

+    lVar1 = -0x3fffffe9;

+  }

+  else {

+    lVar1 = Initialize(this,param_1,false);

+    if (lVar1 < 0) {

+      _scalar_deleting_destructor_(this,(uint)param_1);

+    }

+    else {

+      *param_3 = this;

+    }

+  }

+  return lVar1;

+}

+
```

## `DirectComposition::CChannel::OnProcessCreation`  (modified)

```diff
--- DirectComposition::CChannel::OnProcessCreation
+++ DirectComposition::CChannel::OnProcessCreation
@@ -1,2 +1,54 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CChannel::OnProcessCreation : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static long __cdecl DirectComposition::CChannel::OnProcessCreation(class

+   DirectComposition::CProcessData * __ptr64) */

+

+long __cdecl DirectComposition::CChannel::OnProcessCreation(CProcessData *param_1)

+

+{

+  int iVar1;

+  void *pvVar2;

+  void *_Dst;

+  __uint64 in_RDX;

+  void *pvVar3;

+  

+  _Dst = (void *)0x0;

+  pvVar2 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     ((CLeakTrackingAllocator *)param_1,in_RDX,0x48,0x74634344);

+  if (pvVar2 == (void *)0x0) {

+    pvVar2 = (void *)0x0;

+    iVar1 = -0x3fffffe9;

+  }

+  else {

+    RtlInitializeGenericTable

+              (pvVar2,CGenericTable<unsigned_int,DirectComposition::CChannel,1952662340,1>::

+                      CompareTableEntries,

+               CGenericTable<unsigned_int,DirectComposition::CChannel,1952662340,1>::

+               AllocateTableEntry,

+               CGenericTable<DirectComposition::CResourceMarshaler*___ptr64,DirectComposition::CWeakReferenceBase,1953973060,1>

+               ::FreeTableEntry,0);

+    _Dst = NSInstrumentation::CLeakTrackingAllocator::Allocate

+                     (gpLeakTrackingAllocator,0x44,0x68,0x73634344);

+    if (_Dst == (void *)0x0) {

+      pvVar3 = (void *)0x0;

+      iVar1 = -0x3fffffe9;

+    }

+    else {

+      memset(_Dst,0,0x68);

+      iVar1 = ExInitializeResourceLite(_Dst);

+      pvVar3 = _Dst;

+      if (-1 < iVar1) goto LAB_0;

+    }

+    NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,pvVar2);

+    pvVar2 = (void *)0x0;

+    _Dst = (void *)0x0;

+    if (pvVar3 != (void *)0x0) {

+      NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,pvVar3);

+      _Dst = (void *)0x0;

+    }

+  }

+LAB_0:

+  *(void **)param_1 = pvVar2;

+  *(void **)(param_1 + 8) = _Dst;

+  return iVar1;

+}

+
```

## `DirectComposition::CApplicationChannel::CompleteAddCrossChannelVisualChild`  (modified)

```diff
--- DirectComposition::CApplicationChannel::CompleteAddCrossChannelVisualChild
+++ DirectComposition::CApplicationChannel::CompleteAddCrossChannelVisualChild
@@ -1,2 +1,107 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CApplicationChannel::CompleteAddCrossChannelVisualChild : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl

+   DirectComposition::CApplicationChannel::CompleteAddCrossChannelVisualChild(unsigned int,unsigned

+   int,unsigned int,class ResourceHandle,int,unsigned int,class ResourceHandle) __ptr64 */

+

+long __thiscall

+DirectComposition::CApplicationChannel::CompleteAddCrossChannelVisualChild

+          (CApplicationChannel *this,__uint64 param_2_00,undefined4 param_2,int param_3,int param_5,

+          undefined4 param_6,int param_7,uint param_8)

+

+{

+  longlong *plVar1;

+  CVisualMarshaler *pCVar2;

+  long lVar3;

+  CResourceMarshaler *pCVar4;

+  CCrossChannelParentVisualMarshaler *pCVar5;

+  CVisualMarshaler *this_00;

+  ulonglong uVar6;

+  CLeakTrackingAllocator *this_01;

+  CVisualMarshaler *pCVar7;

+  char local_res10 [8];

+  

+  pCVar5 = (CCrossChannelParentVisualMarshaler *)0x0;

+  this_00 = (CVisualMarshaler *)0x0;

+  pCVar7 = (CVisualMarshaler *)0x0;

+  uVar6 = (ulonglong)((int)param_2_00 - 1);

+  if ((((int)param_2_00 == 0) || (*(ulonglong *)(this + 0x50) <= uVar6)) ||

+     (this_01 = *(CLeakTrackingAllocator **)

+                 (uVar6 * *(longlong *)(this + 0x58) + *(longlong *)(this + 0x38)),

+     this_01 == (CLeakTrackingAllocator *)0x0)) {

+    lVar3 = -0x3fffffde;

+    goto LAB_0;

+  }

+  pCVar4 = (CResourceMarshaler *)(**(code **)(*(longlong *)this_01 + 0xa8))();

+  pCVar2 = this_00;

+  if (pCVar4 != (CResourceMarshaler *)0x0) {

+    pCVar2 = pCVar7;

+    if (param_7 == 0) {

+      param_2_00 = (__uint64)param_8;

+      if (param_8 != 0) {

+        this_01 = (CLeakTrackingAllocator *)pCVar4;

+        pCVar5 = CVisualMarshaler::GetCrossChannelVisualChildNoRef();

+LAB_1:

+        pCVar2 = this_00;

+        if (pCVar5 == (CCrossChannelParentVisualMarshaler *)0x0) goto LAB_2;

+      }

+      if (param_3 == 0) {

+        pCVar2 = this_00;

+        if (param_5 != 0) {

+          pCVar7 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             (this_01,param_2_00,0x180,0x70784344);

+          if (pCVar7 == (CVisualMarshaler *)0x0) {

+            lVar3 = -0x3fffffe9;

+            goto LAB_0;

+          }

+          CVisualMarshaler::CVisualMarshaler(pCVar7);

+          *(undefined ***)pCVar7 = &CCrossChannelParentVisualMarshaler::_vftable_;

+          lVar3 = CCrossChannelParentVisualMarshaler::Initialize

+                            ((CCrossChannelParentVisualMarshaler *)pCVar7,this,param_5,param_2);

+          if ((lVar3 < 0) ||

+             (lVar3 = RegisterResource(this,(CResourceMarshaler *)pCVar7), lVar3 < 0)) {

+            (**(code **)(*(longlong *)pCVar7 + 0xc0))(pCVar7,this);

+            (**(code **)(*(longlong *)pCVar7 + 0x48))(pCVar7,1);

+            pCVar7 = this_00;

+          }

+          this_00 = pCVar7;

+          if (lVar3 < 0) goto LAB_0;

+          goto LAB_3;

+        }

+      }

+      else {

+        pCVar2 = pCVar7;

+        if ((((ulonglong)(param_3 - 1) < *(ulonglong *)(this + 0x50)) &&

+            (plVar1 = *(longlong **)

+                       ((ulonglong)(param_3 - 1) * *(longlong *)(this + 0x58) +

+                       *(longlong *)(this + 0x38)), plVar1 != (longlong *)0x0)) &&

+           (this_00 = (CVisualMarshaler *)(**(code **)(*plVar1 + 0xa8))(), pCVar2 = this_00,

+           this_00 != (CVisualMarshaler *)0x0)) {

+          CResourceMarshaler::AddRef((CResourceMarshaler *)this_00);

+LAB_3:

+          local_res10[0] = '\0';

+          lVar3 = (**(code **)(*(longlong *)pCVar4 + 0x120))

+                            (pCVar4,this,this_00,param_6,pCVar5,local_res10);

+          if ((-1 < lVar3) && (local_res10[0] != '\0')) {

+            PutResourceOnUpdatedList(this,pCVar4);

+          }

+          goto LAB_0;

+        }

+      }

+    }

+    else if (((ulonglong)(param_7 - 1) < *(ulonglong *)(this + 0x50)) &&

+            (this_01 = *(CLeakTrackingAllocator **)

+                        ((ulonglong)(param_7 - 1) * *(longlong *)(this + 0x58) +

+                        *(longlong *)(this + 0x38)), this_01 != (CLeakTrackingAllocator *)0x0)) {

+      pCVar5 = (CCrossChannelParentVisualMarshaler *)(**(code **)(*(longlong *)this_01 + 0xa8))();

+      goto LAB_1;

+    }

+  }

+LAB_2:

+  this_00 = pCVar2;

+  lVar3 = -0x3ffffff3;

+LAB_0:

+  ReleaseResource(this,(CResourceMarshaler *)this_00);

+  return lVar3;

+}

+
```

## `DirectComposition::CApplicationChannel::OpenInternalSharedReadResource`  (modified)

```diff
--- DirectComposition::CApplicationChannel::OpenInternalSharedReadResource
+++ DirectComposition::CApplicationChannel::OpenInternalSharedReadResource
@@ -1,2 +1,58 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CApplicationChannel::OpenInternalSharedReadResource : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl

+   DirectComposition::CApplicationChannel::OpenInternalSharedReadResource(unsigned int,struct

+   DirectComposition::ResourceObject const * __ptr64,class DirectComposition::CResourceMarshaler *

+   __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CApplicationChannel::OpenInternalSharedReadResource

+          (CApplicationChannel *this,uint param_1,ResourceObject *param_2,

+          CResourceMarshaler **param_3)

+

+{

+  long lVar1;

+  CResourceMarshaler *pCVar2;

+  undefined4 in_register_00000014;

+  

+  if (param_1 == 0xc4) {

+    pCVar2 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)this,CONCAT44(in_register_00000014,param_1),0x48,

+                        0x74764344);

+    if (pCVar2 == (CResourceMarshaler *)0x0) {

+      pCVar2 = (CResourceMarshaler *)0x0;

+    }

+    else {

+      *(undefined4 *)(pCVar2 + 0x20) = 0;

+      *(undefined8 *)(pCVar2 + 0x30) = 0;

+      *(ResourceObject **)(pCVar2 + 0x38) = param_2 + 0x18;

+      *(undefined8 *)(pCVar2 + 0x18) = 1;

+      *(undefined4 *)(pCVar2 + 0x24) = 0x93;

+      *(undefined ***)pCVar2 = &CVisualTargetMarshaler::_vftable_;

+    }

+    if (pCVar2 == (CResourceMarshaler *)0x0) {

+      *(undefined4 *)(param_2 + 0x38) = 2;

+LAB_0:

+      ObfDereferenceObject(param_2);

+      return -0x3fffffe9;

+    }

+  }

+  else {

+    pCVar2 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)this,CONCAT44(in_register_00000014,param_1),0x40,

+                        0x30734344);

+    if (pCVar2 == (CResourceMarshaler *)0x0) goto LAB_0;

+    *(undefined4 *)(pCVar2 + 0x20) = 0;

+    *(undefined8 *)(pCVar2 + 0x30) = 0;

+    *(undefined8 *)(pCVar2 + 0x18) = 1;

+    *(uint *)(pCVar2 + 0x24) = param_1;

+    *(undefined ***)pCVar2 =

+         &CSharedResourceMarshaler<DirectComposition::CResourceMarshaler,0>::_vftable_;

+    *(ResourceObject **)(pCVar2 + 0x38) = param_2 + 0x18;

+  }

+  lVar1 = InitializeAndRegisterInternalResource(this,pCVar2);

+  if (-1 < lVar1) {

+    *param_3 = pCVar2;

+  }

+  return lVar1;

+}

+
```

## `CCursorClip::DeadzoneJumping::CreatePortal`  (modified)

```diff
--- CCursorClip::DeadzoneJumping::CreatePortal
+++ CCursorClip::DeadzoneJumping::CreatePortal
@@ -1,2 +1,147 @@
-Failed to decompile win32kbase.sys - .ProgramDB CCursorClip::DeadzoneJumping::CreatePortal : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: long __cdecl CCursorClip::DeadzoneJumping::CreatePortal(struct

+   CCursorClip::DeadzoneJumping::RegionInfo * __ptr64,struct

+   CCursorClip::DeadzoneJumping::RegionInfo * __ptr64,struct

+   CCursorClip::DeadzoneJumping::RegionPortal * __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+CCursorClip::DeadzoneJumping::CreatePortal

+          (DeadzoneJumping *this,RegionInfo *param_1,RegionInfo *param_2,RegionPortal **param_3)

+

+{

+  uint uVar1;

+  uint uVar2;

+  bool bVar3;

+  RegionPortal *pRVar4;

+  undefined8 *puVar5;

+  CLeakTrackingAllocator *this_00;

+  int iVar6;

+  __uint64 _Var7;

+  undefined4 uVar8;

+  int iVar9;

+  undefined8 local_res8;

+  undefined8 local_res10;

+  int local_res18;

+  uint uStackX_1c;

+  int local_res20;

+  uint uStackX_24;

+  

+  *param_3 = (RegionPortal *)0x0;

+  uVar1 = *(uint *)(param_2 + 0x14);

+  uStackX_24 = *(uint *)(param_1 + 0xc);

+  this_00 = (CLeakTrackingAllocator *)(ulonglong)uStackX_24;

+  if (uStackX_24 == uVar1) {

+    iVar9 = *(int *)(param_2 + 0x10) + -1;

+    local_res18 = *(int *)(param_2 + 8);

+    _Var7 = (__uint64)(*(int *)(param_1 + 0x10) - 1U);

+    this_00 = (CLeakTrackingAllocator *)(ulonglong)*(uint *)(param_1 + 8);

+    bVar3 = RangesOverlap(*(uint *)(param_1 + 8),*(int *)(param_1 + 0x10) - 1U,local_res18,iVar9);

+    if (!bVar3) {

+      return 0;

+    }

+    local_res20 = (int)this_00;

+    iVar6 = (int)_Var7;

+    uVar8 = 2;

+    if (local_res18 < local_res20) {

+      local_res18 = local_res20;

+    }

+    if (iVar6 < iVar9) {

+      iVar9 = iVar6;

+    }

+    local_res10 = CONCAT44(uStackX_24,iVar6);

+    local_res8 = CONCAT44(uStackX_24,iVar9);

+    uStackX_1c = uStackX_24;

+  }

+  else {

+    uVar2 = *(uint *)(param_1 + 0x14);

+    uStackX_1c = *(uint *)(param_2 + 0xc);

+    if (uVar2 == uStackX_1c) {

+      iVar9 = *(int *)(param_2 + 0x10) + -1;

+      local_res18 = *(int *)(param_2 + 8);

+      _Var7 = (__uint64)(*(int *)(param_1 + 0x10) - 1U);

+      this_00 = (CLeakTrackingAllocator *)(ulonglong)*(uint *)(param_1 + 8);

+      bVar3 = RangesOverlap(*(uint *)(param_1 + 8),*(int *)(param_1 + 0x10) - 1U,local_res18,iVar9);

+      if (!bVar3) {

+        return 0;

+      }

+      uStackX_24 = uVar2 - 1;

+      local_res20 = (int)this_00;

+      iVar6 = (int)_Var7;

+      uVar8 = 4;

+      if (local_res18 < local_res20) {

+        local_res18 = local_res20;

+      }

+      local_res10 = CONCAT44(uStackX_24,iVar6);

+      if (iVar6 < iVar9) {

+        iVar9 = iVar6;

+      }

+      local_res8 = CONCAT44(uStackX_24,iVar9);

+      uStackX_1c = uStackX_24;

+    }

+    else {

+      local_res20 = *(int *)(param_1 + 8);

+      if (local_res20 == *(int *)(param_2 + 0x10)) {

+        iVar9 = uVar1 - 1;

+        _Var7 = (__uint64)(uVar2 - 1);

+        bVar3 = RangesOverlap(uStackX_24,uVar2 - 1,uStackX_1c,iVar9);

+        if (!bVar3) {

+          return 0;

+        }

+        uVar8 = 1;

+      }

+      else {

+        local_res20 = *(int *)(param_1 + 0x10);

+        if (local_res20 != *(int *)(param_2 + 8)) {

+          return 0;

+        }

+        iVar9 = uVar1 - 1;

+        _Var7 = (__uint64)(uVar2 - 1);

+        this_00 = (CLeakTrackingAllocator *)(ulonglong)uStackX_24;

+        bVar3 = RangesOverlap(uStackX_24,uVar2 - 1,uStackX_1c,iVar9);

+        if (!bVar3) {

+          return 0;

+        }

+        local_res20 = local_res20 + -1;

+        uVar8 = 3;

+      }

+      iVar6 = (int)_Var7;

+      local_res10 = CONCAT44(iVar6,local_res20);

+      if ((int)uStackX_1c < (int)uStackX_24) {

+        uStackX_1c = uStackX_24;

+      }

+      if (iVar6 < iVar9) {

+        iVar9 = iVar6;

+      }

+      local_res8 = CONCAT44(iVar9,local_res20);

+      local_res18 = local_res20;

+    }

+  }

+  pRVar4 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     (this_00,_Var7,0x48,0x6a637a44);

+  if (pRVar4 == (RegionPortal *)0x0) {

+    return -0x3fffffe9;

+  }

+  *(undefined8 *)(pRVar4 + 8) = 0;

+  *(ulonglong *)(pRVar4 + 0x20) = CONCAT44(uStackX_1c,local_res18);

+  *(undefined8 *)(pRVar4 + 0x28) = local_res8;

+  *(ulonglong *)(pRVar4 + 0x30) = CONCAT44(uStackX_24,local_res20);

+  *(undefined8 *)(pRVar4 + 0x38) = local_res10;

+  *(undefined4 *)(pRVar4 + 0x40) = uVar8;

+  *(RegionInfo **)(pRVar4 + 0x10) = param_1;

+  *(RegionInfo **)(pRVar4 + 0x18) = param_2;

+  puVar5 = *(undefined8 **)(param_2 + 0x18);

+  do {

+    if (puVar5 == (undefined8 *)0x0) {

+LAB_0:

+      *param_3 = pRVar4;

+      return 0;

+    }

+    if ((RegionInfo *)puVar5[3] == param_1) {

+      *(undefined8 **)(pRVar4 + 8) = puVar5;

+      puVar5[1] = pRVar4;

+      goto LAB_0;

+    }

+    puVar5 = (undefined8 *)*puVar5;

+  } while( true );

+}

+
```

## `DirectComposition::GeneratedCreatePrivateMarshaler`  (modified)

```diff
--- DirectComposition::GeneratedCreatePrivateMarshaler
+++ DirectComposition::GeneratedCreatePrivateMarshaler
@@ -1,2 +1,617 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::GeneratedCreatePrivateMarshaler : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* long __cdecl DirectComposition::GeneratedCreatePrivateMarshaler(unsigned int,class

+   DirectComposition::CResourceMarshaler * __ptr64 * __ptr64) */

+

+long __cdecl

+DirectComposition::GeneratedCreatePrivateMarshaler(uint param_1,CResourceMarshaler **param_2)

+

+{

+  long lVar1;

+  CVisualMarshaler *this;

+  undefined **ppuVar2;

+  CParticleEmitterVisualMarshaler *this_00;

+  CSceneVisualMarshaler *this_01;

+  CTextVisualMarshaler *this_02;

+  CSuperWetInkVisualMarshaler *this_03;

+  undefined4 in_register_0000000c;

+  CLeakTrackingAllocator *this_04;

+  undefined4 uVar3;

+  

+  this_04 = (CLeakTrackingAllocator *)CONCAT44(in_register_0000000c,param_1);

+  if (param_1 < 0x7e) {

+    if (param_1 == 0x7d) {

+      this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       (this_04,(__uint64)param_2,0x58,0x68714344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x7d;

+        *(undefined8 *)(this + 0x38) = 0;

+        *(undefined8 *)(this + 0x40) = 0;

+        *(undefined8 *)(this + 0x48) = 0;

+        ppuVar2 = &CParticleColorBehaviorMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 < 0x55) {

+      if (param_1 == 0x54) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_04,(__uint64)param_2,0xb8,0x62694344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          ppuVar2 = &CImageLegacyMilBrushMarshaler::_vftable_;

+          *(undefined4 *)(this + 0x24) = 0x54;

+          goto LAB_1;

+        }

+      }

+      else if (param_1 < 0x2c) {

+        if (param_1 == 0x2b) {

+          this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           (this_04,(__uint64)param_2,0x60,0x6c744344);

+          if (this != (CVisualMarshaler *)0x0) {

+            *(undefined4 *)(this + 0x20) = 0;

+            *(undefined8 *)(this + 0x30) = 0;

+            ppuVar2 = &CCompositionTextLineMarshaler::_vftable_;

+            *(undefined4 *)(this + 0x24) = 0x2b;

+            goto LAB_1;

+          }

+        }

+        else if (param_1 == 3) {

+          this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x68,0x68614344);

+          if (this != (CVisualMarshaler *)0x0) {

+            *(undefined4 *)(this + 0x24) = 3;

+            ppuVar2 = &CAnimationControllerMarshaler::_vftable_;

+            goto LAB_2;

+          }

+        }

+        else if (param_1 == 5) {

+          this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x78,0x72744344);

+          if (this != (CVisualMarshaler *)0x0) {

+            *(undefined4 *)(this + 0x20) = 0;

+            *(undefined ***)this = &CAnimationTriggerMarshaler::_vftable_;

+            *(undefined8 *)(this + 0x30) = 0;

+            *(undefined8 *)(this + 0x18) = 1;

+            *(undefined4 *)(this + 0x24) = 5;

+            goto LAB_3;

+          }

+        }

+        else if (param_1 == 7) {

+          this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x58,0x77614344);

+          if (this != (CVisualMarshaler *)0x0) {

+            *(undefined4 *)(this + 0x20) = 0;

+            *(undefined ***)this = &CAtlasedRectsGroupMarshaler::_vftable_;

+            *(undefined8 *)(this + 0x30) = 0;

+            *(undefined8 *)(this + 0x18) = 1;

+            *(undefined4 *)(this + 0x24) = 7;

+            *(undefined8 *)(this + 0x40) = 0;

+            *(undefined8 *)(this + 0x48) = 0;

+            *(undefined8 *)(this + 0x50) = 0;

+            goto LAB_4;

+          }

+        }

+        else if (param_1 == 8) {

+          this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x70,0x30614344);

+          if (this != (CVisualMarshaler *)0x0) {

+            *(undefined4 *)(this + 0x20) = 0;

+            *(undefined ***)this = &CAtlasedRectsMeshMarshaler::_vftable_;

+            *(undefined8 *)(this + 0x30) = 0;

+            *(undefined8 *)(this + 0x18) = 1;

+            *(undefined4 *)(this + 0x24) = 8;

+            *(undefined8 *)(this + 0x40) = 0;

+            *(undefined8 *)(this + 0x48) = 0;

+            *(undefined8 *)(this + 0x50) = 0;

+            *(undefined8 *)(this + 0x58) = 0;

+            *(undefined8 *)(this + 0x60) = 0;

+            *(undefined8 *)(this + 0x68) = 0;

+            goto LAB_4;

+          }

+        }

+        else {

+          if (param_1 != 0x23) {

+            return -0x3ffffff3;

+          }

+          this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)0x1b,(__uint64)param_2,0x60,0x72674344);

+          if (this != (CVisualMarshaler *)0x0) {

+            *(undefined4 *)(this + 0x20) = 0;

+            *(undefined8 *)(this + 0x30) = 0;

+            ppuVar2 = &CCompositionGlyphRunMarshaler::_vftable_;

+            *(undefined4 *)(this + 0x24) = 0x23;

+            goto LAB_1;

+          }

+        }

+      }

+      else if (param_1 == 0x3a) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_04,(__uint64)param_2,0x58,0x67654344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          ppuVar2 = &CEffectGroupMarshaler::_vftable_;

+          *(undefined4 *)(this + 0x24) = 0x3a;

+          goto LAB_1;

+        }

+      }

+      else if (param_1 == 0x32) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_04,(__uint64)param_2,0x188,0x79634344);

+        if (this != (CVisualMarshaler *)0x0) {

+          CVisualMarshaler::CVisualMarshaler(this,0x32);

+          *(undefined ***)this = &CCursorVisualMarshaler::_vftable_;

+          goto LAB_4;

+        }

+      }

+      else if (param_1 == 0x41) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_04,(__uint64)param_2,0x70,0x64674344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x24) = 0x41;

+          ppuVar2 = &CGdiSpriteBitmapMarshaler::_vftable_;

+LAB_5:

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined ***)this = ppuVar2;

+          *(undefined8 *)(this + 0x38) = 0;

+          *(undefined8 *)(this + 0x40) = 0;

+          *(undefined8 *)(this + 0x48) = 0;

+          goto LAB_4;

+        }

+      }

+      else if (param_1 == 0x45) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_04,(__uint64)param_2,0x50,0x67674344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x24) = 0x45;

+          ppuVar2 = &CGeometry2DGroupMarshaler::_vftable_;

+          goto LAB_5;

+        }

+      }

+      else {

+        if (param_1 != 0x48) {

+          return -0x3ffffff3;

+        }

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_04,(__uint64)param_2,0x50,0x76674344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          ppuVar2 = &CGlobalDCompVisualMarshaler::_vftable_;

+          *(undefined4 *)(this + 0x24) = 0x48;

+          goto LAB_1;

+        }

+      }

+    }

+    else if (param_1 < 0x79) {

+      if (param_1 == 0x78) {

+        this_00 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                            (this_04,(__uint64)param_2,0x228,0x76714344);

+        if (this_00 != (CParticleEmitterVisualMarshaler *)0x0) {

+          CParticleEmitterVisualMarshaler::CParticleEmitterVisualMarshaler(this_00);

+          lVar1 = FUN_1c00bb39b();

+          return lVar1;

+        }

+      }

+      else if (param_1 == 100) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0xa0,0x626c4344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 100;

+          *(undefined8 *)(this + 0x68) = 0;

+          *(undefined8 *)(this + 0x70) = 0;

+          *(undefined8 *)(this + 0x78) = 0;

+          ppuVar2 = &CLinearGradientLegacyMilBrushMarshaler::_vftable_;

+          goto LAB_0;

+        }

+      }

+      else if (param_1 == 0x6f) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x88,0x676d4344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined ***)this = &CMeshGeometry2DMarshaler::_vftable_;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 0x6f;

+          *(undefined8 *)(this + 0x40) = 0;

+          *(undefined8 *)(this + 0x48) = 0;

+          *(undefined8 *)(this + 0x50) = 0;

+          *(undefined8 *)(this + 0x58) = 0;

+          *(undefined8 *)(this + 0x60) = 0;

+          *(undefined8 *)(this + 0x68) = 0;

+          *(undefined8 *)(this + 0x70) = 0;

+          *(undefined8 *)(this + 0x78) = 0;

+          *(undefined8 *)(this + 0x80) = 0;

+          goto LAB_4;

+        }

+      }

+      else if (param_1 == 0x73) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x50,0x72714344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          ppuVar2 = &CParticleAttractorMarshaler::_vftable_;

+          *(undefined4 *)(this + 0x24) = 0x73;

+          goto LAB_1;

+        }

+      }

+      else if (param_1 == 0x75) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x90,0x62714344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          ppuVar2 = &CParticleBehaviorsMarshaler::_vftable_;

+          *(undefined4 *)(this + 0x24) = 0x75;

+          goto LAB_1;

+        }

+      }

+      else {

+        if (param_1 != 0x76) {

+          return -0x3ffffff3;

+        }

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)0x1,(__uint64)param_2,0x58,0x64714344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 0x76;

+          *(undefined8 *)(this + 0x38) = 0;

+          *(undefined8 *)(this + 0x40) = 0;

+          *(undefined8 *)(this + 0x48) = 0;

+          ppuVar2 = &CParticleColorBehaviorMarshaler::_vftable_;

+          goto LAB_0;

+        }

+      }

+    }

+    else if (param_1 == 0x79) {

+      this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0xd0,0x67714344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        ppuVar2 = &CParticleGeneratorMarshaler::_vftable_;

+        *(undefined4 *)(this + 0x24) = 0x79;

+        goto LAB_1;

+      }

+    }

+    else if (param_1 == 0x7a) {

+      this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x58,0x65714344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x7a;

+        *(undefined8 *)(this + 0x38) = 0;

+        *(undefined8 *)(this + 0x40) = 0;

+        *(undefined8 *)(this + 0x48) = 0;

+        ppuVar2 = &CParticleColorBehaviorMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x7b) {

+      this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x58,0x66714344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x7b;

+        *(undefined8 *)(this + 0x38) = 0;

+        *(undefined8 *)(this + 0x40) = 0;

+        *(undefined8 *)(this + 0x48) = 0;

+        ppuVar2 = &CParticleColorBehaviorMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else {

+      if (param_1 != 0x7c) {

+        return -0x3ffffff3;

+      }

+      this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)0x1,(__uint64)param_2,0x58,0x69714344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x7c;

+        *(undefined8 *)(this + 0x38) = 0;

+        *(undefined8 *)(this + 0x40) = 0;

+        *(undefined8 *)(this + 0x48) = 0;

+        ppuVar2 = &CParticleColorBehaviorMarshaler::_vftable_;

+LAB_0:

+        *(undefined ***)this = ppuVar2;

+        goto LAB_4;

+      }

+    }

+  }

+  else {

+    uVar3 = 0xad;

+    if (param_1 < 0xae) {

+      if (param_1 == 0xad) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_04,(__uint64)param_2,0x58,0x746b4344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          ppuVar2 = &CSkewTransformMarshaler::_vftable_;

+LAB_6:

+          *(undefined4 *)(this + 0x24) = uVar3;

+          goto LAB_1;

+        }

+      }

+      else {

+        uVar3 = 0x9d;

+        if (param_1 < 0x9e) {

+          if (param_1 == 0x9d) {

+            this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             (this_04,(__uint64)param_2,0x98,0x657a4344);

+            if (this != (CVisualMarshaler *)0x0) {

+              *(undefined4 *)(this + 0x20) = 0;

+              *(undefined8 *)(this + 0x30) = 0;

+              ppuVar2 = &CSceneMeshMarshaler::_vftable_;

+              goto LAB_6;

+            }

+          }

+          else if (param_1 == 0x8e) {

+            this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x78,0x67724344);

+            if (this != (CVisualMarshaler *)0x0) {

+              *(undefined4 *)(this + 0x20) = 0;

+              *(undefined ***)this = &CRegionGeometryMarshaler::_vftable_;

+              *(undefined8 *)(this + 0x30) = 0;

+              *(undefined8 *)(this + 0x18) = 1;

+              *(undefined4 *)(this + 0x24) = 0x8e;

+              *(undefined8 *)(this + 0x60) = 0;

+              *(undefined8 *)(this + 0x68) = 0;

+              *(undefined8 *)(this + 0x70) = 0;

+              goto LAB_4;

+            }

+          }

+          else if (param_1 == 0x94) {

+            this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x58,0x6f724344);

+            if (this != (CVisualMarshaler *)0x0) {

+              *(undefined4 *)(this + 0x20) = 0;

+              *(undefined8 *)(this + 0x30) = 0;

+              ppuVar2 = &CRotateTransformMarshaler::_vftable_;

+              *(undefined4 *)(this + 0x24) = 0x94;

+              goto LAB_1;

+            }

+          }

+          else if (param_1 == 0x95) {

+            this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x68,0x33724344);

+            if (this != (CVisualMarshaler *)0x0) {

+              *(undefined4 *)(this + 0x20) = 0;

+              *(undefined8 *)(this + 0x30) = 0;

+              ppuVar2 = &CRotateTransform3DMarshaler::_vftable_;

+              *(undefined4 *)(this + 0x24) = 0x95;

+              goto LAB_1;

+            }

+          }

+          else if (param_1 == 0x98) {

+            this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x58,0x74734344);

+            if (this != (CVisualMarshaler *)0x0) {

+              *(undefined4 *)(this + 0x20) = 0;

+              *(undefined8 *)(this + 0x30) = 0;

+              ppuVar2 = &CScaleTransformMarshaler::_vftable_;

+              *(undefined4 *)(this + 0x24) = 0x98;

+LAB_1:

+              *(undefined ***)this = ppuVar2;

+              *(undefined8 *)(this + 0x18) = 1;

+              goto LAB_4;

+            }

+          }

+          else {

+            if (param_1 != 0x99) {

+              return -0x3ffffff3;

+            }

+            this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)0x1,(__uint64)param_2,0x60,0x33734344);

+            if (this != (CVisualMarshaler *)0x0) {

+              *(undefined4 *)(this + 0x20) = 0;

+              *(undefined8 *)(this + 0x30) = 0;

+              ppuVar2 = &CScaleTransform3DMarshaler::_vftable_;

+              *(undefined4 *)(this + 0x24) = 0x99;

+              goto LAB_1;

+            }

+          }

+        }

+        else {

+          uVar3 = 0x9f;

+          if (param_1 == 0x9f) {

+            this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0xa8,0x726d4344);

+            if (this != (CVisualMarshaler *)0x0) {

+              *(undefined4 *)(this + 0x20) = 0;

+              *(undefined8 *)(this + 0x30) = 0;

+              ppuVar2 = &CSceneMetallicRoughnessMaterialMarshaler::_vftable_;

+              goto LAB_6;

+            }

+          }

+          else if (param_1 == 0xa0) {

+            this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x40,0x7a7a4344);

+            if (this != (CVisualMarshaler *)0x0) {

+              *(undefined4 *)(this + 0x20) = 0;

+              *(undefined8 *)(this + 0x30) = 0;

+              ppuVar2 = &CSceneModelTransformMarshaler::_vftable_;

+              *(undefined4 *)(this + 0x24) = 0xa0;

+              goto LAB_1;

+            }

+          }

+          else if (param_1 == 0xa1) {

+            this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                             ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x70,0x747a4344);

+            if (this != (CVisualMarshaler *)0x0) {

+              *(undefined4 *)(this + 0x20) = 0;

+              *(undefined ***)this = &CSceneNodeMarshaler::_vftable_;

+              *(undefined8 *)(this + 0x30) = 0;

+              *(undefined8 *)(this + 0x18) = 1;

+              *(undefined4 *)(this + 0x24) = 0xa1;

+              *(undefined8 *)(this + 0x38) = 0;

+              *(undefined8 *)(this + 0x40) = 0;

+              *(undefined8 *)(this + 0x48) = 0;

+LAB_3:

+              *(undefined8 *)(this + 0x50) = 0;

+              *(undefined8 *)(this + 0x58) = 0;

+              *(undefined8 *)(this + 0x60) = 0;

+              goto LAB_4;

+            }

+          }

+          else {

+            if (param_1 != 0xa6) {

+              return -0x3ffffff3;

+            }

+            this_01 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                                ((CLeakTrackingAllocator *)0x5,(__uint64)param_2,0x188,0x767a4344);

+            if (this_01 != (CSceneVisualMarshaler *)0x0) {

+              CSceneVisualMarshaler::CSceneVisualMarshaler(this_01);

+              lVar1 = FUN_1c00bb39b();

+              return lVar1;

+            }

+          }

+        }

+      }

+    }

+    else if (param_1 < 0xbe) {

+      if (param_1 == 0xbd) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_04,(__uint64)param_2,0x60,0x67744344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x24) = 0xbd;

+          ppuVar2 = &CTransformGroupMarshaler::_vftable_;

+LAB_2:

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined ***)this = ppuVar2;

+          *(undefined8 *)(this + 0x48) = 0;

+          *(undefined8 *)(this + 0x50) = 0;

+          *(undefined8 *)(this + 0x58) = 0;

+          goto LAB_4;

+        }

+      }

+      else {

+        uVar3 = 0xaf;

+        if (param_1 == 0xaf) {

+          this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x68,0x7a734344);

+          if (this != (CVisualMarshaler *)0x0) {

+            *(undefined4 *)(this + 0x20) = 0;

+            *(undefined8 *)(this + 0x30) = 0;

+            ppuVar2 = &CSolidColorLegacyMilBrushMarshaler::_vftable_;

+            goto LAB_6;

+          }

+        }

+        else if (param_1 == 0xb3) {

+          this_03 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                              ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x188,0x75734344);

+          if (this_03 != (CSuperWetInkVisualMarshaler *)0x0) {

+            CSuperWetInkVisualMarshaler::CSuperWetInkVisualMarshaler(this_03);

+            lVar1 = FUN_1c00bb39b();

+            return lVar1;

+          }

+        }

+        else if (param_1 == 0xb6) {

+          this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x78,0x79734344);

+          if (this != (CVisualMarshaler *)0x0) {

+            *(undefined4 *)(this + 0x20) = 0;

+            *(undefined8 *)(this + 0x30) = 0;

+            ppuVar2 = &CSynchronousSuperWetInkMarshaler::_vftable_;

+            *(undefined4 *)(this + 0x24) = 0xb6;

+            goto LAB_1;

+          }

+        }

+        else if (param_1 == 0xb9) {

+          this_02 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                              ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x1c8,0x76744344);

+          if (this_02 != (CTextVisualMarshaler *)0x0) {

+            CTextVisualMarshaler::CTextVisualMarshaler(this_02);

+            lVar1 = FUN_1c00bb39b();

+            return lVar1;

+          }

+        }

+        else {

+          if (param_1 != 0xbc) {

+            return -0x3ffffff3;

+          }

+          this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)0x3,(__uint64)param_2,0x60,0x33674344);

+          if (this != (CVisualMarshaler *)0x0) {

+            *(undefined4 *)(this + 0x24) = 0xbc;

+            ppuVar2 = &CTransform3DGroupMarshaler::_vftable_;

+            goto LAB_2;

+          }

+        }

+      }

+    }

+    else {

+      uVar3 = 0xbe;

+      if (param_1 == 0xbe) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x50,0x74744344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          ppuVar2 = &CTranslateTransformMarshaler::_vftable_;

+          goto LAB_6;

+        }

+      }

+      else if (param_1 == 0xbf) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x58,0x33744344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          ppuVar2 = &CTranslateTransform3DMarshaler::_vftable_;

+          *(undefined4 *)(this + 0x24) = 0xbf;

+          goto LAB_1;

+        }

+      }

+      else if (param_1 == 0xc5) {

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x40,0x78764344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          ppuVar2 = &CVisualBitmapMarshaler::_vftable_;

+          *(undefined4 *)(this + 0x24) = 0xc5;

+          goto LAB_1;

+        }

+      }

+      else {

+        if (param_1 != 199) {

+          return -0x3ffffff3;

+        }

+        this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)0x2,(__uint64)param_2,0x50,0x67764344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x24) = 199;

+          ppuVar2 = &CVisualGroupMarshaler::_vftable_;

+          goto LAB_5;

+        }

+      }

+    }

+  }

+  this = (CVisualMarshaler *)0x0;

+LAB_4:

+  *param_2 = (CResourceMarshaler *)this;

+  return 0;

+}

+
```

## `DirectComposition::CEffectInputSet::Initialize`  (modified)

```diff
--- DirectComposition::CEffectInputSet::Initialize
+++ DirectComposition::CEffectInputSet::Initialize
@@ -1,2 +1,58 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CEffectInputSet::Initialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl DirectComposition::CEffectInputSet::Initialize(unsigned int) __ptr64 */

+

+long __thiscall DirectComposition::CEffectInputSet::Initialize(CEffectInputSet *this,uint param_1)

+

+{

+  undefined1 auVar1 [16];

+  undefined1 auVar2 [16];

+  void *pvVar3;

+  ulonglong uVar4;

+  

+  uVar4 = 0;

+  *(uint *)this = param_1;

+  if (param_1 == 0) {

+    return 0;

+  }

+  if (SUB168(ZEXT416(4) * ZEXT416(param_1),8) == 0) {

+    pvVar3 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuota

+                       ((CLeakTrackingAllocator *)this,0x104,SUB168(ZEXT416(4) * ZEXT416(param_1),0)

+                        ,0x66664344);

+    *(void **)(this + 0x10) = pvVar3;

+    if (pvVar3 == (void *)0x0) {

+      return -0x3fffffe9;

+    }

+    if (*(int *)this != 0) {

+      do {

+        *(undefined4 *)(*(longlong *)(this + 0x10) + uVar4 * 4) = 2;

+        uVar4 = uVar4 + 1;

+      } while (uVar4 < *(uint *)this);

+    }

+    **(undefined4 **)(this + 0x10) = 0;

+    auVar1._8_8_ = 0;

+    auVar1._0_8_ = (CLeakTrackingAllocator *)CONCAT44(0,*(uint *)this);

+    if (SUB168(ZEXT816(0x10) * auVar1,8) == 0) {

+      pvVar3 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)CONCAT44(0,*(uint *)this),0,

+                          SUB168(ZEXT816(0x10) * auVar1,0),0x6a664344);

+      *(void **)(this + 0x18) = pvVar3;

+      if (pvVar3 == (void *)0x0) {

+        return -0x3fffffe9;

+      }

+      auVar2._8_8_ = 0;

+      auVar2._0_8_ = (CLeakTrackingAllocator *)CONCAT44(0,*(uint *)this);

+      if (SUB168(ZEXT816(8) * auVar2,8) == 0) {

+        pvVar3 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)CONCAT44(0,*(uint *)this),0,

+                            SUB168(ZEXT816(8) * auVar2,0),0x69664344);

+        *(void **)(this + 8) = pvVar3;

+        if (pvVar3 == (void *)0x0) {

+          return -0x3fffffe9;

+        }

+        return 0;

+      }

+    }

+  }

+  return -0x3fffff6b;

+}

+
```

## `DirectComposition::CBatchSharedMemoryPool::Create`  (modified)

```diff
--- DirectComposition::CBatchSharedMemoryPool::Create
+++ DirectComposition::CBatchSharedMemoryPool::Create
@@ -1,2 +1,140 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CBatchSharedMemoryPool::Create : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Type propagation algorithm not settling */

+/* public: static long __cdecl DirectComposition::CBatchSharedMemoryPool::Create(class

+   DirectComposition::CBatchSharedMemoryPoolSet * __ptr64,bool,class

+   DirectComposition::CBatchSharedMemoryPool * __ptr64 * __ptr64) */

+

+long __cdecl

+DirectComposition::CBatchSharedMemoryPool::Create

+          (CBatchSharedMemoryPoolSet *param_1,bool param_2,CBatchSharedMemoryPool **param_3)

+

+{

+  int iVar1;

+  CLeakTrackingAllocator *this;

+  bool bVar2;

+  int iVar3;

+  CBatchSharedMemoryPool *pCVar4;

+  CLeakTrackingAllocator *this_00;

+  longlong *plVar5;

+  undefined8 uVar6;

+  undefined4 local_res20 [2];

+  CLeakTrackingAllocator *local_108;

+  longlong local_100;

+  ulonglong *local_f8;

+  undefined4 *local_f0;

+  ulonglong local_e8 [4];

+  CBackTrace local_c8 [160];

+  

+  local_108 = (CLeakTrackingAllocator *)0x0;

+  local_100 = 0;

+  local_e8[2] = 0;

+  local_e8[1] = 0x1000;

+  iVar3 = MmCreateSection(&local_108,6,0,local_e8 + 1,4,0x8400000,0,0);

+  if (iVar3 < 0) goto LAB_0;

+  plVar5 = &local_100;

+  this_00 = local_108;

+  iVar3 = MmMapViewInSessionSpace(local_108,plVar5,local_e8 + 2);

+  this = gpLeakTrackingAllocator;

+  if (iVar3 < 0) goto LAB_0;

+  if (param_2) {

+    pCVar4 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       (this_00,(__uint64)plVar5,0x48,0x73624344);

+  }

+  else {

+    uVar6 = 0x104;

+    local_res20[0] = 0x73624344;

+    local_e8[0] = 0x104;

+    local_e8[3] = 0x48;

+    iVar1 = *(int *)gpLeakTrackingAllocator;

+    if (iVar1 == 0) {

+      pCVar4 = (CBatchSharedMemoryPool *)ExAllocatePool2(0x104,0x48,0x73624344);

+      if (pCVar4 != (CBatchSharedMemoryPool *)0x0) {

+        LOCK();

+        *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + 1;

+        UNLOCK();

+      }

+    }

+    else {

+      if (iVar1 == 1) {

+        bVar2 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                          (gpLeakTrackingAllocator,0x73624344);

+        if (bVar2) {

+          pCVar4 = (CBatchSharedMemoryPool *)

+                   ExAllocatePool2(local_e8[0] & 0xfffffffffffffffd,0x58,local_res20[0]);

+          if (pCVar4 != (CBatchSharedMemoryPool *)0x0) {

+            LOCK();

+            *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + 1;

+            UNLOCK();

+            *(undefined8 *)pCVar4 = 0x73624344;

+            pCVar4 = pCVar4 + 0x10;

+            if (pCVar4 != (CBatchSharedMemoryPool *)0x0) goto LAB_1;

+          }

+          NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

+                    (*(CPointerHashTable **)(this + 8),(void *)0x73624344);

+          goto LAB_1;

+        }

+      }

+      else if (iVar1 == 2) {

+        local_f8 = (ulonglong *)0x0;

+        bVar2 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                          (gpLeakTrackingAllocator,0x73624344,(__uint64 *)&local_f8);

+        if (!bVar2) {

+          local_f8 = local_e8;

+          local_f0 = local_res20;

+          pCVar4 = (CBatchSharedMemoryPool *)

+                   NSInstrumentation::CLeakTrackingAllocator::

+                   MakeUntrackedAllocation<<lambda_992394a475252bc644037de3157b7526>,unsigned___int64_&>

+                             (this,&local_f8,local_e8 + 3);

+          goto LAB_1;

+        }

+        pCVar4 = (CBatchSharedMemoryPool *)ExAllocatePool2(uVar6,0x58,0x73624344);

+        if (pCVar4 != (CBatchSharedMemoryPool *)0x0) {

+          LOCK();

+          *(longlong *)(this + 0x80) = *(longlong *)(this + 0x80) + 1;

+          UNLOCK();

+          NSInstrumentation::CBackTrace::CBackTrace(local_c8);

+          if (((uint)pCVar4 & 0xfff) + 0x10 < 0x1000) {

+            bVar2 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

+                              (this,pCVar4,(__uint64)local_f8,local_c8);

+            if (!bVar2) {

+LAB_2:

+              LOCK();

+              *(longlong *)(this + 0x88) = *(longlong *)(this + 0x88) + 1;

+              UNLOCK();

+              ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                        (pCVar4);

+              goto LAB_3;

+            }

+            pCVar4 = pCVar4 + 0x10;

+          }

+          else {

+            bVar2 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

+                              (this,pCVar4,(__uint64)local_f8,local_c8);

+            if (!bVar2) goto LAB_2;

+          }

+          goto LAB_1;

+        }

+      }

+LAB_3:

+      pCVar4 = (CBatchSharedMemoryPool *)0x0;

+    }

+  }

+LAB_1:

+  if (pCVar4 != (CBatchSharedMemoryPool *)0x0) {

+    *(CLeakTrackingAllocator **)(pCVar4 + 0x18) = local_108;

+    *(longlong *)(pCVar4 + 0x38) = local_100;

+    *(CBatchSharedMemoryPoolSet **)(pCVar4 + 0x10) = param_1;

+    *param_3 = pCVar4;

+    return iVar3;

+  }

+  iVar3 = -0x3fffffe9;

+LAB_0:

+  if (local_100 != 0) {

+    MmUnmapViewInSessionSpace();

+  }

+  if (local_108 != (CLeakTrackingAllocator *)0x0) {

+    ObfDereferenceObject();

+  }

+  return iVar3;

+}

+
```

## `DirectComposition::GeneratedCreateSharedWriteMarshaler`  (modified)

```diff
--- DirectComposition::GeneratedCreateSharedWriteMarshaler
+++ DirectComposition::GeneratedCreateSharedWriteMarshaler
@@ -1,2 +1,261 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::GeneratedCreateSharedWriteMarshaler : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* long __cdecl DirectComposition::GeneratedCreateSharedWriteMarshaler(unsigned int,class

+   DirectComposition::CSharedSystemResource const * __ptr64,class

+   DirectComposition::CResourceMarshaler * __ptr64 * __ptr64) */

+

+long __cdecl

+DirectComposition::GeneratedCreateSharedWriteMarshaler

+          (uint param_1,CSharedSystemResource *param_2,CResourceMarshaler **param_3)

+

+{

+  CResourceMarshaler *pCVar1;

+  CSharedResourceMarshaler<DirectComposition::CInteractionMarshaler,2> *this;

+  CSharedResourceMarshaler<DirectComposition::CVisualMarshaler,2> *this_00;

+  undefined4 in_register_0000000c;

+  CLeakTrackingAllocator *this_01;

+  undefined **ppuVar2;

+  

+  this_01 = (CLeakTrackingAllocator *)CONCAT44(in_register_0000000c,param_1);

+  if (param_1 < 0x6e) {

+    if (param_1 == 0x6d) {

+      pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_01,(__uint64)param_2,0x68,0x30734344);

+      if (pCVar1 != (CResourceMarshaler *)0x0) {

+        *(undefined4 *)(pCVar1 + 0x24) = 0x6d;

+        ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CMatrixTransformMarshaler,2>::

+                   _vftable_;

+LAB_0:

+        *(undefined4 *)(pCVar1 + 0x20) = 0;

+        *(CSharedSystemResource **)(pCVar1 + 0x60) = param_2;

+        goto LAB_1;

+      }

+    }

+    else if (param_1 == 0x59) {

+      this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       (this_01,(__uint64)param_2,0x158,0x30734344);

+      if (this != (CSharedResourceMarshaler<DirectComposition::CInteractionMarshaler,2> *)0x0) {

+        pCVar1 = (CResourceMarshaler *)

+                 CSharedResourceMarshaler<DirectComposition::CInteractionMarshaler,2>::

+                 CSharedResourceMarshaler<DirectComposition::CInteractionMarshaler,2>(this,param_2);

+        goto LAB_2;

+      }

+    }

+    else if (param_1 == 0x22) {

+      pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_01,(__uint64)param_2,0x90,0x30734344);

+      if (pCVar1 != (CResourceMarshaler *)0x0) {

+        *(undefined4 *)(pCVar1 + 0x24) = 0x22;

+        ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CCompositionDistantLightMarshaler,2>

+                   ::_vftable_;

+        goto LAB_3;

+      }

+    }

+    else if (param_1 == 0x29) {

+      pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_01,(__uint64)param_2,0xd0,0x30734344);

+      if (pCVar1 != (CResourceMarshaler *)0x0) {

+        *(undefined4 *)(pCVar1 + 0x20) = 0;

+        ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CCompositionSpotLightMarshaler,2>::

+                   _vftable_;

+        *(CSharedSystemResource **)(pCVar1 + 200) = param_2;

+        *(undefined4 *)(pCVar1 + 0x24) = 0x29;

+LAB_1:

+        *(undefined ***)pCVar1 = ppuVar2;

+        *(undefined8 *)(pCVar1 + 0x18) = 1;

+        *(undefined8 *)(pCVar1 + 0x30) = 0;

+        goto LAB_2;

+      }

+    }

+    else if (param_1 == 0x20) {

+      pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_01,(__uint64)param_2,0x80,0x30734344);

+      if (pCVar1 != (CResourceMarshaler *)0x0) {

+        *(undefined4 *)(pCVar1 + 0x20) = 0;

+        ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CCompositionAmbientLightMarshaler,2>

+                   ::_vftable_;

+        *(CSharedSystemResource **)(pCVar1 + 0x78) = param_2;

+        *(undefined4 *)(pCVar1 + 0x24) = 0x20;

+        goto LAB_1;

+      }

+    }

+    else if (param_1 == 0x13) {

+      pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_01,(__uint64)param_2,0x68,0x30734344);

+      if (pCVar1 != (CResourceMarshaler *)0x0) {

+        *(undefined4 *)(pCVar1 + 0x24) = 0x13;

+        ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CCaptureControllerMarshaler,2>::

+                   _vftable_;

+        *(undefined2 *)(pCVar1 + 0x48) = 0x101;

+        *(undefined4 *)(pCVar1 + 0x58) = 0x40000000;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x26) {

+      pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_01,(__uint64)param_2,0xa8,0x30734344);

+      if (pCVar1 != (CResourceMarshaler *)0x0) {

+        *(undefined4 *)(pCVar1 + 0x20) = 0;

+        ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CCompositionPointLightMarshaler,2>::

+                   _vftable_;

+        *(CSharedSystemResource **)(pCVar1 + 0xa0) = param_2;

+        *(undefined4 *)(pCVar1 + 0x24) = 0x26;

+        goto LAB_1;

+      }

+    }

+    else if (param_1 == 0x50) {

+      pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_01,(__uint64)param_2,0x68,0x30734344);

+      if (pCVar1 != (CResourceMarshaler *)0x0) {

+        *(undefined4 *)(pCVar1 + 0x20) = 0;

+        *(undefined8 *)(pCVar1 + 0x30) = 0;

+        *(uint *)(pCVar1 + 0x10) = *(uint *)(pCVar1 + 0x10) | 0x20;

+        *(undefined ***)pCVar1 =

+             &CSharedResourceMarshaler<DirectComposition::CHolographicInteropTextureMarshaler,2>::

+              _vftable_;

+        *(undefined8 *)(pCVar1 + 0x18) = 1;

+        *(undefined4 *)(pCVar1 + 0x24) = 0x50;

+        *(CSharedSystemResource **)(pCVar1 + 0x60) = param_2;

+        goto LAB_2;

+      }

+    }

+    else if (param_1 == 0x5e) {

+      pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_01,(__uint64)param_2,0x48,0x30734344);

+      if (pCVar1 != (CResourceMarshaler *)0x0) {

+        *(undefined4 *)(pCVar1 + 0x24) = 0x5e;

+        ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CLegacyAnimationTriggerMarshaler,2>::

+                   _vftable_;

+        goto LAB_4;

+      }

+    }

+    else {

+      if (param_1 != 0x6a) {

+        return -0x3ffffff3;

+      }

+      pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         (this_01,(__uint64)param_2,0x88,0x30734344);

+      if (pCVar1 != (CResourceMarshaler *)0x0) {

+        *(undefined4 *)(pCVar1 + 0x20) = 0;

+        ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CManipulationTransformMarshaler,2>::

+                   _vftable_;

+        *(CSharedSystemResource **)(pCVar1 + 0x80) = param_2;

+        *(undefined4 *)(pCVar1 + 0x24) = 0x6a;

+        goto LAB_1;

+      }

+    }

+  }

+  else if (param_1 == 0x6e) {

+    pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x90,0x30734344);

+    if (pCVar1 != (CResourceMarshaler *)0x0) {

+      *(undefined4 *)(pCVar1 + 0x24) = 0x6e;

+      ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CMatrixTransform3DMarshaler,2>::

+                 _vftable_;

+LAB_3:

+      *(undefined4 *)(pCVar1 + 0x20) = 0;

+      *(CSharedSystemResource **)(pCVar1 + 0x88) = param_2;

+      goto LAB_1;

+    }

+  }

+  else if (param_1 == 0x80) {

+    pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x50,0x30734344);

+    if (pCVar1 != (CResourceMarshaler *)0x0) {

+      *(undefined4 *)(pCVar1 + 0x20) = 0;

+      ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CPrimitiveColorMarshaler,2>::_vftable_;

+      *(CSharedSystemResource **)(pCVar1 + 0x48) = param_2;

+      *(undefined4 *)(pCVar1 + 0x24) = 0x80;

+      goto LAB_1;

+    }

+  }

+  else if (param_1 == 0x83) {

+    pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x70,0x30734344);

+    if (pCVar1 != (CResourceMarshaler *)0x0) {

+      *(undefined4 *)(pCVar1 + 0x24) = 0x83;

+      ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CProjectedShadowCasterMarshaler,2>::

+                 _vftable_;

+LAB_5:

+      *(undefined4 *)(pCVar1 + 0x20) = 0;

+      *(CSharedSystemResource **)(pCVar1 + 0x68) = param_2;

+      goto LAB_1;

+    }

+  }

+  else if (param_1 == 0x8e) {

+    pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x80,0x30734344);

+    if (pCVar1 != (CResourceMarshaler *)0x0) {

+      *(undefined4 *)(pCVar1 + 0x20) = 0;

+      *(undefined8 *)(pCVar1 + 0x30) = 0;

+      *(undefined8 *)(pCVar1 + 0x18) = 1;

+      *(undefined4 *)(pCVar1 + 0x24) = 0x8e;

+      *(undefined8 *)(pCVar1 + 0x60) = 0;

+      *(undefined8 *)(pCVar1 + 0x68) = 0;

+      *(undefined8 *)(pCVar1 + 0x70) = 0;

+      *(undefined ***)pCVar1 =

+           &CSharedResourceMarshaler<DirectComposition::CRegionGeometryMarshaler,2>::_vftable_;

+      *(CSharedSystemResource **)(pCVar1 + 0x78) = param_2;

+      goto LAB_2;

+    }

+  }

+  else if (param_1 == 0x8f) {

+    pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x70,0x30734344);

+    if (pCVar1 != (CResourceMarshaler *)0x0) {

+      *(undefined4 *)(pCVar1 + 0x24) = 0x8f;

+      ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CRemoteAppRenderTargetMarshaler,2>::

+                 _vftable_;

+      *(undefined4 *)(pCVar1 + 0x38) = 3;

+      goto LAB_5;

+    }

+  }

+  else if (param_1 == 0xc4) {

+    this_00 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                        ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x180,0x30734344);

+    if (this_00 != (CSharedResourceMarshaler<DirectComposition::CVisualMarshaler,2> *)0x0) {

+      pCVar1 = (CResourceMarshaler *)

+               CSharedResourceMarshaler<DirectComposition::CVisualMarshaler,2>::

+               CSharedResourceMarshaler<DirectComposition::CVisualMarshaler,2>(this_00,param_2);

+      goto LAB_2;

+    }

+  }

+  else if (param_1 == 0xc5) {

+    pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x48,0x30734344);

+    if (pCVar1 != (CResourceMarshaler *)0x0) {

+      *(undefined4 *)(pCVar1 + 0x24) = 0xc5;

+      ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CVisualBitmapMarshaler,2>::_vftable_;

+LAB_4:

+      *(undefined4 *)(pCVar1 + 0x20) = 0;

+      *(CSharedSystemResource **)(pCVar1 + 0x40) = param_2;

+      goto LAB_1;

+    }

+  }

+  else if (param_1 == 0xc9) {

+    pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)0x0,(__uint64)param_2,0x48,0x30734344);

+    if (pCVar1 != (CResourceMarshaler *)0x0) {

+      *(undefined4 *)(pCVar1 + 0x24) = 0xc9;

+      ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CVisualReferenceControllerMarshaler,2>

+                 ::_vftable_;

+      goto LAB_4;

+    }

+  }

+  else {

+    if (param_1 != 0xca) {

+      return -0x3ffffff3;

+    }

+    pCVar1 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)0x1,(__uint64)param_2,0x68,0x30734344);

+    if (pCVar1 != (CResourceMarshaler *)0x0) {

+      *(undefined4 *)(pCVar1 + 0x24) = 0xca;

+      ppuVar2 = &CSharedResourceMarshaler<DirectComposition::CVisualSurfaceMarshaler,2>::_vftable_;

+      goto LAB_0;

+    }

+  }

+  pCVar1 = (CResourceMarshaler *)0x0;

+LAB_2:

+  *param_3 = pCVar1;

+  return 0;

+}

+
```

## `CitpInteractionSummaryStopTracking`  (modified)

```diff
--- CitpInteractionSummaryStopTracking
+++ CitpInteractionSummaryStopTracking
@@ -1,2 +1,359 @@
-Failed to decompile win32kbase.sys - .ProgramDB CitpInteractionSummaryStopTracking : Error: Decompile error: 
-Low-level Error: DuplicateFunctionError, but could not recover original symbol+

+/* void __cdecl CitpInteractionSummaryStopTracking(struct _CIT_INTERACTION_SUMMARY *

+   __ptr64,unsigned int) */

+

+void __cdecl CitpInteractionSummaryStopTracking(_CIT_INTERACTION_SUMMARY *param_1,uint param_2)

+

+{

+  _CIT_INTERACTION_SUMMARY *p_Var1;

+  _CIT_INTERACTION_SUMMARY *p_Var2;

+  int iVar3;

+  longlong *plVar4;

+  wchar_t *pwVar5;

+  code *pcVar6;

+  longlong lVar7;

+  char cVar8;

+  int iVar9;

+  _CIT_INTERACTION_SUMMARY **pp_Var10;

+  wchar_t *pwVar11;

+  longlong lVar12;

+  wchar_t *pwVar13;

+  ushort in_R8W;

+  _GUID *p_Var14;

+  _GUID *p_Var15;

+  _CIT_INTERACTION_SUMMARY *p_Var16;

+  longlong lVar17;

+  wchar_t *pwVar18;

+  int iVar19;

+  _CIT_INTERACTION_SUMMARY local_res8 [8];

+  _tlgWrapperByVal<1> local_res18 [8];

+  _tlgWrapperByVal<1> local_res20 [8];

+  _tlgWrapperByVal<1> a_Stack_138 [2];

+  undefined2 local_136;

+  undefined2 local_134;

+  undefined2 local_132;

+  undefined2 local_130;

+  undefined2 local_12e;

+  undefined2 local_12c;

+  undefined2 local_12a;

+  short local_128;

+  short local_126;

+  short local_124;

+  short local_122;

+  undefined2 local_120;

+  short local_11e;

+  short local_11c;

+  undefined2 local_11a;

+  short local_118;

+  short local_116;

+  short local_114;

+  short local_112;

+  undefined2 local_110;

+  undefined2 local_10e;

+  undefined2 local_10c;

+  undefined2 local_10a;

+  undefined2 local_108;

+  undefined2 local_106;

+  undefined2 local_104 [2];

+  undefined4 local_100;

+  uint local_fc;

+  undefined4 local_f8;

+  undefined4 local_f4;

+  uint local_f0;

+  undefined4 local_ec;

+  undefined4 local_e8;

+  undefined4 local_e4;

+  undefined4 local_e0;

+  uint local_dc;

+  undefined4 local_d8;

+  undefined4 local_d4;

+  uint local_d0;

+  uint local_cc;

+  int local_c8 [2];

+  _CIT_INTERACTION_SUMMARY *p_Stack_c0;

+  undefined8 local_b8;

+  undefined4 uStack_b0;

+  undefined4 uStack_ac;

+  undefined8 local_a8;

+  undefined4 local_a0;

+  undefined2 local_9c;

+  uint uStack_98;

+  int iStack_94;

+  _CIT_INTERACTION_SUMMARY *local_90;

+  _CIT_INTERACTION_SUMMARY *local_88;

+  _GUID *local_80;

+  wchar_t *local_78;

+  wchar_t *local_70;

+  _GUID *local_68;

+  _CIT_INTERACTION_SUMMARY *local_60 [2];

+  undefined8 uStack_50;

+  longlong alStack_48 [2];

+  

+  lVar12 = *(longlong *)param_1;

+  if ((*(_CIT_INTERACTION_SUMMARY **)(lVar12 + 8) == param_1) &&

+     (plVar4 = *(longlong **)(param_1 + 8), (_CIT_INTERACTION_SUMMARY *)*plVar4 == param_1)) {

+    *plVar4 = lVar12;

+    p_Var1 = param_1 + 0x74;

+    *(longlong **)(lVar12 + 8) = plVar4;

+    p_Var2 = param_1 + 0x7c;

+    *(_CIT_INTERACTION_SUMMARY **)(param_1 + 8) = param_1;

+    pp_Var10 = local_60;

+    *(_CIT_INTERACTION_SUMMARY **)param_1 = param_1;

+    lVar12 = 2;

+    local_60[0] = p_Var1;

+    local_60[1] = p_Var2;

+    do {

+      if (((_CIT_AUDIO_STATS *)*pp_Var10)[3] != (_CIT_AUDIO_STATS)0x0) {

+        CitpAudioStatSnapDelta((_CIT_AUDIO_STATS *)*pp_Var10);

+      }

+      lVar7 = DAT_0;

+      p_Var14 = (_GUID *)0x0;

+      pp_Var10 = pp_Var10 + 1;

+      lVar12 = lVar12 + -1;

+    } while (lVar12 != 0);

+    if (((((DAT_1 & 0x10) == 0) || (*(short *)(param_1 + 0x72) != 4)) ||

+        (((*(short *)(param_1 + 0x6c) != 0 && (*(short *)(param_1 + 0x6e) != 0)) &&

+         (((((byte)param_1[100] & 1) != 0 ||

+           ((_EPROCESS *)**(longlong **)(*(longlong *)(param_1 + 0x18) + 8) == (_EPROCESS *)0x0)) ||

+          ((_EPROCESS *)**(longlong **)(*(longlong *)(param_1 + 0x18) + 8) != g_pepDwm)))))) &&

+       (((((DAT_1 & 0x20) == 0 ||

+          ((*(ushort *)(param_1 + 0x72) >> 3 & 1) == 0 ||

+           (*(ushort *)(param_1 + 0x72) & 0xfff3) != 0)) || (2 < *(ushort *)(param_1 + 0x6a))) ||

+        ((*(short *)(param_1 + 0x6c) != 0 && (*(short *)(param_1 + 0x6e) != 0)))))) {

+      p_Var16 = param_1 + 0x4c;

+      iVar3 = *(int *)(param_1 + 0x5c);

+      iVar19 = param_2 - *(int *)(DAT_0 + 0x120);

+      lVar12 = *(longlong *)(DAT_0 + 0x100) + 1;

+      p_Var15 = *(_GUID **)(DAT_0 + 0x118);

+      *(longlong *)(DAT_0 + 0x100) = lVar12;

+      if (((byte)param_1[100] & 1) == 0) {

+        local_a0 = *(undefined4 *)(param_1 + 0x38);

+        local_b8 = *(undefined8 *)(param_1 + 0x20);

+        uStack_b0 = *(undefined4 *)(param_1 + 0x28);

+        uStack_ac = *(undefined4 *)(param_1 + 0x2c);

+        local_a8 = *(undefined8 *)(param_1 + 0x30);

+        local_9c = *(undefined2 *)(param_1 + 0x3c);

+        iVar9 = OnlyCompositionMetrics(param_1,(_tlgWrapperBinary *)&local_b8);

+        if (((iVar9 == 0) && (5 < DAT_2)) &&

+           (cVar8 = _tlgKeywordOn(&DAT_2,0x800000000800), cVar8 != '\0')) {

+          local_78 = *(wchar_t **)(param_1 + 0x10);

+          local_cc = *(uint *)p_Var2 & 0xffffff;

+          local_60[0] = (_CIT_INTERACTION_SUMMARY *)0x2000000;

+          local_d0 = *(uint *)p_Var1 & 0xffffff;

+          local_104[0] = *(undefined2 *)(param_1 + 0x6a);

+          local_106 = *(undefined2 *)(param_1 + 0x70);

+          local_108 = *(undefined2 *)(param_1 + 0x6e);

+          local_10a = *(undefined2 *)(param_1 + 0x6c);

+          local_d4 = *(undefined4 *)(param_1 + 0x60);

+          local_10c = *(undefined2 *)(param_1 + 0x38);

+          local_10e = *(undefined2 *)(param_1 + 0x68);

+          local_d8 = *(undefined4 *)(lVar7 + 0x124);

+          local_dc = DAT_1;

+          local_e0 = DAT_3;

+          local_e4 = DAT_4;

+          local_e8 = DAT_5;

+          local_110 = *(undefined2 *)(param_1 + 0x46);

+          local_res8[0] = param_1[0x48];

+          local_112 = *(short *)(param_1 + 0x44);

+          local_114 = *(short *)(param_1 + 0x42);

+          local_116 = *(short *)(param_1 + 0x40);

+          local_118 = *(short *)(param_1 + 0x3e);

+          local_11a = *(undefined2 *)(param_1 + 0x2c);

+          local_11c = *(short *)(param_1 + 0x3c);

+          local_11e = local_11c + *(short *)(param_1 + 0x3a);

+          local_120 = *(undefined2 *)(param_1 + 0x36);

+          local_122 = *(short *)(param_1 + 0x34);

+          local_124 = local_122 + *(short *)(param_1 + 0x32);

+          local_126 = *(short *)(param_1 + 0x30);

+          local_128 = local_126 + *(short *)(param_1 + 0x2e);

+          local_12a = *(undefined2 *)(param_1 + 0x2a);

+          local_12c = *(undefined2 *)(param_1 + 0x28);

+          local_12e = *(undefined2 *)(param_1 + 0x26);

+          local_130 = *(undefined2 *)(param_1 + 0x24);

+          local_132 = *(undefined2 *)(param_1 + 0x22);

+          local_134 = *(undefined2 *)(param_1 + 0x20);

+          local_b8 = *(undefined8 *)(param_1 + 0xa0);

+          uStack_b0 = CONCAT22(uStack_b0._2_2_,*(undefined2 *)(param_1 + 0xa8));

+          local_136 = *(undefined2 *)(param_1 + 0x8c);

+          local_ec = *(undefined4 *)(param_1 + 0x98);

+          local_100 = *(undefined4 *)(param_1 + 0x90);

+          local_f0 = (uint)*(ushort *)(param_1 + 0x66);

+          local_f4 = *(undefined4 *)(param_1 + 0x84);

+          local_f8 = *(undefined4 *)(param_1 + 0x88);

+          local_res18[0] = (_tlgWrapperByVal<1>)0x1;

+          local_res20[0] = (_tlgWrapperByVal<1>)0x1;

+          local_fc = iVar19;

+          local_c8[0] = param_2 - iVar3;

+          local_90 = p_Var16;

+          local_88 = p_Var16;

+          local_80 = p_Var15;

+          local_70 = (wchar_t *)lVar12;

+          local_68 = (_GUID *)p_Var16;

+          _tlgWriteTemplate<long___cdecl(_tlgProvider_t_const*___ptr64,void_const*___ptr64,_GUID_const*___ptr64,_GUID_const*___ptr64,unsigned_int,_EVENT_DATA_DESCRIPTOR*___ptr64),&long___cdecl__tlgWriteTransfer_EtwWriteTransfer(struct__tlgProvider_t_const*___ptr64,void_const*___ptr64,struct__GUID_const*___ptr64,struct__GUID_const*___ptr64,unsigned_int,struct__EVENT_DATA_DESCRIPTOR*___ptr64),_GUID_const*___ptr64,_GUID_const*___ptr64>

+          ::

+          Write<_tlgWrapperByRef<16>,_tlgWrapperByVal<1>,_tlgWrapperByVal<1>,_tlgWrapperByRef<16>,_tlgWrapperByRef<16>,_tlgWrapperByVal<8>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<2>,_tlgWrapperBinary,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<1>,_tlgWrapperByVal<2>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<4>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<8>,_tlgWrapperByVal<4>,_tlgWrapperByVal<8>,_tlgWrapperByVal<8>_>

+                    ((_tlgProvider_t *)0xffffff,&DAT_6,p_Var14,p_Var15,

+                     (_tlgWrapperByRef<16> *)&local_90,local_res20,local_res18,

+                     (_tlgWrapperByRef<16> *)&local_68,(_tlgWrapperByRef<16> *)&local_88,

+                     (_tlgWrapperByVal<8> *)&local_80,(_tlgWrapperByVal<4> *)&local_fc,

+                     (_tlgWrapperByVal<4> *)&local_f8,(_tlgWrapperByVal<4> *)&local_f4,

+                     (_tlgWrapperByVal<4> *)&local_f0,(_tlgWrapperByVal<4> *)&local_100,

+                     (_tlgWrapperByVal<4> *)&local_ec,(_tlgWrapperByVal<2> *)&local_136,

+                     (_tlgWrapperBinary *)&local_b8,(_tlgWrapperByVal<2> *)&local_134,

+                     (_tlgWrapperByVal<2> *)&local_132,(_tlgWrapperByVal<2> *)&local_130,

+                     (_tlgWrapperByVal<2> *)&local_12e,(_tlgWrapperByVal<2> *)&local_12c,

+                     (_tlgWrapperByVal<2> *)&local_12a,(_tlgWrapperByVal<2> *)&local_128,

+                     (_tlgWrapperByVal<2> *)&local_126,(_tlgWrapperByVal<2> *)&local_124,

+                     (_tlgWrapperByVal<2> *)&local_122,(_tlgWrapperByVal<2> *)&local_120,

+                     (_tlgWrapperByVal<2> *)&local_11e,(_tlgWrapperByVal<2> *)&local_11c,

+                     (_tlgWrapperByVal<2> *)&local_11a,(_tlgWrapperByVal<2> *)&local_118,

+                     (_tlgWrapperByVal<2> *)&local_116,(_tlgWrapperByVal<2> *)&local_114,

+                     (_tlgWrapperByVal<2> *)&local_112,(_tlgWrapperByVal<1> *)local_res8,

+                     (_tlgWrapperByVal<2> *)&local_110,(_tlgWrapperByVal<4> *)&local_e8,

+                     (_tlgWrapperByVal<4> *)&local_e4,(_tlgWrapperByVal<4> *)&local_e0,

+                     (_tlgWrapperByVal<4> *)&local_dc,(_tlgWrapperByVal<4> *)&local_d8,

+                     (_tlgWrapperByVal<2> *)&local_10e,(_tlgWrapperByVal<2> *)&local_10c,

+                     (_tlgWrapperByVal<4> *)&local_d4,(_tlgWrapperByVal<2> *)&local_10a,

+                     (_tlgWrapperByVal<2> *)&local_108,(_tlgWrapperByVal<2> *)&local_106,

+                     (_tlgWrapperByVal<2> *)local_104,(_tlgWrapperByVal<4> *)&local_d0,

+                     (_tlgWrapperByVal<4> *)&local_cc,(_tlgWrapperByVal<8> *)&local_78,

+                     (_tlgWrapperByVal<4> *)local_c8,(_tlgWrapperByVal<8> *)&local_70,

+                     (_tlgWrapperByVal<8> *)local_60);

+        }

+      }

+      else {

+        lVar17 = *(longlong *)(param_1 + 0x18);

+        pwVar13 = L"";

+        p_Stack_c0 = (_CIT_INTERACTION_SUMMARY *)0x1c02805d8;

+        pwVar18 = L"";

+        pwVar11 = L"";

+        p_Var1 = *(_CIT_INTERACTION_SUMMARY **)(lVar17 + 0x28);

+        if (p_Var1 != (_CIT_INTERACTION_SUMMARY *)0x0) {

+          pwVar5 = *(wchar_t **)(lVar17 + 0x30);

+          if (*(int *)(lVar17 + 0x48) == 1) {

+            p_Stack_c0 = p_Var1;

+            if (pwVar5 != (wchar_t *)0x0) {

+              pwVar18 = pwVar5;

+            }

+          }

+          else {

+            pwVar13 = (wchar_t *)p_Var1;

+            if (pwVar5 != (wchar_t *)0x0) {

+              pwVar11 = pwVar5;

+            }

+          }

+        }

+        local_a0 = *(undefined4 *)(param_1 + 0x38);

+        local_b8 = *(undefined8 *)(param_1 + 0x20);

+        uStack_b0 = *(undefined4 *)(param_1 + 0x28);

+        uStack_ac = *(undefined4 *)(param_1 + 0x2c);

+        local_a8 = *(undefined8 *)(param_1 + 0x30);

+        local_9c = *(undefined2 *)(param_1 + 0x3c);

+        iVar9 = OnlyCompositionMetrics(param_1,(_tlgWrapperBinary *)&local_b8);

+        if (((iVar9 == 0) && (5 < DAT_2)) &&

+           (cVar8 = _tlgKeywordOn(&DAT_2,0x800000000800), cVar8 != '\0')) {

+          local_90 = *(_CIT_INTERACTION_SUMMARY **)(param_1 + 0x10);

+          uStack_98 = *(uint *)(param_1 + 0x7c) & 0xffffff;

+          uStack_50 = 0x2000000;

+          local_fc = *(uint *)(param_1 + 0x74) & 0xffffff;

+          local_136 = *(undefined2 *)(param_1 + 0x6a);

+          local_134 = *(undefined2 *)(param_1 + 0x70);

+          local_132 = *(undefined2 *)(param_1 + 0x6e);

+          local_130 = *(undefined2 *)(param_1 + 0x6c);

+          local_f8 = *(undefined4 *)(param_1 + 0x60);

+          local_12e = *(undefined2 *)(param_1 + 0x38);

+          local_12c = *(undefined2 *)(param_1 + 0x68);

+          local_f4 = *(undefined4 *)(lVar7 + 0x124);

+          local_f0 = DAT_1;

+          local_100 = DAT_3;

+          local_ec = DAT_4;

+          local_e8 = DAT_5;

+          local_12a = *(undefined2 *)(param_1 + 0x46);

+          local_res8[0] = param_1[0x48];

+          local_128 = *(short *)(param_1 + 0x44);

+          local_126 = *(short *)(param_1 + 0x42);

+          local_124 = *(short *)(param_1 + 0x40);

+          local_122 = *(short *)(param_1 + 0x3e);

+          local_120 = *(undefined2 *)(param_1 + 0x2c);

+          local_11e = *(short *)(param_1 + 0x3c);

+          local_11c = local_11e + *(short *)(param_1 + 0x3a);

+          local_11a = *(undefined2 *)(param_1 + 0x36);

+          local_118 = *(short *)(param_1 + 0x34);

+          local_116 = local_118 + *(short *)(param_1 + 0x32);

+          local_114 = *(short *)(param_1 + 0x30);

+          local_112 = local_114 + *(short *)(param_1 + 0x2e);

+          local_110 = *(undefined2 *)(param_1 + 0x2a);

+          local_10e = *(undefined2 *)(param_1 + 0x28);

+          local_10c = *(undefined2 *)(param_1 + 0x26);

+          local_10a = *(undefined2 *)(param_1 + 0x24);

+          local_108 = *(undefined2 *)(param_1 + 0x22);

+          local_106 = *(undefined2 *)(param_1 + 0x20);

+          local_b8 = *(undefined8 *)(param_1 + 0xa0);

+          uStack_b0 = CONCAT22(uStack_b0._2_2_,*(undefined2 *)(param_1 + 0xa8));

+          local_104[0] = *(undefined2 *)(param_1 + 0x8c);

+          local_e4 = *(undefined4 *)(param_1 + 0x98);

+          local_e0 = *(undefined4 *)(param_1 + 0x90);

+          local_dc = (uint)*(ushort *)(param_1 + 0x66);

+          local_d8 = *(undefined4 *)(param_1 + 0x84);

+          local_d4 = *(undefined4 *)(param_1 + 0x88);

+          local_88 = param_1 + 0x4c;

+          local_cc = *(undefined4 *)(lVar17 + 0x40);

+          local_c8[0] = *(undefined4 *)(lVar17 + 0x44);

+          local_res18[0] = (_tlgWrapperByVal<1>)0x1;

+          local_res20[0] = (_tlgWrapperByVal<1>)0x1;

+          a_Stack_138[0] = (_tlgWrapperByVal<1>)0x1;

+          local_d0 = iVar19;

+          iStack_94 = param_2 - iVar3;

+          local_80 = (_GUID *)local_88;

+          local_78 = pwVar11;

+          local_70 = pwVar18;

+          local_68 = p_Var15;

+          local_60[0] = (_CIT_INTERACTION_SUMMARY *)pwVar13;

+          alStack_48[0] = lVar12;

+          _tlgWriteTemplate<long___cdecl(_tlgProvider_t_const*___ptr64,void_const*___ptr64,_GUID_const*___ptr64,_GUID_const*___ptr64,unsigned_int,_EVENT_DATA_DESCRIPTOR*___ptr64),&long___cdecl__tlgWriteTransfer_EtwWriteTransfer(struct__tlgProvider_t_const*___ptr64,void_const*___ptr64,struct__GUID_const*___ptr64,struct__GUID_const*___ptr64,unsigned_int,struct__EVENT_DATA_DESCRIPTOR*___ptr64),_GUID_const*___ptr64,_GUID_const*___ptr64>

+          ::

+          Write<_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<1>,_tlgWrapperByVal<1>,_tlgWrapperByVal<1>,_tlgWrapperByRef<16>,_tlgWrapperByRef<16>,_tlgWrapperByVal<8>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<2>,_tlgWrapperBinary,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<1>,_tlgWrapperByVal<2>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<4>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<8>,_tlgWrapperByVal<4>,_tlgWrapperByVal<8>,_tlgWrapperByVal<8>_>

+                    ((_tlgProvider_t *)0xffffff,&DAT_7,p_Var14,p_Var15,

+                     (_tlgWrapSz<unsigned_short> *)local_60,

+                     (_tlgWrapSz<unsigned_short> *)&p_Stack_c0,

+                     (_tlgWrapSz<unsigned_short> *)&local_70,(_tlgWrapSz<unsigned_short> *)&local_78

+                     ,(_tlgWrapperByVal<4> *)local_c8,(_tlgWrapperByVal<4> *)&local_cc,a_Stack_138,

+                     local_res20,local_res18,(_tlgWrapperByRef<16> *)&local_80,

+                     (_tlgWrapperByRef<16> *)&local_88,(_tlgWrapperByVal<8> *)&local_68,

+                     (_tlgWrapperByVal<4> *)&local_d0,(_tlgWrapperByVal<4> *)&local_d4,

+                     (_tlgWrapperByVal<4> *)&local_d8,(_tlgWrapperByVal<4> *)&local_dc,

+                     (_tlgWrapperByVal<4> *)&local_e0,(_tlgWrapperByVal<4> *)&local_e4,

+                     (_tlgWrapperByVal<2> *)local_104,(_tlgWrapperBinary *)&local_b8,

+                     (_tlgWrapperByVal<2> *)&local_106,(_tlgWrapperByVal<2> *)&local_108,

+                     (_tlgWrapperByVal<2> *)&local_10a,(_tlgWrapperByVal<2> *)&local_10c,

+                     (_tlgWrapperByVal<2> *)&local_10e,(_tlgWrapperByVal<2> *)&local_110,

+                     (_tlgWrapperByVal<2> *)&local_112,(_tlgWrapperByVal<2> *)&local_114,

+                     (_tlgWrapperByVal<2> *)&local_116,(_tlgWrapperByVal<2> *)&local_118,

+                     (_tlgWrapperByVal<2> *)&local_11a,(_tlgWrapperByVal<2> *)&local_11c,

+                     (_tlgWrapperByVal<2> *)&local_11e,(_tlgWrapperByVal<2> *)&local_120,

+                     (_tlgWrapperByVal<2> *)&local_122,(_tlgWrapperByVal<2> *)&local_124,

+                     (_tlgWrapperByVal<2> *)&local_126,(_tlgWrapperByVal<2> *)&local_128,

+                     (_tlgWrapperByVal<1> *)local_res8,(_tlgWrapperByVal<2> *)&local_12a,

+                     (_tlgWrapperByVal<4> *)&local_e8,(_tlgWrapperByVal<4> *)&local_ec,

+                     (_tlgWrapperByVal<4> *)&local_100,(_tlgWrapperByVal<4> *)&local_f0,

+                     (_tlgWrapperByVal<4> *)&local_f4,(_tlgWrapperByVal<2> *)&local_12c,

+                     (_tlgWrapperByVal<2> *)&local_12e,(_tlgWrapperByVal<4> *)&local_f8,

+                     (_tlgWrapperByVal<2> *)&local_130,(_tlgWrapperByVal<2> *)&local_132,

+                     (_tlgWrapperByVal<2> *)&local_134,(_tlgWrapperByVal<2> *)&local_136,

+                     (_tlgWrapperByVal<4> *)&local_fc,(_tlgWrapperByVal<4> *)&uStack_98,

+                     (_tlgWrapperByVal<8> *)&local_90,(_tlgWrapperByVal<4> *)&iStack_94,

+                     (_tlgWrapperByVal<8> *)alStack_48,(_tlgWrapperByVal<8> *)&uStack_50);

+        }

+      }

+    }

+    return;

+  }

+  lVar12 = 3;

+  pcVar6 = (code *)swi(0x29);

+  (*pcVar6)();

+  if (in_R8W < *(ushort *)(lVar12 + 0x70)) {

+    return;

+  }

+  return;

+}

+
```

## `DirectComposition::CCompositionCubeMapMarshaler::SetBufferProperty`  (modified)

```diff
--- DirectComposition::CCompositionCubeMapMarshaler::SetBufferProperty
+++ DirectComposition::CCompositionCubeMapMarshaler::SetBufferProperty
@@ -1,2 +1,62 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CCompositionCubeMapMarshaler::SetBufferProperty : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl

+   DirectComposition::CCompositionCubeMapMarshaler::SetBufferProperty(class

+   DirectComposition::CApplicationChannel * __ptr64,unsigned int,void const * __ptr64,unsigned

+   __int64,bool * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CCompositionCubeMapMarshaler::SetBufferProperty

+          (CCompositionCubeMapMarshaler *this,CApplicationChannel *param_1,uint param_2,

+          void *param_3,__uint64 param_4,bool *param_5)

+

+{

+  undefined8 *puVar1;

+  int iVar2;

+  uint uVar3;

+  uint uVar4;

+  undefined1 auVar5 [16];

+  undefined8 uVar6;

+  void *pvVar7;

+  

+  *param_5 = false;

+  if (param_2 == 1) {

+    if ((param_4 == 0x10) && (*(uint *)(this + 0x48) < (uint)(*(int *)(this + 0x50) * 6))) {

+      *(uint *)(this + 0x10) = *(uint *)(this + 0x10) | 0x40;

+      uVar6 = *(undefined8 *)((longlong)param_3 + 8);

+      puVar1 = (undefined8 *)

+               (*(longlong *)(this + 0x38) + 8 + (ulonglong)*(uint *)(this + 0x48) * 0x18);

+      *puVar1 = *(undefined8 *)param_3;

+      puVar1[1] = uVar6;

+LAB_0:

+      *param_5 = true;

+      return 0;

+    }

+  }

+  else if ((param_2 == 2) && (param_4 == 0xc)) {

+    *(uint *)(this + 0x10) = *(uint *)(this + 0x10) | 0x20;

+    iVar2 = *(int *)((longlong)param_3 + 8);

+    uVar3 = *(uint *)param_3;

+    uVar4 = *(uint *)((longlong)param_3 + 4);

+    if ((uVar3 != 0) && ((uVar4 - 1 < 0x1f && ((uint)(1 << ((byte)uVar4 & 0x1f)) <= uVar3)))) {

+      auVar5._8_8_ = 0;

+      auVar5._0_8_ = (CLeakTrackingAllocator *)CONCAT44(0,uVar4);

+      if (SUB168(ZEXT816(0x90) * auVar5,8) != 0) {

+        return -0x3fffff6b;

+      }

+      pvVar7 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)CONCAT44(0,uVar4),0,

+                          SUB168(ZEXT816(0x90) * auVar5,0),0x6d634344);

+      if (pvVar7 == (void *)0x0) {

+        return -0x3fffffe9;

+      }

+      *(void **)(this + 0x38) = pvVar7;

+      *(uint *)(this + 0x4c) = uVar3;

+      *(uint *)(this + 0x40) = uVar4 * 6;

+      *(uint *)(this + 0x50) = uVar4;

+      this[0x54] = (CCompositionCubeMapMarshaler)(iVar2 != 0);

+      goto LAB_0;

+    }

+  }

+  return -0x3ffffff3;

+}

+
```

## `DirectComposition::CAnimationBinding::Create`  (modified)

```diff
--- DirectComposition::CAnimationBinding::Create
+++ DirectComposition::CAnimationBinding::Create
@@ -1,2 +1,30 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CAnimationBinding::Create : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static long __cdecl DirectComposition::CAnimationBinding::Create(class

+   DirectComposition::CResourceMarshaler * __ptr64,unsigned int,class

+   DirectComposition::CBaseAnimation * __ptr64,class DirectComposition::CAnimationBinding * __ptr64

+   * __ptr64) */

+

+long __cdecl

+DirectComposition::CAnimationBinding::Create

+          (CResourceMarshaler *param_1,uint param_2,CBaseAnimation *param_3,

+          CAnimationBinding **param_4)

+

+{

+  long lVar1;

+  CAnimationBinding *this;

+  undefined4 in_register_00000014;

+  

+  this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                   ((CLeakTrackingAllocator *)param_1,CONCAT44(in_register_00000014,param_2),0x30,

+                    0x62614344);

+  if (this == (CAnimationBinding *)0x0) {

+    lVar1 = -0x3fffffe9;

+  }

+  else {

+    Initialize(this,param_1,param_2,param_3);

+    lVar1 = 0;

+    *param_4 = this;

+  }

+  return lVar1;

+}

+
```

## `DirectComposition::CApplicationChannel::OpenInternalSharedWriteResource`  (modified)

```diff
--- DirectComposition::CApplicationChannel::OpenInternalSharedWriteResource
+++ DirectComposition::CApplicationChannel::OpenInternalSharedWriteResource
@@ -1,2 +1,49 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CApplicationChannel::OpenInternalSharedWriteResource : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl

+   DirectComposition::CApplicationChannel::OpenInternalSharedWriteResource(unsigned int,struct

+   DirectComposition::ResourceObject * __ptr64,class DirectComposition::CResourceMarshaler * __ptr64

+   * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CApplicationChannel::OpenInternalSharedWriteResource

+          (CApplicationChannel *this,uint param_1,ResourceObject *param_2,

+          CResourceMarshaler **param_3)

+

+{

+  long lVar1;

+  CSharedResourceMarshaler<DirectComposition::CVisualMarshaler,2> *this_00;

+  undefined4 in_register_00000014;

+  CResourceMarshaler *local_18 [2];

+  

+  local_18[0] = (CResourceMarshaler *)0x0;

+  if (param_1 == 0xc4) {

+    this_00 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                        ((CLeakTrackingAllocator *)this,CONCAT44(in_register_00000014,param_1),0x188

+                         ,0x76684344);

+    if (this_00 == (CSharedResourceMarshaler<DirectComposition::CVisualMarshaler,2> *)0x0) {

+      lVar1 = -0x3fffffe9;

+LAB_0:

+      *(undefined4 *)(param_2 + 0x3c) = 0;

+      ObfDereferenceObject(param_2);

+      return lVar1;

+    }

+    CSharedResourceMarshaler<DirectComposition::CVisualMarshaler,2>::

+    CSharedResourceMarshaler<DirectComposition::CVisualMarshaler,2>

+              (this_00,(CSharedSystemResource *)(param_2 + 0x18));

+    *(uint *)(this_00 + 0x10) = *(uint *)(this_00 + 0x10) | 2;

+    *(undefined ***)this_00 = &CHostVisualMarshaler::_vftable_;

+    *(uint *)(this_00 + 0x180) = *(uint *)(this_00 + 0x180) | 1;

+  }

+  else {

+    lVar1 = GeneratedCreateSharedWriteMarshaler

+                      (param_1,(CSharedSystemResource *)(param_2 + 0x18),local_18);

+    this_00 = (CSharedResourceMarshaler<DirectComposition::CVisualMarshaler,2> *)local_18[0];

+    if (lVar1 < 0) goto LAB_0;

+  }

+  lVar1 = InitializeAndRegisterInternalResource(this,(CResourceMarshaler *)this_00);

+  if (-1 < lVar1) {

+    *param_3 = (CResourceMarshaler *)this_00;

+  }

+  return lVar1;

+}

+
```

## `DirectComposition::CProcessData::OnProcessCreation`  (modified)

```diff
--- DirectComposition::CProcessData::OnProcessCreation
+++ DirectComposition::CProcessData::OnProcessCreation
@@ -1,2 +1,34 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CProcessData::OnProcessCreation : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static long __cdecl DirectComposition::CProcessData::OnProcessCreation(struct _W32PROCESS

+   * __ptr64) */

+

+long __cdecl DirectComposition::CProcessData::OnProcessCreation(_W32PROCESS *param_1)

+

+{

+  long lVar1;

+  CProcessData *this;

+  uint uVar2;

+  __uint64 in_RDX;

+  

+  this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                   ((CLeakTrackingAllocator *)param_1,in_RDX,0x48,0x64704344);

+  if (this == (CProcessData *)0x0) {

+    lVar1 = -0x3fffffe9;

+  }

+  else {

+    uVar2 = 0;

+    memset(this,0,0x48);

+    this[0x30] = (CProcessData)0x0;

+    lVar1 = CConnection::OnProcessCreation(this);

+    if (-1 < lVar1) {

+      lVar1 = CChannel::OnProcessCreation(this);

+    }

+    if (-1 < lVar1) goto LAB_0;

+    _scalar_deleting_destructor_(this,uVar2);

+  }

+  this = (CProcessData *)0x0;

+LAB_0:

+  *(CProcessData **)(param_1 + 0x100) = this;

+  return lVar1;

+}

+
```

## `DirectComposition::CCompositionMipmapSurfaceMarshaler::SetBufferProperty`  (modified)

```diff
--- DirectComposition::CCompositionMipmapSurfaceMarshaler::SetBufferProperty
+++ DirectComposition::CCompositionMipmapSurfaceMarshaler::SetBufferProperty
@@ -1,2 +1,79 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CCompositionMipmapSurfaceMarshaler::SetBufferProperty : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl

+   DirectComposition::CCompositionMipmapSurfaceMarshaler::SetBufferProperty(class

+   DirectComposition::CApplicationChannel * __ptr64,unsigned int,void const * __ptr64,unsigned

+   __int64,bool * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CCompositionMipmapSurfaceMarshaler::SetBufferProperty

+          (CCompositionMipmapSurfaceMarshaler *this,CApplicationChannel *param_1,uint param_2,

+          void *param_3,__uint64 param_4,bool *param_5)

+

+{

+  undefined8 *puVar1;

+  uint uVar2;

+  uint uVar3;

+  undefined4 uVar4;

+  undefined4 uVar5;

+  uint uVar6;

+  undefined8 uVar7;

+  uint uVar8;

+  void *pvVar9;

+  

+  *param_5 = false;

+  if (param_2 == 1) {

+    if ((param_4 == 0x10) && (*(uint *)(this + 0x40) < *(uint *)(this + 0x4c))) {

+      *(uint *)(this + 0x10) = *(uint *)(this + 0x10) | 0x40;

+      uVar7 = *(undefined8 *)((longlong)param_3 + 8);

+      puVar1 = (undefined8 *)

+               (*(longlong *)(this + 0x38) + 8 + (ulonglong)*(uint *)(this + 0x40) * 0x18);

+      *puVar1 = *(undefined8 *)param_3;

+      puVar1[1] = uVar7;

+      *param_5 = true;

+      *(uint *)(this + 0x58) = *(uint *)(this + 0x58) | 1 << (*(uint *)(this + 0x40) & 0x1f);

+      return 0;

+    }

+  }

+  else if ((param_2 == 2) && (param_4 == 0x14)) {

+    uVar2 = *(uint *)param_3;

+    uVar3 = *(uint *)((longlong)param_3 + 4);

+    uVar4 = *(undefined4 *)((longlong)param_3 + 0xc);

+    uVar5 = *(undefined4 *)((longlong)param_3 + 0x10);

+    if ((uVar2 != 0) &&

+       ((uVar3 != 0 && (uVar6 = *(uint *)((longlong)param_3 + 8), uVar6 - 1 < 0xf)))) {

+      uVar8 = uVar2;

+      if (uVar2 <= uVar3) {

+        uVar8 = uVar3;

+      }

+      if ((uint)(1 << ((byte)(uVar6 - 1) & 0x1f)) <= uVar8) {

+        if ((((*(int *)(this + 0x44) != 0) || (*(int *)(this + 0x48) != 0)) ||

+            (*(int *)(this + 0x4c) != 0)) ||

+           (((*(int *)(this + 0x54) != 0 || (*(int *)(this + 0x50) != 0)) ||

+            (*(longlong *)(this + 0x38) != 0)))) {

+          return -0x3ffffff3;

+        }

+        if (SUB168(ZEXT416(0x18) * ZEXT416(uVar6),8) != 0) {

+          return -0x3fffff6b;

+        }

+        pvVar9 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           ((CLeakTrackingAllocator *)(ulonglong)(uVar6 - 1),0,

+                            SUB168(ZEXT416(0x18) * ZEXT416(uVar6),0),0x6d6d4344);

+        if (pvVar9 == (void *)0x0) {

+          return -0x3fffffe9;

+        }

+        *(uint *)(this + 0x44) = uVar2;

+        *(uint *)(this + 0x48) = uVar3;

+        *(uint *)(this + 0x4c) = uVar6;

+        *(undefined4 *)(this + 0x54) = uVar5;

+        *(undefined4 *)(this + 0x50) = uVar4;

+        *(void **)(this + 0x38) = pvVar9;

+        *(undefined4 *)(this + 0x58) = 0;

+        *param_5 = true;

+        *(uint *)(this + 0x10) = *(uint *)(this + 0x10) | 0x20;

+        return 0;

+      }

+    }

+  }

+  return -0x3ffffff3;

+}

+
```

## `DirectComposition::CCrossChannelParentVisualMarshaler::Initialize`  (modified)

```diff
--- DirectComposition::CCrossChannelParentVisualMarshaler::Initialize
+++ DirectComposition::CCrossChannelParentVisualMarshaler::Initialize
@@ -1,2 +1,41 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CCrossChannelParentVisualMarshaler::Initialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl DirectComposition::CCrossChannelParentVisualMarshaler::Initialize(class

+   DirectComposition::CApplicationChannel * __ptr64,class ResourceHandle,unsigned int) __ptr64 */

+

+long __thiscall

+DirectComposition::CCrossChannelParentVisualMarshaler::Initialize

+          (CCrossChannelParentVisualMarshaler *this,__uint64 param_1,undefined4 param_3,

+          undefined4 param_4)

+

+{

+  long lVar1;

+  void *pvVar2;

+  CCrossChannelParentVisualMarshaler *this_00;

+  __uint64 _Var3;

+  

+  this_00 = this;

+  _Var3 = param_1;

+  lVar1 = CVisualMarshaler::Initialize((CVisualMarshaler *)this);

+  if (-1 < lVar1) {

+    *(uint *)(this + 0x10) = *(uint *)(this + 0x10) | 0x2000002;

+    lVar1 = 0;

+    *(undefined4 *)(this + 0x68) = 0x3f800000;

+    *(undefined4 *)(this + 0x6c) = 0x3f800000;

+    pvVar2 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)this_00,_Var3,0x10,0x76634344);

+    if (pvVar2 != (void *)0x0) {

+      *(undefined4 *)((longlong)pvVar2 + 8) = 0;

+    }

+    *(void **)(this + 0x178) = pvVar2;

+    if (pvVar2 == (void *)0x0) {

+      lVar1 = -0x3fffffe9;

+    }

+    else {

+      CConnection::ReferenceSystemResource(*(CConnection **)(param_1 + 0x28),param_3);

+      *(undefined4 *)(*(longlong *)(this + 0x178) + 0xc) = param_4;

+      *(undefined4 *)(*(longlong *)(this + 0x178) + 8) = param_3;

+    }

+  }

+  return lVar1;

+}

+
```

## `DirectComposition::CApplicationChannel::Create`  (modified)

```diff
--- DirectComposition::CApplicationChannel::Create
+++ DirectComposition::CApplicationChannel::Create
@@ -1,2 +1,58 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CApplicationChannel::Create : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static long __cdecl DirectComposition::CApplicationChannel::Create(unsigned int *

+   __ptr64,unsigned int * __ptr64,void * __ptr64 * __ptr64) */

+

+long __cdecl

+DirectComposition::CApplicationChannel::Create(uint *param_1,uint *param_2,void **param_3)

+

+{

+  undefined8 uVar1;

+  long lVar2;

+  CConnection *this;

+  CApplicationChannel *pCVar3;

+  CProcessData *pCVar4;

+  CLeakTrackingAllocator *this_00;

+  uint *puVar5;

+  

+  this_00 = (CLeakTrackingAllocator *)param_1;

+  puVar5 = param_2;

+  this = CConnection::GetDefaultConnection();

+  if (this == (CConnection *)0x0) {

+    return -0x3fffffde;

+  }

+  pCVar3 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                     (this_00,(__uint64)puVar5,0xaf0,0x63614344);

+  if ((pCVar3 == (CApplicationChannel *)0x0) ||

+     (pCVar3 = (CApplicationChannel *)CApplicationChannel(pCVar3,this,true,*param_2),

+     pCVar3 == (CApplicationChannel *)0x0)) {

+    lVar2 = -0x3fffffe9;

+  }

+  else {

+    lVar2 = Initialize(pCVar3,param_2,param_3);

+    if (-1 < lVar2) {

+      pCVar4 = CProcessData::Current();

+      if (pCVar4 == (CProcessData *)0x0) {

+        lVar2 = -0x3fffffff;

+      }

+      else {

+        uVar1 = *(undefined8 *)(pCVar4 + 8);

+        KeEnterCriticalRegion();

+        ExAcquireResourceExclusiveLite(uVar1,1);

+        lVar2 = CGenericTable<unsigned_int,DirectComposition::CChannel,1952662340,1>::InsertObject

+                          (*(CGenericTable<unsigned_int,DirectComposition::CChannel,1952662340,1> **

+                            )pCVar4,*(uint *)(pCVar3 + 0x1c),(CChannel *)pCVar3);

+        ExReleaseResourceLite(*(undefined8 *)(pCVar4 + 8));

+        KeLeaveCriticalRegion();

+        if (-1 < lVar2) {

+          *param_1 = *(uint *)(pCVar3 + 0x1c);

+          goto LAB_0;

+        }

+      }

+    }

+    CChannel::Release((CChannel *)pCVar3);

+  }

+LAB_0:

+  CConnection::Release(this);

+  return lVar2;

+}

+
```

## `DirectComposition::CExpressionMarshaler::SetReferenceArrayProperty`  (modified)

```diff
--- DirectComposition::CExpressionMarshaler::SetReferenceArrayProperty
+++ DirectComposition::CExpressionMarshaler::SetReferenceArrayProperty
@@ -1,25 +1,73 @@
 

-/* WARNING: Control flow encountered bad instruction data */

+/* public: virtual long __cdecl

+   DirectComposition::CExpressionMarshaler::SetReferenceArrayProperty(class

+   DirectComposition::CApplicationChannel * __ptr64,unsigned int,class

+   DirectComposition::CResourceMarshaler * __ptr64 * __ptr64,unsigned __int64,bool * __ptr64)

+   __ptr64 */

 

 long __thiscall

-PDEVOBJ::SetReferenceArrayProperty

+DirectComposition::CExpressionMarshaler::SetReferenceArrayProperty

           (CExpressionMarshaler *this,CApplicationChannel *param_1,uint param_2,

           CResourceMarshaler **param_3,__uint64 param_4,bool *param_5)

 

 {

-  byte *pbVar1;

-  undefined4 in_EAX;

-  int iVar2;

-  undefined4 in_register_00000004;

-  longlong unaff_RBX;

+  CLeakTrackingAllocator *this_00;

+  long lVar1;

+  void *pvVar2;

+  ulonglong uVar3;

+  ulonglong uVar4;

   

-  iVar2 = CONCAT31((int3)((uint)in_EAX >> 8),(byte)in_EAX + (0x76 < (byte)in_EAX) + 'l');

-  *(int *)CONCAT44(in_register_00000004,iVar2) =

-       *(int *)CONCAT44(in_register_00000004,iVar2) + iVar2;

-  *(char *)(unaff_RBX + 0x42892043) = *(char *)(unaff_RBX + 0x42892043) + (byte)this;

-  pbVar1 = (byte *)(CONCAT44(in_register_00000004,iVar2) + -0x75);

-  *pbVar1 = *pbVar1 | (byte)this;

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

+  uVar3 = 0;

+  lVar1 = 0;

+  *param_5 = false;

+  if ((param_2 == 0x14) && (param_3 != (CResourceMarshaler **)0x0)) {

+    if (*(longlong *)(this + 0xc0) == 0) {

+      pvVar2 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                         ((CLeakTrackingAllocator *)this,(__uint64)param_1,param_4 * 8,0x72774344);

+      *(void **)(this + 0xc0) = pvVar2;

+      if (pvVar2 == (void *)0x0) {

+        lVar1 = -0x3fffffe9;

+      }

+      else {

+        uVar4 = uVar3;

+        if (param_4 != 0) {

+          do {

+            lVar1 = CApplicationChannel::GetWeakReferenceBase

+                              (param_1,param_3[uVar4],

+                               (CWeakReferenceBase **)(*(longlong *)(this + 0xc0) + uVar4 * 8));

+            if (lVar1 < 0) {

+              if ((int)uVar4 != 0) {

+                do {

+                  CApplicationChannel::ReleaseWeakReference

+                            (param_1,*(CWeakReferenceBase **)(uVar3 + *(longlong *)(this + 0xc0)));

+                  uVar3 = uVar3 + 8;

+                  uVar4 = uVar4 - 1;

+                } while (uVar4 != 0);

+              }

+              if (*(void **)(this + 0xc0) != (void *)0x0) {

+                NSInstrumentation::CLeakTrackingAllocator::Free

+                          (gpLeakTrackingAllocator,*(void **)(this + 0xc0));

+              }

+              *(undefined8 *)(this + 0xc0) = 0;

+              return lVar1;

+            }

+            uVar4 = (ulonglong)((int)uVar4 + 1);

+          } while (uVar4 < param_4);

+        }

+        this_00 = gpLeakTrackingAllocator;

+        *(int *)(this + 200) = (int)param_4;

+        *param_5 = true;

+        *(uint *)(this + 0x10) = *(uint *)(this + 0x10) & 0xfffff7ff;

+        NSInstrumentation::CLeakTrackingAllocator::Free(this_00,param_3);

+      }

+    }

+    else {

+      lVar1 = -0x3fffffde;

+    }

+  }

+  else {

+    lVar1 = -0x3ffffff3;

+  }

+  return lVar1;

 }
```

## `CCursorClip::DeadzoneJumping::RefreshRegions`  (modified)

```diff
--- CCursorClip::DeadzoneJumping::RefreshRegions
+++ CCursorClip::DeadzoneJumping::RefreshRegions
@@ -1,2 +1,104 @@
-Failed to decompile win32kbase.sys - .ProgramDB CCursorClip::DeadzoneJumping::RefreshRegions : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

+/* public: bool __cdecl CCursorClip::DeadzoneJumping::RefreshRegions(void) __ptr64 */

+

+bool __thiscall CCursorClip::DeadzoneJumping::RefreshRegions(DeadzoneJumping *this)

+

+{

+  RegionInfo *pRVar1;

+  undefined4 uVar2;

+  undefined4 uVar3;

+  undefined4 uVar4;

+  long lVar5;

+  longlong lVar6;

+  CLeakTrackingAllocator *pCVar7;

+  undefined8 in_RDX;

+  __uint64 _Var8;

+  CLeakTrackingAllocator *pCVar9;

+  CLeakTrackingAllocator *pCVar10;

+  CLeakTrackingAllocator *pCVar11;

+  undefined8 *puVar12;

+  RegionInfo *pRVar13;

+  RegionPortal *local_res10;

+  CLockedInputSpaceRegion local_28 [8];

+  undefined8 *local_20;

+  

+  Cleanup(this);

+  CLockedInputSpaceRegion::CLockedInputSpaceRegion(local_28);

+  pCVar9 = (CLeakTrackingAllocator *)0x0;

+  lVar6 = *(longlong *)(gpInputConfig + 0x18);

+  if (lVar6 == 0) {

+    lVar6 = gpInputConfig + 0x20;

+  }

+  KeEnterCriticalRegion();

+  _Var8 = CONCAT71((int7)((ulonglong)in_RDX >> 8),1);

+  pCVar7 = _slock;

+  ExAcquireResourceSharedLite();

+  puVar12 = *(undefined8 **)(lVar6 + 0x5b0);

+  pCVar11 = pCVar9;

+  while( true ) {

+    pCVar10 = pCVar9;

+    if (puVar12 != (undefined8 *)(lVar6 + 0x5b0)) {

+      pCVar10 = (CLeakTrackingAllocator *)(puVar12 + 2);

+    }

+    if (pCVar10 == (CLeakTrackingAllocator *)0x0) break;

+    pCVar7 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       (pCVar7,_Var8,0x28,0x6a637a44);

+    if (pCVar7 == (CLeakTrackingAllocator *)0x0) {

+      Cleanup(this);

+      ExReleaseResourceLite(_slock);

+      KeLeaveCriticalRegion();

+LAB_0:

+      ExReleaseResourceLite(*local_20);

+      KeLeaveCriticalRegion();

+      return SUB81(pCVar9,0);

+    }

+    uVar2 = *(undefined4 *)(pCVar10 + 4);

+    uVar3 = *(undefined4 *)(pCVar10 + 8);

+    uVar4 = *(undefined4 *)(pCVar10 + 0xc);

+    *(undefined4 *)(pCVar7 + 8) = *(undefined4 *)pCVar10;

+    *(undefined4 *)(pCVar7 + 0xc) = uVar2;

+    *(undefined4 *)(pCVar7 + 0x10) = uVar3;

+    *(undefined4 *)(pCVar7 + 0x14) = uVar4;

+    *(undefined2 *)(pCVar7 + 0x20) = *(undefined2 *)(pCVar10 + 0x14);

+    *(undefined8 *)pCVar7 = 0;

+    *(undefined8 *)(pCVar7 + 0x18) = 0;

+    if (pCVar11 == (CLeakTrackingAllocator *)0x0) {

+      *(CLeakTrackingAllocator **)this = pCVar7;

+    }

+    else {

+      *(CLeakTrackingAllocator **)pCVar11 = pCVar7;

+    }

+    puVar12 = (undefined8 *)*puVar12;

+    pCVar11 = pCVar7;

+  }

+  pCVar7 = _slock;

+  ExReleaseResourceLite();

+  KeLeaveCriticalRegion();

+  pRVar1 = *(RegionInfo **)this;

+  pRVar13 = pRVar1;

+  for (; pRVar1 != (RegionInfo *)0x0; pRVar1 = *(RegionInfo **)pRVar1) {

+    if (pRVar13 != (RegionInfo *)0x0) {

+      do {

+        if (pRVar1 != pRVar13) {

+          local_res10 = (RegionPortal *)0x0;

+          lVar5 = CreatePortal((DeadzoneJumping *)pCVar7,pRVar1,pRVar13,&local_res10);

+          if (lVar5 < 0) {

+            Cleanup(this);

+            goto LAB_0;

+          }

+          pCVar7 = (CLeakTrackingAllocator *)local_res10;

+          if (local_res10 != (RegionPortal *)0x0) {

+            *(undefined8 *)local_res10 = *(undefined8 *)(pRVar1 + 0x18);

+            *(RegionPortal **)(pRVar1 + 0x18) = local_res10;

+          }

+        }

+        pRVar13 = *(RegionInfo **)pRVar13;

+      } while (pRVar13 != (RegionInfo *)0x0);

+      pRVar13 = *(RegionInfo **)this;

+    }

+  }

+  pCVar9 = (CLeakTrackingAllocator *)0x1;

+  goto LAB_0;

+}

+
```

## `DirectComposition::CApplicationChannel::CreateBatch`  (modified)

```diff
--- DirectComposition::CApplicationChannel::CreateBatch
+++ DirectComposition::CApplicationChannel::CreateBatch
@@ -1,2 +1,123 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CApplicationChannel::CreateBatch : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

+/* public: long __cdecl DirectComposition::CApplicationChannel::CreateBatch(class

+   DirectComposition::CBatch * __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CApplicationChannel::CreateBatch(CApplicationChannel *this,CBatch **param_1)

+

+{

+  CLeakTrackingAllocator *this_00;

+  bool bVar1;

+  int iVar2;

+  CBatch *pCVar3;

+  CApplicationChannel *this_01;

+  CBatch **ppCVar4;

+  long lVar5;

+  undefined8 uVar6;

+  undefined4 local_res8 [4];

+  __uint64 local_res18;

+  ulonglong local_res20;

+  undefined8 local_f8 [2];

+  ulonglong *local_e8;

+  undefined4 *local_e0;

+  CBackTrace local_d8 [160];

+  

+  lVar5 = 0;

+  this_01 = this;

+  ppCVar4 = param_1;

+  iVar2 = (**(code **)(*(longlong *)this + 8))();

+  this_00 = gpLeakTrackingAllocator;

+  if (iVar2 == 3) {

+    uVar6 = 0x104;

+    local_res20 = 0x104;

+    local_res8[0] = 0x61624344;

+    iVar2 = *(int *)gpLeakTrackingAllocator;

+    local_f8[0] = 0xa0;

+    if (iVar2 == 0) {

+      pCVar3 = (CBatch *)ExAllocatePool2(0x104,0xa0,0x61624344);

+      if (pCVar3 != (CBatch *)0x0) {

+        LOCK();

+        *(longlong *)(this_00 + 0x70) = *(longlong *)(this_00 + 0x70) + 1;

+        UNLOCK();

+      }

+    }

+    else {

+      if (iVar2 == 1) {

+        bVar1 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                          (gpLeakTrackingAllocator,0x61624344);

+        if (bVar1) {

+          pCVar3 = (CBatch *)ExAllocatePool2(local_res20 & 0xfffffffffffffffd,0xb0,local_res8[0]);

+          if (pCVar3 != (CBatch *)0x0) {

+            LOCK();

+            *(longlong *)(this_00 + 0x70) = *(longlong *)(this_00 + 0x70) + 1;

+            UNLOCK();

+            *(undefined8 *)pCVar3 = 0x61624344;

+            pCVar3 = pCVar3 + 0x10;

+            if (pCVar3 != (CBatch *)0x0) goto LAB_0;

+          }

+          NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

+                    (*(CPointerHashTable **)(this_00 + 8),(void *)0x61624344);

+          goto LAB_0;

+        }

+      }

+      else if (iVar2 == 2) {

+        local_res18 = 0;

+        bVar1 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                          (gpLeakTrackingAllocator,0x61624344,&local_res18);

+        if (!bVar1) {

+          local_e8 = &local_res20;

+          local_e0 = local_res8;

+          pCVar3 = (CBatch *)

+                   NSInstrumentation::CLeakTrackingAllocator::

+                   MakeUntrackedAllocation<<lambda_992394a475252bc644037de3157b7526>,unsigned___int64_&>

+                             (this_00,&local_e8,local_f8);

+          goto LAB_0;

+        }

+        pCVar3 = (CBatch *)ExAllocatePool2(uVar6,0xb0,0x61624344);

+        if (pCVar3 != (CBatch *)0x0) {

+          LOCK();

+          *(longlong *)(this_00 + 0x80) = *(longlong *)(this_00 + 0x80) + 1;

+          UNLOCK();

+          NSInstrumentation::CBackTrace::CBackTrace(local_d8);

+          if (((uint)pCVar3 & 0xfff) + 0x10 < 0x1000) {

+            bVar1 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

+                              (this_00,pCVar3,local_res18,local_d8);

+            if (bVar1) {

+              pCVar3 = pCVar3 + 0x10;

+              goto LAB_0;

+            }

+          }

+          else {

+            bVar1 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

+                              (this_00,pCVar3,local_res18,local_d8);

+            if (bVar1) goto LAB_0;

+          }

+          LOCK();

+          *(longlong *)(this_00 + 0x88) = *(longlong *)(this_00 + 0x88) + 1;

+          UNLOCK();

+          ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                    (pCVar3);

+        }

+      }

+      pCVar3 = (CBatch *)0x0;

+    }

+  }

+  else {

+    pCVar3 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                       ((CLeakTrackingAllocator *)this_01,(__uint64)ppCVar4,0xa0,0x61624344);

+  }

+LAB_0:

+  if (pCVar3 == (CBatch *)0x0) {

+    lVar5 = -0x3fffffe9;

+  }

+  else {

+    *(CApplicationChannel **)(pCVar3 + 8) = this;

+    *(undefined ***)(pCVar3 + 0x78) = &CBatch::CBatchListProxy::_vftable_;

+    *(undefined4 *)(pCVar3 + 0x14) = 7;

+    *(CBatch **)(pCVar3 + 0x80) = pCVar3;

+    *param_1 = pCVar3;

+  }

+  return lVar5;

+}

+
```

## `DirectComposition::CInteractionTrackerMarshaler::SetBufferProperty`  (modified)

```diff
--- DirectComposition::CInteractionTrackerMarshaler::SetBufferProperty
+++ DirectComposition::CInteractionTrackerMarshaler::SetBufferProperty
@@ -1,2 +1,177 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CInteractionTrackerMarshaler::SetBufferProperty : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl

+   DirectComposition::CInteractionTrackerMarshaler::SetBufferProperty(class

+   DirectComposition::CApplicationChannel * __ptr64,unsigned int,void const * __ptr64,unsigned

+   __int64,bool * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CInteractionTrackerMarshaler::SetBufferProperty

+          (CInteractionTrackerMarshaler *this,CApplicationChannel *param_1,uint param_2,

+          void *param_3,__uint64 param_4,bool *param_5)

+

+{

+  int iVar1;

+  undefined8 uVar2;

+  bool bVar3;

+  long lVar4;

+  InteractionTrackerMarshalerFlag IVar5;

+  CInteractionTrackerMarshaler *pCVar6;

+  void *pvVar7;

+  CLeakTrackingAllocator *this_00;

+  ulonglong uVar8;

+  longlong lVar9;

+  InertiaModifierAxis IVar10;

+  uint uVar11;

+  ulonglong uVar12;

+  uint uVar13;

+  longlong lVar14;

+  undefined8 local_38;

+  undefined4 local_30;

+  

+  lVar4 = 0;

+  *param_5 = false;

+  if (param_2 == 0x15) {

+    if ((param_3 == (void *)0x0) && (*(int *)(this + 0x168) != 0)) {

+      ReleaseManipulationReferences(this,param_1);

+LAB_0:

+      *param_5 = true;

+      *(uint *)(this + 0x10) = *(uint *)(this + 0x10) & 0xfffff7ff;

+      return lVar4;

+    }

+    if ((0x1000 < param_4) || ((param_4 & 7) != 0)) goto LAB_1;

+    pCVar6 = this;

+    ReleaseManipulationReferences(this,param_1);

+    uVar13 = (uint)(param_4 >> 3);

+    if (uVar13 == 0) goto LAB_0;

+    pvVar7 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuota

+                       ((CLeakTrackingAllocator *)pCVar6,0x104,(param_4 >> 3 & 0xffffffff) << 4,

+                        0x72694344);

+    *(void **)(this + 0x160) = pvVar7;

+    if (pvVar7 != (void *)0x0) {

+      uVar12 = 0;

+      do {

+        while( true ) {

+          uVar11 = (uint)uVar12;

+          if (uVar13 <= uVar11) goto LAB_2;

+          iVar1 = *(int *)((longlong)param_3 + uVar12 * 8);

+          uVar8 = (ulonglong)(iVar1 - 1);

+          if ((((iVar1 == 0) || (*(ulonglong *)(param_1 + 0x50) <= uVar8)) ||

+              (lVar14 = *(longlong *)

+                         (uVar8 * *(longlong *)(param_1 + 0x58) + *(longlong *)(param_1 + 0x38)),

+              lVar14 == 0)) ||

+             (bVar3 = CResourceMarshaler::IsDerivedResourceType

+                                (*(MIL_RESOURCE_TYPE *)(lVar14 + 0x24),0x69), !bVar3))

+          goto LAB_1;

+          lVar9 = uVar12 * 0x10;

+          *(longlong *)(lVar9 + *(longlong *)(this + 0x160)) = lVar14;

+          CResourceMarshaler::AddRef(*(CResourceMarshaler **)(lVar9 + *(longlong *)(this + 0x160)));

+          *(int *)(this + 0x168) = *(int *)(this + 0x168) + 1;

+          if (lVar4 < 0) break;

+          iVar1 = *(int *)((longlong)param_3 + uVar12 * 8 + 4);

+          if (iVar1 == 0) {

+            *(undefined8 *)(lVar9 + 8 + *(longlong *)(this + 0x160)) = 0;

+          }

+          else {

+            uVar8 = (ulonglong)(iVar1 - 1);

+            if (((*(ulonglong *)(param_1 + 0x50) <= uVar8) ||

+                (lVar14 = *(longlong *)

+                           (uVar8 * *(longlong *)(param_1 + 0x58) + *(longlong *)(param_1 + 0x38)),

+                lVar14 == 0)) ||

+               (bVar3 = CResourceMarshaler::IsDerivedResourceType

+                                  (*(MIL_RESOURCE_TYPE *)(lVar14 + 0x24),0x59), !bVar3)) {

+              lVar4 = -0x3ffffff3;

+              *(undefined8 *)(lVar9 + 8 + *(longlong *)(this + 0x160)) = 0;

+              break;

+            }

+            *(longlong *)(*(longlong *)(this + 0x160) + 8 + uVar12 * 0x10) = lVar14;

+            CResourceMarshaler::AddRef

+                      (*(CResourceMarshaler **)(*(longlong *)(this + 0x160) + 8 + uVar12 * 0x10));

+          }

+          uVar12 = (ulonglong)(uVar11 + 1);

+        }

+        uVar12 = (ulonglong)(uVar11 + 1);

+      } while (-1 < lVar4);

+LAB_2:

+      if (-1 < lVar4) goto LAB_0;

+      goto LAB_3;

+    }

+LAB_4:

+    lVar4 = -0x3fffffe9;

+  }

+  else {

+    if (param_2 == 0x29) {

+      if ((param_4 < 0x1001) && ((param_4 & 3) == 0)) {

+        IVar10 = 0;

+LAB_5:

+        uVar12 = (ulonglong)IVar10;

+        pvVar7 = *(void **)(this + uVar12 * 8 + 0x108);

+        this_00 = (CLeakTrackingAllocator *)this;

+        if (pvVar7 != (void *)0x0) {

+          this_00 = gpLeakTrackingAllocator;

+          NSInstrumentation::CLeakTrackingAllocator::Free(gpLeakTrackingAllocator,pvVar7);

+          *(undefined8 *)(this + uVar12 * 8 + 0x108) = 0;

+        }

+        pCVar6 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                           (this_00,(__uint64)pvVar7,param_4,0x72694344);

+        *(CInteractionTrackerMarshaler **)(this + uVar12 * 8 + 0x108) = pCVar6;

+        if (pCVar6 != (CInteractionTrackerMarshaler *)0x0) {

+          memcpy(pCVar6,param_3,param_4);

+          *(__uint64 *)(this + uVar12 * 8 + 0x128) = param_4;

+          IVar5 = GetInertiaModifierMarshalerFlag(pCVar6,IVar10);

+          *(InteractionTrackerMarshalerFlag *)(this + 0x10) = *(uint *)(this + 0x10) & ~IVar5;

+LAB_6:

+          *param_5 = true;

+          return lVar4;

+        }

+        goto LAB_4;

+      }

+    }

+    else if (param_2 == 0x2a) {

+      if ((param_4 < 0x1001) && ((param_4 & 3) == 0)) {

+        IVar10 = 1;

+        goto LAB_5;

+      }

+    }

+    else if (param_2 == 0x2b) {

+      if ((param_4 < 0x1001) && (IVar10 = 3, (param_4 & 3) == 0)) goto LAB_5;

+    }

+    else if (param_2 == 0x2c) {

+      if ((param_4 < 0x1001) && ((param_4 & 3) == 0)) {

+        IVar10 = 2;

+        goto LAB_5;

+      }

+    }

+    else if (param_2 == 0x41) {

+      if (param_4 == 0xc) {

+        local_38 = *(undefined8 *)param_3;

+        uVar13 = *(uint *)(this + 0x188);

+        local_30 = *(undefined4 *)((longlong)param_3 + 8);

+        lVar4 = CDCompDynamicArrayBase::Grow((CDCompDynamicArrayBase *)(this + 0x170),1,0x72694344);

+        if (lVar4 < 0) goto LAB_3;

+        memcpy((void *)((ulonglong)uVar13 * *(size_t *)(this + 400) + *(longlong *)(this + 0x170)),

+               &local_38,*(size_t *)(this + 400));

+        goto LAB_6;

+      }

+    }

+    else if ((param_2 == 0x42) && (param_4 == 0x24)) {

+      uVar2 = *(undefined8 *)((longlong)param_3 + 8);

+      *(undefined8 *)(this + 0x19c) = *(undefined8 *)param_3;

+      *(undefined8 *)(this + 0x1a4) = uVar2;

+      uVar2 = *(undefined8 *)((longlong)param_3 + 0x18);

+      *(undefined8 *)(this + 0x1ac) = *(undefined8 *)((longlong)param_3 + 0x10);

+      *(undefined8 *)(this + 0x1b4) = uVar2;

+      *(undefined4 *)(this + 0x1bc) = *(undefined4 *)((longlong)param_3 + 0x20);

+      *param_5 = true;

+      *(uint *)(this + 0x10) = *(uint *)(this + 0x10) & 0xfeffffff;

+      return 0;

+    }

+LAB_1:

+    lVar4 = -0x3ffffff3;

+  }

+LAB_3:

+  if (*(longlong *)(this + 0x160) != 0) {

+    ReleaseManipulationReferences(this,param_1);

+  }

+  return lVar4;

+}

+
```

## `DirectComposition::CCompClockInfo::Create`  (modified)

```diff
--- DirectComposition::CCompClockInfo::Create
+++ DirectComposition::CCompClockInfo::Create
@@ -1,2 +1,43 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CCompClockInfo::Create : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: static long __cdecl DirectComposition::CCompClockInfo::Create(struct

+   tagCOMPOSITION_TARGET_ID const & __ptr64,class DirectComposition::CCompClockInfo * __ptr64 *

+   __ptr64) */

+

+long __cdecl

+DirectComposition::CCompClockInfo::Create

+          (tagCOMPOSITION_TARGET_ID *param_1,CCompClockInfo **param_2)

+

+{

+  undefined4 uVar1;

+  undefined8 uVar2;

+  long lVar3;

+  CCompClockInfo *this;

+  uint uVar4;

+  

+  uVar4 = (uint)param_2;

+  *param_2 = (CCompClockInfo *)0x0;

+  this = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                   ((CLeakTrackingAllocator *)param_1,(__uint64)param_2,0x14,0x64704344);

+  if (this == (CCompClockInfo *)0x0) {

+    lVar3 = -0x3fffffe9;

+  }

+  else {

+    uVar1 = *(undefined4 *)(param_1 + 0x10);

+    uVar2 = *(undefined8 *)param_1;

+    *(undefined4 *)(this + 0x10) = 0;

+    *(undefined4 *)(this + 0xc) = uVar1;

+    *(undefined8 *)(this + 4) = uVar2;

+    lVar3 = Initialize(this);

+    if (lVar3 < 0) {

+      _scalar_deleting_destructor_(this,uVar4);

+    }

+    else {

+      LOCK();

+      *(int *)this = *(int *)this + 1;

+      UNLOCK();

+      *param_2 = this;

+    }

+  }

+  return lVar3;

+}

+
```

## `DirectComposition::CApplicationChannel::CompleteAddCrossChannelVisualChild`  (modified)

```diff
--- DirectComposition::CApplicationChannel::CompleteAddCrossChannelVisualChild
+++ DirectComposition::CApplicationChannel::CreateSystemVisualForCrossChannelVisualChild
@@ -1,107 +1,99 @@
 

 /* WARNING: Function: _guard_dispatch_icall replaced with injection: guard_dispatch_icall */

 /* public: long __cdecl

-   DirectComposition::CApplicationChannel::CompleteAddCrossChannelVisualChild(unsigned int,unsigned

-   int,unsigned int,class ResourceHandle,int,unsigned int,class ResourceHandle) __ptr64 */

+   DirectComposition::CApplicationChannel::CreateSystemVisualForCrossChannelVisualChild(unsigned

+   int,class ResourceHandle * __ptr64) __ptr64 */

 

 long __thiscall

-DirectComposition::CApplicationChannel::CompleteAddCrossChannelVisualChild

-          (CApplicationChannel *this,__uint64 param_2_00,undefined4 param_2,int param_3,int param_5,

-          undefined4 param_6,int param_7,uint param_8)

+DirectComposition::CApplicationChannel::CreateSystemVisualForCrossChannelVisualChild

+          (CApplicationChannel *this,uint param_1,ResourceHandle *param_2)

 

 {

-  longlong *plVar1;

-  CVisualMarshaler *pCVar2;

-  long lVar3;

-  CResourceMarshaler *pCVar4;

-  CCrossChannelParentVisualMarshaler *pCVar5;

+  CVisualMarshaler *pCVar1;

+  longlong *plVar2;

+  code *pcVar3;

+  int iVar4;

+  longlong lVar5;

   CVisualMarshaler *this_00;

-  ulonglong uVar6;

   CLeakTrackingAllocator *this_01;

-  CVisualMarshaler *pCVar7;

+  undefined4 in_register_00000014;

+  __uint64 _Var6;

+  undefined1 *puVar7;

   char local_res10 [8];

+  undefined1 auStack_58 [8];

+  undefined1 auStack_50 [24];

+  undefined8 local_38;

+  char *local_30;

   

-  pCVar5 = (CCrossChannelParentVisualMarshaler *)0x0;

-  this_00 = (CVisualMarshaler *)0x0;

-  pCVar7 = (CVisualMarshaler *)0x0;

-  uVar6 = (ulonglong)((int)param_2_00 - 1);

-  if ((((int)param_2_00 == 0) || (*(ulonglong *)(this + 0x50) <= uVar6)) ||

+  _Var6 = CONCAT44(in_register_00000014,param_1);

+  puVar7 = auStack_58;

+  if (((param_1 == 0) || (*(ulonglong *)(this + 0x50) <= (ulonglong)(param_1 - 1))) ||

      (this_01 = *(CLeakTrackingAllocator **)

-                 (uVar6 * *(longlong *)(this + 0x58) + *(longlong *)(this + 0x38)),

-     this_01 == (CLeakTrackingAllocator *)0x0)) {

-    lVar3 = -0x3fffffde;

-    goto LAB_0;

+                 ((ulonglong)(param_1 - 1) * *(longlong *)(this + 0x58) + *(longlong *)(this + 0x38)

+                 ), this_01 == (CLeakTrackingAllocator *)0x0)) {

+    iVar4 = -0x3fffffde;

   }

-  pCVar4 = (CResourceMarshaler *)(**(code **)(*(longlong *)this_01 + 0xa8))();

-  pCVar2 = this_00;

-  if (pCVar4 != (CResourceMarshaler *)0x0) {

-    pCVar2 = pCVar7;

-    if (param_7 == 0) {

-      param_2_00 = (__uint64)param_8;

-      if (param_8 != 0) {

-        this_01 = (CLeakTrackingAllocator *)pCVar4;

-        pCVar5 = CVisualMarshaler::GetCrossChannelVisualChildNoRef();

-LAB_1:

-        pCVar2 = this_00;

-        if (pCVar5 == (CCrossChannelParentVisualMarshaler *)0x0) goto LAB_2;

-      }

-      if (param_3 == 0) {

-        pCVar2 = this_00;

-        if (param_5 != 0) {

-          pCVar7 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

-                             (this_01,param_2_00,0x180,0x70784344);

-          if (pCVar7 == (CVisualMarshaler *)0x0) {

-            lVar3 = -0x3fffffe9;

-            goto LAB_0;

-          }

-          CVisualMarshaler::CVisualMarshaler(pCVar7);

-          *(undefined ***)pCVar7 = &CCrossChannelParentVisualMarshaler::_vftable_;

-          lVar3 = CCrossChannelParentVisualMarshaler::Initialize

-                            ((CCrossChannelParentVisualMarshaler *)pCVar7,this,param_5,param_2);

-          if ((lVar3 < 0) ||

-             (lVar3 = RegisterResource(this,(CResourceMarshaler *)pCVar7), lVar3 < 0)) {

-            (**(code **)(*(longlong *)pCVar7 + 0xc0))(pCVar7,this);

-            (**(code **)(*(longlong *)pCVar7 + 0x48))(pCVar7,1);

-            pCVar7 = this_00;

-          }

-          this_00 = pCVar7;

-          if (lVar3 < 0) goto LAB_0;

-          goto LAB_3;

-        }

+  else {

+    lVar5 = (**(code **)(*(longlong *)this_01 + 0xa8))();

+    if (lVar5 == 0) {

+      iVar4 = -0x3ffffff3;

+    }

+    else {

+      this_00 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                          (this_01,_Var6,400,0x63784344);

+      if (this_00 == (CVisualMarshaler *)0x0) {

+        iVar4 = -0x3fffffe9;

       }

       else {

-        pCVar2 = pCVar7;

-        if ((((ulonglong)(param_3 - 1) < *(ulonglong *)(this + 0x50)) &&

-            (plVar1 = *(longlong **)

-                       ((ulonglong)(param_3 - 1) * *(longlong *)(this + 0x58) +

-                       *(longlong *)(this + 0x38)), plVar1 != (longlong *)0x0)) &&

-           (this_00 = (CVisualMarshaler *)(**(code **)(*plVar1 + 0xa8))(), pCVar2 = this_00,

-           this_00 != (CVisualMarshaler *)0x0)) {

-          CResourceMarshaler::AddRef((CResourceMarshaler *)this_00);

-LAB_3:

-          local_res10[0] = '\0';

-          lVar3 = (**(code **)(*(longlong *)pCVar4 + 0x120))

-                            (pCVar4,this,this_00,param_6,pCVar5,local_res10);

-          if ((-1 < lVar3) && (local_res10[0] != '\0')) {

-            PutResourceOnUpdatedList(this,pCVar4);

+        CVisualMarshaler::CVisualMarshaler(this_00);

+        *(undefined ***)this_00 = &CCrossChannelChildVisualMarshaler::_vftable_;

+        pCVar1 = this_00 + 0x180;

+        *(undefined4 *)(this_00 + 0x178) = 0;

+        *(CVisualMarshaler **)(this_00 + 0x188) = pCVar1;

+        *(CVisualMarshaler **)pCVar1 = pCVar1;

+        iVar4 = CVisualMarshaler::Initialize(this_00);

+        if (-1 < iVar4) {

+          iVar4 = CConnection::CreateSystemResource

+                            (*(CConnection **)(this + 0x28),0xc4,(ResourceHandle *)(this_00 + 0x178)

+                            );

+        }

+        if ((-1 < iVar4) &&

+           (iVar4 = RegisterResource(this,(CResourceMarshaler *)this_00), -1 < iVar4)) {

+          plVar2 = *(longlong **)(this + 0x100);

+          pCVar1 = this_00 + 0x180;

+          if ((CApplicationChannel *)*plVar2 == this + 0xf8) {

+            *(longlong **)(this_00 + 0x188) = plVar2;

+            *(CApplicationChannel **)pCVar1 = this + 0xf8;

+            *plVar2 = (longlong)pCVar1;

+            local_30 = local_res10;

+            *(CVisualMarshaler **)(this + 0x100) = pCVar1;

+            local_38 = 0;

+            local_res10[0] = '\0';

+            iVar4 = (**(code **)(*(longlong *)this_00 + 0x120))(this_00,this,lVar5,0);

+            if (-1 < iVar4) {

+              if (local_res10[0] != '\0') {

+                PutResourceOnUpdatedList(this,(CResourceMarshaler *)this_00);

+              }

+              CConnection::ReferenceSystemResource

+                        (*(CConnection **)(this + 0x28),*(undefined4 *)(this_00 + 0x178));

+              *(undefined4 *)param_2 = *(undefined4 *)(this_00 + 0x178);

+              return iVar4;

+            }

           }

-          goto LAB_0;

+          else {

+            pcVar3 = (code *)swi(0x29);

+            (*pcVar3)(3);

+            puVar7 = auStack_50;

+          }

+          *(undefined8 *)(puVar7 + -8) = 0x1c0119506;

+          ReleaseResource(this,(CResourceMarshaler *)this_00);

+          return iVar4;

         }

+        (**(code **)(*(longlong *)this_00 + 0xc0))(this_00,this);

+        (**(code **)(*(longlong *)this_00 + 0x48))(this_00,1);

       }

     }

-    else if (((ulonglong)(param_7 - 1) < *(ulonglong *)(this + 0x50)) &&

-            (this_01 = *(CLeakTrackingAllocator **)

-                        ((ulonglong)(param_7 - 1) * *(longlong *)(this + 0x58) +

-                        *(longlong *)(this + 0x38)), this_01 != (CLeakTrackingAllocator *)0x0)) {

-      pCVar5 = (CCrossChannelParentVisualMarshaler *)(**(code **)(*(longlong *)this_01 + 0xa8))();

-      goto LAB_1;

-    }

   }

-LAB_2:

-  this_00 = pCVar2;

-  lVar3 = -0x3ffffff3;

-LAB_0:

-  ReleaseResource(this,(CResourceMarshaler *)this_00);

-  return lVar3;

+  return iVar4;

 }
```

## `DirectComposition::CEvent::Create`  (modified)

```diff
--- DirectComposition::CEvent::Create
+++ DirectComposition::CEvent::Create
@@ -1,2 +1,143 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CEvent::Create : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Type propagation algorithm not settling */

+/* public: static long __cdecl DirectComposition::CEvent::Create(enum _EVENT_TYPE,int,class

+   DirectComposition::CEvent * __ptr64 * __ptr64) */

+

+long __cdecl DirectComposition::CEvent::Create(_EVENT_TYPE param_1,int param_2,CEvent **param_3)

+

+{

+  CLeakTrackingAllocator *this;

+  bool bVar1;

+  int iVar2;

+  CEvent *this_00;

+  undefined4 in_register_0000000c;

+  uint uVar3;

+  undefined4 in_register_00000014;

+  undefined8 uVar4;

+  _EVENT_TYPE local_res8 [2];

+  void *local_res20;

+  ulonglong local_108 [2];

+  ulonglong *local_f8;

+  _EVENT_TYPE *local_f0;

+  undefined4 local_e8;

+  undefined4 local_e4;

+  undefined8 local_e0;

+  undefined8 local_d8;

+  undefined4 local_d0;

+  undefined4 local_cc;

+  undefined8 local_c8;

+  undefined8 uStack_c0;

+  CBackTrace local_b8 [160];

+  

+  this = gpLeakTrackingAllocator;

+  if (param_2 == 0) {

+    uVar4 = 0x104;

+    local_res8[0] = 0x76654344;

+    local_108[0] = 0x104;

+    local_108[1] = 0x10;

+    iVar2 = *(int *)gpLeakTrackingAllocator;

+    if (iVar2 == 0) {

+      this_00 = (CEvent *)ExAllocatePool2(0x104,0x10,0x76654344);

+      if (this_00 != (CEvent *)0x0) {

+        LOCK();

+        *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + 1;

+        UNLOCK();

+      }

+    }

+    else {

+      if (iVar2 == 1) {

+        bVar1 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

+                          (gpLeakTrackingAllocator,0x76654344);

+        if (bVar1) {

+          this_00 = (CEvent *)ExAllocatePool2(local_108[0] & 0xfffffffffffffffd,0x20,local_res8[0]);

+          if (this_00 != (CEvent *)0x0) {

+            LOCK();

+            *(longlong *)(this + 0x70) = *(longlong *)(this + 0x70) + 1;

+            UNLOCK();

+            *(undefined8 *)this_00 = 0x76654344;

+            this_00 = this_00 + 0x10;

+            if (this_00 != (CEvent *)0x0) goto LAB_0;

+          }

+          NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

+                    (*(CPointerHashTable **)(this + 8),(void *)0x76654344);

+          goto LAB_0;

+        }

+      }

+      else if (iVar2 == 2) {

+        local_res20 = (void *)0x0;

+        bVar1 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

+                          (gpLeakTrackingAllocator,0x76654344,(__uint64 *)&local_res20);

+        if (!bVar1) {

+          local_f8 = local_108;

+          local_f0 = local_res8;

+          this_00 = (CEvent *)

+                    NSInstrumentation::CLeakTrackingAllocator::

+                    MakeUntrackedAllocation<<lambda_992394a475252bc644037de3157b7526>,unsigned___int64_&>

+                              (this,&local_f8,local_108 + 1);

+          goto LAB_0;

+        }

+        this_00 = (CEvent *)ExAllocatePool2(uVar4,0x20,0x76654344);

+        if (this_00 != (CEvent *)0x0) {

+          LOCK();

+          *(longlong *)(this + 0x80) = *(longlong *)(this + 0x80) + 1;

+          UNLOCK();

+          NSInstrumentation::CBackTrace::CBackTrace(local_b8);

+          if (((uint)this_00 & 0xfff) + 0x10 < 0x1000) {

+            bVar1 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

+                              (this,this_00,(__uint64)local_res20,local_b8);

+            if (bVar1) {

+              this_00 = this_00 + 0x10;

+              goto LAB_0;

+            }

+          }

+          else {

+            bVar1 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

+                              (this,this_00,(__uint64)local_res20,local_b8);

+            if (bVar1) goto LAB_0;

+          }

+          LOCK();

+          *(longlong *)(this + 0x88) = *(longlong *)(this + 0x88) + 1;

+          UNLOCK();

+          ___<lambda_invoker_cdecl>_PEAX_<lambda_b53cdcd0d3c992df2e2d971420ae00a1>__CA_A_PPEAX_Z

+                    (this_00);

+        }

+      }

+      this_00 = (CEvent *)0x0;

+    }

+  }

+  else {

+    local_res8[0] = param_1;

+    this_00 = NSInstrumentation::CLeakTrackingAllocator::AllocateQuotaZInit

+                        ((CLeakTrackingAllocator *)CONCAT44(in_register_0000000c,param_1),

+                         CONCAT44(in_register_00000014,param_2),0x10,0x76654344);

+  }

+LAB_0:

+  if (this_00 == (CEvent *)0x0) {

+    iVar2 = -0x3fffffe9;

+  }

+  else {

+    local_res20 = (void *)0x0;

+    local_e4 = 0;

+    local_cc = 0;

+    local_e0 = 0;

+    local_d8 = 0;

+    uVar3 = 0x1f0003;

+    local_c8 = 0;

+    uStack_c0 = 0;

+    local_e8 = 0x30;

+    local_d0 = 0x200;

+    iVar2 = ZwCreateEvent(&local_res20,0x1f0003,&local_e8,0,0);

+    if (-1 < iVar2) {

+      iVar2 = Initialize(this_00,local_res20,true);

+      uVar3 = 0;

+      ObCloseHandle(local_res20);

+      if (-1 < iVar2) {

+        *param_3 = this_00;

+        return iVar2;

+      }

+    }

+    _scalar_deleting_destructor_(this_00,uVar3);

+  }

+  return iVar2;

+}

+
```

## `NTOSKRNL.EXE::RtlNtStatusToDosError`  (modified)

```diff
--- NTOSKRNL.EXE::RtlNtStatusToDosError calling
+++ NTOSKRNL.EXE::RtlNtStatusToDosError calling
@@ -4,6 +4,6 @@
-FUN_1c013dd5a
-FUN_1c013e75a
-FUN_1c0142cf8
-FUN_1c0143a10
-FUN_1c0149840
-FUN_1c01542a0
+FUN_1c013a334
+FUN_1c013ad34
+FUN_1c01412ee
+FUN_1c0142006
+FUN_1c0146478
+FUN_1c014ed88
@@ -48,3 +47,0 @@
-NtUserDisplayConfigGetDeviceInfo$filt$0
-NtUserDisplayConfigGetDeviceInfo$filt$1
-NtUserDisplayConfigGetDeviceInfo$filt$2
```

## `NTOSKRNL.EXE::EtwActivityIdControl`  (modified)

```diff
--- NTOSKRNL.EXE::EtwActivityIdControl calling
+++ NTOSKRNL.EXE::EtwActivityIdControl calling
@@ -22,4 +22,4 @@
-FUN_1c000ee3a
-FUN_1c005c4ae
-FUN_1c0102e3c
-FUN_1c0154d4a
+FUN_1c0086c9e
+FUN_1c009e982
+FUN_1c011d6f0
+FUN_1c014f2cc
@@ -74 +73,0 @@
-PrivateAPI::`anonymous_namespace'::EnterSharedCritInternal
```

## `NTOSKRNL.EXE::PsGetCurrentThreadWin32Thread`  (modified)

```diff
--- NTOSKRNL.EXE::PsGetCurrentThreadWin32Thread calling
+++ NTOSKRNL.EXE::PsGetCurrentThreadWin32Thread calling
@@ -35,7 +35,7 @@
-FUN_1c000eaea
-FUN_1c000ee3a
-FUN_1c005c4ae
-FUN_1c00ba6d4
-FUN_1c00baa55
-FUN_1c00f66a6
-FUN_1c0154d4a
+FUN_1c0086c9e
+FUN_1c009e982
+FUN_1c009fc6e
+FUN_1c00bcd64
+FUN_1c00bd0e5
+FUN_1c0117031
+FUN_1c014f2cc
@@ -131 +131 @@
-switchD_1c005a525::caseD_2
+switchD_1c0084d4e::caseD_2
```

## `NTOSKRNL.EXE::ExAllocatePool2`  (modified)

```diff
--- NTOSKRNL.EXE::ExAllocatePool2 calling
+++ NTOSKRNL.EXE::ExAllocatePool2 calling
@@ -15,2 +14,0 @@
-CCursorClip::DeadzoneJumping::CreatePortal
-CCursorClip::DeadzoneJumping::CreateRegionInfo
@@ -87 +84,0 @@
-CreateProfileUserName
@@ -97,3 +93,0 @@
-DirectComposition::CAnimationBinding::Create
-DirectComposition::CApplicationChannel::CompleteAddCrossChannelVisualChild
-DirectComposition::CApplicationChannel::Create
@@ -101,5 +94,0 @@
-DirectComposition::CApplicationChannel::CreatePrivateMarshaler
-DirectComposition::CApplicationChannel::CreateSystemVisualForCrossChannelVisualChild
-DirectComposition::CApplicationChannel::GetWeakReferenceBase
-DirectComposition::CApplicationChannel::OpenInternalSharedReadResource
-DirectComposition::CApplicationChannel::OpenInternalSharedWriteResource
@@ -109,4 +97,0 @@
-DirectComposition::CChannel::OnProcessCreation
-DirectComposition::CCompClockInfo::Create
-DirectComposition::CCompositionCubeMapMarshaler::SetBufferProperty
-DirectComposition::CCompositionMipmapSurfaceMarshaler::SetBufferProperty
@@ -114,4 +98,0 @@
-DirectComposition::CCrossChannelParentVisualMarshaler::Initialize
-DirectComposition::CDwmChannel::Create
-DirectComposition::CEffectBrushMarshaler::SetReferenceProperty
-DirectComposition::CEffectInputSet::Initialize
@@ -119,3 +99,0 @@
-DirectComposition::CEvent::Create
-DirectComposition::CEvent::Create
-DirectComposition::CExpressionMarshaler::SetReferenceArrayProperty
@@ -123 +100,0 @@
-DirectComposition::CInteractionTrackerMarshaler::SetBufferProperty
@@ -127 +103,0 @@
-DirectComposition::CProcessData::OnProcessCreation
@@ -130,2 +105,0 @@
-DirectComposition::GeneratedCreatePrivateMarshaler
-DirectComposition::GeneratedCreateSharedWriteMarshaler
@@ -148,10 +122,7 @@
-FUN_1c0001f80
-FUN_1c006b45c
-FUN_1c008d3e0
-FUN_1c009487d
-FUN_1c00bbff0
-FUN_1c00fc186
-FUN_1c00fc340
-FUN_1c0111ea7
-FUN_1c012a32f
-FastGetProfileKeysW
+FUN_1c0003730
+FUN_1c0010c7c
+FUN_1c003d1f0
+FUN_1c00452fd
+FUN_1c00f9585
+FUN_1c013d074
+FUN_1c013d22e
@@ -159 +129,0 @@
-FastGetProfileValue
@@ -163,2 +132,0 @@
-GetProcessAppContainerSid
-GetProcessCommandLine
@@ -180 +147,0 @@
-InitSystemThread
@@ -270 +236,0 @@
-NtConfigureInputSpace
@@ -277,4 +242,0 @@
-NtSetShellCursorState
-NtUserDisplayConfigGetDeviceInfo
-NtUserDisplayConfigSetDeviceInfo
-NtUserFunctionalizeDisplayConfig
@@ -282,14 +243,0 @@
-NtUserGetRawPointerDeviceData
-NtUserInitializeGenericHidInjection
-NtUserInitializeInputDeviceInjection
-NtUserInjectDeviceInput
-NtUserInjectKeyboardInput
-NtUserInjectMouseInput
-NtUserInjectPointerInput
-NtUserMapPointsByVisualIdentifier
-NtUserQueryDisplayConfig
-NtUserSetAdditionalForegroundBoostProcesses
-NtUserSetDisplayConfig
-NtUserSetFeatureReportResponse
-NtUserSetManipulationInputTarget
-NtUserSetSysColors
@@ -379 +326,0 @@
-SetHandleFlag
@@ -383 +329,0 @@
-SynthesizeMitTouchInput
@@ -401 +346,0 @@
-UserReAllocPoolWithQuota
@@ -434,2 +378,0 @@
-xxxCreateThreadInfo
-xxxDispBrokerSetDisplayConfig
```
