# CVE-2026-62711 — win32kbase.sys patch diff

`win32kbase.sys` 10.0.26100.8875 -> 10.0.26100.8972 (ghidriff).

## `CheckSystemParametersAccess`  (modified)

```diff
--- CheckSystemParametersAccess
+++ CheckSystemParametersAccess
@@ -1,25 +1,304 @@
 

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

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

-

-void CheckSystemParametersAccess(void)

+ulonglong CheckSystemParametersAccess(ulonglong param_1,char param_2)

 

 {

-  undefined8 *puVar1;

-  undefined1 in_AL;

-  longlong unaff_RBP;

-  undefined8 *unaff_RDI;

-  undefined8 unaff_R14;

+  bool bVar1;

+  longlong *plVar2;

+  ulonglong uVar3;

+  undefined7 uVar4;

+  undefined7 extraout_var;

+  uint uVar5;

+  int iVar6;

+  tagPROCESSINFO *this;

   

-  out(0xff,in_AL);

-  *(undefined8 *)(*(longlong *)(unaff_RBP + 0x50) + 0x18) = unaff_R14;

-  DomainShared<>::DomainExclusive<>::ObjectLock<tagObjLock>::~ObjectLock<tagObjLock>

-            ((ObjectLock<tagObjLock> *)&stack0x00000028);

-  while (unaff_RDI != (undefined8 *)0x0) {

-    puVar1 = (undefined8 *)unaff_RDI[1];

-    (**(code **)*unaff_RDI)(unaff_RDI);

-    unaff_RDI = puVar1;

+  plVar2 = (longlong *)PsGetCurrentProcessWin32Process();

+  this = (tagPROCESSINFO *)0x0;

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

+    this = (tagPROCESSINFO *)((ulonglong)plVar2 & -(ulonglong)(*plVar2 != 0));

   }

-  return;

+  uVar4 = 0;

+  uVar5 = (uint)param_1;

+  if (uVar5 < 0x6e) {

+    if (uVar5 == 0x6d) {

+LAB_0:

+      if (param_2 != '\0') goto LAB_1;

+    }

+    else {

+      if (0x37 < uVar5) {

+        if (uVar5 < 0x56) {

+          if (uVar5 != 0x55) {

+            if (uVar5 < 0x4a) {

+              if ((0x10 < uVar5 - 0x39) || ((0x15515U >> (uVar5 - 0x39 & 0x1f) & 1) == 0)) {

+LAB_2:

+                if (uVar5 < 0x45) {

+                  if (uVar5 - 0x34 < 0x11) {

+                    bVar1 = (uVar5 - 0x34 & 1) == 0;

+                    goto LAB_3;

+                  }

+                  goto LAB_1;

+                }

+LAB_4:

+                if (((uVar5 != 0x46) && (uVar5 != 0x48)) &&

+                   ((uVar5 != 0x4a && ((uVar5 != 0x4f && (uVar5 != 0x50)))))) {

+                  iVar6 = uVar5 - 0x53;

+                  goto LAB_5;

+                }

+                goto LAB_6;

+              }

+            }

+            else if ((((uVar5 != 0x4b) && (uVar5 != 0x4c)) && (uVar5 != 0x4d)) &&

+                    (((uVar5 != 0x4e && (uVar5 != 0x51)) && (uVar5 != 0x52)))) goto LAB_4;

+          }

+        }

+        else if (uVar5 < 0x61) {

+          if ((uVar5 != 0x60) &&

+             (((((uVar5 != 0x56 && (uVar5 != 0x57)) && (uVar5 != 0x58)) &&

+               ((uVar5 != 0x5a && (uVar5 != 0x5b)))) && (uVar5 != 0x5d)))) {

+LAB_7:

+            if (uVar5 < 0x5a) {

+              if (uVar5 == 0x59) goto LAB_6;

+              goto LAB_8;

+            }

+LAB_9:

+            if (uVar5 < 0x7d) {

+              if (uVar5 != 0x7c) goto LAB_10;

+            }

+            else {

+              if (0x8e < uVar5) {

+                iVar6 = uVar5 - 0x90;

+                bVar1 = iVar6 == 0;

+                goto LAB_11;

+              }

+              if (uVar5 != 0x8e) {

+                iVar6 = uVar5 - 0x7e;

+                bVar1 = iVar6 == 0;

+                goto LAB_12;

+              }

+            }

+            goto LAB_6;

+          }

+        }

+        else if ((10 < uVar5 - 0x61) || ((uVar5 - 0x61 & 1) != 0)) {

+LAB_10:

+          if (uVar5 < 0x6d) {

+            if ((((uVar5 == 0x6c) || (uVar5 == 0x5c)) || (uVar5 == 0x5e)) || (uVar5 == 0x5f))

+            goto LAB_6;

+            iVar6 = uVar5 - 0x62;

+            bVar1 = iVar6 == 0;

+            goto LAB_13;

+          }

+          if (((uVar5 == 0x6e) || (uVar5 == 0x70)) || ((uVar5 == 0x72 || (uVar5 == 0x73))))

+          goto LAB_6;

+          iVar6 = uVar5 - 0x74;

+          goto LAB_14;

+        }

+        goto LAB_0;

+      }

+      if (uVar5 == 0x37) goto LAB_0;

+      if (uVar5 < 0x1e) {

+        if (uVar5 != 0x1d) {

+          if (uVar5 < 0x14) {

+            if ((0xaa854U >> (uVar5 & 0x1f) & 1) == 0) {

+LAB_15:

+              if (((((uVar5 == 1) || (uVar5 == 3)) || (uVar5 == 5)) ||

+                  ((uVar5 == 10 || (uVar5 == 0xe)))) || ((uVar5 == 0x10 || (uVar5 == 0x12))))

+              goto LAB_6;

+              bVar1 = uVar5 == 0x16;

+              goto LAB_3;

+            }

+          }

+          else if (((((uVar5 != 0x14) && (uVar5 != 0x15)) && (uVar5 != 0x17)) &&

+                   ((uVar5 != 0x18 && (uVar5 != 0x1a)))) && (uVar5 != 0x1c)) goto LAB_16;

+        }

+        goto LAB_0;

+      }

+      if (0x2a < uVar5) {

+        if (((uVar5 != 0x2c) && (uVar5 != 0x2e)) &&

+           ((uVar5 != 0x2f && (((uVar5 != 0x31 && (uVar5 != 0x33)) && (uVar5 != 0x35)))))) {

+LAB_8:

+          if (0x32 < uVar5) goto LAB_2;

+          if (uVar5 == 0x32) goto LAB_6;

+LAB_16:

+          if (uVar5 < 0x1a) {

+            if (uVar5 != 0x19) goto LAB_15;

+          }

+          else if (uVar5 != 0x1b) goto LAB_17;

+          goto LAB_6;

+        }

+        goto LAB_0;

+      }

+      if (((uVar5 == 0x2a) || (uVar5 == 0x1e)) ||

+         ((uVar5 == 0x20 ||

+          ((((uVar5 == 0x21 || (uVar5 == 0x22)) || (uVar5 == 0x24)) || (uVar5 == 0x25))))))

+      goto LAB_0;

+LAB_17:

+      if ((uVar5 < 0x31) && ((0x12a4880000000U >> (param_1 & 0x3f) & 1) != 0)) goto LAB_6;

+LAB_1:

+      bVar1 = tagPROCESSINFO::CanPerformUIOperation(this,8);

+      uVar4 = extraout_var;

+      if (bVar1) goto LAB_6;

+    }

+    uVar3 = EtwTraceUIPISystemError(this,0,1);

+    uVar3 = uVar3 & 0xffffffffffffff00;

+  }

+  else {

+    if (uVar5 < 0x1018) {

+      if (uVar5 != 0x1017) {

+        if (0xad < uVar5) {

+          if (0x1007 < uVar5) {

+            if ((((uVar5 == 0x1009) || (uVar5 == 0x100b)) || (uVar5 == 0x100d)) ||

+               (((uVar5 == 0x100f || (uVar5 == 0x1013)) || (uVar5 == 0x1015)))) goto LAB_0;

+LAB_18:

+            uVar4 = 0;

+            if (uVar5 < 0x1017) {

+              if (uVar5 != 0x1016) goto LAB_19;

+              goto LAB_6;

+            }

+            iVar6 = uVar5 - 0x1018;

+            bVar1 = iVar6 == 0;

+            goto LAB_12;

+          }

+          if (((uVar5 == 0x1007) || (uVar5 == 0xaf)) ||

+             ((uVar4 = 0, uVar5 == 0xb1 ||

+              ((((uVar5 == 0xb3 || (uVar5 == 0x1001)) || (uVar5 == 0x1003)) || (uVar5 == 0x1005)))))

+             ) goto LAB_0;

+          if (uVar5 < 0x1001) {

+            if (uVar5 != 0x1000) goto LAB_20;

+          }

+          else {

+LAB_19:

+            uVar4 = 0;

+            if (((((uVar5 != 0x1002) && (uVar5 != 0x1004)) && (uVar5 != 0x1006)) &&

+                ((uVar5 != 0x1008 && (uVar5 != 0x100a)))) &&

+               ((uVar5 != 0x100c && (uVar5 != 0x100e)))) {

+              iVar6 = uVar5 - 0x1012;

+              goto LAB_21;

+            }

+          }

+          goto LAB_6;

+        }

+        if (uVar5 != 0xad) {

+          if (uVar5 < 0x9a) {

+            if (((((uVar5 != 0x99) && (uVar5 != 0x6f)) &&

+                 ((uVar5 != 0x71 && ((uVar5 != 0x75 && (uVar5 != 0x77)))))) && (uVar5 != 0x93)) &&

+               ((uVar5 != 0x95 && (uVar5 != 0x97)))) goto LAB_9;

+          }

+          else if (((uVar5 != 0x9b) && (uVar5 != 0xa1)) &&

+                  (((uVar5 != 0xa3 && ((uVar5 != 0xa6 && (uVar5 != 0xa9)))) && (uVar5 != 0xab)))) {

+            if (uVar5 < 0x9f) {

+              if (uVar5 != 0x9e) goto LAB_7;

+              goto LAB_6;

+            }

+LAB_20:

+            uVar4 = 0;

+            if (0xaa < uVar5) {

+              iVar6 = uVar5 - 0xac;

+              bVar1 = iVar6 == 0;

+              goto LAB_13;

+            }

+            if ((((uVar5 == 0xaa) || (uVar5 == 0xa0)) || (uVar5 == 0xa2)) || (uVar5 == 0xa5))

+            goto LAB_6;

+            iVar6 = uVar5 - 0xa7;

+LAB_5:

+            uVar4 = 0;

+            if (iVar6 == 0) goto LAB_6;

+            bVar1 = iVar6 == 1;

+            goto LAB_3;

+          }

+        }

+      }

+      goto LAB_0;

+    }

+    if (0x2005 < uVar5) {

+      if (uVar5 < 0x201c) {

+        if (((uVar5 != 0x201b) && (uVar5 != 0x2009)) &&

+           ((uVar5 != 0x200f &&

+            ((((uVar4 = 0, uVar5 != 0x2011 && (uVar5 != 0x2015)) && (uVar5 != 0x2017)) &&

+             (uVar5 != 0x2019)))))) {

+          if (uVar5 < 0x2015) {

+            if (uVar5 == 0x2014) goto LAB_6;

+            goto LAB_22;

+          }

+LAB_23:

+          uVar4 = 0;

+          if (0x2028 < uVar5) {

+            iVar6 = uVar5 - 0x202a;

+            bVar1 = iVar6 == 0;

+            goto LAB_12;

+          }

+          if (uVar5 == 0x2028) goto LAB_6;

+          iVar6 = uVar5 - 0x2016;

+          goto LAB_24;

+        }

+      }

+      else if ((((uVar5 != 0x201d) && (uVar5 != 0x2031)) && (uVar5 != 0x2033)) &&

+              (((uVar5 != 0x2035 && (uVar5 != 0x2037)) && (uVar5 != 0x2039)))) goto LAB_23;

+      goto LAB_0;

+    }

+    if (uVar5 == 0x2005) goto LAB_0;

+    if (uVar5 < 0x104c) {

+      if ((((uVar5 == 0x104b) || (uVar5 == 0x1019)) || (uVar5 == 0x101d)) ||

+         (((uVar4 = 0, uVar5 == 0x101f || (uVar5 == 0x1027)) ||

+          ((uVar5 == 0x1041 || ((uVar5 == 0x1043 || (uVar5 == 0x1049)))))))) goto LAB_0;

+      if (uVar5 < 0x103f) {

+        if (uVar5 != 0x103e) goto LAB_18;

+        goto LAB_6;

+      }

+LAB_25:

+      uVar4 = 0;

+      if ((uVar5 == 0x1040) || (uVar5 == 0x1042)) goto LAB_6;

+      iVar6 = uVar5 - 0x1048;

+      bVar1 = iVar6 == 0;

+    }

+    else {

+      if (((uVar5 == 0x104d) || (uVar5 == 0x104f)) ||

+         (((uVar5 == 0x1051 || ((uVar5 == 0x1053 || (uVar5 == 0x2001)))) || (uVar5 == 0x2003))))

+      goto LAB_0;

+LAB_22:

+      uVar4 = 0;

+      if (uVar5 < 0x2001) {

+        if (uVar5 == 0x2000) goto LAB_6;

+        goto LAB_25;

+      }

+      iVar6 = uVar5 - 0x2002;

+LAB_24:

+      uVar4 = 0;

+      if (iVar6 == 0) goto LAB_6;

+      iVar6 = iVar6 + -2;

+      bVar1 = iVar6 == 0;

+LAB_12:

+      uVar4 = 0;

+      if (bVar1) goto LAB_6;

+      iVar6 = iVar6 + -2;

+      bVar1 = iVar6 == 0;

+    }

+LAB_11:

+    uVar4 = 0;

+    if ((!bVar1) && (iVar6 != 2)) {

+      iVar6 = iVar6 + -4;

+      bVar1 = iVar6 == 0;

+LAB_13:

+      uVar4 = 0;

+      if (!bVar1) {

+        iVar6 = iVar6 + -2;

+LAB_14:

+        uVar4 = 0;

+        if ((iVar6 != 0) && (iVar6 != 2)) {

+          iVar6 = iVar6 + -4;

+LAB_21:

+          uVar4 = 0;

+          if (iVar6 != 0) {

+            bVar1 = iVar6 == 2;

+LAB_3:

+            uVar4 = 0;

+            if (!bVar1) goto LAB_1;

+          }

+        }

+      }

+    }

+LAB_6:

+    uVar3 = CONCAT71(uVar4,1);

+  }

+  return uVar3;

 }
```

## `ApiSetpGetContractKeyInfo`  (modified)

```diff
--- ApiSetpGetContractKeyInfo
+++ ApiSetpGetContractKeyInfo
@@ -1,47 +1,160 @@
 

-ulonglong ApiSetpGetContractKeyInfo(undefined8 param_1,longlong param_2,longlong param_3)

+ulonglong ApiSetpGetContractKeyInfo

+                    (ulonglong *param_1,ushort param_2,undefined8 param_3,undefined8 *param_4)

 

 {

-  uint uVar1;

-  uint uVar3;

-  ushort *puVar4;

-  ushort *in_R10;

-  longlong in_R11;

-  longlong lVar5;

-  undefined1 in_ZF;

-  ulonglong uVar2;

+  char *pcVar1;

+  byte bVar2;

+  char cVar3;

+  bool bVar4;

+  bool bVar5;

+  bool bVar6;

+  bool bVar7;

+  bool bVar8;

+  bool bVar9;

+  char *pcVar10;

+  bool bVar11;

+  ulonglong uVar12;

+  ulonglong uVar13;

+  ushort uVar14;

+  short sVar15;

+  ulonglong uVar16;

+  uint uVar17;

+  uint uVar18;

+  byte *pbVar19;

   

-  uVar2 = 0;

-  if ((uint)(in_R10 == (ushort *)0x0) == (uint)CONCAT71((int7)((ulonglong)param_1 >> 8),in_ZF)) {

-    puVar4 = *(ushort **)(param_3 + 8);

-    uVar2 = 0;

-    if ((puVar4 == (ushort *)0x0) == (*(longlong *)(param_2 + 8) == 0)) {

-      if (in_R10 != (ushort *)0x0) {

-        lVar5 = in_R11 - (longlong)in_R10;

-        do {

-          uVar3 = (uint)*(ushort *)((longlong)in_R10 + lVar5);

-          uVar1 = *in_R10 - uVar3;

-          uVar2 = (ulonglong)uVar1;

-          if (uVar1 != 0) break;

-          in_R10 = in_R10 + 1;

-        } while (uVar3 != 0);

-        if (uVar1 != 0) goto LAB_0;

+  uVar16 = (ulonglong)param_2;

+  uVar12 = 0;

+  *param_4 = 0;

+  param_4[1] = 0;

+  param_4[2] = 0;

+  param_4[3] = 0;

+  param_4[4] = 0;

+  if (((param_2 < 5) || (uVar12 = (ulonglong)(ushort)(param_2 * 2), (ushort)(param_2 * 2) < 8)) ||

+     ((uVar12 = *param_1 & 0xffffffdfffdfffdf, uVar12 != 0x2d004900500041 &&

+      (uVar12 != 0x2d005400580045)))) {

+LAB_0:

+    return uVar12 & 0xffffffffffffff00;

+  }

+  *param_4 = param_1;

+  *(ushort *)(param_4 + 1) = param_2;

+  *(undefined1 *)((longlong)param_4 + 10) = 1;

+  pbVar19 = (byte *)((longlong)param_1 + uVar16 * 2);

+  bVar8 = false;

+  bVar9 = false;

+  uVar18 = 0;

+  uVar17 = 1;

+  uVar13 = (ulonglong)param_2;

+  bVar4 = false;

+  bVar7 = true;

+  do {

+    uVar12 = 0xffff;

+    pbVar19 = pbVar19 + -2;

+    uVar14 = (short)uVar13 - 1;

+    uVar13 = (ulonglong)uVar14;

+    bVar2 = *pbVar19;

+    bVar5 = true;

+    bVar6 = false;

+    sVar15 = (short)uVar16;

+    bVar11 = bVar6;

+    if (bVar2 == 0x2d) {

+      if (bVar4) {

+        if (!bVar9) {

+          *(short *)(param_4 + 3) = (short)uVar18;

+          bVar9 = true;

+          uVar18 = 0;

+          *(undefined4 *)((longlong)param_4 + 0xc) = 3;

+          *(ushort *)((longlong)param_4 + 0x12) = uVar14;

+          bVar6 = bVar5;

+          goto LAB_1;

+        }

       }

-      if (puVar4 != (ushort *)0x0) {

-        lVar5 = *(longlong *)(param_2 + 8) - (longlong)puVar4;

-        do {

-          uVar3 = (uint)*(ushort *)((longlong)puVar4 + lVar5);

-          uVar1 = *puVar4 - uVar3;

-          uVar2 = (ulonglong)uVar1;

-          if (uVar1 != 0) break;

-          puVar4 = puVar4 + 1;

-        } while (uVar3 != 0);

-        if (uVar1 != 0) goto LAB_0;

+      else {

+        *(undefined4 *)((longlong)param_4 + 0xc) = 1;

+        *(short *)((longlong)param_4 + 0x12) = sVar15;

+        uVar13 = uVar16;

       }

-      return CONCAT71((int7)(uVar2 >> 8),1);

+LAB_2:

+      uVar14 = (ushort)uVar13;

+      *(ushort *)((longlong)param_4 + 0x14) = uVar14;

+      if ((((7 < uVar14) && (((char)param_1[1] + 0xb3U & 0xdf) == 0)) &&

+          ((*(char *)((longlong)param_1 + 10) + 0xadU & 0xdf) == 0)) &&

+         (*(char *)((longlong)param_1 + 0xc) == '-')) {

+        *(undefined4 *)((longlong)param_4 + 0x1a) = 0x60004;

+      }

+      bVar2 = 0;

+      pcVar10 = (char *)(uVar13 * 2 + (longlong)param_1);

+      uVar16 = uVar13;

+      break;

     }

+    if (bVar2 == 0x7e) {

+      if (!bVar9) {

+        *(short *)((longlong)param_4 + 0x12) = sVar15;

+        *(undefined4 *)((longlong)param_4 + 0xc) = 2;

+        *(ushort *)((longlong)param_4 + 0x16) = (sVar15 - uVar14) + -1;

+        goto LAB_2;

+      }

+      goto LAB_0;

+    }

+    if (bVar2 == 0x2e) {

+      if ((bVar9) || (bVar8)) goto LAB_0;

+      bVar8 = true;

+      uVar16 = uVar13;

+      bVar6 = true;

+    }

+    else {

+      bVar11 = false;

+      if ((byte)(bVar2 - 0x30) < 10) {

+        if (bVar7) {

+          uVar18 = bVar2 - 0x30;

+          uVar17 = 10;

+          bVar11 = bVar5;

+        }

+        else {

+          bVar11 = bVar4;

+          if (bVar4) {

+            uVar12 = (ulonglong)(uVar18 & 0xffff);

+            uVar18 = (bVar2 - 0x30) * uVar17 + (uVar18 & 0xffff);

+            if (0xffff < uVar18) goto LAB_0;

+            uVar18 = uVar18 & 0xffff;

+            uVar17 = uVar17 * 10;

+            if (0xffff < uVar17) {

+              uVar17 = 0x10000;

+            }

+          }

+        }

+      }

+    }

+LAB_1:

+    bVar4 = bVar11;

+    uVar12 = 0xffff;

+    bVar7 = bVar6;

+    if (uVar14 < 2) goto LAB_0;

+  } while( true );

+joined_r0x00014023c765:

+  if (uVar14 < 5) {

+LAB_3:

+    return CONCAT71((int7)(uVar13 >> 8),1);

   }

-LAB_0:

-  return uVar2 & 0xffffffffffffff00;

+  pcVar1 = pcVar10 + -2;

+  sVar15 = (short)uVar16;

+  uVar14 = sVar15 - 1;

+  uVar16 = (ulonglong)uVar14;

+  cVar3 = *pcVar1;

+  uVar13 = CONCAT71((int7)(uVar13 >> 8),cVar3 - 0x30U);

+  if (9 < (byte)(cVar3 - 0x30U)) {

+    if (((bVar6) && ((cVar3 + 0xb4U & 0xdf) == 0)) && (sVar15 = sVar15 + -2, pcVar10[-4] == '-')) {

+      *(short *)((longlong)param_4 + 0x1e) = sVar15;

+      *(ushort *)(param_4 + 4) = bVar2 + 1 + sVar15;

+    }

+    goto LAB_3;

+  }

+  bVar4 = !bVar6;

+  pcVar10 = pcVar1;

+  bVar6 = bVar5;

+  if ((bVar4) && (cVar3 == '1')) {

+    bVar2 = 1;

+  }

+  goto joined_r0x00014023c765;

 }
```

## `Win32AllocPoolWithQuotaZInitImpl`  (modified)

```diff
--- Win32AllocPoolWithQuotaZInitImpl
+++ RGNMEMOBJ::AllocateRegion
@@ -1,99 +1,53 @@
 

-/* void * __ptr64 __cdecl Win32AllocPoolWithQuotaZInitImpl(unsigned __int64,unsigned

-   __int64,unsigned long) */

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

+/* public: static class REGION * __ptr64 __cdecl RGNMEMOBJ::AllocateRegion(class

+   RustAutoHotpatchLockSH const & __ptr64,unsigned long) */

 

-void * __cdecl Win32AllocPoolWithQuotaZInitImpl(__uint64 param_1,__uint64 param_2,ulong param_3)

+REGION * __cdecl RGNMEMOBJ::AllocateRegion(RustAutoHotpatchLockSH *param_1,ulong param_2)

 

 {

-  CLeakTrackingAllocator *this;

+  REGION_CORE *this;

   int iVar1;

-  bool bVar2;

-  longlong lVar3;

-  void *pvVar4;

-  undefined8 *puVar5;

-  ulong *puVar6;

-  ulonglong uVar7;

-  CBackTrace local_a8 [160];

+  REGION *this_00;

+  longlong lVar2;

+  void *pvVar3;

+  SCAN *pSVar4;

   

-  pvVar4 = (void *)(ulonglong)param_3;

-  lVar3 = W32GetUserSessionState();

-  this = (CLeakTrackingAllocator *)(lVar3 + 0x11a68);

-  iVar1 = *(int *)this;

-  if (iVar1 == 0) {

-LAB_0:

-    pvVar4 = (void *)ExAllocatePool2(0x101,param_2,pvVar4);

-    if (pvVar4 != (void *)0x0) {

-      LOCK();

-      *(longlong *)(lVar3 + 0x11ad8) = *(longlong *)(lVar3 + 0x11ad8) + 1;

-      UNLOCK();

+                    /* 0x1bff00  47

+                       ?AllocateRegion@RGNMEMOBJ@@SAPEAVREGION@@AEBVRustAutoHotpatchLockSH@@K@Z */

+  this_00 = AllocateIsolatedType<NSInstrumentation::CTypeIsolation<28672,112>_>();

+  if (this_00 == (REGION *)0x0) {

+    return (REGION *)0x0;

+  }

+  this = (REGION_CORE *)(this_00 + 0x18);

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

+    lVar2 = *DAT_0;

+    iVar1 = (**(code **)(lVar2 + 0x90))(this,param_2);

+    RgnCaptureLiveMemoryDumpOnZeroSizedScan((BaseRustExports *)(lVar2 + 0x30),this);

+    if (iVar1 == 0) {

+      REGION::vDeleteREGION(this_00,param_1);

+      return (REGION *)0x0;

     }

+    return this_00;

+  }

+  REGION_CORE::set_sizeScan(this,0);

+  REGION_CORE::set_sizeScanAlloc(this,param_2);

+  if (param_2 == 0x70) {

+    lVar2 = W32GetSessionState();

+    pvVar3 = Win32AllocateFromPagedLookasideListImpl

+                       (*(void **)(*(longlong *)(lVar2 + 0x58) + 0x1028));

   }

   else {

-    if (iVar1 == 1) {

-      bVar2 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement(this,param_3);

-      if ((bVar2) && (param_2 < param_2 + 0x10)) {

-        puVar5 = (undefined8 *)ExAllocatePool2(0x101,param_2 + 0x10,pvVar4);

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

-          LOCK();

-          *(longlong *)(lVar3 + 0x11ad8) = *(longlong *)(lVar3 + 0x11ad8) + 1;

-          UNLOCK();

-          *puVar5 = pvVar4;

-          if (puVar5 + 2 != (undefined8 *)0x0) {

-            return puVar5 + 2;

-          }

-        }

-        NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement

-                  (*(CPointerHashTable **)(lVar3 + 0x11a70),pvVar4);

-        return (void *)0x0;

-      }

-    }

-    else if (iVar1 == 2) {

-      if ((*(uint *)(lVar3 + 0x11ab8) & param_3) == param_3) {

-        puVar6 = (ulong *)(lVar3 + 0x11a98);

-        for (uVar7 = 0; uVar7 < *(uint *)(lVar3 + 0x11abc); uVar7 = uVar7 + 1) {

-          if (*puVar6 == param_3) {

-            bVar2 = false;

-            if ((param_2 < 0x1000) || ((param_2 & 0xfff) != 0)) {

-              bVar2 = true;

-              param_2 = param_2 + 0x10;

-            }

-            pvVar4 = (void *)ExAllocatePool2(0x101,param_2,pvVar4);

-            if (pvVar4 != (void *)0x0) {

-              LOCK();

-              *(longlong *)(lVar3 + 0x11ae8) = *(longlong *)(lVar3 + 0x11ae8) + 1;

-              UNLOCK();

-              memset(local_a8,0,0xa0);

-              RtlCaptureStackBackTrace(0,0x14,local_a8);

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

-                bVar2 = NSInstrumentation::CLeakTrackingAllocator::

-                        AssociateAllocationWithBacktrace<1>(this,pvVar4,uVar7,local_a8);

-                if (bVar2) {

-                  return (void *)((longlong)pvVar4 + 0x10);

-                }

-              }

-              else {

-                bVar2 = NSInstrumentation::CLeakTrackingAllocator::

-                        AssociateAllocationWithBacktrace<0>(this,pvVar4,uVar7,local_a8);

-                if (bVar2) {

-                  return pvVar4;

-                }

-              }

-              LOCK();

-              *(longlong *)(lVar3 + 0x11af0) = *(longlong *)(lVar3 + 0x11af0) + 1;

-              UNLOCK();

-              ___<lambda_invoker_cdecl>_PEAX_<lambda_fbf80a8de0504b0922e6810f5f982d9a>__CA_A_PPEAX_Z

-                        (pvVar4);

-            }

-            goto LAB_1;

-          }

-          puVar6 = puVar6 + 1;

-        }

-      }

-      goto LAB_0;

-    }

+    if (param_2 < 0x71) goto LAB_1;

+    pvVar3 = (void *)PALLOCNOZ(param_2,0x6e637347);

+  }

+  *(void **)this = pvVar3;

 LAB_1:

-    pvVar4 = (void *)0x0;

+  pSVar4 = REGION_CORE::get_pScan(this);

+  if (pSVar4 == (SCAN *)0x0) {

+    REGION::vDeleteREGION(this_00);

+    return (REGION *)0x0;

   }

-  return pvVar4;

+  return this_00;

 }
```

## `xxxCreateThreadInfo`  (modified)

```diff
--- xxxCreateThreadInfo
+++ xxxCreateThreadInfo
@@ -1,10 +1,861 @@
 

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

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

+/* WARNING: Removing unreachable block (ram,0x000140157d64) */

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

 

-void xxxCreateThreadInfo(void)

+tagTHREADINFO * xxxCreateThreadInfo(undefined8 param_1)

 

 {

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

-  halt_baddata();

+  code *pcVar1;

+  char cVar2;

+  undefined4 uVar3;

+  ulong uVar4;

+  uint uVar5;

+  ulong uVar6;

+  int iVar7;

+  LastWokenThreadTestResult LVar8;

+  int iVar9;

+  _EPROCESS *p_Var10;

+  longlong lVar11;

+  longlong *plVar12;

+  undefined8 *puVar13;

+  longlong lVar14;

+  tagTHREADINFO *ptVar15;

+  tagTHREADINFO *ptVar16;

+  void *pvVar17;

+  undefined8 uVar18;

+  tagQ *ptVar19;

+  tagDESKTOP *ptVar20;

+  tagTHREADINFO **pptVar21;

+  uint *puVar22;

+  ushort *puVar23;

+  undefined8 uVar24;

+  ulonglong uVar25;

+  uint uVar26;

+  tagTHREADINFO *ptVar27;

+  undefined1 uVar28;

+  void *pvVar29;

+  _EPROCESS *p_Var30;

+  tagPROCESSINFO *ptVar31;

+  undefined4 local_res10 [2];

+  undefined4 local_res18;

+  undefined4 uStackX_1c;

+  undefined8 local_res20;

+  ulonglong in_stack_fffffffffffffe28;

+  undefined8 in_stack_fffffffffffffe30;

+  undefined4 uVar32;

+  tagTHREADINFO *local_1b8;

+  undefined1 local_1a8;

+  undefined8 local_190;

+  undefined8 *local_188;

+  undefined8 local_180;

+  void *local_178;

+  code *local_170;

+  AtomicExecutionCheck local_168 [8];

+  longlong local_160;

+  undefined8 local_158;

+  undefined8 local_150;

+  undefined4 local_148;

+  undefined4 local_144;

+  undefined4 local_140;

+  undefined4 local_13c;

+  uint local_138;

+  undefined4 local_134;

+  uint local_130;

+  void *local_128;

+  uint local_120;

+  ushort *local_118;

+  undefined8 local_108;

+  tagDESKTOP *local_100;

+  void *local_f8;

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)> local_f0 [24];

+  tagTHREADINFO *local_d8;

+  undefined8 local_d0;

+  longlong local_c8;

+  undefined8 local_c0;

+  longlong local_b8;

+  undefined8 local_b0;

+  tagTHREADINFO *local_a8;

+  undefined8 local_a0;

+  AtomicExecutionCheck local_98 [8];

+  longlong local_90;

+  undefined8 local_88;

+  undefined8 uStack_80;

+  undefined8 local_78;

+  undefined8 uStack_70;

+  tagDESKTOP *local_68;

+  undefined8 uStack_60;

+  

+  uVar32 = (undefined4)((ulonglong)in_stack_fffffffffffffe30 >> 0x20);

+  p_Var10 = (_EPROCESS *)PsGetThreadProcess();

+  memset(&local_158,0,0x48);

+  ptVar20 = (tagDESKTOP *)0x0;

+  local_1b8 = (tagTHREADINFO *)0x0;

+  local_1a8 = 0;

+  local_190 = 0;

+  local_res20 = &ExceptionList;

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>::

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>

+            ((Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)> *)

+             &local_180);

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>::

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>(local_f0);

+  local_f8 = (void *)0x0;

+  local_88 = 0;

+  uStack_80 = 0;

+  local_78 = 0;

+  uStack_70 = 0;

+  local_68 = (tagDESKTOP *)0x0;

+  uStack_60 = 0;

+  if (DAT_0 < '\0') {

+    McTemplateK0_EtwWriteTransfer();

+  }

+  lVar11 = W32GetUserSessionState();

+  uVar6 = 0;

+  if (((*(int *)(lVar11 + 0x8ec8) != 0) ||

+      (plVar12 = (longlong *)PsGetCurrentProcessWin32Process(), plVar12 == (longlong *)0x0)) ||

+     (((ulonglong)plVar12 & -(ulonglong)(*plVar12 != 0)) == 0)) {

+    Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>::

+    ~Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

+              ((Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

+                *)local_f0);

+    Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>::

+    ~Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

+              ((Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

+                *)&local_180);

+    return (tagTHREADINFO *)0xc000010a;

+  }

+  lVar11 = W32GetUserSessionState(-*plVar12);

+  *(int *)(lVar11 + 0x8ed0) = *(int *)(lVar11 + 0x8ed0) + 1;

+  lVar11 = W32GetUserGdiSessionState();

+  uVar5 = 0x2000048;

+  if (p_Var10 != *(_EPROCESS **)(lVar11 + 0x28)) {

+    uVar5 = 0;

+  }

+  puVar13 = (undefined8 *)PsGetThreadWin32Thread(param_1);

+  ptVar15 = (tagTHREADINFO *)ptVar20;

+  if (puVar13 != (undefined8 *)0x0) {

+    ptVar15 = (tagTHREADINFO *)*puVar13;

+  }

+  lVar14 = PsGetProcessPeb(p_Var10);

+  lVar11 = *(longlong *)(lVar14 + 0x20);

+  local_188 = &local_158;

+  local_158 = *(undefined8 *)(lVar11 + 0x20);

+  local_150 = *(undefined8 *)(lVar11 + 0x28);

+  local_148 = *(undefined4 *)(lVar11 + 0x88);

+  local_144 = *(undefined4 *)(lVar11 + 0x8c);

+  local_140 = *(undefined4 *)(lVar11 + 0x90);

+  local_13c = *(undefined4 *)(lVar11 + 0x94);

+  local_138 = *(uint *)(lVar11 + 0xa4);

+  local_134 = *(undefined4 *)(lVar11 + 0xa8);

+  puVar22 = (uint *)(lVar11 + 0xc0);

+  if (*(uint **)MmUserProbeAddress_exref <= (uint *)(lVar11 + 0xc0)) {

+    puVar22 = *(uint **)MmUserProbeAddress_exref;

+  }

+  local_130 = *puVar22;

+  uStackX_1c = (undefined4)((ulonglong)lVar14 >> 0x20);

+  pvVar17 = *(void **)(puVar22 + 2);

+  if ((ushort)local_130 != 0) {

+    local_128 = pvVar17;

+    local_res18 = local_130;

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

+                    /* WARNING: Subroutine does not return */

+      ExRaiseDatatypeMisalignment();

+    }

+    pvVar29 = (void *)((longlong)pvVar17 + (ulonglong)(local_130 & 0xffff) + 2);

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

+                    /* WARNING: Subroutine does not return */

+      ExRaiseAccessViolation();

+    }

+    local_res18._2_2_ = (ushort)(local_130 >> 0x10);

+    if (local_res18._2_2_ < (ushort)local_130) {

+      if ((local_130 & 1) == 0) goto LAB_1;

+    }

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

+      pvVar29 = Win32AllocPoolWithQuotaZInitImpl

+                          ((ulonglong)local_130,(ulonglong)(local_130 & 0xffff),0x79747355);

+      local_128 = pvVar29;

+      local_f8 = pvVar29;

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

+                    /* WARNING: Subroutine does not return */

+        ExRaiseStatus(0xc0000017);

+      }

+      if (local_170 != (code *)0xffffffffffffffff) {

+        ptVar15 = PtiCurrent();

+                    /* WARNING: Subroutine does not return */

+        KeBugCheckEx(0x164,0x12,&local_180,pvVar29,ptVar15);

+      }

+      ptVar16 = PtiCurrent();

+      local_180 = *(undefined8 *)(ptVar16 + 0x180);

+      *(undefined8 **)(ptVar16 + 0x180) = &local_180;

+      local_170 = GreDeleteFastMutex;

+      local_178 = pvVar29;

+      memmove(local_128,pvVar17,(ulonglong)(ushort)local_130);

+      goto LAB_2;

+    }

+    local_res10[0] = 0x20000;

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0x501);

+LAB_1:

+                    /* WARNING: Subroutine does not return */

+    ExRaiseAccessViolation();

+  }

+  local_128 = (void *)0x0;

+LAB_2:

+  puVar22 = (uint *)(lVar11 + 0xd0);

+  if (*(uint **)MmUserProbeAddress_exref <= (uint *)(lVar11 + 0xd0)) {

+    puVar22 = *(uint **)MmUserProbeAddress_exref;

+  }

+  local_120 = *puVar22;

+  local_118 = *(ushort **)(puVar22 + 2);

+  local_res18 = local_120;

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

+                    /* WARNING: Subroutine does not return */

+    ExRaiseDatatypeMisalignment();

+  }

+  puVar23 = (ushort *)((ulonglong)(ushort)local_120 + 2 + (longlong)local_118);

+  if ((puVar23 <= local_118) || (*(ushort **)MmUserProbeAddress_exref <= puVar23)) {

+                    /* WARNING: Subroutine does not return */

+    ExRaiseAccessViolation();

+  }

+  local_res18._2_2_ = (ushort)(local_120 >> 0x10);

+  if (local_res18._2_2_ < (ushort)local_120) {

+    if ((local_120 & 1) == 0) goto LAB_3;

+  }

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

+    plVar12 = (longlong *)PsGetCurrentProcessWin32Process();

+    ptVar31 = (tagPROCESSINFO *)0x0;

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

+      ptVar31 = (tagPROCESSINFO *)((ulonglong)plVar12 & -(ulonglong)(*plVar12 != 0));

+    }

+    uVar26 = uVar5 | 0x100;

+    if (((byte)ptVar31[0xc] & 0x80) == 0) {

+      uVar26 = uVar5;

+    }

+    lVar11 = PsGetThreadProcessId(param_1);

+    lVar14 = W32GetUserSessionState();

+    uVar5 = uVar26 | 0x2000000;

+    if (*(longlong *)(lVar14 + 0xf8c0) != lVar11) {

+      uVar5 = uVar26;

+    }

+    LOCK();

+    *(uint *)(ptVar15 + 0x210) = *(uint *)(ptVar15 + 0x210) | uVar5;

+    UNLOCK();

+    lVar11 = W32GetUserSessionState();

+    if ((char)*(undefined4 *)(lVar11 + 0x10658) < '\0') {

+      lVar11 = W32GetUserSessionState();

+      if (*(longlong *)(lVar11 + 0x37b8) != 0) {

+        lVar11 = W32GetUserSessionState();

+        lVar11 = _HMPheFromObject(*(undefined8 *)(lVar11 + 0x37b8));

+        if ((*(byte *)(lVar11 + 0x19) & 1) != 0) {

+          local_res18 = 0x20000;

+          MicrosoftTelemetryAssertTriggeredArgsKM("IXPTellMeIf",0x20000);

+        }

+      }

+      lVar11 = W32GetUserSessionState();

+      local_d0 = *(undefined8 *)(lVar11 + 0x37b8);

+      local_d8 = ptVar15 + 0x1e0;

+      pptVar21 = &local_d8;

+    }

+    else {

+      lVar11 = W32GetUserSessionState();

+      if (*(longlong *)(lVar11 + 0x3798) == 0) {

+        lVar11 = W32GetUserSessionState();

+        if (*(longlong *)(lVar11 + 0x37b8) == 0) {

+          lVar11 = W32GetUserSessionState();

+          if (*(longlong *)(lVar11 + 0x3970) == 0) goto LAB_4;

+          lVar11 = W32GetUserSessionState();

+          uVar18 = *(undefined8 *)(lVar11 + 0x3970);

+          local_b8 = W32GetUserSessionState();

+          local_b8 = local_b8 + 0x3798;

+          uVar24 = 0;

+          plVar12 = &local_b8;

+          local_b0 = uVar18;

+        }

+        else {

+          lVar11 = W32GetUserSessionState();

+          uVar18 = *(undefined8 *)(lVar11 + 0x37b8);

+          local_c8 = W32GetUserSessionState();

+          local_c8 = local_c8 + 0x3798;

+          uVar24 = 1;

+          plVar12 = &local_c8;

+          local_c0 = uVar18;

+        }

+        HMAssignmentLock(plVar12,uVar24);

+      }

+LAB_4:

+      lVar11 = W32GetUserSessionState();

+      if (*(longlong *)(lVar11 + 0x3798) != 0) {

+        lVar11 = W32GetUserSessionState();

+        lVar11 = _HMPheFromObject(*(undefined8 *)(lVar11 + 0x3798));

+        if ((*(byte *)(lVar11 + 0x19) & 1) != 0) {

+          local_res18 = 0x20000;

+          MicrosoftTelemetryAssertTriggeredArgsKM("IXPTellMeIf",0x20000);

+        }

+      }

+      lVar11 = W32GetUserSessionState();

+      local_a0 = *(undefined8 *)(lVar11 + 0x3798);

+      local_a8 = ptVar15 + 0x1e0;

+      pptVar21 = &local_a8;

+    }

+    HMAssignmentLock(pptVar21,0);

+    *(tagTHREADINFO **)(ptVar15 + 0x1e8) = ptVar15 + 0x448;

+    if ((*(uint *)(ptVar31 + 0xc) & 0x800000) != 0) {

+      LOCK();

+      *(uint *)(ptVar15 + 0x210) = *(uint *)(ptVar15 + 0x210) | 0x2000000;

+      UNLOCK();

+    }

+    *(tagPROCESSINFO **)(ptVar15 + 0x1d0) = ptVar31;

+    *(undefined8 *)(ptVar15 + 0x2c0) = *(undefined8 *)(ptVar31 + 0x158);

+    *(tagTHREADINFO **)(ptVar31 + 0x158) = ptVar15;

+    *(int *)(ptVar31 + 0x188) = *(int *)(ptVar31 + 0x188) + 1;

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

+      pvVar17 = (void *)PsGetThreadId(*(undefined8 *)ptVar15);

+      local_res20[0xf] = pvVar17;

+    }

+    *(void ***)(ptVar15 + 0x208) = local_res20 + 0x100;

+    *(undefined4 *)(*(longlong *)(ptVar15 + 0x208) + 0xe8) = *(undefined4 *)(ptVar15 + 400);

+    *(undefined4 *)(*(longlong *)(ptVar15 + 0x208) + 0xec) = 0;

+    *(longlong *)(ptVar15 + 0x198) = *(longlong *)(ptVar15 + 0x208) + 0xe8;

+    *(undefined4 *)(*(longlong *)(ptVar15 + 0x208) + 0xf0) = *(undefined4 *)(ptVar15 + 0x194);

+    *(undefined4 *)(*(longlong *)(ptVar15 + 0x208) + 0xf4) = 0;

+    *(longlong *)(ptVar15 + 0x1a0) = *(longlong *)(ptVar15 + 0x208) + 0xf0;

+    if ((*(uint *)(ptVar31 + 0xc) & 0x2000000) != 0) {

+      LOCK();

+      *(uint *)(ptVar15 + 0x210) = *(uint *)(ptVar15 + 0x210) | 0x20000000;

+      UNLOCK();

+    }

+    if (*(int *)(ptVar15 + 0x2a0) == 0) {

+      lVar11 = PsGetProcessPeb(p_Var10);

+      if (lVar11 == 0) {

+        *(undefined4 *)(ptVar15 + 0x2a0) = 0x600;

+      }

+      else {

+        uVar18 = PsGetProcessSectionBaseAddress(p_Var10);

+        uVar3 = RtlGetExpWinVer(uVar18);

+        *(undefined4 *)(ptVar15 + 0x2a0) = uVar3;

+      }

+    }

+    lVar11 = W32GetWin32kBaseApiSetTable();

+    pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x438);

+    if (pcVar1 == (code *)0x0) {

+      iVar7 = -0x3fffff45;

+    }

+    else {

+      iVar7 = (*pcVar1)();

+    }

+    iVar9 = -0x3fffff45;

+    if (-1 < iVar7) {

+      lVar11 = W32GetWin32kBaseApiSetTable();

+      pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x440);

+      if (pcVar1 != (code *)0x0) {

+        (*pcVar1)();

+      }

+    }

+    local_res20 = (void **)(CONCAT44(local_res20._4_4_,uVar5) & 0xffffffff0000000c);

+    if ((uVar5 & 0xc) == 0) {

+      lVar11 = W32GetWin32kBaseApiSetTable();

+      pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x448);

+      if (pcVar1 == (code *)0x0) {

+        iVar7 = -0x3fffff45;

+      }

+      else {

+        iVar7 = (*pcVar1)();

+      }

+      if (-1 < iVar7) {

+        lVar11 = W32GetWin32kBaseApiSetTable();

+        pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x450);

+        uVar4 = uVar6;

+        if (pcVar1 != (code *)0x0) {

+          uVar4 = (*pcVar1)(ptVar15);

+        }

+        if (uVar4 != 0) {

+          *(uint *)(ptVar31 + 0xc) = *(uint *)(ptVar31 + 0xc) | 0x1000000;

+        }

+      }

+    }

+    ptVar16 = ptVar15 + 0x2f8;

+    puVar13 = (undefined8 *)(in_stack_fffffffffffffe28 & 0xffffffffffffff00);

+    uVar28 = 0;

+    uVar5 = ZwCreateEvent(ptVar16,0x1f0003,0,1,puVar13);

+    ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+    if (-1 < (int)uVar5) {

+      uVar18 = *(undefined8 *)ExEventObjectType_exref;

+      local_108 = 0;

+      uVar32 = 0;

+      puVar13 = &local_108;

+      uVar5 = ObReferenceObjectByHandle(*(undefined8 *)ptVar16,0x1f0003,uVar18,1,puVar13,0);

+      uVar28 = (undefined1)uVar18;

+      ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+      *(undefined8 *)(ptVar15 + 0x300) = local_108;

+      if ((int)uVar5 < 0) {

+        if (uVar5 != 0xc0000008) {

+          ObCloseHandle(*(undefined8 *)ptVar16);

+        }

+      }

+      else {

+        uVar28 = (undefined1)*(undefined8 *)ExEventObjectType_exref;

+        uVar5 = ProtectHandle(*(undefined8 *)ptVar16);

+        ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+      }

+    }

+    if ((int)ptVar27 < 0) {

+      *(undefined8 *)ptVar16 = 0;

+    }

+    else {

+      p_Var30 = p_Var10;

+      uVar5 = ObDuplicateObject(p_Var10,*(undefined8 *)ptVar16,p_Var10,ptVar15 + 0x678,

+                                (ulonglong)puVar13 & 0xffffffff00000000,CONCAT44(uVar32,0x200),2,0);

+      uVar28 = SUB81(p_Var30,0);

+      ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+      if ((int)uVar5 < 0) {

+        *(undefined8 *)(ptVar15 + 0x678) = 0;

+      }

+      else {

+        uVar5 = InitializeThreadInfoIocp(p_Var10,ptVar15);

+        ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+        if (-1 < (int)uVar5) {

+          local_res18 = *(uint *)(ptVar31 + 0xc) & 0x4000;

+          *(uint *)(ptVar31 + 0xc) = *(uint *)(ptVar31 + 0xc) | 0x4000;

+          if ((*(int *)(ptVar31 + 0x310) == 0) && (local_138 != 0)) {

+            *(undefined4 *)(ptVar31 + 0x310) = 0x1c;

+            *(undefined4 *)(ptVar31 + 0x314) = local_148;

+            *(undefined4 *)(ptVar31 + 0x318) = local_144;

+            *(undefined4 *)(ptVar31 + 0x31c) = local_140;

+            *(undefined4 *)(ptVar31 + 800) = local_13c;

+            *(uint *)(ptVar31 + 0x324) = local_138;

+            *(undefined2 *)(ptVar31 + 0x328) = (undefined2)local_134;

+          }

+          if (local_res18 == 0) {

+            if ((local_138 & 0x200) == 0) {

+              if ((short)local_120 != 0) {

+                uVar6 = ParseReserved(local_118,(ushort *)0x4000);

+              }

+            }

+            else {

+              uVar6 = (ulong)local_158;

+            }

+            *(ulong *)(ptVar31 + 700) = uVar6;

+            if ((*(uint *)(local_188 + 4) & 0x400) != 0) {

+              uVar18 = local_188[1];

+              lVar11 = HMValidateSharedHandle(uVar18);

+              if (lVar11 != 0) {

+                *(undefined8 *)(ptVar31 + 0x2c0) = uVar18;

+              }

+            }

+          }

+          iVar7 = Feature_NTUSER_Compartment__private_IsEnabledDeviceUsageNoInline();

+          if (iVar7 == 0) {

+            ptVar19 = (tagQ *)AllocQueue(0);

+          }

+          else {

+            ptVar19 = tagQ::Alloc(ptVar15);

+          }

+          if (ptVar19 == (tagQ *)0x0) {

+            ptVar27 = (tagTHREADINFO *)0xc0000017;

+          }

+          else {

+            tagTHREADINFO::AssignQueue(ptVar15,ptVar19);

+            *(tagTHREADINFO **)(ptVar19 + 0x78) = ptVar15;

+            *(tagTHREADINFO **)(ptVar19 + 0x70) = ptVar15;

+            ApiSetEditionUpdateRawMouseMode(ptVar19);

+            iVar7 = Feature_NTUSER_Compartment__private_IsEnabledDeviceUsageNoInline();

+            if (iVar7 == 0) {

+              tagQ::InitUIPIFromThread(ptVar19,ptVar15);

+            }

+            LOCK();

+            uVar5 = *(uint *)(ptVar15 + 0x210);

+            if (uVar5 == 0) {

+              *(uint *)(ptVar15 + 0x210) = 0;

+              uVar5 = 0;

+            }

+            UNLOCK();

+            if (((uVar5 & 0xc) == 0) &&

+               (lVar11 = W32GetUserSessionState(), *(longlong *)(lVar11 + 0xf8a8) != 0)) {

+              lVar11 = W32GetWin32kBaseApiSetTable();

+              pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x468);

+              if (pcVar1 == (code *)0x0) {

+                ptVar27 = (tagTHREADINFO *)0xc00000bb;

+              }

+              else {

+                uVar5 = (*pcVar1)();

+                ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+              }

+              if (-1 < (int)ptVar27) {

+                uVar28 = SUB81(&local_190,0);

+                uVar5 = xxxResolveDesktop();

+                ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+                if (-1 < (int)uVar5) {

+                  lVar11 = W32GetWin32kBaseApiSetTable();

+                  pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x478);

+                  if (pcVar1 == (code *)0x0) {

+                    ptVar27 = (tagTHREADINFO *)0xc00000bb;

+                  }

+                  else {

+                    uVar5 = (*pcVar1)();

+                    ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+                  }

+                  if (-1 < (int)ptVar27) {

+                    AtomicExecutionCheck::AtomicExecutionCheck(local_98);

+                    uVar5 = xxxSetProcessWindowStation(local_190);

+                    ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+                    if (local_98[0] != (AtomicExecutionCheck)0x0) {

+                      *(int *)(local_90 + 0x1c) = *(int *)(local_90 + 0x1c) + -1;

+                    }

+                    if (-1 < (int)uVar5) {

+                      uVar18 = *(undefined8 *)ExDesktopObjectType_exref;

+                      local_100 = (tagDESKTOP *)0x0;

+                      uVar5 = ObReferenceObjectByHandle(0,0,uVar18,1,&local_100,0);

+                      ptVar20 = local_100;

+                      uVar28 = (undefined1)uVar18;

+                      ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+                      local_1b8 = (tagTHREADINFO *)local_100;

+                      if (-1 < (int)uVar5) {

+                        Win32RawLockedNtObject<tagDESKTOP>::ManualLock

+                                  ((Win32RawLockedNtObject<tagDESKTOP> *)local_f0,local_100);

+                        ObfDereferenceObject(ptVar20);

+                        local_78 = CONCAT44(local_78._4_4_,1);

+                        uStack_70 = PsGetCurrentProcess();

+                        local_68 = ptVar20;

+                        uStack_60 = 0x100000000;

+                        lVar11 = W32GetWin32kBaseApiSetTable();

+                        pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x488);

+                        if (pcVar1 == (code *)0x0) {

+                          ptVar27 = (tagTHREADINFO *)0xc00000bb;

+                        }

+                        else {

+                          uVar5 = (*pcVar1)();

+                          ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+                        }

+                        if (-1 < (int)ptVar27) {

+                          lVar11 = W32GetWin32kBaseApiSetTable();

+                          pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x490);

+                          if (pcVar1 == (code *)0x0) {

+                            ptVar27 = (tagTHREADINFO *)0xc00000bb;

+                          }

+                          else {

+                            uVar5 = (*pcVar1)(&local_88);

+                            ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+                          }

+                          if (-1 < (int)ptVar27) {

+                            if (*(longlong *)(ptVar31 + 400) == 0) {

+                              lVar11 = W32GetUserSessionState();

+                              lVar11 = *(longlong *)(lVar11 + 0xf8c0);

+                              lVar14 = PsGetProcessId(p_Var10);

+                              if (lVar14 != lVar11) {

+                                LockObjectAssignment(ptVar31 + 0x168);

+                                *(undefined8 *)(ptVar31 + 400) = 0;

+                              }

+                            }

+                            goto LAB_5;

+                          }

+                        }

+                      }

+                      goto LAB_6;

+                    }

+                  }

+                  CloseProtectedHandle(0);

+                  CloseProtectedHandle(local_190);

+                  local_190 = 0;

+                  goto LAB_6;

+                }

+              }

+              if ((int)ptVar27 == -0x3ffffd95) {

+                ReleaseUserCriticalSection();

+                ZwTerminateProcess(0xffffffffffffffff,0xc000026b);

+                lVar11 = W32GetUserSessionState();

+                uVar28 = 0;

+                lVar14 = UserCritInternal::`anonymous_namespace'::EnterCritInternal

+                                   (lVar11,1,0,

+                                    <lambda_63b61c2369133a205197eda5bd671ee7>::

+                                    <lambda_invoker_cdecl>);

+                *(longlong *)(lVar11 + 0x10) = lVar14;

+                if ((lVar14 != 0) &&

+                   (cVar2 = UserCritInternal::`anonymous_namespace'::IsValidGuiContext(lVar14),

+                   cVar2 != '\0')) {

+                  DestroySharedUserCritDeferredUnlockList(lVar11 + 0x4d78);

+                  DestroyDeferredUnlockObjectAssignmentList(lVar11 + 0x4db0);

+                  DestroyDeferredUnlockObjectAssignmentList(lVar11 + 0x4da0);

+                }

+              }

+              else {

+                PsGetCurrentProcessId();

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

+                  McTemplateK0dq_EtwWriteTransfer();

+                }

+                ptVar27 = (tagTHREADINFO *)0xc0000142;

+              }

+            }

+            else {

+              *(ulonglong *)(ptVar15 + 0x550) = *(ulonglong *)(ptVar15 + 0x550) | 0x10;

+              iVar7 = IsEditionSetProcessWindowStationAtProcessInitSupported();

+              puVar13 = local_188;

+              if (-1 < iVar7) {

+                iVar7 = IsEditionSetProcessWindowStationAtProcessInitSupported();

+                ptVar27 = (tagTHREADINFO *)ptVar20;

+                if (-1 < iVar7) {

+                  uVar5 = EditionSetProcessWindowStationAtProcessInit(puVar13 + 5);

+                  ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+                }

+                if ((int)ptVar27 < 0) goto LAB_6;

+                *(uint *)(ptVar31 + 0xc) = *(uint *)(ptVar31 + 0xc) | 0x40010;

+              }

+              iVar7 = IsEditionSetThreadDesktopAtThreadInitSupported();

+              if ((-1 < iVar7) &&

+                 (iVar7 = IsEditionSetThreadDesktopAtThreadInitSupported(), -1 < iVar7)) {

+                lVar11 = W32GetWin32kBaseApiSetTable();

+                pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x3e0);

+                if (pcVar1 != (code *)0x0) {

+                  (*pcVar1)();

+                }

+              }

+LAB_5:

+              iVar7 = InitClientInfo(ptVar15);

+              ptVar20 = (tagDESKTOP *)local_1b8;

+              if (iVar7 != 0) {

+                AtomicExecutionCheck::AtomicExecutionCheck(local_168);

+                lVar11 = W32GetWin32kBaseApiSetTable();

+                pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x498);

+                if (pcVar1 == (code *)0x0) {

+                  ptVar27 = (tagTHREADINFO *)0xc00000bb;

+                }

+                else {

+                  uVar5 = (*pcVar1)();

+                  ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+                }

+                if (-1 < (int)ptVar27) {

+                  uVar28 = local_1a8;

+                  uVar5 = zzzSetDesktop(ptVar15);

+                  ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+                  if (-1 < (int)uVar5) {

+                    if (local_168[0] != (AtomicExecutionCheck)0x0) {

+                      *(int *)(local_160 + 0x1c) = *(int *)(local_160 + 0x1c) + -1;

+                    }

+                    W32GetUserSessionState();

+                    puVar13 = local_188;

+                    if (*(int *)(local_188 + 4) < 0) {

+                      if (local_res18 == 0) {

+                        lVar11 = W32GetUserSessionState();

+                        if (*(longlong *)(lVar11 + 0xf8c0) != 0) {

+                          lVar11 = W32GetUserSessionState();

+                          lVar11 = *(longlong *)(lVar11 + 0xf8c0);

+                          lVar14 = PsGetProcessInheritedFromUniqueProcessId(p_Var10);

+                          if (lVar14 == lVar11) {

+                            lVar11 = W32GetUserSessionState();

+                            *(tagPROCESSINFO **)(lVar11 + 0xf5f0) = ptVar31;

+                            lVar11 = W32GetUserSessionState();

+                            uVar18 = *(undefined8 *)(*(longlong *)(lVar11 + 0x4e30) + 0x1360);

+                            lVar11 = W32GetUserSessionState();

+                            *(undefined8 *)(lVar11 + 0x8e10) = uVar18;

+                            *(uint *)(ptVar31 + 0xc) = *(uint *)(ptVar31 + 0xc) | 0x200000;

+                            EtwTraceScreenSaverProcessEvent(1);

+                            uVar28 = 8;

+                            ForegroundBoost::`anonymous_namespace'::_SetForegroundPriority

+                                      (*(undefined8 *)(ptVar15 + 0x1d0));

+                            *(uint *)(ptVar31 + 0xc) = *(uint *)(ptVar31 + 0xc) | 0x400000;

+                            goto LAB_7;

+                          }

+                        }

+                        *(uint *)(puVar13 + 4) = *(uint *)(puVar13 + 4) & 0x7fffffff;

+                      }

+                      else {

+LAB_7:

+                        LOCK();

+                        *(uint *)(ptVar15 + 0x210) = *(uint *)(ptVar15 + 0x210) | 0x2000000;

+                        UNLOCK();

+                      }

+                    }

+                    uVar26 = local_res18;

+                    LOCK();

+                    uVar5 = *(uint *)(ptVar15 + 0x210);

+                    if (uVar5 == 0) {

+                      *(uint *)(ptVar15 + 0x210) = 0;

+                      uVar5 = 0;

+                    }

+                    UNLOCK();

+                    if (((uVar5 & 0xc) != 0) || (local_res18 != 0)) {

+LAB_8:

+                      ApiSetEditionInitInputHangInfo();

+                      if (*(longlong *)(ptVar15 + 0x1d8) != 0) {

+                        iVar7 = Feature_ConsistentPendingMouse2__private_IsEnabledDeviceUsageNoInline

+                                          ();

+                        if (iVar7 == 0) {

+                          ptVar19 = (tagQ *)(*(longlong *)(ptVar15 + 0x1d8) + 0x22c);

+                        }

+                        else {

+                          ptVar19 = ptVar19 + 0x148;

+                        }

+                        SetUnavailableInputSource(ptVar19);

+                      }

+                      if ((*(uint *)(ptVar31 + 0xc) & 0x20000) != 0) {

+                        LOCK();

+                        *(uint *)(ptVar15 + 0x210) = *(uint *)(ptVar15 + 0x210) | 0x4000;

+                        UNLOCK();

+                      }

+                      LOCK();

+                      *(uint *)(ptVar15 + 0x210) = *(uint *)(ptVar15 + 0x210) | 0x1000000;

+                      UNLOCK();

+                      if (((*(uint *)(ptVar31 + 0xc) & 0x140) == 0) &&

+                         (((byte)ptVar31[0x330] & 0x30) != 0x10)) {

+                        lVar11 = W32GetUserSessionState();

+                        if (((*(longlong *)(lVar11 + 0x4a60) != 0) &&

+                            (*(tagPROCESSINFO **)(*(longlong *)(lVar11 + 0x4a60) + 0x1d0) == ptVar31

+                            )) || (LVar8 = LastWokenThread::Test(ptVar31,false), LVar8 == 3)) {

+                          tagTHREADINFO::SetForegroundActivate(ptVar15,1);

+                        }

+                      }

+                      lVar11 = W32GetUserSessionState();

+                      if ((**(uint **)(lVar11 + 0x4e30) & 4) != 0) {

+                        lVar11 = W32GetWin32kBaseApiSetTable();

+                        pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x4d0);

+                        if (pcVar1 == (code *)0x0) {

+                          iVar7 = -0x3fffff45;

+                        }

+                        else {

+                          iVar7 = (*pcVar1)();

+                        }

+                        if (-1 < iVar7) {

+                          lVar11 = W32GetWin32kBaseApiSetTable();

+                          pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x4d8);

+                          if (pcVar1 != (code *)0x0) {

+                            (*pcVar1)(0);

+                          }

+                        }

+                      }

+                      if ((int)local_res20 == 0) {

+                        lVar11 = W32GetWin32kBaseApiSetTable();

+                        pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x4e0);

+                        if (pcVar1 == (code *)0x0) {

+                          ptVar27 = (tagTHREADINFO *)0xc00000bb;

+                        }

+                        else {

+                          uVar5 = (*pcVar1)();

+                          ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+                        }

+                        if (-1 < (int)ptVar27) {

+                          lVar11 = W32GetWin32kBaseApiSetTable();

+                          pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x4e8);

+                          if (pcVar1 == (code *)0x0) {

+                            ptVar27 = (tagTHREADINFO *)0xc00000bb;

+                          }

+                          else {

+                            uVar5 = (*pcVar1)();

+                            ptVar27 = (tagTHREADINFO *)(ulonglong)uVar5;

+                          }

+                          if (-1 < (int)ptVar27) goto LAB_9;

+                        }

+                        goto LAB_6;

+                      }

+LAB_9:

+                      if ((uVar26 == 0) && ((*(uint *)(ptVar31 + 0xc) & 1) == 0)) {

+                        lVar11 = W32GetWin32kBaseApiSetTable();

+                        pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x4f0);

+                        if (pcVar1 != (code *)0x0) {

+                          iVar9 = (*pcVar1)();

+                        }

+                        if (-1 < iVar9) {

+                          lVar11 = W32GetWin32kBaseApiSetTable();

+                          pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x4f8);

+                          if (pcVar1 != (code *)0x0) {

+                            (*pcVar1)(7);

+                          }

+                        }

+                      }

+                      if (local_1b8 != (tagTHREADINFO *)0x0) {

+                        if ((*(uint *)(local_1b8 + 0x30) & 8) != 0) goto LAB_10;

+                        Win32RawLockedItemBase<tagDESKTOP,&void___cdecl_UserDereferenceObject(void*___ptr64),1,1,1>

+                        ::UnlockWorker((Win32RawLockedItemBase<tagDESKTOP,&void___cdecl_UserDereferenceObject(void*___ptr64),1,1,1>

+                                        *)local_f0,false,(bool)uVar28);

+                      }

+                      if ((*(ulonglong *)(ptVar15 + 0x550) & 1) != 0) {

+                        *(ulonglong *)(ptVar15 + 0x550) =

+                             *(ulonglong *)(ptVar15 + 0x550) & 0xfffffffffffffffe;

+                      }

+                      goto LAB_11;

+                    }

+                    iVar7 = Feature_StartGlassModern__private_IsEnabledDeviceUsageNoInline();

+                    if (iVar7 == 0) {

+                      lVar11 = W32GetUserSessionState();

+                      *(int *)(lVar11 + 0x114d8) = *(int *)(lVar11 + 0x114d8) + 1;

+                      iVar7 = IszzzCalcStartCursorHideSupported();

+                      if (-1 < iVar7) {

+                        plVar12 = (longlong *)PsGetProcessWin32Process(p_Var10);

+                        uVar25 = 0;

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

+                          uVar25 = (ulonglong)plVar12 & -(ulonglong)(*plVar12 != 0);

+                        }

+                        zzzCalcStartCursorHide(uVar25);

+                      }

+                      lVar11 = W32GetUserSessionState();

+                      if (*(int *)(lVar11 + 0x114d8) == 0) {

+                        local_res18 = 0x20000;

+                        uVar28 = 0x16;

+                        MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert");

+                      }

+                      lVar11 = W32GetUserSessionState();

+                      *(int *)(lVar11 + 0x114d8) = *(int *)(lVar11 + 0x114d8) + -1;

+                    }

+                    else {

+                      CWinEventNoopDeferral::CWinEventNoopDeferral

+                                ((CWinEventNoopDeferral *)local_res10);

+                      plVar12 = (longlong *)PsGetProcessWin32Process(p_Var10);

+                      uVar25 = 0;

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

+                        uVar25 = (ulonglong)plVar12 & -(ulonglong)(*plVar12 != 0);

+                      }

+                      lVar11 = W32GetWin32kBaseApiSetTable();

+                      pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x418);

+                      if (pcVar1 != (code *)0x0) {

+                        (*pcVar1)(uVar25);

+                      }

+                      CWinEventNoopDeferral::~CWinEventNoopDeferral

+                                ((CWinEventNoopDeferral *)local_res10);

+                    }

+                    lVar11 = W32GetUserSessionState();

+                    if ((*(longlong *)(lVar11 + 0xf8a8) == 0) ||

+                       (*(longlong *)(ptVar31 + 0x2a0) != 0)) goto LAB_8;

+                    UserSetLastError(0x3eb);

+LAB_10:

+                    ptVar27 = (tagTHREADINFO *)0xc0000001;

+                    goto LAB_6;

+                  }

+                }

+                if (local_168[0] != (AtomicExecutionCheck)0x0) {

+                  *(int *)(local_160 + 0x1c) = *(int *)(local_160 + 0x1c) + -1;

+                  local_160 = 0;

+                }

+              }

+            }

+          }

+        }

+      }

+    }

+LAB_6:

+    if (ptVar20 != (tagDESKTOP *)0x0) {

+      Win32RawLockedItemBase<tagDESKTOP,&void___cdecl_UserDereferenceObject(void*___ptr64),1,1,1>::

+      UnlockWorker((Win32RawLockedItemBase<tagDESKTOP,&void___cdecl_UserDereferenceObject(void*___ptr64),1,1,1>

+                    *)local_f0,false,(bool)uVar28);

+    }

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

+      Win32RawLockedItemBase<DISPLAYCONFIG_DEVICE_INFO_HEADER,&void___cdecl_Win32FreePool(void*___ptr64),1,1,1>

+      ::UnlockWorker((Win32RawLockedItemBase<DISPLAYCONFIG_DEVICE_INFO_HEADER,&void___cdecl_Win32FreePool(void*___ptr64),1,1,1>

+                      *)&local_180,false,(bool)uVar28);

+    }

+    xxxDestroyThreadInfo();

+LAB_11:

+    Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>::

+    ~Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

+              ((Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

+                *)local_f0);

+    Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>::

+    ~Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

+              ((Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

+                *)&local_180);

+    return ptVar27;

+  }

+  local_res18 = 0x20000;

+  MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0x518);

+LAB_3:

+                    /* WARNING: Subroutine does not return */

+  ExRaiseAccessViolation();

 }
```

## `NtUserDisplayConfigSetDeviceInfo`  (modified)

```diff
--- NtUserDisplayConfigSetDeviceInfo
+++ NtUserDisplayConfigSetDeviceInfo
@@ -1,7 +1,156 @@
 

-void NtUserDisplayConfigSetDeviceInfo(void)

+int NtUserDisplayConfigSetDeviceInfo(void *param_1)

 

 {

-  return;

+  tagUIPI_INFO *ptVar1;

+  bool bVar2;

+  bool bVar3;

+  char cVar4;

+  int iVar5;

+  DISPLAYCONFIG_DEVICE_INFO_TYPE DVar6;

+  longlong lVar7;

+  longlong lVar8;

+  tagTHREADINFO *ptVar9;

+  DISPLAYCONFIG_DEVICE_INFO_TYPE *pDVar10;

+  DISPLAYCONFIG_DEVICE_INFO_TYPE *pDVar11;

+  ulonglong _Size;

+  undefined1 uVar12;

+  undefined8 local_58;

+  DISPLAYCONFIG_DEVICE_INFO_TYPE *local_50;

+  code *local_48;

+  undefined4 local_40;

+  undefined4 local_3c;

+  undefined4 local_38;

+  CDisplayScenarioContextScope local_28 [32];

+  

+                    /* 0x165c40  1962  NtUserDisplayConfigSetDeviceInfo */

+  local_28[0] = (CDisplayScenarioContextScope)0x0;

+  CDisplayScenarioContextScope::ContextScopeConstructor(local_28,(_GUID *)0x0,0x1e,0);

+  pDVar10 = (DISPLAYCONFIG_DEVICE_INFO_TYPE *)0x0;

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>::

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>

+            ((Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)> *)

+             &local_58);

+  lVar7 = W32GetUserSessionState();

+  uVar12 = 0;

+  lVar8 = UserCritInternal::`anonymous_namespace'::EnterCritInternal

+                    (lVar7,0,0,<lambda_63b61c2369133a205197eda5bd671ee7>::<lambda_invoker_cdecl>);

+  *(longlong *)(lVar7 + 0x10) = lVar8;

+  if (lVar8 != 0) {

+    DestroySharedUserCritDeferredUnlockList(lVar7 + 0x4d78);

+    DestroyDeferredUnlockObjectAssignmentList(lVar7 + 0x4db0);

+    DestroyDeferredUnlockObjectAssignmentList(lVar7 + 0x4da0);

+  }

+  lVar7 = W32GetUserGdiSessionState();

+  if (*(int *)(lVar7 + 0x20) == 0) {

+LAB_0:

+    iVar5 = -0x3fffffff;

+    goto LAB_1;

+  }

+  ptVar9 = PtiCurrent();

+  iVar5 = Feature_UIPIModernization__private_IsEnabledDeviceUsageNoInline();

+  ptVar1 = (tagUIPI_INFO *)(*(longlong *)(ptVar9 + 0x1d0) + 0x130);

+  if (iVar5 == 0) {

+    local_40 = 0x2000;

+    local_3c = 0xffffffff;

+    local_38 = 0;

+    uVar12 = 0;

+    bVar2 = UIPrivilegeIsolation::CheckAccess(ptVar1,(tagUIPI_INFO *)&local_40,0);

+  }

+  else {

+    bVar2 = UIPrivilegeIsolation::MeetsUIPIThreshold

+                      ((UIPIAccessor *)

+                       (-(ulonglong)(*(longlong *)(ptVar9 + 0x1d0) != 0) & (ulonglong)ptVar1),0x2000

+                      );

+  }

+  bVar3 = tagPROCESSINFO::CanPerformUIOperation(*(tagPROCESSINFO **)(ptVar9 + 0x1d0),0x10);

+  if ((bVar3) && (bVar2 != false)) {

+    pDVar10 = *(DISPLAYCONFIG_DEVICE_INFO_TYPE **)MmUserProbeAddress_exref;

+    pDVar11 = (DISPLAYCONFIG_DEVICE_INFO_TYPE *)((longlong)param_1 + 4U);

+    if (pDVar10 <= (DISPLAYCONFIG_DEVICE_INFO_TYPE *)((longlong)param_1 + 4U)) {

+      pDVar11 = pDVar10;

+    }

+    DVar6 = *pDVar11;

+    _Size = (ulonglong)DVar6;

+    if (DVar6 < 0x14) {

+      iVar5 = -0x3fffffdd;

+      pDVar10 = (DISPLAYCONFIG_DEVICE_INFO_TYPE *)0x0;

+      goto LAB_1;

+    }

+    pDVar10 = Win32AllocPoolWithQuotaZInitImpl((__uint64)pDVar10,_Size,0x63447355);

+    if (pDVar10 == (DISPLAYCONFIG_DEVICE_INFO_TYPE *)0x0) {

+                    /* WARNING: Subroutine does not return */

+      ExRaiseStatus(0xc0000017);

+    }

+    if (local_48 != (code *)0xffffffffffffffff) {

+      ptVar9 = PtiCurrent();

+                    /* WARNING: Subroutine does not return */

+      KeBugCheckEx(0x164,0x12,&local_58,pDVar10,ptVar9);

+    }

+    ptVar9 = PtiCurrent();

+    local_58 = *(undefined8 *)(ptVar9 + 0x180);

+    *(undefined8 **)(ptVar9 + 0x180) = &local_58;

+    local_48 = GreDeleteFastMutex;

+    local_50 = pDVar10;

+    lVar7 = PsGetCurrentProcessWow64Process();

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

+                    /* WARNING: Subroutine does not return */

+      ExRaiseDatatypeMisalignment();

+    }

+    RtlCopyVolatileMemory(pDVar10,param_1,_Size);

+    uVar12 = (undefined1)_Size;

+    pDVar10[1] = DVar6;

+    lVar7 = W32GetUserGdiSessionState();

+    if (*(int *)(lVar7 + 0x24) != 0) goto LAB_0;

+    if (*pDVar10 == 0xffffffed) {

+      if (gbOSTestSigningEnabled == '\0') {

+        cVar4 = RtlIsMultiSessionSku();

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

+        iVar5 = IsCurrentProcessDwm();

+        goto LAB_3;

+      }

+    }

+    else {

+      iVar5 = UserIsWddmConnectedSession();

+LAB_3:

+      if (iVar5 == 0) goto LAB_2;

+    }

+    DVar6 = DispConfigTypes::GetSetterTypeSize(*pDVar10);

+    if ((DVar6 == 0) || (pDVar10[1] != DVar6)) {

+      iVar5 = -0x3ffffff3;

+    }

+    else {

+      iVar5 = PreAllocateForPrimaryMonitorChange();

+      if (iVar5 == 0) {

+        iVar5 = -0x3fffffe9;

+      }

+      else {

+        iVar5 = DrvDisplayConfigSetDeviceInfo(pDVar10);

+        if (iVar5 == -0x7ffffffb) {

+          iVar5 = -0x3fffffdd;

+        }

+        else if (iVar5 != -0x3fffffdd) {

+          iVar5 = _DeviceInfoTranslateStatusDefault(*pDVar10);

+        }

+      }

+    }

+  }

+  else {

+LAB_2:

+    iVar5 = -0x3fffffde;

+  }

+LAB_1:

+  if (pDVar10 != (DISPLAYCONFIG_DEVICE_INFO_TYPE *)0x0) {

+    Win32RawLockedItemBase<DISPLAYCONFIG_DEVICE_INFO_HEADER,&void___cdecl_Win32FreePool(void*___ptr64),1,1,1>

+    ::UnlockWorker((Win32RawLockedItemBase<DISPLAYCONFIG_DEVICE_INFO_HEADER,&void___cdecl_Win32FreePool(void*___ptr64),1,1,1>

+                    *)&local_58,false,(bool)uVar12);

+  }

+  ReleaseUserCriticalSection();

+  Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>::

+  ~Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

+            ((Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

+              *)&local_58);

+  CDisplayScenarioContextScope::~CDisplayScenarioContextScope(local_28);

+  return iVar5;

 }
```

## `NtUserSystemParametersInfo`  (modified)

```diff
--- NtUserSystemParametersInfo
+++ NtUserSystemParametersInfo
@@ -1,21 +1,1367 @@
 

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

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

-

-undefined4 NtUserSystemParametersInfo(void)

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

 

 {

-  undefined4 unaff_EBX;

-  code *unaff_retaddr;

-  undefined8 in_stack_00000060;

+  uint uVar1;

+  void *_Src;

+  uint uVar2;

+  uint uVar3;

+  bool bVar4;

+  char cVar5;

+  bool bVar6;

+  int iVar7;

+  longlong lVar8;

+  longlong lVar9;

+  longlong *plVar10;

+  uint *puVar11;

+  tagTHREADINFO *ptVar12;

+  uint *puVar13;

+  uint *puVar14;

+  ushort uVar15;

+  tagPROCESSINFO *this;

+  uint *puVar16;

+  undefined8 uVar17;

+  void *pvVar18;

+  ulonglong uVar19;

+  uint *puVar20;

+  tagPROCESSINFO *ptVar21;

+  ulonglong uVar22;

+  uint local_338;

+  uint *local_330;

+  uint local_328;

+  undefined8 local_320;

+  uint *local_318;

+  code *local_310;

+  undefined8 local_308;

+  uint *local_300;

+  code *local_2f8;

+  int local_2f0;

+  uint local_2ec;

+  undefined4 local_2e8;

+  uint *local_2e0;

+  undefined4 local_2c8;

+  undefined4 local_2c4;

+  undefined4 local_2c0;

+  undefined8 local_2b0;

+  undefined8 uStack_2a8;

+  undefined8 local_2a0;

+  undefined8 local_298;

+  void *pvStack_290;

+  uint *local_288;

+  uint *local_280;

+  uint local_268 [140];

   

-  (*unaff_retaddr)();

-  in_stack_00000060 = 0xffffffffffffffff;

+                    /* 0x16c7b0  2043  NtUserSystemParametersInfo */

+  ptVar21 = (tagPROCESSINFO *)(ulonglong)param_1;

+  local_298 = 0;

+  pvStack_290 = (void *)0x0;

+  local_338 = 0;

+  local_2e0 = (uint *)0x0;

+  local_2f0 = 0;

+  lVar8 = W32GetUserSessionState();

+  lVar9 = UserCritInternal::`anonymous_namespace'::EnterCritInternal

+                    (lVar8,0,0,<lambda_63b61c2369133a205197eda5bd671ee7>::<lambda_invoker_cdecl>);

+  *(longlong *)(lVar8 + 0x10) = lVar9;

+  if (lVar9 != 0) {

+    DestroySharedUserCritDeferredUnlockList(lVar8 + 0x4d78);

+    DestroyDeferredUnlockObjectAssignmentList(lVar8 + 0x4db0);

+    DestroyDeferredUnlockObjectAssignmentList(lVar8 + 0x4da0);

+  }

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>::

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>

+            ((Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)> *)

+             &local_308);

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>::

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>

+            ((Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)> *)

+             &local_320);

+  local_2ec = param_4 & 3;

+  iVar7 = Feature_UIPIModernization__private_IsEnabledDeviceUsageNoInline();

+  if (iVar7 == 0) {

+    local_2c8 = 0x2000;

+    local_2c4 = 0xffffffff;

+    local_2c0 = 0;

+    plVar10 = (longlong *)PsGetCurrentProcessWin32Process();

+    uVar22 = 0;

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

+      uVar22 = (ulonglong)plVar10 & -(ulonglong)(*plVar10 != 0);

+    }

+    bVar4 = UIPrivilegeIsolation::CheckAccess

+                      ((tagUIPI_INFO *)(uVar22 + 0x130),(tagUIPI_INFO *)&local_2c8,0);

+  }

+  else {

+    plVar10 = (longlong *)PsGetCurrentProcessWin32Process();

+    uVar22 = 0;

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

+      uVar22 = (ulonglong)plVar10 & -(ulonglong)(*plVar10 != 0);

+    }

+    bVar4 = UIPrivilegeIsolation::MeetsUIPIThreshold

+                      ((UIPIAccessor *)(-(ulonglong)(uVar22 != 0) & uVar22 + 0x130),0x2000);

+  }

+  iVar7 = Feature_LearningModeExpansion__private_IsEnabledDeviceUsageNoInline();

+  if (iVar7 == 0) {

+    this = *(tagPROCESSINFO **)(lVar9 + 0x1d0);

+    bVar6 = tagPROCESSINFO::HasUILimit(this,8);

+    if ((bVar6) || (bVar4 == false)) {

+      if (param_1 < 0x6e) {

+        if (param_1 != 0x6d) {

+          if (param_1 < 0x38) {

+            if (param_1 != 0x37) {

+              if (param_1 < 0x1e) {

+                if (param_1 != 0x1d) {

+                  if (param_1 < 0x14) {

+                    uVar1 = 0xaa854 >> (param_1 & 0x1f);

+LAB_0:

+                    if ((uVar1 & 1) == 0) goto LAB_1;

+                  }

+                  else if (((param_1 != 0x14) && (param_1 != 0x15)) && (param_1 != 0x17)) {

+                    iVar7 = param_1 - 0x18;

+                    bVar4 = iVar7 == 0;

+                    goto LAB_2;

+                  }

+                }

+              }

+              else if (param_1 < 0x2b) {

+                if (((((param_1 != 0x2a) && (param_1 != 0x1e)) && (param_1 != 0x20)) &&

+                    ((param_1 != 0x21 && (param_1 != 0x22)))) && (param_1 != 0x24)) {

+                  bVar4 = param_1 == 0x25;

+                  goto joined_r0x00014016ccb6;

+                }

+              }

+              else if ((param_1 != 0x2c) && (param_1 != 0x2e)) {

+                iVar7 = param_1 - 0x2f;

+                goto LAB_3;

+              }

+            }

+          }

+          else if (param_1 < 0x56) {

+            if (param_1 != 0x55) {

+              if (param_1 < 0x4a) {

+                if (param_1 - 0x39 < 0x11) {

+                  this = (tagPROCESSINFO *)0x15515;

+                  uVar1 = 0x15515 >> (param_1 - 0x39 & 0x1f);

+                  goto LAB_0;

+                }

+                goto LAB_1;

+              }

+              if (((param_1 != 0x4b) && (param_1 != 0x4c)) &&

+                 ((param_1 != 0x4d && ((param_1 != 0x4e && (param_1 != 0x51)))))) {

+                bVar4 = param_1 == 0x52;

+                goto LAB_4;

+              }

+            }

+          }

+          else {

+            if (0x60 < param_1) {

+              if (param_1 - 0x61 < 0xb) {

+                bVar4 = (param_1 - 0x61 & 1) == 0;

+LAB_4:

+                if (bVar4) goto LAB_5;

+              }

+              goto LAB_1;

+            }

+            if ((((param_1 != 0x60) && (param_1 != 0x56)) && (param_1 != 0x57)) &&

+               ((param_1 != 0x58 && (param_1 != 0x5a)))) {

+              iVar7 = param_1 - 0x5b;

+              bVar4 = iVar7 == 0;

+              goto LAB_6;

+            }

+          }

+        }

+      }

+      else if (param_1 < 0x1018) {

+        if (param_1 != 0x1017) {

+          if (param_1 < 0xae) {

+            if (param_1 != 0xad) {

+              if (param_1 < 0x9a) {

+                if (((param_1 != 0x99) && (param_1 != 0x6f)) &&

+                   ((param_1 != 0x71 && ((param_1 != 0x75 && (param_1 != 0x77)))))) {

+                  iVar7 = param_1 - 0x93;

+                  goto LAB_7;

+                }

+              }

+              else if ((((param_1 != 0x9b) && (param_1 != 0xa1)) && (param_1 != 0xa3)) &&

+                      (param_1 != 0xa6)) {

+                iVar7 = param_1 - 0xa9;

+                bVar4 = iVar7 == 0;

+                goto LAB_6;

+              }

+            }

+          }

+          else if (param_1 < 0x1008) {

+            if (((param_1 != 0x1007) && (param_1 != 0xaf)) &&

+               ((param_1 != 0xb1 && (param_1 != 0xb3)))) {

+              iVar7 = param_1 - 0x1001;

+              bVar4 = iVar7 == 0;

+              goto LAB_2;

+            }

+          }

+          else if (((param_1 != 0x1009) && (param_1 != 0x100b)) &&

+                  ((param_1 != 0x100d && (param_1 != 0x100f)))) {

+            iVar7 = param_1 - 0x1013;

+            goto LAB_8;

+          }

+        }

+      }

+      else if (param_1 < 0x2006) {

+        if (param_1 != 0x2005) {

+          if (param_1 < 0x104c) {

+            if (((param_1 != 0x104b) && (param_1 != 0x1019)) &&

+               ((param_1 != 0x101d &&

+                ((((param_1 != 0x101f && (param_1 != 0x1027)) && (param_1 != 0x1041)) &&

+                 (param_1 != 0x1043)))))) {

+              bVar4 = param_1 == 0x1049;

+joined_r0x00014016ccb6:

+              if (!bVar4) goto LAB_1;

+            }

+          }

+          else if (((param_1 != 0x104d) && (param_1 != 0x104f)) &&

+                  ((param_1 != 0x1051 && (param_1 != 0x1053)))) {

+            iVar7 = param_1 - 0x2001;

+            bVar4 = iVar7 == 0;

+LAB_6:

+            if (!bVar4) {

+              bVar4 = iVar7 == 2;

+              goto joined_r0x00014016ccb6;

+            }

+          }

+        }

+      }

+      else if (param_1 < 0x201c) {

+        if ((((param_1 != 0x201b) && (param_1 != 0x2009)) && (param_1 != 0x200f)) &&

+           (param_1 != 0x2011)) {

+          iVar7 = param_1 - 0x2015;

+LAB_7:

+          if (iVar7 != 0) {

+            iVar7 = iVar7 + -2;

+LAB_8:

+            if (iVar7 != 0) {

+              bVar4 = iVar7 == 2;

+              goto joined_r0x00014016ccb6;

+            }

+          }

+        }

+      }

+      else if ((param_1 != 0x201d) && (param_1 != 0x2031)) {

+        iVar7 = param_1 - 0x2033;

+LAB_3:

+        if (iVar7 != 0) {

+          iVar7 = iVar7 + -2;

+          bVar4 = iVar7 == 0;

+LAB_2:

+          if (!bVar4) {

+            iVar7 = iVar7 + -2;

+            bVar4 = iVar7 == 0;

+            goto LAB_6;

+          }

+        }

+      }

+LAB_5:

+      plVar10 = (longlong *)PsGetCurrentProcessWin32Process();

+      uVar22 = 0;

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

+        uVar22 = (ulonglong)plVar10 & -(ulonglong)(*plVar10 != 0);

+      }

+      EtwTraceUIPISystemError(uVar22,0,1);

+      goto LAB_9;

+    }

+LAB_1:

+    lVar8 = 4;

+    puVar11 = Win32AllocPoolWithQuotaZInitImpl((__uint64)this,0x228,0x79747355);

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

+      uVar17 = 8;

+      goto LAB_10;

+    }

+    if (local_2f8 != (code *)0xffffffffffffffff) {

+      ptVar12 = PtiCurrent();

+                    /* WARNING: Subroutine does not return */

+      KeBugCheckEx(0x164,0x12,&local_308,puVar11,ptVar12);

+    }

+    ptVar12 = PtiCurrent();

+    local_308 = *(undefined8 *)(ptVar12 + 0x180);

+    *(undefined8 **)(ptVar12 + 0x180) = &local_308;

+    local_2f8 = GreDeleteFastMutex;

+    local_330 = puVar11;

+    local_328 = param_2;

+    local_300 = puVar11;

+    if (0x1026 < param_1) {

+      local_330 = param_3;

+      if (param_1 != 0x1027) {

+        if (param_1 != 0x201d) goto LAB_11;

+        local_330 = param_3;

+        if (((param_3 != (uint *)0x0) && (local_330 = param_3, param_3 != (uint *)0x1)) &&

+           (local_330 = param_3, param_3 != (uint *)0x2)) {

+          UserSetLastError(0x57);

+          iVar7 = 0;

+          Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+          ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                    ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      *)&local_320);

+          Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+          ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                    ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      *)&local_308);

+          goto LAB_12;

+        }

+      }

+      goto LAB_13;

+    }

+    if (param_1 == 0x1026) {

+LAB_14:

+      local_338 = 4;

+      puVar20 = param_3;

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

+        puVar20 = *(uint **)MmUserProbeAddress_exref;

+      }

+      *puVar20 = *puVar20;

+      local_2f0 = 1;

+      local_330 = puVar11;

+      local_2e0 = param_3;

+    }

+    else {

+      if (param_1 < 99) {

+        if (param_1 == 0x62) goto LAB_14;

+        if (param_1 < 0x33) {

+          if (param_1 == 0x32) {

+            local_338 = 0x18;

+          }

+          else {

+            if (param_1 < 0x1a) {

+              if (param_1 != 0x19) {

+                if (param_1 < 0xf) {

+                  if ((param_1 != 0xe) && (param_1 != 1)) {

+                    if (param_1 == 3) goto LAB_15;

+                    if (param_1 == 4) goto LAB_16;

+                    if ((param_1 != 5) && (param_1 != 10)) {

+                      if (param_1 != 0xd) goto LAB_11;

+LAB_17:

+                      local_330 = param_3;

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

+                    }

+                  }

+                }

+                else if ((param_1 != 0x10) && (param_1 != 0x12)) {

+                  if (param_1 == 0x14) {

+                    local_330 = param_3;

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

+                      local_330 = (uint *)0xffffffffffffffff;

+                    }

+                    if ((local_330 != (uint *)0xfffffffffffffffe) &&

+                       (local_330 != (uint *)0xffffffffffffffff)) {

+LAB_18:

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

+                        local_330 = *(uint **)MmUserProbeAddress_exref;

+                      }

+                      uVar1 = *local_330;

+                      local_298 = CONCAT44(local_298._4_4_,uVar1);

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

+                      local_2e8 = uVar1;

+                      pvStack_290 = _Src;

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

+                    /* WARNING: Subroutine does not return */

+                        ExRaiseDatatypeMisalignment();

+                      }

+                      uVar15 = (ushort)uVar1;

+                      uVar22 = (ulonglong)uVar15;

+                      pvVar18 = (void *)((longlong)_Src + uVar22 + 2);

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

+                    /* WARNING: Subroutine does not return */

+                        ExRaiseAccessViolation();

+                      }

+                      local_2e8._2_2_ = (ushort)(uVar1 >> 0x10);

+                      if (local_2e8._2_2_ < uVar15) {

+                        if ((uVar1 & 1) == 0) goto LAB_19;

+                      }

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

+                        local_330 = Win32AllocPoolWithQuotaZInitImpl

+                                              ((ulonglong)uVar1,uVar22 + 2,0x79747355);

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

+                    /* WARNING: Subroutine does not return */

+                          ExRaiseStatus(0xc0000017);

+                        }

+                        if (local_310 != (code *)0xffffffffffffffff) {

+                          ptVar12 = PtiCurrent();

+                    /* WARNING: Subroutine does not return */

+                          KeBugCheckEx(0x164,0x12,&local_320,local_330,ptVar12);

+                        }

+                        ptVar12 = PtiCurrent();

+                        local_320 = *(undefined8 *)(ptVar12 + 0x180);

+                        *(undefined8 **)(ptVar12 + 0x180) = &local_320;

+                        local_310 = GreDeleteFastMutex;

+                        local_318 = local_330;

+                        memmove(local_330,_Src,uVar22);

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

+                        goto LAB_13;

+                      }

+                      local_2ec = 0x20000;

+                      MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0x15c);

+LAB_19:

+                    /* WARNING: Subroutine does not return */

+                      ExRaiseAccessViolation();

+                    }

+                  }

+                  else {

+                    if (param_1 != 0x15) {

+                      if (param_1 != 0x16) {

+                        if (param_1 == 0x18) goto LAB_17;

+                        goto LAB_11;

+                      }

+                      goto LAB_14;

+                    }

+                    local_330 = param_3;

+                    if (param_2 == 0xffffffff) goto LAB_13;

+                    local_330 = param_3;

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

+                  }

+                  local_328 = 0xffffffff;

+                  goto LAB_13;

+                }

+              }

+              goto LAB_14;

+            }

+            if (param_1 < 0x2b) {

+              if (param_1 == 0x2a) {

+                local_338 = param_2;

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

+                  UserSetLastError(0x57);

+                  iVar7 = 0;

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_320);

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_308);

+                  goto LAB_12;

+                }

+                goto LAB_20;

+              }

+              if (param_1 == 0x1b) goto LAB_14;

+              if (param_1 == 0x1f) {

+                local_338 = 0x5c;

+              }

+              else {

+                if (param_1 == 0x22) {

+                  local_338 = 0x5c;

+                  goto LAB_21;

+                }

+                if ((param_1 == 0x23) || (param_1 == 0x26)) goto LAB_14;

+                if (param_1 != 0x29) goto LAB_11;

+                local_338 = param_2;

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

+                  UserSetLastError(0x57);

+                  iVar7 = 0;

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_320);

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_308);

+                  goto LAB_12;

+                }

+              }

+            }

+            else {

+              if (param_1 != 0x2b) {

+                if (param_1 == 0x2c) {

+                  local_338 = 0x14;

+                }

+                else {

+                  if (param_1 == 0x2d) {

+                    local_338 = 0x6c;

+                    goto LAB_22;

+                  }

+                  if (param_1 != 0x2e) {

+                    if (param_1 == 0x2f) goto LAB_23;

+                    if (param_1 == 0x30) goto LAB_24;

+                    goto LAB_11;

+                  }

+                  local_338 = 0x6c;

+                }

+                goto LAB_21;

+              }

+              local_338 = 0x14;

+            }

+          }

+        }

+        else {

+          if (0x43 < param_1) {

+            if (param_1 < 0x51) {

+              if (((param_1 != 0x50) && (param_1 != 0x44)) && (param_1 != 0x46)) {

+                if (param_1 == 0x48) goto LAB_25;

+                if (param_1 == 0x49) goto LAB_26;

+                if (param_1 != 0x4a) {

+                  bVar4 = param_1 == 0x4f;

+                  goto LAB_27;

+                }

+              }

+            }

+            else if ((param_1 != 0x53) && (param_1 != 0x54)) {

+              if (param_1 == 0x59) goto LAB_25;

+              if (param_1 == 0x5a) goto LAB_26;

+              iVar7 = param_1 - 0x5e;

+              if (iVar7 != 0) {

+LAB_28:

+                bVar4 = iVar7 == 1;

+                goto LAB_27;

+              }

+            }

+            goto LAB_14;

+          }

+          if (param_1 == 0x43) {

+            local_2b0 = 0;

+            uStack_2a8 = 0;

+            local_2a0 = 0;

+            RtlCopyFromUser(&local_2b0,param_3,0x18);

+            *(undefined8 *)puVar11 = local_2b0;

+            *(undefined8 *)(puVar11 + 2) = uStack_2a8;

+            *(undefined8 *)(puVar11 + 4) = local_2a0;

+            uVar22 = *(ulonglong *)(puVar11 + 4);

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

+                    /* WARNING: Subroutine does not return */

+              ExRaiseDatatypeMisalignment();

+            }

+            uVar15 = (ushort)puVar11[2];

+            uVar19 = (ulonglong)uVar15 + 2 + uVar22;

+            if ((uVar19 <= uVar22) || (*(ulonglong *)MmUserProbeAddress_exref <= uVar19)) {

+                    /* WARNING: Subroutine does not return */

+              ExRaiseAccessViolation();

+            }

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

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

+            }

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

+              if (uVar15 == 0) {

+                puVar11[4] = 0;

+                puVar11[5] = 0;

+              }

+              goto LAB_13;

+            }

+            local_2e8 = 0x20000;

+            MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0x1ea);

+LAB_29:

+                    /* WARNING: Subroutine does not return */

+            ExRaiseAccessViolation();

+          }

+          if (0x3a < param_1) {

+            if (param_1 == 0x3b) {

+LAB_26:

+              local_338 = 8;

+            }

+            else {

+              if (param_1 == 0x3c) goto LAB_15;

+              if (param_1 != 0x3d) {

+                if (param_1 == 0x40) goto LAB_30;

+                if (param_1 == 0x41) goto LAB_31;

+                if (param_1 == 0x42) {

+                  local_338 = 0x10;

+                  lVar8 = PsGetCurrentProcessWow64Process();

+                  ProbeForWrite(param_3,0x10,(-(uint)(lVar8 != 0) & 0xfffffffd) + 4);

+                  uVar1 = param_3[1];

+                  uVar2 = param_3[2];

+                  uVar3 = param_3[3];

+                  *puVar11 = *param_3;

+                  puVar11[1] = uVar1;

+                  puVar11[2] = uVar2;

+                  puVar11[3] = uVar3;

+                  local_2e0 = param_3;

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

+                  goto LAB_32;

+                }

+                goto LAB_11;

+              }

+LAB_16:

+              local_338 = 0xc;

+            }

+LAB_21:

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

+                    /* WARNING: Subroutine does not return */

+              ExRaiseDatatypeMisalignment();

+            }

+            goto LAB_33;

+          }

+          if (param_1 != 0x3a) {

+            if (param_1 == 0x33) {

+              local_338 = 0x18;

+              goto LAB_21;

+            }

+            if (param_1 != 0x34) {

+              if (param_1 != 0x35) {

+                if (param_1 == 0x36) goto LAB_34;

+                iVar7 = param_1 - 0x37;

+                if (iVar7 == 0) goto LAB_35;

+                goto LAB_28;

+              }

+              goto LAB_26;

+            }

+          }

+LAB_25:

+          local_338 = 8;

+        }

+      }

+      else {

+        if (param_1 < 0x95) {

+          if (param_1 == 0x94) {

+            if (param_2 != 0x28) {

+              UserSetLastError(0x57);

+              iVar7 = 0;

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_320);

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_308);

+              goto LAB_12;

+            }

+            local_338 = 0x28;

+            goto LAB_22;

+          }

+          if (param_1 < 0x7b) {

+            if (param_1 != 0x7a) {

+              if (param_1 < 0x71) {

+                if (((param_1 - 100 & 0xfffffff1) != 0) || (param_1 == 0x72)) {

+LAB_11:

+                  local_330 = param_3;

+                  if (0xb5 < param_1) {

+                    if ((0x55 < param_1 - 0x1000) && (0x39 < param_1 - 0x2000)) {

+                      UserSetLastError(0x57);

+                      iVar7 = 0;

+                      Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      ::

+                      ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                  *)&local_320);

+                      Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      ::

+                      ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                  *)&local_308);

+                      goto LAB_12;

+                    }

+                    iVar7 = 0;

+                    if ((param_2 != 0) &&

+                       (((ptVar12 = PtiCurrent(), 0x400 < *(uint *)(ptVar12 + 0x2a0) ||

+                         (param_1 != 0x103f)) || (param_2 != 1)))) {

+                      UserSetLastError(0x57);

+                      Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      ::

+                      ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                  *)&local_320);

+                      Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      ::

+                      ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                  *)&local_308);

+                      goto LAB_12;

+                    }

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

+                    if (param_1 == 0x200b) {

+                      local_330 = param_3;

+                      local_280 = param_3;

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

+                        UserSetLastError(0x57);

+                        iVar7 = 0;

+                        Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ::

+                        ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                  ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                    *)&local_320);

+                        Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ::

+                        ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                  ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                    *)&local_308);

+                        goto LAB_12;

+                      }

+                    }

+                    else {

+                      local_330 = param_3;

+                      if ((param_1 == 0x2013) &&

+                         (local_330 = param_3, local_288 = param_3,

+                         ((ulonglong)param_3 & 0xfffffffe) != 0)) {

+                        UserSetLastError(0x57);

+                        Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ::

+                        ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                  ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                    *)&local_320);

+                        Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ::

+                        ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                  ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                    *)&local_308);

+                        goto LAB_12;

+                      }

+                    }

+                  }

+                  goto LAB_13;

+                }

+              }

+              else if (param_1 != 0x72) {

+                if (param_1 == 0x73) {

+                  local_2e0 = param_3;

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

+                  if (0x103 < param_2) {

+                    param_2 = 0x104;

+                  }

+                  local_338 = param_2 * 2;

+                  local_328 = param_2;

+LAB_32:

+                  local_2f0 = 1;

+                  goto LAB_13;

+                }

+                if (param_1 == 0x74) goto LAB_15;

+                if (param_1 == 0x75) goto LAB_16;

+                iVar7 = param_1 - 0x76;

+                goto LAB_36;

+              }

+            }

+          }

+          else if (param_1 < 0x89) {

+            if (((param_1 != 0x88) && (param_1 != 0x7c)) &&

+               ((param_1 != 0x7e && ((param_1 != 0x80 && (param_1 != 0x82)))))) {

+              iVar7 = param_1 - 0x84;

+LAB_36:

+              if (iVar7 != 0) {

+                bVar4 = iVar7 == 2;

+LAB_27:

+                if (!bVar4) goto LAB_11;

+              }

+            }

+          }

+          else if (((param_1 != 0x8a) && (param_1 != 0x8c)) &&

+                  ((param_1 != 0x8e && (param_1 != 0x90)))) {

+            if (param_1 != 0x92) {

+              if (param_1 == 0x93) {

+                if (param_2 != 0x44) {

+                  UserSetLastError(0x57);

+                  iVar7 = 0;

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_320);

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_308);

+                  goto LAB_12;

+                }

+                local_338 = 0x44;

+                goto LAB_21;

+              }

+              goto LAB_11;

+            }

+            if (param_2 != 0x44) {

+              UserSetLastError(0x57);

+              iVar7 = 0;

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_320);

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_308);

+              goto LAB_12;

+            }

+            local_338 = 0x44;

+            goto LAB_22;

+          }

+          goto LAB_14;

+        }

+        if (param_1 < 0xa6) {

+          if (param_1 == 0xa5) {

+LAB_37:

+            if (param_2 != 0xc) {

+              UserSetLastError(0x57);

+              iVar7 = 0;

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_320);

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_308);

+              goto LAB_12;

+            }

+LAB_15:

+            local_338 = 0xc;

+          }

+          else {

+            if (param_1 < 0x9c) {

+              if (param_1 == 0x9b) {

+                if (param_2 != 0x224) {

+                  UserSetLastError(0x57);

+                  iVar7 = 0;

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_320);

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_308);

+                  goto LAB_12;

+                }

+                local_338 = 0x224;

+                memset(local_268,0,0x224);

+                RtlCopyFromUser(local_268,param_3,0x224);

+                puVar20 = local_268;

+                puVar13 = puVar11;

+                do {

+                  puVar16 = puVar13;

+                  puVar14 = puVar20;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+                  lVar8 = lVar8 + -1;

+                  puVar20 = puVar14 + 0x20;

+                  puVar13 = puVar16 + 0x20;

+                } while (lVar8 != 0);

+                uVar1 = puVar14[0x21];

+                uVar2 = puVar14[0x22];

+                uVar3 = puVar14[0x23];

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

+                puVar16[0x21] = uVar1;

+                puVar16[0x22] = uVar2;

+                puVar16[0x23] = uVar3;

+                uVar1 = puVar14[0x25];

+                uVar2 = puVar14[0x26];

+                uVar3 = puVar14[0x27];

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

+                puVar16[0x25] = uVar1;

+                puVar16[0x26] = uVar2;

+                puVar16[0x27] = uVar3;

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

+                if (0x104 < puVar11[6]) {

+                  UserSetLastError(0x57);

+                  iVar7 = 0;

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_320);

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_308);

+                  goto LAB_12;

+                }

+                goto LAB_13;

+              }

+              if (param_1 == 0x95) {

+                if (param_2 != 0x28) {

+                  UserSetLastError(0x57);

+                  iVar7 = 0;

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_320);

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_308);

+                  goto LAB_12;

+                }

+                local_338 = 0x28;

+              }

+              else {

+                if (param_1 == 0x96) {

+                  if (param_2 != 0x1c) {

+                    UserSetLastError(0x57);

+                    iVar7 = 0;

+                    Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                    ::

+                    ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                *)&local_320);

+                    Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                    ::

+                    ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                *)&local_308);

+                    goto LAB_12;

+                  }

+LAB_34:

+                  local_338 = 0x1c;

+                  goto LAB_22;

+                }

+                if (param_1 == 0x97) {

+                  if (param_2 != 0x1c) {

+                    UserSetLastError(0x57);

+                    iVar7 = 0;

+                    Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                    ::

+                    ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                *)&local_320);

+                    Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                    ::

+                    ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                *)&local_308);

+                    goto LAB_12;

+                  }

+LAB_35:

+                  local_338 = 0x1c;

+                }

+                else {

+                  if (param_1 == 0x98) {

+                    if (param_2 != 0x80) {

+                      UserSetLastError(0x57);

+                      iVar7 = 0;

+                      Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      ::

+                      ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                  *)&local_320);

+                      Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      ::

+                      ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                  *)&local_308);

+                      goto LAB_12;

+                    }

+                    local_338 = 0x80;

+                    goto LAB_22;

+                  }

+                  if (param_1 != 0x99) {

+                    if (param_1 == 0x9a) {

+                      if (param_2 != 0x224) {

+                        UserSetLastError(0x57);

+                        iVar7 = 0;

+                        Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ::

+                        ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                  ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                    *)&local_320);

+                        Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ::

+                        ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                  ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                    *)&local_308);

+                        goto LAB_12;

+                      }

+                      local_338 = 0x224;

+                      lVar9 = PsGetCurrentProcessWow64Process();

+                      ProbeForWrite(param_3,0x224,(-(uint)(lVar9 != 0) & 0xfffffffd) + 4);

+                      puVar20 = param_3;

+                      do {

+                        puVar14 = puVar11;

+                        puVar13 = puVar20;

+                        uVar17 = *(undefined8 *)(puVar13 + 2);

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

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

+                        uVar17 = *(undefined8 *)(puVar13 + 6);

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

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

+                        uVar17 = *(undefined8 *)(puVar13 + 10);

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

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

+                        uVar17 = *(undefined8 *)(puVar13 + 0xe);

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

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

+                        uVar17 = *(undefined8 *)(puVar13 + 0x12);

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

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

+                        uVar17 = *(undefined8 *)(puVar13 + 0x16);

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

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

+                        uVar17 = *(undefined8 *)(puVar13 + 0x1a);

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

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

+                        uVar17 = *(undefined8 *)(puVar13 + 0x1e);

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

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

+                        lVar8 = lVar8 + -1;

+                        puVar20 = puVar13 + 0x20;

+                        puVar11 = puVar14 + 0x20;

+                      } while (lVar8 != 0);

+                      uVar17 = *(undefined8 *)(puVar13 + 0x22);

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

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

+                      uVar17 = *(undefined8 *)(puVar13 + 0x26);

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

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

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

+                      local_2e0 = param_3;

+                      goto LAB_32;

+                    }

+                    goto LAB_11;

+                  }

+                  if (param_2 != 0x80) {

+                    UserSetLastError(0x57);

+                    iVar7 = 0;

+                    Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                    ::

+                    ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                *)&local_320);

+                    Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                    ::

+                    ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                                *)&local_308);

+                    goto LAB_12;

+                  }

+                  local_338 = 0x80;

+                }

+              }

+              goto LAB_21;

+            }

+            if (param_1 != 0x9c) {

+              if (param_1 != 0x9d) {

+                if ((param_1 == 0x9e) || (param_1 == 0xa0)) goto LAB_14;

+                if (param_1 == 0xa2) goto LAB_24;

+                if (param_1 != 0xa3) goto LAB_11;

+              }

+LAB_23:

+              local_338 = 0x10;

+              goto LAB_21;

+            }

+            if (param_2 != 0x10) {

+              UserSetLastError(0x57);

+              iVar7 = 0;

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_320);

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_308);

+              goto LAB_12;

+            }

+LAB_24:

+            local_338 = 0x10;

+          }

+          goto LAB_22;

+        }

+        if (param_1 < 0xb0) {

+          if (param_1 == 0xaf) {

+            lVar8 = PsGetCurrentProcessWow64Process();

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

+                    /* WARNING: Subroutine does not return */

+              ExRaiseDatatypeMisalignment();

+            }

+            if (*param_3 == 0) {

+              local_338 = 0x18;

+            }

+            else if (*param_3 == 1) {

+              local_338 = 0x2c;

+            }

+            else if (*param_3 == 2) {

+              local_338 = 0x30;

+            }

+            else {

+              if (*param_3 != 0xffffffff) {

+                UserSetLastError(0x57);

+                iVar7 = 0;

+                Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+                ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            *)&local_320);

+                Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+                ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            *)&local_308);

+                goto LAB_12;

+              }

+              local_338 = 0x40;

+            }

+            iVar7 = Feature_TouchpadSPIRelaxedCheck__private_IsEnabledDeviceUsageNoInline();

+            if (iVar7 == 0) {

+              if (param_2 != local_338) {

+                UserSetLastError(0x57);

+                iVar7 = 0;

+                Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+                ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            *)&local_320);

+                Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+                ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            *)&local_308);

+                goto LAB_12;

+              }

+            }

+            else if (param_2 < local_338) {

+              UserSetLastError(0x57);

+              iVar7 = 0;

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_320);

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_308);

+              goto LAB_12;

+            }

+LAB_20:

+            if (local_338 != 0) goto LAB_21;

+LAB_33:

+            memmove(puVar11,param_3,(ulonglong)local_338);

+            goto LAB_13;

+          }

+          if (param_1 == 0xa7) goto LAB_37;

+          if ((param_1 == 0xa8) || (param_1 == 0xaa)) goto LAB_14;

+          if (param_1 != 0xac) {

+            if (param_1 == 0xad) {

+              if (param_2 != 4) {

+                UserSetLastError(0x57);

+                iVar7 = 0;

+                Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+                ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            *)&local_320);

+                Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+                ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            *)&local_308);

+                goto LAB_12;

+              }

+              local_338 = 4;

+              goto LAB_21;

+            }

+            if (param_1 != 0xae) goto LAB_11;

+            lVar8 = PsGetCurrentProcessWow64Process();

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

+                    /* WARNING: Subroutine does not return */

+              ExRaiseDatatypeMisalignment();

+            }

+            if (*param_3 == 0) {

+              local_338 = 0x18;

+            }

+            else if (*param_3 == 1) {

+              local_338 = 0x2c;

+            }

+            else if (*param_3 == 2) {

+              local_338 = 0x30;

+            }

+            else {

+              if (*param_3 != 0xffffffff) {

+                UserSetLastError(0x57);

+                iVar7 = 0;

+                Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+                ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            *)&local_320);

+                Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+                ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            *)&local_308);

+                goto LAB_12;

+              }

+              local_338 = 0x40;

+            }

+            iVar7 = Feature_TouchpadSPIRelaxedCheck__private_IsEnabledDeviceUsageNoInline();

+            if (iVar7 == 0) {

+              if (param_2 != local_338) {

+                UserSetLastError(0x57);

+                iVar7 = 0;

+                Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+                ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            *)&local_320);

+                Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+                ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            *)&local_308);

+                goto LAB_12;

+              }

+            }

+            else if (param_2 < local_338) {

+              UserSetLastError(0x57);

+              iVar7 = 0;

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_320);

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_308);

+              goto LAB_12;

+            }

+            *puVar11 = *param_3;

+            goto LAB_22;

+          }

+          if (param_2 != 4) {

+            UserSetLastError(0x57);

+            iVar7 = 0;

+            Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+            ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        *)&local_320);

+            Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+            ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        *)&local_308);

+            goto LAB_12;

+          }

+        }

+        else if (param_1 == 0xb0) {

+          if (param_2 != 0) {

+            UserSetLastError(0x57);

+            iVar7 = 0;

+            Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+            ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        *)&local_320);

+            Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+            ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        *)&local_308);

+            goto LAB_12;

+          }

+        }

+        else {

+          if (param_1 != 0xb2) {

+            if (param_1 != 0xb3) {

+              if (param_1 != 0xb4) {

+                if (param_1 != 0xb5) goto LAB_11;

+                if (param_2 != 0x38) {

+                  UserSetLastError(0x57);

+                  iVar7 = 0;

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_320);

+                  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  ::

+                  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                              *)&local_308);

+                  goto LAB_12;

+                }

+LAB_31:

+                local_338 = 0x38;

+                goto LAB_21;

+              }

+              if (param_2 != 0x38) {

+                UserSetLastError(0x57);

+                iVar7 = 0;

+                Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+                ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            *)&local_320);

+                Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+                ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                            *)&local_308);

+                goto LAB_12;

+              }

+LAB_30:

+              local_338 = 0x38;

+              goto LAB_22;

+            }

+            if (param_2 != 4) {

+              UserSetLastError(0x57);

+              iVar7 = 0;

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_320);

+              Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+              ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                          *)&local_308);

+              goto LAB_12;

+            }

+            local_338 = 4;

+            goto LAB_20;

+          }

+          if (param_2 != 4) {

+            UserSetLastError(0x57);

+            iVar7 = 0;

+            Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+            ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        *)&local_320);

+            Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+            ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                      ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                        *)&local_308);

+            goto LAB_12;

+          }

+        }

+        local_338 = 4;

+      }

+LAB_22:

+      local_2e0 = param_3;

+      lVar8 = PsGetCurrentProcessWow64Process();

+      puVar20 = local_2e0;

+      ProbeForWrite(local_2e0,local_338,(-(uint)(lVar8 != 0) & 0xfffffffd) + 4);

+      local_2f0 = 1;

+      *puVar11 = *puVar20;

+    }

+LAB_13:

+    iVar7 = xxxSystemParametersInfo(ptVar21,local_328,local_330,local_2ec);

+    if (local_2f0 != 0) {

+      memmove(local_2e0,local_330,(ulonglong)local_338);

+    }

+  }

+  else {

+    this = ptVar21;

+    cVar5 = CheckSystemParametersAccess(ptVar21,bVar4);

+    if (cVar5 != '\0') goto LAB_1;

+LAB_9:

+    uVar17 = 5;

+LAB_10:

+    iVar7 = 0;

+    UserSetLastError(uVar17);

+  }

+  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)> *)

+             &local_320);

+  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)> *)

+             &local_308);

+LAB_12:

   ReleaseUserCriticalSection();

-  Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>::

-  ~Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

-            ((Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

-              *)&stack0x00000050);

-  return unaff_EBX;

+  return (longlong)iVar7;

 }
```

## `EtwTraceUIPIMsgError`  (modified)

```diff
--- EtwTraceUIPIMsgError
+++ EtwTraceUIPIMsgError
@@ -1,15 +1,45 @@
 

-/* private: int __cdecl CHidInput::IsTouchpadDevice(struct DEVICEINFO * __ptr64)const __ptr64 */

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

 

-bool EtwTraceUIPIMsgError(undefined8 param_1,longlong param_2)

+void EtwTraceUIPIMsgError(tagPROCESSINFO *param_1,tagPROCESSINFO *param_2)

 

 {

-  bool bVar1;

+  longlong lVar1;

+  char cVar2;

+  bool bVar3;

+  undefined1 auStackY_c8 [32];

+  undefined8 local_58;

+  undefined8 uStack_50;

+  undefined8 local_48;

+  undefined8 uStack_40;

+  undefined4 local_38;

+  ulonglong local_30;

   

-  bVar1 = false;

-  if ((param_2 != 0) && (*(longlong *)(param_2 + 0x1c8) != 0)) {

-    bVar1 = *(int *)(*(longlong *)(param_2 + 0x1c8) + 0x18) == 7;

+                    /* 0xc1f30  1404  EtwTraceUIPIMsgError */

+  local_30 = __security_cookie ^ (ulonglong)auStackY_c8;

+  local_58 = 0;

+  uStack_50 = 0;

+  local_38 = 0;

+  cVar2 = '\x01';

+  local_48 = 0;

+  uStack_40 = 0;

+  EtwpSetTraceHeader((_tagW32KUIPI_Msg_Template_UIPI_Trace_Header *)&local_58,1,(tagTHREADINFO *)0x0

+                     ,param_1,(tagTHREADINFO *)0x0,param_2);

+  if ((Microsoft_Windows_Win32kEnableBits & 4) != 0) {

+    McTemplateK0nqxx_EtwWriteTransfer();

   }

-  return bVar1;

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

+      (-1 < (char)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c))) ||

+     ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

+    cVar2 = '\0';

+  }

+  bVar3 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+  if ((cVar2 != '\0') || (bVar3)) {

+    lVar1 = W32GetUserSessionState();

+    WPP_RECORDER_AND_TRACE_SF_qqDDD

+              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,bVar3,

+               *(undefined8 *)(lVar1 + 0x10f88));

+  }

+  return;

 }
```

## `NtUserChangeDisplaySettings`  (modified)

```diff
--- NtUserChangeDisplaySettings
+++ NtUserChangeDisplaySettings
@@ -1,154 +1,74 @@
 

-longlong NtUserChangeDisplaySettings

-                   (int param_1,undefined4 param_2,int param_3,int param_4,uint param_5,

-                   ulong param_6,int param_7,undefined8 param_8,uint param_9,uint *param_10,

-                   uint *param_11,tagPOINTER_INFO *param_12)

+undefined4

+NtUserChangeDisplaySettings(undefined8 param_1,undefined8 param_2,uint param_3,undefined8 param_4)

 

 {

-  code *pcVar1;

-  int iVar2;

-  uint uVar3;

-  longlong in_RAX;

-  uint *puVar4;

-  longlong lVar5;

-  tagTHREADINFO *ptVar6;

-  undefined8 uVar7;

-  ulonglong uVar8;

-  uint uVar9;

-  tagPOINTER_INFO *_Dst;

-  ushort uVar10;

-  uint *puVar11;

-  uint *puVar12;

-  ulong uVar13;

-  ulonglong uVar14;

-  uint auStack_d8 [2];

-  tagTHREADINFO *aptStack_d0 [11];

-  undefined8 uStack_78;

-  undefined8 uStack_70;

-  undefined8 uStack_68;

-  undefined8 uStack_60;

-  undefined8 local_58;

-  undefined8 local_50;

-  undefined8 local_48;

-  undefined8 uStack_40;

-  undefined8 local_38;

-  undefined8 local_30;

-  undefined8 local_28;

+  tagUIPI_INFO *ptVar1;

+  bool bVar2;

+  bool bVar3;

+  int iVar4;

+  undefined4 uVar5;

+  longlong lVar6;

+  longlong lVar7;

+  tagTHREADINFO *ptVar8;

+  undefined8 uVar9;

+  undefined4 local_38;

+  undefined4 local_34;

+  undefined4 local_30;

+  CDisplayScenarioContextScope local_28 [8];

   undefined8 local_20;

   

-  *(undefined4 *)(in_RAX + 8) = 0;

-  auStack_d8[0] = 0;

-  uVar14 = 0;

-  uVar9 = 1;

-  EnterLeaveCritShared::EnterLeaveCritShared((EnterLeaveCritShared *)aptStack_d0,1);

-  uVar3 = 0;

-  if (((((param_1 == 0) || ((short)((uint)param_1 >> 0x10) != 0)) ||

-       (uVar8 = (ulonglong)param_9, param_9 == 0)) ||

-      (((uVar3 = 0, iVar2 = GetPointerInfoSize(param_2), _Dst = param_12, puVar12 = param_11,

-        puVar11 = param_10, (int)uVar8 != iVar2 || (param_10 == (uint *)0x0)) ||

-       (param_11 == (uint *)0x0)))) ||

-     (((param_3 == 0 && (param_4 == 0)) && (param_12 == (tagPOINTER_INFO *)0x0)))) {

-LAB_0:

-    uVar7 = 0x57;

+                    /* 0x1653f0  1944  NtUserChangeDisplaySettings */

+  local_28[0] = (CDisplayScenarioContextScope)0x0;

+  CDisplayScenarioContextScope::ContextScopeConstructor(local_28,(_GUID *)0x0,0x1a,0);

+  lVar6 = W32GetUserSessionState();

+  lVar7 = UserCritInternal::`anonymous_namespace'::EnterCritInternal

+                    (lVar6,0,0,<lambda_63b61c2369133a205197eda5bd671ee7>::<lambda_invoker_cdecl>);

+  *(longlong *)(lVar6 + 0x10) = lVar7;

+  if (lVar7 != 0) {

+    DestroySharedUserCritDeferredUnlockList(lVar6 + 0x4d78);

+    DestroyDeferredUnlockObjectAssignmentList(lVar6 + 0x4db0);

+    DestroyDeferredUnlockObjectAssignmentList(lVar6 + 0x4da0);

+  }

+  lVar6 = W32GetUserGdiSessionState();

+  if (*(int *)(lVar6 + 0x20) == 0) {

+    uVar5 = 0xffffffff;

+    goto LAB_0;

+  }

+  ptVar8 = PtiCurrent();

+  iVar4 = Feature_UIPIModernization__private_IsEnabledDeviceUsageNoInline();

+  ptVar1 = (tagUIPI_INFO *)(*(longlong *)(ptVar8 + 0x1d0) + 0x130);

+  if (iVar4 == 0) {

+    local_34 = 0xffffffff;

+    local_38 = 0x2000;

+    local_30 = 0;

+    bVar2 = UIPrivilegeIsolation::CheckAccess(ptVar1,(tagUIPI_INFO *)&local_38,0);

   }

   else {

-    if ((param_4 == 0) || ((*(uint *)(aptStack_d0[0] + 0x550) >> 8 & 1) == 0)) {

-      puVar4 = param_10;

-      if (*(uint **)MmUserProbeAddress_exref <= param_10) {

-        puVar4 = *(uint **)MmUserProbeAddress_exref;

-      }

-      param_5 = *puVar4;

-      puVar4 = param_11;

-      if (*(uint **)MmUserProbeAddress_exref <= param_11) {

-        puVar4 = *(uint **)MmUserProbeAddress_exref;

-      }

-      auStack_d8[0] = *puVar4;

-      if (param_12 != (tagPOINTER_INFO *)0x0) {

-        if ((((param_5 == 0) || (auStack_d8[0] == 0)) ||

-            (0xffffffff < (ulonglong)auStack_d8[0] * (ulonglong)param_5)) ||

-           (uVar14 = ((ulonglong)auStack_d8[0] * (ulonglong)param_5 & 0xffffffff) * uVar8,

-           0xffffffff < uVar14)) goto LAB_0;

-        lVar5 = PsGetCurrentProcessWow64Process();

-        ProbeForWrite(_Dst,uVar14 & 0xffffffff,(-(uint)(lVar5 != 0) & 0xfffffffd) + 4);

-      }

-      if (param_1 == 1) {

-        ptVar6 = PtiCurrent();

-        if ((*(uint **)(ptVar6 + 0x600) == (uint *)0x0) || ((**(uint **)(ptVar6 + 0x600) & 1) == 0))

-        {

-          uVar3 = 0;

-          uVar7 = 0x57;

-          goto LAB_1;

-        }

-        param_5 = 1;

-        auStack_d8[0] = 1;

-        uVar3 = uVar9;

-        if (_Dst != (tagPOINTER_INFO *)0x0) {

-          ptVar6 = PtiCurrent();

-          lVar5 = *(longlong *)(ptVar6 + 0x600);

-          uStack_78 = *(undefined8 *)(lVar5 + 0x18);

-          uStack_70 = *(undefined8 *)(lVar5 + 0x20);

-          uStack_68 = *(undefined8 *)(lVar5 + 0x28);

-          uStack_60 = *(undefined8 *)(lVar5 + 0x30);

-          local_58 = *(undefined8 *)(lVar5 + 0x38);

-          local_50 = *(undefined8 *)(lVar5 + 0x40);

-          local_48 = *(undefined8 *)(lVar5 + 0x48);

-          uStack_40 = *(undefined8 *)(lVar5 + 0x50);

-          local_38 = *(undefined8 *)(lVar5 + 0x58);

-          local_30 = *(undefined8 *)(lVar5 + 0x60);

-          local_28 = *(undefined8 *)(lVar5 + 0x68);

-          local_20 = *(undefined8 *)(lVar5 + 0x70);

-          if (*(tagPOINTER_INFO **)MmUserProbeAddress_exref <= _Dst) {

-            _Dst = *(tagPOINTER_INFO **)MmUserProbeAddress_exref;

-          }

-          RtlCopyVolatileMemory(_Dst,&uStack_78,0x60);

-        }

-      }

-      else {

-        uVar13 = (ulong)uVar14;

-        uVar10 = (ushort)param_1;

-        if (param_4 == 0) {

-          uVar9 = 1;

-          auStack_d8[0] = 1;

-          if (param_7 == 0) {

-            param_5 = 1;

-            lVar5 = W32GetUserSessionState();

-            uVar3 = CTouchProcessor::GetPointerInfoInternal

-                              (*(CTouchProcessor **)(lVar5 + 0xcb8),aptStack_d0[0],uVar10,param_6,

-                               uVar13,_Dst);

-          }

-          else {

-            lVar5 = W32GetUserSessionState();

-            uVar3 = CTouchProcessor::GetPointerInfoHistoryInternal

-                              (*(CTouchProcessor **)(lVar5 + 0xcb8),aptStack_d0[0],uVar10,param_6,

-                               uVar13,&param_5,(uchar *)_Dst);

-          }

-        }

-        else {

-          lVar5 = W32GetUserSessionState();

-          uVar3 = CTouchProcessor::GetPointerFrameInfoInternal

-                            (*(CTouchProcessor **)(lVar5 + 0xcb8),aptStack_d0[0],uVar10,param_6,

-                             param_7,uVar13,&param_5,auStack_d8,(uchar *)_Dst);

-          uVar9 = auStack_d8[0];

-        }

-        if (uVar3 == 0) goto LAB_2;

-      }

-      pcVar1 = MmUserProbeAddress_exref;

-      if (*(uint **)MmUserProbeAddress_exref <= puVar11) {

-        puVar11 = *(uint **)MmUserProbeAddress_exref;

-      }

-      *puVar11 = param_5;

-      if (*(uint **)pcVar1 <= puVar12) {

-        puVar12 = *(uint **)pcVar1;

-      }

-      *puVar12 = uVar9;

-      goto LAB_2;

+    bVar2 = UIPrivilegeIsolation::MeetsUIPIThreshold

+                      ((UIPIAccessor *)

+                       (-(ulonglong)(*(longlong *)(ptVar8 + 0x1d0) != 0) & (ulonglong)ptVar1),0x2000

+                      );

+  }

+  bVar3 = tagPROCESSINFO::CanPerformUIOperation(*(tagPROCESSINFO **)(ptVar8 + 0x1d0),0x10);

+  if ((bVar3) && (bVar2 != false)) {

+    if ((param_3 >> 0x1b & 1) == 0) {

+LAB_1:

+      DrvLogDiagDisplayChange(0,8);

+      uVar5 = xxxUserChangeDisplaySettings(param_1,param_2,0,param_3,param_4,1,local_20);

+      goto LAB_0;

     }

-    uVar7 = 5;

+    uVar9 = 0x57;

   }

-LAB_1:

-  UserSetLastError(uVar7);

-LAB_2:

+  else {

+    if (param_3 == 0x22) goto LAB_1;

+    uVar9 = 5;

+  }

+  uVar5 = 0xffffffff;

+  UserSetLastError(uVar9);

+LAB_0:

   ReleaseUserCriticalSection();

-  return (longlong)(int)uVar3;

+  CDisplayScenarioContextScope::~CDisplayScenarioContextScope(local_28);

+  return uVar5;

 }
```

## `NtUserSetSysColors`  (modified)

```diff
--- NtUserSetSysColors
+++ NtUserSetSysColors
@@ -1,27 +1,118 @@
 

-longlong NtUserSetSysColors(Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

-                            *param_1,undefined2 param_2)

+longlong NtUserSetSysColors(uint param_1,void *param_2,void *param_3)

 

 {

-  int *piVar1;

-  undefined1 uVar2;

-  char *in_RAX;

-  int unaff_EBX;

-  undefined1 *unaff_RDI;

+  bool bVar1;

+  int iVar2;

+  longlong lVar3;

+  longlong lVar4;

+  tagTHREADINFO *ptVar5;

+  int *_Dst;

+  int *piVar6;

+  tagUIPI_INFO *ptVar7;

+  _func_void_void_ptr *_Size;

+  ulonglong uVar8;

+  undefined4 local_70;

+  undefined4 local_6c;

+  undefined4 local_68;

+  Win32RawLockedItemNoCleanup<int,0> local_48 [24];

+  Win32RawLockedItemNoCleanup<int,0> local_30 [24];

   

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

-  uVar2 = in(param_2);

-  *unaff_RDI = uVar2;

-  piVar1 = (int *)(CONCAT62((int6)((ulonglong)in_RAX >> 0x10),

-                            CONCAT11(0xed,(char)in_RAX + (char)((ulonglong)param_1 >> 8))) + -0x73);

-  *piVar1 = *piVar1 + -1;

-  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

-  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>(param_1);

-  Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

-  ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

-            ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)> *)

-             &stack0x00000060);

+                    /* 0x16c4b0  2040  NtUserSetSysColors */

+  uVar8 = (ulonglong)param_1;

+  _Dst = (int *)0x0;

+  piVar6 = (int *)0x0;

+  lVar3 = W32GetUserSessionState();

+  _Size = (_func_void_void_ptr *)0x0;

+  lVar4 = UserCritInternal::`anonymous_namespace'::EnterCritInternal

+                    (lVar3,0,0,<lambda_63b61c2369133a205197eda5bd671ee7>::<lambda_invoker_cdecl>);

+  *(longlong *)(lVar3 + 0x10) = lVar4;

+  if (lVar4 != 0) {

+    DestroySharedUserCritDeferredUnlockList(lVar3 + 0x4d78);

+    DestroyDeferredUnlockObjectAssignmentList(lVar3 + 0x4db0);

+    DestroyDeferredUnlockObjectAssignmentList(lVar3 + 0x4da0);

+  }

+  ptVar5 = PtiCurrent();

+  bVar1 = tagPROCESSINFO::CanPerformUIOperation(*(tagPROCESSINFO **)(ptVar5 + 0x1d0),8);

+  if (bVar1) {

+    iVar2 = Feature_UIPIModernization__private_IsEnabledDeviceUsageNoInline();

+    ptVar7 = (tagUIPI_INFO *)(*(longlong *)(ptVar5 + 0x1d0) + 0x130);

+    if (iVar2 == 0) {

+      local_70 = 0x2000;

+      local_6c = 0xffffffff;

+      local_68 = 0;

+      _Size = (_func_void_void_ptr *)0x0;

+      bVar1 = UIPrivilegeIsolation::CheckAccess(ptVar7,(tagUIPI_INFO *)&local_70,0);

+    }

+    else {

+      ptVar7 = (tagUIPI_INFO *)

+               (-(ulonglong)(*(longlong *)(ptVar5 + 0x1d0) != 0) & (ulonglong)ptVar7);

+      bVar1 = UIPrivilegeIsolation::MeetsUIPIThreshold((UIPIAccessor *)ptVar7,0x2000);

+    }

+    if (bVar1 != false) {

+      if (param_1 != 0) {

+        _Size = (_func_void_void_ptr *)(uVar8 * 4);

+        if (uVar8 != 0) {

+          lVar3 = PsGetCurrentProcessWow64Process();

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

+                    /* WARNING: Subroutine does not return */

+            ExRaiseDatatypeMisalignment();

+          }

+          ptVar7 = (tagUIPI_INFO *)(_Size + (longlong)param_2);

+          if (uVar8 != 0) {

+            lVar3 = PsGetCurrentProcessWow64Process();

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

+                    /* WARNING: Subroutine does not return */

+              ExRaiseDatatypeMisalignment();

+            }

+            ptVar7 = (tagUIPI_INFO *)(_Size + (longlong)param_3);

+          }

+        }

+        _Dst = Win32AllocPoolWithQuotaZInitImpl((__uint64)ptVar7,(__uint64)_Size,0x72637355);

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

+                    /* WARNING: Subroutine does not return */

+          ExRaiseStatus(0xc0000017);

+        }

+        piVar6 = _Dst;

+        RtlCopyVolatileMemory(_Dst,param_2,(size_t)_Size);

+        piVar6 = Win32AllocPoolWithQuotaZInitImpl((__uint64)piVar6,(__uint64)_Size,0x76637355);

+        if (piVar6 == (int *)0x0) {

+                    /* WARNING: Subroutine does not return */

+          ExRaiseStatus(0xc0000017);

+        }

+        RtlCopyVolatileMemory(piVar6,param_3,(size_t)_Size);

+      }

+      Win32RawLockedItemNoCleanup<int,0>::Win32RawLockedItemNoCleanup<int,0>(local_30,_Dst,_Size);

+      Win32RawLockedItemNoCleanup<int,0>::Win32RawLockedItemNoCleanup<int,0>(local_48,piVar6,_Size);

+      Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>::

+      Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>

+                ((Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  *)&local_70);

+      CreateProfileUserName

+                ((Win32RawOptionalLockedItemAlways<tagPROFILEUSERNAME,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  *)&local_70);

+      iVar2 = xxxSetSysColors();

+      Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>::

+      ~Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                ((Win32RawOptionalLockedItemAlways<void,&void___cdecl_Win32FreePool(void*___ptr64)>

+                  *)&local_70);

+      Win32RawLockedItemNoCleanup<unsigned_long,0>::~Win32RawLockedItemNoCleanup<unsigned_long,0>

+                ((Win32RawLockedItemNoCleanup<unsigned_long,0> *)local_48);

+      Win32RawLockedItemNoCleanup<unsigned_long,0>::~Win32RawLockedItemNoCleanup<unsigned_long,0>

+                ((Win32RawLockedItemNoCleanup<unsigned_long,0> *)local_30);

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

+        GreDeleteFastMutex(_Dst);

+      }

+      if (piVar6 != (int *)0x0) {

+        GreDeleteFastMutex(piVar6);

+      }

+      goto LAB_0;

+    }

+  }

+  iVar2 = 0;

+  UserSetLastError(5);

+LAB_0:

   ReleaseUserCriticalSection();

-  return (longlong)unaff_EBX;

+  return (longlong)iVar2;

 }
```

## `RIMIsInputSuppressed`  (modified)

```diff
--- RIMIsInputSuppressed
+++ RIMIsInputSuppressed
@@ -1,348 +1,35 @@
 

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

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

-

-uint RIMIsInputSuppressed(byte param_1)

+bool RIMIsInputSuppressed(longlong param_1)

 

 {

-  byte *pbVar1;

-  byte bVar2;

-  ushort uVar3;

-  ushort uVar4;

-  uint uVar5;

-  undefined8 uVar6;

-  _W32PROCESS *p_Var7;

-  HLSURF__ *pHVar8;

-  code *pcVar9;

-  undefined8 uVar10;

-  undefined8 uVar11;

-  undefined8 uVar12;

-  undefined8 uVar13;

-  int iVar14;

-  uint uVar15;

-  undefined4 uVar16;

-  undefined4 uVar17;

-  ulonglong in_RAX;

-  longlong lVar18;

-  SFMLOGICALSURFACE *pSVar19;

-  _BASEOBJECT *p_Var20;

-  HSURF__ *pHVar21;

-  HLSURF__ *unaff_RBX;

-  undefined8 *unaff_RBP;

-  SURFACE *unaff_RSI;

-  OBJECT *unaff_RDI;

-  undefined8 *unaff_R12;

-  longlong unaff_R13;

-  int unaff_R15D;

-  undefined8 in_stack_00000040;

-  int in_stack_00000048;

-  undefined8 in_stack_00000050;

-  undefined8 in_stack_00000060;

-  int in_stack_00000070;

-  undefined4 *in_stack_00000078;

+  longlong lVar1;

+  undefined1 auVar2 [16];

+  int iVar3;

+  longlong lVar4;

+  ulonglong uVar5;

+  longlong lVar6;

   

-  pbVar1 = (byte *)(in_RAX - 0x75);

-  bVar2 = *pbVar1;

-  *pbVar1 = *pbVar1 + param_1;

-  *(char *)(in_RAX - 0x75) = (*(char *)(in_RAX - 0x75) - param_1) - CARRY1(bVar2,param_1);

-  if (((in_RAX & 0x48000002) != 0) &&

-     (iVar14 = (*(code *)(ulonglong)((uint)in_RAX & 0x48000002))(), -1 < iVar14)) {

-    unaff_RBX = (HLSURF__ *)

-                SFMLOGICALSURFACE_CreateHLSURFCloneWrap(*(undefined8 *)(unaff_RDI + 0x30));

-  }

-  SFMLOGICALSURFACEREF::LockLogicalSurfaceObj((SFMLOGICALSURFACEREF *)(unaff_RBP + -0xf),unaff_RBX);

-  lVar18 = unaff_RBP[-0xb];

-  ThreadRestrictNewHandlesRegion::~ThreadRestrictNewHandlesRegion

-            ((ThreadRestrictNewHandlesRegion *)(unaff_RBP + -6));

-  uVar15 = (uint)(lVar18 != 0);

-  if (uVar15 != 0) {

-    OBJECT::SwapShareCount(unaff_RDI,(OBJECT *)unaff_RSI);

-    uVar6 = *(undefined8 *)(unaff_RDI + 0x20);

-    *(SURFACE **)(unaff_RDI + 0x230) = unaff_RSI;

-    *(undefined8 *)(unaff_RDI + 0x20) = *(undefined8 *)(unaff_RSI + 0x20);

-    *(undefined8 *)(unaff_RSI + 0x20) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RDI + 0x90);

-    *(undefined8 *)(unaff_RDI + 0x90) = *(undefined8 *)(unaff_RSI + 0x90);

-    *(undefined8 *)(unaff_RSI + 0x90) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RDI + 0xa0);

-    *(undefined8 *)(unaff_RDI + 0xa0) = *(undefined8 *)(unaff_RSI + 0xa0);

-    uVar3 = *(ushort *)(unaff_RSI + 0xe);

-    *(undefined8 *)(unaff_RSI + 0xa0) = uVar6;

-    uVar4 = *(ushort *)(unaff_RDI + 0xe);

-    *(ushort *)(unaff_RDI + 0xe) = uVar4 & 0x80 | uVar3 & 0x60;

-    *(ushort *)(unaff_RSI + 0xe) = uVar4 & 0x60 | uVar3 & 0x80;

-    uVar16 = *(undefined4 *)(unaff_RDI + 0xa8);

-    *(undefined4 *)(unaff_RDI + 0xa8) = *(undefined4 *)(unaff_RSI + 0xa8);

-    *(undefined4 *)(unaff_RSI + 0xa8) = uVar16;

-    uVar6 = *(undefined8 *)(unaff_RDI + 0xb0);

-    *(undefined8 *)(unaff_RDI + 0xb0) = *(undefined8 *)(unaff_RSI + 0xb0);

-    *(undefined8 *)(unaff_RSI + 0xb0) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RDI + 0x98);

-    *(undefined8 *)(unaff_RDI + 0x98) = *(undefined8 *)(unaff_RSI + 0x98);

-    *(undefined8 *)(unaff_RSI + 0x98) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RDI + 0x80);

-    *(undefined8 *)(unaff_RDI + 0x80) = *(undefined8 *)(unaff_RSI + 0x80);

-    *(undefined8 *)(unaff_RSI + 0x80) = uVar6;

-    uVar16 = *(undefined4 *)(unaff_RDI + 0x140);

-    *(undefined4 *)(unaff_RDI + 0x140) = *(undefined4 *)(unaff_RSI + 0x140);

-    *(undefined4 *)(unaff_RSI + 0x140) = uVar16;

-    uVar16 = *(undefined4 *)(unaff_RDI + 0x144);

-    *(undefined4 *)(unaff_RDI + 0x144) = *(undefined4 *)(unaff_RSI + 0x144);

-    *(undefined4 *)(unaff_RSI + 0x144) = uVar16;

-    uVar10 = *(undefined8 *)(unaff_RDI + 0x150);

-    uVar6 = *(undefined8 *)(unaff_RDI + 0x1e8);

-    uVar11 = *(undefined8 *)(unaff_RDI + 0x158);

-    uVar12 = *(undefined8 *)(unaff_RDI + 0x160);

-    unaff_RBP[-6] = *(undefined8 *)(unaff_RDI + 0x148);

-    unaff_RBP[-5] = uVar10;

-    uVar10 = *(undefined8 *)(unaff_RDI + 0x168);

-    uVar13 = *(undefined8 *)(unaff_RDI + 0x170);

-    unaff_RBP[-4] = uVar11;

-    unaff_RBP[-3] = uVar12;

-    uVar11 = *(undefined8 *)(unaff_RDI + 0x178);

-    uVar12 = *(undefined8 *)(unaff_RDI + 0x180);

-    unaff_RBP[-2] = uVar10;

-    unaff_RBP[-1] = uVar13;

-    uVar10 = *(undefined8 *)(unaff_RDI + 0x188);

-    uVar13 = *(undefined8 *)(unaff_RDI + 400);

-    *unaff_RBP = uVar11;

-    unaff_RBP[1] = uVar12;

-    uVar11 = *(undefined8 *)(unaff_RDI + 0x198);

-    uVar12 = *(undefined8 *)(unaff_RDI + 0x1a0);

-    unaff_RBP[2] = uVar10;

-    unaff_RBP[3] = uVar13;

-    uVar10 = *(undefined8 *)(unaff_RDI + 0x1a8);

-    uVar13 = *(undefined8 *)(unaff_RDI + 0x1b0);

-    unaff_RBP[4] = uVar11;

-    unaff_RBP[5] = uVar12;

-    uVar11 = *(undefined8 *)(unaff_RDI + 0x1b8);

-    uVar12 = *(undefined8 *)(unaff_RDI + 0x1c0);

-    unaff_RBP[6] = uVar10;

-    unaff_RBP[7] = uVar13;

-    uVar10 = *(undefined8 *)(unaff_RDI + 0x1c8);

-    uVar13 = *(undefined8 *)(unaff_RDI + 0x1d0);

-    unaff_RBP[8] = uVar11;

-    unaff_RBP[9] = uVar12;

-    uVar11 = *(undefined8 *)(unaff_RDI + 0x1d8);

-    uVar12 = *(undefined8 *)(unaff_RDI + 0x1e0);

-    unaff_RBP[10] = uVar10;

-    unaff_RBP[0xb] = uVar13;

-    unaff_RBP[0xc] = uVar11;

-    unaff_RBP[0xd] = uVar12;

-    unaff_RBP[0xe] = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RSI + 0x150);

-    *(undefined8 *)(unaff_RDI + 0x148) = *(undefined8 *)(unaff_RSI + 0x148);

-    *(undefined8 *)(unaff_RDI + 0x150) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RSI + 0x160);

-    *(undefined8 *)(unaff_RDI + 0x158) = *(undefined8 *)(unaff_RSI + 0x158);

-    *(undefined8 *)(unaff_RDI + 0x160) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RSI + 0x170);

-    *(undefined8 *)(unaff_RDI + 0x168) = *(undefined8 *)(unaff_RSI + 0x168);

-    *(undefined8 *)(unaff_RDI + 0x170) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RSI + 0x180);

-    *(undefined8 *)(unaff_RDI + 0x178) = *(undefined8 *)(unaff_RSI + 0x178);

-    *(undefined8 *)(unaff_RDI + 0x180) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RSI + 400);

-    *(undefined8 *)(unaff_RDI + 0x188) = *(undefined8 *)(unaff_RSI + 0x188);

-    *(undefined8 *)(unaff_RDI + 400) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RSI + 0x1a0);

-    *(undefined8 *)(unaff_RDI + 0x198) = *(undefined8 *)(unaff_RSI + 0x198);

-    *(undefined8 *)(unaff_RDI + 0x1a0) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RSI + 0x1b0);

-    *(undefined8 *)(unaff_RDI + 0x1a8) = *(undefined8 *)(unaff_RSI + 0x1a8);

-    *(undefined8 *)(unaff_RDI + 0x1b0) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RSI + 0x1c0);

-    *(undefined8 *)(unaff_RDI + 0x1b8) = *(undefined8 *)(unaff_RSI + 0x1b8);

-    *(undefined8 *)(unaff_RDI + 0x1c0) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RSI + 0x1d0);

-    *(undefined8 *)(unaff_RDI + 0x1c8) = *(undefined8 *)(unaff_RSI + 0x1c8);

-    *(undefined8 *)(unaff_RDI + 0x1d0) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RSI + 0x1e0);

-    *(undefined8 *)(unaff_RDI + 0x1d8) = *(undefined8 *)(unaff_RSI + 0x1d8);

-    *(undefined8 *)(unaff_RDI + 0x1e0) = uVar6;

-    *(undefined8 *)(unaff_RDI + 0x1e8) = *(undefined8 *)(unaff_RSI + 0x1e8);

-    uVar6 = unaff_RBP[-5];

-    uVar10 = unaff_RBP[-4];

-    uVar11 = unaff_RBP[-3];

-    *(undefined8 *)(unaff_RSI + 0x148) = unaff_RBP[-6];

-    *(undefined8 *)(unaff_RSI + 0x150) = uVar6;

-    uVar6 = unaff_RBP[-2];

-    uVar12 = unaff_RBP[-1];

-    *(undefined8 *)(unaff_RSI + 0x158) = uVar10;

-    *(undefined8 *)(unaff_RSI + 0x160) = uVar11;

-    uVar10 = *unaff_RBP;

-    uVar11 = unaff_RBP[1];

-    *(undefined8 *)(unaff_RSI + 0x168) = uVar6;

-    *(undefined8 *)(unaff_RSI + 0x170) = uVar12;

-    uVar6 = unaff_RBP[2];

-    uVar12 = unaff_RBP[3];

-    *(undefined8 *)(unaff_RSI + 0x178) = uVar10;

-    *(undefined8 *)(unaff_RSI + 0x180) = uVar11;

-    uVar10 = unaff_RBP[4];

-    uVar11 = unaff_RBP[5];

-    *(undefined8 *)(unaff_RSI + 0x188) = uVar6;

-    *(undefined8 *)(unaff_RSI + 400) = uVar12;

-    uVar6 = unaff_RBP[6];

-    uVar12 = unaff_RBP[7];

-    *(undefined8 *)(unaff_RSI + 0x198) = uVar10;

-    *(undefined8 *)(unaff_RSI + 0x1a0) = uVar11;

-    uVar10 = unaff_RBP[8];

-    uVar11 = unaff_RBP[9];

-    *(undefined8 *)(unaff_RSI + 0x1a8) = uVar6;

-    *(undefined8 *)(unaff_RSI + 0x1b0) = uVar12;

-    uVar12 = unaff_RBP[10];

-    uVar13 = unaff_RBP[0xb];

-    *(undefined8 *)(unaff_RSI + 0x1b8) = uVar10;

-    *(undefined8 *)(unaff_RSI + 0x1c0) = uVar11;

-    uVar10 = unaff_RBP[0xc];

-    uVar11 = unaff_RBP[0xd];

-    uVar6 = unaff_RBP[0xe];

-    *(undefined8 *)(unaff_RSI + 0x1c8) = uVar12;

-    *(undefined8 *)(unaff_RSI + 0x1d0) = uVar13;

-    uVar12 = *(undefined8 *)(unaff_RSI + 0x1f8);

-    *(undefined8 *)(unaff_RSI + 0x1d8) = uVar10;

-    *(undefined8 *)(unaff_RSI + 0x1e0) = uVar11;

-    *(undefined8 *)(unaff_RSI + 0x1e8) = uVar6;

-    uVar6 = *(undefined8 *)(unaff_RDI + 0x1f0);

-    uVar10 = *(undefined8 *)(unaff_RDI + 0x1f8);

-    uVar11 = *(undefined8 *)(unaff_RDI + 0x200);

-    uVar13 = *(undefined8 *)(unaff_RDI + 0x208);

-    *(undefined8 *)(unaff_RDI + 0x1f0) = *(undefined8 *)(unaff_RSI + 0x1f0);

-    *(undefined8 *)(unaff_RDI + 0x1f8) = uVar12;

-    uVar12 = *(undefined8 *)(unaff_RSI + 0x208);

-    *(undefined8 *)(unaff_RDI + 0x200) = *(undefined8 *)(unaff_RSI + 0x200);

-    *(undefined8 *)(unaff_RDI + 0x208) = uVar12;

-    *(undefined8 *)(unaff_RSI + 0x1f0) = uVar6;

-    *(undefined8 *)(unaff_RSI + 0x1f8) = uVar10;

-    *(undefined8 *)(unaff_RSI + 0x200) = uVar11;

-    *(undefined8 *)(unaff_RSI + 0x208) = uVar13;

-    uVar5 = *(uint *)(unaff_RDI + 0x70);

-    *(uint *)(unaff_RDI + 0x70) =

-         (*(uint *)(unaff_RSI + 0x70) ^ uVar5) & 0x3b5ef ^ *(uint *)(unaff_RSI + 0x70);

-    *(uint *)(unaff_RSI + 0x70) = (uVar5 ^ *(uint *)(unaff_RSI + 0x70)) & 0x3b5ef ^ uVar5;

-    uVar5 = *(uint *)(unaff_RDI + 0x74);

-    *(uint *)(unaff_RDI + 0x74) = (uVar5 ^ *(uint *)(unaff_RSI + 0x74)) & 0x7fff ^ uVar5;

-    *(uint *)(unaff_RSI + 0x74) =

-         (*(uint *)(unaff_RSI + 0x74) ^ uVar5) & 0x7fff ^ *(uint *)(unaff_RSI + 0x74);

-    uVar5 = *(uint *)(unaff_RDI + 0x70);

-    *(uint *)(unaff_RDI + 0x70) = (uVar5 ^ *(uint *)(unaff_RSI + 0x70)) & 0xe00000 ^ uVar5;

-    *(uint *)(unaff_RSI + 0x70) =

-         (*(uint *)(unaff_RSI + 0x70) ^ uVar5) & 0xe00000 ^ *(uint *)(unaff_RSI + 0x70);

-    uVar5 = *(uint *)(unaff_RDI + 0x74);

-    *(uint *)(unaff_RDI + 0x74) = (uVar5 ^ *(uint *)(unaff_RSI + 0x74)) & 0x390d ^ uVar5;

-    *(uint *)(unaff_RSI + 0x74) =

-         (*(uint *)(unaff_RSI + 0x74) ^ uVar5) & 0x390d ^ *(uint *)(unaff_RSI + 0x74);

-    p_Var7 = *(_W32PROCESS **)(unaff_RDI + 0x280);

-    SURFACE::vAppContainerOwner((SURFACE *)unaff_RDI,*(_W32PROCESS **)(unaff_RSI + 0x280));

-    SURFACE::vAppContainerOwner(unaff_RSI,p_Var7);

-    if ((*(uint *)(unaff_RDI + 0x74) & 0x800) != 0) {

-      uVar6 = *(undefined8 *)(unaff_RDI + 0x29c);

-      uVar16 = *(undefined4 *)(unaff_RDI + 0x294);

-      uVar17 = *(undefined4 *)(unaff_RDI + 0x298);

-      *(uint *)(unaff_RSI + 0x74) = *(uint *)(unaff_RSI + 0x74) | 0x800;

-      *(undefined4 *)(unaff_RSI + 0x294) = uVar16;

-      *(undefined4 *)(unaff_RSI + 0x298) = uVar17;

-      *(undefined8 *)(unaff_RSI + 0x29c) = uVar6;

+  if (*(int *)(param_1 + 0x518) != 1) {

+    if (*(int *)(param_1 + 0x518) != 2) {

+      return false;

     }

-    if (in_stack_00000048 != 0) {

-      *(ushort *)(unaff_RDI + 0x66) = *(ushort *)(unaff_RDI + 0x66) & 0xfdff;

-      if ((*(uint *)unaff_RSI & 0x800000) != 0) {

-        *(ushort *)(unaff_RSI + 0x66) = *(ushort *)(unaff_RSI + 0x66) | 0x200;

+    lVar4 = KeQueryPerformanceCounter(0);

+    lVar1 = *(longlong *)(param_1 + 0x520);

+    iVar3 = RIMIsWakeCapableDevice(param_1);

+    if (iVar3 != 0) {

+      if (((char)*(undefined4 *)(param_1 + 0xb8) < '\0') &&

+         (*(int *)(*(longlong *)(param_1 + 0x1c8) + 0x18) - 1U < 4)) {

+        uVar5 = gliQpcFreq * 3000;

       }

-      if ((in_stack_00000040._4_4_ != 0) && ((*(uint *)unaff_RSI & 0x800000) != 0)) {

-        *(ushort *)(unaff_RSI + 0x66) = *(ushort *)(unaff_RSI + 0x66) | 0x400;

+      else {

+        uVar5 = gliQpcFreq * 1000;

       }

-      *in_stack_00000078 = 1;

-    }

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

-      UnexpectedThreadTerminationHandler<SFMLOGICALSURFACEREF>::

-      UnexpectedThreadTerminationHandler<SFMLOGICALSURFACEREF>

-                ((UnexpectedThreadTerminationHandler<SFMLOGICALSURFACEREF> *)(unaff_RBP + -6));

-      pHVar8 = (HLSURF__ *)*unaff_R12;

-      unaff_RBP[-2] = 0;

-      *(undefined4 *)(unaff_RBP + -1) = 1;

-      SFMLOGICALSURFACEREF::LockLogicalSurfaceObj((SFMLOGICALSURFACEREF *)(unaff_RBP + -6),pHVar8);

-      if (unaff_R15D != 0) {

-        lVar18 = W32GetWin32kBaseApiSetTable();

-        pcVar9 = *(code **)(*(longlong *)(lVar18 + 0x18) + 0x280);

-        if ((pcVar9 != (code *)0x0) && (iVar14 = (*pcVar9)(), -1 < iVar14)) {

-          vSpDwmMigrateSpriteLSurfReferenceWrap(*(undefined8 *)(unaff_R13 + 0x30),unaff_RBP[-2]);

-        }

-      }

-      while (pSVar19 = SURFACE::GetFirstLSurf((SURFACE *)unaff_RDI),

-            pSVar19 != (SFMLOGICALSURFACE *)0x0) {

-        iVar14 = IsvSpDwmMigrateLSurfShapeReferenceSupported();

-        if (-1 < iVar14) {

-          vSpDwmMigrateLSurfShapeReferenceWrap(*(undefined8 *)(unaff_R13 + 0x30),pSVar19);

-        }

-      }

-      SFMLOGICALSURFACEREF::~SFMLOGICALSURFACEREF((SFMLOGICALSURFACEREF *)(unaff_RBP + -6));

-    }

-    if ((*(uint *)(unaff_RSI + 0x74) & 4) != 0) {

-      p_Var20 = HmgShareLockEx(*(HOBJ__ **)(unaff_RSI + 0x90),'\x05',0);

-      unaff_RBP[-6] = p_Var20;

-      unaff_RBP[-5] = 0;

-      unaff_RBP[-4] = 0;

-      unaff_RBP[-3] = 0;

-      unaff_RBP[-2] = 0;

-      PushThreadGuardedObject

-                (unaff_RBP + -5,unaff_RBP + -6,

-                 UnexpectedThreadTerminationHandler<HmgShareLockResult<SURFACE>_>::

-                 OnUnexpectedThreadTerminationStatic);

-      if ((unaff_RBP[-6] != 0) && (*(longlong *)(unaff_RBP[-6] + 0x18) != 0)) {

-        lVar18 = W32GetWin32kBaseApiSetTable();

-        pcVar9 = *(code **)(*(longlong *)(lVar18 + 0x18) + 0x2a0);

-        if ((pcVar9 != (code *)0x0) && (iVar14 = (*pcVar9)(), -1 < iVar14)) {

-          MulReplaceRedirectionChild

-                    (*(undefined8 *)(unaff_RBP[-6] + 0x18),unaff_RDI + 0x18,unaff_RSI + 0x18);

-        }

-      }

-      HmgShareLockResult<SURFACE>::~HmgShareLockResult<SURFACE>

-                ((HmgShareLockResult<SURFACE> *)(unaff_RBP + -6));

-    }

-    if (in_stack_00000070 != 0) {

-      HmgDecrementShareReferenceCountEx();

-      HmgIncrementShareReferenceCount();

-    }

-    if (*(int *)(unaff_RDI + 8) != 0) {

-      *in_stack_00000078 = 1;

-      goto LAB_0;

-    }

-    pHVar21 = *(HSURF__ **)(unaff_RDI + 0x20);

-    SURFREF::SURFREF((SURFREF *)(unaff_RBP + -6),pHVar21,(SESSION_GLOBALS *)unaff_RBP[-0x10]);

-    iVar14 = (int)pHVar21;

-    SURFREFVIEW::bUnMapImmediate((SURFREFVIEW *)&stack0x00000050);

-    in_stack_00000050 = 0;

-    SURFREFVIEW::bUnMapImmediate((SURFREFVIEW *)&stack0x00000060);

-    in_stack_00000060 = 0;

-    uVar15 = SURFREF::bDeleteSurface((SURFREF *)(unaff_RBP + -6),iVar14);

-    if (uVar15 == 0) {

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

-    }

-    COLORSPACEREF::~COLORSPACEREF((COLORSPACEREF *)(unaff_RBP + -6));

-    if (uVar15 != 0) goto LAB_0;

-  }

-  uVar16 = HmgQueryAltLock(*(undefined8 *)(unaff_RDI + 0x20));

-  uVar17 = HmgQueryAltLock(*(undefined8 *)(unaff_RSI + 0x20));

-  HmgSwapLockedHandleContents

-            (*(undefined8 *)(unaff_RSI + 0x20),uVar17,*(undefined8 *)(unaff_RDI + 0x20),uVar16,5);

-LAB_0:

-  SFMLOGICALSURFACEREF::~SFMLOGICALSURFACEREF((SFMLOGICALSURFACEREF *)(unaff_RBP + -0xf));

-  if ((uVar15 == 0) && (in_stack_00000048 != 0)) {

-    *(ushort *)(unaff_RSI + 0x66) = *(ushort *)(unaff_RSI + 0x66) & 0xfdff;

-    if ((*(uint *)unaff_RDI & 0x800000) != 0) {

-      *(ushort *)(unaff_RDI + 0x66) = *(ushort *)(unaff_RDI + 0x66) | 0x200;

-    }

-    if ((in_stack_00000040._4_4_ != 0) && ((*(uint *)unaff_RDI & 0x800000) != 0)) {

-      *(ushort *)(unaff_RDI + 0x66) = *(ushort *)(unaff_RDI + 0x66) | 0x400;

+      auVar2._8_8_ = 0;

+      auVar2._0_8_ = uVar5;

+      lVar6 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar2,8);

+      return (ulonglong)(lVar4 - lVar1) < (uVar5 - lVar6 >> 1) + lVar6 >> 9;

     }

   }

-  SURFREFVIEW::bUnMapImmediate((SURFREFVIEW *)&stack0x00000050);

-  in_stack_00000050 = 0;

-  SURFREFVIEW::bUnMapImmediate((SURFREFVIEW *)&stack0x00000060);

-  in_stack_00000060 = 0;

-  SURFREFVIEW::bUnMap((SURFREFVIEW *)&stack0x00000050);

-  SURFREFVIEW::bUnMap((SURFREFVIEW *)&stack0x00000060);

-  return uVar15;

+  return true;

 }
```

## `EtwpSetTraceHeader`  (modified)

```diff
--- EtwpSetTraceHeader
+++ EtwpSetTraceHeader
@@ -1,39 +1,40 @@
 

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

+/* void __cdecl EtwpSetTraceHeader(struct

+   _W32KUIPI_Msg_Template::_tagW32KUIPI_Msg_Template_UIPI_Trace_Header * __ptr64,unsigned

+   long,struct tagTHREADINFO * __ptr64,struct tagPROCESSINFO const * __ptr64,struct tagTHREADINFO

+   const * __ptr64,struct tagPROCESSINFO const * __ptr64) */

 

 void __cdecl

 EtwpSetTraceHeader(_tagW32KUIPI_Msg_Template_UIPI_Trace_Header *param_1,ulong param_2,

                   tagTHREADINFO *param_3,tagPROCESSINFO *param_4,tagTHREADINFO *param_5,

                   tagPROCESSINFO *param_6)

 

 {

-  longlong lVar1;

-  char cVar2;

-  char unaff_BL;

-  undefined1 unaff_SIL;

-  undefined1 unaff_DIL;

-  undefined *unaff_R12;

-  undefined *unaff_R15;

-  undefined *puStack0000000000000038;

+  undefined4 uVar1;

   

-  lVar1 = W32GetUserSessionState();

-  puStack0000000000000038 = &WPP_9b909e6f7a6f3ba61ffc5a77a7a32fbe_Traceguids;

-  WPP_RECORDER_AND_TRACE_SF_

-            (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),unaff_DIL,unaff_SIL,

-             *(undefined8 *)(lVar1 + 0x10f88),4);

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

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

-    cVar2 = '\0';

+  *(ulong *)param_1 = param_2;

+  if (param_3 != (tagTHREADINFO *)0x0) {

+    uVar1 = PsGetThreadId(*(undefined8 *)param_3);

+    *(undefined4 *)(param_1 + 8) = uVar1;

+    param_4 = *(tagPROCESSINFO **)(param_3 + 0x1d0);

   }

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

-    unaff_BL = '\0';

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

+    uVar1 = PsGetProcessId(*(undefined8 *)param_4);

+    *(undefined4 *)(param_1 + 4) = uVar1;

+    *(undefined4 *)(param_1 + 0xc) = *(undefined4 *)(param_4 + 0x134);

+    *(undefined4 *)(param_1 + 0x10) = *(undefined4 *)(param_4 + 0x134);

   }

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

-    puStack0000000000000038 = &WPP_9b909e6f7a6f3ba61ffc5a77a7a32fbe_Traceguids;

-    WPP_RECORDER_AND_TRACE_SF_

-              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,unaff_BL,

-               *(undefined8 *)(WPP_GLOBAL_Control + 0x40),5);

+  if (param_5 != (tagTHREADINFO *)0x0) {

+    uVar1 = PsGetThreadId(*(undefined8 *)param_5);

+    *(undefined4 *)(param_1 + 0x18) = uVar1;

+    param_6 = *(tagPROCESSINFO **)(param_5 + 0x1d0);

+  }

+  if (param_6 != (tagPROCESSINFO *)0x0) {

+    uVar1 = PsGetProcessId(*(undefined8 *)param_6);

+    *(undefined4 *)(param_1 + 0x14) = uVar1;

+    *(undefined4 *)(param_1 + 0x1c) = *(undefined4 *)(param_6 + 0x134);

+    *(undefined4 *)(param_1 + 0x20) = *(undefined4 *)(param_6 + 0x134);

   }

   return;

 }
```

## `ValidateHwndEx`  (modified)

```diff
--- ValidateHwndEx
+++ ValidateHwndEx
@@ -1,27 +1,117 @@
 

-undefined4 ValidateHwndEx(void)

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

+

+longlong ValidateHwndEx(ulonglong param_1,int param_2,int param_3)

 

 {

-  longlong lVar1;

-  byte *in_RAX;

-  tagTHREADINFO *ptVar2;

-  undefined4 unaff_EDI;

-  undefined4 uStack0000000000000028;

-  undefined2 uStack0000000000000030;

-  undefined *puStack0000000000000038;

-  longlong in_stack_00000068;

+  code *pcVar1;

+  undefined8 uVar2;

+  bool bVar3;

+  ushort uVar4;

+  uint uVar5;

+  int iVar6;

+  longlong lVar7;

+  longlong lVar8;

+  longlong lVar9;

+  longlong *plVar10;

+  longlong lVar11;

+  tagUIPI_INFO *ptVar12;

+  undefined8 uVar13;

+  tagUIPI_INFO *ptVar14;

+  longlong lVar15;

   

-  *in_RAX = *in_RAX & (byte)in_RAX;

-  puStack0000000000000038 = &WPP_e707f73c5ff83dc2c29746b23add0a6c_Traceguids;

-  uStack0000000000000030 = 0x10;

-  uStack0000000000000028 = 2;

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

-  lVar1 = in_stack_00000068;

-  if (in_stack_00000068 != 0) {

-    ptVar2 = PtiCurrent();

-    *(undefined8 *)(ptVar2 + 0x180) = *(undefined8 *)(lVar1 + 0x30);

-    InputTraceLogging::ThreadLockedPerfRegion::Cleanup((ThreadLockedPerfRegion *)&stack0x00000068);

+                    /* 0xad990  2342  ValidateHwndEx */

+  lVar7 = W32GetUserSessionState();

+  if ((param_1 & 0xffff) < *(ulonglong *)(*(longlong *)(lVar7 + 0x4e30) + 8)) {

+    lVar7 = W32GetUserSessionState();

+    lVar8 = W32GetUserSessionState();

+    lVar15 = (ulonglong)(uint)((int)(param_1 & 0xffff) * *(int *)(lVar8 + 0x4e48)) +

+             *(longlong *)(lVar7 + 0x4e40);

+    lVar8 = W32GetUserSessionState();

+    lVar7 = *(longlong *)(lVar8 + 0x4e40);

+    lVar8 = *(longlong *)(lVar8 + 0x4e08);

+    uVar4 = (ushort)(param_1 >> 0x10) & 0x7fff;

+    if ((((uVar4 == *(ushort *)(lVar15 + 0x1a)) || (uVar4 == 0x7fff)) ||

+        (((param_1 & 0x7fff0000) == 0 && (lVar9 = PsGetCurrentProcessWow64Process(), lVar9 != 0))))

+       && (*(char *)(lVar15 + 0x18) == '\x01')) {

+      plVar10 = (longlong *)PsGetCurrentThreadWin32Thread();

+      lVar9 = 0;

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

+        lVar9 = *plVar10;

+      }

+      lVar7 = *(longlong *)(lVar8 + (lVar15 - lVar7 >> 5 & 0xffffffffU) * 0x28);

+      if ((lVar7 != 0) && (lVar8 = *(longlong *)(lVar7 + 0x10), (*(byte *)(lVar15 + 0x19) & 1) == 0)

+         ) {

+        if ((param_2 != 0) &&

+           ((lVar8 != lVar9 && (*(longlong *)(lVar7 + 0x18) != *(longlong *)(lVar9 + 0x1f0))))) {

+          LOCK();

+          uVar5 = *(uint *)(lVar9 + 0x210);

+          if (uVar5 == 0) {

+            *(uint *)(lVar9 + 0x210) = 0;

+            uVar5 = 0;

+          }

+          UNLOCK();

+          if ((uVar5 & 4) == 0) {

+            lVar11 = W32GetWin32kBaseApiSetTable();

+            pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x1d8);

+            if ((pcVar1 != (code *)0x0) && (iVar6 = (*pcVar1)(), -1 < iVar6)) {

+              uVar13 = *(undefined8 *)(lVar7 + 0x18);

+              uVar2 = *(undefined8 *)(lVar9 + 0x1d0);

+              lVar11 = W32GetWin32kBaseApiSetTable();

+              pcVar1 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x1e0);

+              if ((pcVar1 != (code *)0x0) && (lVar11 = (*pcVar1)(uVar2,uVar13), lVar11 != 0))

+              goto LAB_0;

+            }

+            goto LAB_1;

+          }

+        }

+LAB_0:

+        if ((param_3 != 0) && (*(int *)(*(longlong *)(lVar8 + 0x1d0) + 0x368) != 1)) {

+          param_3 = 0;

+        }

+        if ((*(char *)(lVar9 + 0x6c4) != '\x01') || (lVar8 == 0)) {

+LAB_2:

+          LOCK();

+          uVar5 = *(uint *)(lVar9 + 0x210);

+          if (uVar5 == 0) {

+            *(uint *)(lVar9 + 0x210) = 0;

+            uVar5 = 0;

+          }

+          UNLOCK();

+          if ((uVar5 >> 0x1d & 1) == 0) {

+            return lVar7;

+          }

+          iVar6 = IsHandleEntrySecure(param_1,lVar15);

+          if (iVar6 != 0) {

+            return lVar7;

+          }

+          UserSetLastError(0x578);

+          return 0;

+        }

+        ptVar14 = (tagUIPI_INFO *)(*(longlong *)(lVar8 + 0x1d0) + 0x130);

+        if (*(longlong *)(lVar8 + 0x1d0) == 0) {

+          ptVar14 = (tagUIPI_INFO *)0x0;

+        }

+        ptVar12 = (tagUIPI_INFO *)(*(longlong *)(lVar9 + 0x1d0) + 0x130);

+        if (*(longlong *)(lVar9 + 0x1d0) == 0) {

+          ptVar12 = (tagUIPI_INFO *)0x0;

+        }

+        bVar3 = UIPrivilegeIsolation::CheckAccess(ptVar12,ptVar14,(uint)(param_3 != 0));

+        if (bVar3) goto LAB_2;

+        lVar11 = W32GetUserGdiSessionState();

+        if (**(longlong **)(lVar8 + 0x1d0) == *(longlong *)(lVar11 + 0x28)) goto LAB_2;

+        EtwTraceUIPIHandleValidationError

+                  (*(undefined8 *)(lVar9 + 0x1d0),*(longlong **)(lVar8 + 0x1d0),param_1,

+                   *(undefined1 *)(lVar15 + 0x18));

+        uVar13 = 5;

+        goto LAB_3;

+      }

+    }

   }

-  return unaff_EDI;

+LAB_1:

+  uVar13 = 0x578;

+LAB_3:

+  UserSetLastError(uVar13);

+  return 0;

 }
```

## `AllocQueue`  (modified)

```diff
--- AllocQueue
+++ AllocQueue
@@ -1,22 +1,167 @@
 

-/* struct _GRETHREAD * __ptr64 __cdecl GreGetCurrentThread(void) */

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

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

 

-longlong AllocQueue(void)

+undefined8 * AllocQueue(longlong param_1,undefined8 *param_2)

 

 {

-  longlong *plVar1;

-  longlong lVar2;

-  longlong lVar3;

+  void *pvVar1;

+  code *pcVar2;

+  int iVar3;

+  longlong lVar4;

+  byte *pbVar5;

+  undefined8 uVar6;

+  uint uVar7;

+  uint uVar9;

+  undefined4 uVar10;

+  ulonglong uVar11;

+  undefined4 uVar12;

+  undefined4 uVar13;

+  undefined4 uVar14;

+  ulonglong uVar8;

   

-  plVar1 = (longlong *)W32GetCurrentThreadNonPaged();

-  lVar3 = 0;

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

-    lVar3 = *plVar1;

+                    /* 0x155f60  942  AllocQueue */

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

+    lVar4 = W32GetUserSessionState();

+    pvVar1 = *(void **)(lVar4 + 0x41e0);

+    lVar4 = W32GetUserSessionState();

+    param_2 = NSInstrumentation::CLeakTrackingAllocator::AllocateFromPagedLookasideList

+                        ((CLeakTrackingAllocator *)(lVar4 + 0x11a68),pvVar1);

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

+      return (undefined8 *)0x0;

+    }

+    param_2[0x4c] = 0;

+    uVar10 = 0;

+    param_2[2] = 0;

+    param_2[3] = 0;

+    *(undefined4 *)(param_2 + 4) = 0;

   }

-  lVar2 = 0;

-  if (lVar3 != 0) {

-    lVar2 = lVar3 + 8;

+  else {

+    uVar10 = *(undefined4 *)(param_2 + 0x43);

   }

-  return lVar2;

+  *param_2 = 0;

+  param_2[1] = 0;

+  memset(param_2 + 5,0,600);

+  *(undefined4 *)(param_2 + 0x43) = uVar10;

+  *(undefined4 *)((longlong)param_2 + 0x3c) = 2;

+  param_2[10] = param_2;

+  *(int *)(param_2 + 0x45) = (int)((ulonglong)_DAT_0 * _DAT_fffff78000000320 >> 0x18)

+  ;

+  if (param_1 == 0) {

+    iVar3 = ApiSetEditionIsGetKeyStateBlocked();

+    uVar11 = 0;

+    if (iVar3 == 0) {

+      lVar4 = W32GetUserSessionState();

+      uVar6 = *(undefined8 *)(lVar4 + 0x3800);

+      param_2[0x2f] = *(undefined8 *)(lVar4 + 0x37f8);

+      param_2[0x30] = uVar6;

+      uVar6 = *(undefined8 *)(lVar4 + 0x3810);

+      param_2[0x31] = *(undefined8 *)(lVar4 + 0x3808);

+      param_2[0x32] = uVar6;

+      uVar10 = *(undefined4 *)(lVar4 + 0x381c);

+      uVar12 = *(undefined4 *)(lVar4 + 0x3820);

+      uVar13 = *(undefined4 *)(lVar4 + 0x3824);

+      *(undefined4 *)(param_2 + 0x33) = *(undefined4 *)(lVar4 + 0x3818);

+      *(undefined4 *)((longlong)param_2 + 0x19c) = uVar10;

+      *(undefined4 *)(param_2 + 0x34) = uVar12;

+      *(undefined4 *)((longlong)param_2 + 0x1a4) = uVar13;

+      uVar10 = *(undefined4 *)(lVar4 + 0x3828);

+      uVar12 = *(undefined4 *)(lVar4 + 0x382c);

+      uVar13 = *(undefined4 *)(lVar4 + 0x3830);

+      uVar14 = *(undefined4 *)(lVar4 + 0x3834);

+      goto LAB_1;

+    }

+    do {

+      uVar9 = (uint)uVar11;

+      if ((byte)uVar11 < 0x20) {

+switchD_1401560d3_caseD_5b:

+        lVar4 = W32GetUserSessionState();

+        uVar11 = (uVar11 & 0xff) >> 2;

+        iVar3 = (uVar9 & 3) * 2;

+        if (((byte)(1 << (sbyte)iVar3) & *(byte *)(uVar11 + 0x37f8 + lVar4)) != 0) {

+          *(byte *)(uVar11 + 0x178 + (longlong)param_2) =

+               *(byte *)(uVar11 + 0x178 + (longlong)param_2) | (byte)(1 << iVar3);

+        }

+        lVar4 = W32GetUserSessionState();

+        iVar3 = (uVar9 & 3) * 2 + 1;

+        if (((byte)(1 << (sbyte)iVar3) & *(byte *)(uVar11 + 0x37f8 + lVar4)) != 0) {

+          *(byte *)(uVar11 + 0x178 + (longlong)param_2) =

+               *(byte *)(uVar11 + 0x178 + (longlong)param_2) | (byte)(1 << iVar3);

+        }

+      }

+      else {

+        pbVar5 = &DAT_2;

+        uVar8 = 0;

+        do {

+          if (*pbVar5 == (byte)uVar11) goto switchD_1401560d3_caseD_5b;

+          uVar7 = (int)uVar8 + 1;

+          uVar8 = (ulonglong)uVar7;

+          pbVar5 = pbVar5 + 1;

+        } while (uVar7 < 0xe);

+        switch(uVar9 & 0xff) {

+        case 0x5b:

+        case 0x5c:

+        case 0xa0:

+        case 0xa1:

+        case 0xa2:

+        case 0xa3:

+        case 0xa4:

+        case 0xa5:

+          goto switchD_1401560d3_caseD_5b;

+        }

+      }

+      uVar11 = (ulonglong)(uVar9 + 1);

+    } while ((int)(uVar9 + 1) < 0x100);

+  }

+  else {

+    lVar4 = *(longlong *)(param_1 + 0x1d8);

+    uVar6 = *(undefined8 *)(lVar4 + 0x180);

+    param_2[0x2f] = *(undefined8 *)(lVar4 + 0x178);

+    param_2[0x30] = uVar6;

+    uVar6 = *(undefined8 *)(lVar4 + 400);

+    param_2[0x31] = *(undefined8 *)(lVar4 + 0x188);

+    param_2[0x32] = uVar6;

+    uVar10 = *(undefined4 *)(lVar4 + 0x19c);

+    uVar12 = *(undefined4 *)(lVar4 + 0x1a0);

+    uVar13 = *(undefined4 *)(lVar4 + 0x1a4);

+    *(undefined4 *)(param_2 + 0x33) = *(undefined4 *)(lVar4 + 0x198);

+    *(undefined4 *)((longlong)param_2 + 0x19c) = uVar10;

+    *(undefined4 *)(param_2 + 0x34) = uVar12;

+    *(undefined4 *)((longlong)param_2 + 0x1a4) = uVar13;

+    uVar10 = *(undefined4 *)(lVar4 + 0x1a8);

+    uVar12 = *(undefined4 *)(lVar4 + 0x1ac);

+    uVar13 = *(undefined4 *)(lVar4 + 0x1b0);

+    uVar14 = *(undefined4 *)(lVar4 + 0x1b4);

+LAB_1:

+    *(undefined4 *)(param_2 + 0x35) = uVar10;

+    *(undefined4 *)((longlong)param_2 + 0x1ac) = uVar12;

+    *(undefined4 *)(param_2 + 0x36) = uVar13;

+    *(undefined4 *)((longlong)param_2 + 0x1b4) = uVar14;

+  }

+  lVar4 = W32GetUserSessionState();

+  if ((*(uint *)(lVar4 + 0x10cd0) & 1) == 0) {

+    *(int *)(param_2 + 0x42) = *(int *)(param_2 + 0x42) + -1;

+  }

+  lVar4 = W32GetUserSessionState();

+  if (*(int *)(lVar4 + 0x4c88) != 0) {

+    uVar6 = PsGetCurrentProcess();

+    iVar3 = PsGetProcessSessionIdEx(uVar6);

+    lVar4 = W32GetUserSessionState();

+    if ((iVar3 == *(int *)(lVar4 + 0x4c8c)) &&

+       (lVar4 = W32GetUserSessionState(), *(int *)(lVar4 + 0x4cc0) == 0)) {

+      lVar4 = W32GetUserSessionState();

+      uVar6 = *(undefined8 *)(lVar4 + 0x5608);

+      goto LAB_3;

+    }

+  }

+  lVar4 = W32GetUserSessionState();

+  uVar6 = *(undefined8 *)(lVar4 + 0x5a58);

+LAB_3:

+  lVar4 = W32GetWin32kBaseApiSetTable();

+  pcVar2 = *(code **)(*(longlong *)(lVar4 + 0x30) + 0x508);

+  if (pcVar2 != (code *)0x0) {

+    (*pcVar2)(param_2,uVar6);

+  }

+  return param_2;

 }
```

## `NtUserSetDisplayConfig`  (modified)

```diff
--- NtUserSetDisplayConfig
+++ NtUserSetDisplayConfig
@@ -1,14 +1,331 @@
 

-/* 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 NtUserSetDisplayConfig(longlong param_1)

+int NtUserSetDisplayConfig

+              (uint param_1,longlong *param_2,uint param_3,undefined8 *param_4,longlong param_5)

 

 {

-  longlong unaff_RDI;

+  tagUIPI_INFO *ptVar1;

+  code *pcVar2;

+  bool bVar3;

+  bool bVar4;

+  uint uVar5;

+  int iVar6;

+  int iVar7;

+  longlong lVar8;

+  longlong lVar9;

+  tagTHREADINFO *ptVar10;

+  longlong *plVar11;

+  __uint64 _Var12;

+  __uint64 _Var13;

+  uint uVar14;

+  __uint64 _Var15;

+  uint uVar16;

+  undefined1 uVar17;

+  ulonglong uVar18;

+  undefined1 auStack_178 [32];

+  undefined8 local_158;

+  int local_150;

+  longlong local_148;

+  ulonglong local_140;

+  undefined8 local_138;

+  undefined8 local_130;

+  undefined8 local_128;

+  uint local_118;

+  uint local_114;

+  longlong local_110;

+  undefined4 local_108;

+  undefined4 local_104;

+  longlong *local_100;

+  uint local_f8;

+  uint local_f4;

+  longlong *local_f0;

+  uint local_e8;

+  uint local_e4;

+  undefined4 local_d8;

+  uint local_d0;

+  longlong *local_c8;

+  undefined8 local_c0;

+  longlong *local_b8;

+  code *local_b0;

+  undefined4 local_a8;

+  undefined4 local_a4;

+  undefined4 local_a0;

+  longlong local_90;

+  undefined8 *local_88;

+  CDisplayScenarioContextScope local_80 [8];

+  undefined8 local_78;

+  longlong local_70;

+  undefined8 local_60;

+  undefined1 auStack_58 [8];

+  undefined8 local_50;

+  undefined4 local_48;

+  ulonglong local_40;

   

-  *(int *)(param_1 + -0x7d) = *(int *)(param_1 + -0x7d) + 1;

-  *(char *)(unaff_RDI + param_1) = *(char *)(unaff_RDI + param_1) + '\x01';

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

-  halt_baddata();

+                    /* 0x16b970  2030  NtUserSetDisplayConfig */

+  local_40 = __security_cookie ^ (ulonglong)auStack_178;

+  local_90 = param_5;

+  _Var13 = 0;

+  local_100 = (longlong *)0x0;

+  local_118 = param_3;

+  local_e8 = param_1;

+  local_d0 = param_3;

+  local_88 = param_4;

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>::

+  Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)>

+            ((Win32RawOptionalLockedItem<_devicemodeW,&void___cdecl_Win32FreePool(void*___ptr64)> *)

+             &local_c0);

+  lVar8 = _DAT_0;

+  uVar16 = 0;

+  local_f4 = 0;

+  local_108 = 0;

+  local_60 = 0;

+  auStack_58 = (undefined1  [8])0x0;

+  local_50 = 0;

+  local_48 = 0;

+  local_70 = _DAT_0;

+  uVar5 = KeQueryTimeIncrement();

+  local_110 = (ulonglong)uVar5 * lVar8;

+  iVar6 = -0x3ffffff3;

+  local_d8 = 0xc000000d;

+  lVar8 = W32GetUserSessionState();

+  uVar17 = 0;

+  lVar9 = UserCritInternal::`anonymous_namespace'::EnterCritInternal

+                    (lVar8,0,0,<lambda_63b61c2369133a205197eda5bd671ee7>::<lambda_invoker_cdecl>);

+  *(longlong *)(lVar8 + 0x10) = lVar9;

+  if (lVar9 != 0) {

+    DestroySharedUserCritDeferredUnlockList(lVar8 + 0x4d78);

+    DestroyDeferredUnlockObjectAssignmentList(lVar8 + 0x4db0);

+    DestroyDeferredUnlockObjectAssignmentList(lVar8 + 0x4da0);

+  }

+  lVar8 = W32GetUserGdiSessionState();

+  if (*(int *)(lVar8 + 0x20) == 0) {

+    iVar7 = -0x80000000;

+LAB_1:

+    iVar6 = -0x3fffffff;

+    uVar5 = local_118;

+LAB_2:

+  }

+  else {

+    ptVar10 = PtiCurrent();

+    iVar7 = Feature_UIPIModernization__private_IsEnabledDeviceUsageNoInline();

+    ptVar1 = (tagUIPI_INFO *)(*(longlong *)(ptVar10 + 0x1d0) + 0x130);

+    if (iVar7 == 0) {

+      local_a8 = 0x2000;

+      local_a4 = 0xffffffff;

+      local_a0 = 0;

+      uVar17 = 0;

+      bVar3 = UIPrivilegeIsolation::CheckAccess(ptVar1,(tagUIPI_INFO *)&local_a8,0);

+    }

+    else {

+      bVar3 = UIPrivilegeIsolation::MeetsUIPIThreshold

+                        ((UIPIAccessor *)

+                         (-(ulonglong)(*(longlong *)(ptVar10 + 0x1d0) != 0) & (ulonglong)ptVar1),

+                         0x2000);

+    }

+    bVar4 = tagPROCESSINFO::CanPerformUIOperation(*(tagPROCESSINFO **)(ptVar10 + 0x1d0),0x10);

+    uVar5 = local_118;

+    if ((!bVar4) || (bVar3 == false)) {

+      iVar6 = -0x3fffffde;

+      iVar7 = -0x7fffffff;

+LAB_3:

+      if (iVar7 == 0x12) goto LAB_4;

+      goto LAB_2;

+    }

+    if (0x400 < param_1) {

+      iVar7 = -0x7ffffffe;

+      goto LAB_2;

+    }

+    local_f0 = (longlong *)0x0;

+    local_c8 = (longlong *)0x0;

+    local_f8 = 0;

+    local_e4 = 0;

+    local_114 = 0;

+    if (param_1 != 0) {

+      if (((ulonglong)param_1 * 0xd8 != 0) &&

+         (lVar8 = PsGetCurrentProcessWow64Process(),

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

+                    /* WARNING: Subroutine does not return */

+        ExRaiseDatatypeMisalignment();

+      }

+      local_f8 = 0;

+      _Var12 = _Var13;

+      local_f0 = param_2;

+      _Var15 = _Var13;

+      while( true ) {

+        local_114 = (uint)_Var12;

+        uVar14 = (uint)_Var15;

+        if (param_1 <= local_114) break;

+        if (*local_f0 < 0) {

+          local_f8 = uVar14 + 1;

+          _Var15 = (__uint64)local_f8;

+        }

+        _Var12 = (__uint64)(local_114 + 1);

+        local_f0 = local_f0 + 0x1b;

+      }

+      if (uVar14 != 0) {

+        plVar11 = Win32AllocPoolWithQuotaZInitImpl(_Var12,_Var15 * 0xd8,0x63447355);

+        local_100 = plVar11;

+        if (plVar11 == (longlong *)0x0) {

+                    /* WARNING: Subroutine does not return */

+          ExRaiseStatus(0xc0000017);

+        }

+        if (local_b0 != (code *)0xffffffffffffffff) {

+          local_158 = PtiCurrent();

+                    /* WARNING: Subroutine does not return */

+          KeBugCheckEx(0x164,0x12,&local_c0,plVar11);

+        }

+        ptVar10 = PtiCurrent();

+        local_c0 = *(undefined8 *)(ptVar10 + 0x180);

+        *(undefined8 **)(ptVar10 + 0x180) = &local_c0;

+        local_b8 = local_100;

+        local_b0 = GreDeleteFastMutex;

+      }

+      local_c8 = local_100;

+      _Var12 = _Var13;

+      plVar11 = local_100;

+      while( true ) {

+        uVar17 = 0xd8;

+        local_114 = (uint)_Var13;

+        uVar16 = (uint)_Var12;

+        uVar5 = local_118;

+        local_f0 = param_2;

+        if (local_e8 <= local_114) break;

+        if (*param_2 < 0) {

+          if (uVar14 <= uVar16) {

+            local_104 = 0xc000000d;

+            iVar7 = -0x7ffffffd;

+            local_108 = 0x80000003;

+            goto LAB_3;

+          }

+          uVar17 = 0xd8;

+          RtlCopyVolatileMemory(plVar11,param_2,0xd8);

+          if (-1 < *plVar11) {

+            iVar6 = -0x3fffffde;

+            local_104 = 0xc0000022;

+            iVar7 = -0x7ffffffc;

+            local_108 = 0x80000004;

+            uVar5 = local_118;

+            goto LAB_3;

+          }

+          local_e4 = uVar16 + 1;

+          _Var12 = (__uint64)local_e4;

+          plVar11 = plVar11 + 0x1b;

+          local_c8 = plVar11;

+        }

+        _Var13 = (__uint64)(local_114 + 1);

+        param_2 = param_2 + 0x1b;

+      }

+      if (uVar16 != uVar14) {

+        local_104 = 0xc000000d;

+        iVar7 = -0x7ffffffd;

+        local_108 = 0x80000003;

+        goto LAB_3;

+      }

+    }

+    local_f4 = uVar16;

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

+      lVar8 = PsGetCurrentProcessWow64Process();

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

+                    /* WARNING: Subroutine does not return */

+        ExRaiseDatatypeMisalignment();

+      }

+      local_60 = *param_4;

+      auStack_58 = (undefined1  [8])param_4[1];

+      local_50 = param_4[2];

+      local_48 = *(undefined4 *)(param_4 + 3);

+    }

+    lVar8 = W32GetUserGdiSessionState();

+    if (*(int *)(lVar8 + 0x24) != 0) {

+      iVar7 = -0x7ffffffb;

+      goto LAB_1;

+    }

+    iVar6 = UserIsWddmConnectedSession();

+    if (iVar6 == 0) {

+      iVar6 = -0x3fffffde;

+      iVar7 = -0x7ffffffa;

+      uVar5 = local_118;

+      goto LAB_2;

+    }

+    if (((param_4 == (undefined8 *)0x0) || (iVar6 = DrvNeedDisplayStateCheck(&local_60), iVar6 == 0)

+        ) || (iVar6 = DrvIsDisplayStateCurrent(1,&local_60), iVar6 != 0)) {

+      local_80[0] = (CDisplayScenarioContextScope)0x0;

+      CDisplayScenarioContextScope::ContextScopeConstructor

+                (local_80,(_GUID *)(auStack_58 + 4),0x1d,0);

+      uVar5 = local_118;

+      iVar7 = 0x12;

+      local_128 = 0;

+      local_130 = local_78;

+      local_138 = 0;

+      local_140 = 0;

+      local_148 = local_90;

+      local_150 = CONCAT31(local_150._1_3_,1);

+      local_158 = (tagTHREADINFO *)0x0;

+      uVar18 = (ulonglong)local_118;

+      iVar6 = xxxUserSetDisplayConfig(uVar16,local_100,uVar18,0);

+      uVar17 = (undefined1)uVar18;

+      if (iVar6 == -0x7ffffffb) {

+        iVar6 = -0x3fffffdd;

+      }

+      else if ((iVar6 != -0x3fffffdd) && ((uVar5 >> 0x10 & 1) == 0)) {

+        if (iVar6 == -0x3fe1fcfa) {

+          iVar6 = -0x7ff8f9b6;

+        }

+        else {

+          iVar6 = _QdcSdcTranslateStatusDefault(iVar6);

+        }

+      }

+      CDisplayScenarioContextScope::~CDisplayScenarioContextScope(local_80);

+      goto LAB_3;

+    }

+    iVar6 = -0x3fe1fcc9;

+    iVar7 = -0x7ffffff9;

+    uVar5 = local_118;

+  }

+  local_138 = 0;

+  local_140 = local_140 & 0xffffffffffffff00;

+  local_158 = (tagTHREADINFO *)((ulonglong)local_158._4_4_ << 0x20);

+  uVar18 = (ulonglong)uVar5;

+  local_150 = iVar7;

+  local_148 = local_110;

+  LogDiagSDC(local_f4,local_100,uVar18,iVar6);

+  uVar17 = (undefined1)uVar18;

+LAB_4:

+  if (iVar6 < 0) {

+    if (((param_4 != (undefined8 *)0x0) && (iVar7 = DrvNeedDisplayStateCheck(&local_60), iVar7 != 0)

+        ) && (iVar7 = DrvIsDisplayStateCurrent(0), iVar7 == 0)) {

+      iVar6 = -0x3fe1fcc9;

+    }

+  }

+  else {

+    lVar8 = W32GetWin32kBaseApiSetTable();

+    pcVar2 = *(code **)(*(longlong *)(lVar8 + 0x30) + 0xf70);

+    if (pcVar2 == (code *)0x0) {

+      iVar7 = -0x3fffff45;

+    }

+    else {

+      iVar7 = (*pcVar2)();

+    }

+    if (-1 < iVar7) {

+      lVar8 = W32GetWin32kBaseApiSetTable();

+      pcVar2 = *(code **)(*(longlong *)(lVar8 + 0x30) + 0xf78);

+      if (pcVar2 != (code *)0x0) {

+        (*pcVar2)();

+      }

+    }

+  }

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

+    Win32RawLockedItemBase<tagDESKTOP,&void___cdecl_UserDereferenceObject(void*___ptr64),1,1,1>::

+    UnlockWorker((Win32RawLockedItemBase<tagDESKTOP,&void___cdecl_UserDereferenceObject(void*___ptr64),1,1,1>

+                  *)&local_c0,false,(bool)uVar17);

+  }

+  ReleaseUserCriticalSection();

+  Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>::

+  ~Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

+            ((Win32RawOptionalLockedItem<_UNICODE_STRING,&void___cdecl_Win32FreePool(void*___ptr64)>

+              *)&local_c0);

+  return iVar6;

 }
```

## `IsHandleEntryAccessibleForIL`  (modified)

```diff
--- IsHandleEntryAccessibleForIL
+++ IsHandleEntryAccessibleForIL
@@ -1,23 +1,49 @@
+

+/* int __cdecl IsHandleEntryAccessibleForIL(struct _HANDLEENTRY * __ptr64) */

 

 int __cdecl IsHandleEntryAccessibleForIL(_HANDLEENTRY *param_1)

 

 {

-  char cVar1;

-  undefined4 extraout_EAX;

-  undefined4 uVar2;

-  undefined1 unaff_BL;

-  CPlatformReaderWriterLock *unaff_RSI;

+  _HANDLEENTRY _Var1;

+  bool bVar2;

+  longlong lVar3;

+  longlong *plVar4;

+  longlong lVar5;

+  ulonglong uVar6;

+  longlong *plVar7;

   

-  cVar1 = RtlTestBit();

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

-    NSInstrumentation::CPlatformReaderWriterLock::ReleaseShared(unaff_RSI);

-    uVar2 = extraout_EAX;

+  lVar3 = W32GetUserSessionState();

+  lVar5 = *(longlong *)(lVar3 + 0x4e08);

+  uVar6 = (longlong)param_1 - *(longlong *)(lVar3 + 0x4e40) >> 5 & 0xffffffff;

+  plVar4 = (longlong *)PsGetCurrentProcessWin32Process();

+  if (((plVar4 == (longlong *)0x0) || (*plVar4 != 0)) && (plVar4 != (longlong *)0x0)) {

+    plVar7 = (longlong *)0x0;

+    if ((*(ushort *)(&DAT_0 + (ulonglong)(byte)param_1[0x18] * 0x18) & 2) == 0) {

+      if (((*(ushort *)(&DAT_0 + (ulonglong)(byte)param_1[0x18] * 0x18) & 1) != 0) &&

+         (lVar5 = *(longlong *)(lVar5 + 8 + uVar6 * 0x28), lVar5 != 0)) {

+        plVar7 = *(longlong **)(lVar5 + 0x1d0);

+      }

+    }

+    else {

+      plVar7 = *(longlong **)(lVar5 + 8 + uVar6 * 0x28);

+    }

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

+        (lVar5 = W32GetUserGdiSessionState(), *plVar7 != *(longlong *)(lVar5 + 0x28))) &&

+       (bVar2 = UIPrivilegeIsolation::CheckAccess

+                          ((tagUIPI_INFO *)(plVar4 + 0x26),(tagUIPI_INFO *)(plVar7 + 0x26),0),

+       !bVar2)) {

+      _Var1 = param_1[0x18];

+      lVar5 = W32GetUserSessionState();

+      EtwTraceUIPIHandleValidationError

+                (plVar4,plVar7,

+                 **(undefined8 **)

+                   (*(longlong *)(lVar5 + 0x4e08) +

+                   ((longlong)param_1 - *(longlong *)(lVar5 + 0x4e40) >> 5 & 0xffffffffU) * 0x28),

+                 _Var1);

+      UserSetLastError(5);

+      return 0;

+    }

   }

-  else {

-    ExReleasePushLockSharedEx();

-    uVar2 = KeLeaveCriticalRegion();

-    unaff_BL = 1;

-  }

-  return CONCAT31((int3)((uint)uVar2 >> 8),unaff_BL);

+  return 1;

 }
```

## `UserCaptureSid`  (modified)

```diff
--- UserCaptureSid
+++ UserCaptureSid
@@ -1,67 +1,49 @@
 

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

-

-long __cdecl UserCaptureSid(void *param_1,char param_2,void **param_3)

+undefined8 UserCaptureSid(void *param_1,char param_2,longlong *param_3)

 

 {

-  void *pvVar1;

-  uint uVar2;

-  void *_Dst;

-  int iVar3;

-  undefined7 in_register_00000011;

-  _D3DKMT_ESCAPE_WIN32K_COLOR_PROFILE *unaff_RSI;

-  int unaff_EDI;

-  longlong unaff_R13;

-  uint *unaff_R15;

-  undefined8 in_stack_00000030;

-  undefined8 in_stack_00000038;

+  char cVar1;

+  void *pvVar2;

+  undefined8 uVar3;

+  undefined1 *puVar4;

+  undefined1 local_res10;

+  uint local_18;

   

-  iVar3 = (int)param_1;

-  if (iVar3 == 1) {

-    if (*unaff_R15 < 100) {

-LAB_0:

-      iVar3 = -0x3ffffff3;

-      goto LAB_1;

-    }

-    iVar3 = DrvCollectColorProfileForUser(unaff_RSI,*unaff_R15);

-  }

-  else if (iVar3 == 2) {

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

-LAB_2:

-      iVar3 = -0x3fffffde;

-      goto LAB_1;

-    }

-    if (*unaff_R15 == 0) goto LAB_0;

-    in_stack_00000030 = 0;

-    in_stack_00000038 = 0;

-    DrvSetMonitorsDimState(*unaff_RSI,&stack0x00000030);

-    iVar3 = unaff_EDI;

-  }

-  else if (iVar3 == 3) {

-    if (gbOSTestSigningEnabled == '\0') goto LAB_2;

-    iVar3 = -0x3fffff45;

+                    /* 0x1ae8c0  2252  UserCaptureSid */

+  if (param_2 == '\0') {

+    local_res10 = *(undefined1 *)((longlong)param_1 + 1);

+    local_18 = RtlLengthRequiredSid();

   }

   else {

-    WdLogSingleEntry1(2,CONCAT71(in_register_00000011,param_2));

-    _WdLogGlobalForLineNumber = 0x72db;

-    iVar3 = -0x3ffffff3;

+    puVar4 = (undefined1 *)((longlong)param_1 + 1);

+    if (*(undefined1 **)MmUserProbeAddress_exref <= (undefined1 *)((longlong)param_1 + 1)) {

+      puVar4 = *(undefined1 **)MmUserProbeAddress_exref;

+    }

+    local_res10 = *puVar4;

+    local_18 = RtlLengthRequiredSid();

+    if ((local_18 != 0) && (((ulonglong)param_1 & 3) != 0)) {

+                    /* WARNING: Subroutine does not return */

+      ExRaiseDatatypeMisalignment();

+    }

   }

-  if (-1 < iVar3) {

-    if (unaff_RSI == (_D3DKMT_ESCAPE_WIN32K_COLOR_PROFILE *)0x0) {

-      return iVar3;

+  pvVar2 = Win32AllocPoolZInitImpl(0x100,(ulonglong)local_18,0x65737355);

+  *param_3 = (longlong)pvVar2;

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

+    uVar3 = 0xc000009a;

+  }

+  else {

+    memmove((void *)*param_3,param_1,(ulonglong)local_18);

+    *(undefined1 *)(*param_3 + 1) = local_res10;

+    cVar1 = RtlValidSid(*param_3);

+    if (cVar1 == '\0') {

+      GreDeleteFastMutex(*param_3);

+      *param_3 = 0;

+      uVar3 = 0xc0000078;

     }

-    uVar2 = *unaff_R15;

-    _Dst = *(void **)(unaff_R13 + 0x10);

-    pvVar1 = (void *)((longlong)_Dst + (ulonglong)uVar2);

-    if ((*(void **)MmUserProbeAddress_exref < pvVar1) || (pvVar1 <= _Dst)) {

-      **(undefined1 **)MmUserProbeAddress_exref = (char)unaff_EDI;

+    else {

+      uVar3 = 0;

     }

-    memmove(_Dst,unaff_RSI,(ulonglong)uVar2);

   }

-LAB_1:

-  if (unaff_RSI != (_D3DKMT_ESCAPE_WIN32K_COLOR_PROFILE *)0x0) {

-    GreDeleteFastMutex();

-  }

-  return iVar3;

+  return uVar3;

 }
```

## `ApiSetpIsFeatureEnabled`  (modified)

```diff
--- ApiSetpIsFeatureEnabled
+++ ApiSetpIsFeatureEnabled
@@ -1,43 +1,17 @@
 

-/* long __cdecl CitpProgramIdCopy(struct _CIT_PROGRAM_ID * __ptr64,struct _CIT_PROGRAM_ID const *

-   __ptr64) */

-

-long ApiSetpIsFeatureEnabled(ushort **param_1,undefined8 *param_2)

+bool ApiSetpIsFeatureEnabled(int param_1)

 

 {

-  ushort *puVar1;

-  long lVar2;

-  __uint64 _Var3;

-  __uint64 _Var4;

+  char cVar1;

+  int iVar2;

   

-  puVar1 = (ushort *)param_2[1];

-  *param_1 = (ushort *)*param_2;

-  param_1[1] = puVar1;

-  puVar1 = (ushort *)param_2[3];

-  param_1[2] = (ushort *)param_2[2];

-  param_1[3] = puVar1;

-  param_1[4] = (ushort *)param_2[4];

-  *param_1 = (ushort *)0x0;

-  param_1[1] = (ushort *)0x0;

-  puVar1 = (ushort *)*param_2;

-  if (puVar1 == (ushort *)0x0) {

-    CitpLogFailureWorker(-0x3fffff45,(char *)0x0,0x56e);

-    lVar2 = -0x3fffff45;

+  if (param_1 == 0x3a132a5) {

+    iVar2 = Feature_DriverSetup_ReofferFingerprinting_v2__private_IsEnabledDeviceUsageNoInline();

+    cVar1 = (iVar2 != 0) + '\x01';

   }

   else {

-    _Var3 = 0xffffffffffffffff;

-    _Var4 = 0xffffffffffffffff;

-    do {

-      _Var4 = _Var4 + 1;

-    } while (puVar1[_Var4] != 0);

-    lVar2 = CitpStringDuplicate(param_1,puVar1,_Var4);

-    if ((-1 < lVar2) && (puVar1 = (ushort *)param_2[1], puVar1 != (ushort *)0x0)) {

-      do {

-        _Var3 = _Var3 + 1;

-      } while (puVar1[_Var3] != 0);

-      lVar2 = CitpStringDuplicate(param_1 + 1,puVar1,_Var3);

-    }

+    cVar1 = '\0';

   }

-  return lVar2;

+  return cVar1 == '\x02';

 }
```

## `UserIsProcessImmersiveAppContainer`  (modified)

```diff
--- UserIsProcessImmersiveAppContainer
+++ UserIsProcessImmersiveAppContainer
@@ -1,25 +1,20 @@
 

-void UserIsProcessImmersiveAppContainer(longlong param_1)

+undefined8 UserIsProcessImmersiveAppContainer(void)

 

 {

-  longlong lVar1;

-  undefined4 *unaff_RSI;

-  byte bVar2;

-  undefined4 unaff_R14D;

-  bool bVar3;

+  longlong *plVar1;

+  undefined8 uVar2;

   

-  bVar2 = (byte)unaff_R14D;

-  if (((bVar2 & (byte)*(undefined4 *)(param_1 + 0x2c)) == 0) || (*(byte *)(param_1 + 0x29) < 4)) {

-    bVar2 = 0;

+                    /* 0xc3040  2290  UserIsProcessImmersiveAppContainer */

+  plVar1 = (longlong *)PsGetProcessWin32Process();

+  uVar2 = 0;

+  if ((plVar1 == (longlong *)0x0) || (*plVar1 == 0)) {

+    uVar2 = 0;

   }

-  bVar3 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-  if ((bVar2 != 0) || (bVar3)) {

-    lVar1 = W32GetUserSessionState();

-    WPP_RECORDER_AND_TRACE_SF_qq

-              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),bVar2,bVar3,

-               *(undefined8 *)(lVar1 + 0x4c18),4);

+  else if (((*(int *)((longlong)plVar1 + 0x134) != 0) && (((byte)plVar1[0x66] & 0x30) == 0x10)) &&

+          (((ulonglong)plVar1[0x66] >> 9 & 1) == 0)) {

+    uVar2 = 1;

   }

-  *unaff_RSI = unaff_R14D;

-  return;

+  return uVar2;

 }
```

## `xxxUserSetDisplayConfig`  (modified)

```diff
--- xxxUserSetDisplayConfig
+++ xxxUserSetDisplayConfig
@@ -1,116 +1,300 @@
 

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

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

+/* WARNING: Removing unreachable block (ram,0x00014015d879) */

+/* WARNING: Removing unreachable block (ram,0x00014015d88c) */

+/* WARNING: Removing unreachable block (ram,0x00014015d895) */

+/* WARNING: Removing unreachable block (ram,0x00014015d8a2) */

+/* WARNING: Removing unreachable block (ram,0x00014015d89b) */

+/* WARNING: Removing unreachable block (ram,0x00014015d8a5) */

+/* WARNING: Removing unreachable block (ram,0x00014015d8bb) */

+/* WARNING: Removing unreachable block (ram,0x00014015d8c0) */

+/* WARNING: Removing unreachable block (ram,0x00014015d908) */

+/* WARNING: Removing unreachable block (ram,0x00014015d6d7) */

+/* WARNING: Removing unreachable block (ram,0x00014015d6e0) */

+/* WARNING: Removing unreachable block (ram,0x00014015d6ea) */

+/* WARNING: Removing unreachable block (ram,0x00014015d712) */

+/* WARNING: Removing unreachable block (ram,0x00014015d706) */

+/* WARNING: Removing unreachable block (ram,0x00014015d715) */

+/* WARNING: Removing unreachable block (ram,0x00014015d93a) */

+/* WARNING: Removing unreachable block (ram,0x00014015d944) */

+/* WARNING: Removing unreachable block (ram,0x00014015d956) */

+/* WARNING: Removing unreachable block (ram,0x00014015d95e) */

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

 

-void xxxUserSetDisplayConfig(void)

+int xxxUserSetDisplayConfig

+              (uint param_1,DISPLAYCONFIG_PATH_INFO_INTERNAL *param_2,uint param_3,uint param_4,

+              longlong param_5,char param_6,longlong param_7,longlong param_8,undefined1 *param_9,

+              _DXGK_DISPLAY_SCENARIO_CONTEXT *param_10,undefined8 *param_11)

 

 {

-  void *pvVar1;

-  code *pcVar2;

-  int iVar3;

-  char *in_RAX;

-  longlong lVar4;

-  SGRDPgpRemoteSessionOcclusionEvent<_KEVENT*___ptr64> *this;

-  longlong unaff_RBP;

-  longlong unaff_RSI;

-  longlong unaff_RDI;

+  short *psVar1;

+  undefined2 uVar2;

+  code *pcVar3;

+  bool bVar4;

+  char cVar5;

+  uint uVar6;

+  int iVar7;

+  tagTHREADINFO *ptVar8;

+  longlong lVar9;

+  longlong lVar10;

+  longlong lVar11;

+  longlong lVar12;

+  undefined8 uVar13;

+  uint uVar14;

+  undefined1 auStackY_178 [32];

+  int local_e4;

+  undefined8 *local_d0;

+  uint local_b0 [2];

+  longlong local_a8;

+  _DXGK_DISPLAY_SCENARIO_CONTEXT *local_a0;

+  longlong local_98;

+  undefined1 *local_90;

+  longlong local_88;

+  undefined8 local_80;

+  undefined8 uStack_78;

+  undefined8 local_70;

+  undefined8 uStack_68;

+  undefined8 local_60;

+  ulonglong local_58;

   

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

-  if (*(code **)(*(longlong *)(in_RAX + 0x30) + 0xb8) != (code *)0x0) {

-    (**(code **)(*(longlong *)(in_RAX + 0x30) + 0xb8))(unaff_RBP + 0x20);

-  }

-  pvVar1 = (void *)**(undefined8 **)(unaff_RBP + 0x20);

-  if (pvVar1 != (void *)0x0) {

-    lVar4 = W32GetUserSessionState();

-    NSInstrumentation::CLeakTrackingAllocator::FreePagedLookasideList

-              ((CLeakTrackingAllocator *)(unaff_RDI + lVar4),pvVar1);

-    **(longlong **)(unaff_RBP + 0x20) = unaff_RSI;

-  }

-  lVar4 = W32GetUserSessionState();

-  if (*(longlong *)(lVar4 + 0x4b18) != unaff_RSI) {

-    iVar3 = IsFreeMessageListSupported();

-    if (-1 < iVar3) {

-      FreeMessageList(*(longlong *)(lVar4 + 0x4b18) + 0x28);

-    }

-    FreeQueue(*(undefined8 *)(lVar4 + 0x4b18));

-    *(longlong *)(lVar4 + 0x4b18) = unaff_RSI;

-  }

-  lVar4 = W32GetUserSessionState();

-  if (*(longlong *)(lVar4 + 0x41e0) != unaff_RSI) {

-    lVar4 = W32GetUserSessionState();

-    pvVar1 = *(void **)(lVar4 + 0x41e0);

-    lVar4 = W32GetUserSessionState();

-    NSInstrumentation::CLeakTrackingAllocator::FreePagedLookasideList

-              ((CLeakTrackingAllocator *)(unaff_RDI + lVar4),pvVar1);

-    lVar4 = W32GetUserSessionState();

-    *(longlong *)(lVar4 + 0x41e0) = unaff_RSI;

-  }

-  lVar4 = W32GetUserSessionState();

-  if (*(longlong *)(lVar4 + 0x41e8) != unaff_RSI) {

-    lVar4 = W32GetUserSessionState();

-    pvVar1 = *(void **)(lVar4 + 0x41e8);

-    lVar4 = W32GetUserSessionState();

-    NSInstrumentation::CLeakTrackingAllocator::FreePagedLookasideList

-              ((CLeakTrackingAllocator *)(unaff_RDI + lVar4),pvVar1);

-    lVar4 = W32GetUserSessionState();

-    *(longlong *)(lVar4 + 0x41e8) = unaff_RSI;

-  }

-  CleanupKeyboardLayouts();

-  lVar4 = W32GetUserSessionState();

-  if (*(longlong *)(lVar4 + 0xf7c8) != 0) {

-    GreDeleteFastMutex();

-  }

-  lVar4 = W32GetUserSessionState();

-  if (*(longlong *)(lVar4 + 0xf8b8) != unaff_RSI) {

-    lVar4 = W32GetUserSessionState();

-    GreDeleteFastMutex(*(undefined8 *)(lVar4 + 0xf8b8));

-    lVar4 = W32GetUserSessionState();

-    *(longlong *)(lVar4 + 0xf8b8) = unaff_RSI;

-  }

-  lVar4 = W32GetUserSessionState();

-  if (*(longlong *)(lVar4 + 0x4df0) != unaff_RSI) {

-    lVar4 = W32GetUserSessionState();

-    ExFreePoolWithTag(*(undefined8 *)(lVar4 + 0x4df0),0);

-    lVar4 = W32GetUserSessionState();

-    *(longlong *)(lVar4 + 0x4df0) = unaff_RSI;

-  }

-  lVar4 = W32GetUserSessionState();

-  if (*(longlong *)(lVar4 + 0x1f8) != unaff_RSI) {

-    lVar4 = W32GetUserSessionState();

-    GreDeleteFastMutex(*(undefined8 *)(lVar4 + 0x1f8));

-    lVar4 = W32GetUserSessionState();

-    *(longlong *)(lVar4 + 0x1f8) = unaff_RSI;

-  }

-  lVar4 = W32GetUserSessionState();

-  if (*(longlong *)(lVar4 + 8) != unaff_RSI) {

-    lVar4 = W32GetUserSessionState();

-    CLEANUP_CRIT_RESOURCE((_FAST_ERESOURCE **)(lVar4 + 8));

-  }

-  lVar4 = W32GetUserSessionState();

-  if (*(longlong *)(lVar4 + 0x10cc8) != unaff_RSI) {

-    lVar4 = W32GetUserSessionState();

-    this = *(SGRDPgpRemoteSessionOcclusionEvent<_KEVENT*___ptr64> **)(lVar4 + 0x10cc8);

-    ObfDereferenceObject();

-    *(longlong *)(unaff_RBP + 0x20) = unaff_RSI;

-    SGRDPgpRemoteSessionOcclusionEvent<_KEVENT*___ptr64>::operator=

-              (this,(_KEVENT **)(unaff_RBP + 0x20));

-  }

-  lVar4 = W32GetWin32kBaseApiSetTable();

-  pcVar2 = *(code **)(*(longlong *)(lVar4 + 0x30) + 0x1c8);

-  if (pcVar2 != (code *)0x0) {

-    iVar3 = (*pcVar2)();

-    if (-1 < iVar3) {

-      lVar4 = W32GetWin32kBaseApiSetTable();

-      pcVar2 = *(code **)(*(longlong *)(lVar4 + 0x30) + 0x1d0);

-      if (pcVar2 != (code *)0x0) {

-        (*pcVar2)();

-      }

-    }

-  }

-  lVar4 = W32GetUserSessionState();

-  if (*(longlong *)(lVar4 + 0xdf40) != 0) {

-    ExFreePoolWithTag(*(longlong *)(lVar4 + 0xdf40),0x44535042);

-  }

-  *(longlong *)(lVar4 + 0xdf40) = unaff_RSI;

-  return;

+                    /* 0x15d080  2520  xxxUserSetDisplayConfig */

+  lVar10 = _DAT_0;

+  local_58 = __security_cookie ^ (ulonglong)auStackY_178;

+  local_a8 = param_7;

+  local_98 = param_8;

+  local_90 = param_9;

+  local_a0 = param_10;

+  local_60 = 0;

+  local_e4 = 0;

+  local_80 = 0;

+  uStack_78 = 0;

+  local_70 = 0;

+  uStack_68 = 0;

+  local_d0 = param_11;

+  bVar4 = false;

+  uVar6 = KeQueryTimeIncrement();

+  local_88 = (ulonglong)uVar6 * lVar10;

+  if ((param_5 == 0) || ((*(uint *)(param_5 + 0x30) & 8) != 0)) {

+    ptVar8 = PtiCurrent();

+    param_5 = *(longlong *)(ptVar8 + 0x1f0);

+  }

+  lVar9 = W32GetUserSessionState();

+  lVar10 = W32GetUserGdiSessionState();

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

+  lVar11 = PsGetCurrentProcess();

+  if (((lVar11 == lVar10) || (param_6 == '\0')) || ((param_4 & 0x10) != 0)) {

+    if (param_5 == 0) {

+      param_5 = *(longlong *)(lVar9 + 0x4b58);

+    }

+  }

+  else {

+    lVar10 = W32GetUserSessionState();

+    if (*(int *)(lVar10 + 0xf5f8) == 0) {

+      lVar10 = *(longlong *)(lVar9 + 0x4b58);

+    }

+    else {

+      lVar10 = *(longlong *)(lVar9 + 0x4b60);

+    }

+    if (param_5 != lVar10) {

+      lVar11 = 0;

+      lVar9 = lVar11;

+      if ((lVar10 != 0) && (lVar12 = ObQueryNameInfo(lVar10), lVar12 != 0)) {

+        lVar10 = ObQueryNameInfo(lVar10);

+        lVar9 = lVar10 + 8;

+      }

+      if ((param_5 != 0) && (lVar10 = ObQueryNameInfo(param_5), lVar10 != 0)) {

+        lVar11 = ObQueryNameInfo(param_5);

+        lVar11 = lVar11 + 8;

+      }

+      LogDiagSDCAccessDenied(lVar11,lVar9);

+      iVar7 = -0x3fffffde;

+      local_e4 = 0x31;

+      goto LAB_1;

+    }

+  }

+  uVar6 = param_3 & 0x10000;

+  if ((uVar6 != 0) != (local_a8 != 0)) {

+    iVar7 = -0x3ffffff3;

+    local_e4 = 1;

+    goto LAB_1;

+  }

+  uVar14 = param_4;

+  if (uVar6 != 0) {

+    uVar14 = param_4 | 4;

+    if ((param_3 >> 0x1d & 1) != 0) {

+      uVar14 = param_4 | 0x14;

+    }

+    if ((param_3 >> 0x1c & 1) != 0) {

+      uVar14 = uVar14 | 0x200;

+    }

+  }

+  iVar7 = DrvSetDisplayConfigValidateParams(param_1,param_2,param_3,uVar14);

+  if (iVar7 < 0) {

+    local_e4 = 1;

+    goto LAB_1;

+  }

+  if ((uVar6 == 0) &&

+     (((iVar7 = UserIsConsoleConnection(), iVar7 != 0 || ((param_3 & 0x88f) != 0x88f)) &&

+      ((uVar14 & 0xc01) == 0)))) {

+    iVar7 = DispBrokerGetCurrentMode();

+    if (iVar7 == 3) {

+      iVar7 = DispBrokerSetDisplayConfig(param_1,param_2,param_3,uVar14,local_a0,param_6 != '\0');

+      if ((-1 < iVar7) || ((uVar14 >> 9 & 1) == 0)) {

+        local_e4 = 0x38;

+        goto LAB_1;

+      }

+    }

+    else {

+      iVar7 = DispBrokerGetCurrentMode();

+      if (iVar7 == 2) {

+        local_e4 = 0x37;

+        iVar7 = -0x3fffffde;

+        goto LAB_1;

+      }

+    }

+  }

+  iVar7 = UserIsConsoleConnection();

+  if ((iVar7 != 0) && (uVar6 != 0)) {

+    if (param_11 != (undefined8 *)0x0) {

+      MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000);

+    }

+    lVar10 = DxDdGetDxgkWin32kInterface();

+    (**(code **)(lVar10 + 0x328))(&local_80);

+    local_d0 = &local_80;

+  }

+  if ((param_3 & 0x80) == 0) {

+LAB_2:

+    W32GetUserSessionState();

+    iVar7 = DrvSetDisplayConfig(param_1,param_2,param_3,uVar14 | 0x140);

+    if ((param_3 & 0x80) != 0) {

+      if (iVar7 < 0) {

+        xxxUserResetDisplayDevice();

+      }

+      else {

+        if ((uVar14 >> 9 & 1) != 0) {

+          lVar10 = W32GetSessionState();

+          uVar2 = *(undefined2 *)(*(longlong *)(lVar10 + 0x58) + 0x438);

+          lVar10 = W32GetUserSessionState();

+          *(undefined2 *)(*(longlong *)(lVar10 + 0x4e30) + 0x1b56) = uVar2;

+          lVar10 = W32GetUserSessionState();

+          psVar1 = (short *)(*(longlong *)(lVar10 + 0x4e30) + 0x1b66);

+          *psVar1 = *psVar1 + 1;

+          lVar10 = W32GetUserSessionState();

+          for (lVar10 = *(longlong *)(lVar10 + 0x8ea8); lVar10 != 0;

+              lVar10 = *(longlong *)(lVar10 + 0x180)) {

+            lVar9 = W32GetUserSessionState();

+            *(undefined2 *)(lVar10 + 0x110) =

+                 *(undefined2 *)(*(longlong *)(lVar9 + 0x4e30) + 0x1b56);

+          }

+          Feature_FixWin32kStateAfterSessionDpiUpdate__private_IsEnabledDeviceUsageNoInline();

+        }

+        TrackFullscreenMode(0);

+        lVar10 = W32GetUserSessionState();

+        *(undefined8 *)(*(longlong *)(lVar10 + 0xdf10) + 0x10) = 0;

+        GreIncrementDisplaySettingsUniqueness();

+        PowerDimUndimResend();

+        local_b0[0] = (param_3 >> 0x18 & 8 | uVar14 & 0x10) >> 3 | -(uint)(uVar6 != 0) & 4;

+        iVar7 = xxxResetDisplayDevice(param_5,local_b0,local_d0);

+        if (iVar7 < 0) {

+          local_e4 = 0x24;

+        }

+      }

+      if ((param_5 != 0) && ((*(uint *)(**(longlong **)(param_5 + 8) + 0x40) & 1) == 0)) {

+        xxxInternalInvalidate((*(longlong **)(param_5 + 8))[3]);

+      }

+      SetPointer(1);

+      zzzUpdateCursorImage();

+    }

+LAB_3:

+    if (!bVar4) goto LAB_1;

+LAB_4:

+    uVar13 = ReferenceDwmApiPort();

+    DwmAsyncNotifyRotationModeChange(uVar13,0);

+  }

+  else {

+    lVar10 = W32GetUserSessionState();

+    if (*(int *)(lVar10 + 0xa994) == 0) {

+      lVar10 = W32GetUserSessionState();

+      iVar7 = DrvQueryMDEVPowerState(*(undefined8 *)(*(longlong *)(lVar10 + 0xdf10) + 0x10));

+      if (iVar7 != 0) {

+        if (((param_3 & 0x20010000) != 0x20010000) || (param_1 != 1)) {

+LAB_5:

+          iVar7 = PreAllocateForPrimaryMonitorChange();

+          if (iVar7 != 0) {

+            SetPointer(0);

+            FreeAllSpbs();

+            lVar10 = W32GetUserSessionState();

+            if (*(longlong *)(lVar10 + 0xa880) != 0) {

+              StopFade();

+            }

+            lVar10 = W32GetUserSessionState();

+            bSetDevDragRect(*(undefined8 *)(*(longlong *)(lVar10 + 0xdf10) + 0x30));

+            goto LAB_2;

+          }

+          iVar7 = -0x3fffffff;

+          local_e4 = 0x35;

+          goto LAB_3;

+        }

+        lVar10 = W32GetWin32kBaseApiSetTable();

+        pcVar3 = *(code **)(*(longlong *)(lVar10 + 0x30) + 0xe80);

+        if ((pcVar3 == (code *)0x0) || (iVar7 = (*pcVar3)(), iVar7 == 0)) goto LAB_5;

+        lVar10 = W32GetWin32kBaseApiSetTable();

+        pcVar3 = *(code **)(*(longlong *)(lVar10 + 0x30) + 0x1080);

+        if ((pcVar3 == (code *)0x0) || (iVar7 = (*pcVar3)(), iVar7 < 0)) goto LAB_5;

+        uVar13 = ReferenceDwmApiPort();

+        DwmAsyncNotifyRotationModeChange(uVar13,1);

+        uVar13 = UserReferenceDwmApiPort();

+        ReleaseUserCriticalSection();

+        lVar10 = W32GetWin32kBaseApiSetTable();

+        pcVar3 = *(code **)(*(longlong *)(lVar10 + 0x30) + 0x1068);

+        if (pcVar3 != (code *)0x0) {

+          (*pcVar3)(uVar13,0);

+        }

+        lVar10 = W32GetUserSessionState();

+        lVar9 = UserCritInternal::`anonymous_namespace'::EnterCritInternal

+                          (lVar10,1,0,

+                           <lambda_63b61c2369133a205197eda5bd671ee7>::<lambda_invoker_cdecl>);

+        *(longlong *)(lVar10 + 0x10) = lVar9;

+        if ((lVar9 != 0) &&

+           (cVar5 = UserCritInternal::`anonymous_namespace'::IsValidGuiContext(lVar9), cVar5 != '\0'

+           )) {

+          DestroySharedUserCritDeferredUnlockList(lVar10 + 0x4d78);

+          DestroyDeferredUnlockObjectAssignmentList(lVar10 + 0x4db0);

+          DestroyDeferredUnlockObjectAssignmentList(lVar10 + 0x4da0);

+        }

+        bVar4 = true;

+        lVar10 = W32GetUserSessionState();

+        if (*(int *)(lVar10 + 0xa994) == 0) {

+          lVar10 = W32GetUserSessionState();

+          iVar7 = DrvQueryMDEVPowerState(*(undefined8 *)(*(longlong *)(lVar10 + 0xdf10) + 0x10));

+          if (iVar7 != 0) goto LAB_5;

+          local_e4 = 0x1c;

+        }

+        else {

+          local_e4 = 0x1b;

+        }

+        iVar7 = -0x3fffffff;

+        goto LAB_4;

+      }

+      local_e4 = 0x1c;

+    }

+    else {

+      local_e4 = 0x1b;

+    }

+    iVar7 = -0x3fffffff;

+  }

+LAB_1:

+  if (local_98 != 0) {

+    *(bool *)local_98 = local_e4 - 0x1bU < 2;

+  }

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

+    *local_90 = 0;

+  }

+  if ((-1 < iVar7) && (local_e4 == 0x1d)) {

+    iVar7 = -0x3ffffdd2;

+  }

+  LogDiagSDC(param_1,param_2,param_3,iVar7);

+  return iVar7;

 }
```

## `RecalculateQueueInfo`  (modified)

```diff
--- RecalculateQueueInfo
+++ RecalculateQueueInfo
@@ -1,233 +1,40 @@
 

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

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

-

-int RecalculateQueueInfo(void)

+void RecalculateQueueInfo(void)

 

 {

-  short *psVar1;

-  undefined2 uVar2;

-  code *pcVar3;

-  char cVar4;

-  int iVar5;

-  longlong in_RAX;

-  longlong lVar6;

-  undefined8 uVar7;

-  longlong lVar8;

-  int iVar9;

-  undefined4 uVar10;

-  uint unaff_EBX;

-  longlong unaff_RBP;

-  longlong unaff_RSI;

-  int unaff_R12D;

-  uint unaff_R14D;

-  uint uVar11;

-  bool bVar12;

+  int iVar1;

+  uint uVar2;

+  tagTHREADINFO *ptVar3;

+  undefined8 *puVar4;

+  undefined8 *puVar5;

   

-  (**(code **)(in_RAX + 0x328))();

-  *(longlong *)(unaff_RBP + -0x68) = unaff_RBP + -0x18;

-  uVar11 = unaff_EBX & 0x80;

-  if (uVar11 == 0) {

-LAB_0:

-    W32GetUserSessionState();

-    uVar7 = 0;

-    if (unaff_RSI != 0) {

-      uVar7 = *(undefined8 *)**(undefined8 **)(unaff_RSI + 8);

+                    /* 0x15b250  2169  RecalculateQueueInfo */

+  iVar1 = Feature_RecalculateQueueInfoUpdate__private_IsEnabledDeviceUsageNoInline();

+  if (iVar1 == 0) {

+    ptVar3 = PtiCurrent();

+    puVar4 = (undefined8 *)(*(longlong *)(ptVar3 + 0x1f0) + 0xb0);

+    for (puVar5 = (undefined8 *)*puVar4; puVar5 != puVar4; puVar5 = (undefined8 *)*puVar5) {

+      tagQ::PrepareForRecalc((tagQ *)puVar5[-0x26]);

+      *(uint *)(puVar5[-0x26] + 0x214) = *(uint *)(puVar5[-0x26] + 0x214) & 0xfdffffff;

     }

-    iVar5 = DrvSetDisplayConfig(*(undefined4 *)(unaff_RBP + -0x74),

-                                *(undefined8 *)(unaff_RBP + -0x50),unaff_EBX,unaff_R14D | 0x140,

-                                uVar7);

-    if (uVar11 == 0) {

-      iVar9 = *(int *)(unaff_RBP + -0x7c);

+    for (puVar5 = (undefined8 *)*puVar4; puVar5 != puVar4; puVar5 = (undefined8 *)*puVar5) {

+      LOCK();

+      uVar2 = *(uint *)(puVar5 + -0x1f);

+      if (uVar2 == 0) {

+        *(uint *)(puVar5 + -0x1f) = 0;

+        uVar2 = 0;

+      }

+      UNLOCK();

+      if (((uVar2 & 1) == 0) &&

+         (tagQ::RecalcUIPI((tagQ *)puVar5[-0x26],(tagTHREADINFO *)(puVar5 + -0x61),0),

+         (*(uint *)(puVar5 + 0x49) >> 0x12 & 1) != 0)) {

+        *(uint *)(puVar5[-0x26] + 0x214) = *(uint *)(puVar5[-0x26] + 0x214) | 0x2000000;

+      }

     }

-    else {

-      uVar7 = 0;

-      cVar4 = '\0';

-      iVar9 = iVar5;

-      if (iVar5 < 0) {

-        if (((*(char *)(unaff_RBP + -0x78) != '\0') && (unaff_R12D == 0)) &&

-           (*(longlong *)(unaff_RBP + -0x40) == 0)) {

-          W32GetUserSessionState();

-          if (unaff_RSI != 0) {

-            uVar7 = *(undefined8 *)**(undefined8 **)(unaff_RSI + 8);

-          }

-          iVar9 = DrvSetDisplayConfig(0,0,0x98f,0x102,uVar7);

-          if (-1 < iVar9) goto LAB_1;

-        }

-        xxxUserResetDisplayDevice();

-      }

-      else {

-LAB_1:

-        if ((unaff_R14D >> 9 & 1) != 0) {

-          lVar6 = W32GetSessionState();

-          uVar2 = *(undefined2 *)(*(longlong *)(lVar6 + 0x58) + 0x438);

-          lVar6 = W32GetUserSessionState();

-          *(undefined2 *)(*(longlong *)(lVar6 + 0x4e30) + 0x1b56) = uVar2;

-          lVar6 = W32GetUserSessionState();

-          psVar1 = (short *)(*(longlong *)(lVar6 + 0x4e30) + 0x1b66);

-          *psVar1 = *psVar1 + 1;

-          lVar6 = W32GetUserSessionState();

-          for (lVar6 = *(longlong *)(lVar6 + 0x8ea8); lVar6 != 0;

-              lVar6 = *(longlong *)(lVar6 + 0x180)) {

-            lVar8 = W32GetUserSessionState();

-            *(undefined2 *)(lVar6 + 0x110) = *(undefined2 *)(*(longlong *)(lVar8 + 0x4e30) + 0x1b56)

-            ;

-          }

-          iVar5 = Feature_FixWin32kStateAfterSessionDpiUpdate__private_IsEnabledDeviceUsageNoInline

-                            ();

-          if ((iVar5 != 0) && (*(char *)(unaff_RBP + -0x80) != '\0')) {

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

-               (((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x2000) != 0 &&

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

-              cVar4 = '\x01';

-            }

-            bVar12 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-            if ((cVar4 != '\0') || (bVar12)) {

-              lVar6 = W32GetUserSessionState();

-              WPP_RECORDER_AND_TRACE_SF_

-                        (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar4,bVar12,

-                         *(undefined8 *)(lVar6 + 0x10f88),4);

-            }

-            *(undefined1 *)(unaff_RBP + -0x80) = 0;

-            lVar6 = W32GetUserSessionState();

-            *(undefined8 *)(unaff_RBP + -0x58) =

-                 *(undefined8 *)(*(longlong *)(lVar6 + 0xdf10) + 0x10);

-          }

-          unaff_EBX = *(uint *)(unaff_RBP + -0x70);

-        }

-        TrackFullscreenMode(0);

-        if (*(char *)(unaff_RBP + -0x80) == '\0') {

-          uVar7 = *(undefined8 *)(unaff_RBP + -0x58);

-          lVar6 = W32GetUserSessionState();

-          *(undefined8 *)(*(longlong *)(lVar6 + 0xdf10) + 0x10) = uVar7;

-          GreIncrementDisplaySettingsUniqueness();

-          PowerDimUndimResend();

-          unaff_EBX = *(uint *)(unaff_RBP + -0x70);

-          *(uint *)(unaff_RBP + -0x48) =

-               (unaff_EBX >> 0x18 & 8 | unaff_R14D & 0x10) >> 3 |

-               (*(byte *)(unaff_RBP + -0x77) & 1) << 3 | -(uint)(unaff_R12D != 0) & 4;

-          iVar5 = xxxResetDisplayDevice();

-          if (iVar5 < 0) {

-            *(undefined4 *)(unaff_RBP + -0x7c) = 0x24;

-          }

-        }

-        else {

-          iVar5 = iVar9;

-          if ((unaff_R14D & 4) == 0) {

-            iVar9 = SafeDisableMDEV(1);

-            if (iVar9 != 0) {

-              SafeEnableMDEV(1);

-            }

-            xxxUserResetDisplayDevice();

-          }

-        }

-      }

-      if ((unaff_RSI != 0) && ((*(uint *)(**(longlong **)(unaff_RSI + 8) + 0x40) & 1) == 0)) {

-        xxxInternalInvalidate((*(longlong **)(unaff_RSI + 8))[3]);

-      }

-      SetPointer(1);

-      zzzUpdateCursorImage();

-      iVar9 = *(int *)(unaff_RBP + -0x7c);

-    }

-LAB_2:

-    if (*(char *)(unaff_RBP + -0x76) == '\0') goto LAB_3;

-LAB_4:

-    uVar7 = ReferenceDwmApiPort();

-    DwmAsyncNotifyRotationModeChange(uVar7,0);

-    iVar9 = *(int *)(unaff_RBP + -0x7c);

-    unaff_EBX = *(uint *)(unaff_RBP + -0x70);

   }

   else {

-    lVar6 = W32GetUserSessionState();

-    if (*(int *)(lVar6 + 0xa994) == 0) {

-      lVar6 = W32GetUserSessionState();

-      iVar5 = DrvQueryMDEVPowerState(*(undefined8 *)(*(longlong *)(lVar6 + 0xdf10) + 0x10));

-      if (iVar5 != 0) {

-        if (((unaff_EBX & 0x20010000) != 0x20010000) || (*(int *)(unaff_RBP + -0x74) != 1)) {

-LAB_5:

-          iVar5 = PreAllocateForPrimaryMonitorChange();

-          if (iVar5 != 0) {

-            SetPointer(0);

-            FreeAllSpbs();

-            lVar6 = W32GetUserSessionState();

-            if (*(longlong *)(lVar6 + 0xa880) != 0) {

-              StopFade();

-            }

-            lVar6 = W32GetUserSessionState();

-            bSetDevDragRect(*(undefined8 *)(*(longlong *)(lVar6 + 0xdf10) + 0x30));

-            goto LAB_0;

-          }

-          iVar9 = 0x35;

-          iVar5 = -0x3fffffff;

-          *(undefined4 *)(unaff_RBP + -0x7c) = 0x35;

-          goto LAB_2;

-        }

-        lVar6 = W32GetWin32kBaseApiSetTable();

-        pcVar3 = *(code **)(*(longlong *)(lVar6 + 0x30) + 0xe80);

-        if ((pcVar3 == (code *)0x0) || (iVar5 = (*pcVar3)(), iVar5 == 0)) goto LAB_5;

-        lVar6 = W32GetWin32kBaseApiSetTable();

-        pcVar3 = *(code **)(*(longlong *)(lVar6 + 0x30) + 0x1080);

-        if ((pcVar3 == (code *)0x0) || (iVar5 = (*pcVar3)(), iVar5 < 0)) goto LAB_5;

-        uVar7 = ReferenceDwmApiPort();

-        DwmAsyncNotifyRotationModeChange(uVar7,1);

-        uVar7 = UserReferenceDwmApiPort();

-        ReleaseUserCriticalSection();

-        lVar6 = W32GetWin32kBaseApiSetTable();

-        pcVar3 = *(code **)(*(longlong *)(lVar6 + 0x30) + 0x1068);

-        if (pcVar3 != (code *)0x0) {

-          (*pcVar3)(uVar7,0);

-        }

-        lVar6 = W32GetUserSessionState();

-        lVar8 = UserCritInternal::`anonymous_namespace'::EnterCritInternal

-                          (lVar6,1,0,

-                           <lambda_63b61c2369133a205197eda5bd671ee7>::<lambda_invoker_cdecl>);

-        *(longlong *)(lVar6 + 0x10) = lVar8;

-        if ((lVar8 != 0) &&

-           (cVar4 = UserCritInternal::`anonymous_namespace'::IsValidGuiContext(lVar8), cVar4 != '\0'

-           )) {

-          DestroySharedUserCritDeferredUnlockList(lVar6 + 0x4d78);

-          DestroyDeferredUnlockObjectAssignmentList(lVar6 + 0x4db0);

-          DestroyDeferredUnlockObjectAssignmentList(lVar6 + 0x4da0);

-        }

-        *(undefined1 *)(unaff_RBP + -0x76) = 1;

-        lVar6 = W32GetUserSessionState();

-        if (*(int *)(lVar6 + 0xa994) == 0) {

-          lVar6 = W32GetUserSessionState();

-          iVar5 = DrvQueryMDEVPowerState(*(undefined8 *)(*(longlong *)(lVar6 + 0xdf10) + 0x10));

-          if (iVar5 != 0) {

-            unaff_EBX = *(uint *)(unaff_RBP + -0x70);

-            goto LAB_5;

-          }

-          uVar10 = 0x1c;

-        }

-        else {

-          uVar10 = 0x1b;

-        }

-        *(undefined4 *)(unaff_RBP + -0x7c) = uVar10;

-        iVar5 = -0x3fffffff;

-        goto LAB_4;

-      }

-      iVar9 = 0x1c;

-    }

-    else {

-      iVar9 = 0x1b;

-    }

-    *(int *)(unaff_RBP + -0x7c) = iVar9;

-    iVar5 = -0x3fffffff;

+    RecalculateQueueInfo2();

   }

-LAB_3:

-  uVar10 = *(undefined4 *)(unaff_RBP + -0x74);

-  if (*(longlong *)(unaff_RBP + -0x30) != 0) {

-    *(bool *)*(longlong *)(unaff_RBP + -0x30) = iVar9 == 0x1b || iVar9 == 0x1c;

-  }

-  if (*(undefined1 **)(unaff_RBP + -0x28) != (undefined1 *)0x0) {

-    **(undefined1 **)(unaff_RBP + -0x28) = *(undefined1 *)(unaff_RBP + -0x80);

-  }

-  if ((-1 < iVar5) && (iVar9 == 0x1d)) {

-    iVar5 = -0x3ffffdd2;

-  }

-  LogDiagSDC(uVar10,*(undefined8 *)(unaff_RBP + -0x50),unaff_EBX,iVar5,

-             *(undefined4 *)(unaff_RBP + -0x60));

-  return iVar5;

+  return;

 }
```

## `EtwTraceUIPIHookError`  (modified)

```diff
--- EtwTraceUIPIHookError
+++ EtwTraceUIPIHookError
@@ -1,289 +1,48 @@
 

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

 

-ulonglong EtwTraceUIPIHookError(undefined8 param_1,undefined8 param_2,undefined8 param_3)

+void EtwTraceUIPIHookError

+               (undefined8 param_1,undefined8 param_2,tagTHREADINFO *param_3,tagTHREADINFO *param_4)

 

 {

-  uint *puVar1;

-  uint uVar2;

+  longlong lVar1;

+  char cVar2;

   bool bVar3;

-  int iVar4;

-  int iVar5;

-  longlong lVar6;

-  CPointerInfoNode *pCVar7;

-  CInputDest *pCVar8;

-  char *this;

-  char cVar9;

-  char cVar10;

-  CTouchProcessor *unaff_RBX;

-  longlong unaff_RBP;

-  char cVar11;

-  char cVar14;

-  short sVar15;

-  CPointerInfoNode *unaff_RDI;

-  CPointerInputFramePhase CVar16;

-  CPointerInputFrame *unaff_R13;

-  CPointerInfoNode *unaff_R14;

-  CPointerInfoNode *unaff_R15;

-  bool bStack0000000000000064;

-  longlong in_stack_00000068;

-  HandleValidationType HVar12;

-  CPointerInfoNode *pCVar13;

+  undefined1 auStackY_b8 [32];

+  undefined8 local_58;

+  undefined8 uStack_50;

+  undefined8 local_48;

+  undefined8 uStack_40;

+  undefined4 local_38;

+  ulonglong local_30;

   

-  *(char *)(unaff_RBP + -0x20) = (char)((ulonglong)unaff_RBX >> 8);

-  iVar5 = (int)unaff_RDI;

-  HVar12 = iVar5 + 1;

-  pCVar13 = (CPointerInfoNode *)(ulonglong)HVar12;

-  cVar11 = (char)HVar12;

-  cVar14 = (char)unaff_RDI;

+                    /* 0xc21f0  1402  EtwTraceUIPIHookError */

+  local_30 = __security_cookie ^ (ulonglong)auStackY_b8;

+  local_58 = 0;

+  uStack_50 = 0;

+  local_48 = 0;

+  uStack_40 = 0;

+  local_38 = 0;

+  EtwpSetTraceHeader((_tagW32KUIPI_Msg_Template_UIPI_Trace_Header *)&local_58,2,param_3,

+                     (tagPROCESSINFO *)0x0,param_4,(tagPROCESSINFO *)0x0);

+  if ((Microsoft_Windows_Win32kEnableBits & 4) != 0) {

+    McTemplateK0ndcdxx_EtwWriteTransfer();

+  }

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

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

-     (cVar10 = cVar11, (byte)WPP_GLOBAL_Control[0x29] < 5)) {

-    cVar10 = cVar14;

-  }

-  sVar15 = (short)unaff_RDI;

-  if ((undefined **)WPP_RECORDER_INITIALIZED == &WPP_RECORDER_INITIALIZED) {

-LAB_0:

-    CVar16 = (CPointerInputFramePhase)CONCAT71((int7)((ulonglong)param_3 >> 8),cVar14);

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x2000) == 0)) ||

+     ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

+    cVar2 = '\0';

   }

   else {

-    param_3 = CONCAT71((int7)((ulonglong)param_3 >> 8),cVar11);

-    CVar16 = (CPointerInputFramePhase)param_3;

-    if (*(short *)(WPP_GLOBAL_Control + 0x48) == sVar15) goto LAB_0;

+    cVar2 = '\x01';

   }

-  if ((cVar10 != '\0') || ((char)CVar16 != '\0')) {

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

+  bVar3 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+  if ((cVar2 != '\0') || (bVar3)) {

+    lVar1 = W32GetUserSessionState();

+    WPP_RECORDER_AND_TRACE_SF_qDqq

+              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,bVar3,

+               *(undefined8 *)(lVar1 + 0x10f88));

   }

-  bVar3 = CEResourceLock::Locked((CEResourceLock *)(unaff_RBX + 0x20));

-  if (!bVar3) {

-    CVar16 = 0x198e;

-    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000);

-  }

-  this = (char *)unaff_R15;

-  iVar4 = CPointerInfoNode::IsValid(unaff_R15);

-  if (iVar4 == 0) {

-    this = "IXPTelAssert";

-    CVar16 = 0x198f;

-    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000);

-  }

-  if (((*(uint *)unaff_R15 >> 10 & 1) == 0) && ((*(uint *)unaff_R15 & 4) != 0)) {

-    this = "IXPTelAssert";

-    CVar16 = 0x1990;

-    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000);

-  }

-  if ((((*(uint *)unaff_R15 & 0x400) == 0) && (*(int *)(unaff_R15 + 0x18) == iVar5)) &&

-     (*(int *)(unaff_R15 + 0x160) != iVar5)) {

-    this = "IXPTelAssert";

-    CVar16 = 0x1991;

-    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000);

-  }

-  cVar10 = cVar11;

-  if (unaff_R13 == (CPointerInputFrame *)0x0) {

-    iVar5 = CPointerInfoNode::IsForManipulationThread(unaff_R15);

-    if (iVar5 == 0) {

-      MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0x1998);

-    }

-    iVar5 = CPointerInfoNode::IsForManipulationThread(unaff_R15);

-    if (iVar5 != 0) goto LAB_1;

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

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

-       (cVar9 = cVar11, (byte)WPP_GLOBAL_Control[0x29] < 4)) {

-      cVar9 = cVar14;

-    }

-    bVar3 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-    if ((cVar9 != '\0') || (bVar3)) {

-      lVar6 = W32GetUserSessionState();

-      WPP_RECORDER_AND_TRACE_SF_

-                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar9,bVar3,

-                 *(undefined8 *)(lVar6 + 0x10f88),4);

-    }

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

-        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x29] < 5))

-    {

-      cVar10 = cVar14;

-    }

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

-       (*(short *)(WPP_GLOBAL_Control + 0x48) == sVar15)) {

-      cVar11 = cVar14;

-    }

-  }

-  else {

-    iVar5 = CTouchProcessor::IsFrameReferenced((CTouchProcessor *)this,unaff_R13,CVar16);

-    if (iVar5 == 0) {

-      MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0x19a2);

-    }

-    pCVar7 = CTouchProcessor::FindValidNodeInFrame

-                       (unaff_RBX,unaff_R13,*(ushort *)(unaff_R15 + 0xac),(ulong *)0x0);

-    if (pCVar7 == (CPointerInfoNode *)0x0) {

-      iVar5 = CPointerInfoNode::IsForManipulationThread(unaff_R15);

-      unaff_R14 = pCVar7;

-      if (iVar5 == 0) {

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

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

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

-          pCVar13 = unaff_RDI;

-        }

-        bVar3 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-        if (((char)pCVar13 != '\0') || (bVar3)) {

-          lVar6 = W32GetUserSessionState();

-          WPP_RECORDER_AND_TRACE_SF_d

-                    (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),(ulonglong)pCVar13 & 0xff,bVar3,

-                     *(undefined8 *)(lVar6 + 0x10f88),4);

-        }

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

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

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

-          cVar10 = cVar14;

-        }

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

-           (*(short *)(WPP_GLOBAL_Control + 0x48) == sVar15)) {

-          cVar11 = cVar14;

-        }

-        goto joined_r0x0001400da6dd;

-      }

-    }

-    else {

-      uVar2 = *(uint *)pCVar7;

-      unaff_R14 = unaff_RDI;

-      if (-1 < (char)uVar2) {

-        if (((uVar2 & 4) == 0) && ((uVar2 >> 10 & 1) == 0)) {

-          CInputDest::operator=((CInputDest *)&stack0x00000070,(CInputDest *)(pCVar7 + 0x18));

-          unaff_R14 = pCVar7;

-        }

-        else {

-          pCVar8 = (CInputDest *)

-                   CInputDest::CInputDest

-                             ((CInputDest *)(unaff_RBP + 0x70),*(HWND__ **)(pCVar7 + 0xc0),

-                              *(INPUT_DESTINATION_WINDOW_TYPE *)(pCVar7 + 0x1bc),HVar12);

-          CInputDest::operator=((CInputDest *)&stack0x00000070,pCVar8);

-          CInputDest::~CInputDest((CInputDest *)(unaff_RBP + 0x70));

-          unaff_R14 = pCVar7;

-        }

-      }

-    }

-LAB_1:

-    if ((*(uint *)unaff_R15 & 0x400) == 0) {

-      CInputDest::operator=((CInputDest *)(unaff_RBP + -0x10),(CInputDest *)(unaff_R15 + 0x18));

-    }

-    else {

-      pCVar8 = (CInputDest *)

-               CInputDest::CInputDest

-                         ((CInputDest *)(unaff_RBP + 0x70),*(HWND__ **)(unaff_R15 + 0xc0),

-                          *(INPUT_DESTINATION_WINDOW_TYPE *)(unaff_R15 + 0x1bc),HVar12);

-      CInputDest::operator=((CInputDest *)(unaff_RBP + -0x10),pCVar8);

-      CInputDest::~CInputDest((CInputDest *)(unaff_RBP + 0x70));

-    }

-    bVar3 = CInputDest::operator==

-                      ((CInputDest *)&stack0x00000070,(tagINPUTDEST *)(unaff_RBP + -0x10));

-    if (!bVar3) {

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

-          ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x29] < 4)

-         ) {

-        cVar10 = cVar14;

-      }

-      bVar3 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-      if ((cVar10 != '\0') || (bVar3)) {

-        lVar6 = W32GetUserSessionState();

-        WPP_RECORDER_AND_TRACE_SF_

-                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar10,bVar3,

-                   *(undefined8 *)(lVar6 + 0x10f88),4);

-      }

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

-         (((uVar2 = *(uint *)(unaff_R15 + 0xb4), (uVar2 & 4) == 0 && ((uVar2 >> 0x12 & 1) == 0)) ||

-          ((uVar2 >> 0x10 & 1) != 0)))) {

-        *(uint *)unaff_R15 = *(uint *)unaff_R15 | 8;

-        if (unaff_R14 != (CPointerInfoNode *)0x0) {

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

-        }

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

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

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

-          pCVar13 = unaff_RDI;

-        }

-        cVar10 = (char)pCVar13;

-        bStack0000000000000064 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED

-        ;

-        if ((cVar10 != '\0') || (bStack0000000000000064)) {

-          lVar6 = W32GetUserSessionState();

-          goto LAB_2;

-        }

-      }

-      else {

-        *(uint *)unaff_R15 = *(uint *)unaff_R15 | 0x40;

-        if (unaff_R14 != (CPointerInfoNode *)0x0) {

-          *(uint *)unaff_R14 = *(uint *)unaff_R14 | 0x20;

-        }

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

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

-           (cVar10 = cVar11, (byte)WPP_GLOBAL_Control[0x29] < 4)) {

-          cVar10 = cVar14;

-        }

-        bStack0000000000000064 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED

-        ;

-        if ((cVar10 != '\0') || (bStack0000000000000064)) {

-          lVar6 = W32GetUserSessionState();

-LAB_2:

-          WPP_RECORDER_AND_TRACE_SF_qdqd

-                    (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar10,bStack0000000000000064,

-                     *(undefined8 *)(lVar6 + 0x10f88));

-        }

-      }

-      if (unaff_R14 != (CPointerInfoNode *)0x0) {

-        if (*(uint *)(in_stack_00000068 + 0x30) <= *(uint *)(unaff_R14 + 8)) {

-          MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0x1a24);

-        }

-        puVar1 = (uint *)((ulonglong)*(uint *)(unaff_R14 + 8) * 0xa0 + 0x8c +

-                         *(longlong *)(in_stack_00000068 + 0xf8));

-        *puVar1 = *puVar1 & 0xfffffffe;

-      }

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

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

-         (cVar10 = cVar11, (byte)WPP_GLOBAL_Control[0x29] < 5)) {

-        cVar10 = cVar14;

-      }

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

-         (*(short *)(WPP_GLOBAL_Control + 0x48) == sVar15)) {

-        cVar11 = cVar14;

-      }

-      if ((cVar10 != '\0') || (cVar11 != '\0')) {

-        WPP_RECORDER_AND_TRACE_SF_

-                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar10,cVar11,

-                   *(undefined8 *)(WPP_GLOBAL_Control + 0x40),5);

-      }

-      unaff_RDI = (CPointerInfoNode *)(ulonglong)HVar12;

-      goto LAB_3;

-    }

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

-        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x29] < 4))

-    {

-      pCVar13 = unaff_RDI;

-    }

-    bVar3 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-    if (((char)pCVar13 != '\0') || (bVar3)) {

-      lVar6 = W32GetUserSessionState();

-      WPP_RECORDER_AND_TRACE_SF_

-                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),(ulonglong)pCVar13 & 0xff,bVar3,

-                 *(undefined8 *)(lVar6 + 0x10f88),4);

-    }

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

-        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x29] < 5))

-    {

-      cVar10 = cVar14;

-    }

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

-       (*(short *)(WPP_GLOBAL_Control + 0x48) == sVar15)) {

-      cVar11 = cVar14;

-    }

-  }

-joined_r0x0001400da6dd:

-  if ((cVar10 != '\0') || (cVar11 != '\0')) {

-    WPP_RECORDER_AND_TRACE_SF_

-              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar10,cVar11,

-               *(undefined8 *)(WPP_GLOBAL_Control + 0x40),5);

-  }

-LAB_3:

-  CInputDest::~CInputDest((CInputDest *)&stack0x00000070);

-  CInputDest::~CInputDest((CInputDest *)(unaff_RBP + -0x10));

-  return (ulonglong)unaff_RDI & 0xffffffff;

+  return;

 }
```

## `NtUserSetKeyboardState`  (modified)

```diff
--- NtUserSetKeyboardState
+++ NtUserSetKeyboardState
@@ -1,12 +1,42 @@
 

-void NtUserSetKeyboardState(void)

+longlong NtUserSetKeyboardState(LPBYTE param_1)

 

 {

-  undefined4 in_stack_00000028;

-  undefined4 uStack0000000000000038;

+  tagUIPI_INFO *ptVar1;

+  bool bVar2;

+  BOOL BVar3;

+  longlong lVar4;

+  longlong lVar5;

+  tagTHREADINFO *ptVar6;

+  undefined8 local_18;

+  undefined4 local_10;

   

-  uStack0000000000000038 = in_stack_00000028;

-  func_0x00014013fbd0(&stack0x00000030);

-  return;

+                    /* 0x16c090  2034  NtUserSetKeyboardState */

+  lVar4 = W32GetUserSessionState();

+  lVar5 = UserCritInternal::`anonymous_namespace'::EnterCritInternal

+                    (lVar4,0,0,<lambda_63b61c2369133a205197eda5bd671ee7>::<lambda_invoker_cdecl>);

+  *(longlong *)(lVar4 + 0x10) = lVar5;

+  BVar3 = 0;

+  if (lVar5 != 0) {

+    DestroySharedUserCritDeferredUnlockList(lVar4 + 0x4d78);

+    DestroyDeferredUnlockObjectAssignmentList(lVar4 + 0x4db0);

+    DestroyDeferredUnlockObjectAssignmentList(lVar4 + 0x4da0);

+  }

+  ptVar6 = PtiCurrent();

+  ptVar1 = *(tagUIPI_INFO **)(ptVar6 + 0x1d8);

+  bVar2 = UIPrivilegeIsolation::CheckAccess

+                    ((tagUIPI_INFO *)

+                     (-(ulonglong)(*(longlong *)(ptVar6 + 0x1d0) != 0) &

+                     *(longlong *)(ptVar6 + 0x1d0) + 0x130U),ptVar1,0);

+  if ((bVar2) || ((*(uint *)(ptVar1 + 0x214) & 0x2000000) != 0)) {

+    BVar3 = _SetKeyboardState(param_1);

+  }

+  else {

+    local_18 = *(undefined8 *)ptVar1;

+    local_10 = *(undefined4 *)(ptVar1 + 8);

+    EtwTraceUIPIInputError(ptVar6,0,ptVar1,&local_18,3);

+  }

+  ReleaseUserCriticalSection();

+  return (longlong)BVar3;

 }
```

## `ApiSetpSearchForSectionIndex_V7`  (modified)

```diff
--- ApiSetpSearchForSectionIndex_V7
+++ ApiSetpSearchForSectionIndex_V7
@@ -1,11 +1,55 @@
 

-void ApiSetpSearchForSectionIndex_V7(void)

+undefined2

+ApiSetpSearchForSectionIndex_V7

+          (longlong param_1,longlong param_2,undefined8 param_3,undefined1 param_4)

 

 {

-  code *pcVar1;

+  byte bVar1;

+  byte bVar2;

+  char cVar3;

+  uint uVar4;

+  uint uVar5;

+  ulonglong uVar6;

+  undefined7 uVar7;

+  char cVar8;

+  ulonglong uVar9;

+  undefined7 uVar10;

+  byte bVar11;

+  undefined2 local_res10 [4];

   

-  pcVar1 = (code *)swi(3);

-  (*pcVar1)();

-  return;

+  uVar9 = CONCAT71((int7)((ulonglong)param_3 >> 8),*(byte *)(param_1 + 2)) & 0xffffffffffffff10;

+  bVar1 = *(byte *)(param_1 + 2) & 8;

+  uVar6 = CONCAT71((int7)((ulonglong)param_2 >> 8),*(byte *)(param_2 + 9)) & 0xffffffffffffff02;

+  bVar11 = *(byte *)(param_2 + 9) & 4;

+  uVar10 = (undefined7)(uVar9 >> 8);

+  uVar7 = (undefined7)(uVar6 >> 8);

+  cVar8 = (char)uVar9;

+  cVar3 = (char)uVar6;

+  if (bVar11 == 0) {

+    uVar4 = ApiSetpGetSearchKeyHash

+                      (param_3,CONCAT71(uVar7,cVar3 != '\0'),CONCAT71(uVar10,bVar1 != 0),

+                       cVar8 != '\0',*(undefined1 *)(param_2 + 10));

+  }

+  else {

+    bVar2 = ApiSetpGetSearchKeyHash

+                      (param_3,CONCAT71(uVar7,cVar3 != '\0'),CONCAT71(uVar10,bVar1 != 0),

+                       cVar8 != '\0',*(undefined1 *)(param_2 + 10));

+    uVar4 = (uint)bVar2;

+  }

+  if (bVar11 == 0) {

+    uVar5 = ApiSetpGetSearchKeyHash

+                      (param_3,param_4,bVar1 != 0,cVar8 != '\0',*(undefined1 *)(param_2 + 0xb));

+  }

+  else {

+    bVar1 = ApiSetpGetSearchKeyHash

+                      (param_3,param_4,bVar1 != 0,cVar8 != '\0',*(undefined1 *)(param_2 + 0xb));

+    uVar5 = (uint)bVar1;

+  }

+  local_res10[0] = 0;

+  cVar3 = ApiSetpFindHashtableIndexAndVerify_V7(param_1,param_2,uVar4,uVar5,local_res10);

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

+    local_res10[0] = 0xffff;

+  }

+  return local_res10[0];

 }
```

## `xxxUserSetDisplayConfig`  (modified)

```diff
--- xxxUserSetDisplayConfig
+++ zzzDestroyQueue
@@ -1,300 +1,162 @@
 

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

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

-/* WARNING: Removing unreachable block (ram,0x00014015d879) */

-/* WARNING: Removing unreachable block (ram,0x00014015d88c) */

-/* WARNING: Removing unreachable block (ram,0x00014015d895) */

-/* WARNING: Removing unreachable block (ram,0x00014015d8a2) */

-/* WARNING: Removing unreachable block (ram,0x00014015d89b) */

-/* WARNING: Removing unreachable block (ram,0x00014015d8a5) */

-/* WARNING: Removing unreachable block (ram,0x00014015d8bb) */

-/* WARNING: Removing unreachable block (ram,0x00014015d8c0) */

-/* WARNING: Removing unreachable block (ram,0x00014015d908) */

-/* WARNING: Removing unreachable block (ram,0x00014015d6d7) */

-/* WARNING: Removing unreachable block (ram,0x00014015d6e0) */

-/* WARNING: Removing unreachable block (ram,0x00014015d6ea) */

-/* WARNING: Removing unreachable block (ram,0x00014015d712) */

-/* WARNING: Removing unreachable block (ram,0x00014015d706) */

-/* WARNING: Removing unreachable block (ram,0x00014015d715) */

-/* WARNING: Removing unreachable block (ram,0x00014015d93a) */

-/* WARNING: Removing unreachable block (ram,0x00014015d944) */

-/* WARNING: Removing unreachable block (ram,0x00014015d956) */

-/* WARNING: Removing unreachable block (ram,0x00014015d95e) */

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

 

-int xxxUserSetDisplayConfig

-              (uint param_1,DISPLAYCONFIG_PATH_INFO_INTERNAL *param_2,uint param_3,uint param_4,

-              longlong param_5,char param_6,longlong param_7,longlong param_8,undefined1 *param_9,

-              _DXGK_DISPLAY_SCENARIO_CONTEXT *param_10,undefined8 *param_11)

+void zzzDestroyQueue(tagQ *param_1,tagTHREADINFO *param_2)

 

 {

-  short *psVar1;

-  undefined2 uVar2;

-  code *pcVar3;

-  bool bVar4;

-  char cVar5;

-  uint uVar6;

-  int iVar7;

-  tagTHREADINFO *ptVar8;

+  code *pcVar1;

+  bool bVar2;

+  uint uVar3;

+  int iVar4;

+  longlong lVar5;

+  longlong lVar6;

+  undefined4 uVar7;

+  longlong lVar8;

   longlong lVar9;

-  longlong lVar10;

-  longlong lVar11;

-  longlong lVar12;

-  undefined8 uVar13;

-  uint uVar14;

-  undefined1 auStackY_178 [32];

-  int local_e4;

-  undefined8 *local_d0;

-  uint local_b0 [2];

-  longlong local_a8;

-  _DXGK_DISPLAY_SCENARIO_CONTEXT *local_a0;

-  longlong local_98;

-  undefined1 *local_90;

-  longlong local_88;

-  undefined8 local_80;

-  undefined8 uStack_78;

-  undefined8 local_70;

-  undefined8 uStack_68;

-  undefined8 local_60;

-  ulonglong local_58;

+  char cVar10;

   

-                    /* 0x15d080  2520  xxxUserSetDisplayConfig */

-  lVar10 = _DAT_0;

-  local_58 = __security_cookie ^ (ulonglong)auStackY_178;

-  local_a8 = param_7;

-  local_98 = param_8;

-  local_90 = param_9;

-  local_a0 = param_10;

-  local_60 = 0;

-  local_e4 = 0;

-  local_80 = 0;

-  uStack_78 = 0;

-  local_70 = 0;

-  uStack_68 = 0;

-  local_d0 = param_11;

-  bVar4 = false;

-  uVar6 = KeQueryTimeIncrement();

-  local_88 = (ulonglong)uVar6 * lVar10;

-  if ((param_5 == 0) || ((*(uint *)(param_5 + 0x30) & 8) != 0)) {

-    ptVar8 = PtiCurrent();

-    param_5 = *(longlong *)(ptVar8 + 0x1f0);

+                    /* 0x15a870  2521  zzzDestroyQueue */

+  lVar6 = 0;

+  if (param_2 != (tagTHREADINFO *)0x0) {

+    tagTHREADINFO::RemoveThreadFromQSharingLists(param_2,param_1);

   }

-  lVar9 = W32GetUserSessionState();

-  lVar10 = W32GetUserGdiSessionState();

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

-  lVar11 = PsGetCurrentProcess();

-  if (((lVar11 == lVar10) || (param_6 == '\0')) || ((param_4 & 0x10) != 0)) {

-    if (param_5 == 0) {

-      param_5 = *(longlong *)(lVar9 + 0x4b58);

+  bVar2 = tagQ::IsAnyThreadAttached(param_1);

+  if (bVar2) {

+    if (*(tagTHREADINFO **)(param_1 + 0x58) == param_2) {

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

+          ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x40000) == 0)) ||

+         (cVar10 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 4)) {

+        cVar10 = '\0';

+      }

+      bVar2 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+      if ((cVar10 != '\0') || (bVar2)) {

+        PtiCurrent();

+        lVar5 = W32GetUserSessionState();

+        WPP_RECORDER_AND_TRACE_SF_qqq

+                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar10,bVar2,

+                   *(undefined8 *)(lVar5 + 0x10f88));

+      }

+      *(undefined8 *)(param_1 + 0x58) = 0;

+    }

+    if ((param_2 != (tagTHREADINFO *)0x0) &&

+       ((*(tagTHREADINFO **)(param_1 + 0x78) == param_2 ||

+        (*(tagTHREADINFO **)(param_1 + 0x70) == param_2)))) {

+      lVar8 = lVar6;

+      lVar9 = lVar6;

+      for (lVar5 = *(longlong *)(param_1 + 0x260); lVar5 != 0; lVar5 = *(longlong *)(lVar5 + 0x6b0))

+      {

+        LOCK();

+        uVar3 = *(uint *)(lVar5 + 0x210);

+        if (uVar3 == 0) {

+          *(uint *)(lVar5 + 0x210) = 0;

+          uVar3 = 0;

+        }

+        UNLOCK();

+        if ((uVar3 & 1) == 0) {

+          if (((*(uint *)(*(longlong *)(param_2 + 0x1e8) + 8) & 6) != 0) &&

+             ((*(uint *)(*(longlong *)(lVar5 + 0x1e8) + 0x10) & 6) != 0)) {

+            lVar9 = lVar5;

+          }

+          if (((*(uint *)(*(longlong *)(param_2 + 0x1e8) + 8) & 1) != 0) &&

+             ((*(uint *)(*(longlong *)(lVar5 + 0x1e8) + 0x10) & 1) != 0)) {

+            lVar6 = lVar5;

+          }

+          lVar8 = lVar5;

+          if (((*(uint *)(*(longlong *)(param_2 + 0x1e8) + 0x10) & 0x400) != 0) &&

+             ((*(uint *)(*(longlong *)(lVar5 + 0x1e8) + 0x10) & 0x400) != 0)) {

+            lVar6 = lVar5;

+          }

+        }

+      }

+      lVar5 = lVar8;

+      if (lVar9 != 0) {

+        lVar5 = lVar9;

+      }

+      if (lVar6 != 0) {

+        lVar8 = lVar6;

+      }

+      lVar6 = W32GetWin32kBaseApiSetTable();

+      pcVar1 = *(code **)(*(longlong *)(lVar6 + 0x30) + 0x520);

+      if ((pcVar1 != (code *)0x0) && (iVar4 = (*pcVar1)(), -1 < iVar4)) {

+        if (lVar5 != 0) {

+          SetWakeBit(lVar5,*(uint *)(*(longlong *)(param_2 + 0x1e8) + 8) & 6);

+        }

+        if (lVar8 != 0) {

+          SetWakeBit(lVar8,*(uint *)(*(longlong *)(param_2 + 0x1e8) + 8) & 1);

+          SetWakeBit(lVar8,*(uint *)(*(longlong *)(param_2 + 0x1e8) + 8) & 0x400);

+        }

+      }

+      if (*(tagTHREADINFO **)(param_1 + 0x78) == param_2) {

+        *(longlong *)(param_1 + 0x78) = lVar8;

+      }

+      if (*(tagTHREADINFO **)(param_1 + 0x70) == param_2) {

+        *(longlong *)(param_1 + 0x70) = lVar5;

+        ApiSetEditionUpdateRawMouseMode(param_1);

+      }

+    }

+    RecalculateQueueInfo();

+  }

+  else {

+    lVar6 = W32GetUserSessionState();

+    if ((*(tagQ **)(lVar6 + 0x4a50) == param_1) && (*(longlong *)(param_1 + 0x88) != 0)) {

+      lVar6 = W32GetUserSessionState();

+      uVar7 = 0x33;

+      if (*(int *)(lVar6 + 0x114d8) == 0) {

+        uVar7 = 0x31;

+      }

+      xxxWindowEvent(0x80000003,*(undefined8 *)(param_1 + 0x88),0,6,uVar7);

+    }

+    lVar6 = W32GetWin32kBaseApiSetTable();

+    pcVar1 = *(code **)(*(longlong *)(lVar6 + 0x30) + 0x540);

+    if ((pcVar1 != (code *)0x0) && (iVar4 = (*pcVar1)(), -1 < iVar4)) {

+      lVar6 = W32GetWin32kBaseApiSetTable();

+      pcVar1 = *(code **)(*(longlong *)(lVar6 + 0x30) + 0x548);

+      if (pcVar1 != (code *)0x0) {

+        (*pcVar1)(param_1);

+      }

+    }

+    tagQ::UnlockFocusWnd(param_1);

+    tagQ::SetActiveWindow(param_1,(tagWND *)0x0);

+    HMAssignmentUnlock(param_1 + 0x98);

+    iVar4 = IsClearDelegationCaptureSupported();

+    if (-1 < iVar4) {

+      ClearDelegationCapture(param_1);

+    }

+    HMAssignmentUnlock(param_1 + 0x1b8);

+    LockQCursor(param_1,0);

+    iVar4 = IsFreeMessageListSupported();

+    if (-1 < iVar4) {

+      FreeMessageList(param_1 + 0x28);

+    }

+    lVar6 = W32GetUserSessionState();

+    if (*(tagQ **)(lVar6 + 0x4a50) == param_1) {

+      lVar6 = W32GetWin32kBaseApiSetTable();

+      pcVar1 = *(code **)(*(longlong *)(lVar6 + 0x30) + 0x560);

+      if (pcVar1 != (code *)0x0) {

+        (*pcVar1)();

+      }

+    }

+    lVar6 = W32GetUserSessionState();

+    if (*(tagQ **)(lVar6 + 0x4a58) == param_1) {

+      lVar6 = W32GetUserSessionState();

+      *(undefined8 *)(lVar6 + 0x4a58) = 0;

+    }

+    lVar6 = W32GetUserSessionState();

+    bVar2 = *(tagQ **)(lVar6 + 0x4b78) == param_1;

+    if (bVar2) {

+      lVar6 = W32GetUserSessionState();

+      *(undefined8 *)(lVar6 + 0x4b78) = 0;

+    }

+    if (*(int *)(param_1 + 0x218) == 0) {

+      FreeQueue(param_1);

+    }

+    else {

+      *(uint *)(param_1 + 0x214) = *(uint *)(param_1 + 0x214) | 0x4000000;

+    }

+    if (bVar2) {

+      ApiSetEditionSystemGenerateMove(2);

     }

   }

-  else {

-    lVar10 = W32GetUserSessionState();

-    if (*(int *)(lVar10 + 0xf5f8) == 0) {

-      lVar10 = *(longlong *)(lVar9 + 0x4b58);

-    }

-    else {

-      lVar10 = *(longlong *)(lVar9 + 0x4b60);

-    }

-    if (param_5 != lVar10) {

-      lVar11 = 0;

-      lVar9 = lVar11;

-      if ((lVar10 != 0) && (lVar12 = ObQueryNameInfo(lVar10), lVar12 != 0)) {

-        lVar10 = ObQueryNameInfo(lVar10);

-        lVar9 = lVar10 + 8;

-      }

-      if ((param_5 != 0) && (lVar10 = ObQueryNameInfo(param_5), lVar10 != 0)) {

-        lVar11 = ObQueryNameInfo(param_5);

-        lVar11 = lVar11 + 8;

-      }

-      LogDiagSDCAccessDenied(lVar11,lVar9);

-      iVar7 = -0x3fffffde;

-      local_e4 = 0x31;

-      goto LAB_1;

-    }

-  }

-  uVar6 = param_3 & 0x10000;

-  if ((uVar6 != 0) != (local_a8 != 0)) {

-    iVar7 = -0x3ffffff3;

-    local_e4 = 1;

-    goto LAB_1;

-  }

-  uVar14 = param_4;

-  if (uVar6 != 0) {

-    uVar14 = param_4 | 4;

-    if ((param_3 >> 0x1d & 1) != 0) {

-      uVar14 = param_4 | 0x14;

-    }

-    if ((param_3 >> 0x1c & 1) != 0) {

-      uVar14 = uVar14 | 0x200;

-    }

-  }

-  iVar7 = DrvSetDisplayConfigValidateParams(param_1,param_2,param_3,uVar14);

-  if (iVar7 < 0) {

-    local_e4 = 1;

-    goto LAB_1;

-  }

-  if ((uVar6 == 0) &&

-     (((iVar7 = UserIsConsoleConnection(), iVar7 != 0 || ((param_3 & 0x88f) != 0x88f)) &&

-      ((uVar14 & 0xc01) == 0)))) {

-    iVar7 = DispBrokerGetCurrentMode();

-    if (iVar7 == 3) {

-      iVar7 = DispBrokerSetDisplayConfig(param_1,param_2,param_3,uVar14,local_a0,param_6 != '\0');

-      if ((-1 < iVar7) || ((uVar14 >> 9 & 1) == 0)) {

-        local_e4 = 0x38;

-        goto LAB_1;

-      }

-    }

-    else {

-      iVar7 = DispBrokerGetCurrentMode();

-      if (iVar7 == 2) {

-        local_e4 = 0x37;

-        iVar7 = -0x3fffffde;

-        goto LAB_1;

-      }

-    }

-  }

-  iVar7 = UserIsConsoleConnection();

-  if ((iVar7 != 0) && (uVar6 != 0)) {

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

-      MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000);

-    }

-    lVar10 = DxDdGetDxgkWin32kInterface();

-    (**(code **)(lVar10 + 0x328))(&local_80);

-    local_d0 = &local_80;

-  }

-  if ((param_3 & 0x80) == 0) {

-LAB_2:

-    W32GetUserSessionState();

-    iVar7 = DrvSetDisplayConfig(param_1,param_2,param_3,uVar14 | 0x140);

-    if ((param_3 & 0x80) != 0) {

-      if (iVar7 < 0) {

-        xxxUserResetDisplayDevice();

-      }

-      else {

-        if ((uVar14 >> 9 & 1) != 0) {

-          lVar10 = W32GetSessionState();

-          uVar2 = *(undefined2 *)(*(longlong *)(lVar10 + 0x58) + 0x438);

-          lVar10 = W32GetUserSessionState();

-          *(undefined2 *)(*(longlong *)(lVar10 + 0x4e30) + 0x1b56) = uVar2;

-          lVar10 = W32GetUserSessionState();

-          psVar1 = (short *)(*(longlong *)(lVar10 + 0x4e30) + 0x1b66);

-          *psVar1 = *psVar1 + 1;

-          lVar10 = W32GetUserSessionState();

-          for (lVar10 = *(longlong *)(lVar10 + 0x8ea8); lVar10 != 0;

-              lVar10 = *(longlong *)(lVar10 + 0x180)) {

-            lVar9 = W32GetUserSessionState();

-            *(undefined2 *)(lVar10 + 0x110) =

-                 *(undefined2 *)(*(longlong *)(lVar9 + 0x4e30) + 0x1b56);

-          }

-          Feature_FixWin32kStateAfterSessionDpiUpdate__private_IsEnabledDeviceUsageNoInline();

-        }

-        TrackFullscreenMode(0);

-        lVar10 = W32GetUserSessionState();

-        *(undefined8 *)(*(longlong *)(lVar10 + 0xdf10) + 0x10) = 0;

-        GreIncrementDisplaySettingsUniqueness();

-        PowerDimUndimResend();

-        local_b0[0] = (param_3 >> 0x18 & 8 | uVar14 & 0x10) >> 3 | -(uint)(uVar6 != 0) & 4;

-        iVar7 = xxxResetDisplayDevice(param_5,local_b0,local_d0);

-        if (iVar7 < 0) {

-          local_e4 = 0x24;

-        }

-      }

-      if ((param_5 != 0) && ((*(uint *)(**(longlong **)(param_5 + 8) + 0x40) & 1) == 0)) {

-        xxxInternalInvalidate((*(longlong **)(param_5 + 8))[3]);

-      }

-      SetPointer(1);

-      zzzUpdateCursorImage();

-    }

-LAB_3:

-    if (!bVar4) goto LAB_1;

-LAB_4:

-    uVar13 = ReferenceDwmApiPort();

-    DwmAsyncNotifyRotationModeChange(uVar13,0);

-  }

-  else {

-    lVar10 = W32GetUserSessionState();

-    if (*(int *)(lVar10 + 0xa994) == 0) {

-      lVar10 = W32GetUserSessionState();

-      iVar7 = DrvQueryMDEVPowerState(*(undefined8 *)(*(longlong *)(lVar10 + 0xdf10) + 0x10));

-      if (iVar7 != 0) {

-        if (((param_3 & 0x20010000) != 0x20010000) || (param_1 != 1)) {

-LAB_5:

-          iVar7 = PreAllocateForPrimaryMonitorChange();

-          if (iVar7 != 0) {

-            SetPointer(0);

-            FreeAllSpbs();

-            lVar10 = W32GetUserSessionState();

-            if (*(longlong *)(lVar10 + 0xa880) != 0) {

-              StopFade();

-            }

-            lVar10 = W32GetUserSessionState();

-            bSetDevDragRect(*(undefined8 *)(*(longlong *)(lVar10 + 0xdf10) + 0x30));

-            goto LAB_2;

-          }

-          iVar7 = -0x3fffffff;

-          local_e4 = 0x35;

-          goto LAB_3;

-        }

-        lVar10 = W32GetWin32kBaseApiSetTable();

-        pcVar3 = *(code **)(*(longlong *)(lVar10 + 0x30) + 0xe80);

-        if ((pcVar3 == (code *)0x0) || (iVar7 = (*pcVar3)(), iVar7 == 0)) goto LAB_5;

-        lVar10 = W32GetWin32kBaseApiSetTable();

-        pcVar3 = *(code **)(*(longlong *)(lVar10 + 0x30) + 0x1080);

-        if ((pcVar3 == (code *)0x0) || (iVar7 = (*pcVar3)(), iVar7 < 0)) goto LAB_5;

-        uVar13 = ReferenceDwmApiPort();

-        DwmAsyncNotifyRotationModeChange(uVar13,1);

-        uVar13 = UserReferenceDwmApiPort();

-        ReleaseUserCriticalSection();

-        lVar10 = W32GetWin32kBaseApiSetTable();

-        pcVar3 = *(code **)(*(longlong *)(lVar10 + 0x30) + 0x1068);

-        if (pcVar3 != (code *)0x0) {

-          (*pcVar3)(uVar13,0);

-        }

-        lVar10 = W32GetUserSessionState();

-        lVar9 = UserCritInternal::`anonymous_namespace'::EnterCritInternal

-                          (lVar10,1,0,

-                           <lambda_63b61c2369133a205197eda5bd671ee7>::<lambda_invoker_cdecl>);

-        *(longlong *)(lVar10 + 0x10) = lVar9;

-        if ((lVar9 != 0) &&

-           (cVar5 = UserCritInternal::`anonymous_namespace'::IsValidGuiContext(lVar9), cVar5 != '\0'

-           )) {

-          DestroySharedUserCritDeferredUnlockList(lVar10 + 0x4d78);

-          DestroyDeferredUnlockObjectAssignmentList(lVar10 + 0x4db0);

-          DestroyDeferredUnlockObjectAssignmentList(lVar10 + 0x4da0);

-        }

-        bVar4 = true;

-        lVar10 = W32GetUserSessionState();

-        if (*(int *)(lVar10 + 0xa994) == 0) {

-          lVar10 = W32GetUserSessionState();

-          iVar7 = DrvQueryMDEVPowerState(*(undefined8 *)(*(longlong *)(lVar10 + 0xdf10) + 0x10));

-          if (iVar7 != 0) goto LAB_5;

-          local_e4 = 0x1c;

-        }

-        else {

-          local_e4 = 0x1b;

-        }

-        iVar7 = -0x3fffffff;

-        goto LAB_4;

-      }

-      local_e4 = 0x1c;

-    }

-    else {

-      local_e4 = 0x1b;

-    }

-    iVar7 = -0x3fffffff;

-  }

-LAB_1:

-  if (local_98 != 0) {

-    *(bool *)local_98 = local_e4 - 0x1bU < 2;

-  }

-  if (local_90 != (undefined1 *)0x0) {

-    *local_90 = 0;

-  }

-  if ((-1 < iVar7) && (local_e4 == 0x1d)) {

-    iVar7 = -0x3ffffdd2;

-  }

-  LogDiagSDC(param_1,param_2,param_3,iVar7);

-  return iVar7;

+  return;

 }
```

## `HmgRemoveObjectImpl`  (modified)

```diff
--- HmgRemoveObjectImpl
+++ HmgRemoveObjectImpl
@@ -1,147 +1,195 @@
+

+/* void * __ptr64 __cdecl HmgRemoveObjectImpl(struct HOBJ__ * __ptr64,long,long,unsigned

+   long,unsigned char,unsigned long * __ptr64) */

 

 void * __cdecl

 HmgRemoveObjectImpl(HOBJ__ *param_1,long param_2,long param_3,ulong param_4,uchar param_5,

                    ulong *param_6)

 

 {

-  undefined4 uVar1;

-  longlong *plVar2;

-  undefined8 *puVar3;

-  CPointerHashTable *this;

-  __uint64 _Var4;

-  code *pcVar5;

-  undefined8 *puVar6;

-  bool bVar7;

-  int iVar8;

-  longlong lVar9;

-  ulonglong unaff_RBX;

-  CLeakTrackingAllocator *this_00;

-  undefined8 *puVar10;

-  longlong unaff_RBP;

-  HSEMAPHORE__ *unaff_RSI;

-  undefined8 *unaff_RDI;

-  ulonglong unaff_R14;

-  uint unaff_R15D;

+  ulong uVar1;

+  uint *puVar2;

+  uint *puVar3;

+  char cVar4;

+  int iVar5;

+  int iVar6;

+  uint uVar7;

+  longlong lVar8;

+  longlong *plVar9;

+  ulonglong uVar10;

+  undefined8 uVar11;

+  ReferenceTrackerCountedType RVar12;

+  ulonglong uVar13;

+  HANDLELOCK *this;

+  ulonglong uVar14;

+  void *pvVar15;

+  ulonglong *puVar16;

+  void *pvVar17;

+  uint uVar18;

+  HSEMAPHORE__ *pHVar19;

+  HSEMAPHORE__ *local_res8;

+  uint *local_58;

+  int local_50;

+  undefined2 local_4c;

+  longlong local_48;

   

-  this_00 = (CLeakTrackingAllocator *)(unaff_RBX & 0xffffffffffffff00);

-  puVar6 = (undefined8 *)register0x00000020;

-  do {

-    puVar10 = puVar6;

-    pcVar5 = (code *)swi(0x29);

-    iVar8 = (*pcVar5)(3);

-    if (iVar8 == 1) {

-      *puVar10 = 0x140022c91;

-      bVar7 = NSInstrumentation::CLeakTrackingAllocator::EnsurePoolTagIncrement

-                        (this_00,(uint)unaff_RSI);

-      if ((bVar7) && (unaff_RDI < (undefined8 *)(unaff_R14 + 0x10))) {

-        uVar1 = *(undefined4 *)(unaff_RBP + 0x6f);

-        *puVar10 = 0x140022cbe;

-        unaff_RDI = (undefined8 *)ExAllocatePool2(puVar10[5] | 2,unaff_R14 + 0x10,uVar1);

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

-          LOCK();

-          *(longlong *)(this_00 + 0x70) = *(longlong *)(this_00 + 0x70) + 1;

-          UNLOCK();

-          *unaff_RDI = unaff_RSI;

-          unaff_RDI = unaff_RDI + 2;

-          if (unaff_RDI != (undefined8 *)0x0) goto LAB_0;

+  lVar8 = W32GetSessionState();

+  pHVar19 = (HSEMAPHORE__ *)(**(longlong **)(lVar8 + 0x58) + 0x5e8);

+  local_res8 = pHVar19;

+  GreAcquireSemaphoreInternal(pHVar19);

+  pvVar17 = SystemReserved1[0xf];

+  lVar8 = 0;

+  cVar4 = KeIsAttachedProcess();

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

+LAB_0:

+    plVar9 = (longlong *)PsGetThreadWin32Thread(pvVar17);

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

+      lVar8 = *plVar9;

+    }

+  }

+  else {

+    iVar5 = W32GetCurrentWin32kSessionId();

+    uVar11 = PsGetCurrentThreadProcess();

+    iVar6 = PsGetProcessSessionIdEx(uVar11);

+    if (iVar5 == iVar6) goto LAB_0;

+  }

+  uVar14 = 0;

+  puVar16 = (ulonglong *)(-(ulonglong)(lVar8 != 0) & lVar8 + 8U);

+  if (puVar16 != (ulonglong *)0x0) {

+    uVar13 = *puVar16;

+    if ((uVar13 >> 0x14 & 1) == 0 && (uVar13 & 0xfffffffffff00000) != 0) {

+      iVar5 = 0x25;

+      do {

+        iVar6 = (int)uVar14;

+        if ((uVar13 >> (uVar14 & 0x3f) & 1) == 0) {

+          iVar6 = iVar5;

         }

-        this = *(CPointerHashTable **)(this_00 + 8);

-        *puVar10 = 0x140022ce9;

-        NSInstrumentation::CPointerHashTable::LookupInterlockedDecrement(this,unaff_RSI);

-        goto LAB_0;

+        uVar14 = uVar14 + 1;

+        iVar5 = iVar6;

+      } while (uVar14 < 0x40);

+      if (0x14 < iVar6) {

+        MicrosoftTelemetryAssertTriggeredNoArgsKM();

       }

-LAB_1:

-      unaff_RDI = (undefined8 *)0x0;

+    }

+    cVar4 = *(char *)((longlong)puVar16 + 0x1c);

+    *(char *)((longlong)puVar16 + 0x1c) = cVar4 + '\x01';

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

+      *puVar16 = *puVar16 | 0x100000;

+    }

+  }

+  local_4c = 0;

+  local_58 = (uint *)0x0;

+  local_50 = 0;

+  lVar8 = W32GetSessionState();

+  local_48 = *(longlong *)(lVar8 + 0x58);

+  HANDLELOCK::vLockHandle

+            ((HANDLELOCK *)&local_58,

+             (uint)((ulonglong)param_1 >> 8) & 0xff0000 | (uint)param_1 & 0xffff,

+             (uint)((param_4 & 2) != 0));

+  puVar3 = local_58;

+  if (local_50 == 0) goto LAB_1;

+  puVar2 = *(uint **)(local_48 + 0x1628);

+  uVar18 = *local_58;

+  uVar14 = (ulonglong)uVar18;

+  if ((0xffff < uVar18) && (uVar13 = (ulonglong)(ushort)uVar18, uVar14 = uVar13, 0x10000 < *puVar2))

+  {

+    lVar8 = *(longlong *)(puVar2 + 4);

+    uVar7 = *(uint *)(lVar8 + 0x808);

+    if ((uVar18 & 0xffff) < (*(ushort *)(lVar8 + 2) + 0xffff) * 0x10000 + uVar7) {

+      if ((uVar18 & 0xffff) < uVar7) {

+        uVar14 = 0;

+      }

+      else {

+        uVar14 = (ulonglong)(((uVar18 & 0xffff) - uVar7 >> 0x10) + 1);

+      }

+      plVar9 = *(longlong **)(lVar8 + 8 + uVar14 * 8);

+      uVar10 = uVar13;

+      if ((int)uVar14 != 0) {

+        uVar10 = (ulonglong)(((1 - (int)uVar14) * 0x10000 - uVar7) + (uVar18 & 0xffff));

+      }

+      lVar8 = 0;

+      if ((uint)uVar10 < *(uint *)((longlong)plVar9 + 0x14)) {

+        lVar8 = *plVar9 + uVar10 * 0x18;

+      }

     }

     else {

-      if (iVar8 != 2) goto LAB_1;

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

-      *puVar10 = 0x140022d22;

-      bVar7 = NSInstrumentation::CLeakTrackingAllocator::IsTagTracked

-                        (this_00,(uint)unaff_RSI,(__uint64 *)(unaff_RBP + 0x7f));

-      if (!bVar7) {

-        *(undefined8 **)(unaff_RBP + -0x79) = puVar10 + 5;

-        *(longlong *)(unaff_RBP + -0x71) = unaff_RBP + 0x6f;

-        *puVar10 = 0x140022d48;

-        unaff_RDI = (undefined8 *)

-                    NSInstrumentation::CLeakTrackingAllocator::

-                    MakeUntrackedAllocation<<lambda_4d7361c25cefbba13618e79d09554cff>,unsigned___int64_&>

-                              (this_00,unaff_RBP + -0x79,puVar10 + 6);

-        goto LAB_0;

+      lVar8 = 0;

+    }

+    uVar14 = (ulonglong)uVar18;

+    if ((uint)*(byte *)(lVar8 + 0xd) == uVar18 >> 0x10) {

+      uVar14 = uVar13;

+    }

+  }

+  lVar8 = *(longlong *)(puVar2 + 4);

+  uVar18 = *(uint *)(lVar8 + 0x808);

+  uVar7 = (uint)uVar14;

+  if (uVar7 < (*(ushort *)(lVar8 + 2) + 0xffff) * 0x10000 + uVar18) {

+    if (uVar7 < uVar18) {

+      uVar13 = 0;

+    }

+    else {

+      uVar13 = (ulonglong)((uVar7 - uVar18 >> 0x10) + 1);

+    }

+    lVar8 = *(longlong *)(lVar8 + 8 + uVar13 * 8);

+    if ((int)uVar13 != 0) {

+      uVar14 = (ulonglong)(uVar7 + ((1 - (int)uVar13) * 0x10000 - uVar18));

+    }

+    if (*(uint *)(lVar8 + 0x14) <= (uint)uVar14) goto LAB_2;

+    pvVar17 = *(void **)(*(longlong *)(**(longlong **)(lVar8 + 0x18) + (uVar14 >> 8) * 8) + 8 +

+                        (uVar14 & 0xff) * 0x10);

+  }

+  else {

+LAB_2:

+    pvVar17 = (void *)0x0;

+  }

+  if (((((param_4 & 2) == 0) || (uVar18 = local_58[2] & 0xfffffffe, uVar18 == 0x80000012)) ||

+      (uVar7 = PsGetCurrentProcessId(), uVar18 == (uVar7 & 0xfffffffc))) || (uVar18 == 0)) {

+    if ((*(uchar *)((longlong)puVar3 + 0xe) == param_5) &&

+       ((short)puVar3[3] == (short)((ulonglong)param_1 >> 0x10))) {

+      uVar1 = *(ulong *)((longlong)pvVar17 + 8);

+      if (((param_4 & 4) == 0) &&

+         ((uVar1 != param_3 || (*(short *)((longlong)pvVar17 + 0xc) != (short)param_2)))) {

+        *(byte *)((longlong)puVar3 + 0xf) = *(byte *)((longlong)puVar3 + 0xf) | 8;

+        if (param_6 != (ulong *)0x0) {

+          *param_6 = uVar1;

+        }

       }

-      bVar7 = false;

-      if ((unaff_RDI < (undefined8 *)0x1000) || (((ulonglong)unaff_RDI & 0xfff) != 0)) {

-        unaff_RDI = unaff_RDI + 2;

-        bVar7 = true;

-        puVar10[6] = unaff_RDI;

-      }

-      *puVar10 = 0x140022d7d;

-      unaff_RDI = (undefined8 *)ExAllocatePool2(0x102,unaff_RDI,(ulonglong)unaff_RSI & 0xffffffff);

-      if (unaff_RDI == (undefined8 *)0x0) goto LAB_1;

-      LOCK();

-      *(longlong *)(this_00 + 0x80) = *(longlong *)(this_00 + 0x80) + 1;

-      UNLOCK();

-      *puVar10 = 0x140022da7;

-      memset((void *)(unaff_RBP + -0x69),0,0xa0);

-      *puVar10 = 0x140022dbb;

-      RtlCaptureStackBackTrace(0,0x14,unaff_RBP + -0x69);

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

-        _Var4 = *(__uint64 *)(unaff_RBP + 0x7f);

-        *puVar10 = 0x140022dec;

-        bVar7 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<1>

-                          (this_00,unaff_RDI,_Var4,(CBackTrace *)(unaff_RBP + -0x69));

-        if (!bVar7) {

-LAB_2:

-          LOCK();

-          *(longlong *)(this_00 + 0x88) = *(longlong *)(this_00 + 0x88) + 1;

-          UNLOCK();

-          *puVar10 = 0x140022e24;

-          ___<lambda_invoker_cdecl>_PEAX_<lambda_fbf80a8de0504b0922e6810f5f982d9a>__CA_A_PPEAX_Z

-                    (unaff_RDI);

-          goto LAB_1;

+      else if (((param_4 & 1) != 0) || ((*(byte *)((longlong)puVar3 + 0xf) & 1) == 0)) {

+        lVar8 = HmgPentryFromPobj(pvVar17);

+        if (*(char *)(lVar8 + 0xe) == '\x05') {

+          pvVar15 = *(void **)((longlong)pvVar17 + 0x2a8);

+          RVar12 = 0;

         }

-        unaff_RDI = unaff_RDI + 2;

-      }

-      else {

-        _Var4 = *(__uint64 *)(unaff_RBP + 0x7f);

-        *puVar10 = 0x140022e0c;

-        bVar7 = NSInstrumentation::CLeakTrackingAllocator::AssociateAllocationWithBacktrace<0>

-                          (this_00,unaff_RDI,_Var4,(CBackTrace *)(unaff_RBP + -0x69));

-        if (!bVar7) goto LAB_2;

+        else {

+          if (*(char *)(lVar8 + 0xe) != '\x10') goto LAB_3;

+          pvVar15 = *(void **)((longlong)pvVar17 + 0x88);

+          RVar12 = 2;

+        }

+        TrackObjectReferenceDecrement(RVar12,pvVar15);

+LAB_3:

+        HANDLELOCK::vUnlockAndRelease((HANDLELOCK *)&local_58);

+        this = (HANDLELOCK *)&local_58;

+        HANDLELOCK::~HANDLELOCK(this);

+        if (pHVar19 == (HSEMAPHORE__ *)0x0) {

+          return pvVar17;

+        }

+        GreReleaseSemaphoreCommon<20,void_(__cdecl*)(HSEMAPHORE__*___ptr64)>

+                  ((_func_void_HSEMAPHORE___ptr *)this,pHVar19);

+        return pvVar17;

       }

     }

-LAB_0:

-    unaff_R15D = unaff_R15D & 1;

-    if (unaff_RDI == (undefined8 *)0x0) {

-      return (void *)0x0;

+    else {

+      local_4c = CONCAT11(1,(undefined1)local_4c);

     }

-    if (unaff_R15D != 0) {

-      *puVar10 = 0x140022bfd;

-      memset(unaff_RDI,0,unaff_R14 & 0xffffffff);

-    }

-    *puVar10 = 0x140022c04;

-    lVar9 = W32GetSessionState();

-    plVar2 = *(longlong **)(lVar9 + 0x58);

-    *(undefined4 *)(unaff_RDI + 2) = 0;

-    unaff_RSI = (HSEMAPHORE__ *)(*plVar2 + 0x6b8);

-    *puVar10 = 0x140022c23;

-    GreAcquireSemaphoreInternal(unaff_RSI);

-    *puVar10 = 0x140022c28;

-    func_0x000140022e34();

-    this_00 = (CLeakTrackingAllocator *)(plVar2 + 0x17c);

-    puVar3 = (undefined8 *)plVar2[0x17d];

-    puVar6 = puVar10 + 1;

-    if ((CLeakTrackingAllocator *)*puVar3 == this_00) {

-      *unaff_RDI = this_00;

-      unaff_RDI[1] = puVar3;

-      *puVar3 = unaff_RDI;

-      plVar2[0x17d] = (longlong)unaff_RDI;

-      if (unaff_RSI != (HSEMAPHORE__ *)0x0) {

-        *puVar10 = 0x140022c53;

-        func_0x000140022f1c();

-      }

-      return unaff_RDI + 4;

-    }

-  } while( true );

+    HANDLELOCK::vUnlock((HANDLELOCK *)&local_58);

+  }

+  else {

+    HANDLELOCK::vUnlock((HANDLELOCK *)&local_58);

+    local_4c = CONCAT11(1,(undefined1)local_4c);

+  }

+LAB_1:

+  HANDLELOCK::~HANDLELOCK((HANDLELOCK *)&local_58);

+  SEMOBJ<20>::vUnlock((SEMOBJ<20> *)&local_res8);

+  return (void *)0x0;

 }
```

## `EtwTraceUIPIHandleValidationError`  (modified)

```diff
--- EtwTraceUIPIHandleValidationError
+++ EtwTraceUIPIHandleValidationError
@@ -1,42 +1,46 @@
 

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

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

 

-void EtwTraceUIPIHandleValidationError(longlong param_1,undefined8 *param_2)

+void EtwTraceUIPIHandleValidationError(tagPROCESSINFO *param_1,tagPROCESSINFO *param_2)

 

 {

-  ushort uVar1;

-  int in_EAX;

-  uint uVar2;

-  ushort *unaff_RBX;

-  longlong *unaff_RDI;

+  longlong lVar1;

+  char cVar2;

+  bool bVar3;

+  undefined1 auStackY_b8 [32];

+  undefined8 local_58;

+  undefined8 uStack_50;

+  undefined8 local_48;

+  undefined8 uStack_40;

+  undefined4 local_38;

+  ulonglong local_30;

   

-  if ((in_EAX - 4U & 0xfffffffb) == 0) {

-    uVar2 = *(uint *)(param_1 + 0x28) & 0xff | 0xff515700;

+  local_30 = __security_cookie ^ (ulonglong)auStackY_b8;

+  local_58 = 0;

+  uStack_50 = 0;

+  local_48 = 0;

+  uStack_40 = 0;

+  local_38 = 0;

+  EtwpSetTraceHeader((_tagW32KUIPI_Msg_Template_UIPI_Trace_Header *)&local_58,4,(tagTHREADINFO *)0x0

+                     ,param_1,(tagTHREADINFO *)0x0,param_2);

+  if ((Microsoft_Windows_Win32kEnableBits & 4) != 0) {

+    McTemplateK0nxqq_EtwWriteTransfer();

+  }

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

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x2000) == 0)) ||

+     ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

+    cVar2 = '\0';

   }

   else {

-    uVar2 = *(uint *)(param_1 + 0x28);

+    cVar2 = '\x01';

   }

-  *(uint *)(unaff_RBX + 10) = uVar2;

-  uVar1 = (**(code **)*param_2)();

-  unaff_RBX[2] = uVar1;

-  uVar1 = (**(code **)(*unaff_RDI + 8))();

-  unaff_RBX[3] = uVar1;

-  *(undefined4 *)(unaff_RBX + 4) = *(undefined4 *)(unaff_RDI[1] + 0x20);

-  uVar1 = *(ushort *)(unaff_RDI[1] + 0x24);

-  *unaff_RBX = uVar1 & 0xf;

-  if ((*(uint *)(unaff_RDI[1] + 0x80) & 0x200) != 0) {

-    unaff_RBX[6] = 0;

-    unaff_RBX[7] = 0;

-    unaff_RBX[8] = 0;

-    unaff_RBX[9] = 0;

-    *unaff_RBX = uVar1 & 0xc;

-  }

-  if (*(int *)(unaff_RBX + 0x14) != 0) {

-    *(uint *)(unaff_RBX + 0x20) = *(uint *)(unaff_RBX + 0x20) | 1;

-  }

-  if ((*(uint *)(unaff_RDI[1] + 0x80) & 0x20) != 0) {

-    *(uint *)(unaff_RBX + 0x20) = *(uint *)(unaff_RBX + 0x20) | 2;

+  bVar3 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+  if ((cVar2 != '\0') || (bVar3)) {

+    lVar1 = W32GetUserSessionState();

+    WPP_RECORDER_AND_TRACE_SF_DDqq

+              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,bVar3,

+               *(undefined8 *)(lVar1 + 0x10f88));

   }

   return;

 }
```

## `xxxSystemParametersInfo`  (modified)

```diff
--- xxxSystemParametersInfo
+++ xxxSystemParametersInfo
@@ -1,31 +1,287 @@
 

-undefined4 xxxSystemParametersInfo(RGNOBJ *param_1,RGNOBJ *param_2)

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

+

+ulonglong xxxSystemParametersInfo(uint param_1,uint param_2,_GUID *param_3,_GUID *param_4)

 

 {

-  REGION *pRVar1;

-  int iVar2;

-  undefined4 unaff_EBX;

-  longlong unaff_RBP;

-  HSEMAPHORE__ *unaff_RSI;

-  longlong unaff_RDI;

-  longlong unaff_R12;

-  undefined8 *unaff_R14;

+  undefined8 uVar1;

+  undefined8 uVar2;

+  char cVar3;

+  int iVar4;

+  uint uVar5;

+  InputType IVar6;

+  longlong lVar7;

+  ulonglong uVar8;

+  void *_Src;

+  int *piVar9;

+  _GUID *p_Var10;

+  uint uVar11;

+  bool bVar12;

+  bool bVar13;

+  undefined1 auStackY_b8 [32];

+  uint local_88 [2];

+  _GUID *local_80;

+  uint local_78;

+  ushort local_70 [16];

+  ulonglong local_50;

   

-  RGNOBJ::vSwap(param_1,param_2);

-  pRVar1 = *(REGION **)(unaff_RBP + 0x50);

-  *(REGION **)(unaff_RDI + 0x498) = pRVar1;

-  XCLIPOBJ::vSetup((XCLIPOBJ *)(unaff_RDI + 0x780),pRVar1,(ERECTL *)(unaff_R12 + 4),1);

-  iVar2 = ERECTL::bEmpty((ERECTL *)(unaff_RDI + 0x784));

-  if (iVar2 == 0) {

-    *unaff_R14 = (XCLIPOBJ *)(unaff_RDI + 0x780);

-    unaff_EBX = 1;

-  }

-  RGNMEMOBJTMP::~RGNMEMOBJTMP((RGNMEMOBJTMP *)(unaff_RBP + 0x58));

-  if (*(char *)(unaff_RBP + -0x30) != '\0') {

-    CPushLock::ReleaseLock((CPushLock *)(*(longlong *)(unaff_RBP + -0x38) + 0x458));

-  }

-  GreReleaseSemaphoreCommon<11,void_(__cdecl*)(HSEMAPHORE__*___ptr64)>

-            (GreReleaseSemaphoreExclusiveInternal,unaff_RSI);

-  return unaff_EBX;

+                    /* 0x16e7e0  2514  xxxSystemParametersInfo */

+  local_50 = __security_cookie ^ (ulonglong)auStackY_b8;

+  p_Var10 = param_4;

+  local_80 = param_3;

+  cVar3 = PsIsWin32KFilterEnabled();

+  if ((cVar3 != '\0') && (iVar4 = IsSPIActionAllowedForFilteredProcess(param_1), iVar4 == 0)) {

+    EtwTraceSPIBlockedByFiltering(param_1);

+    if (DAT_0 < 6) {

+      return 0;

+    }

+    cVar3 = _tlgKeywordOn(&DAT_0,0x400000000000);

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

+      return 0;

+    }

+    local_88[0] = param_1;

+    _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>_>

+              ((_tlgProvider_t *)&DAT_0,&DAT_140276aee,param_3,p_Var10,

+               (_tlgWrapperByVal<4> *)local_88);

+    return 0;

+  }

+  local_88[0] = 0;

+  uVar5 = 0;

+  bVar13 = ((ulonglong)param_4 & 1) == 0;

+  bVar12 = !bVar13;

+  uVar11 = (uint)bVar13;

+  local_78 = (uint)param_4 & 2;

+  bVar13 = !bVar12;

+  lVar7 = W32GetUserSessionState();

+  p_Var10 = local_80;

+  if (param_1 < 0xb4) {

+    if (param_1 == 0xb3) {

+LAB_1:

+      iVar4 = WritePointerDeviceSettings(param_1,local_80,bVar12);

+      bVar13 = iVar4 != 0;

+      uVar5 = (uint)bVar13;

+    }

+    else {

+      if (0x68 < param_1) {

+        if (param_1 != 0x69) {

+          if (param_1 == 0x92) {

+LAB_2:

+            iVar4 = ReadPointerDeviceSettings(param_1,local_80);

+          }

+          else {

+            if (param_1 == 0x93) goto LAB_1;

+            if (param_1 != 0xae) {

+              if (param_1 == 0xaf) {

+                uVar5 = _SetPrecisionTouchPadConfiguration(local_80,bVar12);

+                if (uVar5 == 0) {

+                  bVar13 = false;

+                }

+                else {

+                  bVar13 = true;

+                  PTPTelemetry::PTPConfigUpdateEx((DEVICEINFO *)0x0);

+                }

+                goto LAB_3;

+              }

+              if (param_1 == 0xb0) {

+                lVar7 = W32GetUserSessionState();

+                IVar6 = CInputGlobals::GetWakeOnDeviceTypes(*(CInputGlobals **)(lVar7 + 0xbf0));

+                local_80->Data1 = IVar6;

+                goto LAB_4;

+              }

+              if (param_1 == 0xb1) {

+                lVar7 = W32GetUserSessionState();

+                bVar13 = CInputGlobals::SetWakeableInputTypesToRegistry

+                                   (*(CInputGlobals **)(lVar7 + 0xbf0),param_2,(ulong)local_80);

+                goto LAB_4;

+              }

+              if (param_1 != 0xb2) goto LAB_5;

+              goto LAB_2;

+            }

+            iVar4 = _GetPrecisionTouchPadConfiguration(local_80);

+          }

+LAB_6:

+          bVar13 = iVar4 != 0;

+          goto LAB_4;

+        }

+        iVar4 = ApiSetEditionCheckDesktopPolicy();

+        bVar13 = iVar4 == 0 && bVar13;

+        if (iVar4 == 0 && bVar12) {

+          RtlStringCchPrintfW(local_70,0x10,(ushort *)L"%d",(ulonglong)param_2);

+          lVar7 = -1;

+          do {

+            lVar7 = lVar7 + 1;

+          } while (local_70[lVar7] != 0);

+          iVar4 = FastWriteProfileValue(0,4,0xe,1);

+          bVar13 = iVar4 != 0;

+          uVar5 = (uint)bVar13;

+        }

+        if (bVar13 == false) goto LAB_3;

+        lVar7 = W32GetUserSessionState();

+        *(uint *)(*(longlong *)(lVar7 + 0x4e30) + 0x137c) = param_2;

+        goto LAB_7;

+      }

+      if (param_1 == 0x68) {

+        lVar7 = W32GetUserSessionState();

+        local_80->Data1 = *(ulong *)(*(longlong *)(lVar7 + 0x4e30) + 0x137c);

+        goto LAB_4;

+      }

+      if (param_1 == 0x32) {

+        if ((((param_2 != 0) && (param_2 != 0x18)) || (local_80 == (_GUID *)0x0)) ||

+           (local_80->Data1 != 0x18)) {

+          return 0;

+        }

+        uVar5 = 0x14;

+        _Src = (void *)(lVar7 + 0x5084);

+LAB_8:

+        memmove(&local_80->Data2,_Src,(ulonglong)uVar5);

+        goto LAB_9;

+      }

+      if (param_1 == 0x33) {

+        iVar4 = SpiSetFilterKeys(param_2,local_80,(uint)bVar12,uVar11,(int *)local_88);

+      }

+      else {

+        if (param_1 == 0x34) {

+          if ((param_2 & 0xfffffff7) != 0) {

+            return 0;

+          }

+          if (local_80 == (_GUID *)0x0) {

+            return 0;

+          }

+          if (local_80->Data1 != 8) {

+            return 0;

+          }

+          uVar5 = 4;

+          _Src = (void *)(lVar7 + 0x5244);

+          goto LAB_8;

+        }

+        if (param_1 == 0x35) {

+          iVar4 = SpiSetToggleKeys(param_2,local_80,(uint)bVar12,uVar11,(int *)local_88);

+        }

+        else {

+          if (param_1 == 0x3a) {

+            iVar4 = SpiGetStickyKeys(param_2,local_80);

+            goto LAB_6;

+          }

+          if (param_1 == 0x3b) {

+            iVar4 = SpiSetStickyKeys(param_2,local_80,(uint)bVar12,uVar11,(int *)local_88);

+          }

+          else {

+            if (param_1 == 0x3c) {

+              if ((param_2 != 0) && (param_2 != 0xc)) {

+                return 0;

+              }

+              if (local_80 == (_GUID *)0x0) {

+                return 0;

+              }

+              if (local_80->Data1 != 0xc) {

+                return 0;

+              }

+              uVar5 = 8;

+              _Src = (void *)(lVar7 + 0x522c);

+              goto LAB_8;

+            }

+            if (param_1 != 0x3d) goto LAB_5;

+            iVar4 = SpiSetAccessTimeOut(param_2,local_80,(uint)bVar12,uVar11,(int *)local_88);

+          }

+        }

+      }

+      bVar13 = iVar4 != 0;

+      uVar5 = local_88[0];

+    }

+  }

+  else {

+    if (param_1 < 0x2031) {

+      if (param_1 == 0x2030) goto LAB_10;

+      if (param_1 != 0xb4) {

+        if (param_1 == 0xb5) goto LAB_1;

+        if (param_1 == 0x201e) goto LAB_10;

+        if (param_1 != 0x201f) {

+          if (param_1 == 0x2020) goto LAB_10;

+          if (param_1 != 0x2021) {

+            iVar4 = param_1 - 0x2026;

+            goto LAB_11;

+          }

+        }

+        goto LAB_12;

+      }

+      lVar7 = W32GetUserSessionState();

+      uVar1 = *(undefined8 *)(lVar7 + 0x48f0);

+      uVar2 = *(undefined8 *)(lVar7 + 0x48f8);

+      p_Var10->Data1 = (int)uVar1;

+      p_Var10->Data2 = (short)((ulonglong)uVar1 >> 0x20);

+      p_Var10->Data3 = (short)((ulonglong)uVar1 >> 0x30);

+      *(undefined8 *)p_Var10->Data4 = uVar2;

+      uVar1 = *(undefined8 *)(lVar7 + 0x4900);

+      uVar2 = *(undefined8 *)(lVar7 + 0x4908);

+      p_Var10[1].Data1 = (int)uVar1;

+      p_Var10[1].Data2 = (short)((ulonglong)uVar1 >> 0x20);

+      p_Var10[1].Data3 = (short)((ulonglong)uVar1 >> 0x30);

+      *(undefined8 *)p_Var10[1].Data4 = uVar2;

+      uVar1 = *(undefined8 *)(lVar7 + 0x4910);

+      uVar2 = *(undefined8 *)(lVar7 + 0x4918);

+      p_Var10[2].Data1 = (int)uVar1;

+      p_Var10[2].Data2 = (short)((ulonglong)uVar1 >> 0x20);

+      p_Var10[2].Data3 = (short)((ulonglong)uVar1 >> 0x30);

+      *(undefined8 *)p_Var10[2].Data4 = uVar2;

+      uVar1 = *(undefined8 *)(lVar7 + 0x4920);

+      p_Var10[3].Data1 = (int)uVar1;

+      p_Var10[3].Data2 = (short)((ulonglong)uVar1 >> 0x20);

+      p_Var10[3].Data3 = (short)((ulonglong)uVar1 >> 0x30);

+LAB_9:

+      bVar13 = true;

+      goto LAB_4;

+    }

+    if (param_1 != 0x2031) {

+      if (param_1 == 0x2032) {

+LAB_10:

+        lVar7 = W32GetUserSessionState();

+        local_80->Data1 =

+             *(ulong *)(lVar7 + ((ulonglong)((param_1 - 0x2000 >> 1) + 1) + 0x1066) * 0x10);

+        goto LAB_4;

+      }

+      if (param_1 != 0x2033) {

+        if (param_1 == 0x2034) goto LAB_10;

+        if (param_1 != 0x2035) {

+          iVar4 = param_1 - 0x2038;

+LAB_11:

+          if (iVar4 == 0) goto LAB_10;

+          if (iVar4 != 1) {

+LAB_5:

+            uVar8 = ApiSetEditionxxxSystemParametersInfoWorker

+                              (param_1,(ulonglong)param_2,local_80,(ulonglong)param_4 & 0xffffffff);

+            return uVar8;

+          }

+        }

+      }

+    }

+LAB_12:

+    lVar7 = W32GetUserSessionState();

+    piVar9 = (int *)(((ulonglong)((param_1 - 0x2000 >> 1) + 1) + 0x1066) * 0x10 + lVar7);

+    if (bVar12) {

+      iVar4 = FastWriteProfileValue(0,piVar9[1],*(undefined8 *)(piVar9 + 2),4);

+      bVar13 = iVar4 != 0;

+      uVar5 = (uint)bVar13;

+    }

+    if (bVar13 != false) {

+      iVar4 = (int)local_80;

+      *piVar9 = iVar4;

+      if (param_1 == 0x2021) {

+        lVar7 = W32GetUserSessionState();

+        *(int *)(lVar7 + 0x144) = iVar4;

+      }

+      else if (param_1 == 0x2035) {

+        SendCrosshairEnabledStatusChanged(iVar4 != 0);

+      }

+LAB_7:

+      BroadcastSettingsUpdateToAllContainers();

+    }

+  }

+LAB_3:

+  if ((uVar5 != 0) && (local_78 != 0)) {

+    ApiSetEditionxxxBroadcastSPIChange(param_1);

+  }

+LAB_4:

+  return (ulonglong)bVar13;

 }
```

## `GreReleaseSemaphoreCommon<20,void_(__cdecl*)(HSEMAPHORE__*___ptr64)>`  (modified)

```diff
--- GreReleaseSemaphoreCommon<20,void_(__cdecl*)(HSEMAPHORE__*___ptr64)>
+++ ThreadRestrictNewHandlesRegion::InRegion
@@ -1,50 +1,20 @@
 

-/* void __cdecl GreReleaseSemaphoreCommon<20,void (__cdecl*)(struct HSEMAPHORE__ * __ptr64)>(void

-   (__cdecl*)(struct HSEMAPHORE__ * __ptr64),struct HSEMAPHORE__ * __ptr64) */

+/* public: bool __cdecl ThreadRestrictNewHandlesRegion::InRegion(unsigned int) __ptr64 */

 

-void __cdecl

-GreReleaseSemaphoreCommon<20,void_(__cdecl*)(HSEMAPHORE__*___ptr64)>

-          (_func_void_HSEMAPHORE___ptr *param_1,HSEMAPHORE__ *param_2)

+bool __thiscall

+ThreadRestrictNewHandlesRegion::InRegion(ThreadRestrictNewHandlesRegion *this,uint param_1)

 

 {

-  char *pcVar1;

-  void *pvVar2;

-  char cVar3;

-  int iVar4;

-  int iVar5;

-  undefined8 *puVar6;

-  undefined8 uVar7;

-  ulonglong *puVar8;

-  ulonglong *puVar9;

+  ulonglong uVar1;

   

-  EtwTraceGreLockReleaseSemaphore(L"Hmgr");

-  pvVar2 = SystemReserved1[0xf];

-  cVar3 = KeIsAttachedProcess();

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

-    uVar7 = PsGetCurrentProcess();

-    iVar4 = PsGetProcessSessionIdEx(uVar7);

-    uVar7 = PsGetCurrentThreadProcess();

-    iVar5 = PsGetProcessSessionIdEx(uVar7);

-    if (iVar4 != iVar5) goto LAB_0;

+  uVar1 = 0;

+  while( true ) {

+    if (*(ulonglong *)(this + 0x18) <= uVar1) {

+      return false;

+    }

+    if (*(uint *)(*(longlong *)(this + 0x28) + uVar1 * 4) == param_1) break;

+    uVar1 = uVar1 + 1;

   }

-  puVar6 = (undefined8 *)PsGetThreadWin32Thread(pvVar2);

-  puVar9 = (ulonglong *)0x0;

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

-    puVar9 = (ulonglong *)*puVar6;

-  }

-  puVar8 = (ulonglong *)0x0;

-  if (puVar9 != (ulonglong *)0x0) {

-    puVar8 = puVar9 + 1;

-  }

-  if (puVar8 != (ulonglong *)0x0) {

-    pcVar1 = (char *)((longlong)puVar8 + 0x1c);

-    *pcVar1 = *pcVar1 + -1;

-    if (*pcVar1 == '\0') {

-      *puVar8 = *puVar8 & 0xffffffffffefffff;

-    }

-  }

-LAB_0:

-  GreReleaseSemaphoreExclusiveInternal(param_2);

-  return;

+  return true;

 }
```

## `ApiSetpResolveHost`  (modified)

```diff
--- ApiSetpResolveHost
+++ ApiSetpResolveHost
@@ -1,17 +1,141 @@
 

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

-

-void ApiSetpResolveHost(longlong param_1,undefined2 param_2)

+undefined8

+ApiSetpResolveHost(longlong param_1,undefined8 param_2,ulonglong param_3,undefined8 param_4,

+                  undefined8 param_5,undefined1 *param_6,short *param_7)

 

 {

-  byte *pbVar1;

-  byte bVar2;

-  longlong unaff_RBX;

+  short sVar1;

+  char cVar2;

+  ushort uVar3;

+  uint uVar4;

+  byte bVar5;

+  longlong lVar6;

+  byte bVar7;

+  ulonglong uVar8;

+  undefined7 uVar9;

+  undefined1 uVar10;

+  uint *puVar11;

+  ulonglong uVar12;

+  undefined8 local_48;

+  undefined8 uStack_40;

+  undefined8 local_38;

+  undefined8 uStack_30;

+  undefined8 local_28;

   

-  bVar2 = in(param_2);

-  pbVar1 = (byte *)(unaff_RBX + 0x71 + param_1 * 4);

-  *pbVar1 = *pbVar1 & bVar2;

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

-  halt_baddata();

+  local_28 = 0;

+  uVar10 = 0;

+  param_7[0] = 0;

+  param_7[1] = 0;

+  param_7[2] = 0;

+  param_7[3] = 0;

+  param_7[4] = 0;

+  param_7[5] = 0;

+  param_7[6] = 0;

+  param_7[7] = 0;

+  local_48 = 0;

+  uStack_40 = 0;

+  local_38 = 0;

+  uStack_30 = 0;

+  cVar2 = ApiSetpGetContractKeyInfo(param_2,param_3 & 0xffff,param_3,&local_48);

+  if (cVar2 == '\0') goto LAB_0;

+  if (uStack_40._4_4_ == 1) {

+    lVar6 = param_1 + 0x2c;

+    uVar3 = ApiSetpSearchForSectionIndex_V7(param_1,lVar6,&local_48,1);

+    if (uVar3 == 0xffff) goto LAB_0;

+    uVar12 = (ulonglong)*(ushort *)(param_1 + 0x12);

+    puVar11 = (uint *)((ulonglong)*(uint *)(param_1 + 0x2c) +

+                      ((ulonglong)uVar3 * (ulonglong)*(byte *)(param_1 + 0x34) - uVar12) + param_1);

+    uVar8 = CONCAT71((int7)((ulonglong)lVar6 >> 8),*(byte *)(param_1 + 2)) & 0xffffffffffffff10;

+    bVar5 = *(byte *)(param_1 + 2) & 8;

+    uVar9 = (undefined7)(uVar8 >> 8);

+    cVar2 = (char)uVar8;

+    if ((*(byte *)(param_1 + 0x35) & 4) == 0) {

+      uVar4 = ApiSetpGetSearchKeyHash

+                        (&local_48,CONCAT71(uVar9,1),bVar5 != 0,cVar2 != '\0',

+                         *(undefined1 *)(param_1 + 0x37));

+    }

+    else {

+      bVar5 = ApiSetpGetSearchKeyHash

+                        (&local_48,CONCAT71(uVar9,1),bVar5 != 0,cVar2 != '\0',

+                         *(undefined1 *)(param_1 + 0x37));

+      uVar4 = (uint)bVar5;

+    }

+    if (*puVar11 != uVar4) goto LAB_0;

+    bVar5 = *(byte *)((longlong)puVar11 + 10);

+    uVar3 = (ushort)puVar11[1];

+  }

+  else if (uStack_40._4_4_ == 2) {

+    uVar10 = 1;

+    uVar3 = ApiSetpSearchForSectionIndex_V7(param_1,param_1 + 0x38,&local_48,0);

+    if (uVar3 == 0xffff) goto LAB_0;

+    puVar11 = (uint *)((ulonglong)*(uint *)(param_1 + 0x38) +

+                      param_1 + ((ulonglong)*(byte *)(param_1 + 0x40) * (ulonglong)uVar3 -

+                                (ulonglong)*(ushort *)(param_1 + 0x12)));

+    bVar7 = *(byte *)(param_1 + 2) & 0x10;

+    bVar5 = *(byte *)(param_1 + 2) & 8;

+    if ((*(byte *)(param_1 + 0x41) & 4) == 0) {

+      uVar4 = ApiSetpGetSearchKeyHash

+                        (&local_48,0,bVar5 != 0,bVar7 != 0,*(undefined1 *)(param_1 + 0x43));

+    }

+    else {

+      bVar5 = ApiSetpGetSearchKeyHash

+                        (&local_48,0,bVar5 != 0,bVar7 != 0,*(undefined1 *)(param_1 + 0x43));

+      uVar4 = (uint)bVar5;

+    }

+    if (*puVar11 != uVar4) {

+      uVar10 = 0;

+      goto LAB_0;

+    }

+    if (((*(byte *)((longlong)puVar11 + 6) & 4) != 0) &&

+       (((*(byte *)((longlong)puVar11 + 6) & 2) != 0 ||

+        ((puVar11[2] != 0 && (cVar2 = ApiSetpIsFeatureEnabled(), cVar2 == '\0'))))))

+    goto LAB_0;

+    uVar12 = (ulonglong)*(ushort *)(param_1 + 0x12);

+    lVar6 = ((ulonglong)(ushort)puVar11[1] * (ulonglong)*(byte *)(param_1 + 0x34) +

+            (ulonglong)*(uint *)(param_1 + 0x2c)) - (ulonglong)*(ushort *)(param_1 + 0x12);

+    bVar5 = *(byte *)(lVar6 + 10 + param_1);

+    uVar3 = *(ushort *)(lVar6 + 4 + param_1);

+  }

+  else {

+    if (uStack_40._4_4_ != 3) goto LAB_0;

+    uVar3 = ApiSetpSearchForSectionIndex_V7(param_1,param_1 + 0x44,&local_48,0);

+    if (uVar3 == 0xffff) goto LAB_0;

+    uVar12 = (ulonglong)*(ushort *)(param_1 + 0x12);

+    puVar11 = (uint *)((ulonglong)*(uint *)(param_1 + 0x44) +

+                      ((ulonglong)uVar3 * (ulonglong)*(byte *)(param_1 + 0x4c) - uVar12) + param_1);

+    bVar7 = *(byte *)(param_1 + 2) & 0x10;

+    bVar5 = *(byte *)(param_1 + 2) & 8;

+    if ((*(byte *)(param_1 + 0x4d) & 4) == 0) {

+      uVar4 = ApiSetpGetSearchKeyHash

+                        (&local_48,0,bVar5 != 0,bVar7 != 0,*(undefined1 *)(param_1 + 0x4f));

+    }

+    else {

+      bVar5 = ApiSetpGetSearchKeyHash

+                        (&local_48,0,bVar5 != 0,bVar7 != 0,*(undefined1 *)(param_1 + 0x4f));

+      uVar4 = (uint)bVar5;

+    }

+    if ((*puVar11 != uVar4) ||

+       (((*(byte *)((longlong)puVar11 + 10) & 4) != 0 &&

+        (*(byte *)((longlong)puVar11 + 9) < (ushort)uStack_30)))) goto LAB_0;

+    lVar6 = ((ulonglong)(ushort)puVar11[1] * (ulonglong)*(byte *)(param_1 + 0x34) +

+            (ulonglong)*(uint *)(param_1 + 0x2c)) - uVar12;

+    bVar5 = *(byte *)(lVar6 + 10 + param_1);

+    uVar3 = *(ushort *)(lVar6 + 4 + param_1);

+  }

+  uVar10 = 1;

+  if (((bVar5 >> 1 & 1) != 0) &&

+     (lVar6 = ((ulonglong)*(byte *)(param_1 + 100) * (ulonglong)uVar3 +

+              (ulonglong)*(uint *)(param_1 + 0x5c)) - uVar12,

+     *(byte *)(lVar6 + 10 + param_1) <= *(byte *)(param_1 + 3))) {

+    *(ulonglong *)(param_7 + 4) =

+         (((ulonglong)*(uint *)(lVar6 + 4 + param_1) + (ulonglong)*(uint *)(param_1 + 0x24)) -

+         uVar12) + param_1;

+    sVar1 = *(short *)(lVar6 + 8 + param_1) * 2;

+    *param_7 = sVar1;

+    param_7[1] = sVar1;

+  }

+LAB_0:

+  *param_6 = uVar10;

+  return 0;

 }
```

## `IsHandleEntryAccessibleForIL`  (modified)

```diff
--- IsHandleEntryAccessibleForIL
+++ tagPROCESSINFO::tagPROCESSINFO
@@ -1,49 +1,53 @@
 

-/* int __cdecl IsHandleEntryAccessibleForIL(struct _HANDLEENTRY * __ptr64) */

+/* public: __cdecl tagPROCESSINFO::tagPROCESSINFO(struct _EPROCESS * __ptr64) __ptr64 */

 

-int __cdecl IsHandleEntryAccessibleForIL(_HANDLEENTRY *param_1)

+tagPROCESSINFO * __thiscall tagPROCESSINFO::tagPROCESSINFO(tagPROCESSINFO *this,_EPROCESS *param_1)

 

 {

-  _HANDLEENTRY _Var1;

-  bool bVar2;

-  longlong lVar3;

-  longlong *plVar4;

-  longlong lVar5;

-  ulonglong uVar6;

-  longlong *plVar7;

+  tagPROCESSINFO *ptVar1;

+  uint uVar2;

+  undefined4 uVar3;

+  longlong local_res8;

+  tagPROCESSINFO *local_res10;

   

-  lVar3 = W32GetUserSessionState();

-  lVar5 = *(longlong *)(lVar3 + 0x4e08);

-  uVar6 = (longlong)param_1 - *(longlong *)(lVar3 + 0x4e40) >> 5 & 0xffffffff;

-  plVar4 = (longlong *)PsGetCurrentProcessWin32Process();

-  if (((plVar4 == (longlong *)0x0) || (*plVar4 != 0)) && (plVar4 != (longlong *)0x0)) {

-    plVar7 = (longlong *)0x0;

-    if ((*(ushort *)(&DAT_0 + (ulonglong)(byte)param_1[0x18] * 0x18) & 2) == 0) {

-      if (((*(ushort *)(&DAT_0 + (ulonglong)(byte)param_1[0x18] * 0x18) & 1) != 0) &&

-         (lVar5 = *(longlong *)(lVar5 + 8 + uVar6 * 0x28), lVar5 != 0)) {

-        plVar7 = *(longlong **)(lVar5 + 0x1d0);

-      }

-    }

-    else {

-      plVar7 = *(longlong **)(lVar5 + 8 + uVar6 * 0x28);

-    }

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

-        (lVar5 = W32GetUserGdiSessionState(), *plVar7 != *(longlong *)(lVar5 + 0x28))) &&

-       (bVar2 = UIPrivilegeIsolation::CheckAccess

-                          ((tagUIPI_INFO *)(plVar4 + 0x26),(tagUIPI_INFO *)(plVar7 + 0x26),0),

-       !bVar2)) {

-      _Var1 = param_1[0x18];

-      lVar5 = W32GetUserSessionState();

-      EtwTraceUIPIHandleValidationError

-                (plVar4,plVar7,

-                 **(undefined8 **)

-                   (*(longlong *)(lVar5 + 0x4e08) +

-                   ((longlong)param_1 - *(longlong *)(lVar5 + 0x4e40) >> 5 & 0xffffffffU) * 0x28),

-                 _Var1);

-      UserSetLastError(5);

-      return 0;

-    }

+  local_res8 = 0;

+  *(undefined8 *)(this + 0x480) = 0;

+  *(undefined2 *)(this + 0x488) = 0;

+  *(undefined8 *)(this + 0x4a8) = 0;

+  *(undefined8 *)(this + 0x4b8) = 0;

+  *(undefined4 *)(this + 0x48c) = 5;

+  *(undefined4 *)(this + 0x4a0) = 1;

+  this[0x4b0] = (tagPROCESSINFO)0x0;

+  ptVar1 = this + 0x410;

+  *(tagPROCESSINFO **)(this + 0x418) = ptVar1;

+  *(tagPROCESSINFO **)ptVar1 = ptVar1;

+  ptVar1 = this + 0x490;

+  *(tagPROCESSINFO **)(this + 0x498) = ptVar1;

+  *(tagPROCESSINFO **)ptVar1 = ptVar1;

+  ptVar1 = this + 0x460;

+  *(tagPROCESSINFO **)(this + 0x468) = ptVar1;

+  *(tagPROCESSINFO **)ptVar1 = ptVar1;

+  ptVar1 = this + 0x470;

+  *(tagPROCESSINFO **)(this + 0x478) = ptVar1;

+  *(tagPROCESSINFO **)ptVar1 = ptVar1;

+  ptVar1 = this + 0x448;

+  *(tagPROCESSINFO **)(this + 0x450) = ptVar1;

+  *(tagPROCESSINFO **)ptVar1 = ptVar1;

+  SystemPrng(&local_res8,8);

+  if (local_res8 == 0) {

+    local_res8 = 1;

   }

-  return 1;

+  *(longlong *)(this + 0x118) = local_res8;

+  GdiPreUserProcessCallout(this,1);

+  *(_EPROCESS **)this = param_1;

+  uVar2 = PsGetProcessId(param_1);

+  *(undefined4 *)(this + 0x130) = 0xffffffff;

+  *(undefined4 *)(this + 0x134) = 0;

+  *(undefined4 *)(this + 0x138) = 0;

+  *(uint *)(this + 0x38) = uVar2 & 0xfffffffc;

+  local_res10 = this;

+  uVar3 = PsGetProcessSessionIdEx(param_1);

+  W32ExecuteUsingSessionGlobal<<lambda_89689e9a6337494d9eadd66ceb53b672>_>(uVar3,&local_res10);

+  return this;

 }
```

## `NtUserGetKeyboardState`  (modified)

```diff
--- NtUserGetKeyboardState
+++ NtUserGetKeyboardState
@@ -1,11 +1,98 @@
 

-void NtUserGetKeyboardState(void)

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

+

+undefined8 NtUserGetKeyboardState(byte *param_1)

 

 {

-  code *pcVar1;

+  undefined8 uVar1;

+  undefined4 uVar2;

+  code *pcVar3;

+  bool bVar4;

+  byte bVar5;

+  char cVar6;

+  int iVar7;

+  int iVar8;

+  uint uVar9;

+  ulonglong *puVar10;

+  longlong lVar11;

+  ulonglong uVar12;

+  byte *pbVar13;

+  byte *pbVar14;

+  ulonglong uVar15;

+  byte *local_res8;

+  EnterLeaveCritShared local_50 [24];

+  undefined8 local_38;

+  undefined4 local_30;

   

-  pcVar1 = (code *)swi(3);

-  (*pcVar1)();

-  return;

+                    /* 0x167090  1984  NtUserGetKeyboardState */

+  bVar4 = true;

+  uVar15 = 0;

+  EnterLeaveCritShared::EnterLeaveCritShared(local_50,1);

+  puVar10 = (ulonglong *)PsGetCurrentThreadWin32Thread();

+  uVar12 = uVar15;

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

+    uVar12 = *puVar10;

+  }

+  iVar8 = 0;

+  lVar11 = W32GetWin32kBaseApiSetTable();

+  pcVar3 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x2b0);

+  if ((pcVar3 == (code *)0x0) || (iVar7 = (*pcVar3)(), iVar7 < 0)) {

+LAB_0:

+    if (iVar8 == 0) goto LAB_1;

+  }

+  else {

+    lVar11 = W32GetWin32kBaseApiSetTable();

+    pcVar3 = *(code **)(*(longlong *)(lVar11 + 0x30) + 0x2b8);

+    if (pcVar3 != (code *)0x0) {

+      iVar8 = (*pcVar3)();

+      goto LAB_0;

+    }

+LAB_1:

+    iVar8 = ApiSetEditionIsGpqForegroundAccessibleCurrent(1);

+    if (iVar8 != 0) goto LAB_2;

+    lVar11 = W32GetUserSessionState();

+    uVar1 = **(undefined8 **)(lVar11 + 0x4a50);

+    uVar2 = *(undefined4 *)(*(undefined8 **)(lVar11 + 0x4a50) + 1);

+    lVar11 = W32GetUserSessionState();

+    local_38 = uVar1;

+    local_30 = uVar2;

+    EtwTraceUIPIInputError(uVar12,0,*(undefined8 *)(lVar11 + 0x4a50),&local_38,3);

+  }

+  bVar4 = false;

+LAB_2:

+  pbVar13 = *(byte **)MmUserProbeAddress_exref;

+  pbVar14 = param_1;

+  if (pbVar13 <= param_1) {

+    pbVar14 = pbVar13;

+  }

+  *pbVar14 = *pbVar14;

+  pbVar14[0xff] = pbVar14[0xff];

+  puVar10 = (ulonglong *)PsGetCurrentThreadWin32Thread();

+  uVar12 = uVar15;

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

+    uVar12 = *puVar10;

+  }

+  lVar11 = *(longlong *)(uVar12 + 0x1d8);

+  uVar12 = (ulonglong)pbVar13 & 0xffffffffffffff00;

+  local_res8 = param_1;

+  while ((int)uVar15 < 0x100) {

+    *local_res8 = 0;

+    if ((bVar4) || (cVar6 = IsKeyStateCached(), cVar6 != '\0')) {

+      bVar5 = (byte)uVar15 & 3;

+      uVar12 = (ulonglong)((uint)(uVar15 >> 2) & 0x3f);

+      if ((*(byte *)(lVar11 + 0x178 + uVar12) & (byte)(1 << bVar5 * '\x02')) != 0) {

+        *local_res8 = *local_res8 | 0x80;

+      }

+      if ((*(byte *)(lVar11 + 0x178 + uVar12) & (byte)(1 << bVar5 * '\x02' + 1)) != 0) {

+        *local_res8 = *local_res8 | 1;

+      }

+    }

+    uVar9 = (int)uVar15 + 1;

+    local_res8 = local_res8 + 1;

+    uVar12 = (ulonglong)uVar9 & 0xff;

+    uVar15 = (ulonglong)uVar9;

+  }

+  ReleaseUserCriticalSection(uVar12);

+  return 1;

 }
```

## `UserIsCurrentProcessImmersiveAppContainer`  (modified)

```diff
--- UserIsCurrentProcessImmersiveAppContainer
+++ UserIsCurrentProcessImmersiveAppContainer
@@ -1,14 +1,12 @@
 

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

-

-void UserIsCurrentProcessImmersiveAppContainer(longlong param_1)

+void UserIsCurrentProcessImmersiveAppContainer(void)

 

 {

-  char in_AL;

+  undefined8 uVar1;

   

-  *(int *)(param_1 + -0x77) = *(int *)(param_1 + -0x77) + -1;

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

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

-  halt_baddata();

+                    /* 0xc3010  2284  UserIsCurrentProcessImmersiveAppContainer */

+  uVar1 = PsGetCurrentProcess();

+  UserIsProcessImmersiveAppContainer(uVar1);

+  return;

 }
```

## `xxxInitProcessInfo`  (modified)

```diff
--- xxxInitProcessInfo
+++ xxxInitProcessInfo
@@ -1,77 +1,333 @@
 

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

 /* 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 */

 

-undefined4 xxxInitProcessInfo(void)

+int xxxInitProcessInfo(_W32PROCESS *param_1,void *param_2,_PROCESS_IMMERSIVE_TYPE param_3,

+                      ulong param_4,_PS_PKG_CLAIM *param_5)

 

 {

-  uint *puVar1;

-  byte bVar2;

-  byte bVar3;

-  undefined2 uVar4;

-  undefined8 uVar5;

-  code *pcVar6;

-  undefined1 uVar7;

-  int iVar8;

-  longlong in_RAX;

-  longlong lVar9;

-  longlong lVar10;

-  undefined4 unaff_R12D;

-  int unaff_R13D;

+  undefined4 uVar1;

+  undefined4 uVar2;

+  undefined4 uVar3;

+  undefined4 uVar4;

+  code *pcVar5;

+  ulonglong uVar6;

+  undefined1 auVar7 [16];

+  void *pvVar8;

+  byte bVar9;

+  long lVar10;

+  int iVar11;

+  int iVar12;

+  ulong uVar13;

+  longlong lVar14;

+  ulonglong *puVar15;

+  ulonglong uVar16;

+  ulonglong uVar17;

+  undefined8 uVar18;

+  char cVar19;

+  bool bVar20;

+  undefined1 auStack_108 [32];

+  undefined1 local_e8;

+  undefined4 local_e0;

+  undefined2 local_d8;

+  undefined *local_d0;

+  undefined8 local_c8;

+  undefined4 local_c0;

+  undefined4 local_b8;

+  undefined4 local_b0;

+  char local_a8;

+  CWinEventNoopDeferral local_a7 [3];

+  int local_a4;

+  AtomicExecutionCheck local_a0 [8];

+  longlong local_98;

+  int local_90;

+  undefined4 local_8c;

+  longlong *local_88;

+  _PROCESS_IMMERSIVE_TYPE local_80;

+  void *local_78;

+  _PS_PKG_CLAIM *local_70;

+  _W32PROCESS *local_68;

+  undefined8 local_58;

+  int local_50;

+  ulonglong local_48;

   

-  uVar5 = *(undefined8 *)((ulonglong)*(uint *)(in_RAX + 0xdf10) + 0x80);

-  lVar9 = W32GetUserSessionState();

-  for (lVar9 = *(longlong *)(lVar9 + 0xf8a8); lVar9 != 0; lVar9 = *(longlong *)(lVar9 + 8)) {

-    for (lVar10 = *(longlong *)(lVar9 + 0x10); lVar10 != 0; lVar10 = *(longlong *)(lVar10 + 0x20)) {

-      *(undefined8 *)(*(longlong *)(*(longlong *)(*(longlong *)(lVar10 + 8) + 0x18) + 0x28) + 0xa8)

-           = uVar5;

-    }

-  }

-  lVar9 = W32GetUserSessionState();

-  uVar7 = GreGetDeviceCaps(*(undefined8 *)(*(longlong *)(lVar9 + 0xdf10) + 0x40),0xe);

-  lVar9 = W32GetUserSessionState();

-  *(undefined1 *)(*(longlong *)(lVar9 + 0x4e30) + 0x1b5a) = uVar7;

-  lVar9 = W32GetUserSessionState();

-  uVar7 = GreGetDeviceCaps(*(undefined8 *)(*(longlong *)(lVar9 + 0xdf10) + 0x40),0xc);

-  lVar9 = W32GetUserSessionState();

-  *(undefined1 *)(*(longlong *)(lVar9 + 0x4e30) + 0x1b5b) = uVar7;

-  lVar9 = W32GetUserSessionState();

-  lVar9 = *(longlong *)(lVar9 + 0x4e30);

-  lVar10 = W32GetUserSessionState();

-  bVar2 = *(byte *)(lVar9 + 0x1b5a);

-  bVar3 = *(byte *)(*(longlong *)(lVar10 + 0x4e30) + 0x1b5b);

-  lVar9 = W32GetUserSessionState();

-  *(ushort *)(*(longlong *)(lVar9 + 0x4e30) + 0x1b54) = (ushort)bVar3 * (ushort)bVar2;

-  lVar9 = W32GetUserSessionState();

-  uVar4 = *(undefined2 *)(*(longlong *)(lVar9 + 0x4e30) + 0x1b54);

-  lVar9 = W32GetUserSessionState();

-  *(undefined2 *)(*(longlong *)(lVar9 + 0xdf10) + 0x88) = uVar4;

-  lVar9 = W32GetUserSessionState();

-  if (unaff_R13D == 0) {

-    puVar1 = (uint *)(*(longlong *)(lVar9 + 0x4e30) + 0x1b5c);

-    *puVar1 = *puVar1 & 0xfffffffe;

+  local_48 = __security_cookie ^ (ulonglong)auStack_108;

+  local_70 = param_5;

+  uVar17 = 0;

+  local_90 = 0;

+  local_58 = 0;

+  local_50 = 0;

+  local_88 = (longlong *)0x0;

+  local_8c = 0;

+  cVar19 = '\x01';

+  if (param_1[0x4b0] == (_W32PROCESS)0x1) {

+    return 0x4000001b;

+  }

+  local_80 = param_3;

+  local_78 = param_2;

+  local_68 = param_1;

+  if (DAT_0 < '\0') {

+    McTemplateK0_EtwWriteTransfer(param_1,&InitiateGuiProcessExecution,&W32kControlGuid);

+  }

+  lVar10 = xxxCheckProcessAndSessionState(param_1);

+  if (lVar10 < 0) {

+    return lVar10;

+  }

+  AtomicExecutionCheck::AtomicExecutionCheck(local_a0);

+  param_1[0x4b0] = (_W32PROCESS)0x1;

+  *(undefined8 *)(param_1 + 0x140) = 0;

+  *(undefined8 *)(param_1 + 0x148) = 0;

+  *(undefined4 *)(param_1 + 0x150) = 0;

+  *(undefined4 *)(param_1 + 0x2b4) = 3;

+  *(undefined4 *)(param_1 + 0x2b8) = 3;

+  iVar11 = Feature_UIPIModernization__private_IsEnabledDeviceUsageNoInline();

+  if (iVar11 == 0) {

+    local_58 = CONCAT44(param_4,(int)local_58);

+    iVar11 = SeQueryInformationToken(param_2,0x19,&local_58);

+    if (-1 < iVar11) {

+      if ((local_58._4_4_ != 0) && ((int)local_58 != 0x1000)) {

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

+           ((-1 < (char)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c) ||

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

+          cVar19 = '\0';

+        }

+        bVar20 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+        if ((cVar19 != '\0') || (bVar20)) {

+          uVar4 = *(undefined4 *)(param_1 + 0x38);

+          lVar14 = W32GetUserSessionState();

+          local_c8 = CONCAT44(local_c8._4_4_,uVar4);

+          local_d0 = &WPP_e6f73e3fe92236b6e2f1b35bfc876ef9_Traceguids;

+          local_d8 = 0x19;

+          local_e0 = 8;

+          local_e8 = 3;

+          WPP_RECORDER_AND_TRACE_SF_D

+                    (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar19,bVar20,

+                     *(undefined8 *)(lVar14 + 0x10f88));

+        }

+        if (local_a0[0] != (AtomicExecutionCheck)0x0) {

+          *(int *)(local_98 + 0x1c) = *(int *)(local_98 + 0x1c) + -1;

+        }

+        return -0x3fffffff;

+      }

+      iVar11 = PsIsProtectedProcess(*(undefined8 *)param_1);

+      if (iVar11 != 0) {

+        bVar9 = PsGetProcessProtection(*(undefined8 *)param_1);

+        local_50 = ((bVar9 >> 3 & 1 | (bVar9 & 7) << 8) << 8 | (uint)(bVar9 >> 4)) << 8;

+      }

+      if (*(int *)(param_1 + 0x130) != -1) {

+        if (local_a0[0] != (AtomicExecutionCheck)0x0) {

+          *(int *)(local_98 + 0x1c) = *(int *)(local_98 + 0x1c) + -1;

+        }

+        return -0x3fff5ffd;

+      }

+      *(undefined8 *)(param_1 + 0x130) = local_58;

+      *(int *)(param_1 + 0x138) = local_50;

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

+          (-1 < (char)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c))) ||

+         (local_a8 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 4)) {

+        local_a8 = '\0';

+      }

+      local_a7[0] = (CWinEventNoopDeferral)

+                    ((undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED);

+      if ((local_a8 != '\0') || (param_2 = local_78, (bool)local_a7[0])) {

+        uVar4 = *(undefined4 *)(param_1 + 0x138);

+        uVar1 = *(undefined4 *)(param_1 + 0x134);

+        uVar2 = *(undefined4 *)(param_1 + 0x130);

+        uVar3 = *(undefined4 *)(param_1 + 0x38);

+        lVar14 = W32GetUserSessionState();

+        local_c8 = CONCAT44(local_c8._4_4_,uVar3);

+        local_d0 = &WPP_e6f73e3fe92236b6e2f1b35bfc876ef9_Traceguids;

+        local_d8 = 0x1a;

+        local_e0 = 8;

+        local_c0 = uVar2;

+        local_b8 = uVar1;

+        local_b0 = uVar4;

+        WPP_RECORDER_AND_TRACE_SF_DDDD

+                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),local_a8,local_a7[0],

+                   *(undefined8 *)(lVar14 + 0x10f88));

+        param_2 = local_78;

+      }

+      goto LAB_1;

+    }

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

+        (-1 < (char)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c))) ||

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

+      cVar19 = '\0';

+    }

+    bVar20 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+    if ((cVar19 == '\0') && (!bVar20)) goto LAB_2;

+    uVar4 = *(undefined4 *)(param_1 + 0x38);

+    lVar14 = W32GetUserSessionState();

+    uVar18 = *(undefined8 *)(lVar14 + 0x10f88);

+    local_c8 = CONCAT44(local_c8._4_4_,iVar11);

+    local_d8 = 0x18;

+    local_c0 = uVar4;

   }

   else {

-    puVar1 = (uint *)(*(longlong *)(lVar9 + 0x4e30) + 0x1b5c);

-    *puVar1 = *puVar1 | 1;

-  }

-  EnforceColorDependentSettings();

-  lVar9 = W32GetWin32kBaseApiSetTable();

-  pcVar6 = *(code **)(*(longlong *)(lVar9 + 0x30) + 0x1d80);

-  if (pcVar6 != (code *)0x0) {

-    iVar8 = (*pcVar6)();

-    if (-1 < iVar8) {

-      lVar9 = W32GetWin32kBaseApiSetTable();

-      pcVar6 = *(code **)(*(longlong *)(lVar9 + 0x30) + 0x1d88);

-      iVar8 = 0;

-      if (pcVar6 != (code *)0x0) {

-        iVar8 = (*pcVar6)();

-      }

-      if (iVar8 == 0) {

-        unaff_R12D = 0xc0000017;

-      }

-    }

-  }

-  return unaff_R12D;

+    lVar10 = tagPROCESSINFO::InitProcessUipiInfo((tagPROCESSINFO *)param_1,param_2,param_4);

+    if (lVar10 < 0) {

+      if (local_a0[0] == (AtomicExecutionCheck)0x0) {

+        return lVar10;

+      }

+      *(int *)(local_98 + 0x1c) = *(int *)(local_98 + 0x1c) + -1;

+      return lVar10;

+    }

+LAB_1:

+    local_a4 = SeQueryInformationToken(param_2,0x1a,&local_90);

+    if (local_90 != 0) {

+      *(uint *)(param_1 + 0xc) = *(uint *)(param_1 + 0xc) | 0x80080000;

+      *(ulonglong *)(param_1 + 0x330) = *(ulonglong *)(param_1 + 0x330) | 2;

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

+          (-1 < (char)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c))) ||

+         (local_a8 = '\x01', (byte)WPP_GLOBAL_Control[0x29] < 4)) {

+        local_a8 = '\0';

+      }

+      local_a7[0] = (CWinEventNoopDeferral)

+                    ((undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED);

+      if ((local_a8 != '\0') || ((bool)local_a7[0])) {

+        uVar4 = *(undefined4 *)(param_1 + 0x38);

+        uVar18 = *(undefined8 *)param_1;

+        lVar14 = W32GetUserSessionState();

+        local_d0 = &WPP_e6f73e3fe92236b6e2f1b35bfc876ef9_Traceguids;

+        local_d8 = 0x1b;

+        local_e0 = 8;

+        local_c8 = uVar18;

+        local_c0 = uVar4;

+        WPP_RECORDER_AND_TRACE_SF_qD

+                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),local_a8,local_a7[0],

+                   *(undefined8 *)(lVar14 + 0x10f88));

+      }

+    }

+    pvVar8 = local_78;

+    iVar11 = local_a4;

+    SetProcessType((tagPROCESSINFO *)param_1,local_78,local_80,local_70);

+    SetProcessInitialCapabilities((tagPROCESSINFO *)param_1);

+    if ((-1 < iVar11) &&

+       (iVar11 = SeQueryInformationToken(pvVar8,0x1f,&local_88), local_a4 = iVar11, -1 < iVar11)) {

+      if ((*local_88 == 0) || (iVar12 = RtlGetAppContainerSidType(*local_88,&local_8c), iVar12 < 0))

+      {

+        *(undefined4 *)(param_1 + 0x368) = 0;

+      }

+      else {

+        *(undefined4 *)(param_1 + 0x368) = local_8c;

+      }

+      ExFreePoolWithTag(local_88,0);

+      local_88 = (longlong *)0x0;

+      if (-1 < iVar11) {

+        uVar13 = GetSpriteFillColorOverrideForCurrentProcess();

+        *(ulong *)(param_1 + 0x434) = uVar13;

+        lVar14 = PsGetProcessWow64Process(*(undefined8 *)param_1);

+        if (lVar14 != 0) {

+          *(uint *)(param_1 + 0xc) = *(uint *)(param_1 + 0xc) | 0x80;

+        }

+        *(undefined8 *)(param_1 + 0x378) = 0xffffffffffffffff;

+        *(undefined8 *)(param_1 + 0x380) = 0xffffffffffffffff;

+        if ((*(uint *)(param_1 + 0xc) & 0x20) == 0) {

+          *(uint *)(param_1 + 0xc) = *(uint *)(param_1 + 0xc) | 0x20;

+          lVar14 = W32GetUserSessionState();

+          *(uint *)(lVar14 + 0x10650) = *(uint *)(lVar14 + 0x10650) | 0x8000000;

+          iVar12 = Feature_StartGlassModern__private_IsEnabledDeviceUsageNoInline();

+          *(uint *)(param_1 + 0xc) = *(uint *)(param_1 + 0xc) | 2;

+          if ((iVar12 == 0) && (iVar12 = IszzzCalcStartCursorHideSupported(), -1 < iVar12)) {

+            CWinEventNoopDeferral::CWinEventNoopDeferral(local_a7);

+            zzzCalcStartCursorHide(0,0);

+            CWinEventNoopDeferral::~CWinEventNoopDeferral(local_a7);

+          }

+        }

+        lVar14 = W32GetUserSessionState();

+        *(undefined8 *)(param_1 + 0x180) = *(undefined8 *)(lVar14 + 0x8ea8);

+        lVar14 = W32GetUserSessionState();

+        *(_W32PROCESS **)(lVar14 + 0x8ea8) = param_1;

+        lVar14 = W32GetWin32kBaseApiSetTable();

+        pcVar5 = *(code **)(*(longlong *)(lVar14 + 0x30) + 0x1448);

+        if (pcVar5 != (code *)0x0) {

+          (*pcVar5)(param_1);

+        }

+        GetProcessLuid(0,param_1 + 0x308);

+        lVar14 = W32GetUserSessionState();

+        *(undefined4 *)(param_1 + 0x198) = *(undefined4 *)(lVar14 + 0xa204);

+        *(undefined4 *)(param_1 + 0x300) = 0;

+        CitProcessCallout(param_1,1);

+        uVar6 = *(ulonglong *)(param_1 + 0x330);

+        uVar16 = uVar6 & 0xffffffffffbe7fff;

+        *(ulonglong *)(param_1 + 0x330) = uVar16;

+        *(undefined4 *)(param_1 + 0x10c) = 0x6010;

+        *(undefined2 *)(param_1 + 0x110) = 0x60;

+        if (((byte)uVar6 & 0x30) == 0x20) {

+          *(ulonglong *)(param_1 + 0x330) = uVar16 | 0x100000;

+          iVar12 = Feature_UserModeMenus__private_IsEnabledDeviceUsageNoInline();

+          if ((iVar12 != 0) &&

+             (puVar15 = (ulonglong *)GetClientProcessInfo(param_1), puVar15 != (ulonglong *)0x0)) {

+            *puVar15 = *puVar15 | 1;

+          }

+        }

+        iVar12 = PsGetWin32KFilterSet();

+        if (iVar12 == 5) {

+          uVar17 = 0x1000000;

+        }

+        *(ulonglong *)(param_1 + 0x330) =

+             uVar17 | *(ulonglong *)(param_1 + 0x330) & 0xfffffffff6ffffff;

+        lVar14 = W32GetUserSessionState();

+        if (*(short *)(*(longlong *)(lVar14 + 0x4e30) + 0x1b56) != 0) {

+          lVar14 = W32GetWin32kBaseApiSetTable();

+          pcVar5 = *(code **)(*(longlong *)(lVar14 + 0x30) + 1000);

+          if (pcVar5 == (code *)0x0) {

+            iVar12 = -0x3fffff45;

+          }

+          else {

+            iVar12 = (*pcVar5)();

+          }

+          if (iVar12 < 0) {

+            lVar14 = W32GetUserSessionState();

+            *(undefined2 *)(param_1 + 0x110) =

+                 *(undefined2 *)(*(longlong *)(lVar14 + 0x4e30) + 0x1b56);

+          }

+          else {

+            lVar14 = W32GetWin32kBaseApiSetTable();

+            pcVar5 = *(code **)(*(longlong *)(lVar14 + 0x30) + 0x3f0);

+            if (pcVar5 != (code *)0x0) {

+              (*pcVar5)(param_1);

+            }

+          }

+        }

+        Feature_WebThreatDefenseToggle__private_IsEnabledPreCheck();

+        lVar14 = W32GetUserSessionState();

+        iVar12 = 0;

+        if ((*(int *)(lVar14 + 0xa6d8) != 0) &&

+           (lVar14 = W32GetInputMonitorSessionState(), iVar12 = 1, lVar14 == 0)) {

+          MicrosoftTelemetryAssertTriggeredNoArgsKM();

+        }

+        *(uint *)(param_1 + 0x114) = iVar12 * 4 | *(uint *)(param_1 + 0x114) & 0xfffffffb;

+        auVar7._8_8_ = 0;

+        auVar7._0_8_ = _DAT_3 << 8;

+        *(longlong *)(param_1 + 0x440) = SUB168(auVar7 * (ZEXT416(_DAT_4) << 0x20),8)

+        ;

+        goto LAB_2;

+      }

+    }

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

+        (-1 < (char)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c))) ||

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

+      cVar19 = '\0';

+    }

+    bVar20 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+    if ((cVar19 == '\0') && (!bVar20)) goto LAB_2;

+    uVar4 = *(undefined4 *)(param_1 + 0x38);

+    lVar14 = W32GetUserSessionState();

+    uVar18 = *(undefined8 *)(lVar14 + 0x10f88);

+    local_c8 = CONCAT44(local_c8._4_4_,iVar11);

+    local_d8 = 0x1c;

+    local_c0 = uVar4;

+  }

+  local_d0 = &WPP_e6f73e3fe92236b6e2f1b35bfc876ef9_Traceguids;

+  local_e0 = 8;

+  local_e8 = 3;

+  WPP_RECORDER_AND_TRACE_SF_dD(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar19,bVar20,uVar18);

+LAB_2:

+  if (local_a0[0] != (AtomicExecutionCheck)0x0) {

+    *(int *)(local_98 + 0x1c) = *(int *)(local_98 + 0x1c) + -1;

+  }

+  return iVar11;

 }
```

## `IsSPIActionAllowedForFilteredProcess`  (modified)

```diff
--- IsSPIActionAllowedForFilteredProcess
+++ IsSPIActionAllowedForFilteredProcess
@@ -1,95 +1,275 @@
+

+/* int __cdecl IsSPIActionAllowedForFilteredProcess(unsigned int) */

 

 int __cdecl IsSPIActionAllowedForFilteredProcess(uint param_1)

 

 {

-  int *piVar1;

-  void *_Dst;

-  uint uVar2;

-  int in_EAX;

-  ulonglong _Size;

-  longlong lVar3;

-  undefined4 in_register_0000000c;

-  ulonglong unaff_RBX;

-  ulonglong uVar4;

-  ulonglong unaff_RDI;

-  void *unaff_R12;

-  undefined **unaff_R13;

-  longlong unaff_R14;

-  int unaff_R15D;

-  bool bVar5;

-  int iStack0000000000000038;

-  longlong in_stack_00000050;

-  int in_stack_000000a8;

-  uint in_stack_000000b8;

+  int iVar1;

+  bool bVar2;

   

-  piVar1 = (int *)(unaff_RBX + CONCAT44(in_register_0000000c,param_1) * 4 + -8);

-  *piVar1 = *piVar1 + 1;

-  if (-1 < in_EAX) {

-    uVar4 = in_stack_00000050 + 0x48;

-    if (in_stack_00000050 == 0) {

-      uVar4 = unaff_RBX;

-    }

-    if ((*(uint *)(uVar4 + 0xa8) & 0x2000) == 0) {

-      unaff_R15D = -0x3ffffff3;

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

-          ((byte)((byte)unaff_RDI & (byte)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c)) == 0)) ||

-         (uVar4 = unaff_RDI, (byte)WPP_GLOBAL_Control[0x29] < 3)) {

-        uVar4 = unaff_RBX;

-      }

-      bVar5 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-      if (((char)uVar4 != '\0') || (bVar5)) {

-        lVar3 = W32GetUserSessionState();

-        WPP_RECORDER_AND_TRACE_SF_

-                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),uVar4 & 0xff,bVar5,

-                   *(undefined8 *)(lVar3 + 0x4c18),3);

-      }

+  if (param_1 < 0x95) {

+    if (param_1 == 0x94) {

+      return 1;

+    }

+    if (param_1 < 0x54) {

+      if (param_1 == 0x53) {

+        return 1;

+      }

+      if (param_1 < 0x31) {

+        if (param_1 == 0x30) {

+          return 1;

+        }

+        if (0x19 < param_1) {

+          if (0x2d < param_1) {

+            return 0;

+          }

+          if ((0x2a4888000000U >> ((ulonglong)param_1 & 0x3f) & 1) == 0) {

+            return 0;

+          }

+          return 1;

+        }

+        if (param_1 == 0x19) {

+          return 1;

+        }

+        if (param_1 == 1) {

+          return 1;

+        }

+        if (param_1 == 3) {

+          return 1;

+        }

+        if (param_1 == 5) {

+          return 1;

+        }

+        if (param_1 == 10) {

+          return 1;

+        }

+        iVar1 = param_1 - 0xe;

+LAB_0:

+        if (iVar1 == 0) {

+          return 1;

+        }

+        if (iVar1 == 2) {

+          return 1;

+        }

+        if (iVar1 == 4) {

+          return 1;

+        }

+        bVar2 = iVar1 == 8;

+        goto LAB_1;

+      }

+      if (param_1 < 0x41) {

+        bVar2 = (param_1 - 0x32 & 0xfffffff1) == 0;

+        goto LAB_1;

+      }

+      if (param_1 == 0x42) {

+        return 1;

+      }

+      if (param_1 == 0x44) {

+        return 1;

+      }

+      if (param_1 == 0x46) {

+        return 1;

+      }

+      if (param_1 == 0x48) {

+        return 1;

+      }

+      if (param_1 == 0x4a) {

+        return 1;

+      }

+      iVar1 = param_1 - 0x4f;

+LAB_2:

+      if (iVar1 == 0) {

+        return 1;

+      }

+      bVar2 = iVar1 == 1;

+      goto LAB_1;

+    }

+    if (0x74 < param_1) {

+      if (param_1 < 0x85) {

+        if (param_1 == 0x84) {

+          return 1;

+        }

+        iVar1 = param_1 - 0x76;

+        bVar2 = iVar1 == 0;

+      }

+      else {

+        iVar1 = param_1 - 0x86;

+        bVar2 = iVar1 == 0;

+      }

+      goto LAB_3;

+    }

+    if (param_1 == 0x74) {

+      return 1;

+    }

+    if (0x66 < param_1) {

+      if (param_1 == 0x68) {

+        return 1;

+      }

+      if (param_1 == 0x6a) {

+        return 1;

+      }

+      if (param_1 == 0x6c) {

+        return 1;

+      }

+      if (param_1 == 0x6e) {

+        return 1;

+      }

+      if (param_1 == 0x70) {

+        return 1;

+      }

+      iVar1 = param_1 - 0x72;

+      goto LAB_2;

+    }

+    if (param_1 == 0x66) {

+      return 1;

+    }

+    if (param_1 == 0x54) {

+      return 1;

+    }

+    if (param_1 == 0x59) {

+      return 1;

+    }

+    if (param_1 == 0x5c) {

+      return 1;

+    }

+    if (param_1 == 0x5e) {

+      return 1;

+    }

+    if (param_1 == 0x5f) {

+      return 1;

+    }

+    iVar1 = param_1 - 0x62;

+    bVar2 = iVar1 == 0;

+  }

+  else {

+    if (param_1 < 0x1001) {

+      if (param_1 == 0x1000) {

+        return 1;

+      }

+      if (0xa5 < param_1) {

+        if (param_1 == 0xa7) {

+          return 1;

+        }

+        iVar1 = param_1 - 0xa8;

+        bVar2 = iVar1 == 0;

+        goto LAB_4;

+      }

+      if (param_1 == 0xa5) {

+        return 1;

+      }

+      iVar1 = param_1 - 0x96;

+      bVar2 = iVar1 == 0;

+LAB_3:

+      if (bVar2) {

+        return 1;

+      }

+      iVar1 = iVar1 + -2;

+      bVar2 = iVar1 == 0;

+LAB_4:

+      if (bVar2) {

+        return 1;

+      }

+      iVar1 = iVar1 + -2;

     }

     else {

-      RIMLockExclusive(unaff_R14 + 0x2f8);

-      *(int *)(uVar4 + 0xf0) = (int)unaff_RBX;

-      lVar3 = *(longlong *)(uVar4 + 0x1b8);

-      uVar2 = (uint)*(ushort *)(lVar3 + 0x2c);

-      if (in_stack_000000b8 < *(ushort *)(lVar3 + 0x2c)) {

-        uVar2 = in_stack_000000b8;

-      }

-      _Size = (ulonglong)uVar2;

-      *(ulonglong *)(uVar4 + 0xf8) = _Size;

-      if (in_stack_000000a8 == (int)unaff_RBX) {

-        if (unaff_R12 != *(void **)(lVar3 + 0x18)) {

-          memmove(*(void **)(lVar3 + 0x18),unaff_R12,_Size);

-        }

-      }

-      else {

-        _Dst = *(void **)(lVar3 + 0x18);

-        if (((void *)(_Size + (longlong)unaff_R12) < unaff_R12) ||

-           (*(void **)MmUserProbeAddress_exref < (void *)(_Size + (longlong)unaff_R12))) {

-          **(undefined1 **)MmUserProbeAddress_exref = (char)unaff_RBX;

-        }

-        RtlCopyVolatileMemory(_Dst,unaff_R12,_Size);

-      }

-      if (-1 < unaff_R15D) {

-        rimProcessDeviceBufferAndStartRead();

-      }

-      tagObjLock::UnLockExclusive((tagObjLock *)(unaff_R14 + 0x2f8));

-    }

-    ObfDereferenceObject(in_stack_00000050);

-    unaff_R13 = &WPP_GLOBAL_Control;

-  }

-  tagObjLock::UnLockExclusive((tagObjLock *)(unaff_R14 + 0x68));

-  ObfDereferenceObject();

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

-      ((byte)((byte)unaff_RDI & (byte)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c)) == 0)) ||

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

-    unaff_RDI = unaff_RBX;

-  }

-  bVar5 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

-  if (((char)unaff_RDI != '\0') || (bVar5)) {

-    lVar3 = W32GetUserSessionState();

-    iStack0000000000000038 = unaff_R15D;

-    WPP_RECORDER_AND_TRACE_SF_d

-              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),unaff_RDI & 0xff,bVar5,

-               *(undefined8 *)(lVar3 + 0x4c18),4);

-  }

-  return unaff_R15D;

+      if (param_1 < 0x103f) {

+        if (param_1 == 0x103e) {

+          return 1;

+        }

+        if (param_1 < 0x1017) {

+          if (param_1 == 0x1016) {

+            return 1;

+          }

+          if (param_1 == 0x1002) {

+            return 1;

+          }

+          if (param_1 == 0x1004) {

+            return 1;

+          }

+          if (param_1 == 0x1006) {

+            return 1;

+          }

+          if (param_1 == 0x1008) {

+            return 1;

+          }

+          if (param_1 == 0x100a) {

+            return 1;

+          }

+          if (param_1 == 0x100c) {

+            return 1;

+          }

+          if (param_1 == 0x100e) {

+            return 1;

+          }

+          iVar1 = param_1 - 0x1012;

+          bVar2 = iVar1 == 0;

+          goto LAB_5;

+        }

+        if (param_1 == 0x1018) {

+          return 1;

+        }

+        iVar1 = param_1 - 0x101a;

+        bVar2 = iVar1 == 0;

+        goto LAB_3;

+      }

+      if (0x200e < param_1) {

+        if (0x201c < param_1) {

+          if (param_1 == 0x201e) {

+            return 1;

+          }

+          if (param_1 == 0x2020) {

+            return 1;

+          }

+          iVar1 = param_1 - 0x2030;

+          goto LAB_0;

+        }

+        if (param_1 == 0x201c) {

+          return 1;

+        }

+        iVar1 = param_1 - 0x2010;

+        bVar2 = iVar1 == 0;

+        goto LAB_4;

+      }

+      if (param_1 == 0x200e) {

+        return 1;

+      }

+      if (0x2000 < param_1) {

+        iVar1 = param_1 - 0x2002;

+        bVar2 = iVar1 == 0;

+        goto LAB_4;

+      }

+      if (param_1 == 0x2000) {

+        return 1;

+      }

+      if (param_1 == 0x1040) {

+        return 1;

+      }

+      if (param_1 == 0x1042) {

+        return 1;

+      }

+      iVar1 = param_1 - 0x1048;

+    }

+    if (iVar1 == 0) {

+      return 1;

+    }

+    if (iVar1 == 2) {

+      return 1;

+    }

+    if (iVar1 == 4) {

+      return 1;

+    }

+    iVar1 = iVar1 + -6;

+    bVar2 = iVar1 == 0;

+  }

+LAB_5:

+  if (bVar2) {

+    return 1;

+  }

+  bVar2 = iVar1 == 2;

+LAB_1:

+  if (bVar2) {

+    return 1;

+  }

+  return 0;

 }
```

## `RIMSetDeviceInputMode`  (modified)

```diff
--- RIMSetDeviceInputMode
+++ RIMSetDeviceInputMode
@@ -1,10 +1,25 @@
 

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

-

-void RIMSetDeviceInputMode(void)

+undefined4 RIMSetDeviceInputMode(RIMDEV *param_1,_WIN32K_INPUT_MODE param_2)

 

 {

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

-  halt_baddata();

+  int iVar1;

+  undefined4 uVar2;

+  undefined8 uVar3;

+  

+  InputTraceLogging::RIM::SetDeviceInputMode(param_1,param_2);

+  if (param_2 != 1) {

+    if (param_2 != 2) goto LAB_0;

+    iVar1 = RIMIsWakeCapableDevice(param_1);

+    if (iVar1 != 0) goto LAB_0;

+  }

+  rimInvalidateInputs(param_1);

+LAB_0:

+  uVar2 = RIMUpdateDeviceForInputMode(param_1,param_2);

+  if ((param_2 == 1) && (*(int *)(param_1 + 0x518) != 1)) {

+    uVar3 = KeQueryPerformanceCounter(0);

+    *(undefined8 *)(param_1 + 0x520) = uVar3;

+  }

+  *(_WIN32K_INPUT_MODE *)(param_1 + 0x518) = param_2;

+  return uVar2;

 }
```

## `EtwTraceWaitCursor`  (modified)

```diff
--- EtwTraceWaitCursor
+++ EtwTraceWaitCursor
@@ -1,542 +1,60 @@
 

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

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

 

-void EtwTraceWaitCursor(void)

+void EtwTraceWaitCursor(tagCURSOR *param_1,tagCURSOR *param_2)

 

 {

-  int *piVar1;

-  int *piVar2;

-  byte bVar3;

-  undefined2 uVar4;

-  undefined2 uVar5;

-  undefined8 uVar6;

-  int iVar7;

-  int iVar8;

-  uint uVar9;

-  longlong lVar10;

-  longlong lVar11;

-  void *pvVar12;

-  __uint64 _Var13;

-  int unaff_EBX;

-  longlong unaff_RBP;

-  int unaff_ESI;

-  uint uVar14;

-  int unaff_EDI;

-  int unaff_R12D;

-  longlong unaff_R13;

-  int unaff_R14D;

-  __uint64 unaff_R15;

-  undefined4 extraout_XMM0_Da;

-  undefined4 uVar15;

-  undefined4 extraout_XMM0_Da_00;

-  undefined4 extraout_XMM0_Da_01;

-  undefined4 extraout_XMM0_Da_02;

-  undefined4 extraout_XMM0_Da_03;

-  undefined4 extraout_XMM0_Da_04;

-  undefined4 uVar16;

-  uint in_stack_00000040;

-  int iStack0000000000000044;

-  undefined8 in_stack_00000048;

-  undefined8 in_stack_00000050;

-  uint in_stack_00000058;

-  uint uStack000000000000005c;

-  uint uStack0000000000000060;

-  int iStack0000000000000064;

+  ulong uVar1;

+  ulong uVar2;

+  undefined4 uVar3;

+  longlong lVar4;

+  undefined8 *puVar5;

+  longlong lVar6;

   

-  RtlUnicodeStringToInteger(unaff_RBP + -0x50);

-  uStack000000000000005c = (uint)(in_stack_00000040 != 0);

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

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

-  iVar7 = FastGetProfileStringW(0,0x1c,L"On",0,unaff_RBP + 0x1c0);

-  if (iVar7 == 0) {

-    in_stack_00000040 = 0;

-LAB_0:

-    iStack0000000000000044 = 0;

-  }

-  else {

-    RtlInitUnicodeString(unaff_RBP + -0x40,unaff_RBP + 0x1c0);

-    RtlUnicodeStringToInteger(unaff_RBP + -0x40,10,&stack0x00000040);

-    if (in_stack_00000040 == 0) goto LAB_0;

-    iStack0000000000000044 = 1;

-  }

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

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

-  iVar7 = FastGetProfileStringW(0,0x12,L"Flags",0,unaff_RBP + 0x210);

-  if (iVar7 == 0) {

-    in_stack_00000040 = 0;

-  }

-  else {

-    RtlInitUnicodeString(unaff_RBP + -0x30,unaff_RBP + 0x210);

-    RtlUnicodeStringToInteger(unaff_RBP + -0x30,10,&stack0x00000040);

-  }

-  uStack0000000000000060 = in_stack_00000040 & 1;

-  in_stack_00000048 = 0;

-  in_stack_00000050 = 0;

-  iVar7 = FastGetProfileStringW(0,0x1d,L"Flags",0,unaff_RBP + -0x20);

-  if (iVar7 == 0) {

-    in_stack_00000040 = 0;

-  }

-  else {

-    RtlInitUnicodeString(&stack0x00000048,unaff_RBP + -0x20);

-    RtlUnicodeStringToInteger(&stack0x00000048,10,&stack0x00000040);

-  }

-  in_stack_00000058 = in_stack_00000040 & 1;

-  if (unaff_R14D == 0) {

-    lVar10 = W32GetUserSessionState();

-    uVar14 = *(uint *)(lVar10 + 0x5084);

-    lVar10 = W32GetUserSessionState();

-    if ((uVar14 & 1) == (*(uint *)(lVar10 + 0x10650) & 1)) {

-      lVar10 = W32GetUserSessionState();

-      if (unaff_R12D == 0) {

-        *(uint *)(lVar10 + 0x5084) = *(uint *)(lVar10 + 0x5084) & 0xfffffffe;

-      }

-      else {

-        *(uint *)(lVar10 + 0x5084) = *(uint *)(lVar10 + 0x5084) | 1;

+                    /* 0x8d290  1410  EtwTraceWaitCursor */

+  if (((((W32kEtwEnabledKeyword & 0x8000000000040000) != 0) && (2 < (byte)(DAT_0 - 1U))) &&

+      ((_DAT_1 & 0x8000000000040000) != 0)) &&

+     ((DAT_2 & 0x8000000000040000) == DAT_2)) {

+    uVar1 = EtwpGetWaitCursorType(param_2);

+    uVar2 = EtwpGetWaitCursorType(param_1);

+    lVar4 = W32GetUserSessionState();

+    if (((uVar1 == *(ulong *)(lVar4 + 0x8e98)) && (uVar1 != 0)) &&

+       ((uVar1 != uVar2 &&

+        ((lVar6 = (ulonglong)_DAT_3 * _DAT_fffff78000000320,

+         lVar4 = W32GetUserSessionState(),

+         199 < (uint)((int)((ulonglong)lVar6 >> 0x18) - *(int *)(lVar4 + 0x8e9c)) &&

+         ((Microsoft_Windows_Win32kEnableBits & 0x40) != 0)))))) {

+      W32GetCurrentWin32kSessionId();

+      W32GetUserSessionState();

+      W32GetUserSessionState();

+      McTemplateK0qqqqq_EtwWriteTransfer();

+    }

+    lVar4 = W32GetUserSessionState();

+    *(ulong *)(lVar4 + 0x8e98) = uVar2;

+    if (uVar2 != 0) {

+      lVar6 = (ulonglong)_DAT_3 * _DAT_fffff78000000320;

+      lVar4 = W32GetUserSessionState();

+      *(int *)(lVar4 + 0x8e9c) = (int)((ulonglong)lVar6 >> 0x18);

+    }

+    lVar4 = W32GetUserSessionState();

+    if (*(longlong *)(lVar4 + 0x4b78) != 0) {

+      lVar4 = W32GetUserSessionState();

+      puVar5 = (undefined8 *)PtiMouseFromQ(*(undefined8 *)(lVar4 + 0x4b78));

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

+        uVar3 = PsGetThreadId(*puVar5);

+        lVar4 = W32GetUserSessionState();

+        *(undefined4 *)(lVar4 + 0x8ea0) = uVar3;

+        uVar3 = *(undefined4 *)(puVar5[0x3a] + 0x38);

+        lVar4 = W32GetUserSessionState();

+        *(undefined4 *)(lVar4 + 0x8ea4) = uVar3;

+        return;

       }

     }

-    lVar10 = W32GetUserSessionState();

-    uVar14 = *(uint *)(lVar10 + 0x50ec);

-    lVar10 = W32GetUserSessionState();

-    if ((uVar14 & 1) == (*(uint *)(lVar10 + 0x10650) >> 1 & 1)) {

-      lVar10 = W32GetUserSessionState();

-      if ((*(uint *)(lVar10 + 0x50ec) & 1) == 0) {

-        if (unaff_EDI != 0) goto LAB_1;

-      }

-      else {

-        if (unaff_EDI != 0) {

-LAB_1:

-          lVar10 = W32GetUserSessionState();

-          *(uint *)(lVar10 + 0x50ec) = *(uint *)(lVar10 + 0x50ec) | 1;

-          goto LAB_2;

-        }

-        xxxTurnOffStickyKeys();

-      }

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x50ec) = *(uint *)(lVar10 + 0x50ec) & 0xfffffffe;

-    }

-LAB_2:

-    lVar10 = W32GetUserSessionState();

-    uVar14 = *(uint *)(lVar10 + 0x50f4);

-    lVar10 = W32GetUserSessionState();

-    if ((uVar14 & 1) == (*(uint *)(lVar10 + 0x10650) >> 2 & 1)) {

-      lVar10 = W32GetUserSessionState();

-      if (unaff_ESI == 0) {

-        *(uint *)(lVar10 + 0x50f4) = *(uint *)(lVar10 + 0x50f4) & 0xfffffffe;

-      }

-      else {

-        *(uint *)(lVar10 + 0x50f4) = *(uint *)(lVar10 + 0x50f4) | 1;

-      }

-    }

-    lVar10 = W32GetUserSessionState();

-    uVar14 = *(uint *)(lVar10 + 0x5244);

-    lVar10 = W32GetUserSessionState();

-    if ((uVar14 & 1) == (*(uint *)(lVar10 + 0x10650) >> 3 & 1)) {

-      lVar10 = W32GetUserSessionState();

-      if (iStack0000000000000064 == 0) {

-        *(uint *)(lVar10 + 0x5244) = *(uint *)(lVar10 + 0x5244) & 0xfffffffe;

-      }

-      else {

-        *(uint *)(lVar10 + 0x5244) = *(uint *)(lVar10 + 0x5244) | 1;

-      }

-    }

-    lVar10 = W32GetUserSessionState();

-    uVar14 = *(uint *)(lVar10 + 0x522c);

-    lVar10 = W32GetUserSessionState();

-    if ((uVar14 & 1) == (*(uint *)(lVar10 + 0x10650) >> 4 & 1)) {

-      lVar10 = W32GetUserSessionState();

-      if (uStack0000000000000060 == 0) {

-        *(uint *)(lVar10 + 0x522c) = *(uint *)(lVar10 + 0x522c) & 0xfffffffe;

-      }

-      else {

-        *(uint *)(lVar10 + 0x522c) = *(uint *)(lVar10 + 0x522c) | 1;

-      }

-    }

-    lVar10 = W32GetUserSessionState();

-    uVar14 = *(uint *)(lVar10 + 0x10650);

-    lVar10 = W32GetUserSessionState();

-    if ((uint)((uVar14 & 0x20000) != 0) == (*(uint *)(lVar10 + 0x10650) >> 5 & 1)) {

-      lVar10 = W32GetUserSessionState();

-      if (uStack000000000000005c == 0) {

-        *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xfffdffff;

-      }

-      else {

-        *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 0x20000;

-      }

-    }

-    lVar10 = W32GetUserSessionState();

-    uVar14 = *(uint *)(lVar10 + 0x10650);

-    lVar10 = W32GetUserSessionState();

-    if ((uint)((uVar14 & 0x40000) != 0) == (*(uint *)(lVar10 + 0x10650) >> 6 & 1)) {

-      lVar10 = W32GetUserSessionState();

-      if (iStack0000000000000044 == 0) {

-        *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xfffbffff;

-      }

-      else {

-        *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 0x40000;

-      }

-    }

-    lVar10 = W32GetUserSessionState();

-    uVar14 = *(uint *)(lVar10 + 0x52c4);

-    lVar10 = W32GetUserSessionState();

-    if ((uVar14 & 1) == (*(uint *)(lVar10 + 0x10650) >> 7 & 1)) {

-      if (in_stack_00000058 == 0) goto LAB_3;

-      goto LAB_4;

-    }

+    lVar4 = W32GetUserSessionState();

+    *(undefined4 *)(lVar4 + 0x8ea0) = 0;

+    lVar4 = W32GetUserSessionState();

+    *(undefined4 *)(lVar4 + 0x8ea4) = 0;

   }

-  else {

-    lVar10 = W32GetUserSessionState();

-    if (unaff_R12D == 0) {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xfffffffe;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x5084) = *(uint *)(lVar10 + 0x5084) & 0xfffffffe;

-    }

-    else {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 1;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x5084) = *(uint *)(lVar10 + 0x5084) | 1;

-    }

-    lVar10 = W32GetUserSessionState();

-    if (((*(uint *)(lVar10 + 0x50ec) & 1) != 0) && (unaff_R12D == 0)) {

-      xxxTurnOffStickyKeys();

-    }

-    lVar10 = W32GetUserSessionState();

-    if (unaff_EDI == 0) {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xfffffffd;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x50ec) = *(uint *)(lVar10 + 0x50ec) & 0xfffffffe;

-    }

-    else {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 2;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x50ec) = *(uint *)(lVar10 + 0x50ec) | 1;

-    }

-    lVar10 = W32GetUserSessionState();

-    if (unaff_ESI == 0) {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xfffffffb;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x50f4) = *(uint *)(lVar10 + 0x50f4) & 0xfffffffe;

-    }

-    else {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 4;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x50f4) = *(uint *)(lVar10 + 0x50f4) | 1;

-    }

-    lVar10 = W32GetUserSessionState();

-    if (unaff_EBX == 0) {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xfffffff7;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x5244) = *(uint *)(lVar10 + 0x5244) & 0xfffffffe;

-    }

-    else {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 8;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x5244) = *(uint *)(lVar10 + 0x5244) | 1;

-    }

-    lVar10 = W32GetUserSessionState();

-    if (uStack0000000000000060 == 0) {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xffffffef;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x522c) = *(uint *)(lVar10 + 0x522c) & 0xfffffffe;

-    }

-    else {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 0x10;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x522c) = *(uint *)(lVar10 + 0x522c) | 1;

-    }

-    lVar10 = W32GetUserSessionState();

-    if (uStack000000000000005c == 0) {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xffffffdf;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xfffdffff;

-      lVar10 = W32GetUserSessionState();

-      LOCK();

-      **(uint **)(lVar10 + 0x4e30) = **(uint **)(lVar10 + 0x4e30) & 0xffffff7f;

-      UNLOCK();

-    }

-    else {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 0x20;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 0x20000;

-      lVar10 = W32GetUserSessionState();

-      LOCK();

-      **(uint **)(lVar10 + 0x4e30) = **(uint **)(lVar10 + 0x4e30) | 0x80;

-      UNLOCK();

-    }

-    lVar10 = W32GetUserSessionState();

-    if (iStack0000000000000044 == 0) {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xffffffbf;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xfffbffff;

-    }

-    else {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 0x40;

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 0x40000;

-    }

-    lVar10 = W32GetUserSessionState();

-    if (in_stack_00000058 == 0) {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xffffff7f;

-LAB_3:

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x52c4) = *(uint *)(lVar10 + 0x52c4) & 0xfffffffe;

-    }

-    else {

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 0x80;

-LAB_4:

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x52c4) = *(uint *)(lVar10 + 0x52c4) | 1;

-    }

-  }

-  in_stack_00000048 = 0;

-  in_stack_00000050 = 0;

-  iVar7 = FastGetProfileStringW(0,0xf,L"Flags",0,unaff_RBP + -0x20);

-  if (iVar7 == 0) {

-    in_stack_00000040 = 0x52;

-  }

-  else {

-    RtlInitUnicodeString(&stack0x00000048,unaff_RBP + -0x20);

-    RtlUnicodeStringToInteger(&stack0x00000048,10,&stack0x00000040);

-  }

-  lVar10 = W32GetUserSessionState();

-  if ((*(uint *)(lVar10 + 0x5084) & 1) == 0) {

-    in_stack_00000040 = in_stack_00000040 & 0xfffffffe;

-  }

-  else {

-    in_stack_00000040 = in_stack_00000040 | 1;

-  }

-  *(uint *)(unaff_R13 + 0x5084) = in_stack_00000040;

-  uVar15 = FastGetProfileIntW(extraout_XMM0_Da,0xf,L"DelayBeforeAcceptance",1000,unaff_R13 + 0x5088)

-  ;

-  uVar15 = FastGetProfileIntW(uVar15,0xf,L"AutoRepeatRate",500,unaff_R13 + 0x5090);

-  uVar15 = FastGetProfileIntW(uVar15,0xf,L"AutoRepeatDelay",1000,unaff_R13 + 0x508c);

-  uVar15 = FastGetProfileIntW(uVar15,0xf,L"BounceTime",0,unaff_R13 + 0x5094);

-  uVar15 = FastGetProfileIntW(uVar15,0x13,L"Flags",2,unaff_R13 + 0x5264);

-  uVar15 = FastGetProfileIntW(uVar15,0x13,L"FSTextEffect",0,unaff_R13 + 0x5268);

-  FastGetProfileIntW(uVar15,0x13,L"WindowsEffect",0,unaff_R13 + 0x5280);

-  in_stack_00000048 = 0;

-  in_stack_00000050 = 0;

-  iVar7 = FastGetProfileStringW(0,0x14,L"On",0,unaff_RBP + -0x20);

-  if (iVar7 == 0) {

-    in_stack_00000040 = 0;

-  }

-  else {

-    RtlInitUnicodeString(&stack0x00000048,unaff_RBP + -0x20);

-    RtlUnicodeStringToInteger(&stack0x00000048,10,&stack0x00000040);

-    if (in_stack_00000040 != 0) {

-      lVar10 = W32GetUserSessionState();

-      *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) | 0x8000;

-      goto LAB_5;

-    }

-  }

-  lVar10 = W32GetUserSessionState();

-  *(uint *)(lVar10 + 0x10650) = *(uint *)(lVar10 + 0x10650) & 0xffff7fff;

-LAB_5:

-  lVar10 = W32GetUserSessionState();

-  uVar14 = *(uint *)(lVar10 + 0x10650);

-  lVar10 = W32GetUserSessionState();

-  in_stack_00000048 = 0;

-  in_stack_00000050 = 0;

-  *(uint *)(*(longlong *)(lVar10 + 0x4e30) + 0x880) = uVar14 >> 0xf & 1;

-  iVar7 = FastGetProfileStringW(0,0xe,L"Flags",0,unaff_RBP + -0x20);

-  if (iVar7 == 0) {

-    in_stack_00000040 = 0x1d2;

-  }

-  else {

-    RtlInitUnicodeString(&stack0x00000048,unaff_RBP + -0x20);

-    RtlUnicodeStringToInteger(&stack0x00000048,10,&stack0x00000040);

-  }

-  lVar10 = W32GetUserSessionState();

-  if ((*(uint *)(lVar10 + 0x50ec) & 1) == 0) {

-    in_stack_00000040 = in_stack_00000040 & 0xfffffffe;

-  }

-  else {

-    in_stack_00000040 = in_stack_00000040 | 1;

-  }

-  *(uint *)(unaff_R13 + 0x50ec) = in_stack_00000040;

-  in_stack_00000048 = 0;

-  in_stack_00000050 = 0;

-  iVar7 = FastGetProfileStringW(0,0x10,L"Flags",0,unaff_RBP + -0x20);

-  if (iVar7 == 0) {

-    in_stack_00000040 = 0x12;

-  }

-  else {

-    RtlInitUnicodeString(&stack0x00000048,unaff_RBP + -0x20);

-    RtlUnicodeStringToInteger(&stack0x00000048,10,&stack0x00000040);

-  }

-  lVar10 = W32GetUserSessionState();

-  if ((*(uint *)(lVar10 + 0x50f4) & 1) == 0) {

-    in_stack_00000040 = in_stack_00000040 & 0xfffffffe;

-  }

-  else {

-    in_stack_00000040 = in_stack_00000040 | 1;

-  }

-  piVar1 = (int *)(unaff_R13 + 0x50f8);

-  *(uint *)(unaff_R13 + 0x50f4) = in_stack_00000040;

-  uVar15 = FastGetProfileIntW(extraout_XMM0_Da_00,0x10,L"MaximumSpeed",0x28,piVar1);

-  piVar2 = (int *)(unaff_R13 + 0x50fc);

-  FastGetProfileIntW(uVar15,0x10,L"TimeToMaximumSpeed",3000,piVar2);

-  if (0x15e < *piVar1 - 10U) {

-    *piVar1 = 0x28;

-  }

-  if (4000 < *piVar2 - 1000U) {

-    *piVar2 = 3000;

-  }

-  CalculateMouseTable();

-  lVar10 = W32GetUserSessionState();

-  lVar11 = W32GetUserSessionState();

-  uVar4 = *(undefined2 *)(lVar11 + 0x3698);

-  lVar11 = W32GetUserSessionState();

-  uVar5 = *(undefined2 *)(lVar11 + 0x3698);

-  bVar3 = *(byte *)((ulonglong)(byte)((byte)uVar4 >> 2) + 0x37f8 + lVar10);

-  lVar10 = W32GetUserSessionState();

-  uVar14 = *(uint *)(lVar10 + 0x50f4);

-  lVar10 = W32GetUserSessionState();

-  *(byte *)(lVar10 + 0x5227) =

-       (byte)(uVar14 >> 7) & 1 ^ (1 << ((byte)uVar5 & 3) * '\x02' + 1 & (uint)bVar3) != 0;

-  lVar10 = W32GetUserSessionState();

-  if ((*(uint *)(lVar10 + 0x50f4) & 1) == 0) {

-    MKHideMouseCursor();

-  }

-  else {

-    MKShowMouseCursor();

-  }

-  in_stack_00000048 = 0;

-  in_stack_00000050 = 0;

-  iVar7 = FastGetProfileStringW(0,0x11,L"Flags",0,unaff_RBP + -0x20);

-  if (iVar7 == 0) {

-    in_stack_00000040 = 0x12;

-  }

-  else {

-    RtlInitUnicodeString(&stack0x00000048,unaff_RBP + -0x20);

-    RtlUnicodeStringToInteger(&stack0x00000048,10,&stack0x00000040);

-  }

-  lVar10 = W32GetUserSessionState();

-  if ((*(uint *)(lVar10 + 0x5244) & 1) == 0) {

-    in_stack_00000040 = in_stack_00000040 & 0xfffffffe;

-  }

-  else {

-    in_stack_00000040 = in_stack_00000040 | 1;

-  }

-  *(uint *)(unaff_R13 + 0x5244) = in_stack_00000040;

-  in_stack_00000048 = 0;

-  in_stack_00000050 = 0;

-  iVar7 = FastGetProfileStringW(0,0x12,L"Flags",0,unaff_RBP + -0x20);

-  if (iVar7 == 0) {

-    in_stack_00000040 = 2;

-  }

-  else {

-    RtlInitUnicodeString(&stack0x00000048,unaff_RBP + -0x20);

-    RtlUnicodeStringToInteger(&stack0x00000048,10,&stack0x00000040);

-  }

-  lVar10 = W32GetUserSessionState();

-  if ((*(uint *)(lVar10 + 0x522c) & 1) == 0) {

-    in_stack_00000040 = in_stack_00000040 & 0xfffffffe;

-  }

-  else {

-    in_stack_00000040 = in_stack_00000040 | 1;

-  }

-  *(uint *)(unaff_R13 + 0x522c) = in_stack_00000040;

-  lVar10 = W32GetUserSessionState();

-  uVar15 = extraout_XMM0_Da_01;

-  if (*(longlong *)(lVar10 + 0x36f0) != 0) {

-    lVar10 = W32GetUserSessionState();

-    if ((*(int *)(*(longlong *)(lVar10 + 0x36f0) + 0x10) == 0x10) &&

-       (lVar10 = W32GetUserSessionState(), *(longlong *)(*(longlong *)(lVar10 + 0x36f0) + 0x18) != 0

-       )) {

-      lVar10 = W32GetUserSessionState();

-      uVar6 = *(undefined8 *)(*(longlong *)(lVar10 + 0x36f0) + 0x18);

-      lVar10 = W32GetUserSessionState();

-      *(undefined8 *)(lVar10 + 0x3770) = uVar6;

-    }

-    lVar10 = W32GetUserSessionState();

-    uVar15 = extraout_XMM0_Da_02;

-    if ((*(byte *)(*(longlong *)(lVar10 + 0x36f0) + 2) & 2) != 0) {

-      lVar10 = W32GetUserSessionState();

-      *(undefined2 *)(lVar10 + 0x3698) = 0x24;

-      lVar10 = W32GetUserSessionState();

-      *(undefined2 *)(lVar10 + 0x369a) = 0x15;

-      uVar15 = extraout_XMM0_Da_03;

-    }

-  }

-  FastGetProfileIntW(uVar15,0x12,L"TimeToWait",300000,unaff_R13 + 0x5230);

-  lVar10 = unaff_RBP + -0x20;

-  in_stack_00000048 = 0;

-  in_stack_00000050 = 0;

-  iVar7 = FastGetProfileStringW(0,0x1d,L"Flags",0,lVar10);

-  if (iVar7 == 0) {

-    in_stack_00000040 = 0x52;

-  }

-  else {

-    RtlInitUnicodeString(&stack0x00000048,unaff_RBP + -0x20);

-    RtlUnicodeStringToInteger(&stack0x00000048,10,&stack0x00000040);

-  }

-  lVar11 = W32GetUserSessionState();

-  if ((*(uint *)(lVar11 + 0x52c4) & 1) == 0) {

-    in_stack_00000040 = in_stack_00000040 & 0xfffffffe;

-  }

-  else {

-    in_stack_00000040 = in_stack_00000040 | 1;

-  }

-  in_stack_00000048 = 0;

-  in_stack_00000050 = 0;

-  *(uint *)(unaff_R13 + 0x52c4) = in_stack_00000040;

-  iStack0000000000000044 = 0;

-  lVar11 = W32GetUserSessionState();

-  in_stack_00000058 = *(int *)(lVar11 + 0xf5c8);

-  uVar15 = extraout_XMM0_Da_04;

-  do {

-    uVar16 = (undefined4)((ulonglong)lVar10 >> 0x20);

-    _Var13 = unaff_R15;

-    lVar11 = OpenCacheKeyEx(uVar15,0x1d,0x20019,&stack0x00000058);

-    if (lVar11 == 0) {

-LAB_6:

-      *(undefined4 *)(unaff_R13 + 0x55d8) = 0xc;

-      uVar15 = FastGetProfileIntW();

-      FastGetProfileIntW(uVar15,0x30,L"Locale",0,unaff_R13 + 0x55e0);

-      AccessTimeOutReset();

-      SetAccessEnabledFlag();

-      return;

-    }

-    iStack0000000000000044 = 0x10c;

-    pvVar12 = Win32AllocPoolWithQuotaZInitImpl(_Var13,0x10c,0x72707355);

-    if (pvVar12 == (void *)0x0) {

-LAB_7:

-      ZwClose(lVar11);

-      goto LAB_6;

-    }

-    RtlInitUnicodeString(&stack0x00000048,L"High Contrast Scheme");

-    lVar10 = CONCAT44(uVar16,iStack0000000000000044);

-    iVar8 = ZwQueryValueKey(lVar11,&stack0x00000048,2,pvVar12,lVar10);

-    iVar7 = 0;

-    if (iVar8 != -0x7ffffffb) {

-      iVar7 = iVar8;

-    }

-    if (-1 < iVar7) {

-      uVar9 = *(uint *)((longlong)pvVar12 + 8) >> 1;

-      uVar14 = 0x80;

-      if (uVar9 < 0x80) {

-        uVar14 = uVar9;

-      }

-      if (*(uint *)((longlong)pvVar12 + 8) < 2) {

-        *(undefined2 *)(unaff_RBP + 0x260) = 0;

-      }

-      else {

-        *(undefined2 *)((longlong)pvVar12 + (ulonglong)(uVar14 - 1) * 2 + 0xc) = 0;

-        RtlStringCchCopyW((ushort *)(unaff_RBP + 0x260),0x80,(ushort *)((longlong)pvVar12 + 0xc));

-      }

-      GreDeleteFastMutex(pvVar12);

-      ZwClose(lVar11);

-      if (uVar14 != 0) {

-        RtlStringCchCopyW((ushort *)(unaff_R13 + 0x52d0),0x80,(ushort *)(unaff_RBP + 0x260));

-      }

-      goto LAB_6;

-    }

-    if (in_stack_00000058 == 0) {

-      GreDeleteFastMutex(pvVar12);

-      goto LAB_7;

-    }

-    GreDeleteFastMutex(pvVar12);

-    uVar15 = ZwClose(lVar11);

-  } while( true );

+  return;

 }
```

## `NtUserEnableTouchPad`  (modified)

```diff
--- NtUserEnableTouchPad
+++ NtUserEnableTouchPad
@@ -1,29 +1,61 @@
 

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

-

-undefined8 NtUserEnableTouchPad(longlong param_1)

+longlong NtUserEnableTouchPad(int param_1)

 

 {

-  longlong in_RAX;

-  longlong lVar1;

-  char cVar2;

-  bool bVar3;

+  bool bVar1;

+  int iVar2;

+  longlong lVar3;

+  longlong lVar4;

+  tagTHREADINFO *ptVar5;

+  undefined4 local_28;

+  undefined4 local_24;

+  undefined4 local_20;

+  AtomicExecutionCheck local_18 [8];

+  longlong local_10;

   

-  if (((param_1 == in_RAX) || ((*(uint *)(param_1 + 0x2c) & 2) == 0)) ||

-     (*(byte *)(param_1 + 0x29) < 2)) {

-    cVar2 = '\0';

+                    /* 0x1b9020  1965  NtUserEnableTouchPad */

+  lVar3 = W32GetUserSessionState();

+  lVar4 = UserCritInternal::`anonymous_namespace'::EnterCritInternal

+                    (lVar3,0,0,<lambda_63b61c2369133a205197eda5bd671ee7>::<lambda_invoker_cdecl>);

+  *(longlong *)(lVar3 + 0x10) = lVar4;

+  if (lVar4 != 0) {

+    DestroySharedUserCritDeferredUnlockList(lVar3 + 0x4d78);

+    DestroyDeferredUnlockObjectAssignmentList(lVar3 + 0x4db0);

+    DestroyDeferredUnlockObjectAssignmentList(lVar3 + 0x4da0);

+  }

+  local_10 = 0;

+  local_18[0] = (AtomicExecutionCheck)0x0;

+  AtomicExecutionCheck::Arm(local_18);

+  iVar2 = Feature_UIPIModernization__private_IsEnabledDeviceUsageNoInline();

+  if (iVar2 == 0) {

+    local_24 = 0xffffffff;

+    local_20 = 0;

+    local_28 = 0x2000;

+    ptVar5 = PtiCurrent();

+    bVar1 = UIPrivilegeIsolation::CheckAccess

+                      ((tagUIPI_INFO *)(*(longlong *)(ptVar5 + 0x1d0) + 0x130),

+                       (tagUIPI_INFO *)&local_28,0);

   }

   else {

-    cVar2 = '\x01';

+    ptVar5 = PtiCurrent();

+    bVar1 = UIPrivilegeIsolation::MeetsUIPIThreshold

+                      ((UIPIAccessor *)

+                       (-(ulonglong)(*(longlong *)(ptVar5 + 0x1d0) != 0) &

+                       *(longlong *)(ptVar5 + 0x1d0) + 0x130U),0x2000);

   }

-  bVar3 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

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

-    lVar1 = W32GetUserSessionState();

-    WPP_RECORDER_AND_TRACE_SF_

-              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar2,bVar3,

-               *(undefined8 *)(lVar1 + 0x10f88),2);

+  if (bVar1 == false) {

+    ptVar5 = PtiCurrent();

+    EtwTraceUIPISystemError(*(undefined8 *)(ptVar5 + 0x1d0),0,0xd);

+    iVar2 = 0;

+    UserSetLastError(5);

   }

-  UserSetLastError(0x57);

-  return 0;

+  else {

+    iVar2 = EnablePTPDevices(param_1 != 0);

+  }

+  if (local_18[0] != (AtomicExecutionCheck)0x0) {

+    *(int *)(local_10 + 0x1c) = *(int *)(local_10 + 0x1c) + -1;

+  }

+  ReleaseUserCriticalSection();

+  return (longlong)iVar2;

 }
```

## `InputHapticsTrigger`  (modified)

```diff
--- InputHapticsTrigger
+++ InputHapticsTrigger
@@ -1,20 +1,88 @@
 

 void InputHapticsTrigger(undefined4 param_1)

 

 {

-  undefined8 uVar1;

+  int iVar1;

   longlong lVar2;

-  longlong unaff_RBX;

-  undefined8 in_XMM0_Qa;

-  undefined8 in_XMM0_Qb;

+  tagTHREADINFO *ptVar3;

+  bool bVar4;

+  undefined4 local_a8;

+  undefined1 local_a4 [4];

+  undefined8 local_a0;

+  undefined8 uStack_98;

+  undefined8 local_90;

+  undefined8 uStack_88;

+  undefined8 local_80;

+  undefined8 uStack_78;

+  undefined4 local_70;

+  undefined4 uStack_6c;

+  undefined4 uStack_68;

+  undefined4 uStack_64;

+  undefined4 local_60;

+  undefined4 uStack_5c;

+  undefined4 uStack_58;

+  undefined4 uStack_54;

+  undefined4 local_50;

+  undefined4 uStack_4c;

+  undefined4 uStack_48;

+  undefined4 uStack_44;

+  undefined8 local_40;

+  undefined8 uStack_38;

+  undefined8 local_30;

+  undefined8 uStack_28;

+  undefined8 local_20;

+  undefined8 uStack_18;

+  undefined8 local_10;

   

-  *(undefined8 *)(unaff_RBX + 0x2c) = in_XMM0_Qa;

-  *(undefined8 *)(unaff_RBX + 0x34) = in_XMM0_Qb;

-  *(undefined4 *)(unaff_RBX + 0x34) = param_1;

+                    /* 0x211c00  1717  InputHapticsTrigger */

+  memset(local_a4,0,0x9c);

+  local_a8 = param_1;

   lVar2 = W32GetUserSessionState();

-  uVar1 = *(undefined8 *)(lVar2 + 0x4b80);

-  *(undefined8 *)(unaff_RBX + 0xedc) = 0;

-  *(undefined8 *)(unaff_RBX + 0xed4) = uVar1;

+  local_40 = *(undefined8 *)(lVar2 + 0x48f0);

+  uStack_38 = *(undefined8 *)(lVar2 + 0x48f8);

+  local_30 = *(undefined8 *)(lVar2 + 0x4900);

+  uStack_28 = *(undefined8 *)(lVar2 + 0x4908);

+  local_20 = *(undefined8 *)(lVar2 + 0x4910);

+  uStack_18 = *(undefined8 *)(lVar2 + 0x4918);

+  local_10 = *(undefined8 *)(lVar2 + 0x4920);

+  ptVar3 = PtiCurrent();

+  local_a0 = *(undefined8 *)(ptVar3 + 0x568);

+  uStack_98 = *(undefined8 *)(ptVar3 + 0x570);

+  local_90 = *(undefined8 *)(ptVar3 + 0x578);

+  uStack_88 = *(undefined8 *)(ptVar3 + 0x580);

+  local_70 = *(undefined4 *)(ptVar3 + 0x598);

+  uStack_6c = *(undefined4 *)(ptVar3 + 0x59c);

+  uStack_68 = *(undefined4 *)(ptVar3 + 0x5a0);

+  uStack_64 = *(undefined4 *)(ptVar3 + 0x5a4);

+  local_80 = *(undefined8 *)(ptVar3 + 0x588);

+  uStack_78 = *(undefined8 *)(ptVar3 + 0x590);

+  local_50 = *(undefined4 *)(ptVar3 + 0x5b8);

+  uStack_4c = *(undefined4 *)(ptVar3 + 0x5bc);

+  uStack_48 = *(undefined4 *)(ptVar3 + 0x5c0);

+  uStack_44 = *(undefined4 *)(ptVar3 + 0x5c4);

+  local_60 = *(undefined4 *)(ptVar3 + 0x5a8);

+  uStack_5c = *(undefined4 *)(ptVar3 + 0x5ac);

+  uStack_58 = *(undefined4 *)(ptVar3 + 0x5b0);

+  uStack_54 = *(undefined4 *)(ptVar3 + 0x5b4);

+  iVar1 = *(int *)(ptVar3 + 0x5a0);

+  if (iVar1 == 2) {

+    bVar4 = (int)uStack_18 == 0;

+  }

+  else if (iVar1 == 8) {

+    if ((int)local_40 == 0) {

+      return;

+    }

+    bVar4 = local_40._4_4_ == 0;

+  }

+  else {

+    if ((iVar1 - 0x10U & 0xfffffffd) != 0) {

+      return;

+    }

+    bVar4 = (int)uStack_28 == 0;

+  }

+  if (!bVar4) {

+    SendMessageTo(0x16,&local_a8,0xa0);

+  }

   return;

 }
```

## `InitProcessUipiInfo`  (modified)

```diff
--- InitProcessUipiInfo
+++ tagPROCESSINFO::InitProcessUipiInfo
@@ -1,10 +1,128 @@
 

-long __cdecl InitProcessUipiInfo(tagPROCESSINFO *param_1,void *param_2,ulong param_3)

+/* public: long __cdecl tagPROCESSINFO::InitProcessUipiInfo(void * __ptr64,unsigned long) __ptr64 */

+

+long __thiscall

+tagPROCESSINFO::InitProcessUipiInfo(tagPROCESSINFO *this,void *param_1,ulong param_2)

 

 {

-  uint in_EAX;

+  undefined4 uVar1;

+  undefined4 uVar2;

+  byte bVar3;

+  int iVar4;

+  longlong lVar5;

+  int iVar6;

+  char cVar7;

+  bool bVar8;

+  bool bVar9;

+  undefined4 local_res8 [2];

+  void *local_res10;

+  ulong local_res18;

+  int local_res20 [2];

   

-  *(int *)(param_1 + 0x1c) = *(int *)(param_1 + 0x1c) + -1;

-  return in_EAX & 0xffffff28;

+  if (*(int *)(this + 0x130) == -1) {

+    local_res8[0] = 0;

+    iVar6 = 0;

+    local_res10 = param_1;

+    local_res18 = param_2;

+    iVar4 = SeQueryInformationToken(param_1,0x19,local_res8);

+    if (iVar4 < 0) {

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

+          (-1 < (char)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c))) ||

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

+        cVar7 = '\0';

+      }

+      else {

+        cVar7 = '\x01';

+      }

+      bVar8 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+      if ((cVar7 != '\0') || (bVar8)) {

+        uVar1 = *(undefined4 *)(this + 0x38);

+        lVar5 = W32GetUserSessionState();

+        WPP_RECORDER_AND_TRACE_SF_dD

+                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar7,bVar8,

+                   *(undefined8 *)(lVar5 + 0x10f88),3,8,0x1f,

+                   &WPP_e6f73e3fe92236b6e2f1b35bfc876ef9_Traceguids,iVar4,uVar1);

+      }

+    }

+    else {

+      iVar4 = PsIsProtectedProcess(*(undefined8 *)this);

+      bVar8 = true;

+      if (iVar4 != 0) {

+        bVar3 = PsGetProcessProtection(*(undefined8 *)this);

+        iVar6 = ((bVar3 >> 3 & 1 | (bVar3 & 7) << 8) << 8 | (uint)(bVar3 >> 4)) << 8;

+      }

+      *(undefined4 *)(this + 0x130) = local_res8[0];

+      *(ulong *)(this + 0x134) = param_2;

+      *(int *)(this + 0x138) = iVar6;

+      iVar4 = Feature_UIPIDecoupleACFromIL__private_IsEnabledDeviceUsageNoInline();

+      uVar1 = local_res8[0];

+      if (*(int *)(this + 0x134) != 0) {

+        if (iVar4 == 0) {

+          if (*(int *)(this + 0x130) != 0x1000) {

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

+                (-1 < (char)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c))) ||

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

+              bVar8 = false;

+            }

+            bVar9 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+            if ((bVar8 != false) || (bVar9)) {

+              uVar1 = *(undefined4 *)(this + 0x38);

+              lVar5 = W32GetUserSessionState();

+              WPP_RECORDER_AND_TRACE_SF_D

+                        (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),bVar8,bVar9,

+                         *(undefined8 *)(lVar5 + 0x10f88),3,8,0x21,

+                         &WPP_e6f73e3fe92236b6e2f1b35bfc876ef9_Traceguids,uVar1);

+            }

+            return -0x3fffffff;

+          }

+        }

+        else if (*(int *)(this + 0x130) != 0x1000) {

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

+              (-1 < (char)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c))) ||

+             ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

+            cVar7 = '\0';

+          }

+          else {

+            cVar7 = '\x01';

+          }

+          bVar9 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+          if ((cVar7 != '\0') || (bVar9)) {

+            uVar2 = *(undefined4 *)(this + 0x38);

+            lVar5 = W32GetUserSessionState();

+            WPP_RECORDER_AND_TRACE_SF_DDD

+                      (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar7,bVar9,

+                       *(undefined8 *)(lVar5 + 0x10f88),4,8,0x20,

+                       &WPP_e6f73e3fe92236b6e2f1b35bfc876ef9_Traceguids,uVar2,local_res18,uVar1);

+          }

+        }

+      }

+      local_res20[0] = 0;

+      iVar4 = SeQueryInformationToken(local_res10,0x32,local_res20);

+      if (((-1 < iVar4) && (local_res20[0] != 0)) &&

+         (iVar4 = Feature_LearningModeExpansion__private_IsEnabledDeviceUsageNoInline(), iVar4 != 0)

+         ) {

+        *(ulonglong *)(this + 0x330) =

+             (ulonglong)(((byte)local_res20[0] & 3) == 3) + 1 << 0x26 |

+             *(ulonglong *)(this + 0x330) & 0xffffff3fffffffff;

+      }

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

+          (-1 < (char)*(undefined4 *)(WPP_GLOBAL_Control + 0x2c))) ||

+         ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

+        bVar8 = false;

+      }

+      bVar9 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+      if ((bVar8) || (bVar9)) {

+        lVar5 = W32GetUserSessionState();

+        WPP_RECORDER_AND_TRACE_SF_DDDDD

+                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),bVar8,bVar9,

+                   *(undefined8 *)(lVar5 + 0x10f88));

+      }

+      iVar4 = 0;

+    }

+  }

+  else {

+    iVar4 = -0x3fff5ffd;

+  }

+  return iVar4;

 }
```

## `DirectComposition::CVisualMarshaler::CVisualMarshaler`  (modified)

```diff
--- DirectComposition::CVisualMarshaler::CVisualMarshaler
+++ DirectComposition::CVisualMarshaler::SetReferenceProperty
@@ -1,20 +1,107 @@
 

-/* protected: __cdecl DirectComposition::CVisualMarshaler::CVisualMarshaler(enum MIL_RESOURCE_TYPE)

-   __ptr64 */

+/* public: virtual long __cdecl DirectComposition::CVisualMarshaler::SetReferenceProperty(class

+   DirectComposition::CApplicationChannel * __ptr64,unsigned int,class

+   DirectComposition::CResourceMarshaler * __ptr64,bool * __ptr64) __ptr64 */

 

-CVisualMarshaler * __thiscall

-DirectComposition::CVisualMarshaler::CVisualMarshaler

-          (CVisualMarshaler *this,MIL_RESOURCE_TYPE param_1)

+long __thiscall

+DirectComposition::CVisualMarshaler::SetReferenceProperty

+          (CVisualMarshaler *this,CApplicationChannel *param_1,uint param_2,

+          CResourceMarshaler *param_3,bool *param_4)

 

 {

-  CPropertyChangeResourceMarshaler::CPropertyChangeResourceMarshaler

-            ((CPropertyChangeResourceMarshaler *)this,param_1);

-  *(undefined ***)this = &_vftable_;

-  CMarshaledArray<tagRECT,1735541572,2048,564,565>::CMarshaledArray<tagRECT,1735541572,2048,564,565>

-            ((CMarshaledArray<tagRECT,1735541572,2048,564,565> *)(this + 0x138));

-  CMarshaledArray<tagRECT,1735541572,2048,564,565>::CMarshaledArray<tagRECT,1735541572,2048,564,565>

-            ((CMarshaledArray<tagRECT,1735541572,2048,564,565> *)(this + 0x150));

-  *(undefined4 *)(this + 0x168) = 0;

-  return this;

+  bool bVar1;

+  int iVar2;

+  long lVar3;

+  MIL_RESOURCE_TYPE MVar4;

+  CVisualMarshaler *pCVar5;

+  MIL_RESOURCE_TYPE MVar6;

+  CVisualMarshaler *pCVar7;

+  ulong uVar8;

+  

+  *param_4 = false;

+  if (param_2 == 4) {

+    pCVar7 = this + 0x10;

+    pCVar5 = this + 0x88;

+    uVar8 = 0x100;

+    MVar6 = 0xab;

+  }

+  else {

+    if (param_2 == 5) {

+LAB_0:

+      if (param_3 != (CResourceMarshaler *)0x0) {

+        MVar6 = *(MIL_RESOURCE_TYPE *)(param_3 + 0x24);

+        bVar1 = CResourceMarshaler::IsDerivedResourceType(MVar6,0xb4);

+        if ((!bVar1) &&

+           ((param_2 == 5 || (bVar1 = CResourceMarshaler::IsDerivedResourceType(MVar6,0xb8), !bVar1)

+            ))) {

+          return -0x3ffffff3;

+        }

+      }

+      lVar3 = SetTransformParent(this,param_1,param_3,param_2 == 0x27,param_4);

+      return lVar3;

+    }

+    if (param_2 == 6) {

+      pCVar7 = this + 0x10;

+      pCVar5 = this + 0x98;

+      uVar8 = 0x400;

+      MVar6 = 0x36;

+    }

+    else if (param_2 == 7) {

+      pCVar7 = this + 0x10;

+      pCVar5 = this + 0xa0;

+      uVar8 = 0x1000;

+      MVar6 = 0x41;

+    }

+    else {

+      if (param_2 == 0xb) {

+        iVar2 = Feature_DCompChromiumK2__private_IsEnabledDeviceUsageNoInline();

+        MVar6 = 0x2d;

+        if ((iVar2 != 0) && (param_3 != (CResourceMarshaler *)0x0)) {

+          MVar4 = 0x11;

+          bVar1 = CResourceMarshaler::IsDerivedResourceType

+                            (*(MIL_RESOURCE_TYPE *)(param_3 + 0x24),0x11);

+          MVar6 = 0x2d;

+          if (bVar1) {

+            MVar6 = MVar4;

+          }

+        }

+        pCVar5 = this + 0xa8;

+        uVar8 = 0x800;

+      }

+      else {

+        if (param_2 != 0x17) {

+          if (param_2 == 0x27) goto LAB_0;

+          if (param_2 == 0x28) {

+            pCVar7 = this + 0x10;

+            pCVar5 = this + 0xe0;

+            uVar8 = 0x4000000;

+            MVar6 = 0x11;

+          }

+          else {

+            if (param_2 != 0x31) {

+              return -0x3ffffff3;

+            }

+            pCVar7 = this + 0x168;

+            pCVar5 = this + 0xe8;

+            uVar8 = 4;

+            MVar6 = 0xba;

+          }

+          goto LAB_1;

+        }

+        if (DAT_2 < '\0') {

+          McTemplateK0qqqxx_EtwWriteTransfer();

+        }

+        pCVar5 = this + 0xd8;

+        uVar8 = 0x100000;

+        MVar6 = 0x57;

+      }

+      pCVar7 = this + 0x10;

+    }

+  }

+LAB_1:

+  lVar3 = CResourceMarshaler::SetReferencePropertyHelper

+                    ((CResourceMarshaler *)this,param_1,(CResourceMarshaler **)pCVar5,param_3,1,

+                     MVar6,(ulong *)pCVar7,uVar8,0,param_4);

+  return lVar3;

 }
```

## `DirectComposition::CColorBrushMarshaler::SetRemarshalingFlags`  (modified)

```diff
--- DirectComposition::CColorBrushMarshaler::SetRemarshalingFlags
+++ DirectComposition::CColorBrushMarshaler::SetRemarshalingFlags
@@ -1,2 +1,15 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CColorBrushMarshaler::SetRemarshalingFlags : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual bool __cdecl DirectComposition::CColorBrushMarshaler::SetRemarshalingFlags(void)

+   __ptr64 */

+

+bool __thiscall

+DirectComposition::CColorBrushMarshaler::SetRemarshalingFlags(CColorBrushMarshaler *this)

+

+{

+  int iVar1;

+  

+  iVar1 = Feature_DCompChromiumK2__private_IsEnabledDeviceUsageNoInline();

+  *(uint *)(this + 0x10) = *(uint *)(this + 0x10) | (-(uint)(iVar1 != 0) & 0x3a0) + 0x20;

+  return true;

+}

+
```

## `SURFACE::bDeleteSurface`  (modified)

```diff
--- SURFACE::bDeleteSurface
+++ SURFACE::bDeleteSurface
@@ -1,2 +1,594 @@
-Failed to decompile win32kbase.sys - .ProgramDB SURFACE::bDeleteSurface : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

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

+/* public: int __cdecl SURFACE::bDeleteSurface(enum _CLEANUPTYPE,int) __ptr64 */

+

+int __thiscall SURFACE::bDeleteSurface(SURFACE *this,_CLEANUPTYPE param_1,int param_2)

+

+{

+  SURFACE *pSVar1;

+  ushort uVar2;

+  uint uVar3;

+  longlong *plVar4;

+  code *pcVar5;

+  uint *puVar6;

+  longlong *plVar7;

+  _W32PROCESS *p_Var8;

+  SURFACE *pSVar9;

+  undefined8 uVar10;

+  undefined1 *puVar11;

+  int iVar12;

+  uint uVar13;

+  ulong uVar14;

+  int iVar15;

+  int iVar16;

+  longlong lVar17;

+  longlong lVar18;

+  longlong lVar19;

+  OBJECT *pOVar20;

+  _GRETHREAD *p_Var21;

+  void *pvVar22;

+  ReferenceTrackerCountedType RVar23;

+  ulonglong uVar24;

+  ulonglong uVar25;

+  ulonglong uVar26;

+  undefined1 *puVar27;

+  undefined1 *puVar28;

+  uint uVar29;

+  uint uVar30;

+  HOBJ__ *pHVar31;

+  bool bVar32;

+  undefined8 local_res8;

+  _CLEANUPTYPE local_res10;

+  HSEMAPHORE__ *local_res20;

+  undefined8 uStack_230;

+  undefined1 auStack_228 [32];

+  ulonglong local_208 [4];

+  undefined4 local_1e8 [4];

+  longlong local_1d8;

+  HOBJ__ *local_1d0;

+  int local_1c8 [4];

+  longlong local_1b8;

+  uint *local_1b0;

+  undefined8 local_1a8;

+  void *local_1a0;

+  undefined8 local_198;

+  undefined8 local_190;

+  undefined4 local_188;

+  longlong local_180;

+  longlong local_178;

+  longlong local_170;

+  longlong local_168;

+  longlong local_160;

+  void *pvStack_158;

+  longlong local_150;

+  undefined8 uStack_148;

+  undefined8 local_140;

+  undefined4 local_138;

+  longlong local_130;

+  SEMOBJ<20> local_128 [8];

+  longlong local_120;

+  ulonglong local_118;

+  SESSION_GLOBALS *local_110;

+  undefined1 local_108;

+  longlong local_f8 [3];

+  uint local_e0;

+  undefined8 local_88;

+  undefined8 local_80;

+  undefined8 local_78;

+  undefined8 local_68;

+  undefined8 uStack_60;

+  undefined8 local_58;

+  undefined8 uStack_50;

+  undefined8 local_48;

+  undefined8 uStack_40;

+  

+                    /* 0x3d300  435  ?bDeleteSurface@SURFACE@@QEAAHW4_CLEANUPTYPE@@H@Z */

+  puVar27 = auStack_228;

+  puVar28 = auStack_228;

+  iVar15 = 1;

+  local_res10 = param_1;

+  lVar17 = W32GetSessionState();

+  if (this == *(SURFACE **)(*(longlong *)(lVar17 + 0x58) + 0x10a8)) {

+    return 1;

+  }

+  lVar17 = 0;

+  if (this == (SURFACE *)0x0) {

+    return 1;

+  }

+  local_178 = 0;

+  local_170 = 0;

+  local_180 = 0;

+  local_1c8[0] = 0;

+  if (*(short *)(this + 100) == 0) {

+    local_178 = *(longlong *)(this + 0xc0);

+    local_170 = *(longlong *)(this + 0xb8);

+    local_1c8[0] = *(int *)(this + 0xd8);

+    local_180 = *(longlong *)(this + 0xe0);

+    lVar17 = *(longlong *)(this + 0x48) - (ulonglong)(*(uint *)(this + 0xd4) & 0xffff);

+  }

+  local_68 = *(undefined8 *)(this + 0x110);

+  uStack_60 = *(undefined8 *)(this + 0x118);

+  local_118 = *(ulonglong *)(this + 0x80);

+  local_58 = *(undefined8 *)(this + 0x120);

+  uStack_50 = *(undefined8 *)(this + 0x128);

+  uVar2 = *(ushort *)(this + 0x66);

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

+  local_48 = *(undefined8 *)(this + 0x130);

+  uStack_40 = *(undefined8 *)(this + 0x138);

+  local_1d8 = *(longlong *)(this + 0x48);

+  local_168 = *(longlong *)(this + 0xf8);

+  local_160 = *(longlong *)(this + 0x248);

+  pvStack_158 = *(void **)(this + 0x250);

+  local_1c8[2] = *(int *)(this + 0x140);

+  local_res20 = (HSEMAPHORE__ *)CONCAT44(local_res20._4_4_,(uint)uVar2);

+  local_150 = *(longlong *)(this + 600);

+  uStack_148 = *(undefined8 *)(this + 0x260);

+  local_140 = *(undefined8 *)(this + 0x268);

+  lVar18 = W32GetSessionState();

+  plVar4 = *(longlong **)(lVar18 + 0x58);

+  iVar12 = ExIsResourceAcquiredSharedLite(*plVar4 + 0x270);

+  lVar18 = W32GetSessionState();

+  local_108 = iVar12 == 0;

+  local_110 = *(SESSION_GLOBALS **)(lVar18 + 0x58);

+  if (iVar12 == 0) {

+    GreAcquireSemaphoreShared<1>(local_110);

+  }

+  lVar18 = *(longlong *)(this + 0x30);

+  local_130 = lVar18;

+  if (((lVar18 == 0) || ((*(uint *)(this + 0x70) & 0x400000) == 0)) ||

+     ((*(uint *)(lVar18 + 0x28) & 1) == 0)) {

+    NEEDDYNAMICMODECHANGESHARELOCK::vUnlockIfNeeded((NEEDDYNAMICMODECHANGESHARELOCK *)&local_110);

+  }

+  local_1b8 = 0;

+  DEVLOCKOBJ::DEVLOCKOBJ((DEVLOCKOBJ *)local_f8);

+  if (((*(uint *)(this + 0x70) & 0x400000) == 0) || (lVar18 == 0)) {

+    local_f8[0] = 0;

+    local_f8[1] = 0;

+    local_f8[2] = 0;

+    local_e0 = 0;

+    lVar18 = W32GetWin32kBaseApiSetTable();

+    pcVar5 = *(code **)(*(longlong *)(lVar18 + 0x18) + 0x300);

+    if ((pcVar5 != (code *)0x0) && (iVar12 = (*pcVar5)(), -1 < iVar12)) {

+      lVar18 = W32GetWin32kBaseApiSetTable();

+      pcVar5 = *(code **)(*(longlong *)(lVar18 + 0x18) + 0x308);

+      if (pcVar5 != (code *)0x0) {

+        (*pcVar5)(local_f8,0);

+      }

+    }

+    local_78 = 0;

+    local_80 = 0;

+    local_88 = 0;

+  }

+  else {

+    local_1b8 = 0;

+    iVar12 = PDEVOBJ::bAllowShareAccess((PDEVOBJ *)&local_130);

+    if ((iVar12 == 0) && ((*(uint *)(lVar18 + 0x28) & 0x8000) == 0)) {

+      lVar19 = W32GetSessionState();

+      local_1b8 = *(longlong *)*(SESSION_GLOBALS **)(lVar19 + 0x58) + 0x478;

+      GreAcquireSemaphore<2>(*(SESSION_GLOBALS **)(lVar19 + 0x58));

+    }

+    local_80 = 0;

+    local_f8[0] = 0;

+    local_f8[1] = 0;

+    local_88 = 0;

+    DEVLOCKOBJ::bPrepareTrgDco((DEVLOCKOBJ *)local_f8,(XDCOBJ *)0x0);

+    local_e0 = 1;

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

+      lVar19 = W32GetSessionState();

+      local_f8[0] = *(longlong *)(lVar18 + 0x30);

+      local_f8[2] = lVar18;

+      if (local_f8[0] == *(longlong *)*(SESSION_GLOBALS **)(lVar19 + 0x58) + 0x478) {

+        local_e0 = local_e0 | 0x100000;

+        GreAcquireSemaphore<2>(*(SESSION_GLOBALS **)(lVar19 + 0x58));

+      }

+      else {

+        GreAcquireSemaphore<8,PDEVOBJ>(lVar18);

+      }

+    }

+  }

+  local_1d0 = *(HOBJ__ **)this;

+  local_1c8[1] = 0x80000022;

+  lVar18 = W32GetSessionState();

+  uVar29 = (uint)((ulonglong)local_1d0 >> 8) & 0xff0000;

+  uVar13 = (uint)local_1d0 & 0xffff;

+  uVar30 = uVar29 | uVar13;

+  uVar25 = (ulonglong)uVar30;

+  puVar6 = *(uint **)(*(longlong *)(lVar18 + 0x58) + 0x1628);

+  uVar26 = uVar25;

+  if (0xffff < uVar30) {

+    uVar26 = uVar25 & 0xffff;

+    uVar30 = (uint)uVar26;

+    if (0x10000 < *puVar6) {

+      lVar18 = *(longlong *)(puVar6 + 4);

+      uVar3 = *(uint *)(lVar18 + 0x808);

+      if (uVar30 < (*(ushort *)(lVar18 + 2) + 0xffff) * 0x10000 + uVar3) {

+        if (uVar30 < uVar3) {

+          uVar24 = 0;

+        }

+        else {

+          uVar24 = (ulonglong)((uVar30 - uVar3 >> 0x10) + 1);

+        }

+        plVar7 = *(longlong **)(lVar18 + 8 + uVar24 * 8);

+        lVar18 = 0;

+        if ((int)uVar24 != 0) {

+          uVar26 = (ulonglong)(uVar30 + ((1 - (int)uVar24) * 0x10000 - uVar3));

+        }

+        if ((uint)uVar26 < *(uint *)((longlong)plVar7 + 0x14)) {

+          lVar18 = *plVar7 + uVar26 * 0x18;

+        }

+      }

+      else {

+        lVar18 = 0;

+      }

+      uVar26 = uVar25;

+      if ((uint)*(byte *)(lVar18 + 0xd) == uVar29 >> 0x10) {

+        uVar26 = (ulonglong)uVar13;

+      }

+    }

+  }

+  lVar18 = *(longlong *)(puVar6 + 4);

+  uVar13 = *(uint *)(lVar18 + 0x808);

+  uVar29 = (uint)uVar26;

+  if (uVar29 < (*(ushort *)(lVar18 + 2) + 0xffff) * 0x10000 + uVar13) {

+    if (uVar29 < uVar13) {

+      uVar25 = 0;

+    }

+    else {

+      uVar25 = (ulonglong)((uVar29 - uVar13 >> 0x10) + 1);

+    }

+    lVar19 = 0;

+    plVar7 = *(longlong **)(lVar18 + 8 + uVar25 * 8);

+    if ((int)uVar25 != 0) {

+      uVar26 = (ulonglong)(uVar29 + ((1 - (int)uVar25) * 0x10000 - uVar13));

+    }

+    if (((uint)uVar26 < *(uint *)((longlong)plVar7 + 0x14)) &&

+       (*(longlong *)

+         (*(longlong *)(*(longlong *)plVar7[3] + (uVar26 >> 8) * 8) + 8 + (uVar26 & 0xff) * 0x10) !=

+        0)) {

+      lVar19 = *plVar7 + uVar26 * 0x18;

+    }

+    if (((lVar19 != 0) && (*(char *)(lVar19 + 0xe) == '\x05')) &&

+       (*(short *)(lVar19 + 0xc) == (short)((ulonglong)local_1d0 >> 0x10))) {

+      local_1c8[1] = *(uint *)(lVar19 + 8) & 0xfffffffe;

+    }

+  }

+  pOVar20 = (OBJECT *)0x0;

+  local_res8 = (ulonglong)local_res8._4_4_ << 0x20;

+  puVar11 = auStack_228;

+  uVar13 = (uint)uVar2;

+  iVar12 = iVar15;

+  if (param_2 != 0) goto LAB_0;

+  lVar18 = plVar4[0x17b];

+  SEMOBJ<20>::SEMOBJ<20>(local_128);

+  local_1b0 = (uint *)0x0;

+  local_1a8 = local_1a8 & 0xffff000000000000;

+  lVar19 = W32GetSessionState();

+  pHVar31 = local_1d0;

+  local_1a0 = *(void **)(lVar19 + 0x58);

+  HANDLELOCK::vLockHandle

+            ((HANDLELOCK *)&local_1b0,

+             (uint)((ulonglong)local_1d0 >> 8) & 0xff0000 | (uint)local_1d0 & 0xffff,0);

+  puVar6 = local_1b0;

+  if ((int)local_1a8 != 0) {

+    pOVar20 = GdiHandleManager::GetEntryObject

+                        (*(GdiHandleManager **)((longlong)local_1a0 + 0x1628),*local_1b0);

+    if ((*(char *)((longlong)puVar6 + 0xe) == '\x05') &&

+       ((short)puVar6[3] == (short)((ulonglong)local_1d0 >> 0x10))) {

+      iVar16 = *(int *)(pOVar20 + 8);

+      if ((iVar16 == 1) && (*(short *)(pOVar20 + 0xc) == 0)) {

+        if (((int)lVar18 != 0) || ((*(byte *)((longlong)puVar6 + 0xf) & 1) == 0)) {

+          lVar18 = HmgPentryFromPobj(pOVar20);

+          if (*(char *)(lVar18 + 0xe) == '\x05') {

+            pvVar22 = *(void **)(pOVar20 + 0x2a8);

+            RVar23 = 0;

+LAB_1:

+            TrackObjectReferenceDecrement(RVar23,pvVar22);

+          }

+          else if (*(char *)(lVar18 + 0xe) == '\x10') {

+            pvVar22 = *(void **)(pOVar20 + 0x88);

+            RVar23 = 2;

+            goto LAB_1;

+          }

+          HANDLELOCK::vUnlockAndRelease((HANDLELOCK *)&local_1b0);

+          pHVar31 = local_1d0;

+          goto LAB_2;

+        }

+      }

+      else {

+        *(byte *)((longlong)puVar6 + 0xf) = *(byte *)((longlong)puVar6 + 0xf) | 8;

+        local_res8 = CONCAT44(local_res8._4_4_,iVar16);

+      }

+    }

+    else {

+      local_1a8._0_6_ = CONCAT15(1,(undefined5)local_1a8);

+    }

+    HANDLELOCK::vUnlock((HANDLELOCK *)&local_1b0);

+    pOVar20 = (OBJECT *)0x0;

+    pHVar31 = local_1d0;

+  }

+LAB_2:

+  HANDLELOCK::~HANDLELOCK((HANDLELOCK *)&local_1b0);

+  SEMOBJ<20>::vUnlock(local_128);

+  if (pOVar20 != (OBJECT *)0x0) {

+    puVar11 = auStack_228;

+    uVar13 = (uint)local_res20;

+    goto LAB_0;

+  }

+  if (local_res10 == 1) {

+    while( true ) {

+      *(undefined8 **)(puVar28 + 0x28) = &local_res8;

+      puVar28[0x20] = 5;

+      *(undefined8 *)(puVar28 + -8) = 0x14003ddf6;

+      pvVar22 = HmgRemoveObjectImpl(pHVar31,0,1,2,puVar28[0x20],*(ulong **)(puVar28 + 0x28));

+      puVar27 = puVar28;

+      if (pvVar22 == (void *)0x0) break;

+      puVar11 = puVar28;

+      uVar13 = (uint)local_res20;

+LAB_0:

+      puVar27 = puVar11;

+      pHVar31 = (HOBJ__ *)0x0;

+      if (*(int *)(puVar27 + 0x68) != 0) {

+        LOCK();

+        *(int *)((longlong)plVar4 + 0xc) = *(int *)((longlong)plVar4 + 0xc) + -1;

+        UNLOCK();

+      }

+      if (((*(uint *)(this + 0x70) & 0x40000) != 0) && (*(longlong *)(this + 0x230) != 0)) {

+        *(undefined8 *)(puVar27 + -8) = 0x14003ddb7;

+        MicrosoftTelemetryAssertTriggeredNoArgsKM();

+      }

+      *(undefined8 *)(puVar27 + -8) = 0x14003d7cf;

+      lVar18 = W32GetWin32kBaseApiSetTable();

+      pcVar5 = *(code **)(*(longlong *)(lVar18 + 0x18) + 0x818);

+      if (pcVar5 != (code *)0x0) {

+        *(undefined8 *)(puVar27 + -8) = 0x14003d7e9;

+        iVar16 = (*pcVar5)();

+        if (-1 < iVar16) {

+          *(undefined8 *)(puVar27 + -8) = 0x14003d7f4;

+          lVar18 = W32GetWin32kBaseApiSetTable();

+          pcVar5 = *(code **)(*(longlong *)(lVar18 + 0x18) + 0x820);

+          if (pcVar5 != (code *)0x0) {

+            *(undefined8 *)(puVar27 + -8) = 0x14003d811;

+            (*pcVar5)(this);

+          }

+        }

+      }

+      *(undefined8 *)(puVar27 + -8) = 0x14003d819;

+      vDeleteDriverRealization(this);

+      lVar19 = local_178;

+      lVar18 = local_180;

+      if (local_180 != 0) {

+        *(undefined8 *)(puVar27 + -8) = 0x14003db1a;

+        uVar13 = PsGetCurrentProcessId();

+        if (*(uint *)(this + 0xd0) == (uVar13 & 0xfffffffc)) {

+          *(undefined8 *)(puVar27 + -8) = 0x14003db38;

+          MmUnsecureVirtualMemory(lVar18);

+        }

+LAB_3:

+        if ((*(uint *)(this + 0x74) & 0x1000) != 0) {

+          *(undefined4 *)(puVar27 + 0x40) = 0;

+          *(undefined8 *)(puVar27 + 0x38) = 0;

+          *(undefined8 *)(puVar27 + 0x30) = 0;

+          *(ulonglong *)(puVar27 + 0x28) = (ulonglong)*(uint *)(puVar27 + 100);

+          *(ulonglong *)(puVar27 + 0x20) = local_res8 & 0xffffffff;

+          *(undefined8 *)(puVar27 + -8) = 0x14003da61;

+          DbgkWerCaptureLiveKernelDump(L"GreLKD",400,4,*(undefined8 *)(puVar27 + 0x58));

+        }

+        *(undefined8 *)(puVar27 + -8) = 0x14003d872;

+        SURFACE_Free(this);

+        lVar17 = local_120;

+        if (local_120 != 0) {

+          *(undefined8 *)(puVar27 + -8) = 0x14003dd01;

+          lVar18 = W32GetWin32kBaseApiSetTable();

+          pcVar5 = *(code **)(*(longlong *)(lVar18 + 0x18) + 0x848);

+          if (pcVar5 != (code *)0x0) {

+            *(undefined8 *)(puVar27 + -8) = 0x14003dd1f;

+            iVar15 = (*pcVar5)();

+            if (-1 < iVar15) {

+              *(undefined8 *)(puVar27 + -8) = 0x14003dd2e;

+              lVar18 = W32GetWin32kBaseApiSetTable();

+              pcVar5 = *(code **)(*(longlong *)(lVar18 + 0x18) + 0x850);

+              if (pcVar5 != (code *)0x0) {

+                *(undefined8 *)(puVar27 + -8) = 0x14003dd4f;

+                (*pcVar5)(lVar17);

+              }

+            }

+          }

+        }

+        if (local_118 != 0) {

+          local_res8 = local_118;

+          *(undefined8 *)(puVar27 + -8) = 0x14003d89b;

+          XEPALOBJ::vUnrefPalette((XEPALOBJ *)&local_res8);

+        }

+        goto LAB_4;

+      }

+      if (*(int *)(puVar27 + 0x60) != 0) {

+        if (*(longlong *)(puVar27 + 0x50) != 0) {

+          local_160 = 0;

+          pvStack_158 = (void *)0x0;

+          uStack_148 = 0;

+          local_140 = 0;

+          local_138 = 3;

+          local_150 = lVar17;

+          *(undefined8 *)(puVar27 + -8) = 0x14003dc30;

+          Gre::MapViewOfSectionObj::Unmap((MapViewOfSectionObj *)&local_160);

+        }

+        goto LAB_3;

+      }

+      if (local_178 != 0) {

+        *(undefined8 *)(puVar27 + -8) = 0x14003d8ed;

+        uVar13 = PsGetCurrentProcessId();

+        if (*(uint *)(this + 0xd0) == (uVar13 & 0xfffffffc)) {

+          *(undefined8 *)(puVar27 + -8) = 0x14003d90b;

+          MmUnsecureVirtualMemory(lVar19);

+          if (*(longlong *)(puVar27 + 0x50) != 0) {

+            if (local_170 == 0) {

+              local_res20 = (HSEMAPHORE__ *)0x0;

+              *(undefined8 *)(puVar27 + -8) = 0x14003d949;

+              ZwFreeVirtualMemory(0xffffffffffffffff,puVar27 + 0x50,&local_res20,0x8000);

+            }

+            else {

+              *(undefined8 *)(puVar27 + -8) = 0x14003db09;

+              ZwUnmapViewOfSection(0xffffffffffffffff,lVar17);

+            }

+          }

+        }

+        goto LAB_3;

+      }

+      if ((uVar13 & 8) != 0) {

+        if (-1 < (char)uVar13) {

+          *(undefined8 *)(puVar27 + -8) = 0x14003dcf5;

+          EngFreeUserMem(*(undefined8 *)(puVar27 + 0x50));

+          goto LAB_3;

+        }

+        *(undefined8 *)(puVar27 + -8) = 0x14003da79;

+        p_Var21 = GreGetCurrentThread();

+        pvVar22 = pvStack_158;

+        iVar15 = (int)uStack_148;

+        bVar32 = (int)uStack_148 != 0;

+        *(undefined8 *)(puVar27 + 0x78) = 0;

+        local_198 = 0;

+        local_1a0 = pvVar22;

+        if (bVar32) {

+          local_1a0 = *(void **)(puVar27 + 0x50);

+        }

+        local_1a8 = 0;

+        local_190 = 0;

+        local_188 = 1;

+        *(undefined8 *)(puVar27 + -8) = 0x14003dab4;

+        Gre::MapViewOfSectionObj::Unmap((MapViewOfSectionObj *)(puVar27 + 0x78));

+        if ((p_Var21 == (_GRETHREAD *)0x0) || (*(longlong *)(p_Var21 + 0x40) == 0)) {

+          if ((int)local_140 != 0) {

+            uVar14 = uStack_148._4_4_;

+            goto LAB_5;

+          }

+          *(undefined8 *)(puVar27 + -8) = 0x14003de4a;

+          lVar17 = W32GetWin32kBaseApiSetTable();

+          pcVar5 = *(code **)(*(longlong *)(lVar17 + 0x18) + 0x838);

+          if (pcVar5 != (code *)0x0) {

+            *(undefined8 *)(puVar27 + -8) = 0x14003de6b;

+            iVar15 = (*pcVar5)();

+            if (-1 < iVar15) {

+              uVar10 = *(undefined8 *)(puVar27 + 0x50);

+              *(undefined8 *)(puVar27 + -8) = 0x14003de7f;

+              lVar17 = W32GetWin32kBaseApiSetTable();

+              pcVar5 = *(code **)(*(longlong *)(lVar17 + 0x18) + 0x840);

+              if (pcVar5 != (code *)0x0) {

+                *(undefined8 *)(puVar27 + -8) = 0x14003dea0;

+                (*pcVar5)(uVar10);

+              }

+            }

+          }

+        }

+        else {

+          *(undefined8 *)(puVar27 + -8) = 0x14003dce6;

+          uVar14 = UMPDGetThreadClientPID(p_Var21);

+LAB_5:

+          pvVar22 = *(void **)(puVar27 + 0x50);

+          if (iVar15 != 0) {

+            pvVar22 = pvStack_158;

+          }

+          *(undefined8 *)(puVar27 + -8) = 0x14003dade;

+          Gre::MapViewOfSectionObj::Unmap(uVar14,pvVar22);

+        }

+        if (local_160 == 0) {

+          *(undefined4 *)(puVar27 + 0x40) = 0;

+          *(undefined8 *)(puVar27 + 0x38) = 0;

+          *(undefined8 *)(puVar27 + 0x30) = 0;

+          *(undefined8 *)(puVar27 + 0x28) = 0;

+          *(undefined8 *)(puVar27 + 0x20) = 0;

+          *(undefined8 *)(puVar27 + -8) = 0x14003dd9b;

+          DbgkWerCaptureLiveKernelDump(L"GreLKD",400,0x44);

+        }

+        else {

+          *(undefined8 *)(puVar27 + -8) = 0x14003daf5;

+          ObfDereferenceObject();

+        }

+        goto LAB_3;

+      }

+      if ((uVar13 >> 0xb & 1) == 0) {

+        if ((uVar13 & 0x10) != 0) {

+          *(undefined8 *)(puVar27 + -8) = 0x14003df08;

+          vFreeKernelSection(*(void **)(puVar27 + 0x50));

+        }

+        goto LAB_3;

+      }

+      local_res20 = (HSEMAPHORE__ *)(*plVar4 + 0x3a8);

+      *(undefined8 *)(puVar27 + -8) = 0x14003db59;

+      GreAcquireSemaphoreInternal(local_res20);

+      *(undefined8 *)(puVar27 + -8) = 0x14003db5e;

+      GrepAcquireLockValidate<36>();

+      p_Var8 = *(_W32PROCESS **)(this + 0x108);

+      if (p_Var8 == (_W32PROCESS *)0x0) {

+LAB_6:

+        *(undefined8 *)(puVar27 + -8) = 0x14003dbc5;

+        W32PIDLOCK::vCleanUp((W32PIDLOCK *)&local_68);

+        lVar17 = local_168;

+        if (local_168 != 0) {

+          *(undefined8 *)(puVar27 + -8) = 0x14003dbd8;

+          ObfDereferenceObject(lVar17);

+        }

+        *(undefined8 *)(puVar27 + -8) = 0x14003dbe9;

+        SEMOBJ<36>::vUnlock((SEMOBJ<36> *)&local_res20);

+        goto LAB_3;

+      }

+      pSVar1 = this + 0x210;

+      pSVar9 = *(SURFACE **)pSVar1;

+      if (pSVar9 == pSVar1) {

+LAB_7:

+        pvVar22 = *(void **)(puVar27 + 0x50);

+        if ((pvVar22 != (void *)0x0) && (local_168 != 0)) {

+          *(undefined8 *)(puVar27 + -8) = 0x14003dbaf;

+          uVar14 = GrepW32PidFromW32Process(p_Var8);

+          *(undefined8 *)(puVar27 + -8) = 0x14003dbb9;

+          Gre::MapViewOfSectionObj::Unmap(uVar14,pvVar22);

+        }

+        goto LAB_6;

+      }

+      if ((*(SURFACE **)(pSVar9 + 8) == pSVar1) &&

+         (plVar7 = *(longlong **)(this + 0x218), (SURFACE *)*plVar7 == pSVar1)) {

+        *plVar7 = (longlong)pSVar9;

+        *(longlong **)(pSVar9 + 8) = plVar7;

+        goto LAB_7;

+      }

+      pcVar5 = (code *)swi(0x29);

+      (*pcVar5)(3);

+      puVar28 = puVar27 + 8;

+    }

+  }

+  iVar12 = 0;

+  if ((int)local_res8 == 1) {

+    if ((*(uint *)(this + 0x70) >> 0xb & 1) == 0) {

+      *(undefined8 *)(puVar27 + -8) = 0x14003da07;

+      EngSetLastError(0xaa);

+      goto LAB_4;

+    }

+  }

+  else {

+    if (*(longlong *)(this + 0xa0) == 0) {

+      *(undefined8 *)(puVar27 + -8) = 0x14003debd;

+      iVar16 = bStockSurface(this);

+      if ((iVar16 == 0) && ((*(uint *)(this + 0x70) >> 0xb & 1) == 0)) goto LAB_4;

+    }

+    if ((*(uint *)(this + 0x70) >> 0xb & 1) == 0) {

+      *(uint *)(this + 0x70) = *(uint *)(this + 0x70) | 0x1000000;

+    }

+    else if (*(int *)(this + 0x140) == 0) {

+      *(undefined4 *)(this + 0x140) = 1;

+      LOCK();

+      *(int *)((longlong)plVar4 + 0xc) = *(int *)((longlong)plVar4 + 0xc) + 1;

+      UNLOCK();

+    }

+  }

+  *(undefined8 *)(puVar27 + -8) = 0x14003d9f1;

+  HmgDecrementShareReferenceCountEx(this,0);

+  iVar12 = iVar15;

+LAB_4:

+  *(undefined8 *)(puVar27 + -8) = 0x14003d8a4;

+  DEVLOCKOBJ::~DEVLOCKOBJ((DEVLOCKOBJ *)local_f8);

+  *(undefined8 *)(puVar27 + -8) = 0x14003d8ae;

+  NEEDGRELOCK::vUnlock((NEEDGRELOCK *)(puVar27 + 0x70));

+  *(undefined8 *)(puVar27 + -8) = 0x14003d8b7;

+  NEEDDYNAMICMODECHANGESHARELOCK::vUnlockIfNeeded((NEEDDYNAMICMODECHANGESHARELOCK *)&local_110);

+  return iVar12;

+}

+
```

## `HANDLELOCK::vLockHandle`  (modified)

```diff
--- HANDLELOCK::vLockHandle
+++ HANDLELOCK::vLockHandle
@@ -1,2 +1,366 @@
-Failed to decompile win32kbase.sys - .ProgramDB HANDLELOCK::vLockHandle : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: void __cdecl HANDLELOCK::vLockHandle(unsigned int,enum HandleLockOptions) __ptr64 */

+

+void __thiscall HANDLELOCK::vLockHandle(HANDLELOCK *this,uint param_1,HandleLockOptions param_2)

+

+{

+  longlong lVar1;

+  uint *puVar2;

+  char cVar3;

+  int iVar4;

+  int iVar5;

+  longlong *plVar6;

+  longlong lVar7;

+  longlong lVar8;

+  uint *puVar9;

+  uint uVar10;

+  ulonglong uVar11;

+  uint uVar12;

+  uint uVar13;

+  uint uVar14;

+  longlong lVar15;

+  longlong lVar16;

+  uint uVar17;

+  undefined8 uVar18;

+  undefined8 local_res20;

+  longlong local_58;

+  

+  lVar8 = 0;

+  local_res20 = 0;

+  plVar6 = (longlong *)PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion(&local_res20);

+  cVar3 = KeIsAttachedProcess();

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

+LAB_0:

+    lVar16 = lVar8;

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

+      lVar16 = *plVar6;

+    }

+    if (lVar16 != 0) {

+      lVar8 = lVar16 + 8;

+    }

+    if (lVar8 == 0) goto LAB_1;

+    local_58 = *(longlong *)(lVar8 + 0x40);

+  }

+  else {

+    uVar18 = PsGetCurrentProcess();

+    iVar4 = PsGetProcessSessionIdEx(uVar18);

+    uVar18 = PsGetCurrentThreadProcess();

+    iVar5 = PsGetProcessSessionIdEx(uVar18);

+    if (iVar4 == iVar5) goto LAB_0;

+LAB_1:

+    local_58 = 0;

+  }

+  *(undefined4 *)(this + 8) = 1;

+  puVar2 = *(uint **)(*(longlong *)(this + 0x10) + 0x1628);

+  uVar12 = param_1;

+  if ((0xffff < param_1) && (uVar12 = param_1 & 0xffff, 0x10000 < *puVar2)) {

+    lVar16 = *(longlong *)(puVar2 + 4);

+    uVar17 = *(uint *)(lVar16 + 0x808);

+    if (uVar12 < (*(ushort *)(lVar16 + 2) + 0xffff) * 0x10000 + uVar17) {

+      if (uVar12 < uVar17) {

+        plVar6 = *(longlong **)(lVar16 + 8);

+      }

+      else {

+        uVar13 = (uVar12 - uVar17 >> 0x10) + 1;

+        plVar6 = *(longlong **)(lVar16 + 8 + (ulonglong)uVar13 * 8);

+        uVar12 = uVar12 + ((1 - uVar13) * 0x10000 - uVar17);

+      }

+      lVar16 = 0;

+      if (uVar12 < *(uint *)((longlong)plVar6 + 0x14)) {

+        lVar16 = *plVar6 + (ulonglong)uVar12 * 0x18;

+      }

+    }

+    else {

+      lVar16 = 0;

+    }

+    uVar12 = param_1;

+    if ((uint)*(byte *)(lVar16 + 0xd) == param_1 >> 0x10) {

+      uVar12 = param_1 & 0xffff;

+    }

+  }

+  lVar16 = *(longlong *)(puVar2 + 4);

+  uVar17 = *(uint *)(lVar16 + 0x808);

+  if ((*(ushort *)(lVar16 + 2) + 0xffff) * 0x10000 + uVar17 <= uVar12) {

+    *(undefined8 *)this = 0;

+LAB_2:

+    if ((param_2 & 8) != 0) {

+      GrepCaptureLiveMemoryDump(400,0x38,0,0,0,0);

+    }

+    *(undefined4 *)(this + 8) = 0;

+    KeLeaveCriticalRegion();

+    return;

+  }

+  if (uVar12 < uVar17) {

+    plVar6 = *(longlong **)(lVar16 + 8);

+  }

+  else {

+    uVar13 = (uVar12 - uVar17 >> 0x10) + 1;

+    plVar6 = *(longlong **)(lVar16 + 8 + (ulonglong)uVar13 * 8);

+    uVar12 = uVar12 + ((1 - uVar13) * 0x10000 - uVar17);

+  }

+  lVar16 = 0;

+  if (uVar12 < *(uint *)((longlong)plVar6 + 0x14)) {

+    lVar15 = (ulonglong)(uVar12 & 0xff) * 0x10;

+    lVar1 = (ulonglong)(uVar12 >> 8) * 8;

+    lVar7 = *(longlong *)(*(longlong *)plVar6[3] + lVar1) + lVar15;

+    KeEnterCriticalRegion();

+    ExAcquirePushLockExclusiveEx(lVar7,0);

+    if ((uVar12 < *(uint *)((longlong)plVar6 + 0x14)) &&

+       (*(longlong *)(*(longlong *)(*(longlong *)plVar6[3] + lVar1) + 8 + lVar15) != 0)) {

+      *(undefined1 *)((ulonglong)uVar12 * 0x18 + 6 + *plVar6) = 1;

+      lVar16 = *plVar6 + (ulonglong)uVar12 * 0x18;

+    }

+    else {

+      ExReleasePushLockExclusiveEx(lVar7,0);

+      KeLeaveCriticalRegion();

+    }

+  }

+  *(longlong *)this = lVar16;

+  if (lVar16 == 0) goto LAB_2;

+  if ((param_2 & 1) == 0) {

+    uVar12 = *(uint *)(lVar16 + 8) & 0xfffffffe;

+    if (((uVar12 != ((uint)local_res20 & 0xfffffffc)) && (uVar12 != 0)) &&

+       ((local_58 == 0 || (uVar17 = UMPDGetThreadClientPID(lVar8), uVar12 != uVar17)))) {

+      if ((param_2 & 8) != 0) {

+        GrepCaptureLiveMemoryDump(400,0x38,1,0,0,0);

+      }

+      goto LAB_3;

+    }

+  }

+  if (((param_2 & 2) == 0) && ((*(byte *)(*(longlong *)this + 0xf) & 0x20) != 0)) {

+    if ((param_2 & 8) != 0) {

+      GrepCaptureLiveMemoryDump(400,0x38,2,0,0,0);

+    }

+    puVar2 = *(uint **)(*(longlong *)(this + 0x10) + 0x1628);

+    uVar12 = **(uint **)this;

+    uVar11 = (ulonglong)uVar12;

+    if (0xffff < uVar12) {

+      uVar11 = (ulonglong)(ushort)uVar12;

+      uVar17 = uVar12 & 0xffff;

+      if (0x10000 < *puVar2) {

+        lVar8 = *(longlong *)(puVar2 + 4);

+        uVar13 = *(uint *)(lVar8 + 0x808);

+        if ((uVar12 & 0xffff) < (*(ushort *)(lVar8 + 2) + 0xffff) * 0x10000 + uVar13) {

+          if ((uVar12 & 0xffff) < uVar13) {

+            plVar6 = *(longlong **)(lVar8 + 8);

+          }

+          else {

+            uVar17 = ((uVar12 & 0xffff) - uVar13 >> 0x10) + 1;

+            plVar6 = *(longlong **)(lVar8 + 8 + (ulonglong)uVar17 * 8);

+            uVar17 = (uVar12 & 0xffff) + ((1 - uVar17) * 0x10000 - uVar13);

+          }

+          lVar8 = 0;

+          if (uVar17 < *(uint *)((longlong)plVar6 + 0x14)) {

+            lVar8 = *plVar6 + (ulonglong)uVar17 * 0x18;

+          }

+        }

+        else {

+          lVar8 = 0;

+        }

+        uVar11 = (ulonglong)uVar12;

+        if ((uint)*(byte *)(lVar8 + 0xd) == uVar12 >> 0x10) {

+          uVar11 = (ulonglong)(uVar12 & 0xffff);

+        }

+      }

+    }

+    lVar8 = *(longlong *)(puVar2 + 4);

+    uVar12 = *(uint *)(lVar8 + 0x808);

+    uVar17 = (uint)uVar11;

+    if (uVar17 < (*(ushort *)(lVar8 + 2) + 0xffff) * 0x10000 + uVar12) {

+      if (uVar17 < uVar12) {

+        lVar16 = *(longlong *)(lVar8 + 8);

+      }

+      else {

+        uVar13 = (uVar17 - uVar12 >> 0x10) + 1;

+        lVar16 = *(longlong *)(lVar8 + 8 + (ulonglong)uVar13 * 8);

+        uVar11 = (ulonglong)(uVar17 + ((1 - uVar13) * 0x10000 - uVar12));

+      }

+      if ((uint)uVar11 < *(uint *)(lVar16 + 0x14)) {

+        puVar9 = *(uint **)(*(longlong *)(**(longlong **)(lVar16 + 0x18) + (uVar11 >> 8) * 8) + 8 +

+                           (uVar11 & 0xff) * 0x10);

+        goto LAB_4;

+      }

+    }

+    puVar9 = (uint *)0x0;

+LAB_4:

+    uVar12 = *puVar9;

+    uVar13 = uVar12 & 0xffff;

+    uVar14 = uVar12 >> 8 & 0xff0000 | uVar13;

+    uVar17 = uVar14;

+    if ((0xffff < uVar14) && (uVar17 = uVar13, 0x10000 < *puVar2)) {

+      uVar17 = *(uint *)(lVar8 + 0x808);

+      if (uVar13 < (*(ushort *)(lVar8 + 2) + 0xffff) * 0x10000 + uVar17) {

+        if (uVar13 < uVar17) {

+          plVar6 = *(longlong **)(lVar8 + 8);

+          uVar17 = uVar13;

+        }

+        else {

+          uVar10 = (uVar13 - uVar17 >> 0x10) + 1;

+          plVar6 = *(longlong **)(lVar8 + 8 + (ulonglong)uVar10 * 8);

+          uVar17 = uVar13 + ((1 - uVar10) * 0x10000 - uVar17);

+        }

+        lVar8 = 0;

+        if (uVar17 < *(uint *)((longlong)plVar6 + 0x14)) {

+          lVar8 = *plVar6 + (ulonglong)uVar17 * 0x18;

+        }

+      }

+      else {

+        lVar8 = 0;

+      }

+      uVar17 = uVar14;

+      if ((uint)*(byte *)(lVar8 + 0xd) == uVar12 >> 0x18) {

+        uVar17 = uVar13;

+      }

+    }

+    lVar8 = *(longlong *)(puVar2 + 4);

+    uVar12 = *(uint *)(lVar8 + 0x808);

+    if (uVar17 < (*(ushort *)(lVar8 + 2) + 0xffff) * 0x10000 + uVar12) {

+      if (uVar17 < uVar12) {

+        plVar6 = *(longlong **)(lVar8 + 8);

+      }

+      else {

+        uVar13 = (uVar17 - uVar12 >> 0x10) + 1;

+        plVar6 = *(longlong **)(lVar8 + 8 + (ulonglong)uVar13 * 8);

+        uVar17 = uVar17 + ((1 - uVar13) * 0x10000 - uVar12);

+      }

+      *(undefined1 *)(*plVar6 + 6 + (ulonglong)uVar17 * 0x18) = 0;

+      ExReleasePushLockExclusiveEx

+                (((ulonglong)uVar17 & 0xff) * 0x10 +

+                 *(longlong *)(*(longlong *)plVar6[3] + (ulonglong)(uVar17 >> 8) * 8),0);

+      KeLeaveCriticalRegion();

+    }

+    *(undefined4 *)(this + 8) = 0;

+    *(undefined8 *)this = 0;

+    KeLeaveCriticalRegion();

+    return;

+  }

+  if (((param_2 & 4) == 0) && ((*(byte *)((longlong)*(uint **)this + 0xf) & 0x40) != 0)) {

+    uVar12 = **(uint **)this;

+    puVar2 = *(uint **)(*(longlong *)(this + 0x10) + 0x1628);

+    uVar11 = (ulonglong)uVar12;

+    if (0xffff < uVar12) {

+      uVar11 = (ulonglong)(ushort)uVar12;

+      uVar17 = uVar12 & 0xffff;

+      if (0x10000 < *puVar2) {

+        lVar16 = *(longlong *)(puVar2 + 4);

+        uVar13 = *(uint *)(lVar16 + 0x808);

+        if ((uVar12 & 0xffff) < (*(ushort *)(lVar16 + 2) + 0xffff) * 0x10000 + uVar13) {

+          if ((uVar12 & 0xffff) < uVar13) {

+            plVar6 = *(longlong **)(lVar16 + 8);

+          }

+          else {

+            uVar17 = ((uVar12 & 0xffff) - uVar13 >> 0x10) + 1;

+            plVar6 = *(longlong **)(lVar16 + 8 + (ulonglong)uVar17 * 8);

+            uVar17 = (uVar12 & 0xffff) + ((1 - uVar17) * 0x10000 - uVar13);

+          }

+          lVar16 = 0;

+          if (uVar17 < *(uint *)((longlong)plVar6 + 0x14)) {

+            lVar16 = *plVar6 + (ulonglong)uVar17 * 0x18;

+          }

+        }

+        else {

+          lVar16 = 0;

+        }

+        uVar11 = (ulonglong)uVar12;

+        if ((uint)*(byte *)(lVar16 + 0xd) == uVar12 >> 0x10) {

+          uVar11 = (ulonglong)(uVar12 & 0xffff);

+        }

+      }

+    }

+    lVar16 = *(longlong *)(puVar2 + 4);

+    uVar12 = *(uint *)(lVar16 + 0x808);

+    uVar17 = (uint)uVar11;

+    if (uVar17 < (*(ushort *)(lVar16 + 2) + 0xffff) * 0x10000 + uVar12) {

+      if (uVar17 < uVar12) {

+        lVar16 = *(longlong *)(lVar16 + 8);

+      }

+      else {

+        uVar13 = (uVar17 - uVar12 >> 0x10) + 1;

+        lVar16 = *(longlong *)(lVar16 + 8 + (ulonglong)uVar13 * 8);

+        uVar11 = (ulonglong)(uVar17 + ((1 - uVar13) * 0x10000 - uVar12));

+      }

+      if (*(uint *)(lVar16 + 0x14) <= (uint)uVar11) goto LAB_5;

+      lVar16 = *(longlong *)

+                (*(longlong *)(**(longlong **)(lVar16 + 0x18) + (uVar11 >> 8) * 8) + 8 +

+                (uVar11 & 0xff) * 0x10);

+    }

+    else {

+LAB_5:

+      lVar16 = 0;

+    }

+    if ((*(short *)(lVar16 + 0xc) != 0) && (*(void **)(lVar16 + 0x10) == SystemReserved1[0xf]))

+    goto LAB_6;

+    if ((param_2 & 8) == 0) goto LAB_3;

+    uVar18 = 5;

+  }

+  else {

+LAB_6:

+    puVar2 = *(uint **)(*(longlong *)(this + 0x10) + 0x1628);

+    uVar12 = **(uint **)this;

+    uVar17 = uVar12;

+    if ((0xffff < uVar12) && (uVar17 = uVar12 & 0xffff, 0x10000 < *puVar2)) {

+      lVar16 = *(longlong *)(puVar2 + 4);

+      uVar13 = *(uint *)(lVar16 + 0x808);

+      if (uVar17 < (*(ushort *)(lVar16 + 2) + 0xffff) * 0x10000 + uVar13) {

+        if (uVar17 < uVar13) {

+          plVar6 = *(longlong **)(lVar16 + 8);

+        }

+        else {

+          uVar14 = (uVar17 - uVar13 >> 0x10) + 1;

+          plVar6 = *(longlong **)(lVar16 + 8 + (ulonglong)uVar14 * 8);

+          uVar17 = uVar17 + ((1 - uVar14) * 0x10000 - uVar13);

+        }

+        lVar16 = 0;

+        if (uVar17 < *(uint *)((longlong)plVar6 + 0x14)) {

+          lVar16 = *plVar6 + (ulonglong)uVar17 * 0x18;

+        }

+      }

+      else {

+        lVar16 = 0;

+      }

+      uVar17 = uVar12;

+      if ((uint)*(byte *)(lVar16 + 0xd) == uVar12 >> 0x10) {

+        uVar17 = uVar12 & 0xffff;

+      }

+    }

+    lVar16 = *(longlong *)(puVar2 + 4);

+    uVar12 = *(uint *)(lVar16 + 0x808);

+    if (uVar17 < (*(ushort *)(lVar16 + 2) + 0xffff) * 0x10000 + uVar12) {

+      if (uVar17 < uVar12) {

+        lVar16 = *(longlong *)(lVar16 + 8);

+      }

+      else {

+        uVar13 = (uVar17 - uVar12 >> 0x10) + 1;

+        lVar16 = *(longlong *)(lVar16 + 8 + (ulonglong)uVar13 * 8);

+        uVar17 = uVar17 + ((1 - uVar13) * 0x10000 - uVar12);

+      }

+      if (*(uint *)(lVar16 + 0x14) <= uVar17) goto LAB_7;

+      lVar16 = *(longlong *)

+                (*(longlong *)(**(longlong **)(lVar16 + 0x18) + (ulonglong)(uVar17 >> 8) * 8) + 8 +

+                (ulonglong)(byte)uVar17 * 0x10);

+    }

+    else {

+LAB_7:

+      lVar16 = 0;

+    }

+    if ((*(byte *)(lVar16 + 0xe) & 0x20) == 0) {

+      return;

+    }

+    if (((lVar8 != 0) && (lVar8 = *(longlong *)(lVar8 + 0x150), lVar8 != 0)) &&

+       (*(char *)(lVar8 + 0x50) != '\0')) {

+      for (uVar11 = 0; uVar11 < *(ulonglong *)(lVar8 + 0x18); uVar11 = uVar11 + 1) {

+        if (*(uint *)(*(longlong *)(lVar8 + 0x28) + uVar11 * 4) == param_1) {

+          return;

+        }

+      }

+    }

+    this[0xc] = (HANDLELOCK)0x1;

+    if ((param_2 & 8) == 0) goto LAB_3;

+    uVar18 = 6;

+  }

+  DbgkWerCaptureLiveKernelDump(L"GreLKD",400,0x38,uVar18,0,0,0,0,0);

+LAB_3:

+  vUnlock(this);

+  return;

+}

+
```

## `CTouchProcessor::UnreferenceMsgData`  (modified)

```diff
--- CTouchProcessor::UnreferenceMsgData
+++ CTouchProcessor::UnreferenceMsgData
@@ -1,2 +1,110 @@
-Failed to decompile win32kbase.sys - .ProgramDB CTouchProcessor::UnreferenceMsgData : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: void __cdecl CTouchProcessor::UnreferenceMsgData(unsigned __int64,enum

+   tagPOINTERMSGDATA_REFTYPE,void * __ptr64) __ptr64 */

+

+void __thiscall

+CTouchProcessor::UnreferenceMsgData

+          (CTouchProcessor *this,__uint64 param_1,tagPOINTERMSGDATA_REFTYPE param_2,void *param_3)

+

+{

+  bool bVar1;

+  bool bVar2;

+  CPointerMsgData *pCVar3;

+  longlong lVar4;

+  RECORDER_LOG__ *pRVar5;

+  ushort uVar6;

+  uint uVar7;

+  ulonglong uVar8;

+  char cVar9;

+  longlong lVar10;

+  CPointerInputFramePhase CVar11;

+  undefined8 in_stack_ffffffffffffffa8;

+  

+  lVar10 = (longlong)(int)param_2;

+  pCVar3 = GetNonConstMsgData(this,param_1);

+  bVar2 = CEResourceLock::Locked((CEResourceLock *)(this + 0x20));

+  bVar1 = true;

+  if (!bVar2) {

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20001,0x2c31);

+  }

+  if (*(int *)(pCVar3 + 0x18) == 0) {

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20001,0x2c41);

+  }

+  LOCK();

+  *(int *)(pCVar3 + 0x18) = *(int *)(pCVar3 + 0x18) + -1;

+  UNLOCK();

+  if (param_2 == 1) {

+    if ((*(uint *)(pCVar3 + 0x24) & 0x40) == 0) {

+      MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20001,0x2c46);

+    }

+    if ((*(uint *)(pCVar3 + 0x24) & 0x40) == 0) {

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

+          ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x29] < 2)

+         ) {

+        cVar9 = '\0';

+      }

+      else {

+        cVar9 = '\x01';

+      }

+      bVar2 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+      if ((cVar9 != '\0') || (bVar2)) {

+        lVar4 = W32GetUserSessionState();

+        in_stack_ffffffffffffffa8 = CONCAT71((int7)((ulonglong)in_stack_ffffffffffffffa8 >> 8),2);

+        WPP_RECORDER_AND_TRACE_SF_q

+                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar9,bVar2,

+                   *(undefined8 *)(lVar4 + 0x10f88),in_stack_ffffffffffffffa8,4,0x11e,

+                   &WPP_9b909e6f7a6f3ba61ffc5a77a7a32fbe_Traceguids,pCVar3);

+      }

+    }

+    *(uint *)(pCVar3 + 0x24) = *(uint *)(pCVar3 + 0x24) & 0xffffffbf;

+  }

+  else if (8 < param_2) {

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20001,0x2c51);

+    return;

+  }

+  if (pCVar3[lVar10 + 0x34] == (CPointerMsgData)0x0) {

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20001,0x2c56);

+  }

+  CVar11 = (CPointerInputFramePhase)in_stack_ffffffffffffffa8;

+  if (pCVar3[lVar10 + 0x34] != (CPointerMsgData)0x0) {

+    pCVar3[lVar10 + 0x34] = (CPointerMsgData)((char)pCVar3[lVar10 + 0x34] + -1);

+    if (*(int *)(pCVar3 + 0x18) == 0) {

+      uVar8 = 0;

+      do {

+        if ((pCVar3[uVar8 + 0x34] != (CPointerMsgData)0x0) &&

+           (MicrosoftTelemetryAssertTriggeredArgsKM

+                      ("IXPTelAssert",0x30001,(uint)uVar8 & 0xffff | 0x2c670000),

+           pCVar3[uVar8 + 0x34] != (CPointerMsgData)0x0)) {

+                    /* WARNING: Subroutine does not return */

+          KeBugCheckEx(0x164,0x25,pCVar3,lVar10,uVar8);

+        }

+        CVar11 = (CPointerInputFramePhase)in_stack_ffffffffffffffa8;

+        uVar7 = (uint)uVar8 + 1;

+        uVar8 = (ulonglong)uVar7;

+      } while (uVar7 < 9);

+    }

+    uVar6 = (ushort)*(ulong *)(pCVar3 + 0x18);

+    InputTraceLogging::PointerMsg::UnreferenceMsgData

+              (param_1,*(ulong *)(pCVar3 + 0x18),param_2,(uint)(byte)pCVar3[lVar10 + 0x34]);

+    if (*(int *)(pCVar3 + 0x18) == 0) {

+      if ((*(uint *)(pCVar3 + 0x24) & 0x20) == 0) {

+        FreePointerInfoNode(this,uVar6,*(ulong *)(pCVar3 + 0x1c),*(ulong *)(pCVar3 + 0x20),CVar11);

+      }

+      FreeMsgData(this,param_1);

+    }

+    return;

+  }

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

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x29] < 2)) {

+    bVar1 = false;

+  }

+  bVar2 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+  if ((bVar1) || (bVar2)) {

+    pRVar5 = SGTRACINGgBaseLog<RECORDER_LOG__*___ptr64>::operator_struct_RECORDER_LOG______ptr64

+                       ((SGTRACINGgBaseLog<RECORDER_LOG__*___ptr64> *)WPP_GLOBAL_Control);

+    WPP_RECORDER_AND_TRACE_SF_Lq(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),bVar1,bVar2,pRVar5);

+  }

+                    /* WARNING: Subroutine does not return */

+  KeBugCheckEx(0x164,0x25,pCVar3,lVar10,lVar10);

+}

+
```

## `DirectComposition::GeneratedCreatePrivateMarshaler`  (modified)

```diff
--- DirectComposition::GeneratedCreatePrivateMarshaler
+++ DirectComposition::GeneratedCreatePrivateMarshaler
@@ -1,2 +1,513 @@
-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)

+

+{

+  CVisualMarshaler *this;

+  undefined **ppuVar1;

+  CRegionGeometryMarshaler *this_00;

+  CVisualGroupMarshaler *this_01;

+  undefined4 in_register_0000000c;

+  __uint64 _Var2;

+  

+  _Var2 = CONCAT44(in_register_0000000c,param_1);

+  if (param_1 < 0x88) {

+    if (param_1 == 0x87) {

+      this = Win32AllocPoolWithQuotaZInitImpl(_Var2,0x68,0x33724344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x87;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CRotateTransform3DMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 < 0x35) {

+      if (param_1 == 0x34) {

+        this = Win32AllocPoolWithQuotaZInitImpl(_Var2,0x48,0x65644344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 0x34;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CDesktopTreeMarshaler::_vftable_;

+          goto LAB_0;

+        }

+      }

+      else if (param_1 == 3) {

+        this = Win32AllocPoolWithQuotaZInitImpl(0,0x68,0x68614344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 3;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CAnimationControllerMarshaler::_vftable_;

+          goto LAB_1;

+        }

+      }

+      else if (param_1 == 4) {

+        this = Win32AllocPoolWithQuotaZInitImpl(0,0x40,0x63674344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 4;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CAnimationGlobalConfigurationMarshaler::_vftable_;

+          goto LAB_0;

+        }

+      }

+      else if (param_1 == 5) {

+        this = Win32AllocPoolWithQuotaZInitImpl(0,0x78,0x72744344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 5;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CAnimationTriggerMarshaler::_vftable_;

+LAB_2:

+          *(undefined8 *)(this + 0x50) = 0;

+          *(undefined8 *)(this + 0x58) = 0;

+          *(undefined8 *)(this + 0x60) = 0;

+          goto LAB_0;

+        }

+      }

+      else if (param_1 == 7) {

+        this = Win32AllocPoolWithQuotaZInitImpl(0,0x58,0x77614344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 7;

+          *(undefined8 *)(this + 0x40) = 0;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CAtlasedRectsGroupMarshaler::_vftable_;

+          *(undefined8 *)(this + 0x48) = 0;

+          *(undefined8 *)(this + 0x50) = 0;

+          goto LAB_0;

+        }

+      }

+      else if (param_1 == 8) {

+        this = Win32AllocPoolWithQuotaZInitImpl(0,0x70,0x30614344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 8;

+          *(undefined8 *)(this + 0x40) = 0;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CAtlasedRectsMeshMarshaler::_vftable_;

+          *(undefined8 *)(this + 0x48) = 0;

+          *(undefined8 *)(this + 0x50) = 0;

+          *(undefined8 *)(this + 0x58) = 0;

+          *(undefined8 *)(this + 0x60) = 0;

+          *(undefined8 *)(this + 0x68) = 0;

+          goto LAB_0;

+        }

+      }

+      else if (param_1 == 0x13) {

+        this = (CVisualMarshaler *)Memory::AllocateAndClear(0x90,0x71634344,1);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 0x13;

+          *(undefined8 *)(this + 0x68) = 0;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CCaptureControllerMarshaler::_vftable_;

+          *(undefined8 *)(this + 0x70) = 0;

+          *(undefined8 *)(this + 0x78) = 0;

+          goto LAB_0;

+        }

+      }

+      else if (param_1 == 0x22) {

+        this = Win32AllocPoolWithQuotaZInitImpl(0,0x58,0x74644344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 0x22;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CCompositionDynamicTextureMarshaler::_vftable_;

+          goto LAB_3;

+        }

+      }

+      else if (param_1 == 0x30) {

+        this = Win32AllocPoolWithQuotaZInitImpl(0,0x198,0x79634344);

+        if (this != (CVisualMarshaler *)0x0) {

+          CVisualMarshaler::CVisualMarshaler(this,0x30);

+          ppuVar1 = &CCursorVisualMarshaler::_vftable_;

+          goto LAB_4;

+        }

+      }

+      else {

+        if (param_1 != 0x33) {

+          return -0x3ffffff3;

+        }

+        this = Win32AllocPoolWithQuotaZInitImpl(3,0x50,0x69644344);

+        if (this != (CVisualMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 0x33;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CDelegatedInkCanvasMarshaler::_vftable_;

+          goto LAB_0;

+        }

+      }

+    }

+    else if (param_1 == 0x38) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0x58,0x67654344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x38;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CEffectGroupMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x3f) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0x70,0x64674344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x3f;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CGdiSpriteBitmapMarshaler::_vftable_;

+LAB_3:

+        *(undefined8 *)(this + 0x38) = 0;

+        *(undefined8 *)(this + 0x40) = 0;

+        *(undefined8 *)(this + 0x48) = 0;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x43) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0x50,0x67674344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x43;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CGeometry2DGroupMarshaler::_vftable_;

+        goto LAB_3;

+      }

+    }

+    else if (param_1 == 0x46) {

+      this = (CVisualMarshaler *)Memory::AllocateAndClear(0x58,0x76674344,1);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x46;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CGlobalDCompVisualMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x52) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0xb8,0x62694344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x52;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CImageLegacyMilBrushMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x62) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0x90,0x626c4344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x62;

+        *(undefined8 *)(this + 0x68) = 0;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CLinearGradientLegacyMilBrushMarshaler::_vftable_;

+        *(undefined8 *)(this + 0x70) = 0;

+        *(undefined8 *)(this + 0x78) = 0;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x6d) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0x88,0x676d4344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x6d;

+        *(undefined8 *)(this + 0x40) = 0;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CMeshGeometry2DMarshaler::_vftable_;

+        *(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_0;

+      }

+    }

+    else if (param_1 == 0x80) {

+      this_00 = Win32AllocPoolWithQuotaZInitImpl(0,0x78,0x67724344);

+      if (this_00 != (CRegionGeometryMarshaler *)0x0) {

+        this = (CVisualMarshaler *)CRegionGeometryMarshaler::CRegionGeometryMarshaler(this_00);

+        goto LAB_5;

+      }

+    }

+    else {

+      if (param_1 != 0x86) {

+        return -0x3ffffff3;

+      }

+      this = Win32AllocPoolWithQuotaZInitImpl(6,0x58,0x6f724344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x86;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CRotateTransformMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+  }

+  else if (param_1 < 0xa6) {

+    if (param_1 == 0xa5) {

+      this = Win32AllocPoolWithQuotaZInitImpl(_Var2,0x180,0x75734344);

+      if (this != (CVisualMarshaler *)0x0) {

+        CVisualMarshaler::CVisualMarshaler(this,0xa5);

+        ppuVar1 = &CSuperWetInkVisualMarshaler::_vftable_;

+LAB_4:

+        *(undefined ***)this = ppuVar1;

+        goto LAB_5;

+      }

+    }

+    else if (param_1 == 0x8a) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0x58,0x74734344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x8a;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CScaleTransformMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x8b) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0x60,0x33734344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x8b;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CScaleTransform3DMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x8f) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0x98,0x657a4344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x8f;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CSceneMeshMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x91) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0xa8,0x726d4344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x91;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CSceneMetallicRoughnessMaterialMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x92) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0x40,0x7a7a4344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x92;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CSceneModelTransformMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x93) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0x70,0x747a4344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x93;

+        *(undefined8 *)(this + 0x38) = 0;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CSceneNodeMarshaler::_vftable_;

+        *(undefined8 *)(this + 0x40) = 0;

+        *(undefined8 *)(this + 0x48) = 0;

+        goto LAB_2;

+      }

+    }

+    else if (param_1 == 0x98) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0x180,0x767a4344);

+      if (this != (CVisualMarshaler *)0x0) {

+        CVisualMarshaler::CVisualMarshaler(this,0x98);

+        ppuVar1 = &CSceneVisualMarshaler::_vftable_;

+        goto LAB_4;

+      }

+    }

+    else if (param_1 == 0x9f) {

+      this = Win32AllocPoolWithQuotaZInitImpl(0,0x58,0x746b4344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x9f;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CSkewTransformMarshaler::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else {

+      if (param_1 != 0xa2) {

+        return -0x3ffffff3;

+      }

+      this = Win32AllocPoolWithQuotaZInitImpl(3,0x68,0x7a734344);

+      if (this != (CVisualMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0xa2;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CSolidColorLegacyMilBrushMarshaler::_vftable_;

+LAB_0:

+        *(undefined ***)this = ppuVar1;

+        goto LAB_5;

+      }

+    }

+  }

+  else if (param_1 == 0xa8) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x78,0x79734344);

+    if (this != (CVisualMarshaler *)0x0) {

+      *(undefined4 *)(this + 0x20) = 0;

+      *(undefined8 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x18) = 1;

+      *(undefined4 *)(this + 0x24) = 0xa8;

+      *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+      ppuVar1 = &CSynchronousSuperWetInkMarshaler::_vftable_;

+      goto LAB_0;

+    }

+  }

+  else if (param_1 == 0xac) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x60,0x33674344);

+    if (this != (CVisualMarshaler *)0x0) {

+      *(undefined4 *)(this + 0x20) = 0;

+      *(undefined8 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x18) = 1;

+      *(undefined4 *)(this + 0x24) = 0xac;

+      *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+      ppuVar1 = &CTransform3DGroupMarshaler::_vftable_;

+LAB_1:

+      *(undefined8 *)(this + 0x48) = 0;

+      *(undefined8 *)(this + 0x50) = 0;

+      *(undefined8 *)(this + 0x58) = 0;

+      goto LAB_0;

+    }

+  }

+  else if (param_1 == 0xad) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x60,0x67744344);

+    if (this != (CVisualMarshaler *)0x0) {

+      *(undefined4 *)(this + 0x20) = 0;

+      *(undefined8 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x18) = 1;

+      *(undefined4 *)(this + 0x24) = 0xad;

+      *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+      ppuVar1 = &CTransformGroupMarshaler::_vftable_;

+      goto LAB_1;

+    }

+  }

+  else if (param_1 == 0xae) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x50,0x74744344);

+    if (this != (CVisualMarshaler *)0x0) {

+      *(undefined4 *)(this + 0x20) = 0;

+      *(undefined8 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x18) = 1;

+      *(undefined4 *)(this + 0x24) = 0xae;

+      *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+      ppuVar1 = &CTranslateTransformMarshaler::_vftable_;

+      goto LAB_0;

+    }

+  }

+  else if (param_1 == 0xaf) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x58,0x33744344);

+    if (this != (CVisualMarshaler *)0x0) {

+      *(undefined4 *)(this + 0x20) = 0;

+      *(undefined8 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x18) = 1;

+      *(undefined4 *)(this + 0x24) = 0xaf;

+      *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+      ppuVar1 = &CTranslateTransform3DMarshaler::_vftable_;

+      goto LAB_0;

+    }

+  }

+  else if (param_1 == 0xb5) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x40,0x78764344);

+    if (this != (CVisualMarshaler *)0x0) {

+      *(undefined4 *)(this + 0x20) = 0;

+      *(undefined8 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x18) = 1;

+      *(undefined4 *)(this + 0x24) = 0xb5;

+      *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+      ppuVar1 = &CVisualBitmapMarshaler::_vftable_;

+      goto LAB_0;

+    }

+  }

+  else if (param_1 == 0xb7) {

+    this_01 = Win32AllocPoolWithQuotaZInitImpl(0,0x50,0x67764344);

+    if (this_01 != (CVisualGroupMarshaler *)0x0) {

+      this = (CVisualMarshaler *)CVisualGroupMarshaler::CVisualGroupMarshaler(this_01);

+      goto LAB_5;

+    }

+  }

+  else {

+    if (param_1 != 0xbc) {

+      return -0x3ffffff3;

+    }

+    this = (CVisualMarshaler *)Memory::AllocateAndClear(0x228,0x6e774344,1);

+    if (this != (CVisualMarshaler *)0x0) {

+      CVisualMarshaler::CVisualMarshaler(this,0xbc);

+      ppuVar1 = &CWindowNodeMarshaler::_vftable_;

+      goto LAB_4;

+    }

+  }

+  this = (CVisualMarshaler *)0x0;

+LAB_5:

+  *param_2 = (CResourceMarshaler *)this;

+  return ~-(uint)(this != (CVisualMarshaler *)0x0) & 0xc0000017;

+}

+
```

## `DirectComposition::CColorBrushMarshaler::EmitUpdateCommands`  (modified)

```diff
--- DirectComposition::CColorBrushMarshaler::EmitUpdateCommands
+++ DirectComposition::CColorBrushMarshaler::EmitUpdateCommands
@@ -1,2 +1,65 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CColorBrushMarshaler::EmitUpdateCommands : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: virtual bool __cdecl DirectComposition::CColorBrushMarshaler::EmitUpdateCommands(class

+   DirectComposition::CBatch * __ptr64 * __ptr64) __ptr64 */

+

+bool __thiscall

+DirectComposition::CColorBrushMarshaler::EmitUpdateCommands

+          (CColorBrushMarshaler *this,CBatch **param_1)

+

+{

+  char cVar1;

+  bool bVar2;

+  int iVar3;

+  uint uVar4;

+  CColorBrushMarshaler *local_res18 [2];

+  

+  iVar3 = Feature_DCompChromiumK2__private_IsEnabledDeviceUsageNoInline();

+  if (iVar3 == 0) {

+    bVar2 = EmitUpdateColorCommand(this,param_1);

+  }

+  else {

+    uVar4 = *(uint *)(this + 0x10);

+    if ((uVar4 & 0x40) != 0) {

+      local_res18[0] = this;

+      cVar1 = CResourceMarshaler::EmitUpdateCommand<<lambda_063dcf6fbb279be43041067d140dca61>_>

+                        (this,param_1,local_res18);

+      if (cVar1 == '\0') {

+        return false;

+      }

+      *(uint *)(this + 0x10) = *(uint *)(this + 0x10) & 0xffffffbf;

+      uVar4 = *(uint *)(this + 0x10);

+    }

+    if ((char)uVar4 < '\0') {

+      local_res18[0] = this;

+      cVar1 = CResourceMarshaler::EmitUpdateCommand<<lambda_cd66cd1f085f33f1d353774995491a29>_>

+                        (this,param_1,local_res18);

+      if (cVar1 == '\0') {

+        return false;

+      }

+      *(uint *)(this + 0x10) = *(uint *)(this + 0x10) & 0xffffff7f;

+      uVar4 = *(uint *)(this + 0x10);

+    }

+    if ((uVar4 >> 8 & 1) != 0) {

+      local_res18[0] = this;

+      cVar1 = CResourceMarshaler::EmitUpdateCommand<<lambda_64820aa579a027dfbb0f875fb10e056c>_>

+                        (this,param_1,local_res18);

+      if (cVar1 == '\0') {

+        return false;

+      }

+      *(uint *)(this + 0x10) = *(uint *)(this + 0x10) & 0xfffffeff;

+      uVar4 = *(uint *)(this + 0x10);

+    }

+    if ((uVar4 >> 9 & 1) != 0) {

+      local_res18[0] = this;

+      cVar1 = CResourceMarshaler::EmitUpdateCommand<<lambda_1436539551c065f2314ede7578b1b04d>_>

+                        (this,param_1,local_res18);

+      if (cVar1 == '\0') {

+        return false;

+      }

+      *(uint *)(this + 0x10) = *(uint *)(this + 0x10) & 0xfffffdff;

+    }

+    bVar2 = true;

+  }

+  return bVar2;

+}

+
```

## `DirectComposition::CWindowNodeMarshaler::SetReferenceProperty`  (modified)

```diff
--- DirectComposition::CWindowNodeMarshaler::SetReferenceProperty
+++ DirectComposition::CWindowNodeMarshaler::SetReferenceProperty
@@ -1,2 +1,76 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CWindowNodeMarshaler::SetReferenceProperty : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl DirectComposition::CWindowNodeMarshaler::SetReferenceProperty(class

+   DirectComposition::CApplicationChannel * __ptr64,unsigned int,class

+   DirectComposition::CResourceMarshaler * __ptr64,bool * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CWindowNodeMarshaler::SetReferenceProperty

+          (CWindowNodeMarshaler *this,CApplicationChannel *param_1,uint param_2,

+          CResourceMarshaler *param_3,bool *param_4)

+

+{

+  bool bVar1;

+  long lVar2;

+  CWindowNodeMarshaler *pCVar3;

+  

+  *param_4 = false;

+  if (param_2 == 0x3a) {

+    lVar2 = 0;

+    pCVar3 = this + 0x1c8;

+    if ((param_3 != (CResourceMarshaler *)0x0) &&

+       (lVar2 = 0,

+       bVar1 = CResourceMarshaler::IsDerivedResourceType

+                         (*(MIL_RESOURCE_TYPE *)(param_3 + 0x24),0x41), !bVar1)) {

+      return -0x3ffffff3;

+    }

+    if ((param_3 != *(CResourceMarshaler **)pCVar3) &&

+       (lVar2 = CApplicationChannel::ReplaceResource<DirectComposition::CResourceMarshaler>

+                          (param_1,(CResourceMarshaler **)pCVar3,param_3,(CResourceMarshaler *)0x0),

+       lVar2 < 0)) {

+      return lVar2;

+    }

+    *(uint *)(this + 0x170) = *(uint *)(this + 0x170) | 0x40;

+  }

+  else if (param_2 == 0x42) {

+    lVar2 = 0;

+    pCVar3 = this + 0x208;

+    if ((param_3 != (CResourceMarshaler *)0x0) &&

+       (lVar2 = 0,

+       bVar1 = CResourceMarshaler::IsDerivedResourceType

+                         (*(MIL_RESOURCE_TYPE *)(param_3 + 0x24),0x3f), !bVar1)) {

+      return -0x3ffffff3;

+    }

+    if ((param_3 != *(CResourceMarshaler **)pCVar3) &&

+       (lVar2 = CApplicationChannel::ReplaceResource<DirectComposition::CResourceMarshaler>

+                          (param_1,(CResourceMarshaler **)pCVar3,param_3,(CResourceMarshaler *)0x0),

+       lVar2 < 0)) {

+      return lVar2;

+    }

+    *(uint *)(this + 0x170) = *(uint *)(this + 0x170) | 0x4000;

+  }

+  else {

+    if (param_2 != 0x43) {

+      lVar2 = CVisualMarshaler::SetReferenceProperty

+                        ((CVisualMarshaler *)this,param_1,param_2,param_3,param_4);

+      return lVar2;

+    }

+    lVar2 = 0;

+    pCVar3 = this + 0x210;

+    if ((param_3 != (CResourceMarshaler *)0x0) &&

+       (lVar2 = 0,

+       bVar1 = CResourceMarshaler::IsDerivedResourceType

+                         (*(MIL_RESOURCE_TYPE *)(param_3 + 0x24),0x80), !bVar1)) {

+      return -0x3ffffff3;

+    }

+    if ((param_3 != *(CResourceMarshaler **)pCVar3) &&

+       (lVar2 = CApplicationChannel::ReplaceResource<DirectComposition::CResourceMarshaler>

+                          (param_1,(CResourceMarshaler **)pCVar3,param_3,(CResourceMarshaler *)0x0),

+       lVar2 < 0)) {

+      return lVar2;

+    }

+    *(uint *)(this + 0x170) = *(uint *)(this + 0x170) | 0x8000;

+  }

+  *param_4 = true;

+  return lVar2;

+}

+
```

## `CTouchProcessor::PostPointerMessage`  (modified)

```diff
--- CTouchProcessor::PostPointerMessage
+++ CTouchProcessor::PostPointerMessage
@@ -1,2 +1,131 @@
-Failed to decompile win32kbase.sys - .ProgramDB CTouchProcessor::PostPointerMessage : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: int __cdecl CTouchProcessor::PostPointerMessage(class CInputDest const & __ptr64,struct

+   CPointerInputFrame const * __ptr64,struct CPointerInfoNode const * __ptr64,unsigned

+   __int64,unsigned int,unsigned long,int,int) __ptr64 */

+

+int __thiscall

+CTouchProcessor::PostPointerMessage

+          (CTouchProcessor *this,CInputDest *param_1,CPointerInputFrame *param_2,

+          CPointerInfoNode *param_3,__uint64 param_4,uint param_5,ulong param_6,int param_7,

+          int param_8)

+

+{

+  undefined8 uVar1;

+  undefined4 uVar2;

+  longlong lVar3;

+  bool bVar4;

+  char cVar5;

+  _ProcessorExecutionEnvironment _Var6;

+  int iVar7;

+  tagUIPI_INFO *ptVar8;

+  tagTHREADINFO *ptVar9;

+  longlong lVar10;

+  tagTHREADINFO *ptVar11;

+  ulonglong uVar12;

+  undefined8 local_80;

+  undefined8 local_78;

+  undefined4 local_70;

+  undefined8 local_68;

+  undefined8 uStack_60;

+  undefined8 local_58;

+  undefined8 local_50;

+  

+  local_80 = 0;

+  ptVar8 = CInputDest::GetQueue(param_1,0);

+  cVar5 = '\x01';

+  if (ptVar8 != (tagUIPI_INFO *)0x0) {

+    _Var6 = CBaseProcessor::GetExecutionEnvironment();

+    if (_Var6 != 1) {

+      MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert");

+    }

+    ptVar9 = CInputDest::GetThreadInfo(param_1);

+    if (ptVar9 == (tagTHREADINFO *)0x0) {

+      MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert");

+    }

+    if (((param_7 != 0) && ((*(uint *)param_3 & 0x800) == 0)) && (param_8 == 0)) {

+      lVar10 = HMValidateHandleNoSecure(*(undefined8 *)(param_3 + 0xb8),0x13);

+      if (lVar10 == 0) {

+        MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000);

+      }

+      bVar4 = UIPrivilegeIsolation::CheckAccess

+                        ((tagUIPI_INFO *)(*(longlong *)(lVar10 + 0x1c8) + 0x3c0),ptVar8,0);

+      if (!bVar4) {

+        lVar10 = *(longlong *)(*(longlong *)(lVar10 + 0x170) + 0x58);

+        if (((lVar10 != 0) && ((*(byte *)(lVar10 + 0x330) & 0x30) == 0x10)) &&

+           (lVar3 = *(longlong *)(ptVar9 + 0x1d0), lVar10 == lVar3)) {

+          local_78 = *(undefined8 *)(lVar3 + 0x130);

+          local_70 = *(undefined4 *)(lVar3 + 0x138);

+          iVar7 = ApiSetEditionIsGpqForegroundAccessibleExplicit(param_7,ptVar9,&local_78,0);

+          if (iVar7 != 0) goto LAB_0;

+        }

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

+            ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) == 0)) ||

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

+          cVar5 = '\0';

+        }

+        bVar4 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+        if ((cVar5 != '\0') || (bVar4)) {

+          lVar10 = W32GetUserSessionState();

+          WPP_RECORDER_AND_TRACE_SF_

+                    (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar5,bVar4,

+                     *(undefined8 *)(lVar10 + 0x10f88),3,4,0x112,

+                     &WPP_9b909e6f7a6f3ba61ffc5a77a7a32fbe_Traceguids);

+        }

+        InputTraceLogging::Pointer::DropInput(param_2,(tagPOINTEREVENTINT *)(param_3 + 0xa0),6);

+        uVar1 = *(undefined8 *)ptVar8;

+        uVar2 = *(undefined4 *)(ptVar8 + 8);

+        ptVar11 = PtiCurrent();

+        local_78 = uVar1;

+        local_70 = uVar2;

+        EtwTraceUIPIInputError(ptVar11,ptVar9,ptVar8,&local_78,8);

+        return 0;

+      }

+    }

+  }

+LAB_0:

+  uVar12 = (ulonglong)*(ushort *)(param_3 + 0xac);

+  if (param_5 != 0x253) {

+    uVar12 = ((ulonglong)*(ushort *)(param_3 + 0xb4) & 0xffffe1f7) << 0x10 |

+             (ulonglong)*(ushort *)(param_3 + 0xac);

+  }

+  GetPointerInputSource(*(undefined4 *)(param_3 + 0xa8),param_7,param_8,&local_80);

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

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

+    cVar5 = '\0';

+  }

+  else {

+    cVar5 = '\x01';

+  }

+  bVar4 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+  if ((cVar5 != '\0') || (bVar4)) {

+    flagString(uVar12 >> 0x10);

+    W32GetUserSessionState();

+    messageString(param_5);

+    WPP_RECORDER_AND_TRACE_SF_LsHHsLLLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar5,bVar4);

+  }

+  cVar5 = '\x01';

+  local_50 = 0xffffffffffffffff;

+  local_58 = 0;

+  local_68 = 0;

+  uStack_60 = 0;

+  iVar7 = ApiSetEditionPostInputMessage

+                    (param_1,0,param_5,uVar12,param_4,param_6,*(undefined8 *)(param_3 + 0xf8),0,

+                     -(*(int *)(param_3 + 0x138) != 0) & 8,&local_80,&local_68);

+  if (iVar7 != 0) {

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

+        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x29] < 4))

+    {

+      cVar5 = '\0';

+    }

+    bVar4 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+    if ((cVar5 != '\0') || (bVar4)) {

+      lVar10 = W32GetUserSessionState();

+      WPP_RECORDER_AND_TRACE_SF_

+                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar5,bVar4,

+                 *(undefined8 *)(lVar10 + 0x10f88),4,4,0x114,

+                 &WPP_9b909e6f7a6f3ba61ffc5a77a7a32fbe_Traceguids);

+    }

+  }

+  return iVar7;

+}

+
```

## `ThreadRestrictNewHandlesRegion::Protect`  (modified)

```diff
--- ThreadRestrictNewHandlesRegion::Protect
+++ ThreadRestrictNewHandlesRegion::Protect
@@ -1,43 +1,57 @@
 

-bool __cdecl

-DirectComposition::CSharedResourceMarshaler<DirectComposition::CManipulationTransformMarshaler,2>::

-Protect(_GRETHREAD *param_1,void *param_2)

+/* public: static bool __cdecl ThreadRestrictNewHandlesRegion::Protect(struct _GRETHREAD *

+   __ptr64,void * __ptr64) */

+

+bool __cdecl ThreadRestrictNewHandlesRegion::Protect(_GRETHREAD *param_1,void *param_2)

 

 {

-  byte *pbVar1;

-  undefined8 uVar2;

-  undefined8 *puVar3;

-  int iVar4;

-  undefined8 *unaff_RBP;

-  int unaff_ESI;

-  longlong *unaff_RDI;

-  longlong in_R8;

+  uint uVar1;

+  ThreadRestrictNewHandlesRegion *this;

+  GdiHandleManager *this_00;

+  bool bVar2;

+  OBJECT *pOVar3;

+  OBJECT *pOVar4;

+  ThreadRestrictNewHandlesRegion *this_01;

+  uint uVar5;

+  uint *local_28;

+  int local_20;

+  longlong local_18;

   

-  pbVar1 = (byte *)(in_R8 + -0x7b);

-  *pbVar1 = *pbVar1 ^ (byte)param_1;

-  if (*pbVar1 != 0) {

-    unaff_RBP[9] = param_1;

-    uVar2 = *(undefined8 *)param_1;

-    *unaff_RBP = 0x1401c1399;

-    iVar4 = GreGetObjectOwner(uVar2,8);

-    if (iVar4 != unaff_ESI) {

-      *unaff_RBP = 0x1401c13a7;

-      XEPALOBJ::vUnrefPalette((XEPALOBJ *)(unaff_RBP + 9));

+                    /* 0x1c0ad0  312

+                       ?Protect@ThreadRestrictNewHandlesRegion@@SA_NPEAU_GRETHREAD@@PEAX@Z */

+  uVar5 = (uint)((ulonglong)param_2 >> 8) & 0xff0000 | (uint)param_2 & 0xffff;

+  if (((param_1 != (_GRETHREAD *)0x0) &&

+      (this = *(ThreadRestrictNewHandlesRegion **)(param_1 + 0x150),

+      this != (ThreadRestrictNewHandlesRegion *)0x0)) &&

+     (this[0x50] != (ThreadRestrictNewHandlesRegion)0x0)) {

+    this_01 = this;

+    bVar2 = InRegion(this,uVar5);

+    if (bVar2) {

+      return true;

+    }

+    bVar2 = MakeRoom(this_01);

+    if (bVar2) {

+      HANDLELOCK::HANDLELOCK((HANDLELOCK *)&local_28,uVar5,1);

+      if (local_20 != 0) {

+        pOVar3 = GdiHandleManager::GetEntryObject

+                           (*(GdiHandleManager **)(local_18 + 0x1628),*local_28);

+        if (((byte)pOVar3[0xe] & 0x20) != 0) {

+          MicrosoftTelemetryAssertTriggeredNoArgsKM();

+        }

+        this_00 = *(GdiHandleManager **)(local_18 + 0x1628);

+        uVar1 = *local_28;

+        pOVar3 = GdiHandleManager::GetEntryObject(this_00,uVar1);

+        pOVar4 = GdiHandleManager::GetEntryObject(this_00,uVar1);

+        *(ushort *)(pOVar3 + 0xe) = *(ushort *)(pOVar4 + 0xe) | 0x20;

+        HANDLELOCK::vUnlock((HANDLELOCK *)&local_28);

+        *(uint *)(*(longlong *)(this + 0x28) + *(longlong *)(this + 0x18) * 4) = uVar5;

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

+        HANDLELOCK::~HANDLELOCK((HANDLELOCK *)&local_28);

+        return true;

+      }

+      HANDLELOCK::~HANDLELOCK((HANDLELOCK *)&local_28);

     }

   }

-  puVar3 = (undefined8 *)((undefined8 *)*unaff_RDI)[0xf];

-  if ((undefined8 *)*unaff_RDI != puVar3) {

-    unaff_RBP[9] = puVar3;

-    uVar2 = *puVar3;

-    *unaff_RBP = 0x1401c13c5;

-    iVar4 = GreGetObjectOwner(uVar2,8);

-    if (iVar4 != unaff_ESI) {

-      *unaff_RBP = 0x1401c13d3;

-      XEPALOBJ::vUnrefPalette((XEPALOBJ *)(unaff_RBP + 9));

-    }

-  }

-  *unaff_RBP = 0x1401c13db;

-  XEPALOBJ_FreePaletteMemory();

-  return true;

+  return false;

 }
```

## `DirectComposition::CColorBrushMarshaler::SetBufferProperty`  (modified)

```diff
--- DirectComposition::CColorBrushMarshaler::SetBufferProperty
+++ DirectComposition::CColorBrushMarshaler::SetBufferProperty
@@ -1,2 +1,37 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CColorBrushMarshaler::SetBufferProperty : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl DirectComposition::CColorBrushMarshaler::SetBufferProperty(class

+   DirectComposition::CApplicationChannel * __ptr64,unsigned int,void const * __ptr64,unsigned

+   __int64,bool * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CColorBrushMarshaler::SetBufferProperty

+          (CColorBrushMarshaler *this,CApplicationChannel *param_1,uint param_2,void *param_3,

+          __uint64 param_4,bool *param_5)

+

+{

+  undefined4 uVar1;

+  undefined4 uVar2;

+  undefined4 uVar3;

+  int iVar4;

+  long lVar5;

+  

+  lVar5 = 0;

+  *param_5 = false;

+  if (((param_2 == 0) && (param_3 != (void *)0x0)) && (param_4 == 0x10)) {

+    uVar1 = *(undefined4 *)((longlong)param_3 + 4);

+    uVar2 = *(undefined4 *)((longlong)param_3 + 8);

+    uVar3 = *(undefined4 *)((longlong)param_3 + 0xc);

+    *(undefined4 *)(this + 0x48) = *(undefined4 *)param_3;

+    *(undefined4 *)(this + 0x4c) = uVar1;

+    *(undefined4 *)(this + 0x50) = uVar2;

+    *(undefined4 *)(this + 0x54) = uVar3;

+    iVar4 = Feature_DCompChromiumK2__private_IsEnabledDeviceUsageNoInline();

+    *(uint *)(this + 0x10) = *(uint *)(this + 0x10) | (-(uint)(iVar4 != 0) & 0x3a0) + 0x20;

+    *param_5 = true;

+  }

+  else {

+    lVar5 = -0x3ffffff3;

+  }

+  return lVar5;

+}

+
```

## `CInputDest::CanCallerAccessDestination`  (modified)

```diff
--- CInputDest::CanCallerAccessDestination
+++ CInputDest::CanCallerAccessDestination
@@ -1,2 +1,30 @@
-Failed to decompile win32kbase.sys - .ProgramDB CInputDest::CanCallerAccessDestination : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: bool __cdecl CInputDest::CanCallerAccessDestination(void)const __ptr64 */

+

+bool __thiscall CInputDest::CanCallerAccessDestination(CInputDest *this)

+

+{

+  bool bVar1;

+  tagWND *ptVar2;

+  tagTHREADINFO *ptVar3;

+  

+  if (*(int *)this == 0) {

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000);

+  }

+  ptVar2 = GetUserWindow(this);

+  if (ptVar2 == (tagWND *)0x0) {

+    bVar1 = true;

+  }

+  else {

+    ptVar3 = PtiCurrent();

+    bVar1 = UIPrivilegeIsolation::CheckAccess

+                      ((tagUIPI_INFO *)

+                       (-(ulonglong)(*(longlong *)(ptVar3 + 0x1d0) != 0) &

+                       *(longlong *)(ptVar3 + 0x1d0) + 0x130U),

+                       (tagUIPI_INFO *)

+                       (-(ulonglong)(*(longlong *)(*(longlong *)(ptVar2 + 0x10) + 0x1d0) != 0) &

+                       *(longlong *)(*(longlong *)(ptVar2 + 0x10) + 0x1d0) + 0x130U),0);

+  }

+  return bVar1;

+}

+
```

## `DirectComposition::CApplicationChannel::CMilCommandBatchParser::ValidateAndTranslateCommandGenerated`  (modified)

```diff
--- DirectComposition::CApplicationChannel::CMilCommandBatchParser::ValidateAndTranslateCommandGenerated
+++ DirectComposition::CApplicationChannel::CMilCommandBatchParser::ValidateAndTranslateCommandGenerated
@@ -1,17 +1,2968 @@
+

+/* WARNING: Type propagation algorithm not settling */

+/* private: long __cdecl

+   DirectComposition::CApplicationChannel::CMilCommandBatchParser::ValidateAndTranslateCommandGenerated(void

+   * __ptr64,unsigned int) __ptr64 */

 

 long __thiscall

-OPM::CMonitorHandleTable<COPMProtectedOutput,void*___ptr64>::ValidateAndTranslateCommandGenerated

+DirectComposition::CApplicationChannel::CMilCommandBatchParser::ValidateAndTranslateCommandGenerated

           (CMilCommandBatchParser *this,void *param_1,uint param_2)

 

 {

-  code *pcVar1;

-  long lVar2;

-  byte unaff_BL;

-  longlong unaff_RDI;

+  uint *puVar1;

+  ulonglong uVar2;

+  uint *puVar3;

+  uint uVar4;

+  MIL_RESOURCE_TYPE MVar5;

+  ulonglong uVar6;

+  bool bVar7;

+  long local_res10 [2];

   

-  *(byte *)(unaff_RDI + -0x3d) = *(byte *)(unaff_RDI + -0x3d) & unaff_BL;

-  pcVar1 = (code *)swi(3);

-  lVar2 = (*pcVar1)();

-  return lVar2;

+  uVar2 = (ulonglong)param_2;

+  local_res10[0] = 0;

+  switch(*(undefined4 *)param_1) {

+  case 1:

+    bVar7 = param_2 < 0xc;

+    goto LAB_0;

+  case 2:

+    bVar7 = param_2 < 0x10;

+LAB_0:

+    if (bVar7) {

+      return -0x3ffffff3;

+    }

+    goto LAB_1;

+  case 3:

+  case 6:

+    bVar7 = param_2 == 0xc;

+    goto LAB_2;

+  case 4:

+  case 8:

+    bVar7 = param_2 == 0x10;

+    goto LAB_2;

+  case 5:

+    if (param_2 != 0x3c) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),2,false,local_res10);

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

+    bVar7 = true;

+    goto LAB_3;

+  case 7:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),2,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_4;

+  case 9:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 2;

+    goto LAB_5;

+  case 10:

+  case 0xb:

+    bVar7 = param_2 == 0x1c;

+LAB_2:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_1:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_3:

+    MVar5 = 2;

+    break;

+  case 0xc:

+  case 0xd:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 10;

+    goto LAB_6;

+  case 0xe:

+    if (param_2 < 0x14) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xb,false,local_res10);

+    if (uVar2 - 0x14 < (ulonglong)*(uint *)((longlong)param_1 + 0xc)) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 0x10);

+    puVar1 = puVar3 + (*(uint *)((longlong)param_1 + 0xc) >> 2);

+    for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

+      TranslateMilCommandBatchHandle(this,puVar3,0x3a,false,local_res10);

+    }

+    return local_res10[0];

+  case 0xf:

+  case 0x12:

+    bVar7 = param_2 == 0x10;

+    goto LAB_7;

+  case 0x10:

+    bVar7 = param_2 == 0xc;

+    goto LAB_7;

+  case 0x11:

+    bVar7 = param_2 == 0x2c;

+LAB_7:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_8:

+    MVar5 = 0xb;

+    break;

+  case 0x13:

+    if (param_2 < 0x14) {

+      return -0x3ffffff3;

+    }

+    goto LAB_9;

+  case 0x14:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+LAB_9:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0xd;

+    break;

+  case 0x15:

+    bVar7 = param_2 == 0xc;

+    goto LAB_10;

+  case 0x16:

+    bVar7 = param_2 == 0x1c;

+LAB_10:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x12;

+    break;

+  case 0x17:

+    if (param_2 != 0x44) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x12,false,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 0x20),0x7e,true,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 0x24),0x9e,true,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 0x28);

+    goto LAB_11;

+  case 0x18:

+    bVar7 = param_2 == 0xc;

+    goto LAB_12;

+  case 0x19:

+  case 0x1d:

+  case 0x22:

+    bVar7 = param_2 == 0x14;

+    goto LAB_12;

+  case 0x1a:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    goto LAB_13;

+  case 0x1b:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x14,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_14;

+  case 0x1c:

+  case 0x1e:

+  case 0x1f:

+  case 0x20:

+  case 0x21:

+    bVar7 = param_2 == 0x10;

+LAB_12:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_13:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x14;

+    break;

+  case 0x23:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x14;

+    goto LAB_15;

+  case 0x24:

+  case 0x2e:

+  case 0x2f:

+  case 0x10c:

+    bVar7 = param_2 == 8;

+    goto LAB_16;

+  case 0x25:

+  case 0x117:

+  case 0x118:

+    bVar7 = param_2 == 0x10;

+    goto LAB_16;

+  case 0x26:

+    bVar7 = param_2 == 0x10;

+    goto LAB_17;

+  case 0x27:

+    bVar7 = param_2 == 0xc;

+LAB_17:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    goto LAB_18;

+  case 0x28:

+  case 0x115:

+  case 0x116:

+    bVar7 = param_2 == 0x10;

+    goto LAB_19;

+  case 0x29:

+    bVar7 = param_2 == 0xc;

+    goto LAB_19;

+  case 0x2a:

+  case 0x107:

+  case 0x10a:

+  case 0x111:

+  case 0x112:

+  case 0x11a:

+    bVar7 = param_2 == 0xc;

+    goto LAB_16;

+  case 0x2b:

+  case 0x2d:

+  case 0x10d:

+    if (param_2 < 0xc) {

+      return -0x3ffffff3;

+    }

+    return 0;

+  case 0x2c:

+  case 0x10e:

+  case 0x119:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_16;

+  case 0x30:

+    if (param_2 != 0x34) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 0x28);

+    goto LAB_11;

+  case 0x31:

+  case 0x32:

+  case 0x34:

+  case 0x35:

+    bVar7 = param_2 == 0x10;

+    goto LAB_20;

+  case 0x33:

+    bVar7 = param_2 == 0x1c;

+LAB_20:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_21:

+    MVar5 = 0x16;

+    break;

+  case 0x36:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_22;

+  case 0x37:

+    bVar7 = param_2 == 0x10;

+LAB_22:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x17;

+    break;

+  case 0x38:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x19;

+    bVar7 = false;

+    break;

+  case 0x39:

+    if (param_2 != 0x70) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_23;

+  case 0x3a:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x1c;

+    goto LAB_5;

+  case 0x3b:

+  case 0x3c:

+  case 0x3d:

+  case 0x3f:

+    bVar7 = param_2 == 0x14;

+    goto LAB_24;

+  case 0x3e:

+    bVar7 = param_2 == 0x10;

+    goto LAB_24;

+  case 0x40:

+    bVar7 = param_2 == 0x24;

+LAB_24:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_25;

+  case 0x41:

+    bVar7 = param_2 == 0x14;

+    goto LAB_26;

+  case 0x42:

+  case 0x43:

+  case 0x46:

+  case 0x47:

+    bVar7 = param_2 == 0x18;

+    goto LAB_26;

+  case 0x44:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_26;

+  case 0x45:

+    bVar7 = param_2 == 0x10;

+    goto LAB_26;

+  case 0x48:

+    bVar7 = param_2 == 0x4c;

+LAB_26:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_27:

+    MVar5 = 0x1e;

+    break;

+  case 0x49:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_28;

+  case 0x4a:

+    bVar7 = param_2 == 0x10;

+LAB_28:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x20;

+    break;

+  case 0x4b:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_29;

+  case 0x4c:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x21;

+    goto LAB_30;

+  case 0x4d:

+    bVar7 = param_2 == 0x18;

+    goto LAB_29;

+  case 0x4e:

+    bVar7 = param_2 == 0x10;

+LAB_29:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x21;

+    break;

+  case 0x4f:

+  case 0x50:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    goto LAB_31;

+  case 0x51:

+  case 0x52:

+    bVar7 = param_2 == 0xc;

+    goto LAB_32;

+  case 0x53:

+    bVar7 = param_2 == 0x10;

+LAB_32:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_31:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_33:

+    MVar5 = 0x23;

+    break;

+  case 0x54:

+    bVar7 = param_2 == 0xc;

+    goto LAB_34;

+  case 0x55:

+    bVar7 = param_2 == 0x5c;

+    goto LAB_34;

+  case 0x56:

+    bVar7 = param_2 == 0x14;

+    goto LAB_34;

+  case 0x57:

+  case 0x58:

+  case 0x59:

+  case 0x5a:

+    bVar7 = param_2 == 0x10;

+LAB_34:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x24;

+    break;

+  case 0x5b:

+    if (param_2 != 0x20) {

+      return -0x3ffffff3;

+    }

+    goto LAB_35;

+  case 0x5c:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+LAB_35:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x25;

+    break;

+  case 0x5d:

+  case 0x5e:

+  case 0x5f:

+  case 0x62:

+  case 99:

+  case 100:

+    bVar7 = param_2 == 0x10;

+    goto LAB_36;

+  case 0x60:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_36;

+  case 0x61:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x26;

+    goto LAB_30;

+  case 0x65:

+    bVar7 = param_2 == 0x18;

+LAB_36:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x26;

+    break;

+  case 0x66:

+  case 0x67:

+  case 0x68:

+  case 0x6b:

+  case 0x6d:

+  case 0x6e:

+  case 0x6f:

+  case 0x71:

+  case 0x73:

+    bVar7 = param_2 == 0x10;

+    goto LAB_37;

+  case 0x69:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x28;

+    goto LAB_30;

+  case 0x6a:

+  case 0x70:

+    bVar7 = param_2 == 0x18;

+    goto LAB_37;

+  case 0x6c:

+  case 0x72:

+    bVar7 = param_2 == 0x1c;

+LAB_37:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x28;

+    break;

+  case 0x74:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_38;

+  case 0x75:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    goto LAB_39;

+  case 0x76:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x2b,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_40;

+  case 0x77:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+LAB_39:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_41;

+  case 0x78:

+    if (param_2 < 0x14) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x2c;

+    goto LAB_42;

+  case 0x79:

+  case 0x1ca:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_43;

+  case 0x7a:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x31;

+    bVar7 = false;

+    break;

+  case 0x7b:

+    bVar7 = param_2 == 0x3c;

+    goto LAB_44;

+  case 0x7c:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x32;

+    goto LAB_45;

+  case 0x7d:

+    bVar7 = param_2 == 0x10;

+    goto LAB_44;

+  case 0x7e:

+    bVar7 = param_2 == 0x44;

+LAB_44:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x32;

+    break;

+  case 0x7f:

+  case 0x83:

+  case 0x84:

+    bVar7 = param_2 == 0x10;

+    goto LAB_46;

+  case 0x80:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_46;

+  case 0x81:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x35;

+    goto LAB_47;

+  case 0x82:

+    bVar7 = param_2 == 0x18;

+LAB_46:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_48:

+    MVar5 = 0x35;

+    break;

+  case 0x85:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x37,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    goto LAB_49;

+  case 0x86:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x37,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_50;

+  case 0x87:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x37,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0x1c;

+    break;

+  case 0x88:

+  case 0x89:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x39;

+    bVar7 = false;

+    break;

+  case 0x8a:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x3a;

+    goto LAB_5;

+  case 0x8b:

+    bVar7 = param_2 < 0x10;

+    goto LAB_51;

+  case 0x8c:

+  case 0x8d:

+    bVar7 = param_2 < 0x14;

+LAB_51:

+    if (bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_40:

+    MVar5 = 0x3a;

+    break;

+  case 0x8e:

+    if (param_2 < 0x14) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x3b;

+    break;

+  case 0x8f:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_52;

+  case 0x90:

+    bVar7 = param_2 < 0xc;

+    goto LAB_53;

+  case 0x91:

+    if (param_2 != 0x34) {

+      return -0x3ffffff3;

+    }

+    goto LAB_54;

+  case 0x92:

+    bVar7 = param_2 < 0x1c;

+LAB_53:

+    if (bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_54:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x40;

+    break;

+  case 0x93:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x40;

+    goto LAB_55;

+  case 0x94:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x40,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+LAB_43:

+    MVar5 = 0x2e;

+    break;

+  case 0x95:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x41;

+    goto LAB_56;

+  case 0x96:

+  case 0x97:

+  case 0x98:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_57;

+  case 0x99:

+    if (param_2 < 0x14) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x47,false,local_res10);

+    uVar6 = (ulonglong)*(uint *)((longlong)param_1 + 0xc);

+    if (uVar2 - 0x14 < uVar6) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x17;

+    goto LAB_58;

+  case 0x9a:

+  case 0x9b:

+  case 0x9c:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x47;

+    bVar7 = false;

+    break;

+  case 0x9d:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x47;

+    goto LAB_56;

+  case 0x9e:

+    bVar7 = param_2 == 0x20;

+    goto LAB_59;

+  case 0x9f:

+    bVar7 = param_2 == 0x10;

+LAB_59:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x49;

+    break;

+  case 0xa0:

+    bVar7 = param_2 == 0x24;

+    goto LAB_60;

+  case 0xa1:

+  case 0xa2:

+    bVar7 = param_2 == 0x10;

+LAB_60:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x4a;

+    break;

+  case 0xa3:

+    bVar7 = param_2 == 0x14;

+    goto LAB_61;

+  case 0xa4:

+    bVar7 = param_2 == 0x10;

+LAB_61:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x4b;

+    break;

+  case 0xa5:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_62;

+  case 0xa6:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x4c;

+    goto LAB_63;

+  case 0xa7:

+    bVar7 = param_2 == 0x24;

+LAB_62:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x4c;

+    break;

+  case 0xa8:

+    bVar7 = param_2 == 0x18;

+    goto LAB_64;

+  case 0xa9:

+    bVar7 = param_2 == 0x10;

+    goto LAB_64;

+  case 0xaa:

+    bVar7 = param_2 == 0x1c;

+LAB_64:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x4e;

+    break;

+  case 0xab:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x4e;

+    goto LAB_30;

+  case 0xac:

+    bVar7 = param_2 == 0x44;

+    goto LAB_65;

+  case 0xad:

+    bVar7 = param_2 == 0x10;

+    goto LAB_65;

+  case 0xae:

+    bVar7 = param_2 == 0x14;

+LAB_65:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x4f;

+    break;

+  case 0xaf:

+    if (param_2 != 0x24) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x54,false,local_res10);

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

+    goto LAB_11;

+  case 0xb0:

+    bVar7 = param_2 == 0xc;

+    goto LAB_66;

+  case 0xb1:

+    bVar7 = param_2 == 0x1c;

+LAB_66:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x54;

+    break;

+  case 0xb2:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x55;

+    goto LAB_5;

+  case 0xb3:

+    bVar7 = param_2 == 0x38;

+    goto LAB_67;

+  case 0xb4:

+    bVar7 = param_2 == 0x10;

+    goto LAB_67;

+  case 0xb5:

+    bVar7 = param_2 == 0x34;

+    goto LAB_67;

+  case 0xb6:

+    bVar7 = param_2 == 0x18;

+LAB_67:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x56;

+    break;

+  case 0xb7:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_68;

+  case 0xb8:

+  case 0xb9:

+  case 0xbd:

+  case 0xc0:

+    bVar7 = param_2 == 0x10;

+    goto LAB_68;

+  case 0xba:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x57,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0x50;

+    break;

+  case 0xbb:

+    bVar7 = param_2 == 0x14;

+    goto LAB_68;

+  case 0xbc:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x57,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_69;

+  case 0xbe:

+    if (param_2 < 0x18) {

+      return -0x3ffffff3;

+    }

+    goto LAB_70;

+  case 0xbf:

+    bVar7 = param_2 == 0x18;

+LAB_68:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_70:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_71:

+    MVar5 = 0x57;

+    break;

+  case 0xc1:

+  case 0xc9:

+    bVar7 = param_2 == 0x18;

+    goto LAB_72;

+  case 0xc2:

+  case 0xcc:

+    bVar7 = param_2 < 0x10;

+    goto LAB_73;

+  case 0xc3:

+  case 0xc5:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_72;

+  case 0xc4:

+    bVar7 = param_2 == 0xc;

+    goto LAB_72;

+  case 0xc6:

+  case 0xce:

+  case 0xd0:

+    bVar7 = param_2 == 0x10;

+    goto LAB_72;

+  case 199:

+  case 200:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x58,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    goto LAB_74;

+  case 0xca:

+    if (param_2 < 0x18) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x58,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    goto LAB_74;

+  case 0xcb:

+    bVar7 = param_2 < 0xc;

+LAB_73:

+    if (bVar7) {

+      return -0x3ffffff3;

+    }

+    goto LAB_75;

+  case 0xcd:

+  case 0xcf:

+    bVar7 = param_2 == 0x14;

+    goto LAB_72;

+  case 0xd1:

+  case 0xd4:

+    bVar7 = param_2 == 0x20;

+    goto LAB_72;

+  case 0xd2:

+    bVar7 = param_2 == 0x24;

+LAB_72:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_75:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_76:

+    MVar5 = 0x58;

+    break;

+  case 0xd3:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_77;

+  case 0xd5:

+    bVar7 = param_2 == 0x24;

+LAB_77:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x58;

+LAB_78:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_8;

+  case 0xd6:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x59,false,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 8),0x58,true,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    bVar7 = true;

+    goto LAB_76;

+  case 0xd7:

+    bVar7 = param_2 < 0x10;

+    goto LAB_79;

+  case 0xd8:

+    if (param_2 != 0x48) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x5a,false,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 0xc),0x9b,true,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 0x2c),2,true,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 0x30);

+    goto LAB_80;

+  case 0xd9:

+    bVar7 = param_2 < 0x14;

+LAB_79:

+    if (bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_81:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x5a;

+    break;

+  case 0xda:

+  case 0xdb:

+  case 0xdc:

+    bVar7 = param_2 == 0x10;

+    goto LAB_82;

+  case 0xdd:

+  case 0xde:

+    bVar7 = param_2 == 0x24;

+LAB_82:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    goto LAB_81;

+  case 0xdf:

+  case 0xe1:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x5b;

+    bVar7 = false;

+    break;

+  case 0xe0:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x5b,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0x37;

+    break;

+  case 0xe2:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x5b;

+    goto LAB_83;

+  case 0xe3:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_4:

+    MVar5 = 0x5c;

+    break;

+  case 0xe4:

+    bVar7 = param_2 == 0x24;

+    goto LAB_84;

+  case 0xe5:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x5e;

+    goto LAB_45;

+  case 0xe6:

+    bVar7 = param_2 == 0x10;

+    goto LAB_84;

+  case 0xe7:

+    bVar7 = param_2 == 0x44;

+LAB_84:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x5e;

+    break;

+  case 0xe8:

+    if (param_2 != 0x34) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x60;

+    goto LAB_30;

+  case 0xe9:

+  case 0xea:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x61;

+    bVar7 = false;

+    break;

+  case 0xeb:

+  case 0xec:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 100;

+    bVar7 = false;

+    break;

+  case 0xed:

+    bVar7 = param_2 == 0x4c;

+    goto LAB_85;

+  case 0xee:

+    bVar7 = param_2 == 0xe4;

+    goto LAB_85;

+  case 0xef:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x66;

+    goto LAB_86;

+  case 0xf0:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x66;

+LAB_15:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0xb7;

+    break;

+  case 0xf1:

+    bVar7 = param_2 == 0x10;

+    goto LAB_85;

+  case 0xf2:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x66;

+    goto LAB_87;

+  case 0xf3:

+    bVar7 = param_2 == 0xdc;

+LAB_85:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x66;

+    break;

+  case 0xf4:

+    if (param_2 < 0xc) {

+      return -0x3ffffff3;

+    }

+    goto LAB_88;

+  case 0xf5:

+    if (param_2 != 0x20) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x67,false,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 8),0x2b,true,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 0xc),0x2b,true,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 0x10),0x2b,true,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 0x14),0x2b,true,local_res10);

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

+LAB_74:

+    bVar7 = true;

+LAB_41:

+    MVar5 = 0x2b;

+    break;

+  case 0xf6:

+    bVar7 = param_2 == 0x94;

+    goto LAB_89;

+  case 0xf7:

+    bVar7 = param_2 == 0x20;

+LAB_89:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_88:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_69:

+    MVar5 = 0x67;

+    break;

+  case 0xf8:

+    bVar7 = param_2 == 0x3c;

+    goto LAB_90;

+  case 0xf9:

+    bVar7 = param_2 == 0x10;

+    goto LAB_90;

+  case 0xfa:

+  case 0xfb:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x69;

+    goto LAB_47;

+  case 0xfc:

+    if (param_2 != 0x24) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x6a;

+    bVar7 = false;

+    break;

+  case 0xfd:

+  case 0x102:

+    bVar7 = param_2 == 0x14;

+    goto LAB_91;

+  case 0xfe:

+    bVar7 = param_2 == 0x2c;

+    goto LAB_91;

+  case 0xff:

+  case 0x100:

+  case 0x101:

+    bVar7 = param_2 == 0x18;

+LAB_91:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x6e;

+    break;

+  case 0x103:

+    bVar7 = param_2 == 0x14;

+    goto LAB_92;

+  case 0x104:

+    bVar7 = param_2 == 0x10;

+LAB_92:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x6f;

+    break;

+  case 0x105:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x6f;

+    goto LAB_47;

+  case 0x106:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x70;

+    bVar7 = false;

+    break;

+  case 0x108:

+    bVar7 = param_2 == 0x80;

+    goto LAB_16;

+  case 0x109:

+    bVar7 = param_2 == 0x2c;

+    goto LAB_16;

+  case 0x10b:

+    bVar7 = param_2 == 0x3c;

+    goto LAB_16;

+  case 0x10f:

+    bVar7 = param_2 == 0x20;

+    goto LAB_16;

+  case 0x110:

+    bVar7 = param_2 == 0x24;

+    goto LAB_16;

+  case 0x113:

+    bVar7 = param_2 == 0x9c;

+    goto LAB_16;

+  case 0x114:

+    bVar7 = param_2 == 0x18;

+    goto LAB_19;

+  case 0x11b:

+    bVar7 = param_2 == 0x18;

+LAB_16:

+    if (bVar7) {

+      return 0;

+    }

+LAB_93:

+    return -0x3ffffff3;

+  case 0x11c:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x71;

+    goto LAB_5;

+  case 0x11d:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x72;

+    bVar7 = false;

+    break;

+  case 0x11e:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x73;

+    bVar7 = false;

+    break;

+  case 0x11f:

+  case 0x121:

+  case 0x125:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    goto LAB_94;

+  case 0x120:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x74;

+    goto LAB_5;

+  case 0x122:

+  case 0x123:

+    bVar7 = param_2 == 0xc;

+    goto LAB_95;

+  case 0x124:

+    bVar7 = param_2 == 0x1c;

+LAB_95:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_94:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x74;

+    break;

+  case 0x126:

+  case 0x128:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x76;

+    goto LAB_30;

+  case 0x127:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x76,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_21;

+  case 0x129:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x76;

+    goto LAB_47;

+  case 0x12a:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x77;

+    bVar7 = false;

+    break;

+  case 299:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x77;

+    goto LAB_47;

+  case 300:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x77;

+    goto LAB_30;

+  case 0x12d:

+  case 0x12e:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    goto LAB_96;

+  case 0x12f:

+  case 0x130:

+    bVar7 = param_2 == 0xc;

+    goto LAB_97;

+  case 0x131:

+  case 0x133:

+  case 0x134:

+  case 0x135:

+  case 0x136:

+  case 0x137:

+    bVar7 = param_2 == 0x10;

+LAB_97:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_96:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x78;

+    break;

+  case 0x132:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x78,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_33;

+  case 0x138:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x79;

+    bVar7 = false;

+    break;

+  case 0x139:

+    if (param_2 < 0x1c) {

+      return -0x3ffffff3;

+    }

+    goto LAB_98;

+  case 0x13a:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+LAB_98:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_50:

+    MVar5 = 0x7a;

+    break;

+  case 0x13b:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x7b;

+    goto LAB_99;

+  case 0x13c:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x7b;

+    goto LAB_100;

+  case 0x13d:

+  case 0x13e:

+  case 0x13f:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x7c;

+    bVar7 = false;

+    break;

+  case 0x140:

+  case 0x141:

+  case 0x144:

+  case 0x146:

+    bVar7 = param_2 == 0x10;

+    goto LAB_101;

+  case 0x142:

+  case 0x145:

+    bVar7 = param_2 == 0x14;

+    goto LAB_101;

+  case 0x143:

+    bVar7 = param_2 == 0x30;

+LAB_101:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x7d;

+    break;

+  case 0x147:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_102;

+  case 0x148:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x7f;

+    goto LAB_30;

+  case 0x149:

+  case 0x14d:

+  case 0x14e:

+    bVar7 = param_2 == 0x14;

+    goto LAB_103;

+  case 0x14a:

+    bVar7 = param_2 == 0xc;

+    goto LAB_103;

+  case 0x14b:

+  case 0x14f:

+    bVar7 = param_2 == 0x10;

+    goto LAB_103;

+  case 0x14c:

+    bVar7 = param_2 == 0x1c;

+LAB_103:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x81;

+    bVar7 = false;

+    break;

+  case 0x150:

+    bVar7 = param_2 == 0x14;

+    goto LAB_104;

+  case 0x151:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x82;

+LAB_45:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+LAB_105:

+    MVar5 = 0x34;

+    break;

+  case 0x152:

+    bVar7 = param_2 == 0x24;

+LAB_104:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x82;

+    bVar7 = false;

+    break;

+  case 0x153:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x83;

+    bVar7 = false;

+    break;

+  case 0x154:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x84;

+    goto LAB_30;

+  case 0x155:

+    if (param_2 != 0xc) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x84;

+    bVar7 = false;

+    break;

+  case 0x156:

+    bVar7 = param_2 == 0x14;

+    goto LAB_19;

+  case 0x157:

+  case 0x158:

+    bVar7 = param_2 == 0x1c;

+LAB_19:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_106:

+    MVar5 = 0x85;

+    break;

+  case 0x159:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x85,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    goto LAB_18;

+  case 0x15a:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x89;

+    bVar7 = false;

+    break;

+  case 0x15b:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x90,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0x8d;

+    break;

+  case 0x15c:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x90,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_107;

+  case 0x15d:

+    if (param_2 < 0x14) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x90;

+    bVar7 = false;

+    break;

+  case 0x15e:

+  case 0x160:

+  case 0x161:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x97;

+    bVar7 = false;

+    break;

+  case 0x15f:

+    if (param_2 != 0x20) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x97;

+    goto LAB_6;

+  case 0x162:

+    if (param_2 < 0x14) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x9a;

+LAB_42:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    uVar6 = (ulonglong)*(uint *)((longlong)param_1 + 0xc);

+    if (uVar2 - 0x14 < uVar6) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xb1;

+    goto LAB_58;

+  case 0x163:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x9a;

+LAB_100:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+LAB_108:

+    MVar5 = 0xb2;

+    break;

+  case 0x164:

+    if (param_2 < 0x14) {

+      return -0x3ffffff3;

+    }

+    goto LAB_109;

+  case 0x165:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x9d;

+LAB_5:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+LAB_80:

+    bVar7 = true;

+LAB_110:

+    MVar5 = 0x9b;

+    break;

+  case 0x166:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x9e;

+    bVar7 = false;

+    break;

+  case 0x167:

+    if (param_2 != 0x4c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xa0;

+    bVar7 = false;

+    break;

+  case 0x168:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xa0;

+    goto LAB_30;

+  case 0x169:

+  case 0x16c:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xa3;

+    goto LAB_47;

+  case 0x16a:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xa3;

+    goto LAB_99;

+  case 0x16b:

+  case 0x16e:

+  case 0x16f:

+  case 0x171:

+    bVar7 = param_2 == 0x10;

+    goto LAB_111;

+  case 0x16d:

+    if (param_2 < 0x14) {

+      return -0x3ffffff3;

+    }

+    goto LAB_112;

+  case 0x170:

+    bVar7 = param_2 == 0x1c;

+LAB_111:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_112:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xa3;

+    bVar7 = false;

+    break;

+  case 0x172:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xa4;

+    goto LAB_47;

+  case 0x173:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xa4;

+LAB_83:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_48;

+  case 0x174:

+  case 0x175:

+  case 0x176:

+  case 0x177:

+  case 0x178:

+  case 0x17b:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xa7;

+    bVar7 = false;

+    break;

+  case 0x179:

+    if (param_2 != 0x34) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xa7;

+    goto LAB_6;

+  case 0x17a:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xa7;

+    goto LAB_56;

+  case 0x17c:

+    if (param_2 < 0x14) {

+      return -0x3ffffff3;

+    }

+    goto LAB_113;

+  case 0x17d:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xb1;

+LAB_56:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+LAB_25:

+    MVar5 = 0x1d;

+    break;

+  case 0x17e:

+  case 0x181:

+  case 0x182:

+    bVar7 = param_2 == 0x10;

+    goto LAB_114;

+  case 0x17f:

+  case 0x180:

+    bVar7 = param_2 == 0x14;

+LAB_114:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_108;

+  case 0x183:

+    bVar7 = param_2 == 0x3c;

+    goto LAB_115;

+  case 0x184:

+    bVar7 = param_2 == 0x1c;

+LAB_115:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xb3;

+    bVar7 = false;

+    break;

+  case 0x185:

+  case 0x186:

+  case 0x195:

+  case 0x1a1:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    goto LAB_116;

+  case 0x187:

+  case 0x18b:

+    bVar7 = param_2 == 0xc;

+    goto LAB_117;

+  case 0x188:

+  case 0x18a:

+  case 0x18d:

+  case 0x196:

+  case 0x19a:

+  case 0x19b:

+  case 0x19c:

+  case 0x19d:

+  case 0x1a6:

+    bVar7 = param_2 == 0x10;

+    goto LAB_117;

+  case 0x189:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xb4,false,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 8),0xb4,true,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    goto LAB_11;

+  case 0x18c:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xb4;

+    goto LAB_30;

+  case 0x18e:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xb4;

+LAB_6:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+LAB_18:

+    bVar7 = true;

+    goto LAB_106;

+  case 399:

+  case 0x193:

+  case 0x1a3:

+  case 0x1a8:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_117;

+  case 400:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xb4;

+    goto LAB_99;

+  case 0x191:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xb4;

+LAB_86:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+LAB_23:

+    MVar5 = 0x1a;

+    break;

+  case 0x192:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xb4,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0x2d;

+    break;

+  case 0x194:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xb4,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0x36;

+    break;

+  case 0x197:

+    bVar7 = param_2 == 0x24;

+    goto LAB_117;

+  case 0x198:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xb4,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_71;

+  case 0x199:

+  case 0x19e:

+    bVar7 = param_2 == 0x18;

+    goto LAB_117;

+  case 0x19f:

+  case 0x1a2:

+    bVar7 = param_2 == 0x14;

+    goto LAB_117;

+  case 0x1a0:

+    bVar7 = param_2 == 0x34;

+LAB_117:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_116:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_118;

+  case 0x1a4:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xb4;

+    goto LAB_119;

+  case 0x1a5:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xb4,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0xb8;

+    break;

+  case 0x1a7:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xb4;

+LAB_47:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+LAB_49:

+    bVar7 = true;

+    MVar5 = 0x11;

+    break;

+  case 0x1a9:

+    bVar7 = param_2 == 0xc;

+    goto LAB_120;

+  case 0x1aa:

+  case 0x1ab:

+  case 0x1ac:

+    bVar7 = param_2 == 0x14;

+    goto LAB_120;

+  case 0x1ad:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xba;

+    goto LAB_30;

+  case 0x1ae:

+    bVar7 = param_2 == 0x10;

+LAB_120:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xba;

+    bVar7 = false;

+    break;

+  case 0x1af:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xbd,false,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 8),0x29,true,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    goto LAB_121;

+  default:

+    goto LAB_93;

+  case 0x1c3:

+    if (param_2 != 0x30) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 1;

+    bVar7 = false;

+    break;

+  case 0x1c4:

+    if (param_2 != 0x20) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 6;

+    bVar7 = false;

+    break;

+  case 0x1c5:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xe;

+    bVar7 = false;

+    break;

+  case 0x1c6:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x10;

+    bVar7 = false;

+    break;

+  case 0x1c7:

+    if (param_2 != 100) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x18;

+    bVar7 = false;

+    break;

+  case 0x1c8:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x1b,false,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 0xc),0x41,true,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 0x10);

+    goto LAB_122;

+  case 0x1c9:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x1f;

+    bVar7 = false;

+    break;

+  case 0x1cb:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x3d;

+    bVar7 = false;

+    break;

+  case 0x1cc:

+    if (param_2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x3e;

+    bVar7 = false;

+    break;

+  case 0x1cd:

+    if (param_2 < 0x14) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x44,false,local_res10);

+    uVar6 = (ulonglong)*(uint *)((longlong)param_1 + 8);

+    if (uVar2 - 0x14 < uVar6) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x41;

+LAB_58:

+    uVar4 = (uint)(uVar6 >> 2);

+    puVar3 = (uint *)((longlong)param_1 + 0x10);

+    goto LAB_123;

+  case 0x1ce:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x51;

+    bVar7 = false;

+    break;

+  case 0x1cf:

+    if (param_2 != 0x3c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 99;

+    bVar7 = false;

+    break;

+  case 0x1d0:

+    bVar7 = param_2 == 0xc;

+LAB_90:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x68;

+    break;

+  case 0x1d1:

+    if (param_2 != 0x24) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x6b;

+    bVar7 = false;

+    break;

+  case 0x1d2:

+    if (param_2 != 0x4c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x6c;

+    bVar7 = false;

+    break;

+  case 0x1d3:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x88;

+    bVar7 = false;

+    break;

+  case 0x1d4:

+    if (param_2 != 0x24) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x99;

+    bVar7 = false;

+    break;

+  case 0x1d5:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_110;

+  case 0x1d6:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+LAB_109:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_124;

+  case 0x1d7:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+LAB_113:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xa9;

+    bVar7 = false;

+    break;

+  case 0x1d8:

+    if (param_2 != 0x34) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xb0;

+    bVar7 = false;

+    break;

+  case 0x1d9:

+    if (param_2 != 0x28) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xb6,false,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 8),0xb4,true,local_res10);

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 0xc),0xb4,true,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 0x10);

+    goto LAB_121;

+  case 0x1da:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xb9;

+    goto LAB_30;

+  case 0x1db:

+  case 0x1dc:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),3,false,local_res10);

+    if ((ulonglong)*(uint *)((longlong)param_1 + 8) != uVar2 - 0x10) {

+      return -0x3ffffff3;

+    }

+    uVar4 = (uint)(uVar2 - 0x10 >> 2);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    MVar5 = 0x5a;

+    goto LAB_123;

+  case 0x1dd:

+  case 0x1de:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 3;

+    bVar7 = false;

+    break;

+  case 0x1df:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 4;

+    bVar7 = false;

+    break;

+  case 0x1e0:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 5;

+    goto LAB_78;

+  case 0x1e1:

+  case 0x1e2:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),5,false,local_res10);

+    if ((ulonglong)*(uint *)((longlong)param_1 + 8) != uVar2 - 0x10) {

+      return -0x3ffffff3;

+    }

+    uVar4 = (uint)(uVar2 - 0x10 >> 2);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    MVar5 = 0xb;

+    goto LAB_123;

+  case 0x1e3:

+  case 0x1e4:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 5;

+    bVar7 = false;

+    break;

+  case 0x1e5:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 7;

+    goto LAB_125;

+  case 0x1e6:

+  case 0x1e7:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),7,false,local_res10);

+    if ((ulonglong)*(uint *)((longlong)param_1 + 8) != uVar2 - 0x10) {

+      return -0x3ffffff3;

+    }

+    uVar4 = (uint)(uVar2 - 0x10 >> 2);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    bVar7 = true;

+    MVar5 = 8;

+    goto LAB_126;

+  case 0x1e8:

+  case 0x1e9:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    goto LAB_127;

+  case 0x1ea:

+  case 0x1eb:

+  case 0x1ec:

+  case 0x1ed:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+LAB_127:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 8;

+    break;

+  case 0x1ee:

+  case 500:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x13;

+    goto LAB_30;

+  case 0x1ef:

+  case 0x1f2:

+  case 499:

+  case 0x1f8:

+    bVar7 = param_2 == 0x10;

+    goto LAB_128;

+  case 0x1f0:

+  case 0x1f7:

+    bVar7 = param_2 == 0x14;

+LAB_128:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_129:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_14:

+    MVar5 = 0x13;

+    break;

+  case 0x1f1:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x13;

+    goto LAB_119;

+  case 0x1f5:

+  case 0x1f6:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    goto LAB_129;

+  case 0x1f9:

+  case 0x1fa:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x22;

+    break;

+  case 0x1fb:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x22;

+    goto LAB_63;

+  case 0x1fc:

+  case 0x1fd:

+  case 0x200:

+    bVar7 = param_2 == 0x14;

+    goto LAB_130;

+  case 0x1fe:

+  case 0x1ff:

+    bVar7 = param_2 == 0x10;

+LAB_130:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x30;

+    break;

+  case 0x201:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_131;

+  case 0x202:

+    bVar7 = param_2 == 0x14;

+LAB_131:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x33;

+    break;

+  case 0x203:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_105;

+  case 0x204:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x34;

+    goto LAB_30;

+  case 0x205:

+  case 0x206:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x38;

+    bVar7 = false;

+    break;

+  case 0x207:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x38;

+LAB_119:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0xab;

+    break;

+  case 0x208:

+  case 0x209:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    goto LAB_132;

+  case 0x20a:

+  case 0x20b:

+    bVar7 = param_2 == 0x10;

+    goto LAB_133;

+  case 0x20c:

+    bVar7 = param_2 == 0x14;

+    goto LAB_133;

+  case 0x20d:

+    bVar7 = param_2 == 0x1c;

+LAB_133:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+LAB_132:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_134:

+    MVar5 = 0x3f;

+    break;

+  case 0x20e:

+  case 0x20f:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x43,false,local_res10);

+    if ((ulonglong)*(uint *)((longlong)param_1 + 8) != uVar2 - 0x10) {

+      return -0x3ffffff3;

+    }

+    uVar4 = (uint)(uVar2 - 0x10 >> 2);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    bVar7 = true;

+    MVar5 = 0x42;

+    goto LAB_126;

+  case 0x214:

+  case 0x215:

+  case 0x216:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    goto LAB_135;

+  case 0x217:

+  case 0x218:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+LAB_135:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x48;

+    break;

+  case 0x219:

+  case 0x21a:

+  case 0x21f:

+  case 0x220:

+  case 0x221:

+  case 0x222:

+  case 0x223:

+  case 0x224:

+  case 0x225:

+    bVar7 = param_2 == 0x10;

+    goto LAB_136;

+  case 0x21b:

+  case 0x21d:

+    bVar7 = param_2 == 0x1c;

+LAB_136:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x52;

+    break;

+  case 0x21c:

+  case 0x21e:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x52,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+LAB_102:

+    MVar5 = 0x7e;

+    break;

+  case 0x226:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x52;

+LAB_125:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0x53;

+    break;

+  case 0x227:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x5d;

+    bVar7 = false;

+    break;

+  case 0x228:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x5d,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+LAB_52:

+    MVar5 = 0x3c;

+    break;

+  case 0x229:

+  case 0x22a:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x5d;

+LAB_87:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0xaa;

+    break;

+  case 0x22b:

+  case 0x22c:

+    if (param_2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x62;

+    bVar7 = false;

+    break;

+  case 0x22d:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    goto LAB_137;

+  case 0x22e:

+  case 0x22f:

+  case 0x230:

+  case 0x231:

+  case 0x232:

+  case 0x233:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+LAB_137:

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    MVar5 = 0x6d;

+    break;

+  case 0x234:

+  case 0x235:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+    goto LAB_138;

+  case 0x236:

+  case 0x237:

+  case 0x238:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x86;

+    bVar7 = false;

+    break;

+  case 0x239:

+  case 0x23a:

+  case 0x23b:

+  case 0x23c:

+  case 0x23d:

+  case 0x23e:

+  case 0x23f:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x87;

+    bVar7 = false;

+    break;

+  case 0x240:

+  case 0x241:

+  case 0x242:

+  case 0x243:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x8a;

+    bVar7 = false;

+    break;

+  case 0x244:

+  case 0x245:

+  case 0x246:

+  case 0x247:

+  case 0x248:

+  case 0x249:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x8b;

+    bVar7 = false;

+    break;

+  case 0x24a:

+  case 0x252:

+  case 0x253:

+  case 0x254:

+  case 0x255:

+  case 0x256:

+  case 599:

+  case 600:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    bVar7 = false;

+LAB_107:

+    MVar5 = 0x8f;

+    break;

+  case 0x24b:

+  case 0x24c:

+  case 0x24d:

+  case 0x24e:

+  case 0x24f:

+  case 0x250:

+  case 0x251:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x8f,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0x9d;

+    break;

+  case 0x259:

+  case 0x25c:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x91;

+    goto LAB_139;

+  case 0x25a:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_140;

+  case 0x25b:

+  case 0x25d:

+    bVar7 = param_2 == 0x10;

+LAB_140:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x91;

+    bVar7 = false;

+    break;

+  case 0x25e:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x92,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_27;

+  case 0x25f:

+  case 0x260:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x93,false,local_res10);

+    if ((ulonglong)*(uint *)((longlong)param_1 + 8) != uVar2 - 0x10) {

+      return -0x3ffffff3;

+    }

+    uVar4 = (uint)(uVar2 - 0x10 >> 2);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    MVar5 = 0x93;

+    goto LAB_123;

+  case 0x261:

+  case 0x262:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x93,false,local_res10);

+    if ((ulonglong)*(uint *)((longlong)param_1 + 8) != uVar2 - 0x10) {

+      return -0x3ffffff3;

+    }

+    uVar4 = (uint)(uVar2 - 0x10 >> 2);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    MVar5 = 0x8c;

+    goto LAB_123;

+  case 0x263:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x93,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0x92;

+    break;

+  case 0x264:

+  case 0x265:

+  case 0x268:

+  case 0x26a:

+  case 0x26c:

+    bVar7 = param_2 == 0x10;

+    goto LAB_141;

+  case 0x266:

+  case 0x269:

+  case 0x26b:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0x95;

+LAB_139:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0x8e;

+    break;

+  case 0x267:

+    bVar7 = param_2 == 0x18;

+LAB_141:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x95;

+    bVar7 = false;

+    break;

+  case 0x26d:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0x98,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0x93;

+    break;

+  case 0x26e:

+  case 0x26f:

+  case 0x270:

+  case 0x271:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0x9f;

+    bVar7 = false;

+    break;

+  case 0x272:

+    if (param_2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xa2;

+    bVar7 = false;

+    break;

+  case 0x273:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xa5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    MVar5 = 0xa6;

+    break;

+  case 0x274:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xa8;

+LAB_63:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+LAB_121:

+    bVar7 = true;

+LAB_38:

+    MVar5 = 0x29;

+    break;

+  case 0x275:

+  case 0x279:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xa8;

+LAB_55:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+LAB_124:

+    MVar5 = 0x9c;

+    break;

+  case 0x276:

+  case 0x277:

+  case 0x278:

+  case 0x27a:

+  case 0x27b:

+  case 0x27c:

+  case 0x27d:

+  case 0x27e:

+  case 0x27f:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xa8;

+    bVar7 = false;

+    break;

+  case 0x280:

+  case 0x281:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xac,false,local_res10);

+    if ((ulonglong)*(uint *)((longlong)param_1 + 8) != uVar2 - 0x10) {

+      return -0x3ffffff3;

+    }

+    uVar4 = (uint)(uVar2 - 0x10 >> 2);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    MVar5 = 0xab;

+    goto LAB_123;

+  case 0x282:

+  case 0x283:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xad,false,local_res10);

+    if ((ulonglong)*(uint *)((longlong)param_1 + 8) != uVar2 - 0x10) {

+      return -0x3ffffff3;

+    }

+    uVar4 = (uint)(uVar2 - 0x10 >> 2);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    MVar5 = 0xaa;

+    goto LAB_123;

+  case 0x284:

+  case 0x285:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xae;

+    bVar7 = false;

+    break;

+  case 0x286:

+  case 0x287:

+  case 0x288:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xaf;

+    bVar7 = false;

+    break;

+  case 0x289:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xb5;

+LAB_30:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+LAB_11:

+    bVar7 = true;

+LAB_118:

+    MVar5 = 0xb4;

+    break;

+  case 0x28a:

+  case 0x28b:

+    if (param_2 < 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xb7,false,local_res10);

+    if ((ulonglong)*(uint *)((longlong)param_1 + 8) != uVar2 - 0x10) {

+      return -0x3ffffff3;

+    }

+    uVar4 = (uint)(uVar2 - 0x10 >> 2);

+    puVar3 = (uint *)((longlong)param_1 + 0xc);

+    MVar5 = 0xb4;

+LAB_123:

+    bVar7 = false;

+LAB_126:

+    TranslateMilCommandBatchHandleArray(this,puVar3,uVar4,MVar5,bVar7,local_res10);

+    return local_res10[0];

+  case 0x28c:

+  case 0x28d:

+  case 0x28e:

+  case 0x290:

+  case 0x297:

+  case 0x298:

+  case 0x299:

+    bVar7 = param_2 == 0x1c;

+    goto LAB_142;

+  case 0x28f:

+  case 0x291:

+  case 0x29c:

+  case 0x29d:

+    bVar7 = param_2 == 0x14;

+    goto LAB_142;

+  case 0x292:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    MVar5 = 0xbc;

+LAB_99:

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),MVar5,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+LAB_122:

+    bVar7 = true;

+LAB_57:

+    MVar5 = 0x41;

+    break;

+  case 0x293:

+  case 0x294:

+  case 0x295:

+  case 0x296:

+    bVar7 = param_2 == 0x10;

+LAB_142:

+    if (!bVar7) {

+      return -0x3ffffff3;

+    }

+    puVar3 = (uint *)((longlong)param_1 + 4);

+    MVar5 = 0xbc;

+    bVar7 = false;

+    break;

+  case 0x29a:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xbc,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+    goto LAB_134;

+  case 0x29b:

+    if (param_2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    TranslateMilCommandBatchHandle(this,(uint *)((longlong)param_1 + 4),0xbc,false,local_res10);

+    puVar3 = (uint *)((longlong)param_1 + 8);

+    bVar7 = true;

+LAB_138:

+    MVar5 = 0x80;

+  }

+  TranslateMilCommandBatchHandle(this,puVar3,MVar5,bVar7,local_res10);

+  return local_res10[0];

 }
```

## `DirectComposition::CApplicationChannel::ReplaceResource<DirectComposition::CResourceMarshaler>`  (modified)

```diff
--- DirectComposition::CApplicationChannel::ReplaceResource<DirectComposition::CResourceMarshaler>
+++ CMouseProcessor::ProcessMouseMove
@@ -1,35 +1,317 @@
 

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

-/* public: long __cdecl DirectComposition::CApplicationChannel::ReplaceResource<class

-   DirectComposition::CResourceMarshaler>(class DirectComposition::CResourceMarshaler * __ptr64 *

-   __ptr64,class DirectComposition::CResourceMarshaler * __ptr64,class

-   DirectComposition::CResourceMarshaler * __ptr64) __ptr64 */

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

+/* private: void __cdecl CMouseProcessor::ProcessMouseMove(class CMouseProcessor::CMoveEvent const &

+   __ptr64) __ptr64 */

 

-long __thiscall

-DirectComposition::CApplicationChannel::ReplaceResource<DirectComposition::CResourceMarshaler>

-          (CApplicationChannel *this,CResourceMarshaler **param_1,CResourceMarshaler *param_2,

-          CResourceMarshaler *param_3)

+void __thiscall CMouseProcessor::ProcessMouseMove(CMouseProcessor *this,CMoveEvent *param_1)

 

 {

-  CResourceMarshaler *pCVar1;

-  int iVar2;

+  undefined8 uVar1;

+  tagPOINT tVar2;

+  LONG LVar3;

+  char cVar4;

+  MoveNewPosResult MVar5;

+  ulong uVar6;

+  int iVar7;

+  ISMForwardingDecision IVar8;

+  longlong lVar9;

+  HWND__ *pHVar10;

+  tagTHREADINFO *ptVar11;

+  DropReason DVar12;

+  char cVar13;

+  tagPOINT tVar14;

+  byte bVar15;

+  bool bVar16;

+  undefined1 auStackY_168 [32];

+  undefined4 in_stack_fffffffffffffec4;

+  tagPOINT local_128;

+  undefined8 local_120;

+  tagPOINT local_118;

+  LONG local_110;

+  LONG local_10c;

+  ulong local_108;

+  undefined4 local_104;

+  CMouseProcessor *local_100;

+  CMoveEvent *local_f8;

+  undefined1 local_f0;

+  LONG local_ec;

+  undefined8 local_e8 [2];

+  undefined8 local_d8;

+  undefined4 local_d0;

+  undefined8 local_c8;

+  undefined4 local_c0;

+  tagPOINT local_b8 [16];

+  ulonglong local_38;

   

-  iVar2 = 0;

-  if (param_3 != (CResourceMarshaler *)0x0) {

-    if ((param_2 != (CResourceMarshaler *)0x0) &&

-       (iVar2 = (**(code **)(*(longlong *)param_2 + 8))(param_2,this,param_3), iVar2 < 0)) {

-      return iVar2;

-    }

-    pCVar1 = *param_1;

-    if (pCVar1 != (CResourceMarshaler *)0x0) {

-      (**(code **)(*(longlong *)pCVar1 + 0x10))(pCVar1,this);

-    }

-  }

-  if (param_2 != (CResourceMarshaler *)0x0) {

-    CResourceMarshaler::AddRef(param_2);

-  }

-  ReleaseResource(this,*param_1);

-  *param_1 = param_2;

-  return iVar2;

+  local_38 = __security_cookie ^ (ulonglong)auStackY_168;

+  cVar13 = '\x01';

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

+      ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) || ((byte)WPP_GLOBAL_Control[0x29] < 4))

+  {

+    cVar4 = '\0';

+  }

+  else {

+    cVar4 = '\x01';

+  }

+  bVar16 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

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

+    lVar9 = W32GetUserSessionState();

+    WPP_RECORDER_AND_TRACE_SF_

+              (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar4,bVar16,

+               *(undefined8 *)(lVar9 + 0x10f88));

+  }

+  lVar9 = *(longlong *)(param_1 + 8);

+  bVar15 = 0;

+  local_ec = 0;

+  local_f0 = 0;

+  local_100 = this;

+  local_f8 = param_1;

+  if ((*(uint *)(lVar9 + 0x80) & 0x800) == 0) {

+    MVar5 = AnalyzeNewMousePosition(this,(CMouseEvent *)param_1);

+    if (MVar5 == 1) {

+      uVar1 = *(undefined8 *)(lVar9 + 0x3c);

+      lVar9 = W32GetUserSessionState();

+      *(undefined8 *)(*(longlong *)(lVar9 + 0x4e30) + 0x1358) = uVar1;

+      bVar15 = (*(byte *)(*(longlong *)(param_1 + 8) + 0x82) ^ 0xff) & 1;

+    }

+    else if (MVar5 == 2) {

+      uVar1 = *(undefined8 *)(lVar9 + 0x34);

+      lVar9 = W32GetUserSessionState();

+      *(undefined8 *)(*(longlong *)(lVar9 + 0x4e30) + 0x1360) = uVar1;

+      uVar1 = *(undefined8 *)(*(longlong *)(param_1 + 8) + 0x3c);

+      lVar9 = W32GetUserSessionState();

+      *(undefined8 *)(*(longlong *)(lVar9 + 0x4e30) + 0x1358) = uVar1;

+    }

+    CMouseRawInput::PostRawMouse((CMouseRawInput *)(this + 0xef0),(tagINPUTDEST *)0x0,0);

+    lVar9 = *(longlong *)(param_1 + 8);

+    if ((*(uint *)(lVar9 + 0x80) & 0x4000) != 0) {

+      InformUMObservers(this,(CMouseEvent *)param_1,(tagPOINT *)(lVar9 + 0x34),

+                        (tagPOINT *)(lVar9 + 0x44));

+    }

+    lVar9 = *(longlong *)(param_1 + 8);

+    if (MVar5 == 0) {

+      if ((*(uint *)(lVar9 + 0x80) >> 0x10 & 1) == 0) {

+        if ((*(uint *)(lVar9 + 0x80) >> 0xd & 1) == 0) {

+          InputTraceLogging::Mouse::DropMove(*(__uint64 *)(lVar9 + 0x60),0xb);

+        }

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

+            ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) ||

+           ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

+          cVar13 = '\0';

+        }

+        bVar16 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+        if ((cVar13 != '\0') || (bVar16)) {

+          lVar9 = W32GetUserSessionState();

+          WPP_RECORDER_AND_TRACE_SF_

+                    (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar13,bVar16,

+                     *(undefined8 *)(lVar9 + 0x10f88));

+        }

+        goto LAB_0;

+      }

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

+          ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) ||

+         ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

+        cVar4 = '\0';

+      }

+      else {

+        cVar4 = '\x01';

+      }

+      bVar16 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

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

+        lVar9 = W32GetUserSessionState();

+        WPP_RECORDER_AND_TRACE_SF_

+                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar4,bVar16,

+                   *(undefined8 *)(lVar9 + 0x10f88));

+      }

+      goto LAB_1;

+    }

+    *(ulonglong *)(this + 0xee8) = (ulonglong)*(uint *)(lVar9 + 0x28);

+    lVar9 = *(longlong *)(param_1 + 8);

+    *(undefined8 *)(this + 0xed4) = *(undefined8 *)(lVar9 + 0x34);

+    *(undefined8 *)(this + 0xedc) = *(undefined8 *)(lVar9 + 0x3c);

+  }

+  else {

+LAB_1:

+    *(undefined8 *)(this + 0xee8) = 0;

+  }

+  if ((*(uint *)(*(longlong *)(param_1 + 8) + 0x80) & 0x800) == 0) {

+    cVar4 = `anonymous_namespace'::InMouseRawInputMode(0,1,1);

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

+      lVar9 = `anonymous_namespace'::GetPtiFromInputDest(0,1);

+      if (lVar9 != 0) {

+        local_120 = 0;

+        iVar7 = *(int *)(lVar9 + 400);

+        if (iVar7 < 0) {

+          iVar7 = *(int *)(*(longlong *)(lVar9 + 0x1d0) + 0x10c);

+        }

+        lVar9 = W32GetUserSessionState();

+        PhysicalToLogicalDPIPoint(&local_120,*(longlong *)(lVar9 + 0x4e30) + 0x1360,iVar7,0);

+        *(int *)(this + 0x2c) = (int)local_120;

+        *(int *)(this + 0x30) = local_120._4_4_;

+        *(int *)(this + 0x34) = iVar7;

+      }

+      if ((*(uint *)(*(longlong *)(param_1 + 8) + 0x80) & 0x10000) == 0) {

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

+            ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) ||

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

+          cVar13 = '\0';

+        }

+        bVar16 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+        if ((cVar13 != '\0') || (bVar16)) {

+          lVar9 = W32GetUserSessionState();

+          WPP_RECORDER_AND_TRACE_SF_

+                    (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar13,bVar16,

+                     *(undefined8 *)(lVar9 + 0x10f88));

+        }

+        InputTraceLogging::Mouse::DropMove(*(__uint64 *)(*(longlong *)(param_1 + 8) + 0x60),0xc);

+        goto LAB_0;

+      }

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

+          ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) ||

+         ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

+        cVar4 = '\0';

+      }

+      else {

+        cVar4 = '\x01';

+      }

+      bVar16 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

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

+        lVar9 = W32GetUserSessionState();

+        WPP_RECORDER_AND_TRACE_SF_

+                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar4,bVar16,

+                   *(undefined8 *)(lVar9 + 0x10f88));

+      }

+    }

+  }

+  lVar9 = W32GetUserSessionState();

+  local_128 = *(tagPOINT *)(*(longlong *)(lVar9 + 0x4e30) + 0x1360);

+  lVar9 = W32GetUserSessionState();

+  local_e8[0] = *(undefined8 *)(*(longlong *)(lVar9 + 0x4e30) + 0x1358);

+  LOCK();

+  iVar7 = *(int *)(this + 0xfc0);

+  if (iVar7 == 1) {

+    *(int *)(this + 0xfc0) = 1;

+    iVar7 = 1;

+  }

+  UNLOCK();

+  MouseHitTest(this,local_b8,(_SUBPIXELS *)&local_128,(CMouseEvent *)local_e8,

+               (MouseHitTestOptions)param_1,

+               (uint *)CONCAT44(in_stack_fffffffffffffec4,(uint)(iVar7 != 0)));

+  local_ec = local_b8[0].y;

+  local_f0 = 1;

+  pHVar10 = CInputDest::GetWindowHandle((CInputDest *)local_b8);

+  InputTraceLogging::Mouse::ProcessMove

+            (*(__uint64 *)(*(longlong *)(param_1 + 8) + 0x60),

+             (tagPOINT *)(*(longlong *)(param_1 + 8) + 0x34),pHVar10);

+  if (local_b8[0].x == 0) {

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

+        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) ||

+       ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

+      cVar13 = '\0';

+    }

+    bVar16 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+    if ((cVar13 != '\0') || (bVar16)) {

+      lVar9 = W32GetUserSessionState();

+      WPP_RECORDER_AND_TRACE_SF_

+                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar13,bVar16,

+                 *(undefined8 *)(lVar9 + 0x10f88));

+    }

+    DVar12 = 0xd;

+LAB_2:

+    InputTraceLogging::Mouse::DropMove(*(__uint64 *)(*(longlong *)(param_1 + 8) + 0x60),DVar12);

+  }

+  else {

+    if (bVar15 != 0) {

+      CInputDest::GetDpiAwarenessContext((CInputDest *)local_b8);

+      LogicalCursorPosFromDpiAwarenessContext(this,(ulong)&local_120);

+      if ((int)local_120 == local_128.x) {

+        if (local_120._4_4_ == local_128.y) {

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

+              ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) ||

+             ((byte)WPP_GLOBAL_Control[0x29] < 4)) {

+            cVar13 = '\0';

+          }

+          bVar16 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+          if ((cVar13 != '\0') || (bVar16)) {

+            lVar9 = W32GetUserSessionState();

+            WPP_RECORDER_AND_TRACE_SF_

+                      (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar13,bVar16,

+                       *(undefined8 *)(lVar9 + 0x10f88));

+          }

+          DVar12 = 0xb;

+          goto LAB_2;

+        }

+      }

+    }

+    tVar2 = local_128;

+    LVar3 = local_128.y;

+    tVar14 = local_128;

+    uVar6 = CInputDest::GetDpiAwarenessContext((CInputDest *)local_b8);

+    *(LONG *)(this + 0x2c) = tVar14.x;

+    *(LONG *)(this + 0x30) = LVar3;

+    *(ulong *)(this + 0x34) = uVar6;

+    iVar7 = IsPointerPromotedMouseMessage(0x200,*(longlong *)(param_1 + 8) + 0x78);

+    if (iVar7 != 0) {

+      ptVar11 = PtiCurrent();

+      local_d8 = *(undefined8 *)(*(longlong *)(ptVar11 + 0x1d0) + 0x130);

+      local_d0 = *(undefined4 *)(*(longlong *)(ptVar11 + 0x1d0) + 0x138);

+      cVar4 = `anonymous_namespace'::ValidateUIPI(&local_d8,local_b8);

+      tVar14 = local_128;

+      if (cVar4 != '\0') goto LAB_3;

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

+          ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) ||

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

+        cVar13 = '\0';

+      }

+      bVar16 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+      if ((cVar13 != '\0') || (bVar16)) {

+        lVar9 = W32GetUserSessionState();

+LAB_4:

+        WPP_RECORDER_AND_TRACE_SF_

+                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar13,bVar16,

+                   *(undefined8 *)(lVar9 + 0x10f88));

+      }

+LAB_5:

+      DVar12 = 10;

+      goto LAB_2;

+    }

+LAB_3:

+    bVar16 = CMouseEvent::UsingInjectorUIPI((CMouseEvent *)param_1);

+    if (bVar16) {

+      local_c8 = *(undefined8 *)(*(longlong *)(param_1 + 8) + 0x98);

+      local_c0 = *(undefined4 *)(*(longlong *)(param_1 + 8) + 0xa0);

+      cVar4 = `anonymous_namespace'::ValidateUIPI(&local_c8,local_b8);

+      tVar14 = local_128;

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

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

+            ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 0x20) == 0)) ||

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

+          cVar13 = '\0';

+        }

+        bVar16 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+        if ((cVar13 != '\0') || (bVar16)) {

+          lVar9 = W32GetUserSessionState();

+          goto LAB_4;

+        }

+        goto LAB_5;

+      }

+    }

+    local_104 = 0;

+    local_110 = tVar2.x;

+    local_10c = LVar3;

+    local_118 = tVar14;

+    local_108 = uVar6;

+    IVar8 = ForwardInputToISM(this,(CInputDest *)local_b8,(CMouseEvent *)param_1,

+                              (InputDeliveryContext *)&local_118,&local_128,0,0x200,0);

+    if (IVar8 == 1) {

+      DeliverMouseMoveToInputDest

+                (this,param_1,(CInputDest *)local_b8,(InputDeliveryContext *)&local_118,

+                 (_mouseCursorEvent *)0x0);

+    }

+  }

+  CInputDest::~CInputDest((CInputDest *)local_b8);

+LAB_0:

+  EndStreamToken::~EndStreamToken((EndStreamToken *)&local_100);

+  return;

 }
```

## `DirectComposition::GeneratedCreateSharedWriteMarshaler`  (modified)

```diff
--- DirectComposition::GeneratedCreateSharedWriteMarshaler
+++ DirectComposition::GeneratedCreateSharedWriteMarshaler
@@ -1,2 +1,289 @@
-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)

+

+{

+  CHolographicInteropTextureMarshaler *this;

+  undefined **ppuVar1;

+  undefined4 in_register_0000000c;

+  __uint64 _Var2;

+  

+  _Var2 = CONCAT44(in_register_0000000c,param_1);

+  if (param_1 < 0x6d) {

+    if (param_1 == 0x6c) {

+      this = Win32AllocPoolWithQuotaZInitImpl(_Var2,0x90,0x30734344);

+      if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+        CMatrixTransform3DMarshaler::CMatrixTransform3DMarshaler

+                  ((CMatrixTransform3DMarshaler *)this);

+        *(CSharedSystemResource **)(this + 0x88) = param_2;

+        *(undefined ***)this =

+             &CSharedResourceMarshaler<DirectComposition::CMatrixTransform3DMarshaler,2>::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 < 0x4f) {

+      if (param_1 == 0x4e) {

+        this = Win32AllocPoolWithQuotaZInitImpl(_Var2,0x68,0x30734344);

+        if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+          CHolographicInteropTextureMarshaler::CHolographicInteropTextureMarshaler(this);

+          ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CHolographicInteropTextureMarshaler,2>

+                     ::_vftable_;

+LAB_1:

+          *(undefined ***)this = ppuVar1;

+          *(CSharedSystemResource **)(this + 0x60) = param_2;

+          goto LAB_0;

+        }

+      }

+      else if (param_1 == 0x13) {

+        this = Win32AllocPoolWithQuotaZInitImpl(0,0x98,0x30734344);

+        if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x68) = 0;

+          *(undefined8 *)(this + 0x70) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 0x13;

+          *(CSharedSystemResource **)(this + 0x90) = param_2;

+          *(undefined8 *)(this + 0x78) = 0;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CCaptureControllerMarshaler,2>::

+                     _vftable_;

+          goto LAB_2;

+        }

+      }

+      else if (param_1 == 0x20) {

+        this = Win32AllocPoolWithQuotaZInitImpl(0,0x80,0x30734344);

+        if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 0x20;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CCompositionAmbientLightMarshaler,2>

+                     ::_vftable_;

+          goto LAB_3;

+        }

+      }

+      else if (param_1 == 0x21) {

+        this = Win32AllocPoolWithQuotaZInitImpl(0,0x90,0x30734344);

+        if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 0x21;

+          *(CSharedSystemResource **)(this + 0x88) = param_2;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CCompositionDistantLightMarshaler,2>

+                     ::_vftable_;

+          goto LAB_2;

+        }

+      }

+      else if (param_1 == 0x26) {

+        this = Win32AllocPoolWithQuotaZInitImpl(0,0xa8,0x30734344);

+        if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(undefined4 *)(this + 0x24) = 0x26;

+          *(CSharedSystemResource **)(this + 0xa0) = param_2;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CCompositionPointLightMarshaler,2>

+                     ::_vftable_;

+          goto LAB_2;

+        }

+      }

+      else {

+        if (param_1 != 0x28) {

+          return -0x3ffffff3;

+        }

+        this = Win32AllocPoolWithQuotaZInitImpl(2,0xd0,0x30734344);

+        if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+          *(undefined4 *)(this + 0x20) = 0;

+          *(undefined8 *)(this + 0x30) = 0;

+          *(undefined8 *)(this + 0x18) = 1;

+          *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+          *(undefined4 *)(this + 0x24) = 0x28;

+          ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CCompositionSpotLightMarshaler,2>::

+                     _vftable_;

+          *(CSharedSystemResource **)(this + 200) = param_2;

+LAB_2:

+          *(undefined ***)this = ppuVar1;

+          goto LAB_0;

+        }

+      }

+    }

+    else if (param_1 == 0x57) {

+      this = Win32AllocPoolWithQuotaZInitImpl(_Var2,0x158,0x30734344);

+      if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+        CInteractionMarshaler::CInteractionMarshaler((CInteractionMarshaler *)this);

+        *(CSharedSystemResource **)(this + 0x150) = param_2;

+        *(undefined ***)this =

+             &CSharedResourceMarshaler<DirectComposition::CInteractionMarshaler,2>::_vftable_;

+        goto LAB_0;

+      }

+    }

+    else if (param_1 == 0x5c) {

+      this = Win32AllocPoolWithQuotaZInitImpl(_Var2,0x48,0x30734344);

+      if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+        *(undefined4 *)(this + 0x20) = 0;

+        *(undefined8 *)(this + 0x30) = 0;

+        *(undefined8 *)(this + 0x18) = 1;

+        *(undefined4 *)(this + 0x24) = 0x5c;

+        *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+        ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CLegacyAnimationTriggerMarshaler,2>::

+                   _vftable_;

+        goto LAB_4;

+      }

+    }

+    else if (param_1 == 0x68) {

+      this = Win32AllocPoolWithQuotaZInitImpl(_Var2,0x88,0x30734344);

+      if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+        CManipulationTransformMarshaler::CManipulationTransformMarshaler

+                  ((CManipulationTransformMarshaler *)this);

+        *(CSharedSystemResource **)(this + 0x80) = param_2;

+        *(undefined ***)this =

+             &CSharedResourceMarshaler<DirectComposition::CManipulationTransformMarshaler,2>::

+              _vftable_;

+        goto LAB_0;

+      }

+    }

+    else {

+      if (param_1 != 0x6b) {

+        return -0x3ffffff3;

+      }

+      this = Win32AllocPoolWithQuotaZInitImpl(_Var2,0x68,0x30734344);

+      if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+        CMatrixTransformMarshaler::CMatrixTransformMarshaler((CMatrixTransformMarshaler *)this);

+        ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CMatrixTransformMarshaler,2>::

+                   _vftable_;

+        goto LAB_1;

+      }

+    }

+  }

+  else if (param_1 == 0x73) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x50,0x30734344);

+    if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+      *(undefined4 *)(this + 0x20) = 0;

+      *(undefined8 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x18) = 1;

+      *(undefined4 *)(this + 0x24) = 0x73;

+      *(CSharedSystemResource **)(this + 0x48) = param_2;

+      *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+      ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CPrimitiveColorMarshaler,2>::_vftable_;

+      goto LAB_2;

+    }

+  }

+  else if (param_1 == 0x76) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x70,0x30734344);

+    if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+      *(undefined4 *)(this + 0x20) = 0;

+      *(undefined8 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x18) = 1;

+      *(undefined4 *)(this + 0x24) = 0x76;

+      *(CSharedSystemResource **)(this + 0x68) = param_2;

+      *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+      ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CProjectedShadowCasterMarshaler,2>::

+                 _vftable_;

+      goto LAB_2;

+    }

+  }

+  else if (param_1 == 0x80) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x80,0x30734344);

+    if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+      CRegionGeometryMarshaler::CRegionGeometryMarshaler((CRegionGeometryMarshaler *)this);

+      *(CSharedSystemResource **)(this + 0x78) = param_2;

+      *(undefined ***)this =

+           &CSharedResourceMarshaler<DirectComposition::CRegionGeometryMarshaler,2>::_vftable_;

+      goto LAB_0;

+    }

+  }

+  else if (param_1 == 0x81) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x80,0x30734344);

+    if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+      *(undefined4 *)(this + 0x20) = 0;

+      *(undefined8 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x18) = 1;

+      *(undefined4 *)(this + 0x24) = 0x81;

+      *(undefined4 *)(this + 0x38) = 3;

+      *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+      ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CRemoteAppRenderTargetMarshaler,2>::

+                 _vftable_;

+LAB_3:

+      *(CSharedSystemResource **)(this + 0x78) = param_2;

+      goto LAB_2;

+    }

+  }

+  else if (param_1 == 0xb4) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x178,0x30734344);

+    if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+      CVisualMarshaler::CVisualMarshaler((CVisualMarshaler *)this);

+      *(CSharedSystemResource **)(this + 0x170) = param_2;

+      *(undefined ***)this =

+           &CSharedResourceMarshaler<DirectComposition::CVisualMarshaler,2>::_vftable_;

+      goto LAB_0;

+    }

+  }

+  else if (param_1 == 0xb5) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x48,0x30734344);

+    if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+      *(undefined4 *)(this + 0x20) = 0;

+      *(undefined8 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x18) = 1;

+      *(undefined4 *)(this + 0x24) = 0xb5;

+      *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+      ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CVisualBitmapMarshaler,2>::_vftable_;

+LAB_4:

+      *(CSharedSystemResource **)(this + 0x40) = param_2;

+      goto LAB_2;

+    }

+  }

+  else if (param_1 == 0xb7) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x58,0x30734344);

+    if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+      CVisualGroupMarshaler::CVisualGroupMarshaler((CVisualGroupMarshaler *)this);

+      *(CSharedSystemResource **)(this + 0x50) = param_2;

+      *(undefined ***)this =

+           &CSharedResourceMarshaler<DirectComposition::CVisualGroupMarshaler,2>::_vftable_;

+      goto LAB_0;

+    }

+  }

+  else if (param_1 == 0xb9) {

+    this = Win32AllocPoolWithQuotaZInitImpl(0,0x48,0x30734344);

+    if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+      *(undefined4 *)(this + 0x20) = 0;

+      *(undefined8 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x18) = 1;

+      *(undefined4 *)(this + 0x24) = 0xb9;

+      *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+      ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CVisualReferenceControllerMarshaler,2>

+                 ::_vftable_;

+      goto LAB_4;

+    }

+  }

+  else {

+    if (param_1 != 0xba) {

+      return -0x3ffffff3;

+    }

+    this = Win32AllocPoolWithQuotaZInitImpl(1,0x68,0x30734344);

+    if (this != (CHolographicInteropTextureMarshaler *)0x0) {

+      *(undefined4 *)(this + 0x20) = 0;

+      *(undefined8 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x18) = 1;

+      *(undefined4 *)(this + 0x24) = 0xba;

+      *(CSharedSystemResource **)(this + 0x60) = param_2;

+      *(uint *)(this + 0x14) = ~(uint)this ^ 1;

+      ppuVar1 = &CSharedResourceMarshaler<DirectComposition::CVisualSurfaceMarshaler,2>::_vftable_;

+      goto LAB_2;

+    }

+  }

+  this = (CHolographicInteropTextureMarshaler *)0x0;

+LAB_0:

+  *param_3 = (CResourceMarshaler *)this;

+  return ~-(uint)(this != (CHolographicInteropTextureMarshaler *)0x0) & 0xc0000017;

+}

+
```

## `CMouseProcessor::GetMouseWheelForegroundThread`  (modified)

```diff
--- CMouseProcessor::GetMouseWheelForegroundThread
+++ CMouseProcessor::GetMouseWheelForegroundThread
@@ -1,2 +1,32 @@
-Failed to decompile win32kbase.sys - .ProgramDB CMouseProcessor::GetMouseWheelForegroundThread : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: static struct tagTHREADINFO * __ptr64 __cdecl

+   CMouseProcessor::GetMouseWheelForegroundThread(void) */

+

+tagTHREADINFO * __cdecl CMouseProcessor::GetMouseWheelForegroundThread(void)

+

+{

+  longlong lVar1;

+  tagTHREADINFO *ptVar2;

+  

+  lVar1 = W32GetUserSessionState();

+  if (*(longlong *)(lVar1 + 0x4a50) == 0) {

+    ptVar2 = (tagTHREADINFO *)0x0;

+  }

+  else {

+    lVar1 = W32GetUserSessionState();

+    ptVar2 = (tagTHREADINFO *)PtiKbdFromQ(*(undefined8 *)(lVar1 + 0x4a50));

+    if (ptVar2 == (tagTHREADINFO *)0x0) {

+      lVar1 = W32GetUserSessionState();

+      if (*(longlong *)(*(longlong *)(lVar1 + 0x4a50) + 0x88) == 0) {

+        lVar1 = W32GetUserSessionState();

+        ptVar2 = (tagTHREADINFO *)PtiMouseFromQ(*(undefined8 *)(lVar1 + 0x4a50));

+      }

+      else {

+        lVar1 = W32GetUserSessionState();

+        ptVar2 = *(tagTHREADINFO **)(*(longlong *)(*(longlong *)(lVar1 + 0x4a50) + 0x88) + 0x10);

+      }

+    }

+  }

+  return ptVar2;

+}

+
```

## `CTouchProcessor::GetPointerInfo`  (modified)

```diff
--- CTouchProcessor::GetPointerInfo
+++ CTouchProcessor::GetPointerInfo
@@ -1,2 +1,31 @@
-Failed to decompile win32kbase.sys - .ProgramDB CTouchProcessor::GetPointerInfo : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: struct tagPOINTER_INFO const * __ptr64 __cdecl CTouchProcessor::GetPointerInfo(struct

+   CPointerInputFrame const * __ptr64,unsigned long) __ptr64 */

+

+tagPOINTER_INFO * __thiscall

+CTouchProcessor::GetPointerInfo(CTouchProcessor *this,CPointerInputFrame *param_1,ulong param_2)

+

+{

+  int iVar1;

+  tagPOINTER_INFO *ptVar2;

+  CPointerInfoNode *this_00;

+  CInpLockGuardExclusive local_38 [48];

+  

+                    /* 0xde140  166

+                       ?GetPointerInfo@CTouchProcessor@@QEAAPEBUtagPOINTER_INFO@@PEBUCPointerInputFrame@@K@Z

+                        */

+  CInpLockGuardExclusive::CInpLockGuardExclusive

+            (local_38,(CEResourceLock *)(this + 0x20),(void *)0x0);

+  this_00 = (CPointerInfoNode *)((ulonglong)param_2 * 0x1e0 + *(longlong *)(param_1 + 0xf0));

+  iVar1 = CPointerInfoNode::IsValid(this_00);

+  if (iVar1 == 0) {

+    CInpLockGuardExclusive::~CInpLockGuardExclusive(local_38);

+    ptVar2 = (tagPOINTER_INFO *)0x0;

+  }

+  else {

+    CInpLockGuardExclusive::~CInpLockGuardExclusive(local_38);

+    ptVar2 = (tagPOINTER_INFO *)(this_00 + 0xa8);

+  }

+  return ptVar2;

+}

+
```

## `DirectComposition::CSurfaceBrushMarshaler::SetReferenceProperty`  (modified)

```diff
--- DirectComposition::CSurfaceBrushMarshaler::SetReferenceProperty
+++ DirectComposition::CSurfaceBrushMarshaler::SetReferenceProperty
@@ -1,2 +1,58 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CSurfaceBrushMarshaler::SetReferenceProperty : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl

+   DirectComposition::CSurfaceBrushMarshaler::SetReferenceProperty(class

+   DirectComposition::CApplicationChannel * __ptr64,unsigned int,class

+   DirectComposition::CResourceMarshaler * __ptr64,bool * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CSurfaceBrushMarshaler::SetReferenceProperty

+          (CSurfaceBrushMarshaler *this,CApplicationChannel *param_1,uint param_2,

+          CResourceMarshaler *param_3,bool *param_4)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  CSurfaceBrushMarshaler *pCVar4;

+  MIL_RESOURCE_TYPE MVar5;

+  ulong uVar6;

+  

+  if (param_2 == 0) {

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

+      *(undefined2 *)(this + 0x8a) = 0;

+      *(undefined8 *)(this + 0x58) = 0;

+      *(undefined8 *)(this + 0x60) = 0;

+    }

+    else {

+      iVar3 = Feature_DCompChromiumK2__private_IsEnabledDeviceUsageNoInline();

+      if ((iVar3 == 0) ||

+         (bVar1 = CResourceMarshaler::IsDerivedResourceType

+                            (*(MIL_RESOURCE_TYPE *)(param_3 + 0x24),0x22), !bVar1)) {

+        MVar5 = *(MIL_RESOURCE_TYPE *)(param_3 + 0x24);

+        bVar1 = CResourceMarshaler::IsDerivedResourceType(MVar5,0x29);

+        if ((!bVar1) &&

+           (((bVar1 = CResourceMarshaler::IsDerivedResourceType(MVar5,0xba), !bVar1 &&

+             (bVar1 = CResourceMarshaler::IsDerivedResourceType(MVar5,0x74), !bVar1)) &&

+            (bVar1 = CResourceMarshaler::IsDerivedResourceType(MVar5,0x45), !bVar1)))) {

+          return -0x3ffffff3;

+        }

+      }

+    }

+    pCVar4 = this + 0x48;

+    uVar6 = 0x20;

+    MVar5 = 0x85;

+  }

+  else {

+    if (param_2 != 7) {

+      return -0x3ffffff3;

+    }

+    pCVar4 = this + 0x50;

+    uVar6 = 0x40;

+    MVar5 = 0x1d;

+  }

+  lVar2 = CResourceMarshaler::SetReferencePropertyHelper

+                    ((CResourceMarshaler *)this,param_1,(CResourceMarshaler **)pCVar4,param_3,1,

+                     MVar5,(ulong *)(this + 0x10),uVar6,0,param_4);

+  return lVar2;

+}

+
```

## `CPTPEngine::ProcessInputFrame`  (modified)

```diff
--- CPTPEngine::ProcessInputFrame
+++ CPTPEngine::ProcessInputFrame
@@ -1,2 +1,364 @@
-Failed to decompile win32kbase.sys - .ProgramDB CPTPEngine::ProcessInputFrame : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: void __cdecl CPTPEngine::ProcessInputFrame(struct PTPInput * __ptr64) __ptr64 */

+

+void __thiscall CPTPEngine::ProcessInputFrame(CPTPEngine *this,PTPInput *param_1)

+

+{

+  ulonglong uVar1;

+  undefined1 auVar2 [16];

+  undefined8 uVar3;

+  bool bVar4;

+  bool bVar5;

+  bool bVar6;

+  bool bVar7;

+  int iVar8;

+  TOUCHPAD_SENSITIVITY_LEVEL TVar9;

+  BOOL BVar10;

+  uint uVar11;

+  uint uVar12;

+  CPTPEngine *pCVar13;

+  longlong lVar14;

+  PTPInput *pPVar15;

+  PTPInput *pPVar16;

+  int iVar17;

+  CContactState *pCVar18;

+  uint uVar19;

+  uint uVar20;

+  uint local_res18;

+  int local_res20;

+  uint local_84;

+  ulonglong local_78 [4];

+  ulonglong local_58 [4];

+  

+  local_res20 = 0;

+  local_res18 = 0;

+  bVar6 = false;

+  bVar5 = false;

+  iVar8 = IsTouchpadActive(this);

+  if (iVar8 == 0) {

+    local_58[2] = 0;

+    local_78[0] = 0;

+    local_78[1] = 0;

+    local_78[2] = 0;

+    CBasePTPEngine::SendTelemetryOutput((CBasePTPEngine *)this,8,local_78);

+  }

+  if (((*(int *)(param_1 + 0x24) == 0) &&

+      ((iVar8 == 0 ||

+       (((*(uint *)(this + 0xd20) >> 0x19 & 1) != 0 && ((*(uint *)(this + 0xd20) & 0x4000000) == 0))

+       )))) && ((uint)(*(int *)(this + 0xc1c) + *(int *)(this + 0xc08)) < *(uint *)(param_1 + 0x30))

+     ) {

+    CBasePTPEngine::SendInertiaOutput((CBasePTPEngine *)this,0);

+    if (((*(ulonglong *)(this + 0xcd8) != 0) &&

+        (*(ulonglong *)(this + 0xcd8) < *(ulonglong *)(param_1 + 8))) &&

+       (pCVar13 = this, TVar9 = GetSensitivityLevel(this), 0 < (int)TVar9)) {

+      TPAAPSetCurtainState(pCVar13,1);

+    }

+    *(undefined8 *)(this + 0xcd8) = *(undefined8 *)param_1;

+    uVar1 = *(ulonglong *)(param_1 + 0x10);

+    if (*(ulonglong *)(param_1 + 8) < uVar1) {

+      local_78[1] = 0;

+      local_78[2] = 0;

+      local_58[1] = 0;

+      local_58[2] = 0;

+      local_78[0] = uVar1;

+      local_58[0] = uVar1;

+      CBasePTPEngine::SendTelemetryOutput((CBasePTPEngine *)this,0,local_58);

+    }

+    *(uint *)(this + 0xd20) = *(uint *)(this + 0xd20) | 0x4000000;

+  }

+  if (*(int *)(param_1 + 0x24) == 0) {

+    *(undefined4 *)(this + 0xc08) = 0;

+    pPVar15 = param_1 + 0x38;

+    *(undefined4 *)(this + 0xc1c) = 0;

+    local_84 = 0;

+    if (*(int *)(param_1 + 0x30) != 0) {

+      do {

+        uVar19 = 0;

+        uVar11 = *(uint *)(pPVar15 + 4);

+        uVar20 = *(uint *)(this + 0x10);

+        pCVar18 = (CContactState *)(this + ((ulonglong)uVar11 % (ulonglong)uVar20) * 0x148 + 0x450);

+        uVar12 = *(uint *)pCVar18;

+        if (((uVar12 & 1) != 0) &&

+           (((uVar12 & 0x20000000) == 0 || ((*(uint *)(pPVar15 + 0xc) & 0x60000) == 0)))) {

+          local_78[2] = 0;

+          local_58[0] = 0;

+          local_58[1] = 0;

+          local_58[2] = 0;

+          CBasePTPEngine::SendTelemetryOutput((CBasePTPEngine *)this,0xb,local_58);

+          uVar12 = *(uint *)pCVar18 & 0xdffffffe;

+          *(uint *)pCVar18 = uVar12;

+        }

+        if ((uVar12 & 0x20000000) == 0) {

+          bVar5 = true;

+          *(uint *)pCVar18 = uVar12 | 0x20000000;

+          *(undefined8 *)(pCVar18 + 0x48) = *(undefined8 *)(pPVar15 + 0x50);

+          *(undefined8 *)(pCVar18 + 0x20) = *(undefined8 *)(pPVar15 + 0x28);

+        }

+        uVar3 = *(undefined8 *)(pPVar15 + 8);

+        *(undefined8 *)(pCVar18 + 0xe8) = *(undefined8 *)pPVar15;

+        *(undefined8 *)(pCVar18 + 0xf0) = uVar3;

+        uVar3 = *(undefined8 *)(pPVar15 + 0x18);

+        *(undefined8 *)(pCVar18 + 0xf8) = *(undefined8 *)(pPVar15 + 0x10);

+        *(undefined8 *)(pCVar18 + 0x100) = uVar3;

+        uVar3 = *(undefined8 *)(pPVar15 + 0x28);

+        *(undefined8 *)(pCVar18 + 0x108) = *(undefined8 *)(pPVar15 + 0x20);

+        *(undefined8 *)(pCVar18 + 0x110) = uVar3;

+        uVar3 = *(undefined8 *)(pPVar15 + 0x38);

+        *(undefined8 *)(pCVar18 + 0x118) = *(undefined8 *)(pPVar15 + 0x30);

+        *(undefined8 *)(pCVar18 + 0x120) = uVar3;

+        uVar3 = *(undefined8 *)(pPVar15 + 0x48);

+        *(undefined8 *)(pCVar18 + 0x128) = *(undefined8 *)(pPVar15 + 0x40);

+        *(undefined8 *)(pCVar18 + 0x130) = uVar3;

+        uVar3 = *(undefined8 *)(pPVar15 + 0x58);

+        *(undefined8 *)(pCVar18 + 0x138) = *(undefined8 *)(pPVar15 + 0x50);

+        *(undefined8 *)(pCVar18 + 0x140) = uVar3;

+        uVar12 = *(uint *)(pPVar15 + 0xc);

+        *(uint *)(pPVar15 + 0xc) = uVar12 & 0xffffff8f;

+        if ((*(uint *)pCVar18 & 1) == 0) {

+          uVar19 = uVar12 >> 0x17 & 4;

+          pCVar13 = this;

+          iVar8 = PointInsideCurtainRegion(this,*(tagPOINT *)(pPVar15 + 0x28));

+          if ((iVar8 != 0) && (iVar8 = TPAAPShouldAllowNow(pCVar13,param_1,0x40,0), iVar8 == 0)) {

+            uVar19 = uVar19 | 2;

+          }

+          if (((*(uint *)(this + 0xdf8) & 2) != 0) &&

+             (BVar10 = PtInRect((RECT *)(this + 0xcf0),*(POINT *)(pPVar15 + 0x28)), BVar10 == 0)) {

+            auVar2._8_8_ = 0;

+            auVar2._0_8_ = (ulonglong)*(uint *)(this + 0xd60) * *(longlong *)(this + 0x60);

+            lVar14 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar2,8);

+            if (((ulonglong)(*(longlong *)param_1 - *(longlong *)(pCVar18 + 0x48)) <

+                 ((ulonglong)*(uint *)(this + 0xd60) * *(longlong *)(this + 0x60) - lVar14 >> 1) +

+                 lVar14 >> 9) &&

+               ((*(int *)(param_1 + 0x30) != 1 &&

+                (iVar8 = FindContactToBreakSuperCurtains(this,param_1,pCVar18), iVar8 != 0)))) {

+              bVar4 = false;

+            }

+            else {

+              bVar4 = true;

+            }

+            iVar8 = Feature_TouchpadSingleFingerPanning__private_IsEnabledDeviceUsageNoInline();

+            if (((((((iVar8 == 0) || (*(int *)(this + 0xc28) != 1)) || (*(int *)(this + 0xc04) != 0)

+                   ) || ((*(int *)(this + 0xc24) != 0 || (*(int *)(this + 0xc18) != 0)))) ||

+                 (iVar8 = (int)*(undefined8 *)(pCVar18 + 0x20) -

+                          (int)*(undefined8 *)(pPVar15 + 0x28),

+                 iVar17 = (int)((ulonglong)*(undefined8 *)(pCVar18 + 0x20) >> 0x20) -

+                          (int)((ulonglong)*(undefined8 *)(pPVar15 + 0x28) >> 0x20),

+                 (longlong)(iVar8 * iVar8) * (ulonglong)*(uint *)(this + 0xdc8) +

+                 (longlong)(iVar17 * iVar17) * (ulonglong)*(uint *)(this + 0xdc4) <

+                 (ulonglong)*(uint *)(this + 0xdc8) * (ulonglong)*(uint *)(this + 0xdc4))) ||

+                (bVar7 = ContactIsSingleFingerPanning

+                                   (this,*(tagPOINT *)(pPVar15 + 0x28),*(tagPOINT *)(pCVar18 + 0x20)

+                                   ), !bVar7)) && (bVar4)) {

+              uVar19 = uVar19 | 1;

+            }

+          }

+          if ((uVar19 != 0) || ((uVar12 >> 0x12 & 1) != 0)) {

+            *(undefined4 *)(pPVar15 + 0xc) = 0;

+          }

+        }

+        *(uint *)(pCVar18 + 0xe4) = uVar19;

+        if (*(int *)(pPVar15 + 0xc) == 0) {

+          if ((uVar12 & 0x2000006) == 0) {

+            uVar11 = *(uint *)pCVar18;

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

+              local_78[2] = 0;

+              local_58[0] = 0;

+              local_58[1] = 0;

+              local_58[2] = 0;

+              CBasePTPEngine::SendTelemetryOutput((CBasePTPEngine *)this,0xb,local_58);

+              uVar11 = *(uint *)pCVar18 & 0xfffffffe;

+            }

+            *(uint *)pCVar18 = uVar11 & 0xdfffffff;

+          }

+          else {

+            *(int *)(this + 0xc1c) = *(int *)(this + 0xc1c) + 1;

+          }

+        }

+        else {

+          UpdateTPStateIndicator(this,param_1,pCVar18,(PTPEnginePointerNode *)pPVar15);

+          if ((*(uint *)pCVar18 & 2) == 0) {

+            if (*(int *)(this + 0xc28) != 1) {

+              *(uint *)(pCVar18 + 4) = *(uint *)(pCVar18 + 4) & 0xfffffff7;

+            }

+          }

+          else {

+            local_res20 = local_res20 + 1;

+            local_58[1] = 0;

+            local_58[2] = 0;

+            local_78[0] = *(ulonglong *)param_1;

+            bVar6 = true;

+            local_78[1] = 0;

+            local_78[2] = 0;

+            local_58[0] = local_78[0];

+            CBasePTPEngine::SendTelemetryOutput((CBasePTPEngine *)this,3,local_78);

+            local_res18 = (uint)((ulonglong)uVar11 % (ulonglong)uVar20);

+          }

+          if ((*(uint *)(pPVar15 + 0xc) & 0x40000) == 0) {

+            *(int *)(this + 0xc08) = *(int *)(this + 0xc08) + 1;

+          }

+        }

+        pPVar15 = pPVar15 + 0x90;

+        local_84 = local_84 + 1;

+      } while (local_84 < *(uint *)(param_1 + 0x30));

+    }

+    *(undefined4 *)(this + 0xc14) = 0;

+    uVar11 = 0;

+    if (*(int *)(param_1 + 0x30) != 0) {

+      pPVar15 = param_1 + 0x44;

+      do {

+        uVar20 = *(uint *)(pPVar15 + -8);

+        uVar12 = *(uint *)(this + 0x10);

+        lVar14 = ((ulonglong)uVar20 % (ulonglong)uVar12) * 0x148;

+        uVar19 = *(uint *)(this + lVar14 + 0x450);

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

+          if ((*(uint *)pPVar15 & 0x40000) == 0) {

+            if ((uVar19 >> 8 & 1) != 0) {

+              *(int *)(this + 0xc14) = *(int *)(this + 0xc14) + 1;

+            }

+            if ((*(int *)(this + 0xc28) == 1) && ((bVar5 || (bVar6)))) {

+              ResetDragThresholds(this,param_1);

+            }

+            iVar8 = Feature_TouchpadSingleFingerPanning__private_IsEnabledDeviceUsageNoInline();

+            if (((iVar8 != 0) && (*(int *)(this + 0xc28) != 3)) &&

+               ((*(int *)(this + 0xc28) != 1 ||

+                ((*(int *)(this + 0xc04) != 0 || (*(int *)(this + 0xc24) != 0)))))) {

+              *(uint *)(this + lVar14 + 0x454) = *(uint *)(this + lVar14 + 0x454) & 0xffffffcf;

+            }

+          }

+          else {

+            if ((*(uint *)(this + 0xc04) != 0) && ((uVar19 >> 0x10 & 1) != 0)) {

+              SendMouseUpIfPending(this,(uint *)(this + 0xc04));

+            }

+            if ((*(int *)(this + 0xc28) == 2) &&

+               ((int)((ulonglong)uVar20 % (ulonglong)uVar12) == *(int *)(this + 0xc00))) {

+              *(undefined4 *)(this + 0xc28) = 1;

+              if (*(int *)(this + 0xc08) != 0) {

+                ResetDragThresholds(this,param_1);

+                uVar20 = 0;

+                if (*(int *)(param_1 + 0x30) != 0) {

+                  pPVar16 = param_1 + 0x44;

+                  do {

+                    if (((*(uint *)(this + ((ulonglong)*(uint *)(pPVar16 + -8) %

+                                           (ulonglong)*(uint *)(this + 0x10)) * 0x148 + 0x450) & 1)

+                         != 0) && ((*(uint *)pPVar16 & 0x40000) == 0)) {

+                      SetContactRestingState

+                                (this,(CContactState *)

+                                      (this + ((ulonglong)*(uint *)(pPVar16 + -8) %

+                                              (ulonglong)*(uint *)(this + 0x10)) * 0x148 + 0x450),

+                                 true);

+                      *(uint *)(this + lVar14 + 0x454) =

+                           *(uint *)(this + lVar14 + 0x454) & 0xfffffffe;

+                    }

+                    uVar20 = uVar20 + 1;

+                    pPVar16 = pPVar16 + 0x90;

+                  } while (uVar20 < *(uint *)(param_1 + 0x30));

+                }

+              }

+              if (((*(uint *)(this + lVar14 + 0x450) & 0x1000) != 0) &&

+                 ((longlong)(ulonglong)*(uint *)(this + 0xe54) <=

+                  (longlong)

+                  ((ulonglong)

+                   ((*(longlong *)(this + lVar14 + 0x4a0) - *(longlong *)(this + lVar14 + 0x4b0)) *

+                   1000) / *(ulonglong *)(this + 0x60)))) {

+                *(longlong *)(this + 0xd00) = *(longlong *)(this + lVar14 + 0x4a0);

+              }

+            }

+          }

+        }

+        pPVar15 = pPVar15 + 0x90;

+        uVar11 = uVar11 + 1;

+      } while (uVar11 < *(uint *)(param_1 + 0x30));

+    }

+    *(int *)(this + 0xc18) = *(int *)(this + 0xc08) - *(int *)(this + 0xc14);

+    if (bVar6) {

+      if (*(int *)(this + 0xc28) == 1) {

+        SendMouseUpIfPending(this,(uint *)(this + 0xc04));

+      }

+      if (*(int *)(this + 0xd08) != 0) {

+        if (((local_res20 == 1) && (*(int *)(this + 0xd0c) != 0)) &&

+           (iVar8 = (int)*(undefined8 *)(this + 0xc34) -

+                    (int)*(undefined8 *)(this + (ulonglong)local_res18 * 0x148 + 0x460),

+           iVar17 = (int)((ulonglong)*(undefined8 *)(this + 0xc34) >> 0x20) -

+                    (int)((ulonglong)*(undefined8 *)(this + (ulonglong)local_res18 * 0x148 + 0x460)

+                         >> 0x20),

+           (ulonglong)(longlong)(iVar8 * iVar8 + iVar17 * iVar17) <=

+           (ulonglong)(uint)(*(int *)(this + 0xd6c) * *(int *)(this + 0xd6c)))) {

+          uVar11 = 1;

+        }

+        else {

+          uVar11 = 0;

+        }

+        CancelMouseUpTimer(this,uVar11 ^ 1);

+        if (uVar11 != 0) {

+          *(undefined4 *)(this + 0xc04) = *(undefined4 *)(this + 0xd10);

+          *(undefined4 *)(this + 0xd10) = 0;

+          *(uint *)(this + (ulonglong)local_res18 * 0x148 + 0x450) =

+               *(uint *)(this + (ulonglong)local_res18 * 0x148 + 0x450) | 0x8000;

+        }

+      }

+      bVar4 = false;

+      *(undefined4 *)(this + 0xc0c) = 0;

+      iVar8 = Feature_TouchpadSingleFingerPanning__private_IsEnabledDeviceUsageNoInline();

+      uVar11 = 0;

+      if (iVar8 == 0) {

+        if (*(int *)(param_1 + 0x30) != 0) {

+          do {

+            uVar20 = *(uint *)(this + 0x10);

+            lVar14 = ((ulonglong)*(uint *)(param_1 + 0x3c) % (ulonglong)uVar20) * 0x148;

+            uVar12 = *(uint *)(this + lVar14 + 0x450);

+            if ((((uVar12 & 1) != 0) && ((uVar12 & 2) == 0)) &&

+               (((uVar12 & 0x10) == 0 && (((uVar12 >> 0x13 & 1) != 0 || (-1 < (int)uVar12)))))) {

+              *(uint *)(this + lVar14 + 0x450) = uVar12 & 0x7fffffff;

+              uVar20 = *(uint *)(this + 0x10);

+              bVar4 = true;

+            }

+            uVar11 = uVar11 + 1;

+          } while (uVar11 < *(uint *)(param_1 + 0x30));

+          if ((bVar4) && (uVar11 = 0, *(uint *)(param_1 + 0x30) != 0)) {

+            do {

+              lVar14 = ((ulonglong)*(uint *)(param_1 + 0x3c) % (ulonglong)uVar20) * 0x148;

+              uVar12 = *(uint *)(this + lVar14 + 0x450);

+              if (((uVar12 & 1) != 0) && ((uVar12 & 2) != 0)) {

+                *(uint *)(this + lVar14 + 0x450) = uVar12 & 0x7fffffff;

+                uVar20 = *(uint *)(this + 0x10);

+              }

+              uVar11 = uVar11 + 1;

+            } while (uVar11 < *(uint *)(param_1 + 0x30));

+          }

+        }

+      }

+      else if (*(int *)(param_1 + 0x30) != 0) {

+        pPVar15 = param_1 + 0x3c;

+        do {

+          uVar20 = *(uint *)(this + 0x10);

+          lVar14 = ((ulonglong)*(uint *)pPVar15 % (ulonglong)uVar20) * 0x148;

+          uVar12 = *(uint *)(this + lVar14 + 0x450);

+          if (((((uVar12 & 1) != 0) && ((uVar12 & 2) == 0)) && ((uVar12 & 0x10) == 0)) &&

+             (((uVar12 >> 0x13 & 1) != 0 || (-1 < (int)uVar12)))) {

+            *(uint *)(this + lVar14 + 0x450) = uVar12 & 0x7fffffff;

+            uVar20 = *(uint *)(this + 0x10);

+            bVar4 = true;

+          }

+          uVar11 = uVar11 + 1;

+          pPVar15 = pPVar15 + 0x90;

+        } while (uVar11 < *(uint *)(param_1 + 0x30));

+        if ((bVar4) && (uVar11 = 0, *(uint *)(param_1 + 0x30) != 0)) {

+          pPVar15 = param_1 + 0x3c;

+          do {

+            lVar14 = ((ulonglong)*(uint *)pPVar15 % (ulonglong)uVar20) * 0x148;

+            uVar12 = *(uint *)(this + lVar14 + 0x450);

+            if (((uVar12 & 1) != 0) && ((uVar12 & 2) != 0)) {

+              *(uint *)(this + lVar14 + 0x450) = uVar12 & 0x7fffffff;

+              uVar20 = *(uint *)(this + 0x10);

+            }

+            uVar11 = uVar11 + 1;

+            pPVar15 = pPVar15 + 0x90;

+          } while (uVar11 < *(uint *)(param_1 + 0x30));

+        }

+      }

+    }

+    ApplyHeuristics(this,param_1,bVar6,bVar5);

+  }

+  return;

+}

+
```

## `InputExtensibilityCallout::_CanSendMessageToDestinationInternal`  (modified)

```diff
--- InputExtensibilityCallout::_CanSendMessageToDestinationInternal
+++ InputExtensibilityCallout::_CanSendMessageToDestinationInternal
@@ -1,18 +1,45 @@
 

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

+/* private: bool __cdecl InputExtensibilityCallout::_CanSendMessageToDestinationInternal(enum

+   _MIT_ENDPOINT)const __ptr64 */

 

 bool __thiscall

-NSInstrumentation::CSectionBitmapAllocator<180224,704>::_CanSendMessageToDestinationInternal

+InputExtensibilityCallout::_CanSendMessageToDestinationInternal

           (InputExtensibilityCallout *this,_MIT_ENDPOINT param_1)

 

 {

-  undefined1 uVar1;

-  undefined2 uStack000000000000004a;

-  undefined2 uStack000000000000004c;

+  int iVar1;

+  undefined1 uVar2;

   

-  uStack000000000000004a = *(undefined2 *)(this + 0x70);

-  uStack000000000000004c = *(undefined2 *)(this + 0x72);

-  uVar1 = SendMessageTo(0xc,&stack0x00000030,0x23c);

-  return (bool)uVar1;

+  if (param_1 < 0x17) {

+    if (*(longlong *)(this + (longlong)(int)param_1 * 0x28 + 0x18) == 0) {

+      uVar2 = 0;

+    }

+    else {

+      uVar2 = 1;

+      if (*(longlong *)(this + 0x10) == 0) {

+        MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0x19b);

+      }

+      iVar1 = *(int *)(this + (longlong)(int)param_1 * 0x28 + 0x20);

+      if (iVar1 != 0) {

+        if (iVar1 == 1) {

+          uVar2 = IsInputProcessingActivated();

+        }

+        else if (iVar1 == 2) {

+          uVar2 = isRootPartition();

+        }

+        else if (iVar1 == 3) {

+          uVar2 = isChildPartition();

+        }

+        else {

+          MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0x1b0);

+        }

+      }

+    }

+  }

+  else {

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0x191);

+    uVar2 = 0;

+  }

+  return (bool)uVar2;

 }
```

## `EXFORMOBJ::bXform`  (modified)

```diff
--- EXFORMOBJ::bXform
+++ EXFORMOBJ::bXform
@@ -1,2 +1,42 @@
-Failed to decompile win32kbase.sys - .ProgramDB EXFORMOBJ::bXform : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: bool __cdecl EXFORMOBJ::bXform(struct _VECTORL const * __ptr64,struct _VECTORL *

+   __ptr64,unsigned __int64)const __ptr64 */

+

+bool __thiscall

+EXFORMOBJ::bXform(EXFORMOBJ *this,_VECTORL *param_1,_VECTORL *param_2,__uint64 param_3)

+

+{

+  float *pfVar1;

+  int iVar2;

+  bool bVar3;

+  

+                    /* 0x1c23f0  475  ?bXform@EXFORMOBJ@@QEBA_NPEBU_VECTORL@@PEAU2@_K@Z */

+  if (param_3 == 0) {

+    MicrosoftTelemetryAssertTriggeredNoArgsKM();

+  }

+  if ((*(uint *)(*(longlong *)this + 0x20) & 8) == 0) {

+    MicrosoftTelemetryAssertTriggeredNoArgsKM();

+  }

+  pfVar1 = *(float **)this;

+  if ((((uint)pfVar1[8] & 2) == 0) || (param_2 == param_1)) {

+    *pfVar1 = *pfVar1 * 0.0625;

+    *(float *)(*(longlong *)this + 4) = *(float *)(*(longlong *)this + 4) * 0.0625;

+    *(float *)(*(longlong *)this + 8) = *(float *)(*(longlong *)this + 8) * 0.0625;

+    *(float *)(*(longlong *)this + 0xc) = *(float *)(*(longlong *)this + 0xc) * 0.0625;

+    iVar2 = bCvtVts(*(undefined8 *)this,param_1,param_2,param_3,0);

+    **(float **)this = **(float **)this * 16.0;

+    *(float *)(*(longlong *)this + 4) = *(float *)(*(longlong *)this + 4) * 16.0;

+    *(float *)(*(longlong *)this + 8) = *(float *)(*(longlong *)this + 8) * 16.0;

+    *(float *)(*(longlong *)this + 0xc) = *(float *)(*(longlong *)this + 0xc) * 16.0;

+    if (iVar2 == 0) {

+      EngSetLastError(0x216);

+    }

+    bVar3 = iVar2 != 0;

+  }

+  else {

+    memmove(param_2,param_1,param_3 * 8);

+    bVar3 = true;

+  }

+  return bVar3;

+}

+
```

## `EXFORMOBJ::bXform`  (modified)

```diff
--- EXFORMOBJ::bXform
+++ EXFORMOBJ::bXform
@@ -1,2 +1,49 @@
-Failed to decompile win32kbase.sys - .ProgramDB EXFORMOBJ::bXform : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: bool __cdecl EXFORMOBJ::bXform(struct _VECTORL const * __ptr64,struct _VECTORFX *

+   __ptr64,unsigned __int64,bool)const __ptr64 */

+

+bool __thiscall

+EXFORMOBJ::bXform(EXFORMOBJ *this,_VECTORL *param_1,_VECTORFX *param_2,__uint64 param_3,bool param_4

+                 )

+

+{

+  _VECTORL *p_Var1;

+  int iVar2;

+  longlong lVar3;

+  bool bVar4;

+  

+                    /* 0x1c2530  476  ?bXform@EXFORMOBJ@@QEBA_NPEBU_VECTORL@@PEAU_VECTORFX@@_K_N@Z

+                        */

+  if (param_3 == 0) {

+    MicrosoftTelemetryAssertTriggeredNoArgsKM();

+  }

+  if ((*(uint *)(*(longlong *)this + 0x20) & 8) == 0) {

+    MicrosoftTelemetryAssertTriggeredNoArgsKM();

+  }

+  if ((*(uint *)(*(longlong *)this + 0x20) & 2) == 0) {

+    iVar2 = bCvtVts(*(longlong *)this,param_1,param_2,param_3,param_4);

+    if (iVar2 == 0) {

+      EngSetLastError(0x216);

+    }

+    bVar4 = iVar2 != 0;

+  }

+  else {

+    p_Var1 = param_1 + param_3 * 8;

+    if (param_1 < p_Var1) {

+      lVar3 = (longlong)param_2 - (longlong)param_1;

+      do {

+        iVar2 = *(int *)(param_1 + 4);

+        if ((0xffffffc < *(int *)param_1 + 0x7fffffeU) || (0xffffffc < iVar2 + 0x7fffffeU)) {

+          EngSetLastError(0x216);

+          return false;

+        }

+        *(int *)(param_1 + lVar3) = *(int *)param_1 << 4;

+        *(int *)(param_1 + lVar3 + 4) = iVar2 << 4;

+        param_1 = param_1 + 8;

+      } while (param_1 < p_Var1);

+    }

+    bVar4 = true;

+  }

+  return bVar4;

+}

+
```

## `EXFORMOBJ::bXform`  (modified)

```diff
--- EXFORMOBJ::bXform
+++ DirectComposition::CColorBrushMarshaler::SetBufferProperty
@@ -1,2 +1,2 @@
-Failed to decompile win32kbase.sys - .ProgramDB EXFORMOBJ::bXform : Error: Decompile error: 
+Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CColorBrushMarshaler::SetBufferProperty : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `DirectComposition::CApplicationChannel::CMilCommandBatchParser::TranslateMilCommandBatchHandle`  (modified)

```diff
--- DirectComposition::CApplicationChannel::CMilCommandBatchParser::TranslateMilCommandBatchHandle
+++ WPP_RECORDER_AND_TRACE_SF_
@@ -1,30 +1,17 @@
 

-/* private: void __cdecl

-   DirectComposition::CApplicationChannel::CMilCommandBatchParser::TranslateMilCommandBatchHandle(unsigned

-   int * __ptr64,enum MIL_RESOURCE_TYPE,bool,long * __ptr64) __ptr64 */

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

 

-void __thiscall

-DirectComposition::CApplicationChannel::CMilCommandBatchParser::TranslateMilCommandBatchHandle

-          (CMilCommandBatchParser *this,uint *param_1,MIL_RESOURCE_TYPE param_2,bool param_3,

-          long *param_4)

+void WPP_RECORDER_AND_TRACE_SF_

+               (undefined8 param_1,char param_2,char param_3,undefined8 param_4,undefined1 param_5,

+               undefined4 param_6,undefined2 param_7,undefined8 param_8)

 

 {

-  MIL_RESOURCE_TYPE MVar1;

-  CResourceMarshaler *pCVar2;

-  

-  if ((!param_3) || (*param_1 != 0)) {

-    pCVar2 = LookupResourceMarshaler(*(CApplicationChannel **)this,*param_1);

-    if (pCVar2 != (CResourceMarshaler *)0x0) {

-      for (MVar1 = *(MIL_RESOURCE_TYPE *)(pCVar2 + 0x24); MVar1 < 0xbe;

-          MVar1 = *(MIL_RESOURCE_TYPE *)(&DAT_0 + (ulonglong)MVar1 * 4)) {

-        if (MVar1 == param_2) {

-          *param_1 = *(uint *)(pCVar2 + 0x20);

-          return;

-        }

-      }

-    }

-    *param_4 = -0x3ffffff3;

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

+    (*pfnWppTraceMessage)(param_1,0x2b,param_8,param_7,0);

+  }

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

+    WppAutoLogTrace(param_4,param_5,param_6,param_8,param_7,0);

   }

   return;

 }
```

## `CTouchProcessor::CancelActivePointer`  (modified)

```diff
--- CTouchProcessor::CancelActivePointer
+++ CTouchProcessor::CancelActivePointer
@@ -1,2 +1,87 @@
-Failed to decompile win32kbase.sys - .ProgramDB CTouchProcessor::CancelActivePointer : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: void __cdecl CTouchProcessor::CancelActivePointer(struct CInputPointerNode * __ptr64,int

+   * __ptr64) __ptr64 */

+

+void __thiscall

+CTouchProcessor::CancelActivePointer(CTouchProcessor *this,CInputPointerNode *param_1,int *param_2)

+

+{

+  CInputPointerNode *pCVar1;

+  longlong lVar2;

+  __uint64 _Var3;

+  CPointerMsgData *pCVar4;

+  char *this_00;

+  void *in_R9;

+  char cVar5;

+  uint uVar6;

+  bool bVar7;

+  

+  uVar6 = 0;

+  cVar5 = '\x01';

+  if (*(int *)(param_1 + 0x38) == 1) {

+    uVar6 = 0x20000;

+  }

+  else if (*(int *)(param_1 + 0x38) == 2) {

+    uVar6 = 0x40000;

+  }

+  else {

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

+        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x29] < 2))

+    {

+      cVar5 = '\0';

+    }

+    bVar7 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+    if ((cVar5 != '\0') || (bVar7)) {

+      lVar2 = W32GetUserSessionState();

+      in_R9 = *(void **)(lVar2 + 0x10f88);

+      WPP_RECORDER_AND_TRACE_SF_LHH(*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar5,bVar7);

+    }

+  }

+  SetNewValidState(this,uVar6,param_1);

+  this_00 = (char *)(param_1 + 0x48);

+  if (*(int *)this_00 != 0) {

+    CInputDest::~CInputDest((CInputDest *)this_00);

+    *(uint *)(param_1 + 300) = *(uint *)(param_1 + 300) & 0xffff7f8f;

+  }

+  if (*(int *)(param_1 + 0x24) != 0) {

+    this_00 = "IXPTelAssert";

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000);

+  }

+  pCVar1 = param_1 + 0x100;

+  if (*(int *)(param_1 + 0x38) == 3) {

+    if (*(CInputPointerNode **)pCVar1 == pCVar1) {

+      ProcessRoutedAwayList(this,*(ushort *)(param_1 + 0x20),0,(CPointerInputFrame *)0x0,0,0);

+      FreeNode(this,param_1);

+      if (param_2 == (int *)0x0) {

+        return;

+      }

+      *param_2 = 1;

+      return;

+    }

+  }

+  else if (*(CInputPointerNode **)pCVar1 == pCVar1) {

+    this_00 = "IXPTelAssert";

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0x3e56);

+  }

+  _Var3 = *(__uint64 *)pCVar1;

+  if ((char)*(undefined4 *)(_Var3 + 0x24) < '\0') {

+    this_00 = "IXPTelAssert";

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20001,0x3e58);

+  }

+  if ((*(uint *)(_Var3 + 0x24) & 0x40) == 0) {

+    _Var3 = GetPrevMsgId((CTouchProcessor *)this_00,_Var3);

+    if (_Var3 == 0) {

+      return;

+    }

+    pCVar4 = GetNonConstMsgData((CTouchProcessor *)this_00,_Var3);

+    if ((*(uint *)(pCVar4 + 0x24) & 0x40) == 0) {

+      return;

+    }

+  }

+  else if ((*(uint *)(_Var3 + 0x24) & 0x20) != 0) {

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20001,0x3e77);

+  }

+  UnreferenceMsgData(this,_Var3,1,in_R9);

+  return;

+}

+
```

## `CTouchProcessor::GenerateDeparturesForActivePointers`  (modified)

```diff
--- CTouchProcessor::GenerateDeparturesForActivePointers
+++ CTouchProcessor::GenerateDeparturesForActivePointers
@@ -1,2 +1,114 @@
-Failed to decompile win32kbase.sys - .ProgramDB CTouchProcessor::GenerateDeparturesForActivePointers : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: bool __cdecl CTouchProcessor::GenerateDeparturesForActivePointers(struct RIMDEV *

+   __ptr64) __ptr64 */

+

+bool __thiscall

+CTouchProcessor::GenerateDeparturesForActivePointers(CTouchProcessor *this,RIMDEV *param_1)

+

+{

+  CTouchProcessor *pCVar1;

+  bool bVar2;

+  RIMCOMPLETEFRAME *pRVar3;

+  CPointerInputFrame *pCVar4;

+  CInputPointerNode *pCVar5;

+  CPointerInputFrame *pCVar6;

+  CTouchProcessor *pCVar7;

+  CTouchProcessor *pCVar8;

+  uint uVar9;

+  CPointerInputFramePhase CVar10;

+  RIMCOMPLETEFRAME *pRVar11;

+  RIMCOMPLETEFRAME *pRVar12;

+  bool local_res8;

+  int local_res18 [2];

+  undefined4 local_res20;

+  CInpLockGuardExclusive local_80 [64];

+  

+                    /* 0x1fb510  129

+                       ?GenerateDeparturesForActivePointers@CTouchProcessor@@QEAA_NPEAURIMDEV@@@Z */

+  bVar2 = CEResourceLock::Locked((CEResourceLock *)(this + 0x20));

+  if (bVar2) {

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000);

+  }

+  pRVar11 = (RIMCOMPLETEFRAME *)0x0;

+  CInpLockGuardExclusive::CInpLockGuardExclusive

+            (local_80,(CEResourceLock *)(this + 0x20),(void *)0x0);

+  pCVar1 = this + 0x50;

+  local_res8 = false;

+  pCVar8 = *(CTouchProcessor **)pCVar1;

+  if (pCVar8 != pCVar1) {

+    local_res8 = false;

+    do {

+      pRVar3 = (RIMCOMPLETEFRAME *)0x0;

+      pCVar7 = *(CTouchProcessor **)(this + 0x30);

+      local_res18[0] = CONCAT22(local_res18[0]._2_2_,*(undefined2 *)(pCVar8 + 0x10));

+      for (; pCVar6 = (CPointerInputFrame *)pRVar3, pCVar7 != this + 0x30;

+          pCVar7 = *(CTouchProcessor **)pCVar7) {

+        pRVar11 = pRVar3;

+        if (*(uint *)(pCVar7 + 0x28) != 0) {

+          do {

+            if (*(short *)((CTouchProcessor *)((longlong)pRVar11 * 0x1e0) +

+                          *(longlong *)(pCVar7 + 0xe8) + 0xa0) == *(short *)(pCVar8 + 0x12)) {

+              pCVar6 = ReferenceFrameInt((CTouchProcessor *)((longlong)pRVar11 * 0x1e0),

+                                         (CPointerInputFrame *)(pCVar7 + -8),

+                                         (CPointerInputFramePhase)pRVar11);

+              goto LAB_0;

+            }

+            uVar9 = (CPointerInputFramePhase)pRVar11 + 1;

+            pRVar11 = (RIMCOMPLETEFRAME *)(ulonglong)uVar9;

+          } while (uVar9 < *(uint *)(pCVar7 + 0x28));

+        }

+      }

+LAB_0:

+      if ((param_1 == (RIMDEV *)0x0) ||

+         ((pRVar12 = pRVar3, pCVar6 != (CPointerInputFrame *)0x0 &&

+          (*(RIMDEV **)(*(longlong *)(pCVar6 + 0x100) + 0x10) == param_1)))) {

+        pRVar12 = (RIMCOMPLETEFRAME *)0x1;

+        if ((pCVar6 != (CPointerInputFrame *)0x0) &&

+           (pRVar3 = (RIMCOMPLETEFRAME *)<lambda_e1b7d727f4d9425d1205377adb72da73>::operator()(),

+           pRVar3 != (RIMCOMPLETEFRAME *)0x0)) {

+          pRVar11 = (RIMCOMPLETEFRAME *)0x0;

+          pCVar4 = CommitRimCompleteFrame(this,pRVar3,false,false);

+          if ((pCVar4 != (CPointerInputFrame *)0x0) &&

+             (pCVar4 = ReferenceInputFrame(this,pCVar4,pRVar11,0),

+             pCVar4 != (CPointerInputFrame *)0x0)) {

+            uVar9 = *(uint *)(*(CTouchProcessor **)(pCVar4 + 0x100) + 0x170);

+            RemoveUndispatchedFrameFromThreadFrameList(*(CTouchProcessor **)(pCVar4 + 0x100),pCVar4)

+            ;

+            CVar10 = -(uint)((uVar9 >> 4 & 1) != 0);

+            GenerateMessagesCore(this,-(uint)((uVar9 >> 3 & 1) != 0),CVar10,0,pCVar4);

+            UnreferenceFrame(this,pCVar4,CVar10);

+          }

+        }

+        pRVar11 = (RIMCOMPLETEFRAME *)0x1;

+        pCVar5 = FindNodeById(this,(ushort)local_res18[0],1,0);

+        if (pCVar5 != (CInputPointerNode *)0x0) {

+          local_res20 = 0x20000;

+          MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0x409a);

+          pRVar11 = (RIMCOMPLETEFRAME *)local_res18;

+          local_res18[0] = 0;

+          CancelActivePointer(this,pCVar5,(int *)pRVar11);

+          if (local_res18[0] == 0) {

+            pRVar11 = (RIMCOMPLETEFRAME *)0x409d;

+            MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000);

+          }

+        }

+        if (pRVar3 != (RIMCOMPLETEFRAME *)0x0) {

+          GreDeleteFastMutex(pRVar3);

+        }

+      }

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

+        UnreferenceFrameInt(this,pCVar6,(CPointerInputFramePhase)pRVar11);

+      }

+      if ((char)pRVar12 == '\0') {

+        pCVar8 = *(CTouchProcessor **)pCVar8;

+      }

+      else {

+        pCVar8 = *(CTouchProcessor **)pCVar1;

+        local_res8 = true;

+      }

+    } while (pCVar8 != pCVar1);

+  }

+  CInpLockGuardExclusive::~CInpLockGuardExclusive(local_80);

+  return local_res8;

+}

+
```

## `CPTPEngine::DoTPGestureProcessing`  (modified)

```diff
--- CPTPEngine::DoTPGestureProcessing
+++ CPTPEngine::DoTPGestureProcessing
@@ -1,2 +1,266 @@
-Failed to decompile win32kbase.sys - .ProgramDB CPTPEngine::DoTPGestureProcessing : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: void __cdecl CPTPEngine::DoTPGestureProcessing(struct PTPInput * __ptr64) __ptr64 */

+

+void __thiscall CPTPEngine::DoTPGestureProcessing(CPTPEngine *this,PTPInput *param_1)

+

+{

+  undefined1 auVar1 [16];

+  undefined1 auVar2 [16];

+  bool bVar3;

+  int iVar4;

+  uint uVar5;

+  CContactState *pCVar6;

+  uint uVar7;

+  tagPTP_ACTION tVar8;

+  longlong lVar9;

+  longlong lVar10;

+  CPTPEngine *pCVar11;

+  PTPInput *pPVar12;

+  uint uVar13;

+  undefined4 uVar14;

+  uint uVar15;

+  bool bVar16;

+  uint local_res18 [4];

+  undefined4 local_58;

+  undefined4 uStack_54;

+  undefined4 uStack_50;

+  undefined4 uStack_4c;

+  undefined8 local_48;

+  

+  if ((*(int *)(this + 0xc28) == 3) || (*(int *)(this + 0xc28) == 6)) {

+    bVar16 = true;

+  }

+  else {

+    bVar16 = false;

+  }

+  iVar4 = Feature_TouchpadSingleFingerPanning__private_IsEnabledDeviceUsageNoInline();

+  bVar3 = bVar16;

+  if (iVar4 == 0) {

+    if (((*(int *)(this + 0xc28) != 1) || (*(uint *)(this + 0xc18) < 2)) ||

+       (*(int *)(this + 0xc24) != 0)) goto LAB_0;

+    pCVar6 = (CContactState *)0x0;

+    uVar13 = 0;

+    if (*(int *)(param_1 + 0x30) != 0) {

+      local_res18[0] = *(uint *)(this + 0x10);

+      pPVar12 = param_1 + 0x44;

+      do {

+        lVar9 = ((ulonglong)*(uint *)(pPVar12 + -8) % (ulonglong)local_res18[0]) * 0x148;

+        uVar15 = *(uint *)(this + 0xd20);

+        if (((uVar15 >> 0x17 & 1) == 0) && ((uVar15 >> 0x15 & 1) != 0)) {

+          *(undefined8 *)(this + 0xcc0) = *(undefined8 *)param_1;

+          uVar15 = uVar15 | 0x800000;

+          *(uint *)(this + 0xd20) = uVar15;

+        }

+        if (((uVar15 >> 0x15 & 1) == 0) ||

+           (auVar2._8_8_ = 0,

+           auVar2._0_8_ = (ulonglong)*(uint *)(this + 0xdd0) * *(longlong *)(this + 0x60),

+           lVar10 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar2,8),

+           ((ulonglong)*(uint *)(this + 0xdd0) * *(longlong *)(this + 0x60) - lVar10 >> 1) + lVar10

+           >> 9 <= (ulonglong)(*(longlong *)param_1 - *(longlong *)(this + 0xcc0)))) {

+          bVar3 = true;

+        }

+        else {

+          bVar3 = false;

+        }

+        uVar15 = *(uint *)(this + lVar9 + 0x450);

+        if ((((((uVar15 & 1) != 0) && ((*(uint *)pPVar12 & 0x40000) == 0)) &&

+             ((uVar15 >> 8 & 1) == 0)) && (((uVar15 >> 0x14 & 1) != 0 && (bVar3)))) &&

+           ((*(int *)(param_1 + 0x28) != 0 || (((uVar15 & 4) != 0 || ((uVar15 & 0x10) != 0)))))) {

+          pCVar6 = (CContactState *)(this + lVar9 + 0x450);

+          goto LAB_1;

+        }

+        pPVar12 = pPVar12 + 0x90;

+        uVar13 = uVar13 + 1;

+      } while (uVar13 < *(uint *)(param_1 + 0x30));

+    }

+    if (!bVar16) {

+      return;

+    }

+LAB_1:

+    MarkRecentlyTrackedContactsAsNonResting(this,param_1,pCVar6);

+  }

+  else {

+    pCVar6 = (CContactState *)0x0;

+    if ((*(int *)(this + 0xc28) == 1) && (*(int *)(this + 0xc24) == 0)) {

+      if ((*(uint *)(this + 0xc18) < 2) && (*(int *)(this + 0x18) == 0)) {

+        if (*(int *)(this + 0xb0) != 0) {

+          uVar13 = 0;

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

+            pPVar12 = param_1 + 0x44;

+            do {

+              lVar9 = ((ulonglong)*(uint *)(pPVar12 + -8) % (ulonglong)*(uint *)(this + 0x10)) *

+                      0x148;

+              if ((((*(uint *)(this + lVar9 + 0x450) & 1) != 0) &&

+                  ((*(uint *)pPVar12 >> 0x12 & 1) == 0)) &&

+                 ((*(uint *)(this + lVar9 + 0x454) & 0x20) != 0)) {

+                bVar3 = true;

+                goto LAB_2;

+              }

+              pPVar12 = pPVar12 + 0x90;

+              uVar13 = uVar13 + 1;

+            } while (uVar13 < *(uint *)(param_1 + 0x30));

+          }

+        }

+      }

+      else {

+        uVar13 = 0;

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

+          pPVar12 = param_1 + 0x44;

+          do {

+            lVar9 = ((ulonglong)*(uint *)(pPVar12 + -8) % (ulonglong)*(uint *)(this + 0x10)) * 0x148

+            ;

+            uVar15 = *(uint *)(this + lVar9 + 0x450);

+            if ((((((uVar15 & 1) != 0) && ((*(uint *)pPVar12 >> 0x12 & 1) == 0)) &&

+                 ((uVar15 >> 8 & 1) == 0)) && ((uVar15 >> 0x14 & 1) != 0)) &&

+               (((*(int *)(param_1 + 0x28) != 0 || ((uVar15 & 4) != 0)) || ((uVar15 & 0x10) != 0))))

+            {

+              bVar3 = true;

+              pCVar6 = (CContactState *)(this + lVar9 + 0x450);

+              goto LAB_2;

+            }

+            pPVar12 = pPVar12 + 0x90;

+            uVar13 = uVar13 + 1;

+          } while (uVar13 < *(uint *)(param_1 + 0x30));

+        }

+      }

+      if (!bVar16) {

+        return;

+      }

+LAB_2:

+      uVar13 = *(uint *)(this + 0xd20);

+      if (((uVar13 & 0x800000) == 0) && ((uVar13 >> 0x15 & 1) != 0)) {

+        *(undefined8 *)(this + 0xcc0) = *(undefined8 *)param_1;

+        uVar13 = uVar13 | 0x800000;

+        *(uint *)(this + 0xd20) = uVar13;

+      }

+      if (((uVar13 >> 0x15 & 1) == 0) ||

+         (auVar1._8_8_ = 0,

+         auVar1._0_8_ = (ulonglong)*(uint *)(this + 0xdd0) * *(longlong *)(this + 0x60),

+         lVar9 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar1,8),

+         ((ulonglong)*(uint *)(this + 0xdd0) * *(longlong *)(this + 0x60) - lVar9 >> 1) + lVar9 >> 9

+         <= (ulonglong)(*(longlong *)param_1 - *(longlong *)(this + 0xcc0)))) {

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

+          MarkRecentlyTrackedContactsAsNonResting(this,param_1,pCVar6);

+        }

+      }

+      else {

+        bVar3 = false;

+      }

+    }

+LAB_0:

+    if (!bVar3) {

+      return;

+    }

+  }

+  uVar13 = (uint)(*(int *)(this + 0xc28) == 6);

+  local_res18[0] = 0;

+  if ((*(uint *)(this + 0xd20) & 0x800000) != 0) {

+    *(uint *)(this + 0xd20) = *(uint *)(this + 0xd20) & 0xff5fffff;

+  }

+  if (!bVar16) {

+    uVar15 = 0;

+    uVar13 = 0;

+    if (*(int *)(param_1 + 0x30) != 0) {

+      pPVar12 = param_1 + 0x44;

+      do {

+        pCVar11 = this + ((ulonglong)*(uint *)(pPVar12 + -8) % (ulonglong)*(uint *)(this + 0x10)) *

+                         0x148 + 0x450;

+        if ((*(uint *)pCVar11 & 1) != 0) {

+          iVar4 = Feature_TouchpadSingleFingerPanning__private_IsEnabledDeviceUsageNoInline();

+          if (iVar4 == 0) {

+LAB_3:

+            if (((*(uint *)pCVar11 >> 8 & 1) == 0) && ((*(uint *)pPVar12 & 0x40000) == 0)) {

+              uVar5 = 0;

+            }

+            else {

+              uVar5 = 0x800;

+            }

+            uVar7 = *(uint *)pCVar11 & 0xfffff7ff;

+          }

+          else {

+            if ((1 < *(uint *)(this + 0xc18)) || (*(int *)(this + 0x18) != 0)) {

+              *(uint *)(pCVar11 + 4) = *(uint *)(pCVar11 + 4) & 0xffffffdf;

+              goto LAB_3;

+            }

+            uVar7 = (~*(uint *)(pCVar11 + 4) & 0x20) << 6;

+            uVar5 = *(uint *)pCVar11 & 0xfffff7ff;

+          }

+          *(uint *)pCVar11 = uVar7 | uVar5;

+          if (((uVar7 | uVar5) >> 0xb & 1) == 0) {

+            uVar15 = uVar15 + 1;

+          }

+          else {

+            *(uint *)(pCVar11 + 4) = *(uint *)(pCVar11 + 4) & 0xfffffffc;

+          }

+        }

+        uVar13 = uVar13 + 1;

+        pPVar12 = pPVar12 + 0x90;

+      } while (uVar13 < *(uint *)(param_1 + 0x30));

+    }

+    iVar4 = Feature_TouchpadSingleFingerPanning__private_IsEnabledDeviceUsageNoInline();

+    if (iVar4 == 0) {

+      if (uVar15 == 2) {

+        uVar14 = 3;

+        uVar13 = 0;

+      }

+      else {

+        uVar13 = 1;

+        if (uVar15 < 2) {

+          bVar16 = true;

+          uVar14 = 6;

+          goto LAB_4;

+        }

+        uVar14 = 6;

+        uVar13 = 1;

+      }

+      bVar16 = false;

+    }

+    else {

+      uVar13 = (uint)(2 < uVar15);

+      bVar16 = uVar15 == 0;

+      uVar14 = 3;

+      if (2 < uVar15) {

+        uVar14 = 6;

+      }

+    }

+LAB_4:

+    if ((bVar16) || (pCVar6 = FindOrAssignPrimary(this,param_1), pCVar6 == (CContactState *)0x0)) {

+      local_58 = 1;

+      uStack_54 = 0;

+      uStack_50 = 0;

+      uStack_4c = 0;

+      local_48 = 0;

+      CBasePTPEngine::SendTelemetryOutput((CBasePTPEngine *)0x1,0xb,&local_58);

+      uVar15 = 0;

+      goto LAB_5;

+    }

+    SendMouseUpIfPending(this,(uint *)(this + 0xc04));

+    CancelMouseUpTimer(this,1);

+    *(undefined8 *)(this + 0xcc8) = *(undefined8 *)param_1;

+    *(undefined4 *)(this + 0xc28) = uVar14;

+    if (*(int *)(param_1 + 0x28) != 0) {

+      CBasePTPEngine::SendInertiaOutput((CBasePTPEngine *)this,uVar13 * 2 + 1);

+    }

+    if (uVar13 == 0) {

+      tVar8 = 9;

+    }

+    else {

+      tVar8 = (uVar15 != 3) + 0xb;

+    }

+    CBasePTPEngine::SendLastActionTelemetry((CBasePTPEngine *)this,tVar8);

+    iVar4 = SendInitialGestureFrame(this,param_1,pCVar6,uVar13);

+    uVar15 = 0;

+    if (iVar4 != 0) goto LAB_5;

+  }

+  ProcessGestureFrame(this,param_1,uVar13,(int *)local_res18);

+  uVar15 = local_res18[0];

+LAB_5:

+  if (uVar15 != 0) {

+    *(undefined4 *)(this + 0xc28) = 1;

+    ResetDragThresholds(this,param_1);

+    *(uint *)(this + 0xd20) = *(uint *)(this + 0xd20) & 0xfff9ffff;

+    *(undefined8 *)(this + 0xcd0) = *(undefined8 *)param_1;

+  }

+  return;

+}

+
```

## `CMouseProcessor::CaptureLogicalCursorPosToQMouseMove`  (modified)

```diff
--- CMouseProcessor::CaptureLogicalCursorPosToQMouseMove
+++ CMouseProcessor::CaptureLogicalCursorPosToQMouseMove
@@ -1,2 +1,34 @@
-Failed to decompile win32kbase.sys - .ProgramDB CMouseProcessor::CaptureLogicalCursorPosToQMouseMove : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: void __cdecl CMouseProcessor::CaptureLogicalCursorPosToQMouseMove(struct tagQ * __ptr64)

+   __ptr64 */

+

+void __thiscall

+CMouseProcessor::CaptureLogicalCursorPosToQMouseMove(CMouseProcessor *this,tagQ *param_1)

+

+{

+  int iVar1;

+  longlong lVar2;

+  undefined4 uVar3;

+  undefined8 local_res10 [3];

+  

+  if (*(longlong *)(param_1 + 0x80) == 0) {

+    local_res10[0] = *(undefined8 *)(this + 0x2c);

+    uVar3 = *(undefined4 *)(this + 0x34);

+  }

+  else {

+    lVar2 = PtiMouseFromQ(param_1);

+    uVar3 = *(undefined4 *)(*(longlong *)(lVar2 + 0x1d0) + 0x10c);

+    LogicalCursorPosFromDpiAwarenessContext(this,(ulong)local_res10);

+  }

+  iVar1 = Feature_ConsistentPendingMouse2__private_IsEnabledDeviceUsageNoInline();

+  if (iVar1 == 0) {

+    *(undefined8 *)(param_1 + 0xd0) = local_res10[0];

+    *(undefined4 *)(param_1 + 0xd8) = uVar3;

+  }

+  else {

+    *(undefined8 *)(param_1 + 0x108) = local_res10[0];

+    *(undefined4 *)(param_1 + 0x110) = uVar3;

+  }

+  return;

+}

+
```

## `DirectComposition::CPropertySetMarshaler::SetBufferProperty`  (modified)

```diff
--- DirectComposition::CPropertySetMarshaler::SetBufferProperty
+++ DirectComposition::CPropertySetMarshaler::SetBufferProperty
@@ -1,2 +1,189 @@
-Failed to decompile win32kbase.sys - .ProgramDB DirectComposition::CPropertySetMarshaler::SetBufferProperty : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl DirectComposition::CPropertySetMarshaler::SetBufferProperty(class

+   DirectComposition::CApplicationChannel * __ptr64,unsigned int,void const * __ptr64,unsigned

+   __int64,bool * __ptr64) __ptr64 */

+

+long __thiscall

+DirectComposition::CPropertySetMarshaler::SetBufferProperty

+          (CPropertySetMarshaler *this,CApplicationChannel *param_1,uint param_2,void *param_3,

+          __uint64 param_4,bool *param_5)

+

+{

+  int iVar1;

+  int iVar2;

+  undefined8 local_18;

+  int local_10;

+  

+  iVar1 = 0;

+  if (((param_2 != 1) && (param_2 != 2)) || (param_4 < 0xc)) {

+    return -0x3ffffff3;

+  }

+  local_10 = *(int *)((longlong)param_3 + 8);

+  local_18 = *(undefined8 *)param_3;

+  iVar2 = (int)param_4;

+  if (local_10 == 0x11) {

+    if (iVar2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    if (param_2 == 1) {

+      iVar1 = AddProperty<bool>(this,(PropertySetValue *)&local_18,(bool *)((longlong)param_3 + 0xc)

+                               );

+    }

+    else {

+      if (param_2 != 2) {

+        return -0x3ffffff3;

+      }

+      iVar1 = UpdateProperty<bool>

+                        (this,(PropertySetValue *)&local_18,(bool *)((longlong)param_3 + 0xc));

+    }

+  }

+  else if (local_10 == 0x12) {

+    if (iVar2 != 0x10) {

+      return -0x3ffffff3;

+    }

+    if (param_2 == 1) {

+      iVar1 = AddProperty<float>(this,(PropertySetValue *)&local_18,

+                                 (float *)((longlong)param_3 + 0xc));

+    }

+    else {

+      if (param_2 != 2) {

+        return -0x3ffffff3;

+      }

+      iVar1 = UpdateProperty<float>

+                        (this,(PropertySetValue *)&local_18,(float *)((longlong)param_3 + 0xc));

+    }

+  }

+  else if (local_10 == 0x23) {

+    if (iVar2 != 0x14) {

+      return -0x3ffffff3;

+    }

+    if (param_2 == 1) {

+      iVar1 = AddProperty<D2DVector2>

+                        (this,(PropertySetValue *)&local_18,(D2DVector2 *)((longlong)param_3 + 0xc))

+      ;

+    }

+    else {

+      if (param_2 != 2) {

+        return -0x3ffffff3;

+      }

+      iVar1 = UpdateProperty<D2DVector2>

+                        (this,(PropertySetValue *)&local_18,(D2DVector2 *)((longlong)param_3 + 0xc))

+      ;

+    }

+  }

+  else if (local_10 == 0x34) {

+    if (iVar2 != 0x18) {

+      return -0x3ffffff3;

+    }

+    if (param_2 == 1) {

+      iVar1 = AddProperty<D2DVector3>

+                        (this,(PropertySetValue *)&local_18,(D2DVector3 *)((longlong)param_3 + 0xc))

+      ;

+    }

+    else {

+      if (param_2 != 2) {

+        return -0x3ffffff3;

+      }

+      iVar1 = UpdateProperty<D2DVector3>

+                        (this,(PropertySetValue *)&local_18,(D2DVector3 *)((longlong)param_3 + 0xc))

+      ;

+    }

+  }

+  else if (local_10 == 0x45) {

+    if (iVar2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    if (param_2 == 1) {

+      iVar1 = AddProperty<D2DVector4>

+                        (this,(PropertySetValue *)&local_18,(D2DVector4 *)((longlong)param_3 + 0xc))

+      ;

+    }

+    else {

+      if (param_2 != 2) {

+        return -0x3ffffff3;

+      }

+      iVar1 = UpdateProperty<_D3DCOLORVALUE>

+                        (this,(PropertySetValue *)&local_18,

+                         (_D3DCOLORVALUE *)((longlong)param_3 + 0xc));

+    }

+  }

+  else if (local_10 == 0x46) {

+    if (iVar2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    if (param_2 == 1) {

+      iVar1 = AddProperty<_D3DCOLORVALUE>

+                        (this,(PropertySetValue *)&local_18,

+                         (_D3DCOLORVALUE *)((longlong)param_3 + 0xc));

+    }

+    else {

+      if (param_2 != 2) {

+        return -0x3ffffff3;

+      }

+      iVar1 = UpdateProperty<_D3DCOLORVALUE>

+                        (this,(PropertySetValue *)&local_18,

+                         (_D3DCOLORVALUE *)((longlong)param_3 + 0xc));

+    }

+  }

+  else if (local_10 == 0x47) {

+    if (iVar2 != 0x1c) {

+      return -0x3ffffff3;

+    }

+    if (param_2 == 1) {

+      iVar1 = AddProperty<D2DQuaternion>

+                        (this,(PropertySetValue *)&local_18,

+                         (D2DQuaternion *)((longlong)param_3 + 0xc));

+    }

+    else {

+      if (param_2 != 2) {

+        return -0x3ffffff3;

+      }

+      iVar1 = UpdateProperty<D2DQuaternion>

+                        (this,(PropertySetValue *)&local_18,

+                         (D2DQuaternion *)((longlong)param_3 + 0xc));

+    }

+  }

+  else if (local_10 == 0x68) {

+    if (iVar2 != 0x24) {

+      return -0x3ffffff3;

+    }

+    if (param_2 == 1) {

+      iVar1 = AddProperty<D2D_MATRIX_3X2_F>

+                        (this,(PropertySetValue *)&local_18,

+                         (D2D_MATRIX_3X2_F *)((longlong)param_3 + 0xc));

+    }

+    else {

+      if (param_2 != 2) {

+        return -0x3ffffff3;

+      }

+      iVar1 = UpdateProperty<D2D_MATRIX_3X2_F>

+                        (this,(PropertySetValue *)&local_18,

+                         (D2D_MATRIX_3X2_F *)((longlong)param_3 + 0xc));

+    }

+  }

+  else {

+    if (local_10 != 0x109) goto LAB_0;

+    if (iVar2 != 0x4c) {

+      return -0x3ffffff3;

+    }

+    if (param_2 == 1) {

+      iVar1 = AddProperty<D2DMatrix>

+                        (this,(PropertySetValue *)&local_18,(D2DMatrix *)((longlong)param_3 + 0xc));

+    }

+    else {

+      if (param_2 != 2) {

+        return -0x3ffffff3;

+      }

+      iVar1 = UpdateProperty<D2DMatrix>

+                        (this,(PropertySetValue *)&local_18,(D2DMatrix *)((longlong)param_3 + 0xc));

+    }

+  }

+  if (iVar1 < 0) {

+    return iVar1;

+  }

+LAB_0:

+  *(uint *)(this + 0x10) = *(uint *)(this + 0x10) | 0x80;

+  *param_5 = true;

+  return iVar1;

+}

+
```

## `CTouchProcessor::ReferenceMsgData`  (modified)

```diff
--- CTouchProcessor::ReferenceMsgData
+++ CTouchProcessor::ReferenceMsgData
@@ -1,2 +1,84 @@
-Failed to decompile win32kbase.sys - .ProgramDB CTouchProcessor::ReferenceMsgData : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: void __cdecl CTouchProcessor::ReferenceMsgData(unsigned __int64,enum

+   tagPOINTERMSGDATA_REFTYPE,void * __ptr64) __ptr64 */

+

+void __thiscall

+CTouchProcessor::ReferenceMsgData

+          (CTouchProcessor *this,__uint64 param_1,tagPOINTERMSGDATA_REFTYPE param_2,void *param_3)

+

+{

+  CPointerMsgData *pCVar1;

+  int iVar2;

+  bool bVar3;

+  bool bVar4;

+  CPointerMsgData *pCVar5;

+  longlong lVar6;

+  char cVar7;

+  

+  pCVar5 = GetNonConstMsgData(this,param_1);

+  bVar4 = CEResourceLock::Locked((CEResourceLock *)(this + 0x20));

+  bVar3 = true;

+  if (!bVar4) {

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20001,0x2bfa);

+  }

+  LOCK();

+  pCVar1 = pCVar5 + 0x18;

+  iVar2 = *(int *)pCVar1;

+  *(int *)pCVar1 = *(int *)pCVar1 + 1;

+  UNLOCK();

+  if (iVar2 == -1) {

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20001,0x2c02);

+  }

+  if (param_2 == 1) {

+    if ((*(uint *)(pCVar5 + 0x24) & 0x40) != 0) {

+      MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20001,0x2c06);

+    }

+    if ((*(uint *)(pCVar5 + 0x24) & 0x40) != 0) {

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

+          ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x29] < 2)

+         ) {

+        cVar7 = '\0';

+      }

+      else {

+        cVar7 = '\x01';

+      }

+      bVar4 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+      if ((cVar7 != '\0') || (bVar4)) {

+        lVar6 = W32GetUserSessionState();

+        WPP_RECORDER_AND_TRACE_SF_q

+                  (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),cVar7,bVar4,

+                   *(undefined8 *)(lVar6 + 0x10f88),2,4,0x11c,

+                   &WPP_9b909e6f7a6f3ba61ffc5a77a7a32fbe_Traceguids,pCVar5);

+      }

+    }

+    *(uint *)(pCVar5 + 0x24) = *(uint *)(pCVar5 + 0x24) | 0x40;

+  }

+  else if (8 < param_2) {

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20001,0x2c11);

+    return;

+  }

+  pCVar1 = pCVar5 + (longlong)(int)param_2 + 0x34;

+  *pCVar1 = (CPointerMsgData)((char)*pCVar1 + '\x01');

+  if (*pCVar1 == (CPointerMsgData)0x0) {

+    MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20001,0x2c17);

+  }

+  if (pCVar5[(longlong)(int)param_2 + 0x34] == (CPointerMsgData)0x0) {

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

+        ((*(uint *)(WPP_GLOBAL_Control + 0x2c) & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x29] < 2))

+    {

+      bVar3 = false;

+    }

+    bVar4 = (undefined **)WPP_RECORDER_INITIALIZED != &WPP_RECORDER_INITIALIZED;

+    if ((bVar3) || (bVar4)) {

+      lVar6 = W32GetUserSessionState();

+      WPP_RECORDER_AND_TRACE_SF_Lq

+                (*(undefined8 *)(WPP_GLOBAL_Control + 0x18),bVar3,bVar4,

+                 *(undefined8 *)(lVar6 + 0x10f88));

+    }

+  }

+  InputTraceLogging::PointerMsg::ReferenceMsgData

+            (param_1,*(ulong *)(pCVar5 + 0x18),param_2,

+             (uint)(byte)pCVar5[(longlong)(int)param_2 + 0x34]);

+  return;

+}

+
```

## ``anonymous_namespace'::GetPtiFromInputDest`  (modified)

```diff
--- `anonymous_namespace'::GetPtiFromInputDest
+++ `anonymous_namespace'::GetPtiFromInputDest
@@ -1,17 +1,43 @@
 

-void `CTouchProcessor::GetPointerRawDataWithHistory'::GetPtiFromInputDest(void)

+undefined8 `anonymous_namespace'::GetPtiFromInputDest(CInputDest *param_1,int param_2)

 

 {

-  char in_AL;

-  char cVar1;

-  undefined7 in_register_00000001;

-  longlong unaff_RBX;

-  char in_CF;

+  tagWND *ptVar1;

+  longlong lVar2;

+  void *pvVar3;

+  undefined8 uVar4;

   

-  cVar1 = in_AL + '\f' + in_CF;

-  *(char *)CONCAT71(in_register_00000001,cVar1) =

-       *(char *)CONCAT71(in_register_00000001,cVar1) + cVar1;

-  *(int *)(unaff_RBX + 0xc18) = *(int *)(unaff_RBX + 0xc18) + -1;

-  return;

+  uVar4 = 0;

+  if (param_2 == 2) {

+    uVar4 = 0;

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

+      ptVar1 = CInputDest::GetUserWindow(param_1);

+      if (ptVar1 != (tagWND *)0x0) {

+        ptVar1 = CInputDest::GetUserWindow(param_1);

+        uVar4 = *(undefined8 *)(ptVar1 + 0x10);

+      }

+    }

+  }

+  else {

+    if (param_1 == (CInputDest *)0x0) {

+      lVar2 = W32GetUserSessionState();

+      pvVar3 = *(void **)(lVar2 + 0x4a50);

+    }

+    else {

+      pvVar3 = CInputDest::GetQueue(param_1,0);

+    }

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

+      if (param_2 == 0) {

+        uVar4 = *(undefined8 *)((longlong)pvVar3 + 0x70);

+      }

+      else if (param_2 == 1) {

+        uVar4 = PtiMouseFromQ(pvVar3);

+      }

+      else {

+        MicrosoftTelemetryAssertTriggeredArgsKM("IXPTelAssert",0x20000,0xa8);

+      }

+    }

+  }

+  return uVar4;

 }
```

## `UIPrivilegeIsolation::CheckAccess`  (modified)

```diff
--- UIPrivilegeIsolation::CheckAccess
+++ UIPrivilegeIsolation::CheckAccess
@@ -1,2 +1,74 @@
-Failed to decompile win32kbase.sys - .ProgramDB UIPrivilegeIsolation::CheckAccess : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* bool __cdecl UIPrivilegeIsolation::CheckAccess(struct tagUIPI_INFO const & __ptr64,struct

+   tagUIPI_INFO const & __ptr64,enum UIPrivilegeIsolation::AppContainerMatch) */

+

+bool __cdecl

+UIPrivilegeIsolation::CheckAccess

+          (tagUIPI_INFO *param_1,tagUIPI_INFO *param_2,AppContainerMatch param_3)

+

+{

+  uint uVar1;

+  uint uVar2;

+  undefined4 uVar3;

+  char cVar4;

+  int iVar5;

+  int iVar6;

+  undefined4 uVar7;

+  undefined4 uVar8;

+  

+                    /* 0x1a3850  63

+                       ?CheckAccess@UIPrivilegeIsolation@@YA_NAEBUtagUIPI_INFO@@0W4AppContainerMatch@1@@Z

+                        */

+  iVar5 = Feature_UIPISystemILCompartmentGate__private_IsEnabledDeviceUsageNoInline();

+  iVar6 = *(int *)(param_2 + 8);

+  if (iVar6 != 0) {

+    if (iVar5 == 0) {

+      if (*(int *)(param_1 + 8) != iVar6) goto LAB_0;

+    }

+    else if ((*(int *)(param_1 + 8) != iVar6) && (*(uint *)param_1 < 0x4000)) goto LAB_0;

+  }

+  iVar6 = Feature_UIPIModernization__private_IsEnabledDeviceUsageNoInline();

+  if (iVar6 == 0) {

+    uVar1 = *(uint *)param_1;

+    uVar2 = *(uint *)param_2;

+    if (uVar1 <= uVar2) {

+      if (uVar1 == uVar2) {

+        if (*(int *)(param_1 + 4) == *(int *)(param_2 + 4)) {

+          return true;

+        }

+        if (*(int *)(param_1 + 4) == -1) {

+          return true;

+        }

+        if (*(int *)(param_2 + 4) == -1) {

+          return true;

+        }

+      }

+      if ((param_3 == 1) && (uVar1 == uVar2)) {

+        uVar7 = *(undefined4 *)(param_2 + 4);

+        uVar3 = *(undefined4 *)(param_1 + 4);

+        uVar8 = W32GetCurrentWin32kSessionId();

+        cVar4 = SeIsParentOfChildAppContainer(uVar8,uVar3,uVar7);

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

+          return true;

+        }

+      }

+      goto LAB_0;

+    }

+  }

+  else {

+    iVar6 = *(int *)(param_1 + 4);

+    if ((iVar6 != 0) && (iVar5 = *(int *)(param_2 + 4), iVar5 != iVar6)) {

+      if (param_3 != 1) goto LAB_0;

+      uVar7 = W32GetCurrentWin32kSessionId();

+      cVar4 = SeIsParentOfChildAppContainer(uVar7,iVar6,iVar5);

+      if (cVar4 == '\0') goto LAB_0;

+    }

+    if (*(uint *)param_1 < *(uint *)param_2) {

+LAB_0:

+      InputTraceLogging::Win32k::UIPIFailure(param_1,param_2,param_3 == 1);

+      return false;

+    }

+  }

+  return true;

+}

+
```

## `DirectComposition::CApplicationChannel::ReleaseResource`  (modified)

```diff
--- DirectComposition::CApplicationChannel::ReleaseResource
+++ HMUnlockObject
@@ -1,187 +1,59 @@
 

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

-/* public: unsigned __int64 __cdecl DirectComposition::CApplicationChannel::ReleaseResource(class

-   DirectComposition::CResourceMarshaler * __ptr64) __ptr64 */

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

 

-__uint64 __thiscall

-DirectComposition::CApplicationChannel::ReleaseResource

-          (CApplicationChannel *this,CResourceMarshaler *param_1)

+uint * HMUnlockObject(uint *param_1)

 

 {

-  uint uVar1;

-  CResourceMarshaler *pCVar2;

-  CAnimationTimeList *this_00;

-  longlong *plVar3;

-  code *pcVar4;

-  char cVar5;

-  __uint64 _Var6;

-  longlong lVar7;

-  longlong lVar8;

-  longlong *plVar9;

-  uint uVar10;

-  CApplicationChannel *pCVar11;

-  ulonglong uVar12;

-  CAnimationTimeList *pCVar13;

-  longlong local_res10;

-  CResourceMarshaler *local_28;

-  undefined8 local_20;

+  uint *puVar1;

+  uint uVar2;

+  bool bVar3;

+  longlong lVar4;

+  longlong lVar5;

+  _HANDLEENTRY *p_Var6;

+  undefined1 auStack_68 [32];

+  undefined8 *local_48 [5];

+  char local_20;

+  ulonglong local_18;

   

-  _Var6 = 0;

-  if (param_1 != (CResourceMarshaler *)0x0) {

-    _Var6 = CResourceMarshaler::PrivateRelease(param_1);

-    if (_Var6 == 1) {

-      cVar5 = (**(code **)(*(longlong *)param_1 + 0x18))(param_1);

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

-        CResourceMarshaler::ReturnResourceLifetimeTag

-                  (param_1,(CDeletedNotificationList *)(this + 0x220));

+                    /* 0x4cbf0  1664  HMUnlockObject */

+  local_18 = __security_cookie ^ (ulonglong)auStack_68;

+  LOCK();

+  puVar1 = param_1 + 2;

+  uVar2 = *puVar1;

+  *puVar1 = *puVar1 - 1;

+  UNLOCK();

+  if (uVar2 != 1) {

+    return param_1;

+  }

+  uVar2 = *param_1;

+  lVar4 = W32GetUserSessionState();

+  lVar5 = W32GetUserSessionState();

+  p_Var6 = (_HANDLEENTRY *)

+           ((ulonglong)((uVar2 & 0xffff) * *(int *)(lVar5 + 0x4e48)) + *(longlong *)(lVar4 + 0x4e40)

+           );

+  if ((((byte)p_Var6[0x19] & 1) != 0) && (((byte)p_Var6[0x19] & 2) == 0)) {

+    bVar3 = IS_USERCRIT_OWNED_SHAREDONLY();

+    if (bVar3) {

+      DomainShared<>::DomainExclusive<DLT_THREADLOCK>::ObjectLock<>::ObjectLock<>

+                ((ObjectLock<> *)local_48);

+      LockIntoSharedUserCritDeferredUnlockList(param_1);

+      if ((local_20 != '\0') && (local_48[0] != (undefined8 *)0x0)) {

+        ExReleaseResourceAndLeaveCriticalRegion(*local_48[0]);

+        return (uint *)0x0;

       }

     }

-    else if (_Var6 == 0) {

-      if (*(longlong *)(param_1 + 0x30) != 0) {

-        local_res10 = *(longlong *)(param_1 + 0x30);

-        memmove((void *)(((ulonglong)(uint)(*(int *)(this + 0x248) + *(int *)(this + 0x24c)) %

-                         *(ulonglong *)(this + 0x238)) * *(size_t *)(this + 0x240) +

-                        *(longlong *)(this + 0x220)),&local_res10,*(size_t *)(this + 0x240));

-        *(int *)(this + 0x24c) = *(int *)(this + 0x24c) + 1;

-        *(int *)(this + 0x250) = *(int *)(this + 0x250) + -1;

-        *(undefined8 *)(param_1 + 0x30) = 0;

+    else {

+      lVar4 = W32GetUserSessionState();

+      if (((*(_HANDLEENTRY **)(lVar4 + 0x4dc8) != (_HANDLEENTRY *)0x0) &&

+          (p_Var6 != *(_HANDLEENTRY **)(lVar4 + 0x4dc8))) && (*(int *)(lVar4 + 0x4dc4) == 0)) {

+        *(int *)(lVar4 + 0x4dd0) = *(int *)(lVar4 + 0x4dd0) + 1;

+        LockIntoExclusiveUserCritDeferredUnlockList(param_1);

+        return (uint *)0x0;

       }

-      if ((*(uint *)(param_1 + 0x10) & 4) != 0) {

-        local_20 = 0;

-        lVar8 = 0;

-        local_28 = param_1;

-        lVar7 = RtlLookupElementGenericTable(this + 0x120,&local_28);

-        if (lVar7 != 0) {

-          lVar8 = *(longlong *)(lVar7 + 8);

-          RtlDeleteElementGenericTable(this + 0x120,lVar7);

-        }

-        *(uint *)(param_1 + 0x10) = *(uint *)(param_1 + 0x10) & 0xfffffffb;

-        *(undefined8 *)(lVar8 + 0x10) = 0;

-      }

-      if (*(longlong *)(param_1 + 0x28) != 0) {

-        UnbindAllAnimations(this,param_1);

-      }

-      if ((*(uint *)(param_1 + 0x10) & 1) == 0) {

-        if (*(int *)(this + 0x18) < 3) {

-          uVar10 = *(uint *)(param_1 + 0x24);

-          for (uVar1 = uVar10; uVar1 < 0xbe;

-              uVar1 = *(uint *)(&DAT_0 + (ulonglong)uVar1 * 4)) {

-            if (uVar1 == 0x9c) {

-              lVar8 = 0x1d0;

-              goto LAB_1;

-            }

-          }

-          for (; uVar10 < 0xbe; uVar10 = *(uint *)(&DAT_0 + (ulonglong)uVar10 * 4)) {

-            if (uVar10 == 0x1c) {

-              lVar8 = 0x1e0;

-              goto LAB_1;

-            }

-          }

-          lVar8 = 0x1c0;

-LAB_1:

-          pCVar11 = this + lVar8;

-          while (pCVar2 = *(CResourceMarshaler **)pCVar11, pCVar2 != (CResourceMarshaler *)0x0) {

-            if (pCVar2 == param_1) {

-              *(longlong *)pCVar11 = *(longlong *)(param_1 + 8);

-              *(undefined8 *)(param_1 + 8) = 0;

-              break;

-            }

-            pCVar11 = (CApplicationChannel *)(pCVar2 + 8);

-          }

-        }

-      }

-      else if ((*(uint *)(param_1 + 0x10) & 2) != 0) {

-        uVar10 = *(uint *)(param_1 + 0x24);

-        for (uVar1 = uVar10; uVar1 < 0xbe; uVar1 = *(uint *)(&DAT_0 + (ulonglong)uVar1 * 4))

-        {

-          if (uVar1 == 0x9c) {

-            lVar8 = 0x1d8;

-            goto LAB_2;

-          }

-        }

-        for (; uVar10 < 0xbe; uVar10 = *(uint *)(&DAT_0 + (ulonglong)uVar10 * 4)) {

-          if (uVar10 == 0x1c) {

-            lVar8 = 0x1e8;

-            goto LAB_2;

-          }

-        }

-        lVar8 = 0x1c8;

-LAB_2:

-        pCVar11 = this + lVar8;

-        while (pCVar2 = *(CResourceMarshaler **)pCVar11, pCVar2 != (CResourceMarshaler *)0x0) {

-          if (pCVar2 == param_1) {

-            *(longlong *)pCVar11 = *(longlong *)(param_1 + 8);

-            *(undefined8 *)(param_1 + 8) = 0;

-            break;

-          }

-          pCVar11 = (CApplicationChannel *)(pCVar2 + 8);

-        }

-        *(uint *)(param_1 + 0x10) = *(uint *)(param_1 + 0x10) & 0xfffffffd;

-      }

-      lVar8 = (**(code **)(*(longlong *)param_1 + 0x68))(param_1);

-      if (((lVar8 != 0) &&

-          (this_00 = *(CAnimationTimeList **)(lVar8 + 0x50), this_00 != (CAnimationTimeList *)0x0))

-         && (((byte)*(undefined4 *)(this_00 + 0x18) & 3) == 1)) {

-        for (pCVar13 = (CAnimationTimeList *)(this + 0x1f8);

-            *(CAnimationTimeList **)pCVar13 != this_00;

-            pCVar13 = *(CAnimationTimeList **)pCVar13 + 8) {

-        }

-        *(undefined8 *)pCVar13 = *(undefined8 *)(this_00 + 8);

-        *(undefined8 *)(this_00 + 8) = 0;

-        CAnimationTimeList::Release(this_00);

-      }

-      uVar12 = (ulonglong)(*(int *)(param_1 + 0x20) - 1);

-      if ((*(int *)(param_1 + 0x20) != 0) && (uVar12 < *(ulonglong *)(this + 0x90))) {

-        local_res10 = 0;

-        memmove((void *)(*(size_t *)(this + 0x98) * uVar12 + *(longlong *)(this + 0x78)),

-                &local_res10,*(size_t *)(this + 0x98));

-        *(longlong *)(this + 0xa0) = *(longlong *)(this + 0xa0) + -1;

-      }

-      lVar8 = (**(code **)(*(longlong *)param_1 + 0x80))(param_1);

-      if (lVar8 != 0) {

-        plVar9 = (longlong *)(lVar8 + 0x178);

-        lVar7 = *plVar9;

-        if ((*(longlong **)(lVar7 + 8) != plVar9) ||

-           (plVar3 = *(longlong **)(lVar8 + 0x180), (longlong *)*plVar3 != plVar9)) {

-          pcVar4 = (code *)swi(0x29);

-          (*pcVar4)(3);

-          pcVar4 = (code *)swi(3);

-          _Var6 = (*pcVar4)();

-          return _Var6;

-        }

-        *plVar3 = lVar7;

-        *(longlong **)(lVar7 + 8) = plVar3;

-        *(longlong **)(lVar8 + 0x180) = plVar9;

-        *plVar9 = (longlong)plVar9;

-      }

-      if (*(longlong *)(this + 0x218) == 0) {

-        *(CResourceMarshaler **)(this + 0x218) = param_1;

-        *(CResourceMarshaler **)(this + 0x210) = param_1;

-        do {

-          (**(code **)(*(longlong *)param_1 + 0xd8))(param_1,this);

-          *(longlong *)(this + 0x210) = *(longlong *)(param_1 + 8);

-          if ((*(uint *)(param_1 + 0x10) & 1) == 0) {

-            cVar5 = (**(code **)(*(longlong *)param_1 + 0x20))(param_1);

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

-              CConnection::ReleaseShellResourceAccess(*(CConnection **)(this + 0x28),1);

-            }

-            *(longlong *)(param_1 + 8) = 0;

-            (**(code **)(*(longlong *)param_1 + 0x60))(param_1,1);

-          }

-          else {

-            *(longlong *)(param_1 + 8) = *(longlong *)(this + 0x1f0);

-            *(CResourceMarshaler **)(this + 0x1f0) = param_1;

-          }

-          param_1 = *(CResourceMarshaler **)(this + 0x210);

-        } while (param_1 != (CResourceMarshaler *)0x0);

-        *(undefined8 *)(this + 0x218) = 0;

-      }

-      else {

-        *(CResourceMarshaler **)(*(longlong *)(this + 0x218) + 8) = param_1;

-        *(CResourceMarshaler **)(this + 0x218) = param_1;

-      }

+      HMDestroyUnlockedObjectWorker(p_Var6);

     }

+    param_1 = (uint *)0x0;

   }

-  return _Var6;

+  return param_1;

 }
```

## `<lambda_c820352fe8162641e9666e92528d8056>::<lambda_invoker_cdecl>`  (modified)

```diff
--- <lambda_c820352fe8162641e9666e92528d8056>::<lambda_invoker_cdecl>
+++ <lambda_29b2d42dcc04ebbd26f1f321e4dfe9ad>::<lambda_invoker_cdecl>
@@ -1,11 +1,18 @@
 

-void `DrvChangeDisplaySettings'::__l2::AUTO_KM::<lambda_invoker_cdecl>(void)

+bool <lambda_29b2d42dcc04ebbd26f1f321e4dfe9ad>::<lambda_invoker_cdecl>(longlong param_1)

 

 {

-  code *pcVar1;

+  int iVar1;

+  bool bVar2;

   

-  pcVar1 = (code *)swi(3);

-  (*pcVar1)();

-  return;

+  iVar1 = Feature_UIPIModernization__private_IsEnabledDeviceUsageNoInline();

+  if (iVar1 == 0) {

+    bVar2 = 0x1fff < *(uint *)(param_1 + 0x130U);

+  }

+  else {

+    bVar2 = UIPrivilegeIsolation::MeetsUIPIThreshold

+                      ((UIPIAccessor *)(-(ulonglong)(param_1 != 0) & param_1 + 0x130U),0x2000);

+  }

+  return bVar2;

 }
```

## `NTOSKRNL.EXE::RtlGetDaclSecurityDescriptor`  (modified)

```diff
--- NTOSKRNL.EXE::RtlGetDaclSecurityDescriptor calling
+++ NTOSKRNL.EXE::RtlGetDaclSecurityDescriptor calling
@@ -1 +0,0 @@
-AddCapabilityToDescriptor
@@ -4 +2,0 @@
-RemoveCapabilityFromDescriptor
```

## `NTOSKRNL.EXE::RtlLookupElementGenericTableAvl`  (modified)

```diff
--- NTOSKRNL.EXE::RtlLookupElementGenericTableAvl calling
+++ NTOSKRNL.EXE::RtlLookupElementGenericTableAvl calling
@@ -3,2 +2,0 @@
-UserCheckForMessageAccessWithWindowCapability
-UserSetWindowMessageCapability
```

## `NTOSKRNL.EXE::PsGetThreadId`  (modified)

```diff
--- NTOSKRNL.EXE::PsGetThreadId calling
+++ NTOSKRNL.EXE::PsGetThreadId calling
@@ -15,2 +14,0 @@
-EtwTraceUIPIHookError
-EtwTraceUIPIInputError
```

## `NTOSKRNL.EXE::RtlInsertElementGenericTableAvl`  (modified)

```diff
--- NTOSKRNL.EXE::RtlInsertElementGenericTableAvl calling
+++ NTOSKRNL.EXE::RtlInsertElementGenericTableAvl calling
@@ -2 +1,0 @@
-UserSetWindowMessageCapability
```

## `NTOSKRNL.EXE::PsGetCurrentThreadWin32Thread`  (modified)

```diff
--- NTOSKRNL.EXE::PsGetCurrentThreadWin32Thread calling
+++ NTOSKRNL.EXE::PsGetCurrentThreadWin32Thread calling
@@ -16,0 +17 @@
+NtUserGetKeyboardState
```

## `NTOSKRNL.EXE::RtlAddAce`  (modified)

```diff
--- NTOSKRNL.EXE::RtlAddAce calling
+++ NTOSKRNL.EXE::RtlAddAce calling
@@ -1 +0,0 @@
-AddCapabilityToDescriptor
```

## `NTOSKRNL.EXE::RtlEqualSid`  (modified)

```diff
--- NTOSKRNL.EXE::RtlEqualSid calling
+++ NTOSKRNL.EXE::RtlEqualSid calling
@@ -1 +0,0 @@
-FindAceIndex
```

## `WIN32K.SYS::W32GetUserSessionState`  (modified)

```diff
--- WIN32K.SYS::W32GetUserSessionState calling
+++ WIN32K.SYS::W32GetUserSessionState calling
@@ -602 +601,0 @@
-InitProcessUipiInfo
@@ -1204 +1202,0 @@
-UserCheckForMessageAccessWithWindowCapability
@@ -1249,2 +1246,0 @@
-UserSetUserObjectCapability
-UserSetWindowMessageCapability
@@ -1264 +1260 @@
-W32ExecuteUsingSessionGlobal<<lambda_9934c91aed3c134dc886b5a0e8583d8e>_>
+W32ExecuteUsingSessionGlobal<<lambda_c59363ad343e86bc7704f64e0a12f585>_>
@@ -1453,0 +1450 @@
+tagPROCESSINFO::InitProcessUipiInfo
@@ -1457,0 +1455,2 @@
+tagQ::Alloc
+tagQ::InitializeState
```

## `NTOSKRNL.EXE::KeIsAttachedProcess`  (modified)

```diff
--- NTOSKRNL.EXE::KeIsAttachedProcess calling
+++ NTOSKRNL.EXE::KeIsAttachedProcess calling
@@ -36 +35,0 @@
-GrepReleaseLockValidate<20>
```

## `NTOSKRNL.EXE::PsGetCurrentThreadProcess`  (modified)

```diff
--- NTOSKRNL.EXE::PsGetCurrentThreadProcess calling
+++ NTOSKRNL.EXE::PsGetCurrentThreadProcess calling
@@ -35 +34,0 @@
-GrepReleaseLockValidate<20>
```

## `WIN32K.SYS::W32GetUserGdiSessionState`  (modified)

```diff
--- WIN32K.SYS::W32GetUserGdiSessionState calling
+++ WIN32K.SYS::W32GetUserGdiSessionState calling
@@ -48,2 +47,0 @@
-RecalculateQueueInfo
-RecalculateQueueInfo2
@@ -82,0 +81,2 @@
+tagQ::InitUIPIFromThread
+tagQ::RecalcUIPI
```

## `NTOSKRNL.EXE::RtlSetDaclSecurityDescriptor`  (modified)

```diff
--- NTOSKRNL.EXE::RtlSetDaclSecurityDescriptor calling
+++ NTOSKRNL.EXE::RtlSetDaclSecurityDescriptor calling
@@ -1 +0,0 @@
-AddCapabilityToDescriptor
```

## `NTOSKRNL.EXE::PsGetProcessWin32Process`  (modified)

```diff
--- NTOSKRNL.EXE::PsGetProcessWin32Process calling
+++ NTOSKRNL.EXE::PsGetProcessWin32Process calling
@@ -13 +12,0 @@
-UserIsCurrentProcessImmersiveAppContainer
```

## `NTOSKRNL.EXE::PsGetThreadWin32Thread`  (modified)

```diff
--- NTOSKRNL.EXE::PsGetThreadWin32Thread calling
+++ NTOSKRNL.EXE::PsGetThreadWin32Thread calling
@@ -40 +39,0 @@
-GrepReleaseLockValidate<20>
```

## `NTOSKRNL.EXE::SeCaptureSubjectContext`  (modified)

```diff
--- NTOSKRNL.EXE::SeCaptureSubjectContext calling
+++ NTOSKRNL.EXE::SeCaptureSubjectContext calling
@@ -4 +3,0 @@
-UserCheckForMessageAccessWithWindowCapability
```

## `NTOSKRNL.EXE::RtlCreateAcl`  (modified)

```diff
--- NTOSKRNL.EXE::RtlCreateAcl calling
+++ NTOSKRNL.EXE::RtlCreateAcl calling
@@ -1 +0,0 @@
-AddCapabilityToDescriptor
```

## `NTOSKRNL.EXE::RtlLengthSid`  (modified)

```diff
--- NTOSKRNL.EXE::RtlLengthSid calling
+++ NTOSKRNL.EXE::RtlLengthSid calling
@@ -1 +0,0 @@
-AddCapabilityToDescriptor
```

## `NTOSKRNL.EXE::SeIsParentOfChildAppContainer`  (modified)

```diff
--- NTOSKRNL.EXE::SeIsParentOfChildAppContainer calling
+++ NTOSKRNL.EXE::SeIsParentOfChildAppContainer calling
@@ -1,2 +1 @@
-UIPrivilegeIsolation::CheckAccessEx
-UIPrivilegeIsolation::IsSameAppContainer
+UIPrivilegeIsolation::CheckAccess
```

## `NTOSKRNL.EXE::SeReleaseSubjectContext`  (modified)

```diff
--- NTOSKRNL.EXE::SeReleaseSubjectContext calling
+++ NTOSKRNL.EXE::SeReleaseSubjectContext calling
@@ -5 +4,0 @@
-UserCheckForMessageAccessWithWindowCapability
```

## `NTOSKRNL.EXE::PsGetProcessId`  (modified)

```diff
--- NTOSKRNL.EXE::PsGetProcessId calling
+++ NTOSKRNL.EXE::PsGetProcessId calling
@@ -5,4 +4,0 @@
-EtwTraceUIPIHandleValidationError
-EtwTraceUIPIHookError
-EtwTraceUIPIInputError
-EtwTraceUIPIMsgError
```

## `NTOSKRNL.EXE::SeAccessCheck`  (modified)

```diff
--- NTOSKRNL.EXE::SeAccessCheck calling
+++ NTOSKRNL.EXE::SeAccessCheck calling
@@ -2 +1,0 @@
-UserCheckForMessageAccessWithWindowCapability
```
