# CVE-2026-119824 — mstscax.dll patch diff

`mstscax.dll` 10.0.26100.9711 -> 10.0.26100.9974 (ghidriff).

## `ValidateServerCert`  (modified)

```diff
--- ValidateServerCert
+++ ValidateServerCert
@@ -1,35 +1,73 @@
 

-void ValidateServerCert(undefined8 param_1,char *param_2)

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

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

+

+bool ValidateServerCert(undefined4 *param_1)

 

 {

-  byte bVar1;

-  uint uVar2;

+  bool bVar1;

+  undefined4 *puVar2;

   uint uVar3;

-  uint unaff_EBX;

-  int unaff_EDI;

-  ulonglong uVar4;

-  longlong unaff_R14;

-  int iVar5;

-  longlong unaff_R15;

+  undefined1 auStack_c8 [56];

+  undefined8 local_90;

+  longlong lStack_88;

+  longlong local_80;

+  longlong local_78;

+  longlong local_70;

+  ulonglong local_28;

   

-  while( true ) {

-    iVar5 = (int)unaff_R15;

-    unaff_EBX = unaff_EBX + iVar5;

-    param_2 = param_2 + unaff_R15;

-    if (0x1f < unaff_EBX) break;

-    bVar1 = *param_2 - 7U & 0x1f;

-    uVar2 = iVar5 << bVar1;

-    if (iVar5 << bVar1 != 0) {

-      uVar3 = unaff_EDI + 0x100;

-      uVar4 = (ulonglong)uVar2;

-      unaff_EDI = unaff_EDI + uVar2;

-      do {

-        *(char *)((ulonglong)uVar3 + 0x50d06 + unaff_R14) = (char)unaff_EBX;

-        uVar3 = uVar3 + iVar5;

-        uVar4 = uVar4 - unaff_R15;

-      } while (uVar4 != 0);

+  local_28 = __security_cookie ^ (ulonglong)auStack_c8;

+  local_90 = 0;

+  lStack_88 = 0;

+  local_80 = 0;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_4188256568>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_4188256568> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_4188256568>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_4188256568>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar1) {

+    if (*(ushort *)((longlong)param_1 + 0xe) < 0x14) {

+      return false;

+    }

+    uVar3 = *(uint *)(*(longlong *)(param_1 + 4) + 8);

+    if (uVar3 == 0) {

+      return false;

+    }

+    if ((uVar3 & 7) != 0) {

+      return false;

+    }

+    if (*(uint *)(*(longlong *)(param_1 + 4) + 4) < uVar3 >> 3) {

+      return false;

+    }

+    if ((uint)*(ushort *)((longlong)param_1 + 0xe) < (uVar3 >> 3) + 0x14) {

+      return false;

     }

   }

-  return;

+  uVar3 = *(ushort *)((longlong)param_1 + 0xe) + 0x10;

+  puVar2 = operator_new((ulonglong)uVar3);

+  if (puVar2 == (undefined4 *)0x0) {

+    return false;

+  }

+  *puVar2 = *param_1;

+  puVar2[1] = param_1[1];

+  puVar2[2] = param_1[2];

+  *(undefined2 *)(puVar2 + 3) = *(undefined2 *)(param_1 + 3);

+  *(undefined2 *)((longlong)puVar2 + 0xe) = *(undefined2 *)((longlong)param_1 + 0xe);

+  memcpy(puVar2 + 4,*(void **)(param_1 + 4),(ulonglong)*(ushort *)((longlong)param_1 + 0xe));

+  RDP_MD5Init(&local_90);

+  RDP_SHAUpdate(&local_90,puVar2,uVar3);

+  RDP_MD5Final(&local_90);

+  operator_delete(puVar2);

+  _DAT_0 = 0x31415352;

+  _DAT_1 = 0x48;

+  _DAT_2 = 0x200;

+  _DAT_3 = 0x3f;

+  _DAT_4 = 0xc0887b5b;

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

+  RDP_RsaBSafeEncPublic(&DAT_0,0x5c,*(undefined8 *)(param_1 + 7),&local_78);

+  local_78 = local_78 - lStack_88;

+  if (local_78 == 0) {

+    local_78 = local_70 - local_80;

+  }

+  return local_78 == 0;

 }
```

## `TLSVerifyProprietyChainedCertificate`  (modified)

```diff
--- TLSVerifyProprietyChainedCertificate
+++ TLSVerifyProprietyChainedCertificate
@@ -1,33 +1,165 @@
 

-/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

-   guard_dispatch_icall */

-

-undefined4 TLSVerifyProprietyChainedCertificate(void)

+int TLSVerifyProprietyChainedCertificate

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

 

 {

-  longlong *plVar1;

-  undefined4 uVar2;

-  undefined **ppuVar3;

-  undefined4 unaff_EBX;

-  longlong unaff_RBP;

+  bool bVar1;

+  BOOL BVar2;

+  PCCERT_CONTEXT pCertContext;

+  PCCERT_CONTEXT pCVar3;

+  HLOCAL pvVar4;

+  uint uVar5;

+  uint uVar6;

+  int iVar7;

+  int iVar8;

+  uint uVar9;

+  PCCERT_CONTEXT pSubject;

+  uint *puVar10;

+  uint uVar11;

+  int iVar12;

+  uint *puVar13;

+  ulonglong local_res8;

+  DWORD local_res10 [2];

   

-  ppuVar3 = (undefined **)(ulonglong)(uint)WPP_GLOBAL_Control;

-  if (((ppuVar3 != &WPP_GLOBAL_Control) && ((*(byte *)((longlong)ppuVar3 + 0x1c) & 8) != 0)) &&

-     (1 < *(byte *)((longlong)ppuVar3 + 0x19))) {

-    uVar2 = RdpX_GetActivityIdPrefix();

-    WPP_SF_Dsd(*(undefined8 *)(CONCAT44(WPP_GLOBAL_Control._4_4_,(uint)WPP_GLOBAL_Control) + 0x10),

-               0x71,&WPP_3ae206c6a2f43105dec3f898d3e95836_Traceguids,uVar2,

-               "CacheDatabase: failed to get GPU texture data in BitmapDataGPUToCPU()");

+  local_res8 = param_1 & 0xffffffff00000000;

+  local_res10[0] = 3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_2739128634>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_2739128634> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_2739128634>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_2739128634>::GetImpl(void)'

+                      ::__l2::impl);

+  if ((bVar1) && (param_4 != (undefined8 *)0x0)) {

+    *param_4 = 0;

   }

-  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

-            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)(unaff_RBP + 0x48));

-  plVar1 = *(longlong **)(unaff_RBP + 0x50);

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

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

-    (**(code **)(*plVar1 + 8))();

+  if (((param_2 != (uint *)0x0) && (0x3f < param_3)) && ((*param_2 & 0xfffffff) < 3)) {

+    uVar9 = param_2[1];

+    if ((uVar9 - 2 < 199) && ((ulonglong)uVar9 * 8 + 8 <= (ulonglong)param_3)) {

+      uVar11 = 0;

+      puVar13 = param_2 + 2;

+      uVar6 = 8;

+      puVar10 = puVar13;

+      if (uVar9 != 0) {

+        do {

+          uVar5 = uVar6 + 4;

+          if (uVar5 < uVar6) {

+            return 3;

+          }

+          if (param_3 < uVar5) {

+            return 3;

+          }

+          uVar6 = uVar5 + *puVar10;

+          if (uVar6 < uVar5) {

+            return 3;

+          }

+          if (param_3 < uVar6) {

+            return 3;

+          }

+          uVar11 = uVar11 + 1;

+          puVar10 = (uint *)((longlong)puVar10 + (ulonglong)*puVar10 + 4);

+        } while (uVar11 < uVar9);

+      }

+      pCertContext = CertCreateCertificateContext(0x10001,(BYTE *)(param_2 + 3),*puVar13);

+      if (pCertContext == (PCCERT_CONTEXT)0x0) {

+        return 0x10;

+      }

+      wil::details::FeatureImpl<__WilFeatureTraits_Feature_2739128634>::__private_IsEnabled

+                ((FeatureImpl<__WilFeatureTraits_Feature_2739128634> *)

+                 &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_2739128634>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_2739128634>::GetImpl(void)'

+                  ::__l2::impl);

+      pCVar3 = CertDuplicateCertificateContext(pCertContext);

+      uVar9 = 0;

+      iVar7 = 0;

+      iVar12 = 7;

+      iVar8 = iVar12;

+      if (param_2[1] != 0) {

+        do {

+          pSubject = pCVar3;

+          if (pSubject == (PCCERT_CONTEXT)0x0) {

+            iVar8 = 0x10;

+LAB_0:

+            pCVar3 = pSubject;

+            iVar7 = iVar8;

+            if (pCertContext == (PCCERT_CONTEXT)0x0) goto LAB_1;

+            break;

+          }

+          local_res10[0] = 1;

+          BVar2 = CertVerifySubjectCertificateContext(pSubject,pCertContext,local_res10);

+          if (BVar2 == 0) goto LAB_0;

+          if (local_res10[0] != 0) {

+            iVar8 = 3;

+            goto LAB_0;

+          }

+          BVar2 = CertFreeCertificateContext(pCertContext);

+          if (BVar2 == 0) goto LAB_0;

+          puVar13 = (uint *)((longlong)puVar13 + (ulonglong)*puVar13 + 4);

+          pCVar3 = CertCreateCertificateContext(0x10001,(BYTE *)(puVar13 + 1),*puVar13);

+          uVar9 = uVar9 + 1;

+          pCertContext = pSubject;

+        } while (uVar9 < param_2[1]);

+      }

+      iVar8 = iVar7;

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

+        bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_2739128634>::

+                __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_2739128634> *)

+                                    &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_2739128634>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_2739128634>::GetImpl(void)'

+                                     ::__l2::impl);

+        if (bVar1) {

+          if (iVar7 == 0) {

+            BVar2 = CryptDecodeObject(1,(LPCSTR)0x13,

+                                      (pCertContext->pCertInfo->SubjectPublicKeyInfo).PublicKey.

+                                      pbData,(pCertContext->pCertInfo->SubjectPublicKeyInfo).

+                                             PublicKey.cbData,1,(void *)0x0,(DWORD *)&local_res8);

+            iVar8 = iVar12;

+            if ((BVar2 != 0) &&

+               (pvVar4 = LocalAlloc(0x40,local_res8 & 0xffffffff), iVar8 = 1, pvVar4 != (HLOCAL)0x0)

+               ) {

+              BVar2 = CryptDecodeObject(1,(LPCSTR)0x13,

+                                        (pCertContext->pCertInfo->SubjectPublicKeyInfo).PublicKey.

+                                        pbData,(pCertContext->pCertInfo->SubjectPublicKeyInfo).

+                                               PublicKey.cbData,1,pvVar4,(DWORD *)&local_res8);

+              if (BVar2 == 0) {

+                LocalFree(pvVar4);

+                iVar8 = 7;

+              }

+              else {

+                *param_4 = pvVar4;

+                iVar8 = iVar7;

+              }

+            }

+          }

+        }

+        else {

+          BVar2 = CryptDecodeObject(1,(LPCSTR)0x13,

+                                    (pCertContext->pCertInfo->SubjectPublicKeyInfo).PublicKey.pbData

+                                    ,(pCertContext->pCertInfo->SubjectPublicKeyInfo).PublicKey.

+                                     cbData,1,(void *)0x0,(DWORD *)&local_res8);

+          if (BVar2 == 0) {

+            iVar7 = iVar12;

+          }

+          pvVar4 = LocalAlloc(0x40,local_res8 & 0xffffffff);

+          *param_4 = pvVar4;

+          iVar8 = iVar7;

+          if (pvVar4 != (HLOCAL)0x0) {

+            BVar2 = CryptDecodeObject(1,(LPCSTR)0x13,

+                                      (pCertContext->pCertInfo->SubjectPublicKeyInfo).PublicKey.

+                                      pbData,(pCertContext->pCertInfo->SubjectPublicKeyInfo).

+                                             PublicKey.cbData,1,pvVar4,(DWORD *)&local_res8);

+            if (BVar2 == 0) {

+              LocalFree((HLOCAL)*param_4);

+            }

+            iVar8 = 0;

+          }

+        }

+      }

+      CertFreeCertificateContext(pCertContext);

+      pSubject = pCVar3;

+LAB_1:

+      if (pSubject != (PCCERT_CONTEXT)0x0) {

+        CertFreeCertificateContext(pSubject);

+        return iVar8;

+      }

+      return iVar8;

+    }

   }

-  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

-            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)(unaff_RBP + 0x40));

-  return unaff_EBX;

+  return 3;

 }
```

## `GetInstanceOfRedirectPromptDlg2`  (modified)

```diff
--- GetInstanceOfRedirectPromptDlg2
+++ GetInstanceOfRedirectPromptDlg2
@@ -1,36 +1,37 @@
 

-/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

-   guard_dispatch_icall */

+/* long __cdecl GetInstanceOfRedirectPromptDlg2(struct HINSTANCE__ * __ptr64,class ITSWin32CoreApi *

+   __ptr64,class ITSWin32CoreApiNotifySink * __ptr64,struct IRedirectPromptDlg2ViewModel *

+   __ptr64,struct IRedirectPromptDlg2 * __ptr64 * __ptr64) */

 

 long __cdecl

 GetInstanceOfRedirectPromptDlg2

-          (HINSTANCE__ *param_1,ITSWin32CoreApiNotifySink *param_2,

-          IRedirectPromptDlg2ViewModel *param_3,IRedirectPromptDlg2 **param_4)

+          (HINSTANCE__ *param_1,ITSWin32CoreApi *param_2,ITSWin32CoreApiNotifySink *param_3,

+          IRedirectPromptDlg2ViewModel *param_4,IRedirectPromptDlg2 **param_5)

 

 {

-  longlong *plVar1;

-  long lVar2;

-  longlong unaff_RSI;

-  longlong *unaff_RDI;

-  void *in_stack_00000028;

+  long lVar1;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res8;

+  ITSWin32CoreApi *local_res10;

+  ITSWin32CoreApiNotifySink *local_res18;

+  IRedirectPromptDlg2ViewModel *local_res20;

   

-  lVar2 = wil::init_once_nothrow<<lambda_3aefe2359e8f3a3fbebfda9470c97c7d>_>(param_1 + 0xc);

-  if (lVar2 < 0) {

+  local_res8 = param_1;

+  local_res10 = param_2;

+  local_res18 = param_3;

+  local_res20 = param_4;

+  if (param_5 == (IRedirectPromptDlg2 **)0x0) {

     wil::details::in1diag3::Return_Hr

-              (in_stack_00000028,0x6f8,

-               "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              (unaff_retaddr,0xa5,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2.cpp",

+               -0x7fffbffd);

+    lVar1 = -0x7fffbffd;

   }

   else {

-    plVar1 = *(longlong **)(unaff_RSI + 0x28);

-    if (plVar1 == (longlong *)0x0) {

-      *unaff_RDI = 0;

-    }

-    else {

-      *unaff_RDI = (longlong)plVar1;

-      (**(code **)(*plVar1 + 8))();

-    }

-    lVar2 = 0;

+    *param_5 = (IRedirectPromptDlg2 *)0x0;

+    lVar1 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptDlg2,IRedirectPromptDlg2,HINSTANCE__*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,ITSWin32CoreApiNotifySink*___ptr64&___ptr64,IRedirectPromptDlg2ViewModel*___ptr64&___ptr64>

+                      (param_5,&local_res8,&local_res10,&local_res18,&local_res20);

   }

-  return lVar2;

+  return lVar1;

 }
```

## `RDP_RsaBSafeEncPublic`  (modified)

```diff
--- RDP_RsaBSafeEncPublic
+++ RDP_RsaBSafeEncPublic
@@ -1,61 +1,76 @@
 

-undefined4 RDP_RsaBSafeEncPublic(longlong param_1,longlong param_2)

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

+

+undefined8 RDP_RsaBSafeEncPublic(undefined4 *param_1,uint param_2,uchar *param_3,uchar *param_4)

 

 {

-  short sVar1;

-  undefined4 uVar2;

-  uint uVar3;

-  char *in_RAX;

-  undefined4 unaff_EBX;

-  int unaff_EBP;

-  uint unaff_ESI;

-  uint unaff_EDI;

-  uchar *unaff_R12;

-  int unaff_R14D;

-  undefined2 *unaff_R15;

-  uchar *in_stack_000000a0;

-  uint in_stack_000000c0;

-  int *in_stack_000000e8;

-  _MATCH *in_stack_00000120;

+  bool bVar1;

+  int iVar2;

+  NTSTATUS NVar3;

+  uint uVar4;

+  undefined8 uVar5;

+  undefined8 uVar6;

+  undefined1 auStackY_1b8 [32];

+  uint local_168 [2];

+  BCRYPT_KEY_HANDLE local_160;

+  undefined4 local_158;

+  uint local_154;

+  int local_150;

+  uint local_14c;

+  undefined4 local_148;

+  undefined4 local_144;

+  uchar local_140 [264];

+  ulonglong local_38;

   

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

-  if (((param_1 != param_2) && ((*(byte *)(param_1 + 0x1c) & 1) != 0)) &&

-     (3 < *(byte *)(param_1 + 0x19))) {

-    uVar2 = RdpX_GetActivityIdPrefix();

-    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x20,

-             &WPP_bc04a6db45e431e98a6307c9e8bea6c9_Traceguids,uVar2);

-  }

-  uVar3 = Planar::CompressV2<32,unsigned_long,4,4294967295>

-                    (in_stack_000000a0,(uchar *)(unaff_R15 + 4),unaff_ESI,unaff_R14D * 4,

-                     unaff_EBP - 8,unaff_R12,in_stack_000000c0,in_stack_00000120);

-  if (uVar3 == 0) {

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

-        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

-      uVar2 = RdpX_GetActivityIdPrefix();

-      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x26,

-               &WPP_bc04a6db45e431e98a6307c9e8bea6c9_Traceguids,uVar2);

+  local_38 = __security_cookie ^ (ulonglong)auStackY_1b8;

+  local_160 = (BCRYPT_KEY_HANDLE)0x0;

+  uVar6 = 0;

+  uVar5 = 0;

+  if ((param_1 != (undefined4 *)0x0) && (0x13 < param_2)) {

+    iVar2 = RsaBCryptInitAlgHandle();

+    if (iVar2 != 0) {

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

+      if ((uint)param_1[2] < 0x801) {

+        bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_4188256568>::

+                __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_4188256568> *)

+                                    &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_4188256568>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_4188256568>::GetImpl(void)'

+                                     ::__l2::impl);

+        if ((!bVar1) ||

+           (((uVar4 = param_1[2], uVar4 != 0 && (uVar6 = uVar5, (uVar4 & 7) == 0)) &&

+            (uVar4 >> 3 <= (uint)param_1[1])))) {

+          local_158 = *param_1;

+          uVar4 = param_1[2];

+          local_150 = 4;

+          local_154 = uVar4;

+          RDP_ReverseMemoryCopy(local_140,(uchar *)(param_1 + 4),4);

+          local_14c = uVar4 >> 3;

+          uVar4 = local_150 + 0x18;

+          RDP_ReverseMemoryCopy

+                    ((uchar *)((longlong)&local_158 + (ulonglong)uVar4),(uchar *)(param_1 + 5),

+                     local_14c);

+          local_148 = 0;

+          local_144 = 0;

+          NVar3 = BCryptImportKeyPair(g_hRSAAlg,(BCRYPT_KEY_HANDLE)0x0,L"RSAPUBLICBLOB",&local_160,

+                                      (PUCHAR)&local_158,uVar4 + local_14c,0);

+          uVar6 = uVar5;

+          if (NVar3 == 0) {

+            local_168[0] = local_14c;

+            uVar4 = local_14c;

+            RDP_ReverseMemoryCopy(param_4,param_3,local_14c);

+            NVar3 = BCryptEncrypt(local_160,param_4,uVar4,(void *)0x0,(PUCHAR)0x0,0,param_4,uVar4,

+                                  local_168,1);

+            if (NVar3 == 0) {

+              RDP_InPlaceReverse(param_4,local_168[0]);

+              uVar6 = 1;

+            }

+          }

+        }

+      }

+    }

+    if (local_160 != (BCRYPT_KEY_HANDLE)0x0) {

+      BCryptDestroyKey(local_160);

     }

   }

-  else {

-    *unaff_R15 = (short)unaff_EBX;

-    unaff_R15[1] = (short)uVar3;

-    if (unaff_EDI < 9) {

-      sVar1 = (short)unaff_R14D;

-    }

-    else {

-      sVar1 = (short)((unaff_EDI + 3 & 0xfffffffc) * unaff_R14D + 0x1f >> 5) << 2;

-    }

-    unaff_R15[2] = sVar1;

-    unaff_R15[3] = (short)unaff_ESI;

-    *in_stack_000000e8 = uVar3 + 8;

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

-        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

-      uVar2 = RdpX_GetActivityIdPrefix();

-      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x25,

-                &WPP_bc04a6db45e431e98a6307c9e8bea6c9_Traceguids,uVar2,uVar3 + 8);

-    }

-    unaff_EBX = 1;

-  }

-  return unaff_EBX;

+  return uVar6;

 }
```

## `LicenseEnvelopeData`  (modified)

```diff
--- LicenseEnvelopeData
+++ LicenseEnvelopeData
@@ -1,16 +1,57 @@
 

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

-

-void LicenseEnvelopeData(longlong param_1)

+undefined4

+LicenseEnvelopeData(longlong param_1,uint param_2,void *param_3,uint param_4,void *param_5,

+                   uint *param_6)

 

 {

-  byte unaff_BH;

+  bool bVar1;

+  uint uVar2;

+  uint uVar3;

+  int iVar4;

+  void *_Dst;

+  uint uVar5;

+  ulonglong _Size;

   

-  if ((char)(*(byte *)(param_1 + -0x80000000) & unaff_BH) < '\0') {

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

-    halt_baddata();

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

+    if (param_1 != 0) {

+      uVar2 = RDP_RsaGetPublicKeyLength();

+      _Size = (ulonglong)uVar2;

+      uVar3 = RDP_RsaGetPublicKeyDataLength();

+      bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_4188256568>::__private_IsEnabled

+                        ((FeatureImpl<__WilFeatureTraits_Feature_4188256568> *)

+                         &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_4188256568>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_4188256568>::GetImpl(void)'

+                          ::__l2::impl);

+      if ((!bVar1) ||

+         ((((0x13 < param_2 && (uVar5 = *(uint *)(param_1 + 8) >> 3, uVar5 != 0)) &&

+           ((*(byte *)(param_1 + 8) & 7) == 0)) && ((uVar5 <= uVar2 && (uVar5 + 0x14 <= param_2)))))

+         ) {

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

+LAB_0:

+          *param_6 = uVar2;

+          return 0;

+        }

+        if (((param_3 != (void *)0x0) && (param_4 <= uVar3)) &&

+           ((uVar3 <= uVar2 && (uVar2 <= *param_6)))) {

+          *param_6 = 0;

+          _Dst = malloc(_Size);

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

+            return 1;

+          }

+          memset(_Dst,0,_Size);

+          memcpy(_Dst,param_3,(ulonglong)param_4);

+          memset(param_5,0,_Size);

+          iVar4 = RDP_RsaBSafeEncPublic(param_1,param_2,_Dst,param_5);

+          if (iVar4 == 0) {

+            free(_Dst);

+            return 3;

+          }

+          free(_Dst);

+          goto LAB_0;

+        }

+      }

+    }

+    *param_6 = 0;

   }

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

-  halt_baddata();

+  return 3;

 }
```

## `CRedirectPromptDlg2::CRedirectPromptDlg2`  (modified)

```diff
--- CRedirectPromptDlg2::CRedirectPromptDlg2
+++ CRedirectPromptDlg2::CRedirectPromptDlg2
@@ -1,2 +1,23 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptDlg2::CRedirectPromptDlg2 : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: __cdecl CRedirectPromptDlg2::CRedirectPromptDlg2(void) __ptr64 */

+

+CRedirectPromptDlg2 * __thiscall CRedirectPromptDlg2::CRedirectPromptDlg2(CRedirectPromptDlg2 *this)

+

+{

+  *(undefined4 *)(this + 0xc) = 1;

+  *(undefined ***)this =

+       &Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<2>,IRedirectPromptDlg2>::

+        _vftable_;

+  if (Microsoft::WRL::Details::ModuleBase::module_ != (ModuleBase *)0x0) {

+    (**(code **)(*(longlong *)Microsoft::WRL::Details::ModuleBase::module_ + 8))();

+  }

+  *(undefined8 *)(this + 0x10) = 0;

+  *(undefined ***)this = &_vftable_;

+  *(undefined8 *)(this + 0x18) = 0;

+  *(undefined8 *)(this + 0x20) = 0;

+  *(undefined8 *)(this + 0x28) = 0;

+  return this;

+}

+
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPortsPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPortsPermissionItem>
+++ CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPortsPermissionItem>
@@ -1,2 +1,126 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPortsPermissionItem> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

+   CRedirectPromptPortsPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi * __ptr64,class

+   ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPortsPermissionItem>

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int *param_5)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  uint uVar4;

+  CRedirectPromptPortsPermissionItem *pCVar5;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res10;

+  ITSCoreApi *local_res18;

+  ITSWin32CoreApi *local_res20;

+  int *in_stack_ffffffffffffffd0;

+  CRedirectPromptBasePermissionItem *local_28;

+  CRedirectPromptPortsPermissionItem *local_20;

+  

+  local_res10 = param_1;

+  local_res18 = param_2;

+  local_res20 = param_3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  local_20 = (CRedirectPromptPortsPermissionItem *)0x0;

+  if (bVar1) {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptPortsPermissionItem,CRedirectPromptPortsPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) {

+LAB_0:

+      pCVar5 = local_20;

+      param_5._0_4_ = 0;

+      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

+                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

+      if (lVar2 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x36f,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+LAB_1:

+      }

+      else {

+        if ((int)param_5 != 0) {

+          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

+          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

+                                    &_GUID_00000000_0000_0000_c000_000000000046);

+          if (iVar3 == 0) {

+            iVar3 = InlineIsEqualGUID();

+            if (iVar3 == 0) {

+              iVar3 = InlineIsEqualGUID();

+              if (iVar3 != 0) {

+                pCVar5 = pCVar5 + 8;

+                goto LAB_2;

+              }

+              lVar2 = -0x7fffbffe;

+            }

+            else {

+LAB_2:

+              lVar2 = 0;

+              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+            }

+            if (lVar2 < 0) {

+              wil::details::in1diag3::Return_Hr

+                        (unaff_retaddr,0x379,

+                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+              goto LAB_1;

+            }

+          }

+          else {

+            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+          }

+          bVar1 = utl::

+                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                               *)(this + 0x28),

+                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

+                              )&local_28);

+          if (!bVar1) {

+            lVar2 = -0x7ff8fff2;

+            wil::details::in1diag3::Return_Hr

+                      (unaff_retaddr,0x37a,

+                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

+            ;

+            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+            goto LAB_3;

+          }

+          g_wasPortsRequested = 1;

+          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+        }

+        lVar2 = 0;

+      }

+      goto LAB_3;

+    }

+    uVar4 = 0x367;

+  }

+  else {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptPortsPermissionItem,CRedirectPromptPortsPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) goto LAB_0;

+    uVar4 = 0x36b;

+  }

+  wil::details::in1diag3::Return_Hr

+            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+             lVar2);

+LAB_3:

+  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

+  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

+            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

+  return lVar2;

+}

+
```

## `CIH::IHTranslateInputToFastPath`  (modified)

```diff
--- CIH::IHTranslateInputToFastPath
+++ CIH::IHTranslateInputToFastPath
@@ -1,2 +1,125 @@
-Failed to decompile mstscax.dll - .ProgramDB CIH::IHTranslateInputToFastPath : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: unsigned int __cdecl CIH::IHTranslateInputToFastPath(unsigned int * __ptr64,unsigned

+   char * __ptr64,int) __ptr64 */

+

+uint __thiscall CIH::IHTranslateInputToFastPath(CIH *this,uint *param_1,uchar *param_2,int param_3)

+

+{

+  ushort uVar1;

+  short sVar2;

+  longlong lVar3;

+  undefined4 uVar4;

+  byte bVar5;

+  uint uVar6;

+  ulonglong uVar7;

+  uint uVar8;

+  byte *pbVar10;

+  ulonglong uVar11;

+  ulonglong uVar9;

+  

+  uVar9 = 0;

+  uVar6 = 0;

+  if (*(longlong *)(this + 0x48) == 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpX_GetActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x40,

+               &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+    }

+  }

+  else {

+    uVar1 = *(ushort *)(*(longlong *)(this + 0x48) + 0x12);

+    uVar11 = uVar9;

+    if (uVar1 < 0x10) {

+      *param_1 = (uint)uVar1;

+      uVar7 = uVar9;

+      pbVar10 = param_2;

+      if (uVar1 == 0) {

+        return 0;

+      }

+    }

+    else {

+      if (param_2 + 0xc16 <= param_2) {

+        return 0;

+      }

+      *param_2 = (uchar)uVar1;

+      uVar7 = 1;

+      pbVar10 = param_2 + 1;

+      *param_1 = 0;

+    }

+    do {

+      lVar3 = *(longlong *)(this + 0x48);

+      sVar2 = *(short *)(uVar11 + 0x1a + lVar3);

+      uVar6 = (uint)uVar7;

+      if (sVar2 == 0) {

+        if (param_2 + 0xc16 <= pbVar10) {

+          return uVar6;

+        }

+        *pbVar10 = *(byte *)(uVar11 + 0x1e + lVar3) & 0x1f | 0x60;

+        pbVar10 = pbVar10 + 1;

+        uVar7 = (ulonglong)(uVar6 + 1);

+      }

+      else if (sVar2 == 4) {

+        if (param_2 + 0xc14 < pbVar10) {

+          return uVar6;

+        }

+        bVar5 = (byte)(*(ushort *)(uVar11 + 0x1c + lVar3) >> 7) & 6;

+        *pbVar10 = bVar5;

+        if (*(short *)(uVar11 + 0x1c + *(longlong *)(this + 0x48)) < 0) {

+          *pbVar10 = bVar5 | 1;

+        }

+        pbVar10[1] = *(byte *)(uVar11 + 0x1e + *(longlong *)(this + 0x48));

+        pbVar10 = pbVar10 + 2;

+        uVar7 = (ulonglong)(uVar6 + 2);

+      }

+      else if (sVar2 == 5) {

+        if (param_2 + 0xc13 < pbVar10) {

+          return uVar6;

+        }

+        bVar5 = (byte)(*(ushort *)(uVar11 + 0x1c + lVar3) >> 7) & 6;

+        *pbVar10 = bVar5 | 0x80;

+        if (*(short *)(uVar11 + 0x1c + *(longlong *)(this + 0x48)) < 0) {

+          *pbVar10 = bVar5 | 0x81;

+        }

+        *(undefined2 *)(pbVar10 + 1) = *(undefined2 *)(uVar11 + 0x1e + *(longlong *)(this + 0x48));

+        pbVar10 = pbVar10 + 3;

+        uVar7 = (ulonglong)(uVar6 + 3);

+      }

+      else if (sVar2 == 0xa0) {

+        if (param_2 + 0xc11 < pbVar10) {

+          return uVar6;

+        }

+        *pbVar10 = 0xc0;

+        *(undefined4 *)(pbVar10 + 1) = *(undefined4 *)(uVar11 + 0x1c + *(longlong *)(this + 0x48));

+        pbVar10 = pbVar10 + 5;

+        uVar7 = (ulonglong)(uVar6 + 5);

+      }

+      else if (((sVar2 == -0x7fff) || (sVar2 == -0x7ffe)) || (sVar2 == -0x7ffc)) {

+        if (param_2 + 0xc0f < pbVar10) {

+          return uVar6;

+        }

+        if (sVar2 == -0x7fff) {

+          *pbVar10 = 0x20;

+        }

+        else {

+          bVar5 = 0xa0;

+          if (sVar2 == -0x7ffe) {

+            bVar5 = 0x40;

+          }

+          *pbVar10 = bVar5;

+        }

+        lVar3 = *(longlong *)(this + 0x48);

+        *(undefined4 *)(pbVar10 + 1) = *(undefined4 *)(uVar11 + 0x1c + lVar3);

+        *(undefined2 *)(pbVar10 + 5) = *(undefined2 *)(uVar11 + 0x20 + lVar3);

+        pbVar10 = pbVar10 + 7;

+        uVar7 = (ulonglong)(uVar6 + 7);

+      }

+      uVar6 = (uint)uVar7;

+      uVar8 = (int)uVar9 + 1;

+      uVar9 = (ulonglong)uVar8;

+      uVar11 = uVar11 + 0xc;

+    } while (uVar8 < uVar1);

+  }

+  return uVar6;

+}

+
```

## `CRedirectPromptPermissionCollection::GetSavedCredentialsInUse`  (modified)

```diff
--- CRedirectPromptPermissionCollection::GetSavedCredentialsInUse
+++ CRedirectPromptPermissionCollection::GetSavedCredentialsInUse
@@ -1,2 +1,160 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::GetSavedCredentialsInUse : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

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

+/* public: virtual long __cdecl

+   CRedirectPromptPermissionCollection::GetSavedCredentialsInUse(unsigned short * __ptr64 * __ptr64)

+   __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::GetSavedCredentialsInUse

+          (CRedirectPromptPermissionCollection *this,ushort **param_1)

+

+{

+  ushort *puVar1;

+  bool bVar2;

+  int iVar3;

+  IRIMStub *pIVar4;

+  uint uVar5;

+  void *unaff_retaddr;

+  undefined1 auStackY_8a8 [32];

+  ulong in_stack_fffffffffffff788;

+  ushort *local_868;

+  ushort *local_860;

+  ITSPropertySet *local_858;

+  ITSPropertySet *local_850;

+  ushort *local_848;

+  undefined8 local_840;

+  ushort local_838 [1024];

+  ulonglong local_38;

+  

+  local_840 = 0xfffffffffffffffe;

+  local_38 = __security_cookie ^ (ulonglong)auStackY_8a8;

+  *param_1 = (ushort *)0x0;

+  pIVar4 = (IRIMStub *)(**(code **)(**(longlong **)(this + 0x18) + 0x28))();

+  SmartPtr<IRIMStub>::SmartPtr<IRIMStub>((SmartPtr<IRIMStub> *)&local_850,pIVar4);

+  if (local_850 == (ITSPropertySet *)0x0) {

+    iVar3 = -0x7fff0001;

+    wil::details::in1diag3::Return_Hr

+              (unaff_retaddr,0x31d,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+               -0x7fff0001);

+    goto LAB_0;

+  }

+  pIVar4 = (IRIMStub *)(**(code **)(**(longlong **)(this + 0x20) + 0x38))();

+  SmartPtr<IRIMStub>::SmartPtr<IRIMStub>((SmartPtr<IRIMStub> *)&local_858,pIVar4);

+  if (local_858 == (ITSPropertySet *)0x0) {

+    iVar3 = -0x7fff0001;

+    uVar5 = 800;

+LAB_1:

+    wil::details::in1diag3::Return_Hr

+              (unaff_retaddr,uVar5,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+               iVar3);

+  }

+  else {

+    local_848 = (ushort *)0x0;

+    iVar3 = (**(code **)(*(longlong *)local_850 + 0x78))

+                      (local_850,"UserSpecifiedServerName",&local_848);

+    if (iVar3 < 0) {

+      uVar5 = 0x323;

+      goto LAB_1;

+    }

+    local_860 = (ushort *)((ulonglong)local_860 & 0xffffffff00000000);

+    memset(local_838,0,0x800);

+    iVar3 = CRedirectPromptDlg::CheckSendingCredentials

+                      (local_850,local_858,local_848,*(int *)(this + 0x40),(int *)&local_860,

+                       local_838,in_stack_fffffffffffff788);

+    if (iVar3 < 0) {

+      uVar5 = 0x32f;

+      goto LAB_1;

+    }

+    if (((int)local_860 == 0) || (local_838[0] == 0)) {

+LAB_2:

+      iVar3 = 0;

+    }

+    else {

+      bVar2 = wil::details::

+              FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+              __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                                   *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                      ::__l2::impl);

+      if (!bVar2) {

+        wil::

+        make_unique_string_nothrow<wil::unique_any_t<wil::details::unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>_>_>

+                  ((ushort *)&local_868,(__uint64)local_838);

+        puVar1 = local_868;

+        local_868 = (ushort *)0x0;

+        *param_1 = puVar1;

+        wil::details::

+        unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+        ::

+        ~unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                  ((unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                    *)&local_868);

+        if (puVar1 == (ushort *)0x0) {

+          iVar3 = -0x7ff8fff2;

+          uVar5 = 0x33f;

+          goto LAB_1;

+        }

+        goto LAB_2;

+      }

+      local_868 = (ushort *)0x0;

+      iVar3 = LoadStringFromResource(*(undefined8 *)(this + 0x10),0x3507,&local_868);

+      if (iVar3 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x336,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",iVar3);

+        wil::details::

+        unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+        ::

+        ~unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                  ((unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                    *)&local_868);

+      }

+      else {

+        local_860 = (ushort *)0x0;

+        iVar3 = wil::

+                str_printf_nothrow<wil::unique_any_t<wil::details::unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>_>_>

+                          ((unique_any_t<wil::details::unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>_>

+                            *)&local_860,local_868,local_838);

+        puVar1 = local_860;

+        if (-1 < iVar3) {

+          local_860 = (ushort *)0x0;

+          *param_1 = puVar1;

+          wil::details::

+          unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+          ::

+          ~unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                    ((unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                      *)&local_860);

+          wil::details::

+          unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+          ::

+          ~unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                    ((unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                      *)&local_868);

+          goto LAB_2;

+        }

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x339,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",iVar3);

+        wil::details::

+        unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+        ::

+        ~unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                  ((unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                    *)&local_860);

+        wil::details::

+        unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+        ::

+        ~unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                  ((unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void_(__cdecl*)(void*___ptr64),&void___cdecl_CoTaskMemFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                    *)&local_868);

+      }

+    }

+  }

+  ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_858);

+LAB_0:

+  ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_850);

+  return iVar3;

+}

+
```

## `RdpWinDesktopRemoteAppUIManager::CreateDeviceResources`  (modified)

```diff
--- RdpWinDesktopRemoteAppUIManager::CreateDeviceResources
+++ RdpWinDesktopRemoteAppUIManager::CreateDeviceResources
@@ -1,2 +1,118 @@
-Failed to decompile mstscax.dll - .ProgramDB RdpWinDesktopRemoteAppUIManager::CreateDeviceResources : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: long __cdecl RdpWinDesktopRemoteAppUIManager::CreateDeviceResources(struct

+   RdpXInterfaceOutput * __ptr64) __ptr64 */

+

+long __thiscall

+RdpWinDesktopRemoteAppUIManager::CreateDeviceResources

+          (RdpWinDesktopRemoteAppUIManager *this,RdpXInterfaceOutput *param_1)

+

+{

+  TCntPtr<ITSThread> *this_00;

+  longlong *plVar1;

+  bool bVar2;

+  _XResult32 _Var3;

+  long lVar4;

+  uint uVar5;

+  _TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_> *p_Var6;

+  char *pcVar7;

+  undefined8 uVar8;

+  longlong local_res8;

+  longlong *local_res10;

+  undefined8 *local_res18;

+  

+  local_res18 = (undefined8 *)0x0;

+  local_res10 = (longlong *)0x0;

+  local_res8 = 0;

+  CTSCriticalSection::IsLockedByCurrentThread((CTSCriticalSection *)(this + 0x460));

+  _Var3 = (**(code **)(*(longlong *)param_1 + 0x10))(param_1,0x40,&local_res18);

+  lVar4 = MapXResultToHR(_Var3);

+  if (lVar4 < 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar8 = 0xf0;

+      pcVar7 = "GI for XInterfaceId_RdpXInterfaceLegacyXPlatInterop failed";

+LAB_0:

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar8,

+                 &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar5,pcVar7,lVar4);

+    }

+  }

+  else {

+    lVar4 = (**(code **)*local_res18)(local_res18,&IID_IRdpDxResourceDomain,&local_res10);

+    if (lVar4 < 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar8 = 0xf1;

+        pcVar7 = "QI for IID_IRdpDxResourceDomain failed";

+        goto LAB_0;

+      }

+    }

+    else {

+      lVar4 = (**(code **)(*local_res10 + 0x18))(local_res10,&local_res8);

+      if (-1 < lVar4) {

+        this_00 = (TCntPtr<ITSThread> *)(this + 0x470);

+        if (local_res8 != *(longlong *)this_00) {

+          TCntPtr<ITSThread>::SafeRelease(this_00);

+          *(longlong *)this_00 = local_res8;

+          TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                    ((TCntPtr<IRdpProgressiveDecompressorEx> *)this_00);

+          AcquireSRWLockExclusive((PSRWLOCK)(this + 0x1a0));

+          bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>

+                  ::__private_IsEnabled

+                            ((FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash> *

+                             )&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::GetImpl(void)'

+                               ::__l2::impl);

+          if (bVar2) {

+            for (p_Var6 = *(_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                            **)(this + 400);

+                p_Var6 != (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                           *)(this + 0x180);

+                p_Var6 = (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                          *)utl::

+                            _TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                            ::_Traverse(p_Var6,true)) {

+              RdpWin32RemoteAppPresenter::UpdateD3DDevice

+                        (*(RdpWin32RemoteAppPresenter **)(p_Var6 + 0x20),*(ID3D11Device **)this_00);

+            }

+          }

+          else {

+            for (p_Var6 = *(_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                            **)(this + 0x170);

+                p_Var6 != (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                           *)(this + 0x160);

+                p_Var6 = (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                          *)utl::

+                            _TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                            ::_Traverse(p_Var6,true)) {

+              RdpWin32RemoteAppPresenter::UpdateD3DDevice

+                        (*(RdpWin32RemoteAppPresenter **)(p_Var6 + 0x20),*(ID3D11Device **)this_00);

+            }

+          }

+          ReleaseSRWLockExclusive((PSRWLOCK)(this + 0x1a0));

+        }

+        goto LAB_1;

+      }

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar8 = 0xf2;

+        pcVar7 = "GetDevice failed";

+        goto LAB_0;

+      }

+    }

+  }

+  DiscardDeviceResources(this);

+LAB_1:

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res8);

+  plVar1 = local_res10;

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

+    local_res10 = (longlong *)0x0;

+    (**(code **)(*plVar1 + 0x10))();

+  }

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res18);

+  return lVar4;

+}

+
```

## `CRdrServerRequestHandler::OnClose`  (modified)

```diff
--- CRdrServerRequestHandler::OnClose
+++ CRdrServerRequestHandler::OnClose
@@ -1,2 +1,70 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdrServerRequestHandler::OnClose : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: virtual long __cdecl CRdrServerRequestHandler::OnClose(void) __ptr64 */

+

+long __thiscall CRdrServerRequestHandler::OnClose(CRdrServerRequestHandler *this)

+

+{

+  TCntPtr<ITSThread> *this_00;

+  TCntPtr<ITSThread> *pTVar1;

+  bool bVar2;

+  long lVar3;

+  CTSCriticalSection *local_res10;

+  

+  lVar3 = DoIoCancel(this);

+  this_00 = (TCntPtr<ITSThread> *)(this + 0x48);

+  bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_4198753594> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_4198753594>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar2) {

+    local_res10 = (CTSCriticalSection *)(this + 0x80);

+    CTSCriticalSection::Lock(local_res10);

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

+      lVar3 = (**(code **)(**(longlong **)this_00 + 0x38))();

+    }

+    pTVar1 = (TCntPtr<ITSThread> *)(this + 0x50);

+    if (*(longlong *)pTVar1 != 0) {

+      TCntPtr<ITSThread>::SafeRelease(pTVar1);

+      *(undefined8 *)pTVar1 = 0;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+    }

+    if (*(longlong *)(this + 0x58) != 0) {

+      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x58));

+      *(undefined8 *)(this + 0x58) = 0;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)(this + 0x58));

+    }

+    if (*(longlong *)this_00 != 0) {

+      TCntPtr<ITSThread>::SafeRelease(this_00);

+      *(undefined8 *)this_00 = 0;

+    }

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res10);

+  }

+  else {

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

+      lVar3 = (**(code **)(**(longlong **)this_00 + 0x38))();

+    }

+    pTVar1 = (TCntPtr<ITSThread> *)(this + 0x50);

+    if (*(longlong *)pTVar1 != 0) {

+      TCntPtr<ITSThread>::SafeRelease(pTVar1);

+      *(undefined8 *)pTVar1 = 0;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+    }

+    if (*(longlong *)(this + 0x58) != 0) {

+      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x58));

+      *(undefined8 *)(this + 0x58) = 0;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)(this + 0x58));

+    }

+    if (*(longlong *)this_00 != 0) {

+      TCntPtr<ITSThread>::SafeRelease(this_00);

+      *(undefined8 *)this_00 = 0;

+    }

+  }

+  return lVar3;

+}

+
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPnpPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPnpPermissionItem>
+++ CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPnpPermissionItem>
@@ -1,2 +1,126 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPnpPermissionItem> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

+   CRedirectPromptPnpPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi * __ptr64,class

+   ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPnpPermissionItem>

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int *param_5)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  uint uVar4;

+  CRedirectPromptPnpPermissionItem *pCVar5;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res10;

+  ITSCoreApi *local_res18;

+  ITSWin32CoreApi *local_res20;

+  int *in_stack_ffffffffffffffd0;

+  CRedirectPromptBasePermissionItem *local_28;

+  CRedirectPromptPnpPermissionItem *local_20;

+  

+  local_res10 = param_1;

+  local_res18 = param_2;

+  local_res20 = param_3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  local_20 = (CRedirectPromptPnpPermissionItem *)0x0;

+  if (bVar1) {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptPnpPermissionItem,CRedirectPromptPnpPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) {

+LAB_0:

+      pCVar5 = local_20;

+      param_5._0_4_ = 0;

+      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

+                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

+      if (lVar2 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x36f,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+LAB_1:

+      }

+      else {

+        if ((int)param_5 != 0) {

+          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

+          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

+                                    &_GUID_00000000_0000_0000_c000_000000000046);

+          if (iVar3 == 0) {

+            iVar3 = InlineIsEqualGUID();

+            if (iVar3 == 0) {

+              iVar3 = InlineIsEqualGUID();

+              if (iVar3 != 0) {

+                pCVar5 = pCVar5 + 8;

+                goto LAB_2;

+              }

+              lVar2 = -0x7fffbffe;

+            }

+            else {

+LAB_2:

+              lVar2 = 0;

+              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+            }

+            if (lVar2 < 0) {

+              wil::details::in1diag3::Return_Hr

+                        (unaff_retaddr,0x379,

+                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+              goto LAB_1;

+            }

+          }

+          else {

+            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+          }

+          bVar1 = utl::

+                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                               *)(this + 0x28),

+                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

+                              )&local_28);

+          if (!bVar1) {

+            lVar2 = -0x7ff8fff2;

+            wil::details::in1diag3::Return_Hr

+                      (unaff_retaddr,0x37a,

+                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

+            ;

+            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+            goto LAB_3;

+          }

+          g_wasPnpRequested = 1;

+          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+        }

+        lVar2 = 0;

+      }

+      goto LAB_3;

+    }

+    uVar4 = 0x367;

+  }

+  else {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptPnpPermissionItem,CRedirectPromptPnpPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) goto LAB_0;

+    uVar4 = 0x36b;

+  }

+  wil::details::in1diag3::Return_Hr

+            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+             lVar2);

+LAB_3:

+  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

+  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

+            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

+  return lVar2;

+}

+
```

## `CRedirectPromptDlg2View::PopulatePermissions`  (modified)

```diff
--- CRedirectPromptDlg2View::PopulatePermissions
+++ CRedirectPromptDlg2View::PopulatePermissions
@@ -1,2 +1,294 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptDlg2View::PopulatePermissions : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

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

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: void __cdecl CRedirectPromptDlg2View::PopulatePermissions(void) __ptr64 */

+

+void __thiscall CRedirectPromptDlg2View::PopulatePermissions(CRedirectPromptDlg2View *this)

+

+{

+  longlong *plVar1;

+  code *pcVar2;

+  longlong *plVar3;

+  bool bVar4;

+  uint uVar5;

+  int iVar6;

+  DWORD DVar7;

+  HWND pHVar8;

+  longlong lVar9;

+  WPARAM wParam;

+  undefined8 uVar10;

+  UINT UVar11;

+  UINT UVar12;

+  UINT UVar13;

+  undefined1 auStackY_148 [32];

+  uint local_e8;

+  int local_e4;

+  longlong *local_e0;

+  LPVOID local_d8;

+  longlong *local_d0;

+  int local_c8;

+  int local_c4;

+  int local_c0;

+  uint local_bc;

+  LPCWSTR local_b8;

+  longlong *local_b0;

+  LONG local_a8;

+  UINT local_a4;

+  UINT local_a0;

+  code *local_98;

+  uint *local_90;

+  tagRECT local_88;

+  tagRECT local_78;

+  SCROLLINFO local_68;

+  tagRECT local_48;

+  ulonglong local_38;

+  

+  local_38 = __security_cookie ^ (ulonglong)auStackY_148;

+  local_d0 = (longlong *)0x0;

+  plVar1 = *(longlong **)(this + 0x48);

+  local_e0 = (longlong *)0x0;

+  local_b0 = (longlong *)0x0;

+  local_e8 = 0;

+  local_d8 = (LPVOID)0x0;

+  local_c4 = 0;

+  local_c8 = 0;

+  local_90 = (uint *)0x0;

+  local_bc = 0;

+  local_b8 = (LPCWSTR)0x0;

+  local_88.left = 0;

+  local_88.top = 0;

+  local_88.right = 0;

+  local_88.bottom = 0;

+  local_48.left = 0;

+  local_48.top = 0;

+  local_48.right = 0;

+  local_48.bottom = 0;

+  local_78.left = 0;

+  local_78.top = 0;

+  local_78.right = 0;

+  local_78.bottom = 0;

+  if (plVar1 == (longlong *)0x0) {

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

+        ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_0;

+    uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar10 = 0x14;

+  }

+  else {

+    iVar6 = (**(code **)(*plVar1 + 0x28))(plVar1,&local_d0);

+    if (iVar6 < 0) {

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

+          ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+      goto LAB_0;

+      uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar10 = 0x15;

+    }

+    else {

+      iVar6 = (**(code **)(*local_d0 + 0x18))(local_d0,&local_e8);

+      if (iVar6 < 0) {

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

+            ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+        goto LAB_0;

+        uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar10 = 0x16;

+      }

+      else {

+        if (local_e8 == 0) {

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x17,

+                     &WPP_dd02ebdb1640355e1299b56117a2bdc1_Traceguids,uVar5);

+          }

+          HidePermissionsSection(this);

+          goto LAB_0;

+        }

+        pHVar8 = GetDlgItem(*(HWND *)(this + 8),0x3fca);

+        GetWindowRect(pHVar8,&local_88);

+        MapWindowPoints((HWND)0x0,*(HWND *)(this + 8),(LPPOINT)&local_88,2);

+        GetClientRect(*(HWND *)(this + 8),&local_48);

+        local_78.right = 3;

+        local_78.bottom = 0xc;

+        MapDialogRect(*(HWND *)(this + 8),&local_78);

+        local_c0 = local_78.bottom;

+        local_a8 = local_78.right;

+        UVar12 = local_78.bottom * local_e8;

+        UVar11 = local_78.bottom * 8 - local_78.bottom / 2;

+        local_78.left = 0;

+        local_78.top = 0;

+        local_78.right = 0;

+        local_78.bottom = 0;

+        UVar13 = UVar11;

+        if ((int)UVar12 <= (int)UVar11) {

+          UVar13 = UVar12;

+        }

+        local_a4 = UVar13;

+        local_a0 = UVar11;

+        MapDialogRect(*(HWND *)(this + 8),&local_78);

+        GetSystemMetrics(2);

+        uVar5 = 0x1000;

+        if (UVar13 != UVar11) {

+          uVar5 = 0;

+        }

+        lVar9 = IsolationAwareCreateWindowExW(0x10000,L"STATIC",0,uVar5 | 0x52000000);

+        *(longlong *)(this + 0x60) = lVar9;

+        if (lVar9 == 0) {

+          DVar7 = GetLastError();

+          if (0 < (int)DVar7) {

+            DVar7 = DVar7 & 0xffff | 0x80070000;

+          }

+          if ((int)DVar7 < 0) {

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

+                ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+            goto LAB_0;

+            uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+            uVar10 = 0x18;

+            goto LAB_1;

+          }

+        }

+        uVar5 = 0;

+        *(undefined8 *)(this + 0x58) = *(undefined8 *)(this + 0x60);

+        *(undefined4 *)(this + 0x50) = 0x3fca;

+        if ((int)UVar13 < (int)UVar12) {

+          pHVar8 = (HWND)IsolationAwareCreateWindowExW(0,L"SCROLLBAR",0,0x50000001);

+          *(HWND *)(this + 0x68) = pHVar8;

+          if (pHVar8 != (HWND)0x0) {

+            local_68.cbSize = 0x1c;

+            local_68.nPos = 0;

+            local_68.nTrackPos = 0;

+            local_68.fMask = 7;

+            local_68.nMin = 0;

+            local_68.nPage = UVar13;

+            local_68.nMax = UVar12 - 1;

+            SetScrollInfo(pHVar8,2,&local_68,1);

+          }

+        }

+        IsolationAwareSetWindowSubclass

+                  (*(undefined8 *)(this + 0x60),ScrollContainerSubclassProc,0,this);

+        local_e4 = 0;

+        wParam = SendMessageW(*(HWND *)(this + 8),0x31,0,0);

+        if (local_e8 != 0) {

+          do {

+            UVar13 = local_a4;

+            if (0x32 < uVar5) break;

+            CoTaskMemFree(local_d8);

+            plVar3 = local_d0;

+            plVar1 = local_e0;

+            local_d8 = (LPVOID)0x0;

+            local_e0 = (longlong *)0x0;

+            local_98 = *(code **)(*local_d0 + 0x20);

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

+              (**(code **)(*plVar1 + 0x10))();

+            }

+            iVar6 = (*local_98)(plVar3,uVar5,&local_e0);

+            if (iVar6 < 0) {

+              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                  ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                RdpWppGetCurrentThreadActivityIdPrefix();

+                uVar10 = 0x19;

+LAB_2:

+                WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar10,

+                         &WPP_dd02ebdb1640355e1299b56117a2bdc1_Traceguids);

+              }

+            }

+            else {

+              iVar6 = (**(code **)(*local_e0 + 0x18))(local_e0,&local_d8);

+              if (iVar6 < 0) {

+                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                    ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19]))

+                {

+                  RdpWppGetCurrentThreadActivityIdPrefix();

+                  uVar10 = 0x1a;

+                  goto LAB_2;

+                }

+              }

+              else {

+                iVar6 = (**(code **)(*local_e0 + 0x20))(local_e0,&local_c4);

+                if (iVar6 < 0) {

+                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])

+                     ) {

+                    RdpWppGetCurrentThreadActivityIdPrefix();

+                    uVar10 = 0x1b;

+                    goto LAB_2;

+                  }

+                }

+                else {

+                  iVar6 = (**(code **)(*local_e0 + 0x30))(local_e0,&local_c8);

+                  if (iVar6 < 0) {

+                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) &&

+                       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                      RdpWppGetCurrentThreadActivityIdPrefix();

+                      uVar10 = 0x1c;

+                      goto LAB_2;

+                    }

+                  }

+                  else {

+                    pHVar8 = (HWND)IsolationAwareCreateWindowExW

+                                             (0,L"Button",local_d8,

+                                              (-(uint)(local_c8 != 0) & 0xf8010000) + 0x58004c03);

+                    if (wParam != 0) {

+                      SendMessageW(pHVar8,0x30,wParam,1);

+                    }

+                    SendMessageW(pHVar8,0xf1,(ulonglong)(local_c4 != 0),0);

+                    local_e4 = local_e4 + local_c0;

+                  }

+                }

+              }

+            }

+            uVar5 = uVar5 + 1;

+            UVar13 = local_a4;

+          } while (uVar5 < local_e8);

+        }

+        if (((int)UVar13 < (int)local_a0) && (*(int *)(this + 0x88) == 0)) {

+          UVar11 = local_a0;

+          GetControlsBelow(0x3fca,&local_90,&local_bc);

+          CDlgBase::RepositionBottomControls((CDlgBase *)this,UVar13 - UVar11,local_90,local_bc,1);

+        }

+        UpdateUsbWarning(this,(com_ptr_t<IRedirectPromptPermissionCollection,wil::err_returncode_policy>

+                               *)&local_d0);

+        plVar1 = *(longlong **)(this + 0x48);

+        pcVar2 = *(code **)(*plVar1 + 0x20);

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

+          (**(code **)(*local_b0 + 0x10))();

+        }

+        iVar6 = (*pcVar2)(plVar1,&local_b0);

+        if (-1 < iVar6) {

+          UpdateNoPromptCheckbox

+                    (this,(com_ptr_t<IRedirectPromptConnectionInfo,wil::err_returncode_policy> *)

+                          &local_b0);

+          bVar4 = wil::details::

+                  FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+                  __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                                       *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                          ::__l2::impl);

+          if ((((bVar4) && (iVar6 = (**(code **)(*local_d0 + 0x38))(local_d0,&local_b8), -1 < iVar6)

+               ) && (local_b8 != (LPCWSTR)0x0)) && (*local_b8 != L'\0')) {

+            SetDlgItemTextW(*(HWND *)(this + 8),0x34ad,local_b8);

+          }

+          goto LAB_0;

+        }

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

+            ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+        goto LAB_0;

+        uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar10 = 0x1d;

+      }

+    }

+  }

+LAB_1:

+  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar10,

+             &WPP_dd02ebdb1640355e1299b56117a2bdc1_Traceguids,uVar5);

+LAB_0:

+  CoTaskMemFree(local_b8);

+  local_b8 = (LPCWSTR)0x0;

+  CoTaskMemFree(local_d8);

+  local_d8 = (LPVOID)0x0;

+  ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_b0);

+  ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_e0);

+  ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_d0);

+  return;

+}

+
```

## `CRdrServerRequestHandler::OnFileCreated`  (modified)

```diff
--- CRdrServerRequestHandler::OnFileCreated
+++ CRdrServerRequestHandler::OnFileCreated
@@ -1,2 +1,102 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdrServerRequestHandler::OnFileCreated : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: virtual long __cdecl CRdrServerRequestHandler::OnFileCreated(long,struct IAsyncFileProxy

+   * __ptr64,unsigned long) __ptr64 */

+

+long __thiscall

+CRdrServerRequestHandler::OnFileCreated

+          (CRdrServerRequestHandler *this,long param_1,IAsyncFileProxy *param_2,ulong param_3)

+

+{

+  TCntPtr<ITSThread> *this_00;

+  bool bVar1;

+  int iVar2;

+  uint uVar3;

+  uint *puVar4;

+  longlong *plVar5;

+  longlong *local_28;

+  CTSCriticalSection *local_20;

+  

+  plVar5 = (longlong *)0x0;

+  local_28 = (longlong *)0x0;

+  puVar4 = operator_new(8);

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

+    iVar2 = -0x7ff8fff2;

+    goto LAB_0;

+  }

+  puVar4[0] = 0;

+  puVar4[1] = 0;

+  *(undefined1 *)((longlong)puVar4 + 3) = 0;

+  puVar4[1] = param_1;

+  *puVar4 = *puVar4 ^ (*puVar4 ^ param_3) & 0xffffff;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_4198753594> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_4198753594>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar1) {

+    local_20 = (CTSCriticalSection *)(this + 0x78);

+    CTSCriticalSection::Lock(local_20);

+    if (*(longlong *)(this + 0x48) != 0) {

+      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_28);

+      plVar5 = *(longlong **)(this + 0x48);

+      local_28 = plVar5;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_28);

+    }

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_20);

+LAB_1:

+    if (plVar5 == (longlong *)0x0) goto LAB_2;

+    iVar2 = (**(code **)(*plVar5 + 0x18))(plVar5,8,puVar4);

+    if (iVar2 < 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),10,

+                   &WPP_f26f1544384632a256a4da45cfc15c0a_Traceguids,uVar3,

+                   "IWTSVirtualChannel::Write",iVar2);

+      }

+      goto LAB_0;

+    }

+  }

+  else {

+    if (*(longlong *)(this + 0x48) != 0) {

+      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_28);

+      plVar5 = *(longlong **)(this + 0x48);

+      local_28 = plVar5;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_28);

+      goto LAB_1;

+    }

+LAB_2:

+    iVar2 = 0;

+  }

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_4198753594> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_4198753594>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar1) {

+    local_20 = (CTSCriticalSection *)(this + 0x78);

+    this_00 = (TCntPtr<ITSThread> *)(this + 0x40);

+    CTSCriticalSection::Lock(local_20);

+    if (param_2 != *(IAsyncFileProxy **)this_00) {

+      TCntPtr<ITSThread>::SafeRelease(this_00);

+      *(IAsyncFileProxy **)this_00 = param_2;

+      if (param_2 != (IAsyncFileProxy *)0x0) {

+        (**(code **)(*(longlong *)param_2 + 8))(param_2);

+      }

+    }

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_20);

+  }

+  else if (param_2 != *(IAsyncFileProxy **)(this + 0x40)) {

+    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x40));

+    *(IAsyncFileProxy **)(this + 0x40) = param_2;

+    if (param_2 != (IAsyncFileProxy *)0x0) {

+      (**(code **)(*(longlong *)param_2 + 8))(param_2);

+    }

+  }

+LAB_0:

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_28);

+  return iVar2;

+}

+
```

## `CameraAdapter::ActivateDevice`  (modified)

```diff
--- CameraAdapter::ActivateDevice
+++ CameraAdapter::ActivateDevice
@@ -1,44 +1,320 @@
 

-long __thiscall

-Microsoft::WRL::Details::

-RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<6>,0,0,0,IClassFactory,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil>

-::ActivateDevice(CameraAdapter *this,bool param_1)

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

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

+/* public: virtual long __cdecl CameraAdapter::ActivateDevice(bool) __ptr64 */

+

+long __thiscall CameraAdapter::ActivateDevice(CameraAdapter *this,bool param_1)

 

 {

+  CameraAdapter *SRWLock;

+  ComPtr<IMediaSinkCallback> *this_00;

   char *pcVar1;

-  uint uVar2;

-  int iVar3;

-  char *in_RAX;

-  undefined8 in_stack_00000020;

-  undefined4 uVar4;

-  int iStack0000000000000028;

-  byte in_stack_00000068;

+  longlong *plVar2;

+  code *pcVar3;

+  undefined1 auVar4 [16];

+  uint uVar5;

+  int iVar6;

+  uint uVar7;

+  longlong lVar8;

+  undefined8 ****ppppuVar9;

+  ulonglong uVar10;

+  __uint64 _Var11;

+  ulonglong *puVar12;

+  MediaStreamAdapterEntry *pMVar13;

+  undefined4 uVar14;

+  undefined8 uVar15;

+  ulonglong uVar16;

+  ulonglong *puVar17;

+  ulonglong *puVar18;

+  undefined1 auStack_c8 [32];

+  char *local_a8;

+  int local_a0;

+  uint local_98;

+  uint local_94;

+  undefined4 local_90 [2];

+  longlong *local_88;

+  undefined8 local_80;

+  longlong *local_78;

+  uint local_70 [2];

+  undefined8 ***local_68;

+  undefined8 ***local_60;

+  undefined8 local_58;

+  undefined8 local_50;

+  undefined8 local_48;

+  longlong local_40;

+  longlong lStack_38;

+  ulonglong local_30;

   

-  uVar4 = (undefined4)((ulonglong)in_stack_00000020 >> 0x20);

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

-  pcVar1 = in_RAX + 0x468247c;

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

-  if (*pcVar1 == '\0') {

-    iVar3 = func_0x00018025f834();

-    if ((((iVar3 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

-        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

-      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

-      iStack0000000000000028 = iVar3;

-      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xb,

-                 &WPP_593922d82965378f67e2000ddb9e76c2_Traceguids,uVar2,

-                 "OnSelectVersionResponse failed");

+  local_30 = __security_cookie ^ (ulonglong)auStack_c8;

+  iVar6 = 0;

+  local_60 = &local_68;

+  SRWLock = this + 0x10;

+  local_68 = &local_68;

+  local_88 = (longlong *)0x0;

+  local_94 = 0;

+  local_78 = (longlong *)0x0;

+  local_80 = 0;

+  local_90[0] = 0;

+  local_40 = 0;

+  lStack_38 = 0;

+  local_48 = 0;

+  local_58 = 0;

+  local_70[0] = 0;

+  AcquireSRWLockExclusive((PSRWLOCK)SRWLock);

+  if (*(int *)(this + 0x18) == 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+      pcVar1 = *(char **)(this + 0x20);

+      uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+      local_a8 = pcVar1;

+      WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xb,

+                &WPP_bb9a7187ef7f39a689e826e28c9e62d0_Traceguids,uVar5);

     }

+    plVar2 = *(longlong **)(this + 0x28);

+    this_00 = (ComPtr<IMediaSinkCallback> *)(this + 0x30);

+    pcVar3 = *(code **)(*plVar2 + 0x108);

+    Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease(this_00);

+    iVar6 = (*pcVar3)(plVar2,&_GUID_3c9b2eb9_86d5_4514_a394_f56664f9f0d8,this_00);

+    if (iVar6 < 0) {

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

+          ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+      goto LAB_0;

+      uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar15 = 0xc;

+      local_a8 = "m_spDevice->ActivateObject failed";

+    }

+    else {

+      iVar6 = (**(code **)(**(longlong **)(this + 0x28) + 0x118))();

+      if (iVar6 < 0) {

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

+            ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+        goto LAB_0;

+        uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar15 = 0xd;

+        local_a8 = "m_spDevice->DetachObject failed";

+      }

+      else {

+        plVar2 = *(longlong **)this_00;

+        pcVar3 = *(code **)(*plVar2 + 0x40);

+        Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease

+                  ((ComPtr<IMediaSinkCallback> *)&local_88);

+        iVar6 = (*pcVar3)(plVar2,&local_88);

+        if (iVar6 < 0) {

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

+              ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+          goto LAB_0;

+          uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+          uVar15 = 0xe;

+          local_a8 = "pSource->CreatePresentationDescriptor failed";

+        }

+        else {

+          iVar6 = (**(code **)(*local_88 + 0x108))(local_88,&local_94);

+          if (-1 < iVar6) {

+            for (uVar5 = 0; local_98 = uVar5, uVar5 < local_94; uVar5 = uVar5 + 1) {

+              plVar2 = *(longlong **)this_00;

+              pcVar3 = *(code **)(*plVar2 + 0x70);

+              Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease

+                        ((ComPtr<IMediaSinkCallback> *)&local_78);

+              iVar6 = (*pcVar3)(plVar2,uVar5,&local_78);

+              if (iVar6 < 0) {

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

+                    ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+                goto LAB_0;

+                uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+                uVar15 = 0x10;

+                local_a8 = "pSource->GetStreamAttributes failed";

+                goto LAB_1;

+              }

+              iVar6 = (**(code **)(*local_78 + 0x50))

+                                (local_78,&MF_DEVICESTREAM_STREAM_CATEGORY,&local_40);

+              plVar2 = local_88;

+              if (iVar6 < 0) {

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

+                    ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+                goto LAB_0;

+                uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+                uVar15 = 0x11;

+                local_a8 = "spStreamAttributes->GetGUID(MF_DEVICESTREAM_STREAM_CATEGORY) failed";

+                goto LAB_1;

+              }

+              lVar8 = local_40 + -0x11d10353fb6c4281;

+              if (lVar8 == 0) {

+                lVar8 = lStack_38 + 0x45e9333fffffa070;

+              }

+              if (lVar8 == 0) {

+                pcVar3 = *(code **)(*local_88 + 0x110);

+                Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease

+                          ((ComPtr<IMediaSinkCallback> *)&local_80);

+                iVar6 = (*pcVar3)(plVar2,uVar5,local_90,&local_80);

+                if (iVar6 < 0) {

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

+                      ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2)

+                     ) goto LAB_0;

+                  uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+                  uVar15 = 0x13;

+                  local_a8 = "spPresentationDescriptor->GetStreamDescriptorByIndex failed";

+                  goto LAB_1;

+                }

+                local_50 = local_80;

+                iVar6 = Microsoft::WRL::Details::

+                        MakeAndInitialize<MediaStreamAdapter,MediaStreamAdapter,int&___ptr64,IMFStreamDescriptor*___ptr64,unsigned_long&___ptr64>

+                                  (&local_58,local_90,&local_50,&local_98);

+                uVar5 = local_98;

+                if (iVar6 == -0x7ff8fffe) {

+                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])

+                     ) {

+                    uVar7 = RdpWppGetCurrentThreadActivityIdPrefix();

+                    local_a8 = (char *)CONCAT44(local_a8._4_4_,uVar5);

+                    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x14,

+                              &WPP_bb9a7187ef7f39a689e826e28c9e62d0_Traceguids,uVar7);

+                  }

+                  iVar6 = 0;

+                }

+                else {

+                  if (iVar6 < 0) {

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

+                        ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) ||

+                       ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_0;

+                    uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+                    uVar15 = 0x15;

+                    local_a8 = "MakeAndInitialize<MediaStreamAdapter> failed";

+                    goto LAB_1;

+                  }

+                  ppppuVar9 = operator_new(0x18);

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

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

+                        ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) ||

+                       ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_2;

+                    uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+                    uVar14 = 0x16;

+                    local_a8 = "MediaStreamAdapterEntry";

+                    goto LAB_3;

+                  }

+                  *ppppuVar9 = (undefined8 ***)0x0;

+                  ppppuVar9[1] = (undefined8 ***)0x0;

+                  ppppuVar9[2] = (undefined8 ***)0x0;

+                  Microsoft::WRL::ComPtr<MediaStreamAdapter>::operator=

+                            ((ComPtr<MediaStreamAdapter> *)(ppppuVar9 + 2),

+                             (ComPtr<class_MediaStreamAdapter> *)&local_58);

+                  *ppppuVar9 = &local_68;

+                  ppppuVar9[1] = local_60;

+                  *local_60 = ppppuVar9;

+                  local_70[0] = local_70[0] + 1;

+                  uVar5 = local_98;

+                  local_60 = ppppuVar9;

+                }

+              }

+              else if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                       ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) &&

+                      (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+                uVar7 = RdpWppGetCurrentThreadActivityIdPrefix();

+                local_a8 = (char *)CONCAT44(local_a8._4_4_,uVar5);

+                WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x12,

+                          &WPP_bb9a7187ef7f39a689e826e28c9e62d0_Traceguids,uVar7);

+              }

+            }

+            puVar17 = (ulonglong *)0x0;

+            if (local_70[0] == 0) goto LAB_0;

+            uVar5 = local_70[0];

+            if (0xff < local_70[0]) {

+              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                  ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+                WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x17,

+                         &WPP_bb9a7187ef7f39a689e826e28c9e62d0_Traceguids,uVar5);

+              }

+              uVar5 = 0xff;

+            }

+            uVar16 = CONCAT44(0,uVar5 & 0xff);

+            auVar4._8_8_ = 0;

+            auVar4._0_8_ = uVar16;

+            uVar10 = SUB168(ZEXT816(8) * auVar4,0);

+            this[0x40] = SUB41(uVar5,0);

+            if (SUB168(ZEXT816(8) * auVar4,8) != 0) {

+              uVar10 = 0xffffffffffffffff;

+            }

+            _Var11 = uVar10 + 8;

+            if (0xfffffffffffffff7 < uVar10) {

+              _Var11 = 0xffffffffffffffff;

+            }

+            puVar12 = operator_new(_Var11);

+            puVar18 = puVar17;

+            if (puVar12 != (ulonglong *)0x0) {

+              *puVar12 = uVar16;

+              _vector_constructor_iterator_

+                        (puVar12 + 1,8,(ulonglong)(uVar5 & 0xff),

+                         ComPlainSmartPtr<ITSWindowInformation>::

+                         ComPlainSmartPtr<ITSWindowInformation>);

+              puVar18 = puVar12 + 1;

+            }

+            *(ulonglong **)(this + 0x38) = puVar18;

+            if (puVar18 == (ulonglong *)0x0) {

+              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                  ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+                uVar14 = 0x18;

+                local_a8 = "ComPtr<MediaStreamAdapter>[]";

+LAB_3:

+                WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar14,

+                          &WPP_bb9a7187ef7f39a689e826e28c9e62d0_Traceguids,uVar5);

+              }

+LAB_2:

+              iVar6 = -0x7ff8fff2;

+              goto LAB_0;

+            }

+            *(uint *)(this + 0x44) = local_94;

+            pMVar13 = CTEntryList<MediaStreamAdapterEntry,0>::GetNextOfEx

+                                ((CTEntryList<MediaStreamAdapterEntry,0> *)local_70,

+                                 (MediaStreamAdapterEntry *)0x0);

+            puVar18 = puVar17;

+            while (pMVar13 != (MediaStreamAdapterEntry *)0x0) {

+              Microsoft::WRL::ComPtr<MediaStreamAdapter>::operator=

+                        ((ComPtr<MediaStreamAdapter> *)

+                         (*(longlong *)(this + 0x38) + ((ulonglong)puVar18 & 0xffffffff) * 8),

+                         (ComPtr<class_MediaStreamAdapter> *)(pMVar13 + 0x10));

+              puVar18 = (ulonglong *)(ulonglong)((int)puVar17 + 1);

+              pMVar13 = CTEntryList<MediaStreamAdapterEntry,0>::GetNextOfEx

+                                  ((CTEntryList<MediaStreamAdapterEntry,0> *)local_70,pMVar13);

+              puVar17 = (ulonglong *)((ulonglong)puVar18 & 0xffffffff);

+            }

+            this[0x50] = (CameraAdapter)param_1;

+            goto LAB_4;

+          }

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

+              ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+          goto LAB_0;

+          uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+          uVar15 = 0xf;

+          local_a8 = "spPresentationDescriptor->GetStreamDescriptorCount failed";

+        }

+      }

+    }

+LAB_1:

+    local_a0 = iVar6;

+    WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar15,

+               &WPP_bb9a7187ef7f39a689e826e28c9e62d0_Traceguids,uVar5);

   }

   else {

-    iVar3 = -0x7ff8fff3;

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

-        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

-      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

-      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xc,

-                &WPP_593922d82965378f67e2000ddb9e76c2_Traceguids,uVar2,

-                CONCAT44(uVar4,(uint)in_stack_00000068));

-    }

+LAB_4:

+    *(int *)(this + 0x18) = *(int *)(this + 0x18) + 1;

   }

-  return iVar3;

+LAB_0:

+  if (SRWLock != (CameraAdapter *)0x0) {

+    ReleaseSRWLockExclusive((PSRWLOCK)SRWLock);

+  }

+  MediaTypeList::~MediaTypeList((MediaTypeList *)local_70);

+  Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease

+            ((ComPtr<IMediaSinkCallback> *)&local_58);

+  Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease

+            ((ComPtr<IMediaSinkCallback> *)&local_48);

+  Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease

+            ((ComPtr<IMediaSinkCallback> *)&local_80);

+  Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease

+            ((ComPtr<IMediaSinkCallback> *)&local_78);

+  Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease

+            ((ComPtr<IMediaSinkCallback> *)&local_88);

+  return iVar6;

 }
```

## `Avc420Decompressor::BuildQualityMap`  (modified)

```diff
--- Avc420Decompressor::BuildQualityMap
+++ Avc420Decompressor::BuildQualityMap
@@ -1,2 +1,74 @@
-Failed to decompile mstscax.dll - .ProgramDB Avc420Decompressor::BuildQualityMap : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: long __cdecl Avc420Decompressor::BuildQualityMap(void) __ptr64 */

+

+long __thiscall Avc420Decompressor::BuildQualityMap(Avc420Decompressor *this)

+

+{

+  bool bVar1;

+  long lVar2;

+  undefined4 uVar3;

+  char *pcVar4;

+  undefined8 uVar5;

+  _RDPX_RECT_QP *p_Var6;

+  _RDPX_RECT_QP *p_Var7;

+  _RDPX_RECT_QP *p_Var8;

+  ulonglong uVar9;

+  uint local_res8 [2];

+  _RDPX_RECT_QP *local_res10;

+  

+  p_Var8 = (_RDPX_RECT_QP *)0x0;

+  local_res8[0] = 0;

+  local_res10 = (_RDPX_RECT_QP *)0x0;

+  lVar2 = AvcDecoder::GetRectQPs(*(AvcDecoder **)(this + 0x28),local_res8,&local_res10);

+  if (lVar2 < 0) {

+    p_Var7 = p_Var8;

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

+        (p_Var7 = (_RDPX_RECT_QP *)0x0, (WPP_GLOBAL_Control[0x1c] & 8) == 0)) ||

+       ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_0;

+    uVar3 = RdpX_GetActivityIdPrefix();

+    uVar5 = 100;

+    pcVar4 = "Failed to get rectangle, QP info for AVC 420";

+    p_Var7 = p_Var8;

+  }

+  else {

+    operator_delete__((void *)0x0);

+    p_Var7 = local_res10;

+    bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3343370555>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_3343370555> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3343370555>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3343370555>::GetImpl(void)'

+                        ::__l2::impl);

+    uVar9 = (ulonglong)local_res8[0];

+    if ((!bVar1) || (local_res8[0] <= *(uint *)(this + 0xd8))) {

+      *(uint *)(this + 0xdc) = local_res8[0];

+      if (local_res8[0] != 0) {

+        p_Var6 = p_Var7 + 0xc;

+        do {

+          *(undefined4 *)(p_Var8 + *(longlong *)(this + 0x88)) = *(undefined4 *)(p_Var6 + -0xc);

+          *(undefined4 *)(p_Var8 + *(longlong *)(this + 0x88) + 4) = *(undefined4 *)(p_Var6 + -8);

+          *(undefined4 *)(p_Var8 + *(longlong *)(this + 0x88) + 0xc) = *(undefined4 *)p_Var6;

+          *(undefined4 *)(p_Var8 + *(longlong *)(this + 0x88) + 8) = *(undefined4 *)(p_Var6 + -4);

+          *(undefined4 *)(p_Var8 + *(longlong *)(this + 0x88) + 0x10) = *(undefined4 *)(p_Var6 + 8);

+          p_Var8[*(longlong *)(this + 0x88) + 0x14] = p_Var6[4];

+          uVar9 = uVar9 - 1;

+          p_Var6 = p_Var6 + 0x18;

+          p_Var8 = p_Var8 + 0x1c;

+        } while (uVar9 != 0);

+      }

+      goto LAB_0;

+    }

+    lVar2 = -0x7ff8ffa9;

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

+        ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_0;

+    uVar3 = RdpX_GetActivityIdPrefix();

+    uVar5 = 0x65;

+    lVar2 = -0x7ff8ffa9;

+    pcVar4 = "NumRectsQPs exceeds m_maxRects in AVC420 BuildQualityMap";

+  }

+  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar5,

+             &WPP_5bf2df859dd4320a01eb4dd904adbedc_Traceguids,uVar3,pcVar4,lVar2);

+LAB_0:

+  operator_delete__(p_Var7);

+  return lVar2;

+}

+
```

## `DynVCPluginLoader::_LoadOnePluginDirect`  (modified)

```diff
--- DynVCPluginLoader::_LoadOnePluginDirect
+++ DynVCPluginLoader::_LoadOnePluginDirect
@@ -1,2 +1,378 @@
-Failed to decompile mstscax.dll - .ProgramDB DynVCPluginLoader::_LoadOnePluginDirect : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl DynVCPluginLoader::_LoadOnePluginDirect(unsigned short const * __ptr64)

+   __ptr64 */

+

+long __thiscall DynVCPluginLoader::_LoadOnePluginDirect(DynVCPluginLoader *this,ushort *param_1)

+

+{

+  IWTSPlugin *pIVar1;

+  IWTSPluginProxy *pIVar2;

+  bool bVar3;

+  undefined4 uVar4;

+  DWORD DVar5;

+  int iVar6;

+  undefined4 uVar7;

+  HMODULE hModule;

+  longlong *plVar8;

+  FARPROC pFVar9;

+  INT_PTR IVar10;

+  __uint64 _Var11;

+  undefined8 *_Dst;

+  _GUID *p_Var12;

+  uint uVar13;

+  uint uVar14;

+  ulonglong uVar15;

+  uint local_res18 [2];

+  longlong *local_res20;

+  undefined8 in_stack_ffffffffffffff88;

+  ushort *puVar16;

+  longlong *local_68;

+  undefined8 local_60;

+  IWTSPlugin *local_58;

+  IWTSPluginProxy *local_50;

+  HMODULE local_48;

+  undefined8 local_40;

+  undefined8 local_38;

+  

+  uVar4 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);

+  local_38 = 0xfffffffffffffffe;

+  local_40 = 0;

+  local_res18[0] = 0;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar4 = RdpX_GetActivityIdPrefix();

+    puVar16 = param_1;

+    WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4a,

+              &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4,param_1);

+    uVar4 = (undefined4)((ulonglong)puVar16 >> 0x20);

+  }

+  hModule = LoadLibraryW((LPCWSTR)param_1);

+  local_48 = hModule;

+  if (hModule == (HMODULE)0x0) {

+    DVar5 = GetLastError();

+    InitOnceExecuteOnce((PINIT_ONCE)&DAT_0,

+                        WebAuthnRedirConfig::`anonymous_namespace'::InitializeWebAuthnDynVCPath,

+                        (PVOID)0x0,(LPVOID *)0x0);

+    p_Var12 = (_GUID *)0xffffffff;

+    iVar6 = CompareStringOrdinal((LPCWSTR)&DAT_1,-1,(LPCWSTR)param_1,-1,1);

+    if (iVar6 == 2) {

+      local_res20 = (longlong *)0x0;

+      tip2::

+      tip_test<tip2::details::merged_data<_tip_WebAuthnRedirectionInVMConnectTipTest,_tip_WebAuthnRedirectionInVMConnectTipTest>_>

+      ::open_helper((tip_test<tip2::details::merged_data<_tip_WebAuthnRedirectionInVMConnectTipTest,_tip_WebAuthnRedirectionInVMConnectTipTest>_>

+                     *)&local_res20,p_Var12);

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

+         (bVar3 = tip2::details::shared_data<1,0,0>::is_running

+                            ((shared_data<1,0,0> *)(local_res20 + 1)), bVar3)) {

+        plVar8 = (longlong *)

+                 tip2::

+                 tip_test<tip2::details::merged_data<_tip_WebAuthnRedirectionInVMConnectTipTest,_tip_WebAuthnRedirectionInVMConnectTipTest>_>

+                 ::operator->((tip_test<tip2::details::merged_data<_tip_WebAuthnRedirectionInVMConnectTipTest,_tip_WebAuthnRedirectionInVMConnectTipTest>_>

+                               *)&local_res20);

+        *(DWORD *)(*plVar8 + 0x114) = DVar5;

+        tip2::

+        test_data_control<tip2::details::merged_data<_tip_WebAuthnRedirectionInVMConnectTipTest,_tip_WebAuthnRedirectionInVMConnectTipTest>_>

+        ::

+        ~test_data_control<tip2::details::merged_data<_tip_WebAuthnRedirectionInVMConnectTipTest,_tip_WebAuthnRedirectionInVMConnectTipTest>_>

+                  ((test_data_control<tip2::details::merged_data<_tip_WebAuthnRedirectionInVMConnectTipTest,_tip_WebAuthnRedirectionInVMConnectTipTest>_>

+                    *)&local_50);

+      }

+      wil::

+      com_ptr_t<tip2::details::merged_data<_tip_WebAuthnRedirectionInVMConnectTipTest,_tip_WebAuthnRedirectionInVMConnectTipTest>,wil::err_returncode_policy>

+      ::

+      ~com_ptr_t<tip2::details::merged_data<_tip_WebAuthnRedirectionInVMConnectTipTest,_tip_WebAuthnRedirectionInVMConnectTipTest>,wil::err_returncode_policy>

+                ((com_ptr_t<tip2::details::merged_data<_tip_WebAuthnRedirectionInVMConnectTipTest,_tip_WebAuthnRedirectionInVMConnectTipTest>,wil::err_returncode_policy>

+                  *)&local_res20);

+    }

+    if (0 < (int)DVar5) {

+      DVar5 = DVar5 & 0xffff | 0x80070000;

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpX_GetActivityIdPrefix();

+      WPP_SF_DSd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4b,

+                 &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4,param_1,DVar5);

+    }

+    goto LAB_2;

+  }

+  iVar6 = WebAuthnRedirConfig::IsWebAuthnRedirDynVCPlugin(hModule);

+  if ((iVar6 != 0) && (iVar6 = WebAuthnRedirConfig::IsWebAuthnRedirGloballyDisabled(), iVar6 != 0))

+  {

+    DVar5 = 0;

+    if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+       (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (3 < (byte)WPP_GLOBAL_Control[0x19])))) {

+      uVar4 = RdpX_GetActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4c,

+               &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4);

+    }

+    goto LAB_2;

+  }

+  pFVar9 = GetProcAddress(hModule,"VirtualChannelGetInstance");

+  if (pFVar9 == (FARPROC)0x0) {

+    DVar5 = GetLastError();

+    if (0 < (int)DVar5) {

+      DVar5 = DVar5 & 0xffff | 0x80070000;

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar7 = RdpX_GetActivityIdPrefix();

+      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4d,

+                &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar7,CONCAT44(uVar4,DVar5));

+    }

+    goto LAB_2;

+  }

+  IVar10 = (*pFVar9)(&IID_IWTSPlugin,local_res18,0);

+  DVar5 = (DWORD)IVar10;

+  if ((int)DVar5 < 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpX_GetActivityIdPrefix();

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4e,

+                 &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4,"VirtualChannelGetInstance",

+                 DVar5);

+    }

+    goto LAB_2;

+  }

+  _Var11 = SUB168(ZEXT816(8) * ZEXT416(local_res18[0]),0);

+  if (SUB168(ZEXT816(8) * ZEXT416(local_res18[0]),8) != 0) {

+    _Var11 = 0xffffffffffffffff;

+  }

+  _Dst = operator_new(_Var11);

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

+    DVar5 = 0x8007000e;

+    goto LAB_2;

+  }

+  memset(_Dst,0,(ulonglong)local_res18[0] << 3);

+  IVar10 = (*pFVar9)(&IID_IWTSPlugin,local_res18,_Dst);

+  DVar5 = (DWORD)IVar10;

+  if ((int)DVar5 < 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpX_GetActivityIdPrefix();

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4f,

+                 &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4,"VirtualChannelGetInstance",

+                 DVar5);

+    }

+  }

+  else {

+    bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_177773882>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_177773882> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_177773882>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_177773882>::GetImpl(void)'

+                        ::__l2::impl);

+    if ((bVar3) && (iVar6 = WebAuthnRedirConfig::IsWebAuthnRedirDynVCPlugin(hModule), iVar6 != 0)) {

+      local_58 = (IWTSPlugin *)0x0;

+      local_50 = (IWTSPluginProxy *)0x0;

+      local_60 = 0;

+      local_68 = (longlong *)0x0;

+      local_res20 = (longlong *)0x0;

+      if (local_res18[0] == 1) {

+        pIVar1 = (IWTSPlugin *)*_Dst;

+        if (pIVar1 == (IWTSPlugin *)0x0) {

+          DVar5 = 0x8000ffff;

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar4 = RdpX_GetActivityIdPrefix();

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x51,

+                     &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4);

+          }

+          TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+          TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_68);

+          TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_60);

+        }

+        else {

+          TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_58);

+          *_Dst = 0;

+          local_58 = pIVar1;

+          DVar5 = CreateProxyForPlugin(pIVar1,&local_50);

+          if ((int)DVar5 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar4 = RdpX_GetActivityIdPrefix();

+              WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x52,

+                         &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4,

+                         "CreateProxyForPlugin failed for WebAuthn.dll",DVar5);

+            }

+            TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+            TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_68);

+            TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_60);

+            if (local_50 != (IWTSPluginProxy *)0x0) {

+              (**(code **)(*(longlong *)local_50 + 0x10))();

+            }

+          }

+          else {

+            DVar5 = (**(code **)(**(longlong **)(this + 0x58) + 0x40))

+                              (*(longlong **)(this + 0x58),&local_68);

+            if ((int)DVar5 < 0) {

+              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                  ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                uVar4 = RdpX_GetActivityIdPrefix();

+                WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x53,

+                           &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4,

+                           "GetCoreAPI failed",DVar5);

+              }

+              TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+              TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_68);

+              TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_60);

+              if (local_50 != (IWTSPluginProxy *)0x0) {

+                (**(code **)(*(longlong *)local_50 + 0x10))();

+              }

+            }

+            else {

+              plVar8 = (longlong *)(**(code **)(*local_68 + 0x28))();

+              if (plVar8 == (longlong *)0x0) {

+                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                    ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19]))

+                {

+                  uVar4 = RdpX_GetActivityIdPrefix();

+                  WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x54,

+                            &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4,"coreProps");

+                }

+                DVar5 = 0x80004003;

+                TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+                TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_68);

+                TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_60);

+                if (local_50 != (IWTSPluginProxy *)0x0) {

+                  (**(code **)(*(longlong *)local_50 + 0x10))();

+                }

+              }

+              else {

+                TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+                local_res20 = plVar8;

+                TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                          ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_res20);

+                pIVar2 = local_50;

+                DVar5 = (*(code *)**(undefined8 **)local_50)

+                                  (local_50,&_GUID_00000000_0000_0000_c000_000000000046,&local_60);

+                if ((int)DVar5 < 0) {

+                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                      ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])

+                     ) {

+                    uVar4 = RdpX_GetActivityIdPrefix();

+                    WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x55,

+                               &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4,

+                               "QueryInterface for IUnknown on IWTSPluginProxy failed",DVar5);

+                  }

+                  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+                  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_68);

+                  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_60);

+                  if (pIVar2 != (IWTSPluginProxy *)0x0) {

+                    (**(code **)(*(longlong *)pIVar2 + 0x10))(pIVar2);

+                  }

+                }

+                else {

+                  DVar5 = (**(code **)(*plVar8 + 0x30))(plVar8,"WebAuthnDvcPluginProxy",local_60);

+                  if ((int)DVar5 < 0) {

+                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                      uVar4 = RdpX_GetActivityIdPrefix();

+                      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x56,

+                                 &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4,

+                                 "SetIUnknownProperty( TS_PROP_CORE_WEBAUTHN_DVC_PLUGIN_PROXY ) failed"

+                                 ,DVar5);

+                    }

+                    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+                    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_68);

+                    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_60);

+                    if (pIVar2 != (IWTSPluginProxy *)0x0) {

+                      (**(code **)(*(longlong *)pIVar2 + 0x10))(pIVar2);

+                    }

+                  }

+                  else {

+                    DVar5 = (*(code *)**(undefined8 **)pIVar2)

+                                      (pIVar2,&_GUID_a1230201_1439_4e62_a414_190d0ac3d40e,_Dst);

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

+                      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+                      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_68);

+                      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_60);

+                      if (pIVar2 != (IWTSPluginProxy *)0x0) {

+                        (**(code **)(*(longlong *)pIVar2 + 0x10))(pIVar2);

+                      }

+                      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_58);

+                      goto LAB_3;

+                    }

+                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                      uVar4 = RdpX_GetActivityIdPrefix();

+                      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x57,

+                                 &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4,

+                                 "QueryInterface for IWTSPlugin on IWTSPluginProxy failed",DVar5);

+                    }

+                    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+                    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_68);

+                    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_60);

+                    if (pIVar2 != (IWTSPluginProxy *)0x0) {

+                      (**(code **)(*(longlong *)pIVar2 + 0x10))(pIVar2);

+                    }

+                  }

+                }

+              }

+            }

+          }

+        }

+      }

+      else {

+        DVar5 = 0x8000ffff;

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar4 = RdpX_GetActivityIdPrefix();

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x50,

+                   &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4);

+        }

+        TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+        TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_68);

+        TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_60);

+      }

+      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_58);

+    }

+    else {

+LAB_3:

+      uVar15 = 0;

+      if (local_res18[0] != 0) {

+        do {

+          DVar5 = (**(code **)(**(longlong **)(this + 0x50) + 0x20))

+                            (*(longlong **)(this + 0x50),_Dst[uVar15]);

+          if ((((int)DVar5 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+             (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+            uVar4 = RdpX_GetActivityIdPrefix();

+            WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x58,

+                       &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar4,"Add Plugin",DVar5);

+          }

+          uVar13 = (int)uVar15 + 1;

+          uVar15 = (ulonglong)uVar13;

+        } while (uVar13 < local_res18[0]);

+      }

+      iVar6 = DynArray<HINSTANCE__*___ptr64,unsigned_long>::Add

+                        ((DynArray<HINSTANCE__*___ptr64,unsigned_long> *)(this + 0x70),&local_48);

+      if (iVar6 == 0) {

+        DVar5 = 0x8007000e;

+      }

+      else {

+        hModule = (HMODULE)0x0;

+      }

+    }

+  }

+  uVar15 = 0;

+  uVar13 = local_res18[0];

+  if (local_res18[0] != 0) {

+    do {

+      if ((longlong *)_Dst[uVar15] != (longlong *)0x0) {

+        (**(code **)(*(longlong *)_Dst[uVar15] + 0x10))();

+        uVar13 = local_res18[0];

+      }

+      uVar14 = (int)uVar15 + 1;

+      uVar15 = (ulonglong)uVar14;

+    } while (uVar14 < uVar13);

+  }

+  operator_delete(_Dst);

+LAB_2:

+  if (hModule != (HMODULE)0x0) {

+    FreeLibrary(hModule);

+  }

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_40);

+  return DVar5;

+}

+
```

## `CTSWin32CoreApi::GetDisconnectStringIdFromExtendedCode`  (modified)

```diff
--- CTSWin32CoreApi::GetDisconnectStringIdFromExtendedCode
+++ CTSWin32CoreApi::GetDisconnectStringIdFromExtendedCode
@@ -1,2 +1,219 @@
-Failed to decompile mstscax.dll - .ProgramDB CTSWin32CoreApi::GetDisconnectStringIdFromExtendedCode : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: unsigned int __cdecl CTSWin32CoreApi::GetDisconnectStringIdFromExtendedCode(unsigned

+   int) __ptr64 */

+

+uint __thiscall

+CTSWin32CoreApi::GetDisconnectStringIdFromExtendedCode(CTSWin32CoreApi *this,uint param_1)

+

+{

+  bool bVar1;

+  uint uVar2;

+  

+  if (param_1 < 0x101) {

+    if (param_1 == 0x100) {

+      uVar2 = 0x3539;

+      goto LAB_0;

+    }

+    if (param_1 < 9) {

+      if (param_1 == 8) {

+        uVar2 = 0x3548;

+        goto LAB_0;

+      }

+      if (param_1 == 1) {

+        uVar2 = 0x3530;

+        goto LAB_0;

+      }

+      if (param_1 == 2) {

+        uVar2 = 0x3532;

+        goto LAB_0;

+      }

+      if (param_1 == 3) {

+        uVar2 = 0x3533;

+        goto LAB_0;

+      }

+      if (param_1 == 4) {

+        uVar2 = 0x3534;

+        goto LAB_0;

+      }

+      if (param_1 == 5) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x16,

+                   &WPP_352e097ed34b3d3302e512ecd06a3729_Traceguids,uVar2);

+        }

+        uVar2 = 0x3531;

+        goto LAB_0;

+      }

+      if (param_1 == 6) {

+        uVar2 = 0x3538;

+        goto LAB_0;

+      }

+      if (param_1 == 7) {

+        uVar2 = 0x3544;

+        goto LAB_0;

+      }

+    }

+    else {

+      if (param_1 == 9) {

+        uVar2 = 0x354c;

+        goto LAB_0;

+      }

+      if (param_1 == 0x19) {

+        uVar2 = 0x7531;

+        goto LAB_0;

+      }

+      if (param_1 == 0x1a) {

+        uVar2 = 0x7532;

+        goto LAB_0;

+      }

+      if (param_1 == 0x1c) {

+        uVar2 = 0x7534;

+        goto LAB_0;

+      }

+      if (param_1 == 0x1d) {

+        bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_DisconnectOnSmartCardAbsence>::

+                __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_DisconnectOnSmartCardAbsence>

+                                     *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_DisconnectOnSmartCardAbsence>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_DisconnectOnSmartCardAbsence>::GetImpl(void)'

+                                        ::__l2::impl);

+        if (!bVar1) {

+          return 0;

+        }

+        uVar2 = 0x357f;

+        goto LAB_0;

+      }

+      if (param_1 == 0x1e) {

+        bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_DisconnectOnSmartCardAbsence>::

+                __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_DisconnectOnSmartCardAbsence>

+                                     *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_DisconnectOnSmartCardAbsence>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_DisconnectOnSmartCardAbsence>::GetImpl(void)'

+                                        ::__l2::impl);

+        if (!bVar1) {

+          return 0;

+        }

+        uVar2 = 0x3580;

+        goto LAB_0;

+      }

+    }

+  }

+  else if (param_1 < 0x401) {

+    if (param_1 == 0x400) {

+      uVar2 = 0x42cd;

+      goto LAB_0;

+    }

+    if (param_1 < 0x107) {

+      if (param_1 == 0x106) {

+        uVar2 = 0x353f;

+        goto LAB_0;

+      }

+      if (param_1 == 0x101) {

+        uVar2 = 0x353a;

+        goto LAB_0;

+      }

+      if (param_1 == 0x102) {

+        uVar2 = 0x353b;

+        goto LAB_0;

+      }

+      if (param_1 == 0x103) {

+        uVar2 = 0x353c;

+        goto LAB_0;

+      }

+      if (param_1 == 0x104) {

+        uVar2 = 0x353d;

+        goto LAB_0;

+      }

+      if (param_1 == 0x105) {

+        uVar2 = 0x353e;

+        goto LAB_0;

+      }

+    }

+    else {

+      if (param_1 == 0x107) {

+        uVar2 = 0x3540;

+        goto LAB_0;

+      }

+      if (param_1 == 0x108) {

+        uVar2 = 0x3541;

+        goto LAB_0;

+      }

+      if (param_1 == 0x109) {

+        uVar2 = 0x3542;

+        goto LAB_0;

+      }

+      if (param_1 == 0x10a) {

+        uVar2 = 0x3543;

+        goto LAB_0;

+      }

+      if (param_1 == 0x10b) {

+        uVar2 = 0x354e;

+        goto LAB_0;

+      }

+    }

+  }

+  else if (param_1 < 0x409) {

+    if (param_1 == 0x408) {

+      uVar2 = 0x42d5;

+      goto LAB_0;

+    }

+    if (param_1 == 0x402) {

+      uVar2 = 0x42cf;

+      goto LAB_0;

+    }

+    if (param_1 == 0x404) {

+      uVar2 = 0x42d3;

+      goto LAB_0;

+    }

+    if (param_1 == 0x405) {

+      uVar2 = 0x42d0;

+      goto LAB_0;

+    }

+    if (param_1 == 0x406) {

+      uVar2 = 0x42d1;

+      goto LAB_0;

+    }

+    if (param_1 == 0x407) {

+      uVar2 = 0x42d4;

+      goto LAB_0;

+    }

+  }

+  else {

+    if (param_1 == 0x409) {

+      uVar2 = 0x42d9;

+      goto LAB_0;

+    }

+    if (param_1 == 0x410) {

+      uVar2 = 0x42d6;

+      goto LAB_0;

+    }

+    if (param_1 == 0x411) {

+      uVar2 = 0x42d7;

+      goto LAB_0;

+    }

+    if (param_1 == 0x412) {

+      uVar2 = 0x42d8;

+      goto LAB_0;

+    }

+  }

+  uVar2 = param_1 - 0x1000;

+  if (0x6fff < uVar2) {

+    return 0;

+  }

+  if (param_1 == 0x10f3) {

+    uVar2 = 0x3a9d;

+  }

+  else if ((param_1 == 0x1134) || (param_1 == 0x1135)) {

+    uVar2 = 0x354f;

+  }

+  else if (uVar2 == 0x136) {

+    uVar2 = 0x3550;

+  }

+  else if (uVar2 == 0x192) {

+    uVar2 = 0x3547;

+  }

+  else {

+    uVar2 = 0x3535;

+  }

+LAB_0:

+  uVar2 = GetMappedStringId(this,uVar2);

+  return uVar2;

+}

+
```

## `CIH::IHAddMouseEventToPDU`  (modified)

```diff
--- CIH::IHAddMouseEventToPDU
+++ CIH::IHAddMouseEventToPDU
@@ -1,2 +1,230 @@
-Failed to decompile mstscax.dll - .ProgramDB CIH::IHAddMouseEventToPDU : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: int __cdecl CIH::IHAddMouseEventToPDU(enum TS_INPUT_MOUSE_EVENT_TYPE,union

+   tagTS_INPUT_MOUSE_DATA * __ptr64) __ptr64 */

+

+int __thiscall

+CIH::IHAddMouseEventToPDU

+          (CIH *this,TS_INPUT_MOUSE_EVENT_TYPE param_1,tagTS_INPUT_MOUSE_DATA *param_2)

+

+{

+  ushort *puVar1;

+  ushort uVar2;

+  longlong lVar3;

+  char cVar4;

+  ushort uVar5;

+  undefined4 uVar6;

+  int iVar7;

+  short sVar8;

+  ulonglong uVar9;

+  undefined4 uVar10;

+  undefined4 local_res20 [2];

+  undefined4 in_stack_ffffffffffffffc8;

+  undefined2 uVar11;

+  

+  uVar11 = (undefined2)((uint)in_stack_ffffffffffffffc8 >> 0x10);

+  cVar4 = FeatureMsrc108622();

+  if ((cVar4 != '\0') && (*(longlong *)(this + 0xb0) == 0)) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return 0;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return 0;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return 0;

+    }

+    uVar6 = RdpX_GetActivityIdPrefix();

+    uVar10 = 0x1e;

+LAB_0:

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar10,

+             &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar6);

+    return 0;

+  }

+  iVar7 = (**(code **)(**(longlong **)(this + 0xb0) + 0x168))();

+  if (iVar7 != 0) {

+    return 1;

+  }

+  lVar3 = *(longlong *)(this + 0x48);

+  if (lVar3 == 0) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return 0;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return 0;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return 0;

+    }

+    uVar6 = RdpX_GetActivityIdPrefix();

+    uVar10 = 0x1f;

+    goto LAB_0;

+  }

+  uVar9 = (ulonglong)*(ushort *)(lVar3 + 0x12);

+  if (*(uint *)(this + 0x50) <= (uint)*(ushort *)(lVar3 + 0x12)) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return 0;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return 0;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 3) {

+      return 0;

+    }

+    uVar6 = RdpX_GetActivityIdPrefix();

+    uVar10 = 0x20;

+    goto LAB_0;

+  }

+  if ((param_1 - 4 < 2) && (*(int *)(this + 0x70) == 0)) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return 0;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return 0;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 4) {

+      return 0;

+    }

+    uVar6 = RdpX_GetActivityIdPrefix();

+    uVar10 = 0x21;

+    goto LAB_0;

+  }

+  *(undefined8 *)(lVar3 + 0x16 + uVar9 * 0xc) = 0;

+  *(undefined4 *)(lVar3 + 0x1e + uVar9 * 0xc) = 0;

+  *(undefined2 *)(lVar3 + 0x1a + uVar9 * 0xc) = 0x8001;

+  if (param_1 == 0) {

+    *(undefined2 *)(lVar3 + 0x1c + uVar9 * 0xc) = 0x800;

+LAB_1:

+    *(undefined2 *)(lVar3 + 0x1e + uVar9 * 0xc) = *(undefined2 *)param_2;

+    *(undefined2 *)(lVar3 + 0x20 + uVar9 * 0xc) = *(undefined2 *)(param_2 + 4);

+    goto LAB_2;

+  }

+  if ((param_1 == 1) || (param_1 == 2)) {

+    uVar5 = 0x200;

+    if (param_1 != 1) {

+      uVar5 = 0x400;

+    }

+    *(ushort *)(lVar3 + 0x1c + uVar9 * 0xc) = uVar5;

+    uVar2 = *(ushort *)param_2;

+    if (0xff < (short)uVar2) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar6 = RdpX_GetActivityIdPrefix();

+        WPP_SF_DH(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x22,

+                  &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar6,CONCAT22(uVar11,uVar2));

+      }

+      puVar1 = (ushort *)(lVar3 + 0x1c + uVar9 * 0xc);

+      *puVar1 = *puVar1 | 0xff;

+      goto LAB_2;

+    }

+    if (-0x101 < (short)uVar2) {

+      *(ushort *)(lVar3 + 0x1c + uVar9 * 0xc) = uVar2 & 0x1ff | uVar5;

+      goto LAB_2;

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar6 = RdpX_GetActivityIdPrefix();

+      WPP_SF_DH(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x23,

+                &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar6,CONCAT22(uVar11,uVar2));

+    }

+    uVar5 = 0x100;

+LAB_3:

+    puVar1 = (ushort *)(lVar3 + 0x1c + uVar9 * 0xc);

+    *puVar1 = *puVar1 | uVar5;

+  }

+  else {

+    if (param_1 == 3) {

+      *(undefined2 *)(lVar3 + 0x1e + uVar9 * 0xc) = *(undefined2 *)(param_2 + 8);

+      *(undefined2 *)(lVar3 + 0x20 + uVar9 * 0xc) = *(undefined2 *)(param_2 + 0xc);

+      iVar7 = *(int *)param_2;

+      if (iVar7 != 0) {

+        if (iVar7 == 1) {

+LAB_4:

+          sVar8 = (-(ushort)(*(int *)(param_2 + 4) != 0) & 0x8000) + 0x2000;

+          goto LAB_5;

+        }

+        if (iVar7 == 2) {

+LAB_6:

+          sVar8 = (-(ushort)(*(int *)(param_2 + 4) != 0) & 0x8000) + 0x4000;

+          goto LAB_5;

+        }

+        if (iVar7 == 3) {

+          if (*(int *)(param_2 + 4) != 0) {

+            *(undefined2 *)(lVar3 + 0x1c + uVar9 * 0xc) = 0x8000;

+          }

+          puVar1 = (ushort *)(lVar3 + 0x1c + uVar9 * 0xc);

+          *puVar1 = *puVar1 | 1;

+          *(undefined2 *)(lVar3 + 0x1a + uVar9 * 0xc) = 0x8002;

+          goto LAB_2;

+        }

+        if (iVar7 != 4) goto LAB_2;

+        if (*(int *)(param_2 + 4) != 0) {

+          *(undefined2 *)(lVar3 + 0x1c + uVar9 * 0xc) = 0x8000;

+        }

+        *(undefined2 *)(lVar3 + 0x1a + uVar9 * 0xc) = 0x8002;

+        uVar5 = 2;

+        goto LAB_3;

+      }

+    }

+    else {

+      if (param_1 == 4) {

+        *(undefined4 *)(lVar3 + 0x1a + uVar9 * 0xc) = 0x8008004;

+        goto LAB_1;

+      }

+      if (param_1 != 5) {

+        if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+          return 0;

+        }

+        if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+          return 0;

+        }

+        if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+          return 0;

+        }

+        uVar6 = RdpX_GetActivityIdPrefix();

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x24,

+                  &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar6,param_1);

+        return 0;

+      }

+      *(undefined2 *)(lVar3 + 0x1a + uVar9 * 0xc) = 0x8004;

+      *(undefined2 *)(lVar3 + 0x1e + uVar9 * 0xc) = *(undefined2 *)(param_2 + 8);

+      *(undefined2 *)(lVar3 + 0x20 + uVar9 * 0xc) = *(undefined2 *)(param_2 + 0xc);

+      iVar7 = *(int *)param_2;

+      if (iVar7 != 0) {

+        if (iVar7 == 1) goto LAB_4;

+        if (iVar7 == 2) goto LAB_6;

+        if (iVar7 != 3) {

+          if (iVar7 == 4) {

+            if (*(int *)(param_2 + 4) == 0) {

+              *(undefined2 *)(lVar3 + 0x1c + uVar9 * 0xc) = 2;

+            }

+            else {

+              *(undefined2 *)(lVar3 + 0x1c + uVar9 * 0xc) = 0x8002;

+            }

+          }

+          goto LAB_2;

+        }

+        sVar8 = (-(ushort)(*(int *)(param_2 + 4) != 0) & 0x8000) + 1;

+LAB_5:

+        *(short *)(lVar3 + 0x1c + uVar9 * 0xc) = sVar8;

+        goto LAB_2;

+      }

+    }

+    if (*(int *)(param_2 + 4) == 0) {

+      *(undefined2 *)(lVar3 + 0x1c + uVar9 * 0xc) = 0x1000;

+    }

+    else {

+      *(undefined2 *)(lVar3 + 0x1c + uVar9 * 0xc) = 0x9000;

+    }

+  }

+LAB_2:

+  local_res20[0] = 0;

+  PAL_System_TimeGetTickCount(local_res20);

+  *(undefined4 *)(lVar3 + 0x16 + uVar9 * 0xc) = local_res20[0];

+  *(short *)(*(longlong *)(this + 0x48) + 0x12) = *(short *)(*(longlong *)(this + 0x48) + 0x12) + 1;

+  **(short **)(this + 0x48) = **(short **)(this + 0x48) + 0xc;

+  *(short *)(*(longlong *)(this + 0x48) + 0xc) = *(short *)(*(longlong *)(this + 0x48) + 0xc) + 0xc;

+  return 0;

+}

+
```

## `CAsyncIIrpStub::Activate`  (modified)

```diff
--- CAsyncIIrpStub::Activate
+++ CAsyncIIrpStub::Activate
@@ -1,2 +1,29 @@
-Failed to decompile mstscax.dll - .ProgramDB CAsyncIIrpStub::Activate : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl CAsyncIIrpStub::Activate(struct IDeviceCollection * __ptr64) __ptr64

+    */

+

+long __thiscall CAsyncIIrpStub::Activate(CAsyncIIrpStub *this,IDeviceCollection *param_1)

+

+{

+  TCntPtr<ITSThread> *this_00;

+  long lVar1;

+  uint uVar2;

+  

+  this_00 = (TCntPtr<ITSThread> *)(this + 0x38);

+  if (*(longlong *)this_00 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(this_00);

+    *(undefined8 *)this_00 = 0;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)this_00);

+  }

+  lVar1 = CIrpRedirector::CreateInstance((IAsyncIIrpProxy **)this_00,param_1);

+  if ((((lVar1 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+      ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xc,

+               &WPP_bac39d95deb13f2c16bdb4d5bb87b640_Traceguids,uVar2,

+               "CIrpRedirector::CreateInstance",lVar1);

+  }

+  return lVar1;

+}

+
```

## `CRdrServerRequestHandler::OnCustomEvent`  (modified)

```diff
--- CRdrServerRequestHandler::OnCustomEvent
+++ CRdrServerRequestHandler::OnCustomEvent
@@ -1,2 +1,88 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdrServerRequestHandler::OnCustomEvent : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: virtual long __cdecl CRdrServerRequestHandler::OnCustomEvent(struct _GUID,unsigned

+   long,unsigned char * __ptr64) __ptr64 */

+

+long __thiscall

+CRdrServerRequestHandler::OnCustomEvent

+          (CRdrServerRequestHandler *this,_GUID *param_1,ulong param_2,uchar *param_3)

+

+{

+  undefined8 uVar1;

+  undefined8 uVar2;

+  bool bVar3;

+  uint uVar4;

+  long lVar5;

+  void *pvVar6;

+  longlong lVar7;

+  longlong *plVar8;

+  longlong *local_38;

+  CTSCriticalSection *local_30;

+  

+  plVar8 = (longlong *)0x0;

+  local_38 = (longlong *)0x0;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1e,

+             &WPP_f26f1544384632a256a4da45cfc15c0a_Traceguids,uVar4);

+  }

+  uVar4 = param_2 + 0x19;

+  if ((uVar4 < 0x19) || (uVar4 < param_2)) {

+    lVar5 = -0x7ff8ffa9;

+    goto LAB_0;

+  }

+  pvVar6 = operator_new((ulonglong)uVar4);

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

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1f,

+               &WPP_f26f1544384632a256a4da45cfc15c0a_Traceguids,uVar4);

+    }

+    lVar5 = -0x7ff8fff2;

+    goto LAB_0;

+  }

+  uVar1 = *(undefined8 *)param_1;

+  uVar2 = *(undefined8 *)param_1->Data4;

+  *(undefined1 *)((longlong)pvVar6 + 3) = 1;

+  *(ulong *)((longlong)pvVar6 + 0x14) = param_2;

+  *(undefined8 *)((longlong)pvVar6 + 4) = uVar1;

+  *(undefined8 *)((longlong)pvVar6 + 0xc) = uVar2;

+  memcpy((void *)((longlong)pvVar6 + 0x18),param_3,(ulonglong)param_2);

+  bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_4198753594> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_4198753594>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar3) {

+    local_30 = (CTSCriticalSection *)(this + 0x70);

+    CTSCriticalSection::Lock(local_30);

+    if (*(longlong *)(this + 0x40) != 0) {

+      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_38);

+      plVar8 = *(longlong **)(this + 0x40);

+      local_38 = plVar8;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_38);

+    }

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_30);

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

+      lVar7 = *plVar8;

+      goto LAB_1;

+    }

+LAB_2:

+    lVar5 = -0x7fffbffb;

+  }

+  else {

+    plVar8 = *(longlong **)(this + 0x40);

+    if (plVar8 == (longlong *)0x0) goto LAB_2;

+    lVar7 = *plVar8;

+LAB_1:

+    lVar5 = (**(code **)(lVar7 + 0x18))(plVar8,uVar4,pvVar6,0);

+  }

+  operator_delete(pvVar6);

+LAB_0:

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_38);

+  return lVar5;

+}

+
```

## `RdpWinDesktopRemoteAppUIManager::SetRemoteAppCore`  (modified)

```diff
--- RdpWinDesktopRemoteAppUIManager::SetRemoteAppCore
+++ RdpWinDesktopRemoteAppUIManager::SetRemoteAppCore
@@ -1,2 +1,411 @@
-Failed to decompile mstscax.dll - .ProgramDB RdpWinDesktopRemoteAppUIManager::SetRemoteAppCore : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: virtual enum _XResult32 __cdecl RdpWinDesktopRemoteAppUIManager::SetRemoteAppCore(struct

+   RdpXInterfaceRemoteAppCore * __ptr64) __ptr64 */

+

+_XResult32 __thiscall

+RdpWinDesktopRemoteAppUIManager::SetRemoteAppCore

+          (RdpWinDesktopRemoteAppUIManager *this,RdpXInterfaceRemoteAppCore *param_1)

+

+{

+  RdpXSPtr<RdpXInterfaceTapClientShellCallback> *this_00;

+  longlong *plVar1;

+  bool bVar2;

+  uint uVar3;

+  long lVar4;

+  uint uVar5;

+  _XResult32 _Var6;

+  ITSThread *pIVar7;

+  _TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_> *p_Var8;

+  char *pcVar9;

+  RdpWinDesktopRemoteAppUIManager *this_01;

+  undefined8 uVar10;

+  ITSThread *pIVar11;

+  RdpWin32RemoteAppPresenter *this_02;

+  longlong lVar12;

+  int iVar13;

+  ulonglong uVar14;

+  RdpWinDesktopRemoteAppUIManager *pRVar15;

+  CTSCriticalSection *local_res18;

+  ITSThread *local_res20;

+  longlong local_78;

+  undefined8 local_70;

+  RdpWin32RemoteAppPresenter *local_68;

+  CTSRegEntry local_60 [8];

+  int local_58;

+  

+  local_78 = 0;

+  local_res18 = (CTSCriticalSection *)(this + 0x460);

+  local_res20 = (ITSThread *)0x0;

+  CTSCriticalSection::Lock(local_res18);

+  if (((byte)this[0x4c] & 4) == 0) {

+    this_00 = (RdpXSPtr<RdpXInterfaceTapClientShellCallback> *)(this + 0x458);

+    RdpXSPtr<RdpXInterfaceTapClientShellCallback>::operator=

+              (this_00,(RdpXInterfaceTapClientShellCallback *)param_1);

+    lVar12 = 0;

+    if (*(longlong *)(this + 0xa8) != 0) {

+      TCntPtr<ITSInstance>::SafeRelease((TCntPtr<ITSInstance> *)&local_78);

+      lVar12 = *(longlong *)(this + 0xa8);

+      local_78 = lVar12;

+      TCntPtr<ITSInstance>::SafeAddRef((TCntPtr<ITSInstance> *)&local_78);

+    }

+    pIVar11 = (ITSThread *)0x0;

+    if ((lVar12 != 0) &&

+       (pIVar7 = (ITSThread *)

+                 (**(code **)(*(longlong *)

+                               ((longlong)*(int *)(*(longlong *)(lVar12 + 8) + 4) + lVar12 + 8) +

+                             0x68))(), pIVar7 != (ITSThread *)0x0)) {

+      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+      local_res20 = pIVar7;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_res20);

+      pIVar11 = pIVar7;

+    }

+    pRVar15 = this + 0xb8;

+    lVar4 = WindowsRemoteAppLib::CRailUiVisibleUiState::CreateInstance

+                      (*(ITSInstance **)(this + 0xa8),(CRailUiVisibleUiState **)pRVar15);

+    if (lVar4 < 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar10 = 0x17;

+LAB_0:

+        pcVar9 = "CWinManager::CreateInstance failed";

+        goto LAB_1;

+      }

+    }

+    else {

+      lVar4 = WindowsRemoteAppLib::CWinManager::CreateInstance

+                        (*(RdpXInterfaceRemoteAppCore **)this_00,*(ITSWin32CoreApi **)(this + 0xb0),

+                         *(CRailUiVisibleUiState **)pRVar15,(CWinManager **)(this + 0xc0));

+      if (lVar4 < 0) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+          uVar10 = 0x18;

+          goto LAB_0;

+        }

+      }

+      else {

+        lVar4 = WindowsRemoteAppLib::CRailUiManager::CreateInstance

+                          (*(RdpXInterfaceRemoteAppCore **)this_00,

+                           *(CRailUiVisibleUiState **)pRVar15,*(ITSWin32CoreApi **)(this + 0xb0),

+                           (CRailUiManager **)(this + 200));

+        if (lVar4 < 0) {

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+            uVar10 = 0x19;

+            pcVar9 = "CRailUiManager::CreateInstance failed";

+            goto LAB_1;

+          }

+        }

+        else {

+          WindowsRemoteAppLib::CRailUiVisibleUiState::SetUiManagers

+                    (*(CRailUiVisibleUiState **)pRVar15,*(CRailUiManager **)(this + 200),

+                     *(CRailUiManager **)(this + 0xc0));

+          pRVar15 = this + 0x458;

+          lVar4 = WindowsRemoteAppLib::CRailEventsWindow::CreateInstance

+                            (*(RdpXInterfaceRemoteAppCore **)pRVar15,

+                             *(ITSWin32CoreApi **)(this + 0xb0),

+                             (RdpXInterfaceDesktopRemoteAppCore *)this,

+                             (CRailEventsWindow **)(this + 0xd0));

+          if (lVar4 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+              uVar10 = 0x1a;

+              pcVar9 = "CRailEventsWindow::CreateInstance failed";

+              goto LAB_1;

+            }

+          }

+          else {

+            lVar4 = WindowsRemoteAppLib::CRdpWinTextScaleMonitor::CreateInstance

+                              (*(RdpXInterfaceRemoteAppCore **)pRVar15,

+                               (CRdpWinTextScaleMonitor **)(this + 0xe0));

+            if ((((lVar4 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+              WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1b,

+                         &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,

+                         "CRdpWinTextScaleMonitor::CreateInstance failed",lVar4);

+            }

+            lVar4 = WindowsRemoteAppLib::CRdpWinUISettingsMonitor::CreateInstance

+                              (*(RdpXInterfaceRemoteAppCore **)pRVar15,

+                               (CRdpWinUISettingsMonitor **)(this + 0xe8));

+            if (((lVar4 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+               (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+              uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+              WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1c,

+                         &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,

+                         "CRdpWinUISettingsMonitor::CreateInstance failed",lVar4);

+            }

+            lVar4 = WindowsRemoteAppLib::CRdpWinCaretBlinkMonitor::CreateInstance

+                              (*(RdpXInterfaceRemoteAppCore **)pRVar15,

+                               (CRdpWinCaretBlinkMonitor **)(this + 0xf0));

+            if (((lVar4 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+               (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+              uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+              WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1d,

+                         &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,

+                         "CRdpWinCaretBlinkMonitor::CreateInstance failed",lVar4);

+            }

+            lVar4 = WindowsRemoteAppLib::CRdpWinClosedCaptionSettingsMonitor::CreateInstance

+                              (*(RdpXInterfaceRemoteAppCore **)pRVar15,

+                               (CRdpWinClosedCaptionSettingsMonitor **)(this + 0xf8));

+            if ((((lVar4 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+              WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1e,

+                         &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,

+                         "CRdpWinClosedCaptionSettingsMonitor::CreateInstance failed",lVar4);

+            }

+            lVar4 = WindowsRemoteAppLib::CRdpWinAccentColorSettingsMonitor::CreateInstance

+                              (*(RdpXInterfaceRemoteAppCore **)pRVar15,pIVar11,

+                               (CRdpWinAccentColorSettingsMonitor **)(this + 0x100));

+            if (((lVar4 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+               (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+              uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+              WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1f,

+                         &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,

+                         "CRdpWinAccentColorSettingsMonitor::CreateInstance failed",lVar4);

+            }

+            lVar4 = WindowsRemoteAppLib::CRdpWinLightThemeSettingsMonitor::CreateInstance

+                              (*(RdpXInterfaceRemoteAppCore **)pRVar15,

+                               (CRdpWinLightThemeSettingsMonitor **)(this + 0x108));

+            if (((lVar4 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+               (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+              uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+              WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x20,

+                         &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,

+                         "CRdpWinLightThemeSettingsMonitor::CreateInstance failed",lVar4);

+            }

+            uVar3 = (**(code **)(**(longlong **)pRVar15 + 0x78))();

+            if ((uVar3 & 8) == 0) {

+              this_01 = (RdpWinDesktopRemoteAppUIManager *)WPP_GLOBAL_Control;

+              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                  ((WPP_GLOBAL_Control[0x1c] & 0x40) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19]))

+              {

+                uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+                this_01 = *(RdpWinDesktopRemoteAppUIManager **)(WPP_GLOBAL_Control + 0x10);

+                WPP_SF_D(this_01,0x21,&WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar5);

+              }

+              HideLangBar(this_01);

+LAB_2:

+              local_70 = *(undefined8 *)(this + 200);

+              TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                        ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)&local_70);

+              uVar14 = (ulonglong)uVar3;

+              lVar4 = WindowsRemoteAppLib::RailLanguagebarHandler::Initialize

+                                ((RailLanguagebarHandler *)(this + 0x1e0),*(undefined8 *)pRVar15,

+                                 &local_70);

+              if (lVar4 < 0) {

+                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                    ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19]))

+                {

+                  uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+                  uVar10 = 0x24;

+                  pcVar9 = "RailLanguagebarHandler::Initialize failed";

+LAB_1:

+                  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar10,

+                             &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,pcVar9,lVar4);

+                }

+              }

+              else {

+                pRVar15 = this + 0x1a0;

+                AcquireSRWLockExclusive((PSRWLOCK)pRVar15);

+                bVar2 = wil::details::

+                        FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::

+                        __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>

+                                             *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::GetImpl(void)'

+                                                ::__l2::impl);

+                if (!bVar2) {

+                  p_Var8 = *(_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                             **)(this + 0x170);

+LAB_3:

+                  iVar13 = (int)uVar14;

+                  if (p_Var8 != (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                                 *)(this + 0x160)) {

+                    lVar4 = RdpWin32RemoteAppPresenter::SetRemoteAppCore

+                                      (*(RdpWin32RemoteAppPresenter **)(p_Var8 + 0x20),

+                                       *(RdpXInterfaceRemoteAppCore **)(this + 0x458));

+                    if (-1 < lVar4) goto code_r0x00018021672d;

+                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                      uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+                      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x26,

+                                 &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,

+                                 "SetRemoteAppCore failed",lVar4);

+                    }

+LAB_4:

+                    ReleaseSRWLockExclusive((PSRWLOCK)pRVar15);

+                    goto LAB_5;

+                  }

+                  goto LAB_6;

+                }

+                for (p_Var8 = *(_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                                **)(this + 400); iVar13 = (int)uVar14,

+                    p_Var8 != (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                               *)(this + 0x180);

+                    p_Var8 = (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                              *)utl::

+                                _TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                                ::_Traverse(p_Var8,true)) {

+                  local_70 = CONCAT44(local_70._4_4_,*(undefined4 *)(p_Var8 + 0x18));

+                  if (p_Var8 + 0x20 ==

+                      (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                       *)0x0) {

+                    this_02 = (RdpWin32RemoteAppPresenter *)0x0;

+                    local_68 = (RdpWin32RemoteAppPresenter *)0x0;

+                  }

+                  else {

+                    this_02 = *(RdpWin32RemoteAppPresenter **)(p_Var8 + 0x20);

+                    local_68 = this_02;

+                    RdpXSPtr<RdpXInterfaceArray>::SafeAddRef

+                              ((RdpXSPtr<RdpXInterfaceArray> *)&local_68);

+                  }

+                  lVar4 = RdpWin32RemoteAppPresenter::SetRemoteAppCore

+                                    (this_02,*(RdpXInterfaceRemoteAppCore **)(this + 0x458));

+                  if (lVar4 < 0) {

+                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                      uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+                      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x25,

+                                 &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,

+                                 "SetRemoteAppCore failed",lVar4);

+                    }

+                    RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+                              ((RdpXSPtr<RdpXInterfaceCriticalSection> *)&local_68);

+                    goto LAB_4;

+                  }

+                  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+                            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)&local_68);

+                }

+LAB_6:

+                ReleaseSRWLockExclusive((PSRWLOCK)pRVar15);

+                if ((uVar3 & 4) != 0) {

+                  pRVar15 = this + 8;

+                  lVar4 = RemoteAppTaskbarHandler::CreateInstance

+                                    ((RdpXInterfaceRemoteAppUIManager *)

+                                     (-(ulonglong)(this != (RdpWinDesktopRemoteAppUIManager *)0x0) &

+                                     (ulonglong)pRVar15),*(ITSWin32CoreApi **)(this + 0xb0),

+                                     (RemoteAppTaskbarHandler **)(this + 0xd8));

+                  iVar13 = (int)pRVar15;

+                  if (lVar4 < 0) {

+                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                      uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+                      uVar10 = 0x27;

+                      pcVar9 = "RemoteAppTaskbarHandler::CreateInstance failed";

+                      goto LAB_1;

+                    }

+                    goto LAB_5;

+                  }

+                }

+                if (((uVar3 & 0x40) == 0) ||

+                   (lVar4 = WindowsRemoteAppLib::CRdpWin32HookEvents::CreateInstance

+                                      (*(CWinManager **)(this + 0xc0),

+                                       (CRdpWin32HookEvents **)(this + 0x450)), -1 < lVar4)) {

+                  CTSRegEntry::CTSRegEntry

+                            (local_60,(ushort *)L"SOFTWARE\\Microsoft\\Terminal Server Client\\",

+                             (HKEY__ *)0xffffffff80000001,iVar13,0x20019);

+                  if (local_58 == 0) {

+                    CTSRegEntry::GetNumber

+                              (local_60,(ushort *)L"RailScalabilityTest",0,(long *)(this + 0x1bc));

+                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) &&

+                       (2 < (byte)WPP_GLOBAL_Control[0x19])) {

+                      lVar4 = *(long *)(this + 0x1bc);

+                      uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+                      WPP_SF_DSd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x29,

+                                 &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,

+                                 L"RailScalabilityTest",lVar4);

+                    }

+                  }

+                  if ((*(int *)(this + 0x1bc) == 0) ||

+                     (lVar4 = SetupScalabilityTestWindow(this), -1 < lVar4)) {

+                    CTSRegEntry::~CTSRegEntry(local_60);

+                    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res18);

+                    *(uint *)(this + 0x4c) = *(uint *)(this + 0x4c) | 2;

+                    lVar4 = 0;

+                    goto LAB_7;

+                  }

+                  if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                     (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))

+                     ) {

+                    uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+                    WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x2a,

+                               &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,

+                               "SetupScalabilityTestWindow failed",lVar4);

+                  }

+                  CTSRegEntry::~CTSRegEntry(local_60);

+                }

+                else if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                        (((WPP_GLOBAL_Control[0x1c] & 8) != 0 &&

+                         (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+                  uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+                  uVar10 = 0x28;

+                  pcVar9 = "CRdpWin32HookEvents::CreateInstance failed";

+                  goto LAB_1;

+                }

+              }

+            }

+            else {

+              plVar1 = *(longlong **)(this + 0x448);

+              if (plVar1 == (longlong *)0x0) {

+                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                    ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19]))

+                {

+                  uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+                  WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x22,

+                            &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,

+                            "m_spRdpWinLanguageEvents");

+                }

+                lVar4 = -0x7fffbffd;

+              }

+              else {

+                lVar4 = (**(code **)(*plVar1 + 0x48))(plVar1,*(undefined8 *)pRVar15);

+                if (-1 < lVar4) goto LAB_2;

+                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                    ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19]))

+                {

+                  uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+                  uVar10 = 0x23;

+                  pcVar9 = "SetRemoteAppCore failed";

+                  goto LAB_1;

+                }

+              }

+            }

+          }

+        }

+      }

+    }

+  }

+  else {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x16,

+                &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar3,0x8000ffff);

+    }

+    lVar4 = -0x7fff0001;

+  }

+LAB_5:

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res18);

+  Terminate(this + 0x38);

+LAB_7:

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+  TCntPtr<ITSInstance>::SafeRelease((TCntPtr<ITSInstance> *)&local_78);

+  _Var6 = MapHRToXResult(lVar4);

+  return _Var6;

+code_r0x00018021672d:

+  p_Var8 = (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_> *)

+           utl::_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>::

+           _Traverse(p_Var8,true);

+  goto LAB_3;

+}

+
```

## `CRdrServerRequestHandler::DoIoCancel`  (modified)

```diff
--- CRdrServerRequestHandler::DoIoCancel
+++ CRdrServerRequestHandler::DoIoCancel
@@ -1,2 +1,29 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdrServerRequestHandler::DoIoCancel : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: long __cdecl CRdrServerRequestHandler::DoIoCancel(void) __ptr64 */

+

+long __thiscall CRdrServerRequestHandler::DoIoCancel(CRdrServerRequestHandler *this)

+

+{

+  bool bVar1;

+  CTSCriticalSection *local_res10 [3];

+  

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_4198753594> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_4198753594>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar1) {

+    local_res10[0] = (CTSCriticalSection *)(this + 0x80);

+    CTSCriticalSection::Lock(local_res10[0]);

+    if (*(longlong **)(this + 0x48) != (longlong *)0x0) {

+      (**(code **)(**(longlong **)(this + 0x48) + 0x30))();

+    }

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)local_res10);

+  }

+  else if (*(longlong **)(this + 0x48) != (longlong *)0x0) {

+    (**(code **)(**(longlong **)(this + 0x48) + 0x30))();

+  }

+  return 0;

+}

+
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptClipboardPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptClipboardPermissionItem>
+++ CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptClipboardPermissionItem>
@@ -1,2 +1,126 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptClipboardPermissionItem> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

+   CRedirectPromptClipboardPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi *

+   __ptr64,class ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptClipboardPermissionItem>

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int *param_5)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  uint uVar4;

+  CRedirectPromptClipboardPermissionItem *pCVar5;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res10;

+  ITSCoreApi *local_res18;

+  ITSWin32CoreApi *local_res20;

+  int *in_stack_ffffffffffffffd0;

+  CRedirectPromptBasePermissionItem *local_28;

+  CRedirectPromptClipboardPermissionItem *local_20;

+  

+  local_res10 = param_1;

+  local_res18 = param_2;

+  local_res20 = param_3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  local_20 = (CRedirectPromptClipboardPermissionItem *)0x0;

+  if (bVar1) {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptClipboardPermissionItem,CRedirectPromptClipboardPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) {

+LAB_0:

+      pCVar5 = local_20;

+      param_5._0_4_ = 0;

+      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

+                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

+      if (lVar2 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x36f,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+LAB_1:

+      }

+      else {

+        if ((int)param_5 != 0) {

+          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

+          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

+                                    &_GUID_00000000_0000_0000_c000_000000000046);

+          if (iVar3 == 0) {

+            iVar3 = InlineIsEqualGUID();

+            if (iVar3 == 0) {

+              iVar3 = InlineIsEqualGUID();

+              if (iVar3 != 0) {

+                pCVar5 = pCVar5 + 8;

+                goto LAB_2;

+              }

+              lVar2 = -0x7fffbffe;

+            }

+            else {

+LAB_2:

+              lVar2 = 0;

+              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+            }

+            if (lVar2 < 0) {

+              wil::details::in1diag3::Return_Hr

+                        (unaff_retaddr,0x379,

+                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+              goto LAB_1;

+            }

+          }

+          else {

+            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+          }

+          bVar1 = utl::

+                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                               *)(this + 0x28),

+                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

+                              )&local_28);

+          if (!bVar1) {

+            lVar2 = -0x7ff8fff2;

+            wil::details::in1diag3::Return_Hr

+                      (unaff_retaddr,0x37a,

+                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

+            ;

+            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+            goto LAB_3;

+          }

+          g_wasClipboardRequested = 1;

+          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+        }

+        lVar2 = 0;

+      }

+      goto LAB_3;

+    }

+    uVar4 = 0x367;

+  }

+  else {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptClipboardPermissionItem,CRedirectPromptClipboardPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) goto LAB_0;

+    uVar4 = 0x36b;

+  }

+  wil::details::in1diag3::Return_Hr

+            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+             lVar2);

+LAB_3:

+  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

+  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

+            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

+  return lVar2;

+}

+
```

## `Hevc420Decompressor::BuildQualityMap`  (modified)

```diff
--- Hevc420Decompressor::BuildQualityMap
+++ Hevc420Decompressor::BuildQualityMap
@@ -1,2 +1,60 @@
-Failed to decompile mstscax.dll - .ProgramDB Hevc420Decompressor::BuildQualityMap : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: long __cdecl Hevc420Decompressor::BuildQualityMap(void) __ptr64 */

+

+long __thiscall Hevc420Decompressor::BuildQualityMap(Hevc420Decompressor *this)

+

+{

+  uint uVar1;

+  void *pvVar2;

+  bool bVar3;

+  undefined4 uVar4;

+  long lVar5;

+  longlong lVar6;

+  undefined4 *puVar7;

+  ulonglong uVar8;

+  

+  lVar6 = *(longlong *)(this + 0x28);

+  lVar5 = 0;

+  uVar1 = *(uint *)(lVar6 + 0x48);

+  uVar8 = (ulonglong)uVar1;

+  pvVar2 = *(void **)(lVar6 + 0x40);

+  *(undefined8 *)(lVar6 + 0x40) = 0;

+  operator_delete__((void *)0x0);

+  *(undefined8 *)(lVar6 + 0x40) = 0;

+  operator_delete__((void *)0x0);

+  bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_296728890>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_296728890> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_296728890>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_296728890>::GetImpl(void)'

+                      ::__l2::impl);

+  if ((bVar3) && (*(uint *)(this + 0xd8) < uVar1)) {

+    lVar5 = -0x7ff8ffa9;

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpX_GetActivityIdPrefix();

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x5a,

+                 &WPP_14c3f4450ed43549625d52ef5dd326f3_Traceguids,uVar4,

+                 "NumRectsQPs exceeds m_maxRects in HEVC420 BuildQualityMap",0x80070057);

+    }

+  }

+  else {

+    *(uint *)(this + 0xdc) = uVar1;

+    if (uVar1 != 0) {

+      lVar6 = 0;

+      puVar7 = (undefined4 *)((longlong)pvVar2 + 0xc);

+      do {

+        *(undefined4 *)(lVar6 + *(longlong *)(this + 0x88)) = puVar7[-3];

+        *(undefined4 *)(lVar6 + 4 + *(longlong *)(this + 0x88)) = puVar7[-2];

+        *(undefined4 *)(lVar6 + 0xc + *(longlong *)(this + 0x88)) = *puVar7;

+        *(undefined4 *)(lVar6 + 8 + *(longlong *)(this + 0x88)) = puVar7[-1];

+        *(undefined4 *)(lVar6 + 0x10 + *(longlong *)(this + 0x88)) = puVar7[2];

+        *(undefined1 *)(lVar6 + 0x14 + *(longlong *)(this + 0x88)) = *(undefined1 *)(puVar7 + 1);

+        uVar8 = uVar8 - 1;

+        lVar6 = lVar6 + 0x1c;

+        puVar7 = puVar7 + 6;

+      } while (uVar8 != 0);

+    }

+  }

+  operator_delete__(pvVar2);

+  return lVar5;

+}

+
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptDrivesPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptDrivesPermissionItem>
+++ CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptDrivesPermissionItem>
@@ -1,2 +1,126 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptDrivesPermissionItem> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

+   CRedirectPromptDrivesPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi *

+   __ptr64,class ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptDrivesPermissionItem>

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int *param_5)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  uint uVar4;

+  CRedirectPromptDrivesPermissionItem *pCVar5;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res10;

+  ITSCoreApi *local_res18;

+  ITSWin32CoreApi *local_res20;

+  int *in_stack_ffffffffffffffd0;

+  CRedirectPromptBasePermissionItem *local_28;

+  CRedirectPromptDrivesPermissionItem *local_20;

+  

+  local_res10 = param_1;

+  local_res18 = param_2;

+  local_res20 = param_3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  local_20 = (CRedirectPromptDrivesPermissionItem *)0x0;

+  if (bVar1) {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptDrivesPermissionItem,CRedirectPromptDrivesPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) {

+LAB_0:

+      pCVar5 = local_20;

+      param_5._0_4_ = 0;

+      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

+                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

+      if (lVar2 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x36f,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+LAB_1:

+      }

+      else {

+        if ((int)param_5 != 0) {

+          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

+          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

+                                    &_GUID_00000000_0000_0000_c000_000000000046);

+          if (iVar3 == 0) {

+            iVar3 = InlineIsEqualGUID();

+            if (iVar3 == 0) {

+              iVar3 = InlineIsEqualGUID();

+              if (iVar3 != 0) {

+                pCVar5 = pCVar5 + 8;

+                goto LAB_2;

+              }

+              lVar2 = -0x7fffbffe;

+            }

+            else {

+LAB_2:

+              lVar2 = 0;

+              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+            }

+            if (lVar2 < 0) {

+              wil::details::in1diag3::Return_Hr

+                        (unaff_retaddr,0x379,

+                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+              goto LAB_1;

+            }

+          }

+          else {

+            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+          }

+          bVar1 = utl::

+                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                               *)(this + 0x28),

+                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

+                              )&local_28);

+          if (!bVar1) {

+            lVar2 = -0x7ff8fff2;

+            wil::details::in1diag3::Return_Hr

+                      (unaff_retaddr,0x37a,

+                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

+            ;

+            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+            goto LAB_3;

+          }

+          g_wasDrivesRequested = 1;

+          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+        }

+        lVar2 = 0;

+      }

+      goto LAB_3;

+    }

+    uVar4 = 0x367;

+  }

+  else {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptDrivesPermissionItem,CRedirectPromptDrivesPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) goto LAB_0;

+    uVar4 = 0x36b;

+  }

+  wil::details::in1diag3::Return_Hr

+            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+             lVar2);

+LAB_3:

+  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

+  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

+            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

+  return lVar2;

+}

+
```

## `DrPRN::UpdatePrinterCacheData`  (modified)

```diff
--- DrPRN::UpdatePrinterCacheData
+++ DrPRN::UpdatePrinterCacheData
@@ -1,2 +1,59 @@
-Failed to decompile mstscax.dll - .ProgramDB DrPRN::UpdatePrinterCacheData : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: static unsigned long __cdecl DrPRN::UpdatePrinterCacheData(unsigned char * __ptr64 *

+   __ptr64,unsigned long * __ptr64,unsigned char * __ptr64,unsigned long) */

+

+ulong __cdecl

+DrPRN::UpdatePrinterCacheData(uchar **param_1,ulong *param_2,uchar *param_3,ulong param_4)

+

+{

+  uint uVar1;

+  uchar *_Src;

+  bool bVar2;

+  uchar *_Dst;

+  uint uVar3;

+  

+  uVar1 = *param_2;

+  _Src = *param_1;

+  bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_1252772153> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1252772153>::GetImpl(void)'

+                      ::__l2::impl);

+  if ((bVar2) && (uVar1 < 0x18)) {

+    return 0xd;

+  }

+  if (*(uint *)(_Src + 0x14) <= uVar1) {

+    bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_1252772153> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1252772153>::GetImpl(void)'

+                        ::__l2::impl);

+    uVar3 = uVar1 - *(int *)(_Src + 0x14);

+    if (bVar2) {

+      if (uVar3 < 0x18) {

+        return 0x216;

+      }

+      bVar2 = uVar3 + param_4 < uVar3;

+    }

+    else {

+      bVar2 = uVar3 + param_4 < param_4;

+    }

+    if (!bVar2) {

+      _Dst = operator_new((ulonglong)(uVar3 + param_4));

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

+        memcpy(_Dst,_Src,(ulonglong)(uVar1 - *(int *)(_Src + 0x14)));

+        memcpy(_Dst + (uVar1 - *(int *)(_Src + 0x14)),param_3,(ulonglong)param_4);

+        *(ulong *)(_Dst + 0x14) = param_4;

+        *param_2 = uVar3 + param_4;

+        *param_1 = _Dst;

+        wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>::__private_IsEnabled

+                  ((FeatureImpl<__WilFeatureTraits_Feature_1252772153> *)

+                   &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1252772153>::GetImpl(void)'

+                    ::__l2::impl);

+        operator_delete(_Src);

+        return 0;

+      }

+      return 8;

+    }

+  }

+  return 0x216;

+}

+
```

## `CWTSVirtualChannelManagerProxy::CWTSVirtualChannelManagerProxy`  (modified)

```diff
--- CWTSVirtualChannelManagerProxy::CWTSVirtualChannelManagerProxy
+++ CWTSVirtualChannelManagerProxy::CWTSVirtualChannelManagerProxy
@@ -1,2 +1,35 @@
-Failed to decompile mstscax.dll - .ProgramDB CWTSVirtualChannelManagerProxy::CWTSVirtualChannelManagerProxy : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: __cdecl CWTSVirtualChannelManagerProxy::CWTSVirtualChannelManagerProxy(void) __ptr64 */

+

+CWTSVirtualChannelManagerProxy * __thiscall

+CWTSVirtualChannelManagerProxy::CWTSVirtualChannelManagerProxy(CWTSVirtualChannelManagerProxy *this)

+

+{

+  *(undefined ***)this = &IAAMsgOpEvent::_vftable_;

+  *(undefined ***)(this + 8) = &IAAMsgOpEvent::_vftable_;

+  *(undefined4 *)(this + 0x14) = 1;

+  *(undefined ***)this =

+       &Microsoft::WRL::

+        RuntimeClass<Microsoft::WRL::RuntimeClassFlags<2>,IWTSVirtualChannelManager,IWTSPluginServiceProvider>

+        ::_vftable__for__IWTSVirtualChannelManager__;

+  *(undefined ***)(this + 8) =

+       &Microsoft::WRL::

+        RuntimeClass<Microsoft::WRL::RuntimeClassFlags<2>,IWTSVirtualChannelManager,IWTSPluginServiceProvider>

+        ::

+        _vftable__for__Microsoft__WRL__Details__ImplementsHelper<Microsoft::WRL::RuntimeClassFlags<2>,1,IWTSPluginServiceProvider>__

+  ;

+  if (Microsoft::WRL::Details::ModuleBase::module_ != (ModuleBase *)0x0) {

+    (**(code **)(*(longlong *)Microsoft::WRL::Details::ModuleBase::module_ + 8))();

+  }

+  *(undefined ***)this = &_vftable__for__IWTSVirtualChannelManager__;

+  *(undefined ***)(this + 8) =

+       &

+       _vftable__for__Microsoft__WRL__Details__ImplementsHelper<Microsoft::WRL::RuntimeClassFlags<2>,1,IWTSPluginServiceProvider>__

+  ;

+  *(undefined8 *)(this + 0x18) = 0;

+  *(undefined8 *)(this + 0x20) = 0;

+  return this;

+}

+
```

## `CProxyStreamManager::OnStreamDataReceived`  (modified)

```diff
--- CProxyStreamManager::OnStreamDataReceived
+++ CProxyStreamManager::OnStreamDataReceived
@@ -1,2 +1,94 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyStreamManager::OnStreamDataReceived : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: long __cdecl CProxyStreamManager::OnStreamDataReceived(long,unsigned char *

+   __ptr64,unsigned long,int) __ptr64 */

+

+long __thiscall

+CProxyStreamManager::OnStreamDataReceived

+          (CProxyStreamManager *this,long param_1,uchar *param_2,ulong param_3,int param_4)

+

+{

+  LPCRITICAL_SECTION lpCriticalSection;

+  SmartArray<CProxyStream,long> *this_00;

+  CProxyStream *pCVar1;

+  bool bVar2;

+  int iVar3;

+  uint uVar4;

+  long lVar5;

+  CProxyStream *local_res8;

+  

+  local_res8 = (CProxyStream *)0x0;

+  lpCriticalSection = (LPCRITICAL_SECTION)(this + 0x38);

+  this_00 = (SmartArray<CProxyStream,long> *)(this + 0x70);

+  EnterCriticalSection(lpCriticalSection);

+  iVar3 = SmartArray<CProxyStream,long>::GetAt(this_00,param_1,&local_res8);

+  pCVar1 = local_res8;

+  if (iVar3 == 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1a,

+                &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar4,param_1);

+    }

+    lVar5 = -0x7ff8fb6f;

+  }

+  else if (local_res8 == (CProxyStream *)0x0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1b,

+               &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar4);

+    }

+    lVar5 = -0x7fff0001;

+  }

+  else {

+    lVar5 = CProxyStream::FillReceiveBuffer(local_res8,param_2,param_3,param_4);

+    bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1894756665>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_1894756665> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1894756665>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1894756665>::GetImpl(void)'

+                        ::__l2::impl);

+    if (bVar2) {

+      if (-1 < lVar5) {

+LAB_0:

+        (**(code **)(**(longlong **)(pCVar1 + 0x20) + 0x10))();

+        iVar3 = SmartArray<CProxyStream,long>::AddAt(this_00,param_1,(CProxyStream *)0x0);

+        if (((iVar3 == 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+           (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+          uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+          WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1f,

+                    &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar4,param_1);

+        }

+        LeaveCriticalSection(lpCriticalSection);

+        return 0;

+      }

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1c,

+                   &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar4,param_1,lVar5);

+      }

+      iVar3 = SmartArray<CProxyStream,long>::AddAt(this_00,param_1,(CProxyStream *)0x0);

+      if ((((iVar3 == 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1d,

+                  &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar4,param_1);

+      }

+      (**(code **)(**(longlong **)(pCVar1 + 0x20) + 0x10))();

+    }

+    else {

+      if (-1 < lVar5) goto LAB_0;

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1e,

+                   &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar4,

+                   "FillReceiveBuffer failed!",lVar5);

+      }

+    }

+  }

+  LeaveCriticalSection(lpCriticalSection);

+  return lVar5;

+}

+
```

## `CRedirectPromptDlg2View::CRedirectPromptDlg2View`  (modified)

```diff
--- CRedirectPromptDlg2View::CRedirectPromptDlg2View
+++ CRedirectPromptDlg2View::CRedirectPromptDlg2View
@@ -1,2 +1,29 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptDlg2View::CRedirectPromptDlg2View : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: __cdecl CRedirectPromptDlg2View::CRedirectPromptDlg2View(struct HWND__ * __ptr64,struct

+   HINSTANCE__ * __ptr64,struct IRedirectPromptDlg2ViewModel * __ptr64) __ptr64 */

+

+CRedirectPromptDlg2View * __thiscall

+CRedirectPromptDlg2View::CRedirectPromptDlg2View

+          (CRedirectPromptDlg2View *this,HWND__ *param_1,HINSTANCE__ *param_2,

+          IRedirectPromptDlg2ViewModel *param_3)

+

+{

+  CDlgBase::CDlgBase((CDlgBase *)this,param_1,param_2,0x3fac);

+  *(undefined ***)this = &_vftable_;

+  *(IRedirectPromptDlg2ViewModel **)(this + 0x48) = param_3;

+  if (param_3 != (IRedirectPromptDlg2ViewModel *)0x0) {

+    (**(code **)(*(longlong *)param_3 + 8))(param_3);

+  }

+  *(undefined4 *)(this + 0x50) = 0;

+  *(undefined8 *)(this + 0x58) = 0;

+  *(undefined8 *)(this + 0x60) = 0;

+  *(undefined8 *)(this + 0x68) = 0;

+  *(undefined4 *)(this + 0x70) = 0;

+  *(undefined4 *)(this + 0x80) = 0;

+  *(undefined8 *)(this + 0x78) = 0;

+  *(undefined4 *)(this + 0x88) = 0;

+  return this;

+}

+
```

## `MediaSourceVCCallback::OnDeactivateDevice`  (modified)

```diff
--- MediaSourceVCCallback::OnDeactivateDevice
+++ MediaSourceVCCallback::OnDeactivateDevice
@@ -1,2 +1,82 @@
-Failed to decompile mstscax.dll - .ProgramDB MediaSourceVCCallback::OnDeactivateDevice : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl MediaSourceVCCallback::OnDeactivateDevice(unsigned char) __ptr64 */

+

+long __thiscall MediaSourceVCCallback::OnDeactivateDevice(MediaSourceVCCallback *this,uchar param_1)

+

+{

+  longlong lVar1;

+  bool bVar2;

+  int iVar3;

+  uint uVar4;

+  char *pcVar5;

+  undefined8 uVar6;

+  uchar local_res18 [16];

+  

+  bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>::GetImpl(void)'

+                                  ::__l2::impl);

+  lVar1 = **(longlong **)(this + 0x20);

+  if (bVar2) {

+    iVar3 = (**(code **)(lVar1 + 0x30))(*(longlong **)(this + 0x20),*(undefined8 *)(this + 0x18));

+    if (iVar3 < 0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return iVar3;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+        return iVar3;

+      }

+      if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+        return iVar3;

+      }

+      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar6 = 0x29;

+LAB_0:

+      pcVar5 = "m_spCameraAdapter->DeactivateDevice failed";

+      goto LAB_1;

+    }

+  }

+  else {

+    iVar3 = (**(code **)(lVar1 + 0x20))();

+    if (iVar3 < 0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return iVar3;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+        return iVar3;

+      }

+      if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+        return iVar3;

+      }

+      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar6 = 0x2a;

+      goto LAB_0;

+    }

+  }

+  local_res18[1] = 1;

+  local_res18[0] = param_1;

+  iVar3 = (**(code **)(**(longlong **)(this + 0x18) + 0x18))

+                    (*(longlong **)(this + 0x18),2,local_res18);

+  if (-1 < iVar3) {

+    return iVar3;

+  }

+  if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+    return iVar3;

+  }

+  if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+    return iVar3;

+  }

+  if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+    return iVar3;

+  }

+  uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+  uVar6 = 0x2b;

+  pcVar5 = "m_spChannel->Write failed";

+LAB_1:

+  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar6,

+             &WPP_74ce521e55c7353e2d08106bc6647e0b_Traceguids,uVar4,pcVar5,iVar3);

+  return iVar3;

+}

+
```

## `CRdrServerRequestHandler::Initialize`  (modified)

```diff
--- CRdrServerRequestHandler::Initialize
+++ CRdrServerRequestHandler::Initialize
@@ -1,2 +1,56 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdrServerRequestHandler::Initialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: long __cdecl CRdrServerRequestHandler::Initialize(struct IWTSVirtualChannel *

+   __ptr64,struct IAsyncIIrpProxy * __ptr64,class CAsyncIIrpStub * __ptr64,unsigned long) __ptr64 */

+

+long __thiscall

+CRdrServerRequestHandler::Initialize

+          (CRdrServerRequestHandler *this,IWTSVirtualChannel *param_1,IAsyncIIrpProxy *param_2,

+          CAsyncIIrpStub *param_3,ulong param_4)

+

+{

+  TCntPtr<ITSThread> *pTVar1;

+  TCntPtr<CRdpBaseCoreApi> *this_00;

+  int iVar2;

+  long lVar3;

+  

+  lVar3 = 0;

+  if ((param_1 == (IWTSVirtualChannel *)0x0) || (param_2 == (IAsyncIIrpProxy *)0x0)) {

+    lVar3 = -0x7fff0001;

+  }

+  else {

+    iVar2 = CTSCriticalSection::Initialize((CTSCriticalSection *)(this + 0x80));

+    if (iVar2 == 0) {

+      lVar3 = -0x7ff8fff2;

+    }

+    else {

+      pTVar1 = (TCntPtr<ITSThread> *)(this + 0x50);

+      if (param_1 != *(IWTSVirtualChannel **)pTVar1) {

+        TCntPtr<ITSThread>::SafeRelease(pTVar1);

+        *(IWTSVirtualChannel **)pTVar1 = param_1;

+        TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                  ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+      }

+      pTVar1 = (TCntPtr<ITSThread> *)(this + 0x58);

+      if (param_2 != *(IAsyncIIrpProxy **)pTVar1) {

+        TCntPtr<ITSThread>::SafeRelease(pTVar1);

+        *(IAsyncIIrpProxy **)pTVar1 = param_2;

+        TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                  ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+      }

+      this_00 = (TCntPtr<CRdpBaseCoreApi> *)(this + 0x98);

+      if (param_3 != *(CAsyncIIrpStub **)this_00) {

+        TCntPtr<CRdpBaseCoreApi>::SafeRelease(this_00);

+        *(CAsyncIIrpStub **)this_00 = param_3;

+        if (param_3 != (CAsyncIIrpStub *)0x0) {

+          (**(code **)(**(longlong **)(param_3 + 0x30) + 8))();

+        }

+      }

+      *(ulong *)(this + 0x90) = param_4;

+      *(uint *)(this + 0x34) = *(uint *)(this + 0x34) | 2;

+    }

+  }

+  return lVar3;

+}

+
```

## `CIH::Terminate`  (modified)

```diff
--- CIH::Terminate
+++ CIH::Terminate
@@ -1,2 +1,60 @@
-Failed to decompile mstscax.dll - .ProgramDB CIH::Terminate : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl CIH::Terminate(void) __ptr64 */

+

+long __thiscall CIH::Terminate(CIH *this)

+

+{

+  TCntPtr<ITSThread> *pTVar1;

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *pTVar2;

+  char cVar3;

+  long lVar4;

+  undefined4 uVar5;

+  CTSCriticalSection *local_res8;

+  

+  lVar4 = IHFSMProc(this + -8,3,0);

+  if ((((lVar4 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+      ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar5 = RdpX_GetActivityIdPrefix();

+    WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x19,

+               &WPP_1c30b51fc4083f89a2c4652859aa9177_Traceguids,uVar5,"Failed to terminate IH FSM",

+               lVar4);

+  }

+  local_res8 = (CTSCriticalSection *)(this + 0x70);

+  CTSCriticalSection::Lock(local_res8);

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0xa0);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+  }

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0xa8);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x88);

+  if (*(longlong *)pTVar2 != 0) {

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+    *(undefined8 *)pTVar2 = 0;

+    TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+              ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x80);

+  if (*(longlong *)pTVar2 != 0) {

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+    *(undefined8 *)pTVar2 = 0;

+  }

+  cVar3 = FeatureMsrc108622();

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

+    *(undefined8 *)(this + 0x40) = 0;

+  }

+  if (*(HLOCAL *)(this + 0xe0) != (HLOCAL)0x0) {

+    LocalFree(*(HLOCAL *)(this + 0xe0));

+    *(undefined8 *)(this + 0xe0) = 0;

+  }

+  *(uint *)(this + 0x14) = *(uint *)(this + 0x14) | 4;

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res8);

+  return 0;

+}

+
```

## `DynVCPluginLoader::_LoadExternalPlugins`  (modified)

```diff
--- DynVCPluginLoader::_LoadExternalPlugins
+++ DynVCPluginLoader::_LoadExternalPlugins
@@ -1,2 +1,67 @@
-Failed to decompile mstscax.dll - .ProgramDB DynVCPluginLoader::_LoadExternalPlugins : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

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

+/* private: long __cdecl DynVCPluginLoader::_LoadExternalPlugins(unsigned short * __ptr64) __ptr64

+    */

+

+long __thiscall DynVCPluginLoader::_LoadExternalPlugins(DynVCPluginLoader *this,ushort *param_1)

+

+{

+  int iVar1;

+  undefined4 uVar2;

+  wchar_t *pwVar3;

+  undefined1 auStack_68 [32];

+  wchar_t *local_48;

+  ushort *local_38;

+  wchar_t *local_30;

+  undefined8 local_28;

+  _GUID local_20;

+  ulonglong local_10;

+  

+  local_28 = 0xfffffffffffffffe;

+  local_10 = __security_cookie ^ (ulonglong)auStack_68;

+  local_30 = (wchar_t *)0x0;

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

+    pwVar3 = wcstok_s((wchar_t *)param_1,L",",&local_30);

+    while (pwVar3 != (wchar_t *)0x0) {

+      local_20.Data1 = 0;

+      local_20.Data2 = 0;

+      local_20.Data3 = 0;

+      local_20.Data4[0] = '\0';

+      local_20.Data4[1] = '\0';

+      local_20.Data4[2] = '\0';

+      local_20.Data4[3] = '\0';

+      local_20.Data4[4] = '\0';

+      local_20.Data4[5] = '\0';

+      local_20.Data4[6] = '\0';

+      local_20.Data4[7] = '\0';

+      local_38 = (ushort *)0x0;

+      wil::details::

+      unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void*___ptr64_(__cdecl*)(void*___ptr64),&void*___ptr64___cdecl_LocalFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+      ::reset((unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void*___ptr64_(__cdecl*)(void*___ptr64),&void*___ptr64___cdecl_LocalFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+               *)&local_38,(ushort *)0x0);

+      iVar1 = PluginLoaderHelpers::ShouldLoadPluginViaCom((ushort *)pwVar3,&local_20,&local_38);

+      if (iVar1 == 0) {

+        iVar1 = _LoadOnePluginDirect(this,(ushort *)pwVar3);

+      }

+      else {

+        iVar1 = _LoadOnePluginViaCom(this,&local_20,local_38);

+      }

+      if ((((iVar1 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar2 = RdpX_GetActivityIdPrefix();

+        local_48 = pwVar3;

+        WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3e,

+                  &WPP_cd52f9c19b813d4bd928eb09f9f380e8_Traceguids,uVar2);

+      }

+      pwVar3 = wcstok_s((wchar_t *)0x0,L",",&local_30);

+      wil::details::

+      unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void*___ptr64_(__cdecl*)(void*___ptr64),&void*___ptr64___cdecl_LocalFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+      ::

+      ~unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void*___ptr64_(__cdecl*)(void*___ptr64),&void*___ptr64___cdecl_LocalFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                ((unique_storage<wil::details::resource_policy<unsigned_short*___ptr64,void*___ptr64_(__cdecl*)(void*___ptr64),&void*___ptr64___cdecl_LocalFree(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,unsigned_short*___ptr64,unsigned_short*___ptr64,0,std::nullptr_t>_>

+                  *)&local_38);

+    }

+  }

+  return 0;

+}

+
```

## `CameraAdapter::CameraAdapter`  (modified)

```diff
--- CameraAdapter::CameraAdapter
+++ CameraAdapter::CameraAdapter
@@ -1,18 +1,39 @@
 

-void __thiscall

-Microsoft::WRL::Details::

-RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<6>,0,0,0,IClassFactory,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil>

-::CameraAdapter(CameraAdapter *this)

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: __cdecl CameraAdapter::CameraAdapter(void) __ptr64 */

+

+CameraAdapter * __thiscall CameraAdapter::CameraAdapter(CameraAdapter *this)

 

 {

-  DeviceEnumeratorListenerCallback *this_00;

-  longlong unaff_RBX;

-  HWND__ *unaff_RDI;

+  CameraAdapter *pCVar1;

   

-  this_00 = *(DeviceEnumeratorListenerCallback **)((ulonglong)(uint)WPP_GLOBAL_Control + 0x10);

-  WPP_SF_DS();

-  DeviceEnumeratorListenerCallback::PostPrivateDeviceChangeMessage

-            (this_00,unaff_RDI,0x402,(ushort *)(unaff_RBX + 0x1c));

-  return;

+  *(undefined ***)this = &IMiniWin32PointerApi::_vftable_;

+  *(undefined4 *)(this + 0xc) = 1;

+  *(undefined ***)this =

+       &Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<2>,ICameraAdapter>::_vftable_

+  ;

+  if (Microsoft::WRL::Details::ModuleBase::module_ != (ModuleBase *)0x0) {

+    (**(code **)(*(longlong *)Microsoft::WRL::Details::ModuleBase::module_ + 8))();

+  }

+  *(undefined ***)this = &_vftable_;

+  InitializeSRWLock((PSRWLOCK)(this + 0x10));

+  pCVar1 = this + 0x60;

+  *(undefined4 *)(this + 0x18) = 0;

+  *(CameraAdapter **)pCVar1 = pCVar1;

+  *(CameraAdapter **)(this + 0x68) = pCVar1;

+  *(undefined8 *)(this + 0x70) = 0;

+  *(undefined8 *)(this + 0x78) = 0;

+  *(undefined2 *)(this + 0x80) = 0x800;

+  *(undefined8 *)(this + 0x20) = 0;

+  *(undefined8 *)(this + 0x28) = 0;

+  *(undefined8 *)(this + 0x30) = 0;

+  *(undefined8 *)(this + 0x38) = 0;

+  this[0x40] = (CameraAdapter)0x0;

+  *(undefined4 *)(this + 0x44) = 0;

+  *(undefined8 *)(this + 0x48) = 0;

+  this[0x50] = (CameraAdapter)0x0;

+  *(undefined8 *)(this + 0x58) = 0;

+  return this;

 }
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptWebAuthnPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptWebAuthnPermissionItem>
+++ CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptWebAuthnPermissionItem>
@@ -1,2 +1,126 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptWebAuthnPermissionItem> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

+   CRedirectPromptWebAuthnPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi *

+   __ptr64,class ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptWebAuthnPermissionItem>

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int *param_5)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  uint uVar4;

+  CRedirectPromptWebAuthnPermissionItem *pCVar5;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res10;

+  ITSCoreApi *local_res18;

+  ITSWin32CoreApi *local_res20;

+  int *in_stack_ffffffffffffffd0;

+  CRedirectPromptBasePermissionItem *local_28;

+  CRedirectPromptWebAuthnPermissionItem *local_20;

+  

+  local_res10 = param_1;

+  local_res18 = param_2;

+  local_res20 = param_3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  local_20 = (CRedirectPromptWebAuthnPermissionItem *)0x0;

+  if (bVar1) {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptWebAuthnPermissionItem,CRedirectPromptWebAuthnPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) {

+LAB_0:

+      pCVar5 = local_20;

+      param_5._0_4_ = 0;

+      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

+                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

+      if (lVar2 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x36f,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+LAB_1:

+      }

+      else {

+        if ((int)param_5 != 0) {

+          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

+          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

+                                    &_GUID_00000000_0000_0000_c000_000000000046);

+          if (iVar3 == 0) {

+            iVar3 = InlineIsEqualGUID();

+            if (iVar3 == 0) {

+              iVar3 = InlineIsEqualGUID();

+              if (iVar3 != 0) {

+                pCVar5 = pCVar5 + 8;

+                goto LAB_2;

+              }

+              lVar2 = -0x7fffbffe;

+            }

+            else {

+LAB_2:

+              lVar2 = 0;

+              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+            }

+            if (lVar2 < 0) {

+              wil::details::in1diag3::Return_Hr

+                        (unaff_retaddr,0x379,

+                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+              goto LAB_1;

+            }

+          }

+          else {

+            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+          }

+          bVar1 = utl::

+                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                               *)(this + 0x28),

+                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

+                              )&local_28);

+          if (!bVar1) {

+            lVar2 = -0x7ff8fff2;

+            wil::details::in1diag3::Return_Hr

+                      (unaff_retaddr,0x37a,

+                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

+            ;

+            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+            goto LAB_3;

+          }

+          g_wasWebAuthnRequested = 1;

+          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+        }

+        lVar2 = 0;

+      }

+      goto LAB_3;

+    }

+    uVar4 = 0x367;

+  }

+  else {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptWebAuthnPermissionItem,CRedirectPromptWebAuthnPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) goto LAB_0;

+    uVar4 = 0x36b;

+  }

+  wil::details::in1diag3::Return_Hr

+            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+             lVar2);

+LAB_3:

+  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

+  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

+            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

+  return lVar2;

+}

+
```

## `RdpWinDesktopRemoteAppUIManager::GetWindowOutputMap`  (modified)

```diff
--- RdpWinDesktopRemoteAppUIManager::GetWindowOutputMap
+++ RdpWinDesktopRemoteAppUIManager::GetWindowOutputMap
@@ -1,2 +1,245 @@
-Failed to decompile mstscax.dll - .ProgramDB RdpWinDesktopRemoteAppUIManager::GetWindowOutputMap : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Type propagation algorithm not settling */

+/* private: long __cdecl RdpWinDesktopRemoteAppUIManager::GetWindowOutputMap(unsigned int,class

+   RdpWin32RemoteAppPresenter * __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall

+RdpWinDesktopRemoteAppUIManager::GetWindowOutputMap

+          (RdpWinDesktopRemoteAppUIManager *this,uint param_1,RdpWin32RemoteAppPresenter **param_2)

+

+{

+  RdpWinDesktopRemoteAppUIManager *SRWLock;

+  _Tree<unsigned_int,utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>_>,0>

+  *p_Var1;

+  bool bVar2;

+  int iVar3;

+  long lVar4;

+  _TreeNode<utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>_>

+  *p_Var5;

+  RdpXSPtr<RdpWin32RemoteAppPresenter> *pRVar6;

+  RdpWin32RemoteAppPresenter *pRVar7;

+  _GUID *p_Var8;

+  _GUID *in_R9;

+  void *unaff_retaddr;

+  RdpWin32RemoteAppPresenter *local_res10;

+  CTSCriticalSection *local_res18;

+  uint local_res20 [2];

+  RdpWin32RemoteAppPresenter *local_58;

+  ITSInstance *local_50;

+  longlong local_48 [2];

+  

+  local_res10._0_4_ = param_1;

+  if (param_2 == (RdpWin32RemoteAppPresenter **)0x0) {

+    wil::details::in1diag3::Return_Hr

+              (unaff_retaddr,0xdd5,

+               "clientcore\\termsrv\\rdp\\win\\remoteapp\\remoteappplugin\\implementation\\remoteappdesktopuimanager.cpp"

+               ,-0x7fffbffd);

+    return -0x7fffbffd;

+  }

+  SRWLock = this + 0x1a0;

+  p_Var8 = (_GUID *)param_2;

+  bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::GetImpl(void)'

+                                  ::__l2::impl);

+  if (!bVar2) {

+    local_58 = (RdpWin32RemoteAppPresenter *)0x0;

+    AcquireSRWLockExclusive((PSRWLOCK)SRWLock);

+    p_Var1 = (_Tree<unsigned_int,utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>_>,0>

+              *)(this + 0x160);

+    pRVar7 = (RdpWin32RemoteAppPresenter *)0x0;

+    if (((*(_Tree<unsigned_int,utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>_>,0>

+            **)(this + 0x170) != p_Var1) &&

+        (p_Var5 = utl::

+                  _Tree<unsigned_int,utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>_>,0>

+                  ::_LowerBoundNonEmpty<unsigned_int>(p_Var1,(uint *)&local_res10),

+        p_Var5 != (_TreeNode<utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>_>

+                   *)p_Var1)) &&

+       (pRVar7 = (RdpWin32RemoteAppPresenter *)0x0, *(uint *)(p_Var5 + 0x18) <= param_1)) {

+      if (5 < DAT_0) {

+        local_res18 = (CTSCriticalSection *)CONCAT44(local_res18._4_4_,param_1);

+        p_Var8 = (_GUID *)0x0;

+        _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_EventWriteTransfer(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_180853e54,(_GUID *)0x0,in_R9,

+                   (_tlgWrapperByVal<4> *)&local_res18);

+      }

+      pRVar6 = utl::

+               map<unsigned_int,RdpXSPtr<RdpWin32RemoteAppPresenter>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>_>

+               ::at((map<unsigned_int,RdpXSPtr<RdpWin32RemoteAppPresenter>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>_>

+                     *)p_Var1,(uint *)&local_res10);

+      RdpXSPtr<RdpXInterfaceTapClientShellCallback>::operator=

+                ((RdpXSPtr<RdpXInterfaceTapClientShellCallback> *)&local_58,

+                 *(RdpXInterfaceTapClientShellCallback **)pRVar6);

+      pRVar7 = local_58;

+    }

+    ReleaseSRWLockExclusive((PSRWLOCK)SRWLock);

+    if (pRVar7 != (RdpWin32RemoteAppPresenter *)0x0) {

+LAB_1:

+      local_58 = (RdpWin32RemoteAppPresenter *)0x0;

+      *param_2 = pRVar7;

+      RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+                ((RdpXSPtr<RdpXInterfaceCriticalSection> *)&local_58);

+      return 0;

+    }

+    local_50 = (ITSInstance *)0x0;

+    iVar3 = IsHiDefSession(this);

+    if (4 < DAT_0) {

+      local_res18 = (CTSCriticalSection *)CONCAT44(local_res18._4_4_,(uint)(iVar3 != 0));

+      local_res20[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_EventWriteTransfer(struct__tlgProvider_t_const*___ptr64,void_const*___ptr64,struct__GUID_const*___ptr64,struct__GUID_const*___ptr64,unsigned_int,struct__EVENT_DATA_DESCRIPTOR*___ptr64),_GUID_const*___ptr64,_GUID_const*___ptr64>

+      ::Write<_tlgWrapperByVal<4>,_tlgWrapperByVal<4>_>

+                ((_tlgProvider_t *)&DAT_0,&DAT_180853d99,p_Var8,in_R9,

+                 (_tlgWrapperByVal<4> *)local_res20,(_tlgWrapperByVal<4> *)&local_res18);

+    }

+    local_res18 = (CTSCriticalSection *)(this + 0x460);

+    CTSCriticalSection::Lock(local_res18);

+    wil::com_ptr_t<ITSInstance,wil::err_returncode_policy>::operator=

+              ((com_ptr_t<ITSInstance,wil::err_returncode_policy> *)&local_50,

+               *(ITSInstance **)(this + 0xa8));

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res18);

+    lVar4 = RdpWin32RemoteAppPresenter::CreateInstance

+                      (*(int *)(this + 0x110),(uint)(iVar3 != 0),*(ID3D11Device **)(this + 0x470),

+                       *(IDCompositionDevice **)(this + 0x488),param_1,local_50,

+                       (RdpXInterfaceOutputMapManagerInternal *)

+                       (-(ulonglong)(this != (RdpWinDesktopRemoteAppUIManager *)0x0) &

+                       (ulonglong)(this + 0x28)),&local_58);

+    if (lVar4 < 0) {

+      wil::details::in1diag3::Return_Hr

+                (unaff_retaddr,0xe1c,

+                 "clientcore\\termsrv\\rdp\\win\\remoteapp\\remoteappplugin\\implementation\\remoteappdesktopuimanager.cpp"

+                 ,lVar4);

+    }

+    else {

+      AcquireSRWLockExclusive((PSRWLOCK)SRWLock);

+      pRVar7 = local_58;

+      if (*(RdpXInterfaceRemoteAppCore **)(this + 0x458) != (RdpXInterfaceRemoteAppCore *)0x0) {

+        RdpWin32RemoteAppPresenter::SetRemoteAppCore

+                  (local_58,*(RdpXInterfaceRemoteAppCore **)(this + 0x458));

+      }

+      local_res18 = (CTSCriticalSection *)pRVar7;

+      utl::

+      _Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>_>,0>

+      ::emplace<unsigned_int&___ptr64,RdpWin32RemoteAppPresenter*___ptr64,0>

+                ((_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>_>,0>

+                  *)p_Var1,(uint *)local_48,&local_res10);

+      if (local_48[0] != 0) {

+        ReleaseSRWLockExclusive((PSRWLOCK)SRWLock);

+        wil::com_ptr_t<ITSInstance,wil::err_returncode_policy>::

+        ~com_ptr_t<ITSInstance,wil::err_returncode_policy>

+                  ((com_ptr_t<ITSInstance,wil::err_returncode_policy> *)&local_50);

+        goto LAB_1;

+      }

+      wil::details::in1diag3::Return_Hr

+                (unaff_retaddr,0xe27,

+                 "clientcore\\termsrv\\rdp\\win\\remoteapp\\remoteappplugin\\implementation\\remoteappdesktopuimanager.cpp"

+                 ,-0x7ff8fff2);

+      ReleaseSRWLockExclusive((PSRWLOCK)SRWLock);

+      lVar4 = -0x7ff8fff2;

+    }

+    wil::com_ptr_t<ITSInstance,wil::err_returncode_policy>::

+    ~com_ptr_t<ITSInstance,wil::err_returncode_policy>

+              ((com_ptr_t<ITSInstance,wil::err_returncode_policy> *)&local_50);

+    RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+              ((RdpXSPtr<RdpXInterfaceCriticalSection> *)&local_58);

+    return lVar4;

+  }

+  AcquireSRWLockExclusive((PSRWLOCK)SRWLock);

+  p_Var1 = (_Tree<unsigned_int,utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>_>,0>

+            *)(this + 0x180);

+  local_58 = (RdpWin32RemoteAppPresenter *)0x0;

+  if (((*(_Tree<unsigned_int,utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>_>,0>

+          **)(this + 400) != p_Var1) &&

+      (p_Var5 = utl::

+                _Tree<unsigned_int,utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>_>,0>

+                ::_LowerBoundNonEmpty<unsigned_int>(p_Var1,(uint *)&local_res10),

+      p_Var5 != (_TreeNode<utl::pair<unsigned_int_const_,ComPlainSmartPtr<RemoteAppGfxRedirSharedBuffer>_>_>

+                 *)p_Var1)) && (*(uint *)(p_Var5 + 0x18) <= param_1)) {

+    if (5 < DAT_0) {

+      local_res18 = (CTSCriticalSection *)CONCAT44(local_res18._4_4_,param_1);

+      p_Var8 = (_GUID *)0x0;

+      _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_EventWriteTransfer(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_180853e54,(_GUID *)0x0,in_R9,

+                 (_tlgWrapperByVal<4> *)&local_res18);

+    }

+    pRVar6 = utl::

+             map<unsigned_int,RdpXSPtr<RdpWin32RemoteAppPresenter>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>_>

+             ::at((map<unsigned_int,RdpXSPtr<RdpWin32RemoteAppPresenter>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>_>

+                   *)p_Var1,(uint *)&local_res10);

+    if (*(longlong *)pRVar6 != 0) {

+      RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+                ((RdpXSPtr<RdpXInterfaceCriticalSection> *)&local_58);

+      pRVar7 = *(RdpWin32RemoteAppPresenter **)pRVar6;

+      local_58 = pRVar7;

+      RdpXSPtr<RdpXInterfaceArray>::SafeAddRef((RdpXSPtr<RdpXInterfaceArray> *)&local_58);

+      if (pRVar7 != (RdpWin32RemoteAppPresenter *)0x0) goto LAB_2;

+    }

+  }

+  local_50 = (ITSInstance *)0x0;

+  iVar3 = IsHiDefSession(this);

+  if (4 < DAT_0) {

+    local_res18 = (CTSCriticalSection *)CONCAT44(local_res18._4_4_,(uint)(iVar3 != 0));

+    local_res20[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_EventWriteTransfer(struct__tlgProvider_t_const*___ptr64,void_const*___ptr64,struct__GUID_const*___ptr64,struct__GUID_const*___ptr64,unsigned_int,struct__EVENT_DATA_DESCRIPTOR*___ptr64),_GUID_const*___ptr64,_GUID_const*___ptr64>

+    ::Write<_tlgWrapperByVal<4>,_tlgWrapperByVal<4>_>

+              ((_tlgProvider_t *)&DAT_0,&DAT_180853d99,p_Var8,in_R9,

+               (_tlgWrapperByVal<4> *)local_res20,(_tlgWrapperByVal<4> *)&local_res18);

+  }

+  local_res18 = (CTSCriticalSection *)(this + 0x460);

+  CTSCriticalSection::Lock(local_res18);

+  wil::com_ptr_t<ITSInstance,wil::err_returncode_policy>::operator=

+            ((com_ptr_t<ITSInstance,wil::err_returncode_policy> *)&local_50,

+             *(ITSInstance **)(this + 0xa8));

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res18);

+  lVar4 = RdpWin32RemoteAppPresenter::CreateInstance

+                    (*(int *)(this + 0x110),(uint)(iVar3 != 0),*(ID3D11Device **)(this + 0x470),

+                     *(IDCompositionDevice **)(this + 0x488),param_1,local_50,

+                     (RdpXInterfaceOutputMapManagerInternal *)

+                     (-(ulonglong)(this != (RdpWinDesktopRemoteAppUIManager *)0x0) &

+                     (ulonglong)(this + 0x28)),&local_58);

+  pRVar7 = local_58;

+  if (lVar4 < 0) {

+    wil::details::in1diag3::Return_Hr

+              (unaff_retaddr,0xdf3,

+               "clientcore\\termsrv\\rdp\\win\\remoteapp\\remoteappplugin\\implementation\\remoteappdesktopuimanager.cpp"

+               ,lVar4);

+  }

+  else {

+    if (*(RdpXInterfaceRemoteAppCore **)(this + 0x458) != (RdpXInterfaceRemoteAppCore *)0x0) {

+      RdpWin32RemoteAppPresenter::SetRemoteAppCore

+                (local_58,*(RdpXInterfaceRemoteAppCore **)(this + 0x458));

+    }

+    local_res18 = (CTSCriticalSection *)pRVar7;

+    utl::

+    _Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+    ::emplace<unsigned_int&___ptr64,RdpWin32RemoteAppPresenter*___ptr64,0>

+              ((_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+                *)p_Var1,(uint *)local_48,&local_res10);

+    if (local_48[0] != 0) {

+      wil::com_ptr_t<ITSInstance,wil::err_returncode_policy>::

+      ~com_ptr_t<ITSInstance,wil::err_returncode_policy>

+                ((com_ptr_t<ITSInstance,wil::err_returncode_policy> *)&local_50);

+LAB_2:

+      local_58 = (RdpWin32RemoteAppPresenter *)0x0;

+      *param_2 = pRVar7;

+      RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+                ((RdpXSPtr<RdpXInterfaceCriticalSection> *)&local_58);

+      ReleaseSRWLockExclusive((PSRWLOCK)SRWLock);

+      return 0;

+    }

+    wil::details::in1diag3::Return_Hr

+              (unaff_retaddr,0xdfc,

+               "clientcore\\termsrv\\rdp\\win\\remoteapp\\remoteappplugin\\implementation\\remoteappdesktopuimanager.cpp"

+               ,-0x7ff8fff2);

+    lVar4 = -0x7ff8fff2;

+  }

+  wil::com_ptr_t<ITSInstance,wil::err_returncode_policy>::

+  ~com_ptr_t<ITSInstance,wil::err_returncode_policy>

+            ((com_ptr_t<ITSInstance,wil::err_returncode_policy> *)&local_50);

+  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)&local_58);

+  ReleaseSRWLockExclusive((PSRWLOCK)SRWLock);

+  return lVar4;

+}

+
```

## `CRedirectPromptDlg2::~CRedirectPromptDlg2`  (modified)

```diff
--- CRedirectPromptDlg2::~CRedirectPromptDlg2
+++ CRedirectPromptDlg2::~CRedirectPromptDlg2
@@ -1,2 +1,15 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptDlg2::~CRedirectPromptDlg2 : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual __cdecl CRedirectPromptDlg2::~CRedirectPromptDlg2(void) __ptr64 */

+

+void __thiscall CRedirectPromptDlg2::~CRedirectPromptDlg2(CRedirectPromptDlg2 *this)

+

+{

+  ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)(this + 0x28));

+  ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)(this + 0x20));

+  wil::com_ptr_t<INamedPipeAdaptor,wil::err_returncode_policy>::

+  ~com_ptr_t<INamedPipeAdaptor,wil::err_returncode_policy>

+            ((com_ptr_t<INamedPipeAdaptor,wil::err_returncode_policy> *)(this + 0x18));

+  *(undefined4 *)(this + 0xc) = 0xc0000001;

+  return;

+}

+
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptUsbPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptUsbPermissionItem>
+++ CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptUsbPermissionItem>
@@ -1,2 +1,127 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptUsbPermissionItem> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

+   CRedirectPromptUsbPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi * __ptr64,class

+   ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptUsbPermissionItem>

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int *param_5)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  uint uVar4;

+  CRedirectPromptUsbPermissionItem *pCVar5;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res10;

+  ITSCoreApi *local_res18;

+  ITSWin32CoreApi *local_res20;

+  int *in_stack_ffffffffffffffd0;

+  CRedirectPromptBasePermissionItem *local_28;

+  CRedirectPromptUsbPermissionItem *local_20;

+  

+  local_res10 = param_1;

+  local_res18 = param_2;

+  local_res20 = param_3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  local_20 = (CRedirectPromptUsbPermissionItem *)0x0;

+  if (bVar1) {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptUsbPermissionItem,CRedirectPromptUsbPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) {

+LAB_0:

+      pCVar5 = local_20;

+      param_5._0_4_ = 0;

+      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

+                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

+      if (lVar2 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x36f,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+LAB_1:

+      }

+      else {

+        if ((int)param_5 != 0) {

+          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

+          *(undefined4 *)(this + 0x44) = 1;

+          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

+                                    &_GUID_00000000_0000_0000_c000_000000000046);

+          if (iVar3 == 0) {

+            iVar3 = InlineIsEqualGUID();

+            if (iVar3 == 0) {

+              iVar3 = InlineIsEqualGUID();

+              if (iVar3 != 0) {

+                pCVar5 = pCVar5 + 8;

+                goto LAB_2;

+              }

+              lVar2 = -0x7fffbffe;

+            }

+            else {

+LAB_2:

+              lVar2 = 0;

+              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+            }

+            if (lVar2 < 0) {

+              wil::details::in1diag3::Return_Hr

+                        (unaff_retaddr,0x379,

+                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+              goto LAB_1;

+            }

+          }

+          else {

+            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+          }

+          bVar1 = utl::

+                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                               *)(this + 0x28),

+                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

+                              )&local_28);

+          if (!bVar1) {

+            lVar2 = -0x7ff8fff2;

+            wil::details::in1diag3::Return_Hr

+                      (unaff_retaddr,0x37a,

+                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

+            ;

+            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+            goto LAB_3;

+          }

+          g_wasUsbRequested = 1;

+          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+        }

+        lVar2 = 0;

+      }

+      goto LAB_3;

+    }

+    uVar4 = 0x367;

+  }

+  else {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptUsbPermissionItem,CRedirectPromptUsbPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) goto LAB_0;

+    uVar4 = 0x36b;

+  }

+  wil::details::in1diag3::Return_Hr

+            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+             lVar2);

+LAB_3:

+  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

+  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

+            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

+  return lVar2;

+}

+
```

## `CameraAdapter::IncrementActivationCnt`  (modified)

```diff
--- CameraAdapter::IncrementActivationCnt
+++ CameraAdapter::VerifyState
@@ -1,34 +1,51 @@
 

-/* private: void __cdecl CameraAdapter::IncrementActivationCnt(void * __ptr64) __ptr64 */

+/* private: long __cdecl CameraAdapter::VerifyState(void) __ptr64 */

 

-void __thiscall CameraAdapter::IncrementActivationCnt(CameraAdapter *this,void *param_1)

+long __thiscall CameraAdapter::VerifyState(CameraAdapter *this)

 

 {

-  _HashTable<void*___ptr64,utl::pair<void*___ptr64_const,unsigned_int>,utl::hash<void*___ptr64>,utl::equal_to<void*___ptr64>,utl::allocator<utl::pair<void*___ptr64_const,unsigned_int>_>,0>

-  *p_Var1;

-  undefined4 local_res8;

-  undefined4 uStackX_c;

-  void *local_res10 [3];

-  void *local_18 [2];

+  bool bVar1;

+  uint uVar2;

+  undefined8 uVar3;

   

-  p_Var1 = (_HashTable<void*___ptr64,utl::pair<void*___ptr64_const,unsigned_int>,utl::hash<void*___ptr64>,utl::equal_to<void*___ptr64>,utl::allocator<utl::pair<void*___ptr64_const,unsigned_int>_>,0>

-            *)(this + 0x60);

-  local_res10[0] = param_1;

-  utl::

-  _HashTable<void*___ptr64,utl::pair<void*___ptr64_const,unsigned_int>,utl::hash<void*___ptr64>,utl::equal_to<void*___ptr64>,utl::allocator<utl::pair<void*___ptr64_const,unsigned_int>_>,0>

-  ::find<void>(p_Var1,(void **)&local_res8);

-  if (p_Var1 == (_HashTable<void*___ptr64,utl::pair<void*___ptr64_const,unsigned_int>,utl::hash<void*___ptr64>,utl::equal_to<void*___ptr64>,utl::allocator<utl::pair<void*___ptr64_const,unsigned_int>_>,0>

-                 *)CONCAT44(uStackX_c,local_res8)) {

-    local_res8 = 1;

-    utl::

-    _HashTable<void*___ptr64,utl::pair<void*___ptr64_const,unsigned_int>,utl::hash<void*___ptr64>,utl::equal_to<void*___ptr64>,utl::allocator<utl::pair<void*___ptr64_const,unsigned_int>_>,0>

-    ::emplace<void*___ptr64&___ptr64,int,0>(p_Var1,local_18,(int *)local_res10);

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>::GetImpl(void)'

+                                  ::__l2::impl);

+  if (bVar1) {

+    if (*(CameraAdapter **)(this + 0x60) != this + 0x60) {

+      return 0;

+    }

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return -0x3ff2c94a;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return -0x3ff2c94a;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return -0x3ff2c94a;

+    }

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar3 = 0x4d;

   }

   else {

-    p_Var1 = (_HashTable<void*___ptr64,utl::pair<void*___ptr64_const,unsigned_int>,utl::hash<void*___ptr64>,utl::equal_to<void*___ptr64>,utl::allocator<utl::pair<void*___ptr64_const,unsigned_int>_>,0>

-              *)CONCAT44(uStackX_c,local_res8) + 0x20;

-    *(int *)p_Var1 = *(int *)p_Var1 + 1;

+    if (*(int *)(this + 0x18) != 0) {

+      return 0;

+    }

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return -0x3ff2c94a;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return -0x3ff2c94a;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return -0x3ff2c94a;

+    }

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar3 = 0x4e;

   }

-  return;

+  WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar3,

+           &WPP_bb9a7187ef7f39a689e826e28c9e62d0_Traceguids,uVar2);

+  return -0x3ff2c94a;

 }
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptLocationPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptLocationPermissionItem>
+++ CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptLocationPermissionItem>
@@ -1,2 +1,126 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptLocationPermissionItem> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

+   CRedirectPromptLocationPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi *

+   __ptr64,class ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptLocationPermissionItem>

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int *param_5)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  uint uVar4;

+  CRedirectPromptLocationPermissionItem *pCVar5;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res10;

+  ITSCoreApi *local_res18;

+  ITSWin32CoreApi *local_res20;

+  int *in_stack_ffffffffffffffd0;

+  CRedirectPromptBasePermissionItem *local_28;

+  CRedirectPromptLocationPermissionItem *local_20;

+  

+  local_res10 = param_1;

+  local_res18 = param_2;

+  local_res20 = param_3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  local_20 = (CRedirectPromptLocationPermissionItem *)0x0;

+  if (bVar1) {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptLocationPermissionItem,CRedirectPromptLocationPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) {

+LAB_0:

+      pCVar5 = local_20;

+      param_5._0_4_ = 0;

+      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

+                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

+      if (lVar2 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x36f,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+LAB_1:

+      }

+      else {

+        if ((int)param_5 != 0) {

+          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

+          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

+                                    &_GUID_00000000_0000_0000_c000_000000000046);

+          if (iVar3 == 0) {

+            iVar3 = InlineIsEqualGUID();

+            if (iVar3 == 0) {

+              iVar3 = InlineIsEqualGUID();

+              if (iVar3 != 0) {

+                pCVar5 = pCVar5 + 8;

+                goto LAB_2;

+              }

+              lVar2 = -0x7fffbffe;

+            }

+            else {

+LAB_2:

+              lVar2 = 0;

+              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+            }

+            if (lVar2 < 0) {

+              wil::details::in1diag3::Return_Hr

+                        (unaff_retaddr,0x379,

+                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+              goto LAB_1;

+            }

+          }

+          else {

+            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+          }

+          bVar1 = utl::

+                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                               *)(this + 0x28),

+                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

+                              )&local_28);

+          if (!bVar1) {

+            lVar2 = -0x7ff8fff2;

+            wil::details::in1diag3::Return_Hr

+                      (unaff_retaddr,0x37a,

+                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

+            ;

+            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+            goto LAB_3;

+          }

+          g_wasLocationRequested = 1;

+          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+        }

+        lVar2 = 0;

+      }

+      goto LAB_3;

+    }

+    uVar4 = 0x367;

+  }

+  else {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptLocationPermissionItem,CRedirectPromptLocationPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) goto LAB_0;

+    uVar4 = 0x36b;

+  }

+  wil::details::in1diag3::Return_Hr

+            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+             lVar2);

+LAB_3:

+  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

+  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

+            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

+  return lVar2;

+}

+
```

## `utl::_HashTable<void*___ptr64,utl::pair<void*___ptr64_const,unsigned_int>,utl::hash<void*___ptr64>,utl::equal_to<void*___ptr64>,utl::allocator<utl::pair<void*___ptr64_const,unsigned_int>_>,0>::emplace<void*___ptr64&___ptr64,int,0>`  (modified)

```diff
--- utl::_HashTable<void*___ptr64,utl::pair<void*___ptr64_const,unsigned_int>,utl::hash<void*___ptr64>,utl::equal_to<void*___ptr64>,utl::allocator<utl::pair<void*___ptr64_const,unsigned_int>_>,0>::emplace<void*___ptr64&___ptr64,int,0>
+++ CameraAdapter::~CameraAdapter
@@ -1,55 +1,49 @@
 

-/* WARNING: Removing unreachable block (ram,0x00018026037b) */

-/* public: struct utl::pair<class utl::_DlistIt<struct utl::_HashNode<struct utl::pair<void *

-   __ptr64 const,unsigned int> >,struct utl::pair<void * __ptr64 const,unsigned int> >,bool> __cdecl

-   utl::_HashTable<void * __ptr64,struct utl::pair<void * __ptr64 const,unsigned int>,struct

-   utl::hash<void * __ptr64>,struct utl::equal_to<void * __ptr64>,class utl::allocator<struct

-   utl::pair<void * __ptr64 const,unsigned int> >,0>::emplace<void * __ptr64 & __ptr64,int,0>(void *

-   __ptr64 & __ptr64,int && __ptr64) __ptr64 */

+/* protected: virtual __cdecl CameraAdapter::~CameraAdapter(void) __ptr64 */

 

-void ** __thiscall

-utl::

-_HashTable<void*___ptr64,utl::pair<void*___ptr64_const,unsigned_int>,utl::hash<void*___ptr64>,utl::equal_to<void*___ptr64>,utl::allocator<utl::pair<void*___ptr64_const,unsigned_int>_>,0>

-::emplace<void*___ptr64&___ptr64,int,0>

-          (_HashTable<void*___ptr64,utl::pair<void*___ptr64_const,unsigned_int>,utl::hash<void*___ptr64>,utl::equal_to<void*___ptr64>,utl::allocator<utl::pair<void*___ptr64_const,unsigned_int>_>,0>

-           *this,void **param_1,int *param_2)

+void __thiscall CameraAdapter::~CameraAdapter(CameraAdapter *this)

 

 {

-  void *pvVar1;

-  undefined8 *puVar2;

-  undefined4 *in_R9;

-  undefined8 local_res10;

-  void *local_38 [2];

-  char local_28;

+  _HashTable<unsigned_int,utl::pair<unsigned_int_const_,SurfaceVisualizerManager::VisInfo>,utl::hash<unsigned_int>,utl::equal_to<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,SurfaceVisualizerManager::VisInfo>_>,0>

+  *this_00;

+  _HashTable<unsigned_int,utl::pair<unsigned_int_const_,SurfaceVisualizerManager::VisInfo>,utl::hash<unsigned_int>,utl::equal_to<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,SurfaceVisualizerManager::VisInfo>_>,0>

+  *p_Var1;

+  longlong *plVar2;

+  longlong lVar3;

+  uint in_EDX;

   

-  pvVar1 = operator_new(0x28,&std::nothrow);

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

-    *(undefined8 *)((longlong)pvVar1 + 0x18) = *(undefined8 *)param_2;

-    *(undefined4 *)((longlong)pvVar1 + 0x20) = *in_R9;

+  *(undefined ***)this = &_vftable_;

+  ResetStreams(this);

+  if (*(ComPtr<MediaStreamAdapter> **)(this + 0x38) != (ComPtr<MediaStreamAdapter> *)0x0) {

+    Microsoft::WRL::ComPtr<MediaStreamAdapter>::_vector_deleting_destructor_

+              (*(ComPtr<MediaStreamAdapter> **)(this + 0x38),in_EDX);

   }

-  local_res10 = 0;

-  _UninitializedAllocation<utl::allocator<utl::_TreeNode<utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>_>_>_>

-  ::

-  ~_UninitializedAllocation<utl::allocator<utl::_TreeNode<utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>_>_>_>

-            ((_UninitializedAllocation<utl::allocator<utl::_TreeNode<utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>_>_>_>

-              *)&local_res10);

-  *param_1 = (void *)0x0;

-  *(undefined1 *)(param_1 + 1) = 0;

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

-    _FindInsertPos(this,local_38);

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

-      puVar2 = (undefined8 *)

-               _InsertAt(this,(_InsertPosResult *)&local_res10,

-                         (_HashNode<utl::pair<void*___ptr64_const,unsigned_int>_> *)local_38);

-      *param_1 = (void *)*puVar2;

-      *(undefined1 *)(param_1 + 1) = 1;

-    }

-    else {

-      operator_delete__(pvVar1);

-      *param_1 = local_38[0];

-      *(undefined1 *)(param_1 + 1) = 0;

-    }

+  if (*(LPVOID *)(this + 0x20) != (LPVOID)0x0) {

+    CoTaskMemFree(*(LPVOID *)(this + 0x20));

   }

-  return param_1;

+  this_00 = (_HashTable<unsigned_int,utl::pair<unsigned_int_const_,SurfaceVisualizerManager::VisInfo>,utl::hash<unsigned_int>,utl::equal_to<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,SurfaceVisualizerManager::VisInfo>_>,0>

+             *)(this + 0x60);

+  while (p_Var1 = *(_HashTable<unsigned_int,utl::pair<unsigned_int_const_,SurfaceVisualizerManager::VisInfo>,utl::hash<unsigned_int>,utl::equal_to<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,SurfaceVisualizerManager::VisInfo>_>,0>

+                    **)this_00, p_Var1 != this_00) {

+    plVar2 = *(longlong **)(p_Var1 + 8);

+    lVar3 = *(longlong *)p_Var1;

+    *plVar2 = lVar3;

+    *(longlong **)(lVar3 + 8) = plVar2;

+    operator_delete__(p_Var1);

+  }

+  *(undefined8 *)(this + 0x78) = 0;

+  utl::

+  _HashTable<unsigned_int,utl::pair<unsigned_int_const_,SurfaceVisualizerManager::VisInfo>,utl::hash<unsigned_int>,utl::equal_to<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,SurfaceVisualizerManager::VisInfo>_>,0>

+  ::_FreeBuckets(this_00);

+  Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease

+            ((ComPtr<IMediaSinkCallback> *)(this + 0x58));

+  Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease

+            ((ComPtr<IMediaSinkCallback> *)(this + 0x48));

+  Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease

+            ((ComPtr<IMediaSinkCallback> *)(this + 0x30));

+  Microsoft::WRL::ComPtr<IMediaSinkCallback>::InternalRelease

+            ((ComPtr<IMediaSinkCallback> *)(this + 0x28));

+  *(undefined4 *)(this + 0xc) = 0xc0000001;

+  return;

 }
```

## `CProxyStream::Read`  (modified)

```diff
--- CProxyStream::Read
+++ CProxyStream::Read
@@ -1,2 +1,116 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyStream::Read : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl CProxyStream::Read(void * __ptr64,unsigned long,unsigned long *

+   __ptr64) __ptr64 */

+

+long __thiscall CProxyStream::Read(CProxyStream *this,void *param_1,ulong param_2,ulong *param_3)

+

+{

+  undefined4 uVar1;

+  undefined4 uVar2;

+  undefined4 uVar3;

+  bool bVar4;

+  uint uVar5;

+  long lVar6;

+  char *pcVar7;

+  undefined8 uVar8;

+  tagSTATSTG local_78;

+  

+  lVar6 = 1;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar1 = *(undefined4 *)(this + 0x5c);

+    uVar2 = *(undefined4 *)(this + 0x10);

+    uVar3 = *(undefined4 *)(this + 0x44);

+    uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DdDd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x39,

+                &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar5,uVar3,uVar2,uVar1);

+  }

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

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3a,

+               &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar5);

+    }

+    lVar6 = -0x7ffcfff7;

+    goto LAB_0;

+  }

+  if (*(int *)(this + 0x18) == 0) {

+    memset(&local_78,0,0x50);

+    Stat(this,&local_78,1);

+    *(undefined4 *)(this + 0x18) = 1;

+  }

+  if (*(int *)(this + 0x1c) != 0) {

+    if ((*(int *)(this + 0x60) == 0) && (*(int *)(this + 0x24) != 0)) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3b,

+                 &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar5);

+      }

+      lVar6 = -0x7fffbffb;

+      goto LAB_0;

+    }

+    if (*(ulonglong *)(this + 0x20) <= *(ulonglong *)(this + 0x28)) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3c,

+                 &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar5);

+      }

+      if (param_3 != (ulong *)0x0) {

+        *param_3 = 0;

+      }

+      goto LAB_0;

+    }

+  }

+  if (param_2 < 0x10000) {

+    lVar6 = ServiceReadFromCache(this + -0x30,param_1,param_2,param_3);

+    if ((((-1 < lVar6) || ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control)) ||

+        ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_0;

+    uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar8 = 0x3d;

+    pcVar7 = "ServiceReadFromCache failed!";

+  }

+  else {

+    *(undefined4 *)(this + 0x14) = 0;

+    *(undefined4 *)(this + 0x30) = 0;

+    *(void **)(this + 0x38) = param_1;

+    *(ulong *)(this + 0x40) = param_2;

+    lVar6 = SendFileContentsRequest(this + -0x30,2,param_2);

+    if (-1 < lVar6) {

+      if (param_3 != (ulong *)0x0) {

+        *param_3 = *(ulong *)(this + 0x30);

+      }

+      lVar6 = 0;

+      *(ulonglong *)(this + 0x28) = *(longlong *)(this + 0x28) + (ulonglong)*(uint *)(this + 0x30);

+      *(undefined4 *)(this + 0x14) = 0;

+      *(undefined4 *)(this + 0x30) = 0;

+      *(undefined8 *)(this + 0x38) = 0;

+      *(undefined4 *)(this + 0x40) = 0;

+      goto LAB_0;

+    }

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

+        ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_0;

+    uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar8 = 0x3e;

+    pcVar7 = "SendFileContentsRequest failed!";

+  }

+  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar8,

+             &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar5,pcVar7,lVar6);

+LAB_0:

+  bVar4 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1894756665>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_1894756665> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1894756665>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1894756665>::GetImpl(void)'

+                      ::__l2::impl);

+  if ((bVar4) && (lVar6 < 0)) {

+    *(undefined4 *)(this + 0x14) = 0;

+    *(undefined4 *)(this + 0x30) = 0;

+    *(undefined8 *)(this + 0x38) = 0;

+    *(undefined4 *)(this + 0x40) = 0;

+  }

+  return lVar6;

+}

+
```

## `RdpWin32RemoteAppPresenter::CreateInstance`  (modified)

```diff
--- RdpWin32RemoteAppPresenter::CreateInstance
+++ RdpWin32RemoteAppPresenter::DiscardDeviceResources
@@ -1,42 +1,54 @@
 

-/* public: static long __cdecl RdpWin32RemoteAppPresenter::CreateInstance(int,int,struct

-   ID3D11Device * __ptr64,struct IDCompositionDevice * __ptr64,unsigned int,class ITSInstance *

-   __ptr64,struct RdpXInterfaceOutputMapManagerInternal * __ptr64,class RdpWin32RemoteAppPresenter *

-   __ptr64 * __ptr64) */

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: void __cdecl RdpWin32RemoteAppPresenter::DiscardDeviceResources(void) __ptr64 */

 

-long __cdecl

-RdpWin32RemoteAppPresenter::CreateInstance

-          (int param_1,int param_2,ID3D11Device *param_3,IDCompositionDevice *param_4,uint param_5,

-          ITSInstance *param_6,RdpXInterfaceOutputMapManagerInternal *param_7,

-          RdpWin32RemoteAppPresenter **param_8)

+void __thiscall RdpWin32RemoteAppPresenter::DiscardDeviceResources(RdpWin32RemoteAppPresenter *this)

 

 {

-  long lVar1;

-  RdpWin32RemoteAppPresenter *pRVar2;

-  RdpXInterfaceTapClientShellCallback *pRVar3;

-  RdpWin32RemoteAppPresenter *local_18 [2];

+  TCntPtr<ITSThread> *pTVar1;

+  undefined4 uVar2;

+  longlong *plVar3;

+  uint uVar4;

+  CTSCriticalSection *local_res8;

   

-  local_18[0] = (RdpWin32RemoteAppPresenter *)0x0;

-  pRVar2 = operator_new(400);

-  pRVar3 = (RdpXInterfaceTapClientShellCallback *)0x0;

-  if (pRVar2 != (RdpWin32RemoteAppPresenter *)0x0) {

-    pRVar3 = (RdpXInterfaceTapClientShellCallback *)RdpWin32RemoteAppPresenter(pRVar2);

+  local_res8 = (CTSCriticalSection *)(this + 0x40);

+  CTSCriticalSection::Lock(local_res8);

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 0x40) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar2 = *(undefined4 *)(this + 0x50);

+    uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x7f,

+              &WPP_d771ca4c3f1534a0c298a3ee0f0ca533_Traceguids,uVar4,uVar2);

   }

   RdpXSPtr<RdpXInterfaceTapClientShellCallback>::operator=

-            ((RdpXSPtr<RdpXInterfaceTapClientShellCallback> *)local_18,pRVar3);

-  pRVar2 = local_18[0];

-  if (local_18[0] == (RdpWin32RemoteAppPresenter *)0x0) {

-    lVar1 = -0x7ff8fff2;

+            ((RdpXSPtr<RdpXInterfaceTapClientShellCallback> *)(this + 0x88),

+             (RdpXInterfaceTapClientShellCallback *)0x0);

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x80);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

   }

-  else {

-    lVar1 = InitializeObject(local_18[0],param_1,param_2,param_3,param_4,param_5,param_6,param_7);

-    if (-1 < lVar1) {

-      local_18[0] = (RdpWin32RemoteAppPresenter *)0x0;

-      *param_8 = pRVar2;

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x78);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+  }

+  if (*(longlong *)(this + 0x58) != 0) {

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

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

+      (**(code **)(*plVar3 + 0x78))(plVar3,0);

     }

+    plVar3 = *(longlong **)(this + 0x60);

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

+      (**(code **)(*plVar3 + 0x78))(plVar3,0);

+    }

+    (**(code **)(**(longlong **)(this + 0x58) + 0x18))();

   }

-  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

-            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)local_18);

-  return lVar1;

+  *(undefined4 *)(this + 0xb8) = 1;

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res8);

+  return;

 }
```

## `CTSVirtualChannelPluginLoader::LoadExternalPlugin`  (modified)

```diff
--- CTSVirtualChannelPluginLoader::LoadExternalPlugin
+++ CTSVirtualChannelPluginLoader::LoadExternalPlugin
@@ -1,51 +1,147 @@
 

 /* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

    guard_dispatch_icall */

+/* protected: virtual long __cdecl CTSVirtualChannelPluginLoader::LoadExternalPlugin(unsigned short

+   const * __ptr64,class ITSCoreVirtualChannel * __ptr64) __ptr64 */

 

 long __thiscall

-CRdpAudioController::LoadExternalPlugin

+CTSVirtualChannelPluginLoader::LoadExternalPlugin

           (CTSVirtualChannelPluginLoader *this,ushort *param_1,ITSCoreVirtualChannel *param_2)

 

 {

-  long unaff_EBX;

-  longlong unaff_RBP;

-  void *unaff_RSI;

-  longlong *unaff_RDI;

-  ulong unaff_R13D;

-  void *unaff_R14;

-  longlong unaff_R15;

-  bool in_SF;

+  int iVar1;

+  uint uVar2;

+  int iVar3;

+  HMODULE hLibModule;

+  undefined **ppuVar4;

+  FARPROC pFVar5;

+  CTSVirtualChannelPluginLoader *pCVar6;

+  undefined8 uVar7;

+  int local_res20;

+  ulonglong local_40;

+  FARPROC pFStack_38;

+  undefined8 local_30;

   

-  if (!in_SF) {

-    unaff_EBX = RIM_USER_ALLOC_C((void **)(unaff_RBP + -0x10),unaff_R13D,

-                                 *(ulong *)(unaff_RBP + 0x50));

-    unaff_R14 = *(void **)(unaff_RBP + -0x10);

-    if (-1 < unaff_EBX) {

-      unaff_EBX = (**(code **)(*unaff_RDI + 0x108))();

-      if (-1 < unaff_EBX) {

-        unaff_EBX = (**(code **)(*unaff_RDI + 0x120))();

-        if (-1 < unaff_EBX) {

-          unaff_EBX = (**(code **)(*unaff_RDI + 0x148))();

-          if (-1 < unaff_EBX) {

-            unaff_EBX = RIM_USER_ALLOC_C((void **)(unaff_RBP + -0x18),unaff_R13D,

-                                         *(ulong *)(unaff_RBP + 0x48));

-            unaff_RSI = *(void **)(unaff_RBP + -0x18);

-            if (-1 < unaff_EBX) {

-              unaff_EBX = (**(code **)(*unaff_RDI + 0x108))();

-              if (-1 < unaff_EBX) {

-                (**(code **)(**(longlong **)(unaff_R15 + 0x10) + 0x20))

-                          (*(longlong **)(unaff_R15 + 0x10),*(undefined4 *)(unaff_RBP + -0x20),

-                           unaff_R14,*(undefined4 *)(unaff_RBP + 0x50),

-                           *(undefined4 *)(unaff_RBP + 0x58));

-              }

-            }

-          }

+  local_30 = 0;

+  iVar3 = -0x7fffbffb;

+  local_40 = 0;

+  pFStack_38 = (FARPROC)0x0;

+  iVar1 = PluginLoaderHelpers::ShouldLoadPluginViaCom(param_1,(_GUID *)0x0,(ushort **)0x0);

+  if (iVar1 != 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3c,

+                &WPP_bbe861767c833fa98639b356e1f47f41_Traceguids,uVar2,param_1);

+    }

+    return -0x7ff8ffa9;

+  }

+  hLibModule = LoadLibraryW((LPCWSTR)param_1);

+  if (hLibModule == (HMODULE)0x0) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return -0x7fffbffb;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return -0x7fffbffb;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return -0x7fffbffb;

+    }

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3d,

+              &WPP_bbe861767c833fa98639b356e1f47f41_Traceguids,uVar2,param_1);

+    return -0x7fffbffb;

+  }

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DSq(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3e,

+               &WPP_bbe861767c833fa98639b356e1f47f41_Traceguids,uVar2,param_1,hLibModule);

+  }

+  local_res20 = 0;

+  if (0 < *(int *)(this + 0x1d8)) {

+    pCVar6 = this + 0xe8;

+    ppuVar4 = (undefined **)WPP_GLOBAL_Control;

+    do {

+      if (((ppuVar4 != &WPP_GLOBAL_Control) && ((*(byte *)((longlong)ppuVar4 + 0x1c) & 1) != 0)) &&

+         (4 < *(byte *)((longlong)ppuVar4 + 0x19))) {

+        RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_DSqq(*(undefined8 *)(WPP_GLOBAL_Control + 0x10));

+        ppuVar4 = (undefined **)WPP_GLOBAL_Control;

+      }

+      if (*(HMODULE *)pCVar6 == hLibModule) {

+        if (((ppuVar4 != &WPP_GLOBAL_Control) && ((*(byte *)((longlong)ppuVar4 + 0x1c) & 1) != 0))

+           && (1 < *(byte *)((longlong)ppuVar4 + 0x19))) {

+          uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+          WPP_SF_DSq(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x40,

+                     &WPP_bbe861767c833fa98639b356e1f47f41_Traceguids,uVar2,param_1,hLibModule);

         }

+        FreeLibrary(hLibModule);

+        return 1;

       }

+      local_res20 = local_res20 + 1;

+      pCVar6 = pCVar6 + 8;

+    } while (local_res20 < *(int *)(this + 0x1d8));

+  }

+  pFVar5 = GetProcAddress(hLibModule,"VirtualChannelEntryEx");

+  if (pFVar5 == (FARPROC)0x0) {

+    if (pStaticClientInstance != this) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x44,

+                  &WPP_bbe861767c833fa98639b356e1f47f41_Traceguids,uVar2,param_1);

+      }

+      iVar3 = -0x7ff8ffa9;

+      goto LAB_0;

     }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x42,

+                &WPP_bbe861767c833fa98639b356e1f47f41_Traceguids,uVar2,param_1);

+    }

+    pFVar5 = GetProcAddress(hLibModule,"VirtualChannelEntry");

+    if (pFVar5 != (FARPROC)0x0) {

+      local_40 = local_40 & 0xffffffff00000000;

+      local_30 = 0;

+      pFStack_38 = pFVar5;

+      goto LAB_1;

+    }

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

+        ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_0;

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar7 = 0x43;

+    iVar3 = -0x7fffbffb;

   }

-  RIM_USER_FREE(unaff_R14);

-  RIM_USER_FREE(unaff_RSI);

-  return unaff_EBX;

+  else {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x41,

+                &WPP_bbe861767c833fa98639b356e1f47f41_Traceguids,uVar2,param_1);

+    }

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

+    pFStack_38 = pFVar5;

+    local_30 = (**(code **)(**(longlong **)(this + 0x80) + 0x110))();

+LAB_1:

+    iVar3 = (**(code **)(*(longlong *)param_2 + 0x18))(param_2,&local_40);

+    if (-1 < iVar3) {

+      *(HMODULE *)(this + (longlong)*(int *)(this + 0x1d8) * 8 + 0xe8) = hLibModule;

+      *(int *)(this + 0x1d8) = *(int *)(this + 0x1d8) + 1;

+      return 0;

+    }

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

+        ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_0;

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar7 = 0x45;

+  }

+  WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar7,

+            &WPP_bbe861767c833fa98639b356e1f47f41_Traceguids,uVar2,param_1);

+LAB_0:

+  FreeLibrary(hLibModule);

+  return iVar3;

 }
```

## `W32SCard::~W32SCard`  (modified)

```diff
--- W32SCard::~W32SCard
+++ W32SCard::~W32SCard
@@ -1,2 +1,86 @@
-Failed to decompile mstscax.dll - .ProgramDB W32SCard::~W32SCard : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: virtual __cdecl W32SCard::~W32SCard(void) __ptr64 */

+

+void __thiscall W32SCard::~W32SCard(W32SCard *this)

+

+{

+  longlong lVar1;

+  void *pvVar2;

+  bool bVar3;

+  W32SCard *this_00;

+  uint uVar4;

+  ulonglong uVar5;

+  

+  *(undefined ***)this = &_vftable_;

+  bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_1480569144> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1480569144>::GetImpl(void)'

+                      ::__l2::impl);

+  if ((bVar3) && (*(int *)(this + 0x330) != 0)) {

+    EnterCriticalSection((LPCRITICAL_SECTION)(this + 0x2d0));

+    *(undefined4 *)(this + 800) = 1;

+    LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x2d0));

+  }

+  else {

+    *(undefined4 *)(this + 800) = 1;

+  }

+  LOCK();

+  lVar1 = *(longlong *)(this + 0x348);

+  *(longlong *)(this + 0x348) = 0;

+  UNLOCK();

+  if (lVar1 != 0) {

+    (**(code **)(this + 0x398))(lVar1,0xffffffffffffffff);

+  }

+  if (*(void **)(this + 0x278) != (void *)0x0) {

+    operator_delete(*(void **)(this + 0x278));

+  }

+  if (*(RefCount **)(this + 0x280) != (RefCount *)0x0) {

+    RefCount::Release(*(RefCount **)(this + 0x280));

+  }

+  if (*(void **)(this + 0x288) != (void *)0x0) {

+    operator_delete(*(void **)(this + 0x288));

+  }

+  if (*(void **)(this + 0x298) != (void *)0x0) {

+    operator_delete(*(void **)(this + 0x298));

+  }

+  if (*(longlong *)(this + 0x350) != 0) {

+    uVar5 = 0;

+    if (*(int *)(this + 0x358) != 0) {

+      do {

+        pvVar2 = *(void **)(*(longlong *)(this + 0x350) + uVar5 * 8);

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

+          operator_delete(pvVar2);

+        }

+        uVar4 = (int)uVar5 + 1;

+        uVar5 = (ulonglong)uVar4;

+      } while (uVar4 < *(uint *)(this + 0x358));

+    }

+    operator_delete(*(void **)(this + 0x350));

+  }

+  if (*(HMODULE *)(this + 0x328) != (HMODULE)0x0) {

+    FreeLibrary(*(HMODULE *)(this + 0x328));

+  }

+  this_00 = *(W32SCard **)(this + 0x338);

+  if (this_00 != (W32SCard *)0x0) {

+    FreeLibrary((HMODULE)this_00);

+  }

+  if (*(longlong *)(this + 0x340) != 0) {

+    ReleaseStartedEvent(this_00);

+  }

+  if (*(int *)(this + 0x330) != 0) {

+    DeleteCriticalSection((LPCRITICAL_SECTION)(this + 0x2a8));

+    DeleteCriticalSection((LPCRITICAL_SECTION)(this + 0x2d0));

+    DeleteCriticalSection((LPCRITICAL_SECTION)(this + 0x2f8));

+  }

+  if (*(HANDLE *)(this + 0x360) != (HANDLE)0x0) {

+    CloseHandle(*(HANDLE *)(this + 0x360));

+    *(undefined8 *)(this + 0x360) = 0;

+  }

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x378));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x370));

+  W32DrDevice::~W32DrDevice((W32DrDevice *)this);

+  return;

+}

+
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptSmartCardsPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptSmartCardsPermissionItem>
+++ CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptSmartCardsPermissionItem>
@@ -1,2 +1,126 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptSmartCardsPermissionItem> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

+   CRedirectPromptSmartCardsPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi *

+   __ptr64,class ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptSmartCardsPermissionItem>

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int *param_5)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  uint uVar4;

+  CRedirectPromptSmartCardsPermissionItem *pCVar5;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res10;

+  ITSCoreApi *local_res18;

+  ITSWin32CoreApi *local_res20;

+  int *in_stack_ffffffffffffffd0;

+  CRedirectPromptBasePermissionItem *local_28;

+  CRedirectPromptSmartCardsPermissionItem *local_20;

+  

+  local_res10 = param_1;

+  local_res18 = param_2;

+  local_res20 = param_3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  local_20 = (CRedirectPromptSmartCardsPermissionItem *)0x0;

+  if (bVar1) {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptSmartCardsPermissionItem,CRedirectPromptSmartCardsPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) {

+LAB_0:

+      pCVar5 = local_20;

+      param_5._0_4_ = 0;

+      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

+                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

+      if (lVar2 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x36f,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+LAB_1:

+      }

+      else {

+        if ((int)param_5 != 0) {

+          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

+          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

+                                    &_GUID_00000000_0000_0000_c000_000000000046);

+          if (iVar3 == 0) {

+            iVar3 = InlineIsEqualGUID();

+            if (iVar3 == 0) {

+              iVar3 = InlineIsEqualGUID();

+              if (iVar3 != 0) {

+                pCVar5 = pCVar5 + 8;

+                goto LAB_2;

+              }

+              lVar2 = -0x7fffbffe;

+            }

+            else {

+LAB_2:

+              lVar2 = 0;

+              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+            }

+            if (lVar2 < 0) {

+              wil::details::in1diag3::Return_Hr

+                        (unaff_retaddr,0x379,

+                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+              goto LAB_1;

+            }

+          }

+          else {

+            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+          }

+          bVar1 = utl::

+                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                               *)(this + 0x28),

+                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

+                              )&local_28);

+          if (!bVar1) {

+            lVar2 = -0x7ff8fff2;

+            wil::details::in1diag3::Return_Hr

+                      (unaff_retaddr,0x37a,

+                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

+            ;

+            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+            goto LAB_3;

+          }

+          g_wasSmartCardsRequested = 1;

+          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+        }

+        lVar2 = 0;

+      }

+      goto LAB_3;

+    }

+    uVar4 = 0x367;

+  }

+  else {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptSmartCardsPermissionItem,CRedirectPromptSmartCardsPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) goto LAB_0;

+    uVar4 = 0x36b;

+  }

+  wil::details::in1diag3::Return_Hr

+            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+             lVar2);

+LAB_3:

+  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

+  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

+            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

+  return lVar2;

+}

+
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPrintersPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPrintersPermissionItem>
+++ CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPrintersPermissionItem>
@@ -1,2 +1,126 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPrintersPermissionItem> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

+   CRedirectPromptPrintersPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi *

+   __ptr64,class ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPrintersPermissionItem>

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int *param_5)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  uint uVar4;

+  CRedirectPromptPrintersPermissionItem *pCVar5;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res10;

+  ITSCoreApi *local_res18;

+  ITSWin32CoreApi *local_res20;

+  int *in_stack_ffffffffffffffd0;

+  CRedirectPromptBasePermissionItem *local_28;

+  CRedirectPromptPrintersPermissionItem *local_20;

+  

+  local_res10 = param_1;

+  local_res18 = param_2;

+  local_res20 = param_3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  local_20 = (CRedirectPromptPrintersPermissionItem *)0x0;

+  if (bVar1) {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptPrintersPermissionItem,CRedirectPromptPrintersPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) {

+LAB_0:

+      pCVar5 = local_20;

+      param_5._0_4_ = 0;

+      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

+                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

+      if (lVar2 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x36f,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+LAB_1:

+      }

+      else {

+        if ((int)param_5 != 0) {

+          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

+          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

+                                    &_GUID_00000000_0000_0000_c000_000000000046);

+          if (iVar3 == 0) {

+            iVar3 = InlineIsEqualGUID();

+            if (iVar3 == 0) {

+              iVar3 = InlineIsEqualGUID();

+              if (iVar3 != 0) {

+                pCVar5 = pCVar5 + 8;

+                goto LAB_2;

+              }

+              lVar2 = -0x7fffbffe;

+            }

+            else {

+LAB_2:

+              lVar2 = 0;

+              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+            }

+            if (lVar2 < 0) {

+              wil::details::in1diag3::Return_Hr

+                        (unaff_retaddr,0x379,

+                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+              goto LAB_1;

+            }

+          }

+          else {

+            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+          }

+          bVar1 = utl::

+                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                               *)(this + 0x28),

+                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

+                              )&local_28);

+          if (!bVar1) {

+            lVar2 = -0x7ff8fff2;

+            wil::details::in1diag3::Return_Hr

+                      (unaff_retaddr,0x37a,

+                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

+            ;

+            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+            goto LAB_3;

+          }

+          g_wasPrintersRequested = 1;

+          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+        }

+        lVar2 = 0;

+      }

+      goto LAB_3;

+    }

+    uVar4 = 0x367;

+  }

+  else {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptPrintersPermissionItem,CRedirectPromptPrintersPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) goto LAB_0;

+    uVar4 = 0x36b;

+  }

+  wil::details::in1diag3::Return_Hr

+            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+             lVar2);

+LAB_3:

+  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

+  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

+            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

+  return lVar2;

+}

+
```

## `W32SCard::Terminate`  (modified)

```diff
--- W32SCard::Terminate
+++ W32SCard::Terminate
@@ -1,2 +1,49 @@
-Failed to decompile mstscax.dll - .ProgramDB W32SCard::Terminate : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: virtual unsigned long __cdecl W32SCard::Terminate(void) __ptr64 */

+

+ulong __thiscall W32SCard::Terminate(W32SCard *this)

+

+{

+  TCntPtr<ITSThread> *this_00;

+  bool bVar1;

+  uint uVar2;

+  

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_1480569144> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1480569144>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar1) {

+    EnterCriticalSection((LPCRITICAL_SECTION)(this + 0x2d0));

+    *(undefined4 *)(this + 800) = 1;

+    LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x2d0));

+  }

+  this_00 = (TCntPtr<ITSThread> *)(this + 0x378);

+  if (*(longlong *)this_00 != 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x11,

+               &WPP_de34e2354ea93c6e600faf96ae5f54fc_Traceguids,uVar2);

+    }

+    (**(code **)(**(longlong **)this_00 + 0x38))(*(longlong **)this_00,0);

+    if (*(longlong *)this_00 != 0) {

+      TCntPtr<ITSThread>::SafeRelease(this_00);

+      *(undefined8 *)this_00 = 0;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)this_00);

+    }

+  }

+  if (*(int *)(this + 8) != 0) {

+    FlushIRPs(this);

+  }

+  if (*(longlong *)(this + 0x370) != 0) {

+    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x370));

+    *(undefined8 *)(this + 0x370) = 0;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)(this + 0x370));

+  }

+  return 0;

+}

+
```

## `ClearDecompressor::Decompress`  (modified)

```diff
--- ClearDecompressor::Decompress
+++ ClearDecompressor::Decompress
@@ -1,2 +1,767 @@
-Failed to decompile mstscax.dll - .ProgramDB ClearDecompressor::Decompress : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl ClearDecompressor::Decompress(struct RDP_COMPRESSION_PARAMETERS

+   const * __ptr64,struct RDP_BITMAP_INFO const * __ptr64,unsigned char const * __ptr64,unsigned

+   int,unsigned char * __ptr64,unsigned int) __ptr64 */

+

+long __thiscall

+ClearDecompressor::Decompress

+          (ClearDecompressor *this,RDP_COMPRESSION_PARAMETERS *param_1,RDP_BITMAP_INFO *param_2,

+          uchar *param_3,uint param_4,uchar *param_5,uint param_6)

+

+{

+  longlong lVar1;

+  byte bVar2;

+  HBandHeader HVar3;

+  ushort uVar4;

+  undefined4 uVar5;

+  ushort *puVar6;

+  bool bVar7;

+  undefined4 uVar8;

+  undefined4 uVar9;

+  undefined4 uVar10;

+  undefined4 uVar11;

+  long lVar12;

+  int iVar13;

+  void *pvVar14;

+  char *pcVar15;

+  uint uVar16;

+  undefined8 uVar17;

+  uchar *puVar18;

+  uint uVar19;

+  ulonglong uVar20;

+  uint *puVar21;

+  long lVar22;

+  HBandHeader *pHVar23;

+  HBandHeader *pHVar24;

+  uint *puVar25;

+  uint uVar26;

+  uint *puVar27;

+  HBandHeader *pHVar28;

+  uint local_res18;

+  undefined8 in_stack_fffffffffffffee8;

+  PixelMap *pPVar29;

+  undefined8 in_stack_fffffffffffffef0;

+  undefined8 uVar30;

+  HBandHeader *pHVar31;

+  HBandHeader *local_d8;

+  undefined4 local_d0;

+  undefined4 local_cc;

+  undefined4 local_c8;

+  undefined4 local_c4;

+  undefined8 local_c0;

+  undefined8 uStack_b8;

+  undefined8 local_b0;

+  undefined8 local_a8;

+  undefined8 local_a0;

+  uint *puStack_98;

+  ushort *local_90;

+  HBandHeader *local_88;

+  uint *local_80;

+  ulonglong local_78;

+  HBandHeader *local_70;

+  undefined8 local_68;

+  undefined8 local_60;

+  undefined8 local_58;

+  undefined8 uStack_50;

+  uint *local_48;

+  uint *local_40;

+  

+  uVar10 = (undefined4)((ulonglong)in_stack_fffffffffffffef0 >> 0x20);

+  uVar9 = (undefined4)((ulonglong)in_stack_fffffffffffffee8 >> 0x20);

+  lVar22 = 0;

+  lVar12 = 0;

+  local_res18 = 0;

+  local_b0 = 0;

+  local_a8 = 0;

+  local_a0 = 0;

+  puStack_98 = (uint *)0x0;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])

+     ) {

+    uVar11 = *(undefined4 *)(param_2 + 8);

+    uVar5 = *(undefined4 *)(param_2 + 4);

+    uVar8 = RdpX_GetActivityIdPrefix();

+    uVar30 = CONCAT44(uVar10,uVar11);

+    uVar17 = CONCAT44(uVar9,uVar5);

+    WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3a,

+               &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar8,uVar17,uVar30);

+    uVar10 = (undefined4)((ulonglong)uVar30 >> 0x20);

+    uVar9 = (undefined4)((ulonglong)uVar17 >> 0x20);

+  }

+  uVar26 = 0xf;

+  if ((*(int *)(param_2 + 0x10) == 0xf) || (((char)*(int *)(param_2 + 0x10) + 1U & 0xf8) != 0x20)) {

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

+       (((WPP_GLOBAL_Control[0x1c] & 8) == 0 || ((byte)WPP_GLOBAL_Control[0x19] < 2))))

+    goto LAB_0;

+    uVar10 = RdpX_GetActivityIdPrefix();

+    uVar17 = 0x3b;

+LAB_1:

+    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar17,

+              &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar10,CONCAT44(uVar9,0x80070057));

+    goto LAB_0;

+  }

+  if (*(longlong *)(this + 0x40) == 0) {

+    pvVar14 = calloc(0x8000,0xd4);

+    *(void **)(this + 0x40) = pvVar14;

+    if (pvVar14 != (void *)0x0) goto LAB_2;

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

+        ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_3;

+    uVar9 = RdpX_GetActivityIdPrefix();

+    uVar17 = 0x3c;

+    pcVar15 = "m_pCacheEntries";

+LAB_4:

+    WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar17,

+               &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar9,pcVar15,

+               CONCAT44(uVar10,0x8007000e));

+LAB_3:

+    lVar12 = -0x7ff8fff2;

+  }

+  else {

+LAB_2:

+    if (*(longlong *)(this + 0x48) == 0) {

+      pvVar14 = calloc(0x4000,0xd4);

+      *(void **)(this + 0x48) = pvVar14;

+      if (pvVar14 != (void *)0x0) goto LAB_5;

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar9 = RdpX_GetActivityIdPrefix();

+        uVar17 = 0x3d;

+        pcVar15 = "m_pShortCacheEntries";

+        goto LAB_4;

+      }

+      goto LAB_3;

+    }

+LAB_5:

+    if (*(longlong *)(this + 0x58) == 0) {

+      pvVar14 = calloc(800,0x1004);

+      *(void **)(this + 0x58) = pvVar14;

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

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar9 = RdpX_GetActivityIdPrefix();

+          uVar17 = 0x3e;

+          pcVar15 = "m_pGlyphCache";

+          goto LAB_4;

+        }

+        goto LAB_3;

+      }

+      *(undefined4 *)(this + 0x60) = 800;

+    }

+    if (*(int *)(param_2 + 0x10) == 0xf) {

+      uVar16 = 0xf;

+    }

+    else {

+      uVar16 = *(int *)(param_2 + 0x10) + 1U & 0xf8;

+    }

+    iVar13 = *(int *)(param_2 + 8);

+    uVar17 = CONCAT44(uVar10,*(int *)(param_2 + 0xc));

+    pPVar29 = (PixelMap *)CONCAT44(uVar9,iVar13);

+    bVar7 = PixelMap::Attach((PixelMap *)&local_b0,param_5,param_6,*(int *)(param_2 + 4),iVar13,

+                             *(int *)(param_2 + 0xc),uVar16,0,0,*(int *)(param_2 + 4),iVar13);

+    uVar9 = (undefined4)((ulonglong)pPVar29 >> 0x20);

+    uVar10 = (undefined4)((ulonglong)uVar17 >> 0x20);

+    if (bVar7) {

+      uVar16 = -*(int *)(param_2 + 0xc);

+      if (-*(int *)(param_2 + 0xc) < 0) {

+        uVar16 = *(uint *)(param_2 + 0xc);

+      }

+      local_88 = (HBandHeader *)(param_3 + param_4);

+      local_res18 = 0x14;

+      if (((uint)(0x7fffffff / (ulonglong)*(uint *)(param_2 + 8)) < uVar16) ||

+         (param_6 < uVar16 * *(int *)(param_2 + 8))) {

+        if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+           (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (WPP_GLOBAL_Control[0x19] != '\0')))) {

+          uVar17 = 0x40;

+          goto LAB_6;

+        }

+        goto LAB_0;

+      }

+      if (param_4 < 2) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (WPP_GLOBAL_Control[0x19] != '\0')) {

+          uVar17 = 0x41;

+          goto LAB_6;

+        }

+        goto LAB_0;

+      }

+      bVar2 = *param_3;

+      puVar18 = param_3 + 2;

+      if ((bVar2 & 1) == 0) {

+        puVar18 = param_3;

+      }

+      puVar27 = (uint *)(puVar18 + 2);

+      local_90 = (ushort *)(-(ulonglong)((bVar2 & 1) != 0) & (ulonglong)(param_3 + 2));

+      pHVar24 = (HBandHeader *)(puVar18 + 0xe);

+      local_80 = puVar27;

+      if ((*param_3 & 2) == 0) {

+        lVar1 = ((ulonglong)bVar2 & 1) * 2 + 0xe;

+        if (pHVar24 <= local_88) {

+          bVar7 = wil::details::

+                  FeatureImpl<__WilFeatureTraits_Feature_ClearCodecSubCodecBoundsCheck>::

+                  __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_ClearCodecSubCodecBoundsCheck>

+                                       *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_ClearCodecSubCodecBoundsCheck>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_ClearCodecSubCodecBoundsCheck>::GetImpl(void)'

+                                          ::__l2::impl);

+          if (bVar7) {

+            uVar20 = lVar1 + (ulonglong)*(uint *)(puVar18 + 10) +

+                     (ulonglong)*(uint *)(puVar18 + 6) + (ulonglong)*puVar27;

+          }

+          else {

+            uVar20 = lVar1 + (ulonglong)(*(uint *)(puVar18 + 6) + *puVar27 + *(int *)(puVar18 + 10))

+            ;

+          }

+          goto LAB_7;

+        }

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (WPP_GLOBAL_Control[0x19] != '\0')) {

+          uVar17 = 0x43;

+          goto LAB_6;

+        }

+        goto LAB_0;

+      }

+      if (local_90 == (ushort *)0x0) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar9 = RdpX_GetActivityIdPrefix();

+          WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x42,

+                     &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar9,"pGlyphHeader",

+                     CONCAT44(uVar10,0x80070057));

+        }

+        goto LAB_0;

+      }

+      uVar20 = 4;

+LAB_7:

+      if ((((int)(local_a8._4_4_ + 1) >> 3 & 0xffU) * (int)local_b0 * local_b0._4_4_ + 0x32 < uVar20

+          ) || (uVar20 != param_4)) {

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

+           (((WPP_GLOBAL_Control[0x1c] & 8) == 0 || (WPP_GLOBAL_Control[0x19] == '\0'))))

+        goto LAB_0;

+        uVar17 = 0x44;

+LAB_6:

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar17,

+                &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids);

+        goto LAB_0;

+      }

+      if (*(ClearDecompressor *)(param_3 + 1) != this[100]) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (WPP_GLOBAL_Control[0x19] != '\0')) {

+          uVar17 = 0x45;

+          goto LAB_6;

+        }

+        goto LAB_0;

+      }

+      this[100] = (ClearDecompressor)((char)this[100] + '\x01');

+      if ((*param_3 & 4) != 0) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) &&

+           (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar9 = RdpX_GetActivityIdPrefix();

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x46,

+                   &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar9);

+        }

+        *(undefined4 *)(this + 0x50) = 0;

+        *(undefined4 *)(this + 0x54) = 0;

+      }

+      puVar6 = local_90;

+      uVar9 = (undefined4)((ulonglong)pPVar29 >> 0x20);

+      uVar10 = (undefined4)((ulonglong)uVar17 >> 0x20);

+      bVar2 = *param_3;

+      local_res18 = 0x15;

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

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) &&

+           (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar4 = *local_90;

+          uVar11 = RdpX_GetActivityIdPrefix();

+          uVar17 = CONCAT44(uVar10,(uint)uVar4);

+          pPVar29 = (PixelMap *)(CONCAT44(uVar9,(uint)(bVar2 >> 1)) & 0xffffffff00000001);

+          WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x47,

+                     &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar11,pPVar29,uVar17);

+        }

+        uVar9 = (undefined4)((ulonglong)pPVar29 >> 0x20);

+        uVar4 = *puVar6;

+        uVar16 = *(uint *)(this + 0x60);

+        if ((*param_3 & 2) == 0) {

+          uVar19 = (uint)uVar4;

+          if (uVar16 <= uVar19) {

+            if (3999 < uVar4) {

+              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                  ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) &&

+                 (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                uVar9 = RdpX_GetActivityIdPrefix();

+                uVar17 = 0x4c;

+                goto LAB_8;

+              }

+              goto LAB_0;

+            }

+            uVar16 = uVar16 * 3 >> 1;

+            if (uVar19 <= uVar16) {

+              uVar19 = uVar16;

+            }

+            if (3999 < uVar19) {

+              uVar19 = 4000;

+            }

+            pvVar14 = realloc(*(void **)(this + 0x58),(ulonglong)uVar19 * 0x1004);

+            uVar10 = (undefined4)((ulonglong)uVar17 >> 0x20);

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

+              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                  ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                uVar9 = RdpX_GetActivityIdPrefix();

+                uVar17 = 0x4d;

+                pcVar15 = "pNewMem";

+                goto LAB_4;

+              }

+              goto LAB_3;

+            }

+            *(void **)(this + 0x58) = pvVar14;

+            *(uint *)(this + 0x60) = uVar19;

+          }

+          goto LAB_9;

+        }

+        if (uVar16 <= uVar4) {

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

+              ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) == 0)) ||

+             ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_0;

+          uVar9 = RdpX_GetActivityIdPrefix();

+          uVar17 = 0x48;

+LAB_8:

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar17,

+                   &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar9);

+          goto LAB_0;

+        }

+        puVar18 = (uchar *)((ulonglong)uVar4 * 0x1004 + *(longlong *)(this + 0x58));

+        if (*(int *)(puVar18 + 0x1000) == 0) {

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar10 = RdpX_GetActivityIdPrefix();

+            uVar17 = 0x49;

+            goto LAB_1;

+          }

+          goto LAB_0;

+        }

+        local_d0 = 0;

+        local_cc = 0;

+        local_c8 = 0;

+        local_c4 = 0;

+        local_c0 = 0;

+        uStack_b8 = 0;

+        if (local_a8._4_4_ != 0xf) {

+          uVar26 = local_a8._4_4_ + 1 & 0xf8;

+        }

+        bVar7 = PixelMap::Attach((PixelMap *)&local_d0,puVar18,0x1000,(int)local_b0,local_b0._4_4_,

+                                 ((int)(local_a8._4_4_ + 1) >> 3 & 0xffU) * (int)local_b0,uVar26,0,0

+                                 ,(int)local_b0,local_b0._4_4_);

+        if (!bVar7) {

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

+              ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+          goto LAB_10;

+          uVar10 = RdpX_GetActivityIdPrefix();

+          uVar17 = 0x4a;

+          goto LAB_11;

+        }

+        bVar7 = PixelMap::CopyFrom((PixelMap *)&local_b0,(PixelMap *)&local_d0);

+        if (bVar7) {

+          PixelMap::~PixelMap((PixelMap *)&local_d0);

+          goto LAB_12;

+        }

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar10 = RdpX_GetActivityIdPrefix();

+          uVar17 = 0x4b;

+          goto LAB_11;

+        }

+        goto LAB_10;

+      }

+LAB_9:

+      puVar27 = local_80;

+      local_res18 = 0x16;

+      if (*local_80 != 0) {

+        pHVar28 = pHVar24 + *local_80;

+        bVar7 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>::

+                __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks> *)

+                                    &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>::GetImpl(void)'

+                                     ::__l2::impl);

+        if (bVar7) {

+          if (local_88 < pHVar28) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (WPP_GLOBAL_Control[0x19] != '\0')) {

+              uVar17 = 0x4e;

+              goto LAB_6;

+            }

+          }

+          else if (-1 < (int)local_a8) goto LAB_13;

+          goto LAB_0;

+        }

+LAB_13:

+        uVar16 = 0;

+        uVar19 = 0;

+        local_40 = (uint *)((ulonglong)(uint)(local_b0._4_4_ * (int)local_a8) + (longlong)puStack_98

+                           );

+        if (puStack_98 < local_40) {

+          local_78 = local_b0 & 0xffffffff;

+          puVar21 = puStack_98;

+          do {

+            puVar25 = puVar21 + local_78;

+            pHVar23 = pHVar24;

+            local_80 = puVar21;

+            local_48 = puVar25;

+            if (puVar21 < puVar25) {

+              do {

+                pHVar24 = pHVar23;

+                if (uVar16 == 0) {

+                  if (pHVar28 < pHVar23 + 4) {

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

+                        ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || (WPP_GLOBAL_Control[0x19] == '\0')

+                       ) goto LAB_0;

+                    uVar17 = 0x4f;

+                    goto LAB_6;

+                  }

+                  local_d8 = (HBandHeader *)

+                             CONCAT44(local_d8._4_4_,

+                                      (((byte)pHVar23[2] | 0xffffff00) << 8 | (uint)(byte)pHVar23[1]

+                                      ) << 8 | (uint)(byte)*pHVar23);

+                  uVar16 = (uint)(byte)pHVar23[3];

+                  pHVar24 = pHVar23 + 4;

+                  if (uVar16 == 0xff) {

+                    pHVar31 = local_d8;

+                    if (pHVar28 < pHVar23 + 6) goto LAB_14;

+                    uVar16 = (uint)*(ushort *)(pHVar23 + 4);

+                    pHVar24 = pHVar23 + 6;

+                    if (uVar16 == 0xffff) {

+                      local_70 = pHVar23 + 10;

+                      if (pHVar28 < pHVar23 + 10) goto LAB_14;

+                      bVar7 = wil::details::

+                              FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>::

+                              __private_IsEnabled((

+                                                  FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>

+                                                  *)&

+                                                  `private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>::GetImpl(void)'

+                                                  ::__l2::impl);

+                      if ((bVar7) && (local_88 < local_70)) {

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

+                           (((WPP_GLOBAL_Control[0x1c] & 8) == 0 ||

+                            (WPP_GLOBAL_Control[0x19] == '\0')))) goto LAB_0;

+                        uVar17 = 0x50;

+                        goto LAB_6;

+                      }

+                      uVar16 = *(uint *)(pHVar23 + 6);

+                      pHVar24 = local_70;

+                      puVar25 = local_48;

+                    }

+                  }

+                  uVar19 = (uint)local_d8;

+                }

+                *local_80 = uVar19;

+                uVar16 = uVar16 - 1;

+                local_80 = local_80 + 1;

+                pHVar23 = pHVar24;

+              } while (local_80 < puVar25);

+            }

+            puVar21 = (uint *)((longlong)puVar21 + (longlong)(int)local_a8);

+          } while (puVar21 < local_40);

+        }

+      }

+      uVar9 = (undefined4)((ulonglong)uVar17 >> 0x20);

+      local_res18 = 0x17;

+      if (puVar27[1] == 0) {

+LAB_15:

+        uVar9 = (undefined4)((ulonglong)pPVar29 >> 0x20);

+        uVar11 = (undefined4)((ulonglong)uVar17 >> 0x20);

+        local_res18 = 0x18;

+        lVar12 = lVar22;

+        if (puVar27[2] != 0) {

+          pHVar28 = pHVar24 + puVar27[2];

+          if (pHVar28 < pHVar24) {

+            lVar12 = -0x7ff8fdea;

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

+                ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+            goto LAB_16;

+            uVar10 = RdpX_GetActivityIdPrefix();

+            uVar17 = 0x54;

+            uVar30 = CONCAT44(uVar11,0x80070216);

+            pcVar15 = "Subcodec end overflow";

+LAB_17:

+            WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar17,

+                       &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar10,pcVar15,uVar30);

+            goto LAB_16;

+          }

+          lVar12 = 0;

+          while( true ) {

+            uVar10 = (undefined4)((ulonglong)uVar17 >> 0x20);

+            uVar9 = (undefined4)((ulonglong)pPVar29 >> 0x20);

+            if (pHVar28 <= pHVar24) break;

+            pHVar23 = pHVar24 + 0xd;

+            if (pHVar28 < pHVar23) {

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

+                  ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) == 0)) ||

+                 ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_0;

+              uVar9 = RdpX_GetActivityIdPrefix();

+              uVar17 = 0x55;

+              goto LAB_8;

+            }

+            local_78 = (ulonglong)*(uint *)(pHVar24 + 8);

+            local_d8 = pHVar23;

+            if (pHVar28 < pHVar23 + local_78) {

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

+                  ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) == 0)) ||

+                 ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_0;

+              uVar9 = RdpX_GetActivityIdPrefix();

+              uVar17 = 0x56;

+              goto LAB_8;

+            }

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) &&

+               (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+              HVar3 = pHVar24[0xc];

+              uVar10 = RdpX_GetActivityIdPrefix();

+              uVar17 = CONCAT44(uVar9,(uint)(byte)HVar3);

+              pHVar31 = pHVar23;

+              WPP_SF_DDID(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x57,

+                          &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar10,uVar17,pHVar23,

+                          (int)local_78);

+              uVar9 = (undefined4)((ulonglong)uVar17 >> 0x20);

+              uVar10 = (undefined4)((ulonglong)pHVar31 >> 0x20);

+            }

+            local_d0 = 0;

+            local_cc = 0;

+            local_c8 = 0;

+            local_c4 = 0;

+            uVar17 = CONCAT44(uVar10,(int)local_a8);

+            pPVar29 = (PixelMap *)CONCAT44(uVar9,local_b0._4_4_);

+            local_c0 = 0;

+            uStack_b8 = 0;

+            bVar7 = PixelMap::AttachInternal

+                              ((PixelMap *)&local_d0,(TCntPtr<RefCountedBuffer> *)&local_a0,

+                               (uchar *)puStack_98,(int)local_b0,local_b0._4_4_,(int)local_a8,

+                               local_a8._4_4_,(uint)*(ushort *)pHVar24,

+                               (uint)*(ushort *)(pHVar24 + 2),(uint)*(ushort *)(pHVar24 + 4),

+                               (uint)*(ushort *)(pHVar24 + 6));

+            uVar9 = (undefined4)((ulonglong)pPVar29 >> 0x20);

+            if (!bVar7) {

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

+                  ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+              goto LAB_10;

+              uVar10 = RdpX_GetActivityIdPrefix();

+              uVar17 = 0x58;

+              goto LAB_11;

+            }

+            HVar3 = pHVar24[0xc];

+            if (HVar3 == (HBandHeader)0x0) {

+              uVar4 = *(ushort *)(pHVar24 + 4);

+              uVar16 = (uint)*(ushort *)(pHVar24 + 6);

+              iVar13 = (uint)uVar4 + (uint)uVar4 * 2;

+              uVar17 = CONCAT44((int)((ulonglong)uVar17 >> 0x20),iVar13);

+              pPVar29 = (PixelMap *)CONCAT44(uVar9,uVar16);

+              local_68 = 0;

+              local_60 = 0;

+              local_58 = 0;

+              uStack_50 = 0;

+              bVar7 = PixelMap::Attach((PixelMap *)&local_68,(uchar *)pHVar23,*(int *)(pHVar24 + 8),

+                                       (uint)uVar4,uVar16,iVar13,0x18,0,0,(uint)uVar4,uVar16);

+              uVar9 = (undefined4)((ulonglong)pPVar29 >> 0x20);

+              if (!bVar7) {

+                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                    ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19]))

+                {

+                  uVar10 = RdpX_GetActivityIdPrefix();

+                  WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x59,

+                            &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar10,

+                            CONCAT44(uVar9,0x80070057));

+                }

+                lVar12 = -0x7ff8ffa9;

+                PixelMap::~PixelMap((PixelMap *)&local_68);

+                goto LAB_18;

+              }

+              PixelMap::CopyFrom((PixelMap *)&local_d0,(PixelMap *)&local_68);

+              uVar16 = *(uint *)(pHVar24 + 8);

+              PixelMap::~PixelMap((PixelMap *)&local_68);

+              pHVar24 = pHVar23 + uVar16;

+            }

+            else if (HVar3 == (HBandHeader)0x1) {

+              lVar12 = DecompressNSCodec(this,(uchar *)pHVar23,*(uint *)(pHVar24 + 8),

+                                         (PixelMap *)&local_d0);

+              uVar9 = (undefined4)((ulonglong)uVar17 >> 0x20);

+              if (lVar12 < 0) {

+                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                    ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19]))

+                {

+                  uVar10 = RdpX_GetActivityIdPrefix();

+                  uVar17 = 0x5a;

+                  pcVar15 = "DecompressNSCodec failed";

+LAB_19:

+                  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar17,

+                             &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar10,pcVar15,

+                             CONCAT44(uVar9,lVar12));

+                }

+                goto LAB_18;

+              }

+              pHVar24 = pHVar23 + *(uint *)(pHVar24 + 8);

+            }

+            else {

+              if (HVar3 != (HBandHeader)0x2) {

+                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                    ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) &&

+                   (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                  uVar9 = RdpX_GetActivityIdPrefix();

+                  WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x5c,

+                           &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar9);

+                }

+                goto LAB_10;

+              }

+              lVar12 = DecompressRLEX((uchar **)&local_d8,

+                                      (uchar *)(pHVar23 + *(uint *)(pHVar24 + 8)),

+                                      (PixelMap *)&local_d0);

+              uVar9 = (undefined4)((ulonglong)uVar17 >> 0x20);

+              pHVar24 = local_d8;

+              if (lVar12 < 0) {

+                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                    ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19]))

+                {

+                  uVar10 = RdpX_GetActivityIdPrefix();

+                  uVar17 = 0x5b;

+                  pcVar15 = "DecompressRLEX failed";

+                  goto LAB_19;

+                }

+                goto LAB_18;

+              }

+            }

+            PixelMap::~PixelMap((PixelMap *)&local_d0);

+          }

+        }

+        local_res18 = 0x19;

+        if (pHVar24 == local_88) {

+          local_res18 = 0x1a;

+          if ((*param_3 & 1) == 0) {

+LAB_20:

+            if (-1 < lVar12) goto LAB_12;

+          }

+          else {

+            if (*(uint *)(this + 0x60) <= (uint)*local_90) goto LAB_21;

+            local_d0 = 0;

+            local_cc = 0;

+            local_c8 = 0;

+            local_c4 = 0;

+            local_c0 = 0;

+            uStack_b8 = 0;

+            puVar18 = (uchar *)((ulonglong)*local_90 * 0x1004 + *(longlong *)(this + 0x58));

+            if (local_a8._4_4_ != 0xf) {

+              uVar26 = local_a8._4_4_ + 1 & 0xf8;

+            }

+            bVar7 = PixelMap::Attach((PixelMap *)&local_d0,puVar18,0x1000,(int)local_b0,

+                                     local_b0._4_4_,

+                                     ((int)(local_a8._4_4_ + 1) >> 3 & 0xffU) * (int)local_b0,uVar26

+                                     ,0,0,(int)local_b0,local_b0._4_4_);

+            if (bVar7) {

+              bVar7 = PixelMap::CopyFrom((PixelMap *)&local_d0,(PixelMap *)&local_b0);

+              if (bVar7) {

+                puVar18[0x1000] = '\x01';

+                puVar18[0x1001] = '\0';

+                puVar18[0x1002] = '\0';

+                puVar18[0x1003] = '\0';

+                PixelMap::~PixelMap((PixelMap *)&local_d0);

+                goto LAB_20;

+              }

+              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                  ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                uVar10 = RdpX_GetActivityIdPrefix();

+                uVar17 = 0x5f;

+                goto LAB_11;

+              }

+            }

+            else if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                     ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19]))

+            {

+              uVar10 = RdpX_GetActivityIdPrefix();

+              uVar17 = 0x5e;

+LAB_11:

+              WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar17,

+                        &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids,uVar10,

+                        CONCAT44(uVar9,0x80070057));

+            }

+LAB_10:

+            lVar12 = -0x7ff8ffa9;

+LAB_18:

+            PixelMap::~PixelMap((PixelMap *)&local_d0);

+          }

+        }

+        else {

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (WPP_GLOBAL_Control[0x19] != '\0')) {

+            WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x5d,

+                    &WPP_13b51da245623db3b72eb05aac4373f5_Traceguids);

+          }

+LAB_21:

+          lVar12 = -0x7fff0001;

+        }

+      }

+      else {

+        pHVar28 = pHVar24 + puVar27[1];

+        if (pHVar28 < pHVar24) {

+          lVar12 = -0x7ff8fdea;

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar10 = RdpX_GetActivityIdPrefix();

+            uVar17 = 0x51;

+            pcVar15 = "Bands end overflow";

+LAB_22:

+            uVar30 = CONCAT44(uVar9,lVar12);

+            goto LAB_17;

+          }

+        }

+        else {

+          lVar22 = 0;

+          pHVar31 = local_d8;

+          if (local_88 < pHVar28) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) &&

+               (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar9 = RdpX_GetActivityIdPrefix();

+              uVar17 = 0x52;

+              goto LAB_8;

+            }

+            goto LAB_0;

+          }

+          do {

+            local_d8 = pHVar31;

+            if (pHVar28 <= pHVar24) goto LAB_15;

+            local_d8 = pHVar24 + 0xb;

+            if (pHVar28 < local_d8) goto LAB_14;

+            pPVar29 = (PixelMap *)&local_b0;

+            lVar12 = DecodeTextBand(this,pHVar24,(uchar **)&local_d8,(uchar *)pHVar28,pPVar29);

+            uVar9 = (undefined4)((ulonglong)uVar17 >> 0x20);

+            pHVar24 = local_d8;

+            lVar22 = lVar12;

+            pHVar31 = local_d8;

+          } while (-1 < lVar12);

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar10 = RdpX_GetActivityIdPrefix();

+            uVar17 = 0x53;

+            pcVar15 = "DecodeSolidBand failed";

+            goto LAB_22;

+          }

+        }

+      }

+    }

+    else {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar10 = RdpX_GetActivityIdPrefix();

+        uVar17 = 0x3f;

+        goto LAB_1;

+      }

+LAB_0:

+      lVar12 = -0x7ff8ffa9;

+    }

+  }

+LAB_16:

+  LogError(this,local_res18,lVar12);

+LAB_12:

+  PixelMap::~PixelMap((PixelMap *)&local_b0);

+  return lVar12;

+LAB_14:

+  local_d8 = pHVar31;

+  lVar12 = -0x7ff8ff86;

+  goto LAB_16;

+}

+
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptLocationPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptLocationPermissionItem>
+++ CRedirectPromptPermissionCollection::GetSavedCredentialsInUse
@@ -1,126 +1,2 @@
-

-/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

-   guard_dispatch_icall */

-/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

-   CRedirectPromptLocationPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi *

-   __ptr64,class ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

-

-long __thiscall

-CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptLocationPermissionItem>

-          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

-          ITSWin32CoreApi *param_3,int param_4,int *param_5)

-

-{

-  bool bVar1;

-  long lVar2;

-  int iVar3;

-  uint uVar4;

-  CRedirectPromptLocationPermissionItem *pCVar5;

-  void *unaff_retaddr;

-  HINSTANCE__ *local_res10;

-  ITSCoreApi *local_res18;

-  ITSWin32CoreApi *local_res20;

-  int *in_stack_ffffffffffffffd0;

-  CRedirectPromptBasePermissionItem *local_28;

-  CRedirectPromptLocationPermissionItem *local_20;

-  

-  local_res10 = param_1;

-  local_res18 = param_2;

-  local_res20 = param_3;

-  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

-          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

-                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

-                                  ::__l2::impl);

-  local_20 = (CRedirectPromptLocationPermissionItem *)0x0;

-  if (bVar1) {

-    lVar2 = Microsoft::WRL::Details::

-            MakeAndInitialize<CRedirectPromptLocationPermissionItem,CRedirectPromptLocationPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

-                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

-                       in_stack_ffffffffffffffd0);

-    if (-1 < lVar2) {

-LAB_0:

-      pCVar5 = local_20;

-      param_5._0_4_ = 0;

-      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

-                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

-      if (lVar2 < 0) {

-        wil::details::in1diag3::Return_Hr

-                  (unaff_retaddr,0x36f,

-                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

-LAB_1:

-      }

-      else {

-        if ((int)param_5 != 0) {

-          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

-          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

-                                    &_GUID_00000000_0000_0000_c000_000000000046);

-          if (iVar3 == 0) {

-            iVar3 = InlineIsEqualGUID();

-            if (iVar3 == 0) {

-              iVar3 = InlineIsEqualGUID();

-              if (iVar3 != 0) {

-                pCVar5 = pCVar5 + 8;

-                goto LAB_2;

-              }

-              lVar2 = -0x7fffbffe;

-            }

-            else {

-LAB_2:

-              lVar2 = 0;

-              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

-              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

-            }

-            if (lVar2 < 0) {

-              wil::details::in1diag3::Return_Hr

-                        (unaff_retaddr,0x379,

-                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

-              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

-              goto LAB_1;

-            }

-          }

-          else {

-            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

-            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

-          }

-          bVar1 = utl::

-                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

-                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

-                               *)(this + 0x28),

-                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

-                              )&local_28);

-          if (!bVar1) {

-            lVar2 = -0x7ff8fff2;

-            wil::details::in1diag3::Return_Hr

-                      (unaff_retaddr,0x37a,

-                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

-            ;

-            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

-            goto LAB_3;

-          }

-          g_wasLocationRequested = 1;

-          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

-        }

-        lVar2 = 0;

-      }

-      goto LAB_3;

-    }

-    uVar4 = 0x367;

-  }

-  else {

-    lVar2 = Microsoft::WRL::Details::

-            MakeAndInitialize<CRedirectPromptLocationPermissionItem,CRedirectPromptLocationPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

-                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

-                       in_stack_ffffffffffffffd0);

-    if (-1 < lVar2) goto LAB_0;

-    uVar4 = 0x36b;

-  }

-  wil::details::in1diag3::Return_Hr

-            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

-             lVar2);

-LAB_3:

-  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

-  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

-            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

-  return lVar2;

-}

-

+Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::GetSavedCredentialsInUse : Error: Decompile error: 
+Marshaling error: Did not see expected closing element
```

## `CRedirectPromptPermissionCollection::RuntimeClassInitialize`  (modified)

```diff
--- CRedirectPromptPermissionCollection::RuntimeClassInitialize
+++ CRedirectPromptPermissionCollection::RuntimeClassInitialize
@@ -1,2 +1,232 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::RuntimeClassInitialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl CRedirectPromptPermissionCollection::RuntimeClassInitialize(struct

+   HINSTANCE__ * __ptr64,class ITSCoreApi * __ptr64,class ITSWin32CoreApi * __ptr64,enum

+   RedirectPromptDlg2Flags,int,int) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::RuntimeClassInitialize

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,RedirectPromptDlg2Flags param_4,int param_5,int param_6)

+

+{

+  bool bVar1;

+  long lVar2;

+  uint uVar3;

+  int iVar4;

+  void *unaff_retaddr;

+  int *in_stack_ffffffffffffffe0;

+  

+  SmartPtr<IWTSVirtualChannel>::operator=

+            ((SmartPtr<IWTSVirtualChannel> *)(this + 0x18),(IWTSVirtualChannel *)param_2);

+  wil::com_ptr_t<ITSWin32CoreApi,wil::err_returncode_policy>::operator=

+            ((com_ptr_t<ITSWin32CoreApi,wil::err_returncode_policy> *)(this + 0x20),param_3);

+  *(int *)(this + 0x40) = param_6;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  if (bVar1) {

+    *(HINSTANCE__ **)(this + 0x10) = param_1;

+    if ((param_5 == 0) || (iVar4 = 1, (param_4 & 1) != 0)) {

+      iVar4 = 0;

+    }

+    *(int *)(this + 0x48) = iVar4;

+    lVar2 = AddPermissionItem<CRedirectPromptSmartCardsPermissionItem>

+                      (this,param_1,param_2,param_3,iVar4,in_stack_ffffffffffffffe0);

+    if (lVar2 < 0) {

+      uVar3 = 0x2e5;

+    }

+    else {

+      lVar2 = AddPermissionItem<CRedirectPromptWebAuthnPermissionItem>

+                        (this,param_1,param_2,param_3,*(int *)(this + 0x48),

+                         in_stack_ffffffffffffffe0);

+      if (lVar2 < 0) {

+        uVar3 = 0x2e6;

+      }

+      else {

+        lVar2 = AddPermissionItem<CRedirectPromptDrivesPermissionItem>

+                          (this,param_1,param_2,param_3,*(int *)(this + 0x48),

+                           in_stack_ffffffffffffffe0);

+        if (lVar2 < 0) {

+          uVar3 = 0x2e7;

+        }

+        else {

+          lVar2 = AddPermissionItem<CRedirectPromptUsbPermissionItem>

+                            (this,param_1,param_2,param_3,*(int *)(this + 0x48),

+                             in_stack_ffffffffffffffe0);

+          if (lVar2 < 0) {

+            uVar3 = 0x2e8;

+          }

+          else {

+            lVar2 = AddPermissionItem<CRedirectPromptPnpPermissionItem>

+                              (this,param_1,param_2,param_3,*(int *)(this + 0x48),

+                               in_stack_ffffffffffffffe0);

+            if (lVar2 < 0) {

+              uVar3 = 0x2e9;

+            }

+            else {

+              lVar2 = AddPermissionItem<CRedirectPromptClipboardPermissionItem>

+                                (this,param_1,param_2,param_3,*(int *)(this + 0x48),

+                                 in_stack_ffffffffffffffe0);

+              if (lVar2 < 0) {

+                uVar3 = 0x2ea;

+              }

+              else {

+                lVar2 = AddPermissionItem<CRedirectPromptCamerasPermissionItem>

+                                  (this,param_1,param_2,param_3,*(int *)(this + 0x48),

+                                   in_stack_ffffffffffffffe0);

+                if (lVar2 < 0) {

+                  uVar3 = 0x2eb;

+                }

+                else {

+                  lVar2 = AddPermissionItem<CRedirectPromptMicrophonesPermissionItem>

+                                    (this,param_1,param_2,param_3,*(int *)(this + 0x48),

+                                     in_stack_ffffffffffffffe0);

+                  if (lVar2 < 0) {

+                    uVar3 = 0x2ec;

+                  }

+                  else {

+                    lVar2 = AddPermissionItem<CRedirectPromptLocationPermissionItem>

+                                      (this,param_1,param_2,param_3,*(int *)(this + 0x48),

+                                       in_stack_ffffffffffffffe0);

+                    if (lVar2 < 0) {

+                      uVar3 = 0x2ed;

+                    }

+                    else {

+                      lVar2 = AddPermissionItem<CRedirectPromptPortsPermissionItem>

+                                        (this,param_1,param_2,param_3,*(int *)(this + 0x48),

+                                         in_stack_ffffffffffffffe0);

+                      if (lVar2 < 0) {

+                        uVar3 = 0x2ee;

+                      }

+                      else {

+                        lVar2 = AddPermissionItem<CRedirectPromptPrintersPermissionItem>

+                                          (this,param_1,param_2,param_3,*(int *)(this + 0x48),

+                                           in_stack_ffffffffffffffe0);

+                        if (-1 < lVar2) {

+                          lVar2 = AddPermissionItem<CRedirectPromptPosDevicesPermissionItem>

+                                            (this,param_1,param_2,param_3,*(int *)(this + 0x48),

+                                             in_stack_ffffffffffffffe0);

+                          if (-1 < lVar2) {

+                            return 0;

+                          }

+                          uVar3 = 0x2f0;

+LAB_0:

+                          wil::details::in1diag3::Return_Hr

+                                    (unaff_retaddr,uVar3,

+                                     "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp"

+                                     ,lVar2);

+                          return lVar2;

+                        }

+                        uVar3 = 0x2ef;

+                      }

+                    }

+                  }

+                }

+              }

+            }

+          }

+        }

+      }

+    }

+    wil::details::in1diag3::Return_Hr

+              (unaff_retaddr,uVar3,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+               lVar2);

+  }

+  else {

+    if ((param_5 == 0) || (iVar4 = 1, (param_4 & 1) != 0)) {

+      iVar4 = 0;

+    }

+    lVar2 = AddPermissionItem<CRedirectPromptSmartCardsPermissionItem>

+                      (this,param_1,param_2,param_3,iVar4,in_stack_ffffffffffffffe0);

+    if (lVar2 < 0) {

+      uVar3 = 0x2f7;

+    }

+    else {

+      lVar2 = AddPermissionItem<CRedirectPromptWebAuthnPermissionItem>

+                        (this,param_1,param_2,param_3,iVar4,in_stack_ffffffffffffffe0);

+      if (lVar2 < 0) {

+        uVar3 = 0x2f8;

+      }

+      else {

+        lVar2 = AddPermissionItem<CRedirectPromptDrivesPermissionItem>

+                          (this,param_1,param_2,param_3,iVar4,in_stack_ffffffffffffffe0);

+        if (lVar2 < 0) {

+          uVar3 = 0x2f9;

+        }

+        else {

+          lVar2 = AddPermissionItem<CRedirectPromptUsbPermissionItem>

+                            (this,param_1,param_2,param_3,iVar4,in_stack_ffffffffffffffe0);

+          if (lVar2 < 0) {

+            uVar3 = 0x2fa;

+          }

+          else {

+            lVar2 = AddPermissionItem<CRedirectPromptPnpPermissionItem>

+                              (this,param_1,param_2,param_3,iVar4,in_stack_ffffffffffffffe0);

+            if (lVar2 < 0) {

+              uVar3 = 0x2fb;

+            }

+            else {

+              lVar2 = AddPermissionItem<CRedirectPromptClipboardPermissionItem>

+                                (this,param_1,param_2,param_3,iVar4,in_stack_ffffffffffffffe0);

+              if (lVar2 < 0) {

+                uVar3 = 0x2fc;

+              }

+              else {

+                lVar2 = AddPermissionItem<CRedirectPromptCamerasPermissionItem>

+                                  (this,param_1,param_2,param_3,iVar4,in_stack_ffffffffffffffe0);

+                if (lVar2 < 0) {

+                  uVar3 = 0x2fd;

+                }

+                else {

+                  lVar2 = AddPermissionItem<CRedirectPromptMicrophonesPermissionItem>

+                                    (this,param_1,param_2,param_3,iVar4,in_stack_ffffffffffffffe0);

+                  if (lVar2 < 0) {

+                    uVar3 = 0x2fe;

+                  }

+                  else {

+                    lVar2 = AddPermissionItem<CRedirectPromptLocationPermissionItem>

+                                      (this,param_1,param_2,param_3,iVar4,in_stack_ffffffffffffffe0)

+                    ;

+                    if (lVar2 < 0) {

+                      uVar3 = 0x2ff;

+                    }

+                    else {

+                      lVar2 = AddPermissionItem<CRedirectPromptPortsPermissionItem>

+                                        (this,param_1,param_2,param_3,iVar4,

+                                         in_stack_ffffffffffffffe0);

+                      if (lVar2 < 0) {

+                        uVar3 = 0x300;

+                      }

+                      else {

+                        lVar2 = AddPermissionItem<CRedirectPromptPrintersPermissionItem>

+                                          (this,param_1,param_2,param_3,iVar4,

+                                           in_stack_ffffffffffffffe0);

+                        if (-1 < lVar2) {

+                          lVar2 = AddPermissionItem<CRedirectPromptPosDevicesPermissionItem>

+                                            (this,param_1,param_2,param_3,iVar4,

+                                             in_stack_ffffffffffffffe0);

+                          if (-1 < lVar2) {

+                            return 0;

+                          }

+                          uVar3 = 0x302;

+                          goto LAB_0;

+                        }

+                        uVar3 = 0x301;

+                      }

+                    }

+                  }

+                }

+              }

+            }

+          }

+        }

+      }

+    }

+    wil::details::in1diag3::Return_Hr

+              (unaff_retaddr,uVar3,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+               lVar2);

+  }

+  return lVar2;

+}

+
```

## `CIH::IHMaybeSendPDU`  (modified)

```diff
--- CIH::IHMaybeSendPDU
+++ CIH::IHMaybeSendPDU
@@ -1,2 +1,410 @@
-Failed to decompile mstscax.dll - .ProgramDB CIH::IHMaybeSendPDU : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

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

+/* private: void __cdecl CIH::IHMaybeSendPDU(void) __ptr64 */

+

+void __thiscall CIH::IHMaybeSendPDU(CIH *this)

+

+{

+  bool bVar1;

+  char cVar2;

+  int iVar3;

+  undefined4 uVar4;

+  ulong uVar5;

+  long lVar6;

+  void *pvVar7;

+  undefined8 uVar8;

+  CTSRdpConnectionStack *pCVar9;

+  CTSRdpConnectionStack *pCVar10;

+  CTSRdpConnectionStack *pCVar11;

+  CTSRdpConnectionStack *pCVar12;

+  int in_R8D;

+  tagTS_INPUT_MOUSE_DATA *ptVar13;

+  int in_R9D;

+  uint uVar14;

+  ulong uVar15;

+  ulonglong uVar16;

+  ushort *puVar17;

+  undefined1 auStack_c8 [32];

+  char *local_a8;

+  int local_a0;

+  int local_98 [2];

+  ITSNetBuffer *local_90;

+  uint local_88;

+  uint local_84;

+  uint local_80;

+  int local_7c;

+  ushort *local_78;

+  CTSRdpConnectionStack *local_70;

+  CTSRdpConnectionStack *local_68 [2];

+  undefined8 local_58;

+  CTSCriticalSection *local_50;

+  HLOCAL local_48;

+  undefined8 local_40;

+  undefined8 uStack_38;

+  ulonglong local_30;

+  

+  local_30 = __security_cookie ^ (ulonglong)auStack_c8;

+  pCVar11 = (CTSRdpConnectionStack *)0x0;

+  pCVar9 = (CTSRdpConnectionStack *)0x0;

+  local_58 = 0;

+  local_68[0] = (CTSRdpConnectionStack *)0x0;

+  local_84 = 0;

+  uVar15 = 0;

+  uVar14 = 0;

+  local_80 = 0;

+  local_7c = 0;

+  pCVar12 = (CTSRdpConnectionStack *)0x0;

+  local_40 = 0;

+  uStack_38 = 0;

+  local_90 = (ITSNetBuffer *)0x0;

+  local_70 = (CTSRdpConnectionStack *)0x0;

+  local_78 = (ushort *)0x0;

+  local_48 = (HLOCAL)0x0;

+  if (*(longlong **)(this + 0xb0) != (longlong *)0x0) {

+    (**(code **)(**(longlong **)(this + 0xb0) + 200))();

+    local_84 = (**(code **)(**(longlong **)(this + 0xb0) + 0x100))();

+    iVar3 = (**(code **)(**(longlong **)(this + 0xb0) + 0xd0))();

+    if (iVar3 < 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpX_GetActivityIdPrefix();

+        local_a8 = "GetCurrentMousePosition failed!";

+        local_a0 = iVar3;

+        WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x27,

+                   &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+      }

+      goto LAB_0;

+    }

+  }

+  local_50 = (CTSCriticalSection *)(this + 0x78);

+  CTSCriticalSection::Lock(local_50);

+  local_98[0] = 0;

+  PAL_System_TimeGetTickCount(local_98);

+  local_88 = local_98[0] - *(int *)(this + 0x3c);

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+    in_R9D = RdpX_GetActivityIdPrefix();

+    local_a8 = (char *)CONCAT44(local_a8._4_4_,local_88);

+    in_R8D = -0x7f911b10;

+    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10));

+  }

+  if (((*(int *)(this + 0x54) == 0) || (*(int *)(this + 0x38) != 0)) ||

+     (local_88 <= *(uint *)(this + 0x54))) {

+    if (*(longlong *)(this + 0x48) == 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpX_GetActivityIdPrefix();

+        uVar8 = 0x29;

+        goto LAB_1;

+      }

+    }

+    else {

+      if (*(short *)(*(longlong *)(this + 0x48) + 0x12) != 0) goto LAB_2;

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpX_GetActivityIdPrefix();

+        uVar8 = 0x2a;

+        goto LAB_1;

+      }

+    }

+  }

+  else {

+    ptVar13 = (tagTS_INPUT_MOUSE_DATA *)&local_40;

+    local_40 = local_58;

+    IHAddMouseEventToPDU(this,0,ptVar13);

+    in_R8D = (int)ptVar13;

+    *(int *)(this + 0x3c) = local_98[0];

+    *(undefined4 *)(this + 0x38) = 1;

+LAB_2:

+    cVar2 = FeatureMsrc108622();

+    if ((cVar2 == '\0') || (*(longlong *)(this + 0x48) != 0)) {

+      pCVar10 = pCVar11;

+      if (((uint)*(ushort *)(*(longlong *)(this + 0x48) + 0x12) < *(uint *)(this + 0x50)) &&

+         ((*(int *)(this + 0x38) == 0 && (local_88 < local_84)))) {

+        uVar5 = 0;

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            (pCVar10 = pCVar9, pCVar11 = pCVar12, uVar5 = uVar15,

+            (WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar4 = RdpX_GetActivityIdPrefix();

+          in_R8D = -0x7f911b10;

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x2e,

+                   &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+        }

+LAB_3:

+        CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_50);

+        cVar2 = FeatureMsrc108622();

+        puVar17 = local_78;

+        bVar1 = false;

+        if (local_7c != 0) {

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

+            if ((*(longlong *)(this + 0xb8) == 0) || (*(int *)(this + 100) == 0)) {

+              if (pCVar10 == (CTSRdpConnectionStack *)0x0) {

+LAB_4:

+                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                    ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19]))

+                {

+                  uVar4 = RdpX_GetActivityIdPrefix();

+                  local_a8 = (char *)CONCAT44(local_a8._4_4_,uVar14);

+                  WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3d,

+                            &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+                }

+              }

+              else {

+                lVar6 = CTSRdpConnectionStack::GetBuffer(pCVar10,0xc16,in_R8D,&local_90);

+                if (lVar6 < 0) {

+                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                      ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])

+                     ) {

+                    uVar4 = RdpX_GetActivityIdPrefix();

+                    uVar8 = 0x38;

+                    goto LAB_5;

+                  }

+                }

+                else {

+                  pvVar7 = (void *)(**(code **)(*(longlong *)local_90 + 0x28))();

+                  memcpy(pvVar7,local_78,0xc16);

+                  if (*(int *)(this + 100) == 0) {

+                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) &&

+                       (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+                      uVar4 = RdpX_GetActivityIdPrefix();

+                      local_a8 = (char *)CONCAT44(local_a8._4_4_,uVar14);

+                      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3b,

+                                &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+                    }

+                    lVar6 = CTSRdpConnectionStack::SendBuffer(pCVar10,local_90,uVar5,8);

+                    if (((lVar6 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control))

+                       && (((WPP_GLOBAL_Control[0x1c] & 8) != 0 &&

+                           (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+                      uVar4 = RdpX_GetActivityIdPrefix();

+                      uVar8 = 0x3c;

+LAB_6:

+                      local_a8 = "SendBuffer failed!";

+                      local_a0 = lVar6;

+                      goto LAB_7;

+                    }

+                  }

+                  else {

+                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) &&

+                       (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+                      uVar4 = RdpX_GetActivityIdPrefix();

+                      local_a8 = (char *)CONCAT44(local_a8._4_4_,uVar14);

+                      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x39,

+                                &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+                    }

+                    lVar6 = CTSRdpConnectionStack::SendFastPathInput(pCVar10,local_90,uVar5,uVar14);

+                    if ((((lVar6 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control))

+                        && ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                      uVar4 = RdpX_GetActivityIdPrefix();

+                      uVar8 = 0x3a;

+LAB_8:

+                      local_a8 = "SendFastPathInput failed!";

+                      local_a0 = lVar6;

+LAB_7:

+                      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar8,

+                                 &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+                    }

+                  }

+                }

+              }

+            }

+            else {

+              local_78[-2] = 0;

+              local_78[-1] = 0;

+              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                  ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+                uVar4 = RdpX_GetActivityIdPrefix();

+                local_a8 = (char *)CONCAT44(local_a8._4_4_,uVar14);

+                WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x36,

+                          &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+              }

+              puVar17[-2] = 0x303;

+              *(char *)(puVar17 + -1) = (char)uVar14;

+              iVar3 = (**(code **)(**(longlong **)(this + 0xb8) + 0x18))

+                                (*(longlong **)(this + 0xb8),uVar5 + 4,puVar17 + -2,0);

+              if ((((iVar3 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+                  ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                uVar4 = RdpX_GetActivityIdPrefix();

+                uVar8 = 0x37;

+LAB_9:

+                local_a8 = "Write failed!";

+                local_a0 = iVar3;

+                goto LAB_7;

+              }

+            }

+          }

+          else if ((pCVar11 == (CTSRdpConnectionStack *)0x0) || (*(int *)(this + 100) == 0)) {

+            if (pCVar10 == (CTSRdpConnectionStack *)0x0) {

+LAB_10:

+              if (!bVar1) goto LAB_4;

+            }

+            else {

+              lVar6 = CTSRdpConnectionStack::GetBuffer(pCVar10,0xc16,in_R8D,&local_90);

+              if (lVar6 < 0) {

+                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                    ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19]))

+                {

+                  uVar4 = RdpX_GetActivityIdPrefix();

+                  uVar8 = 0x31;

+LAB_5:

+                  local_a8 = "GetBuffer failed!";

+                  local_a0 = lVar6;

+                  goto LAB_7;

+                }

+              }

+              else {

+                pvVar7 = (void *)(**(code **)(*(longlong *)local_90 + 0x28))();

+                memcpy(pvVar7,local_78,0xc16);

+                if (*(int *)(this + 100) == 0) {

+                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])

+                     ) {

+                    uVar4 = RdpX_GetActivityIdPrefix();

+                    local_a8 = (char *)CONCAT44(local_a8._4_4_,uVar14);

+                    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x34,

+                              &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+                  }

+                  lVar6 = CTSRdpConnectionStack::SendBuffer(pCVar10,local_90,uVar5,8);

+                  if (-1 < lVar6) goto LAB_11;

+                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                      ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])

+                     ) {

+                    uVar4 = RdpX_GetActivityIdPrefix();

+                    uVar8 = 0x35;

+                    goto LAB_6;

+                  }

+                }

+                else {

+                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])

+                     ) {

+                    uVar4 = RdpX_GetActivityIdPrefix();

+                    local_a8 = (char *)CONCAT44(local_a8._4_4_,uVar14);

+                    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x32,

+                              &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+                  }

+                  lVar6 = CTSRdpConnectionStack::SendFastPathInput(pCVar10,local_90,uVar5,uVar14);

+                  if (-1 < lVar6) {

+LAB_11:

+                    bVar1 = true;

+                    goto LAB_10;

+                  }

+                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                      ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])

+                     ) {

+                    uVar4 = RdpX_GetActivityIdPrefix();

+                    uVar8 = 0x33;

+                    goto LAB_8;

+                  }

+                }

+              }

+            }

+          }

+          else {

+            local_78[-2] = 0;

+            local_78[-1] = 0;

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar4 = RdpX_GetActivityIdPrefix();

+              local_a8 = (char *)CONCAT44(local_a8._4_4_,uVar14);

+              WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x2f,

+                        &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+            }

+            puVar17[-2] = 0x303;

+            *(char *)(puVar17 + -1) = (char)uVar14;

+            iVar3 = (**(code **)(*(longlong *)pCVar11 + 0x18))(pCVar11,uVar5 + 4,puVar17 + -2,0);

+            if (-1 < iVar3) goto LAB_11;

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar4 = RdpX_GetActivityIdPrefix();

+              uVar8 = 0x30;

+              goto LAB_9;

+            }

+          }

+        }

+        if (local_48 == (HLOCAL)0x0) goto LAB_0;

+      }

+      else {

+        uVar16 = (ulonglong)(-(uint)(*(int *)(this + 100) != 0) & 4);

+        local_48 = (HLOCAL)PAL_System_MemAlloc(uVar16 + 0xc16,1);

+        if (local_48 == (HLOCAL)0x0) {

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar4 = RdpX_GetActivityIdPrefix();

+            local_a8 = "TS_INPUT_PDU";

+            WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x2c,

+                      &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+          }

+          goto LAB_12;

+        }

+        puVar17 = (ushort *)(uVar16 + (longlong)local_48);

+        local_78 = puVar17;

+        if (*(int *)(this + 100) == 0) {

+          memcpy(puVar17,*(void **)(this + 0x48),0xc16);

+          uVar5 = (ulong)*puVar17;

+          uVar14 = 0;

+        }

+        else {

+          uVar5 = IHTranslateInputToFastPath(this,&local_80,(uchar *)puVar17,in_R9D);

+          uVar14 = local_80;

+        }

+        cVar2 = FeatureMsrc108622();

+        if ((cVar2 == '\0') || (*(longlong *)(this + 0xe8) != 0)) {

+          local_7c = 1;

+          if (*(longlong *)(this + 0x98) != 0) {

+            TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+                      ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)local_68);

+            pCVar10 = *(CTSRdpConnectionStack **)(this + 0x98);

+            local_68[0] = pCVar10;

+            TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                      ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)local_68);

+          }

+          cVar2 = FeatureMsrc108622();

+          if ((cVar2 != '\0') && (pCVar11 = pCVar12, *(longlong *)(this + 0xb8) != 0)) {

+            TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_70);

+            pCVar11 = *(CTSRdpConnectionStack **)(this + 0xb8);

+            local_70 = pCVar11;

+            TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                      ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_70);

+          }

+          in_R8D = 0xc16;

+          *(undefined4 *)(this + 0x38) = 0;

+          *(int *)(this + 0x3c) = local_98[0];

+          memset(*(void **)(this + 0xe8),0,0xc16);

+          IHInitPacket(this);

+          goto LAB_3;

+        }

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar4 = RdpX_GetActivityIdPrefix();

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x2d,

+                   &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+        }

+        CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_50);

+      }

+      LocalFree(local_48);

+      goto LAB_0;

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpX_GetActivityIdPrefix();

+      uVar8 = 0x2b;

+LAB_1:

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar8,

+               &WPP_190555ea13253a4eca49c506e86a3139_Traceguids,uVar4);

+    }

+  }

+LAB_12:

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_50);

+LAB_0:

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_70);

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)local_68);

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_90);

+  return;

+}

+
```

## `MediaSourceVCCallback::OnActivateDevice`  (modified)

```diff
--- MediaSourceVCCallback::OnActivateDevice
+++ MediaSourceVCCallback::OnActivateDevice
@@ -1,2 +1,83 @@
-Failed to decompile mstscax.dll - .ProgramDB MediaSourceVCCallback::OnActivateDevice : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl MediaSourceVCCallback::OnActivateDevice(unsigned char) __ptr64 */

+

+long __thiscall MediaSourceVCCallback::OnActivateDevice(MediaSourceVCCallback *this,uchar param_1)

+

+{

+  longlong *plVar1;

+  bool bVar2;

+  int iVar3;

+  uint uVar4;

+  char *pcVar5;

+  undefined7 in_register_00000011;

+  undefined8 uVar6;

+  uchar local_res10 [8];

+  

+  bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>::GetImpl(void)'

+                                  ::__l2::impl);

+  plVar1 = *(longlong **)(this + 0x20);

+  if (bVar2) {

+    iVar3 = (**(code **)(*plVar1 + 0x28))(plVar1,*(undefined8 *)(this + 0x18),1 < param_1);

+    if (iVar3 < 0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return iVar3;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+        return iVar3;

+      }

+      if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+        return iVar3;

+      }

+      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar6 = 0x26;

+LAB_0:

+      pcVar5 = "m_spCameraAdapter->ActivateDevice failed";

+      goto LAB_1;

+    }

+  }

+  else {

+    iVar3 = (**(code **)(*plVar1 + 0x18))(plVar1,CONCAT71(in_register_00000011,1 < param_1));

+    if (iVar3 < 0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return iVar3;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+        return iVar3;

+      }

+      if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+        return iVar3;

+      }

+      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar6 = 0x27;

+      goto LAB_0;

+    }

+  }

+  local_res10[1] = 1;

+  local_res10[0] = param_1;

+  iVar3 = (**(code **)(**(longlong **)(this + 0x18) + 0x18))

+                    (*(longlong **)(this + 0x18),2,local_res10);

+  if (-1 < iVar3) {

+    return iVar3;

+  }

+  if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+    return iVar3;

+  }

+  if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+    return iVar3;

+  }

+  if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+    return iVar3;

+  }

+  uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+  uVar6 = 0x28;

+  pcVar5 = "m_spChannel->Write failed";

+LAB_1:

+  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar6,

+             &WPP_74ce521e55c7353e2d08106bc6647e0b_Traceguids,uVar4,pcVar5,iVar3);

+  return iVar3;

+}

+
```

## `CameraAdapter::VerifyStateAndStreamIndex`  (modified)

```diff
--- CameraAdapter::VerifyStateAndStreamIndex
+++ MediaSourceVCCallback::OnSetPropertyValueRequest
@@ -1,13 +1,2 @@
-

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

-

-long __thiscall

-Microsoft::WRL::Details::

-RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<6>,0,0,0,IClassFactory,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil>

-::VerifyStateAndStreamIndex(CameraAdapter *this,uchar param_1)

-

-{

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

-  halt_baddata();

-}

-

+Failed to decompile mstscax.dll - .ProgramDB MediaSourceVCCallback::OnSetPropertyValueRequest : Error: Decompile error: 
+Marshaling error: Did not see expected closing element
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptCamerasPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptCamerasPermissionItem>
+++ CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptCamerasPermissionItem>
@@ -1,2 +1,126 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptCamerasPermissionItem> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

+   CRedirectPromptCamerasPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi *

+   __ptr64,class ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptCamerasPermissionItem>

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int *param_5)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  uint uVar4;

+  CRedirectPromptCamerasPermissionItem *pCVar5;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res10;

+  ITSCoreApi *local_res18;

+  ITSWin32CoreApi *local_res20;

+  int *in_stack_ffffffffffffffd0;

+  CRedirectPromptBasePermissionItem *local_28;

+  CRedirectPromptCamerasPermissionItem *local_20;

+  

+  local_res10 = param_1;

+  local_res18 = param_2;

+  local_res20 = param_3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  local_20 = (CRedirectPromptCamerasPermissionItem *)0x0;

+  if (bVar1) {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptCamerasPermissionItem,CRedirectPromptCamerasPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) {

+LAB_0:

+      pCVar5 = local_20;

+      param_5._0_4_ = 0;

+      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

+                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

+      if (lVar2 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x36f,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+LAB_1:

+      }

+      else {

+        if ((int)param_5 != 0) {

+          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

+          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

+                                    &_GUID_00000000_0000_0000_c000_000000000046);

+          if (iVar3 == 0) {

+            iVar3 = InlineIsEqualGUID();

+            if (iVar3 == 0) {

+              iVar3 = InlineIsEqualGUID();

+              if (iVar3 != 0) {

+                pCVar5 = pCVar5 + 8;

+                goto LAB_2;

+              }

+              lVar2 = -0x7fffbffe;

+            }

+            else {

+LAB_2:

+              lVar2 = 0;

+              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+            }

+            if (lVar2 < 0) {

+              wil::details::in1diag3::Return_Hr

+                        (unaff_retaddr,0x379,

+                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+              goto LAB_1;

+            }

+          }

+          else {

+            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+          }

+          bVar1 = utl::

+                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                               *)(this + 0x28),

+                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

+                              )&local_28);

+          if (!bVar1) {

+            lVar2 = -0x7ff8fff2;

+            wil::details::in1diag3::Return_Hr

+                      (unaff_retaddr,0x37a,

+                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

+            ;

+            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+            goto LAB_3;

+          }

+          g_wasCamerasRequested = 1;

+          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+        }

+        lVar2 = 0;

+      }

+      goto LAB_3;

+    }

+    uVar4 = 0x367;

+  }

+  else {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptCamerasPermissionItem,CRedirectPromptCamerasPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) goto LAB_0;

+    uVar4 = 0x36b;

+  }

+  wil::details::in1diag3::Return_Hr

+            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+             lVar2);

+LAB_3:

+  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

+  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

+            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

+  return lVar2;

+}

+
```

## `CProxyStream::SendFileContentsRequest`  (modified)

```diff
--- CProxyStream::SendFileContentsRequest
+++ CProxyStream::SendFileContentsRequest
@@ -1,2 +1,253 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyStream::SendFileContentsRequest : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CProxyStream::SendFileContentsRequest(unsigned long,unsigned long) __ptr64

+    */

+

+long __thiscall

+CProxyStream::SendFileContentsRequest(CProxyStream *this,ulong param_1,ulong param_2)

+

+{

+  undefined4 uVar1;

+  undefined4 uVar2;

+  longlong *plVar3;

+  ulonglong uVar4;

+  bool bVar5;

+  uint uVar6;

+  int iVar7;

+  undefined4 uVar8;

+  long lVar9;

+  DWORD DVar10;

+  char *pcVar11;

+  undefined8 uVar12;

+  DWORD local_res8 [2];

+  ulong local_res10;

+  undefined4 local_res20 [2];

+  HANDLE *local_48;

+  undefined8 local_40;

+  

+  local_48 = (HANDLE *)0x0;

+  local_res8[0] = 0;

+  local_res20[0] = 0;

+  local_res10 = param_1;

+  if (*(longlong *)(this + 0x38) == 0) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return -0x7fff0001;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return -0x7fff0001;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return -0x7fff0001;

+    }

+    uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar12 = 0x27;

+LAB_0:

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar12,

+             &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar6);

+    return -0x7fff0001;

+  }

+  if (*(longlong *)(*(longlong *)(this + 0x38) + 0x68) == 0) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return -0x7fff0001;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return -0x7fff0001;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return -0x7fff0001;

+    }

+    uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar12 = 0x28;

+    goto LAB_0;

+  }

+  iVar7 = *(int *)(this + 0x74);

+  if (iVar7 < 0) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return -0x7fff0001;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return -0x7fff0001;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return -0x7fff0001;

+    }

+    uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar12 = 0x29;

+    goto LAB_0;

+  }

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar8 = *(undefined4 *)(this + 0x8c);

+    uVar1 = *(undefined4 *)(this + 0x40);

+    uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DdDd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x2a,

+                &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar6,iVar7,uVar1,uVar8);

+  }

+  plVar3 = *(longlong **)(*(longlong *)(this + 0x38) + 0x68);

+  iVar7 = (**(code **)(*plVar3 + 0x18))(plVar3,&local_48,local_res8);

+  if (iVar7 < 0) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return iVar7;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+      return iVar7;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return iVar7;

+    }

+    uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar12 = 0x2b;

+    pcVar11 = "GetStreamDataEvents failed!";

+LAB_1:

+    WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar12,

+               &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar6,pcVar11,iVar7);

+    return iVar7;

+  }

+  if ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) {

+    if (((WPP_GLOBAL_Control[0x1c] & 1) != 0) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar8 = *(undefined4 *)(this + 0x8c);

+      uVar1 = *(undefined4 *)(this + 0x40);

+      uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x2c,

+                 &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar6,uVar1,uVar8);

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_DdI(*(undefined8 *)(WPP_GLOBAL_Control + 0x10));

+    }

+  }

+  uVar4 = *(ulonglong *)(this + 0x58);

+  local_40 = uVar4;

+  iVar7 = CProxyStreamManager::AcquireProxyStream

+                    (*(CProxyStreamManager **)(this + 0x38),this,*(long *)(this + 0x40));

+  if (iVar7 < 0) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return iVar7;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+      return iVar7;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return iVar7;

+    }

+    uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar12 = 0x2e;

+    pcVar11 = "AcquireProxyStream failed.";

+    goto LAB_1;

+  }

+  if ((*(int *)(this + 0x90) == 0) || (*(ulonglong *)(this + 0x58) < 0x100000000)) {

+    uVar8 = 0;

+  }

+  else {

+    uVar8 = local_40._4_4_;

+  }

+  iVar7 = (**(code **)(*plVar3 + 0x20))

+                    (plVar3,*(undefined4 *)(this + 0x8c),*(undefined4 *)(this + 0x40),

+                     *(undefined4 *)(this + 0x74),local_res10,uVar4 & 0xffffffff,uVar8,param_2,

+                     local_res20);

+  if (iVar7 < 0) {

+    lVar9 = CProxyStreamManager::ReleaseProxyStream

+                      (*(CProxyStreamManager **)(this + 0x38),*(long *)(this + 0x40));

+    if (lVar9 < 0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return iVar7;

+      }

+      if (((WPP_GLOBAL_Control[0x1c] & 1) != 0) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar8 = *(undefined4 *)(this + 0x40);

+        uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x2f,

+                  &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar6,uVar8);

+      }

+    }

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return iVar7;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+      return iVar7;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return iVar7;

+    }

+    uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar12 = 0x30;

+    pcVar11 = "SendFileContentsRequest failed!";

+    goto LAB_1;

+  }

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x31,

+             &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar6);

+  }

+  DVar10 = WaitForMultipleObjects(local_res8[0],local_48,0,0xffffffff);

+  if (DVar10 == 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar8 = *(undefined4 *)(this + 0x8c);

+      uVar1 = *(undefined4 *)(this + 0x40);

+      uVar2 = *(undefined4 *)(this + 0x74);

+      uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_DdDd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x35,

+                  &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar6,uVar2,uVar1,uVar8);

+    }

+    if (*(int *)(this + 0x44) != 0) {

+      return 0;

+    }

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return -0x7fffbffb;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return -0x7fffbffb;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return -0x7fffbffb;

+    }

+    uVar8 = *(undefined4 *)(this + 0x8c);

+    uVar1 = *(undefined4 *)(this + 0x40);

+    uVar2 = *(undefined4 *)(this + 0x74);

+    uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DdDd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x36,

+                &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar6,uVar2,uVar1,uVar8);

+    return -0x7fffbffb;

+  }

+  if (DVar10 < local_res8[0]) {

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

+        ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_2;

+    uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar12 = 0x32;

+  }

+  else {

+    if (DVar10 == 0x102) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x33,

+                 &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar6);

+      }

+      goto LAB_2;

+    }

+    if (((DVar10 == 0xffffffff) || ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control)) ||

+       (((WPP_GLOBAL_Control[0x1c] & 1) == 0 || ((byte)WPP_GLOBAL_Control[0x19] < 2))))

+    goto LAB_2;

+    uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+    DVar10 = DVar10 - 0x80;

+    uVar12 = 0x34;

+  }

+  WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar12,

+            &WPP_a8127e6349d334906d559d27be98d1da_Traceguids,uVar6,DVar10);

+LAB_2:

+  bVar5 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1894756665>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_1894756665> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1894756665>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1894756665>::GetImpl(void)'

+                      ::__l2::impl);

+  if ((bVar5) && (*(CProxyStreamManager **)(this + 0x38) != (CProxyStreamManager *)0x0)) {

+    CProxyStreamManager::ReleaseProxyStream

+              (*(CProxyStreamManager **)(this + 0x38),*(long *)(this + 0x40));

+  }

+  (**(code **)(*plVar3 + 0x28))(plVar3,local_res20[0],7,0xc);

+  return -0x7fffbffb;

+}

+
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptMicrophonesPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptMicrophonesPermissionItem>
+++ CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptMicrophonesPermissionItem>
@@ -1,2 +1,126 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptMicrophonesPermissionItem> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

+   CRedirectPromptMicrophonesPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi *

+   __ptr64,class ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptMicrophonesPermissionItem>

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int *param_5)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  uint uVar4;

+  CRedirectPromptMicrophonesPermissionItem *pCVar5;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res10;

+  ITSCoreApi *local_res18;

+  ITSWin32CoreApi *local_res20;

+  int *in_stack_ffffffffffffffd0;

+  CRedirectPromptBasePermissionItem *local_28;

+  CRedirectPromptMicrophonesPermissionItem *local_20;

+  

+  local_res10 = param_1;

+  local_res18 = param_2;

+  local_res20 = param_3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  local_20 = (CRedirectPromptMicrophonesPermissionItem *)0x0;

+  if (bVar1) {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptMicrophonesPermissionItem,CRedirectPromptMicrophonesPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) {

+LAB_0:

+      pCVar5 = local_20;

+      param_5._0_4_ = 0;

+      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

+                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

+      if (lVar2 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x36f,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+LAB_1:

+      }

+      else {

+        if ((int)param_5 != 0) {

+          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

+          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

+                                    &_GUID_00000000_0000_0000_c000_000000000046);

+          if (iVar3 == 0) {

+            iVar3 = InlineIsEqualGUID();

+            if (iVar3 == 0) {

+              iVar3 = InlineIsEqualGUID();

+              if (iVar3 != 0) {

+                pCVar5 = pCVar5 + 8;

+                goto LAB_2;

+              }

+              lVar2 = -0x7fffbffe;

+            }

+            else {

+LAB_2:

+              lVar2 = 0;

+              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+            }

+            if (lVar2 < 0) {

+              wil::details::in1diag3::Return_Hr

+                        (unaff_retaddr,0x379,

+                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+              goto LAB_1;

+            }

+          }

+          else {

+            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+          }

+          bVar1 = utl::

+                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                               *)(this + 0x28),

+                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

+                              )&local_28);

+          if (!bVar1) {

+            lVar2 = -0x7ff8fff2;

+            wil::details::in1diag3::Return_Hr

+                      (unaff_retaddr,0x37a,

+                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

+            ;

+            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+            goto LAB_3;

+          }

+          g_wasMicrophonesRequested = 1;

+          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+        }

+        lVar2 = 0;

+      }

+      goto LAB_3;

+    }

+    uVar4 = 0x367;

+  }

+  else {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptMicrophonesPermissionItem,CRedirectPromptMicrophonesPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) goto LAB_0;

+    uVar4 = 0x36b;

+  }

+  wil::details::in1diag3::Return_Hr

+            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+             lVar2);

+LAB_3:

+  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

+  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

+            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

+  return lVar2;

+}

+
```

## `RdpWinDesktopRemoteAppUIManager::OnOutputCreated`  (modified)

```diff
--- RdpWinDesktopRemoteAppUIManager::OnOutputCreated
+++ RdpWinDesktopRemoteAppUIManager::OnOutputCreated
@@ -1,2 +1,165 @@
-Failed to decompile mstscax.dll - .ProgramDB RdpWinDesktopRemoteAppUIManager::OnOutputCreated : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

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

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: virtual void __cdecl RdpWinDesktopRemoteAppUIManager::OnOutputCreated(struct

+   RdpXInterfaceOutput * __ptr64) __ptr64 */

+

+void __thiscall

+RdpWinDesktopRemoteAppUIManager::OnOutputCreated

+          (RdpWinDesktopRemoteAppUIManager *this,RdpXInterfaceOutput *param_1)

+

+{

+  bool bVar1;

+  uint uVar2;

+  int iVar3;

+  long lVar4;

+  undefined4 uVar5;

+  _TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_> *p_Var6;

+  longlong *plVar7;

+  undefined8 *puVar8;

+  longlong lVar9;

+  undefined8 *puVar10;

+  wchar_t *pwVar11;

+  wchar_t *pwVar12;

+  undefined1 auStack_198 [32];

+  wchar_t *local_178;

+  long local_170;

+  longlong *local_168;

+  longlong local_160;

+  CTSCriticalSection *local_158 [2];

+  ushort local_148 [128];

+  ulonglong local_48;

+  

+  local_48 = __security_cookie ^ (ulonglong)auStack_198;

+  lVar9 = 0;

+  local_168 = (longlong *)0x0;

+  local_160 = 0;

+  if (param_1 == (RdpXInterfaceOutput *)0x0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x70,

+               &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar2);

+    }

+  }

+  else {

+    local_158[0] = (CTSCriticalSection *)(this + 0x458);

+    CTSCriticalSection::Lock(local_158[0]);

+    iVar3 = (**(code **)(*(longlong *)param_1 + 0x28))(param_1);

+    *(uint *)(this + 0x108) = (uint)(iVar3 == 0xb);

+    if (iVar3 == 0xb) {

+      lVar4 = CreateDeviceResources(this + -8,param_1);

+      if (((lVar4 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+         (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+        uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+        local_178 = L"Failed to CreateDeviceResources";

+        local_170 = lVar4;

+        WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x71,

+                   &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar2);

+      }

+    }

+    else {

+      DiscardDeviceResources(this + -8);

+      AcquireSRWLockExclusive((PSRWLOCK)(this + 0x198));

+      bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::

+              __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>

+                                   *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::GetImpl(void)'

+                                      ::__l2::impl);

+      if (bVar1) {

+        for (p_Var6 = *(_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                        **)(this + 0x188);

+            p_Var6 != (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                       *)(this + 0x178);

+            p_Var6 = (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                      *)utl::

+                        _TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                        ::_Traverse(p_Var6,true)) {

+          RdpWin32RemoteAppPresenter::UpdateD3DDevice

+                    (*(RdpWin32RemoteAppPresenter **)(p_Var6 + 0x20),(ID3D11Device *)0x0);

+        }

+      }

+      else {

+        for (p_Var6 = *(_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                        **)(this + 0x168);

+            p_Var6 != (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                       *)(this + 0x158);

+            p_Var6 = (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                      *)utl::

+                        _TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                        ::_Traverse(p_Var6,true)) {

+          RdpWin32RemoteAppPresenter::UpdateD3DDevice

+                    (*(RdpWin32RemoteAppPresenter **)(p_Var6 + 0x20),(ID3D11Device *)0x0);

+        }

+      }

+      ReleaseSRWLockExclusive((PSRWLOCK)(this + 0x198));

+    }

+    puVar10 = (undefined8 *)0x0;

+    pwVar11 = L"TRUE";

+    if (*(longlong *)(this + 0x450) != 0) {

+      memset(local_148,0,0x100);

+      pwVar12 = L"TRUE";

+      if (*(int *)(this + 0x108) == 0) {

+        pwVar12 = L"FALSE";

+      }

+      StringCbPrintfW(local_148,0x100,

+                      (ushort *)

+                      L"RemoteApp desktop UI manager OnOutputCreated (m_fUsingHardwarePresent=%s)",

+                      pwVar12);

+      (**(code **)(**(longlong **)(this + 0x450) + 0xd8))

+                (*(longlong **)(this + 0x450),local_148,0,0);

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 0x40) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+      iVar3 = *(int *)(this + 0x108);

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      if (iVar3 == 0) {

+        pwVar11 = L"FALSE";

+      }

+      local_178 = pwVar11;

+      WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x72,

+                &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar2);

+    }

+    if (*(longlong *)(this + 0xa0) != 0) {

+      TCntPtr<ITSInstance>::SafeRelease((TCntPtr<ITSInstance> *)&local_160);

+      lVar9 = *(longlong *)(this + 0xa0);

+      local_160 = lVar9;

+      TCntPtr<ITSInstance>::SafeAddRef((TCntPtr<ITSInstance> *)&local_160);

+    }

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)local_158);

+    if ((lVar9 != 0) &&

+       (plVar7 = (longlong *)

+                 (**(code **)(*(longlong *)

+                               ((longlong)*(int *)(*(longlong *)(lVar9 + 8) + 4) + 8 + lVar9) + 0x68

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

+      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_168);

+      local_168 = plVar7;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_168);

+      puVar8 = operator_new(0x10);

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

+        puVar8[1] = 0;

+        puVar10 = puVar8;

+      }

+      *puVar10 = 0;

+      uVar5 = (**(code **)(*(longlong *)param_1 + 0x38))(param_1);

+      *(undefined4 *)(puVar10 + 1) = uVar5;

+      uVar5 = (**(code **)(*(longlong *)param_1 + 0x40))(param_1);

+      *(undefined4 *)((longlong)puVar10 + 0xc) = uVar5;

+      iVar3 = (**(code **)(*plVar7 + 0x88))(plVar7,this + 0x68,puVar10,1);

+      if (iVar3 < 0) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 0x40) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x73,

+                   &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar2);

+        }

+        operator_delete(puVar10);

+      }

+    }

+  }

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_168);

+  TCntPtr<ITSInstance>::SafeRelease((TCntPtr<ITSInstance> *)&local_160);

+  return;

+}

+
```

## `CCO::OnServerRedirectionPacket`  (modified)

```diff
--- CCO::OnServerRedirectionPacket
+++ CCO::OnServerRedirectionPacket
@@ -1,2 +1,1095 @@
-Failed to decompile mstscax.dll - .ProgramDB CCO::OnServerRedirectionPacket : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

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

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

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

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

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

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

+/* public: long __cdecl CCO::OnServerRedirectionPacket(struct RDP_SERVER_REDIRECTION_PACKET

+   __unaligned * __ptr64,unsigned int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CCO::OnServerRedirectionPacket

+          (CCO *this,RDP_SERVER_REDIRECTION_PACKET *param_1,uint param_2,int *param_3)

+

+{

+  ushort uVar1;

+  char cVar2;

+  undefined4 uVar3;

+  int iVar4;

+  uint uVar5;

+  ushort *_Dst;

+  void *pvVar6;

+  undefined1 *_Dst_00;

+  RDP_SERVER_REDIRECTION_PACKET *pRVar7;

+  ulonglong _Size;

+  undefined8 uVar8;

+  uint uVar9;

+  RDP_SERVER_REDIRECTION_PACKET *pRVar10;

+  uint uVar11;

+  ulonglong uVar12;

+  RDP_SERVER_REDIRECTION_PACKET *pRVar13;

+  undefined1 *puVar14;

+  RDP_SERVER_REDIRECTION_PACKET *pRVar15;

+  RDP_SERVER_REDIRECTION_PACKET *pRVar16;

+  RDP_SERVER_REDIRECTION_PACKET *pRVar17;

+  bool bVar18;

+  undefined1 auStackY_1c8 [32];

+  RDP_SERVER_REDIRECTION_PACKET *local_198;

+  RDP_SERVER_REDIRECTION_PACKET *local_190;

+  uint local_188;

+  uint local_178;

+  uint local_168;

+  uint local_164;

+  uint local_160;

+  uint local_15c;

+  RDP_SERVER_REDIRECTION_PACKET *local_158;

+  uint local_150;

+  uint local_14c;

+  uint local_148;

+  uint local_144;

+  uint local_140;

+  uint local_13c;

+  uint local_138;

+  uint local_134;

+  RDP_SERVER_REDIRECTION_PACKET *local_130;

+  RDP_SERVER_REDIRECTION_PACKET *local_128;

+  int local_120;

+  RDP_SERVER_REDIRECTION_PACKET *local_118;

+  RDP_SERVER_REDIRECTION_PACKET *local_110;

+  RDP_SERVER_REDIRECTION_PACKET *local_108;

+  RDP_SERVER_REDIRECTION_PACKET *local_100;

+  RDP_SERVER_REDIRECTION_PACKET *local_f8;

+  RDP_SERVER_REDIRECTION_PACKET *local_f0;

+  RDP_SERVER_REDIRECTION_PACKET *local_e8;

+  int *local_e0;

+  RDP_SERVER_REDIRECTION_PACKET local_d8 [128];

+  ulonglong local_58;

+  

+  local_58 = __security_cookie ^ (ulonglong)auStackY_1c8;

+  local_e0 = param_3;

+  cVar2 = Feature_MSRC108292_IsEnabled();

+  pRVar13 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+  pRVar10 = pRVar13;

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

+    pRVar10 = param_1 + *(ushort *)(param_1 + 2);

+  }

+  pRVar15 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+  local_198 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+  pRVar16 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+  local_190 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+  local_120 = 0;

+  local_144 = 0;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+    RdpX_GetActivityIdPrefix();

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xb0,

+             &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids);

+  }

+  uVar5 = (**(code **)(**(longlong **)(this + 400) + 0x70))();

+  if ((int)uVar5 < 0) {

+    local_198 = pRVar13;

+    if ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) {

+      if (((WPP_GLOBAL_Control[0x1c] & 8) == 0) || ((byte)WPP_GLOBAL_Control[0x19] < 2)) {

+LAB_0:

+        pRVar13 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+        local_198 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+      }

+      else {

+        uVar3 = RdpX_GetActivityIdPrefix();

+        WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xb1,

+                   &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+LAB_1:

+        local_198 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+        pRVar13 = local_198;

+      }

+    }

+    goto LAB_2;

+  }

+  if ((*(longlong **)(this + 0x118) != (longlong *)0x0) &&

+     (iVar4 = (**(code **)(**(longlong **)(this + 0x118) + 0x18))(), iVar4 != 0)) {

+    (**(code **)(**(longlong **)(this + 0x118) + 0x70))();

+  }

+  cVar2 = Feature_MSRC108292_IsEnabled();

+  pRVar7 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

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

+    if (*(ushort *)(param_1 + 2) <= param_2) goto LAB_3;

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (WPP_GLOBAL_Control[0x19] != '\0')) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xb4,

+              &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids);

+    }

+    uVar5 = 0x9f10497a;

+LAB_4:

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar3 = RdpX_GetActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xd8,

+               &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+    }

+    DropLinkImmediate(this,0xd06);

+    local_198 = pRVar15;

+    local_190 = pRVar16;

+LAB_5:

+    pRVar15 = local_198;

+    pRVar16 = local_190;

+    if (local_198 == (RDP_SERVER_REDIRECTION_PACKET *)0x0) goto LAB_6;

+  }

+  else {

+    if ((param_2 < 0xc) || (param_2 < *(ushort *)(param_1 + 2))) {

+      if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+         (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (WPP_GLOBAL_Control[0x19] != '\0')))) {

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xb3,

+                &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids);

+      }

+      uVar5 = 0x9f104971;

+      goto LAB_4;

+    }

+    pRVar10 = param_1 + *(ushort *)(param_1 + 2);

+LAB_3:

+    if ((*(ushort *)param_1 & 0x100) != 0) {

+      cVar2 = Feature_MSRC108292_IsEnabled();

+      if ((cVar2 == '\0') || (0xb < (ulonglong)*(ushort *)(param_1 + 2) + 2)) {

+        uVar1 = *(ushort *)(param_1 + 2);

+        uVar12 = 0x80;

+        if ((ulonglong)uVar1 - 10 < 0x80) {

+          uVar12 = (ulonglong)(uVar1 - 10);

+          uVar9 = uVar1 - 0xb;

+          pRVar7 = pRVar13;

+          if (0x7f < uVar9) goto LAB_7;

+        }

+        else {

+          uVar9 = 0x7f;

+        }

+        cVar2 = Feature_MSRC107417_IsEnabled();

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

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

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"Bad string size, expecting widechar string size here");

+            uVar5 = 0x9f104990;

+            goto LAB_4;

+          }

+          if ((param_1[(ulonglong)uVar9 + 8] != (RDP_SERVER_REDIRECTION_PACKET)0x0) ||

+             (param_1[(ulonglong)((int)uVar12 - 2) + 8] != (RDP_SERVER_REDIRECTION_PACKET)0x0)) {

+            if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+              return -0x7fffbffb;

+            }

+            if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+              return -0x7fffbffb;

+            }

+            if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+              return -0x7fffbffb;

+            }

+            uVar3 = RdpX_GetActivityIdPrefix();

+            uVar8 = 0xb6;

+            goto LAB_8;

+          }

+        }

+        memcpy(local_d8,param_1 + 8,uVar12);

+        CTSConnectionHandler::SetServerRedirectionInfo

+                  (*(CTSConnectionHandler **)(this + 0x120),*(uint *)(param_1 + 4),

+                   (ushort *)local_d8,(uchar *)0x0,0,1);

+        pRVar7 = pRVar13;

+        goto LAB_7;

+      }

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (WPP_GLOBAL_Control[0x19] != '\0')) {

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xb5,

+                &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids);

+      }

+      uVar5 = 0x9f104984;

+      pRVar15 = pRVar13;

+      pRVar16 = pRVar13;

+      goto LAB_4;

+    }

+    uVar9 = 0;

+    if ((*(ushort *)param_1 & 0x200) != 0) {

+      pRVar15 = param_1 + 0xc;

+      uVar11 = *(uint *)(param_1 + 8);

+      pRVar16 = pRVar13;

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

+        iVar4 = CheckReadNBytes((uchar *)pRVar15,(uchar *)pRVar10,4,

+                                (ushort *)L"can not read TARGET_NET_ADDRESSsize");

+        if (iVar4 == 0) {

+          uVar5 = 0x9f1049b1;

+          goto LAB_9;

+        }

+        pRVar16 = (RDP_SERVER_REDIRECTION_PACKET *)(ulonglong)*(uint *)pRVar15;

+        pRVar7 = param_1 + 0x10;

+        iVar4 = CheckReadNBytes((uchar *)pRVar7,(uchar *)pRVar10,(__uint64)pRVar16,

+                                (ushort *)L"can not read TARGET_NET_ADDRESS");

+        if (iVar4 != 0) {

+          pRVar15 = param_1 + 0x10 + (longlong)pRVar16;

+          goto LAB_10;

+        }

+        uVar5 = 0x9f1049b1;

+LAB_11:

+        pRVar15 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+        pRVar16 = pRVar15;

+        goto LAB_4;

+      }

+LAB_10:

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

+        iVar4 = CheckReadNBytes((uchar *)pRVar15,(uchar *)pRVar10,4,

+                                (ushort *)L"can not read LOAD_BALANCE_INFOsize");

+        if (iVar4 == 0) {

+          uVar5 = 0x9f1049b6;

+          goto LAB_9;

+        }

+        uVar9 = *(uint *)pRVar15;

+        pRVar13 = pRVar15 + 4;

+        iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,(ulonglong)uVar9,

+                                (ushort *)L"can not read LOAD_BALANCE_INFO");

+        if (iVar4 == 0) {

+          uVar5 = 0x9f1049b6;

+          goto LAB_11;

+        }

+      }

+      uVar11 = (int)pRVar16 - 1;

+      if (uVar11 < 0x80) {

+        cVar2 = Feature_MSRC107417_IsEnabled();

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

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

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"Bad string size, expecting widechar string size here");

+            uVar5 = 0x9f1049bc;

+            pRVar15 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+            pRVar16 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+            goto LAB_4;

+          }

+          if ((pRVar7[uVar11] != (RDP_SERVER_REDIRECTION_PACKET)0x0) ||

+             (pRVar7[(int)pRVar16 - 2] != (RDP_SERVER_REDIRECTION_PACKET)0x0)) {

+            if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+              return -0x7fffbffb;

+            }

+            if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+              return -0x7fffbffb;

+            }

+            if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+              return -0x7fffbffb;

+            }

+            uVar3 = RdpX_GetActivityIdPrefix();

+            uVar8 = 0xb7;

+LAB_8:

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar8,

+                     &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+            return -0x7fffbffb;

+          }

+        }

+        memcpy(local_d8,pRVar7,(size_t)pRVar16);

+        CTSConnectionHandler::SetServerRedirectionInfo

+                  (*(CTSConnectionHandler **)(this + 0x120),*(uint *)(param_1 + 4),

+                   (ushort *)local_d8,(uchar *)0x0,0,1);

+      }

+      else {

+        local_128 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+        (**(code **)(**(longlong **)(this + 400) + 0x78))

+                  (*(longlong **)(this + 400),"ServerName",&local_128);

+        CTSConnectionHandler::SetServerRedirectionInfo

+                  (*(CTSConnectionHandler **)(this + 0x120),*(uint *)(param_1 + 4),

+                   (ushort *)local_128,(uchar *)pRVar13,uVar9,1);

+      }

+      pRVar7 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+LAB_7:

+      CoreFSM::Disconnect(*(CoreFSM **)(this + 0xf8),0);

+      *local_e0 = 1;

+LAB_12:

+      if ((int)uVar5 < 0) {

+LAB_13:

+        pRVar13 = local_190;

+        if (pRVar7 != (RDP_SERVER_REDIRECTION_PACKET *)0x0) {

+LAB_14:

+          LocalFree(pRVar7);

+          pRVar13 = local_190;

+        }

+LAB_2:

+        pRVar15 = local_198;

+        pRVar16 = pRVar13;

+        local_190 = pRVar13;

+        if ((uVar5 & 0x1f000000) == 0x1f000000) goto LAB_4;

+      }

+      goto LAB_5;

+    }

+    if ((*(ushort *)param_1 & 0x400) == 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar3 = RdpX_GetActivityIdPrefix();

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xd7,

+                 &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+        pRVar7 = pRVar13;

+      }

+      goto LAB_7;

+    }

+    uVar9 = *(uint *)(param_1 + 8);

+    pRVar13 = param_1 + 0xc;

+    local_110 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+    local_128 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+    local_f0 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+    local_108 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+    local_158 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+    local_100 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+    local_f8 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+    local_130 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+    local_e8 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+    local_118 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+    local_168 = 0;

+    local_178 = 0;

+    local_160 = 0;

+    local_150 = 0;

+    local_164 = 0;

+    local_140 = 0;

+    local_13c = 0;

+    local_15c = 0;

+    local_138 = 0;

+    local_14c = 0;

+    local_148 = 0;

+    local_134 = uVar9;

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

+      iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,4,

+                              (ushort *)L"can not read TARGET_NET_ADDRESSsize");

+      if (iVar4 != 0) {

+        local_178 = *(uint *)pRVar13;

+        local_128 = param_1 + 0x10;

+        iVar4 = CheckReadNBytes((uchar *)local_128,(uchar *)pRVar10,(ulonglong)local_178,

+                                (ushort *)L"can not read TARGET_NET_ADDRESS");

+        if (iVar4 != 0) {

+          pRVar13 = param_1 + (ulonglong)local_178 + 0x10;

+          if ((local_178 & 1) == 0) goto LAB_15;

+          TRACE_ABORT_FROM_MACRO_FN

+                    ((ushort *)L"Bad string size, expecting widechar string size here");

+          uVar5 = 0x9f104a01;

+          goto LAB_16;

+        }

+      }

+      uVar5 = 0x9f104a00;

+LAB_16:

+      pRVar15 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+      goto LAB_4;

+    }

+LAB_15:

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

+      iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,4,

+                              (ushort *)L"can not read LOAD_BALANCE_INFOsize");

+      if (iVar4 != 0) {

+        local_168 = *(uint *)pRVar13;

+        local_110 = pRVar13 + 4;

+        iVar4 = CheckReadNBytes((uchar *)local_110,(uchar *)pRVar10,(ulonglong)local_168,

+                                (ushort *)L"can not read LOAD_BALANCE_INFO");

+        if (iVar4 != 0) {

+          pRVar13 = pRVar13 + (ulonglong)local_168 + 4;

+          goto LAB_17;

+        }

+      }

+      uVar5 = 0x9f104a06;

+      goto LAB_16;

+    }

+LAB_17:

+    if ((uVar9 & 4) != 0) {

+      iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,4,

+                              (ushort *)L"can not read LB_USERNAMEsize");

+      if (iVar4 == 0) {

+        uVar5 = 0x9f104a0b;

+        goto LAB_16;

+      }

+      local_160 = *(uint *)pRVar13;

+      local_f0 = pRVar13 + 4;

+      iVar4 = CheckReadNBytes((uchar *)local_f0,(uchar *)pRVar10,(ulonglong)local_160,

+                              (ushort *)L"can not read LB_USERNAME");

+      if (iVar4 == 0) {

+        uVar5 = 0x9f104a0b;

+      }

+      else {

+        pRVar13 = pRVar13 + (ulonglong)local_160 + 4;

+        if ((local_160 & 1) == 0) {

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x1000) != 0)) &&

+             (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpX_GetActivityIdPrefix();

+            WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xb8,

+                      &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+          }

+          goto LAB_18;

+        }

+        TRACE_ABORT_FROM_MACRO_FN((ushort *)L"Bad string size, expecting widechar string size here")

+        ;

+        uVar5 = 0x9f104a0c;

+      }

+LAB_9:

+      pRVar15 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+      pRVar16 = pRVar15;

+      goto LAB_4;

+    }

+LAB_18:

+    if ((uVar9 & 8) != 0) {

+      iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,4,

+                              (ushort *)L"can not read LB_DOMAINsize");

+      if (iVar4 != 0) {

+        local_150 = *(uint *)pRVar13;

+        local_108 = pRVar13 + 4;

+        iVar4 = CheckReadNBytes((uchar *)local_108,(uchar *)pRVar10,(ulonglong)local_150,

+                                (ushort *)L"can not read LB_DOMAIN");

+        if (iVar4 != 0) {

+          pRVar13 = pRVar13 + (ulonglong)local_150 + 4;

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

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"Bad string size, expecting widechar string size here");

+            uVar5 = 0x9f104a14;

+            goto LAB_9;

+          }

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x1000) != 0)) &&

+             (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpX_GetActivityIdPrefix();

+            WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xb9,

+                      &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+          }

+          goto LAB_19;

+        }

+      }

+      uVar5 = 0x9f104a13;

+      goto LAB_9;

+    }

+LAB_19:

+    if ((uVar9 & 0x10) != 0) {

+      iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,4,

+                              (ushort *)L"can not read LB_PASSWORDsize");

+      if (iVar4 != 0) {

+        local_164 = *(uint *)pRVar13;

+        local_158 = pRVar13 + 4;

+        iVar4 = CheckReadNBytes((uchar *)local_158,(uchar *)pRVar10,(ulonglong)local_164,

+                                (ushort *)L"can not read LB_PASSWORD");

+        if (iVar4 != 0) {

+          pRVar13 = pRVar13 + (ulonglong)local_164 + 4;

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

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"Bad string size, expecting widechar string size here");

+            uVar5 = 0x9f104a1c;

+            goto LAB_9;

+          }

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x1000) != 0)) &&

+             (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpX_GetActivityIdPrefix();

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xba,

+                     &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+          }

+          goto LAB_20;

+        }

+      }

+      uVar5 = 0x9f104a1b;

+      goto LAB_9;

+    }

+LAB_20:

+    if ((uVar9 >> 8 & 1) != 0) {

+      iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,4,

+                              (ushort *)L"can not read TARGET_FQDNsize");

+      if (iVar4 != 0) {

+        local_140 = *(uint *)pRVar13;

+        local_100 = pRVar13 + 4;

+        uVar12 = (ulonglong)local_140;

+        iVar4 = CheckReadNBytes((uchar *)local_100,(uchar *)pRVar10,(ulonglong)local_140,

+                                (ushort *)L"can not read TARGET_FQDN");

+        if (iVar4 != 0) {

+          pRVar13 = pRVar13 + uVar12 + 4;

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

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"Bad string size, expecting widechar string size here");

+            uVar5 = 0x9f104a24;

+            goto LAB_9;

+          }

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x1000) != 0)) &&

+             (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpX_GetActivityIdPrefix();

+            WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xbb,

+                      &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+          }

+          goto LAB_21;

+        }

+      }

+      uVar5 = 0x9f104a23;

+      goto LAB_9;

+    }

+LAB_21:

+    if ((uVar9 >> 9 & 1) != 0) {

+      iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,4,

+                              (ushort *)L"can not read TARGET_NETBIOS_NAMEsize");

+      if (iVar4 != 0) {

+        local_13c = *(uint *)pRVar13;

+        local_f8 = pRVar13 + 4;

+        uVar12 = (ulonglong)local_13c;

+        iVar4 = CheckReadNBytes((uchar *)local_f8,(uchar *)pRVar10,(ulonglong)local_13c,

+                                (ushort *)L"can not read TARGET_NETBIOS_NAME");

+        if (iVar4 != 0) {

+          pRVar13 = pRVar13 + uVar12 + 4;

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

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"Bad string size, expecting widechar string size here");

+            uVar5 = 0x9f104a2c;

+            goto LAB_9;

+          }

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x1000) != 0)) &&

+             (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpX_GetActivityIdPrefix();

+            WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xbc,

+                      &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+          }

+          goto LAB_22;

+        }

+      }

+      uVar5 = 0x9f104a2b;

+      goto LAB_9;

+    }

+LAB_22:

+    if ((uVar9 >> 0xc & 1) != 0) {

+      iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,4,

+                              (ushort *)L"can not read LB_CLIENT_TSV_URLsize");

+      if (iVar4 != 0) {

+        uVar5 = *(uint *)pRVar13;

+        local_130 = pRVar13 + 4;

+        iVar4 = CheckReadNBytes((uchar *)local_130,(uchar *)pRVar10,(ulonglong)uVar5,

+                                (ushort *)L"can not read LB_CLIENT_TSV_URL");

+        if (iVar4 != 0) {

+          pRVar13 = pRVar13 + (ulonglong)uVar5 + 4;

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

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"Bad string size, expecting widechar string size here");

+            uVar5 = 0x9f104a3c;

+            goto LAB_9;

+          }

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x1000) != 0)) &&

+             (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpX_GetActivityIdPrefix();

+            WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xbd,

+                      &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+          }

+          goto LAB_23;

+        }

+      }

+      uVar5 = 0x9f104a3b;

+      goto LAB_9;

+    }

+    uVar5 = 0;

+LAB_23:

+    uVar5 = internalVerifyLBInfo(this,uVar9 >> 0xd & 1,(uchar *)local_130,uVar5);

+    if ((int)uVar5 < 0) {

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

+          ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+      goto LAB_0;

+      uVar3 = RdpX_GetActivityIdPrefix();

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xbe,

+                 &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+      goto LAB_1;

+    }

+    if ((uVar9 >> 0xf & 1) != 0) {

+      iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,4,

+                              (ushort *)L"can not read LB_REDIRECTION_GUIDsize");

+      if (iVar4 == 0) {

+        uVar5 = 0x9f104a48;

+      }

+      else {

+        local_14c = *(uint *)pRVar13;

+        local_e8 = pRVar13 + 4;

+        iVar4 = CheckReadNBytes((uchar *)local_e8,(uchar *)pRVar10,(ulonglong)local_14c,

+                                (ushort *)L"can not read LB_REDIRECTION_GUID");

+        if (iVar4 == 0) {

+          uVar5 = 0x9f104a48;

+          goto LAB_11;

+        }

+        pRVar13 = pRVar13 + (ulonglong)local_14c + 4;

+        if ((local_14c & 1) == 0) goto LAB_24;

+        TRACE_ABORT_FROM_MACRO_FN((ushort *)L"Bad string size, expecting widechar string size here")

+        ;

+        uVar5 = 0x9f104a49;

+      }

+      goto LAB_9;

+    }

+LAB_24:

+    if ((uVar9 >> 0x10 & 1) != 0) {

+      iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,4,

+                              (ushort *)L"can not read LB_TARGET_CERTIFICATEsize");

+      if (iVar4 == 0) {

+        uVar5 = 0x9f104a4f;

+      }

+      else {

+        local_148 = *(uint *)pRVar13;

+        local_118 = pRVar13 + 4;

+        iVar4 = CheckReadNBytes((uchar *)local_118,(uchar *)pRVar10,(ulonglong)local_148,

+                                (ushort *)L"can not read LB_TARGET_CERTIFICATE");

+        if (iVar4 == 0) {

+          uVar5 = 0x9f104a4f;

+          goto LAB_11;

+        }

+        pRVar13 = pRVar13 + (ulonglong)local_148 + 4;

+        if ((local_148 & 1) == 0) goto LAB_25;

+        TRACE_ABORT_FROM_MACRO_FN((ushort *)L"Bad string size, expecting widechar string size here")

+        ;

+        uVar5 = 0x9f104a50;

+      }

+      goto LAB_9;

+    }

+LAB_25:

+    if ((uVar9 >> 0xb & 1) == 0) {

+LAB_26:

+      local_134 = uVar9 & 0x80;

+      bVar18 = local_134 == 0;

+      pRVar13 = local_190;

+      if ((local_160 == 0) ||

+         (_Dst = (ushort *)PAL_System_MemAlloc((ulonglong)local_160 + 2,1), _Dst == (ushort *)0x0))

+      {

+LAB_27:

+        if ((local_150 != 0) &&

+           (pvVar6 = (void *)PAL_System_MemAlloc((ulonglong)local_150 + 2,1), pvVar6 != (void *)0x0)

+           ) {

+          memcpy(pvVar6,local_108,(ulonglong)local_150);

+          uVar5 = (**(code **)(**(longlong **)(this + 400) + 0x38))

+                            (*(longlong **)(this + 400),"Domain");

+          LocalFree(pvVar6);

+          if ((int)uVar5 < 0) {

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

+                ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+            goto LAB_2;

+            uVar3 = RdpX_GetActivityIdPrefix();

+            uVar8 = 200;

+            goto LAB_28;

+          }

+        }

+        if (local_164 != 0) {

+          uVar12 = (ulonglong)local_164 + 2;

+          _Size = (ulonglong)local_164;

+          if ((uVar9 >> 0xe & 1) != 0) {

+            if ((uVar12 < 0x801) &&

+               (pvVar6 = (void *)PAL_System_MemAlloc(uVar12,1), pvVar6 != (void *)0x0)) {

+              memcpy(pvVar6,local_158,_Size);

+              uVar5 = (**(code **)(**(longlong **)(this + 400) + 0x38))

+                                (*(longlong **)(this + 400),"PKEncryptedPassword",pvVar6);

+              LocalFree(pvVar6);

+              if ((int)uVar5 < 0) {

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

+                    ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+                goto LAB_2;

+                uVar3 = RdpX_GetActivityIdPrefix();

+                uVar8 = 0xc9;

+                goto LAB_28;

+              }

+            }

+            goto LAB_29;

+          }

+          if ((0x800 < uVar12) ||

+             (_Dst_00 = (undefined1 *)PAL_System_MemAlloc(uVar12,1), _Dst_00 == (undefined1 *)0x0))

+          goto LAB_30;

+          memcpy(_Dst_00,local_158,_Size);

+          uVar5 = (**(code **)(**(longlong **)(this + 400) + 0x40))

+                            (*(longlong **)(this + 400),"Password");

+          for (; _Size != 0; _Size = _Size - 1) {

+            *local_158 = (RDP_SERVER_REDIRECTION_PACKET)0x0;

+            local_158 = local_158 + 1;

+          }

+          puVar14 = _Dst_00;

+          for (uVar12 = (ulonglong)(local_164 + 2); uVar12 != 0; uVar12 = uVar12 - 1) {

+            *puVar14 = 0;

+            puVar14 = puVar14 + 1;

+          }

+          LocalFree(_Dst_00);

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

+            local_120 = 1;

+            if (local_160 == 0) goto LAB_30;

+            (**(code **)(**(longlong **)(this + 400) + 0x20))

+                      (*(longlong **)(this + 400),"AutoLogon",1);

+            goto LAB_31;

+          }

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpX_GetActivityIdPrefix();

+            uVar8 = 0xca;

+            goto LAB_28;

+          }

+          goto LAB_2;

+        }

+LAB_30:

+        if (local_120 == 0) {

+LAB_29:

+          uVar5 = (**(code **)(**(longlong **)(this + 400) + 0x70))

+                            (*(longlong **)(this + 400),"PasswordContainsSCardPin",&local_144);

+          if ((int)uVar5 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar3 = RdpX_GetActivityIdPrefix();

+              uVar8 = 0xcc;

+              goto LAB_28;

+            }

+            goto LAB_2;

+          }

+        }

+        else {

+LAB_31:

+          local_144 = uVar9 >> 6 & 1;

+          uVar5 = (**(code **)(**(longlong **)(this + 400) + 0x20))

+                            (*(longlong **)(this + 400),"PasswordContainsSCardPin",local_144);

+          if ((int)uVar5 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar3 = RdpX_GetActivityIdPrefix();

+              uVar8 = 0xcb;

+              goto LAB_28;

+            }

+            goto LAB_2;

+          }

+        }

+        pRVar10 = local_e8;

+        if (((local_e8 != (RDP_SERVER_REDIRECTION_PACKET *)0x0) && (local_14c != 0)) &&

+           (pvVar6 = (void *)PAL_System_MemAlloc((ulonglong)local_14c + 2,1), pvVar6 != (void *)0x0)

+           ) {

+          memcpy(pvVar6,pRVar10,(ulonglong)local_14c);

+          uVar5 = (**(code **)(**(longlong **)(this + 400) + 0x38))

+                            (*(longlong **)(this + 400),"RedirectionGuid",pvVar6);

+          LocalFree(pvVar6);

+          if ((int)uVar5 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar3 = RdpX_GetActivityIdPrefix();

+              uVar8 = 0xcd;

+              goto LAB_28;

+            }

+            goto LAB_2;

+          }

+        }

+        pRVar10 = local_118;

+        if (((local_118 != (RDP_SERVER_REDIRECTION_PACKET *)0x0) && (local_148 != 0)) &&

+           (pvVar6 = (void *)PAL_System_MemAlloc((ulonglong)local_148 + 2,1), pvVar6 != (void *)0x0)

+           ) {

+          memcpy(pvVar6,pRVar10,(ulonglong)local_148);

+          uVar5 = (**(code **)(**(longlong **)(this + 400) + 0x38))

+                            (*(longlong **)(this + 400),"TargetCertificate",pvVar6);

+          LocalFree(pvVar6);

+          if ((int)uVar5 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar3 = RdpX_GetActivityIdPrefix();

+              uVar8 = 0xce;

+              goto LAB_28;

+            }

+            goto LAB_2;

+          }

+        }

+        uVar5 = (**(code **)(**(longlong **)(this + 400) + 0x20))

+                          (*(longlong **)(this + 400),"RedirectionUseSCardLogon");

+        uVar9 = local_140;

+        if ((int)uVar5 < 0) {

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpX_GetActivityIdPrefix();

+            uVar8 = 0xcf;

+            goto LAB_28;

+          }

+          goto LAB_2;

+        }

+        if ((local_140 != 0) &&

+           (pvVar6 = (void *)PAL_System_MemAlloc((ulonglong)local_140 + 2,1), pvVar6 != (void *)0x0)

+           ) {

+          memcpy(pvVar6,local_100,(ulonglong)uVar9);

+          if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+             (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (3 < (byte)WPP_GLOBAL_Control[0x19])))) {

+            RdpX_GetActivityIdPrefix();

+            WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xd0,

+                      &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids);

+          }

+          uVar5 = (**(code **)(**(longlong **)(this + 400) + 0x38))

+                            (*(longlong **)(this + 400),"ServerFqdn");

+          LocalFree(pvVar6);

+          if ((int)uVar5 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar3 = RdpX_GetActivityIdPrefix();

+              uVar8 = 0xd1;

+              goto LAB_28;

+            }

+            goto LAB_2;

+          }

+        }

+        uVar9 = local_13c;

+        if ((local_13c != 0) &&

+           (pvVar6 = (void *)PAL_System_MemAlloc((ulonglong)local_13c + 2,1), pvVar6 != (void *)0x0)

+           ) {

+          memcpy(pvVar6,local_f8,(ulonglong)uVar9);

+          if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+             (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (3 < (byte)WPP_GLOBAL_Control[0x19])))) {

+            RdpX_GetActivityIdPrefix();

+            WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xd2,

+                      &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids);

+          }

+          uVar5 = (**(code **)(**(longlong **)(this + 400) + 0x38))

+                            (*(longlong **)(this + 400),"ServerNetBiosName");

+          LocalFree(pvVar6);

+          if ((int)uVar5 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar3 = RdpX_GetActivityIdPrefix();

+              uVar8 = 0xd3;

+              goto LAB_28;

+            }

+            goto LAB_2;

+          }

+        }

+        uVar9 = 0;

+        if ((local_198 == (RDP_SERVER_REDIRECTION_PACKET *)0x0) ||

+           (uVar12 = (ulonglong)local_15c, local_15c == 0)) {

+          pRVar7 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+LAB_32:

+          if (0x7f < local_178 - 1) {

+            local_118 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+            (**(code **)(**(longlong **)(this + 400) + 0x78))

+                      (*(longlong **)(this + 400),"ServerName",&local_118);

+            pRVar13 = local_118;

+            pRVar10 = local_110;

+LAB_33:

+            CTSConnectionHandler::SetServerRedirectionInfo

+                      (*(CTSConnectionHandler **)(this + 0x120),*(uint *)(param_1 + 4),

+                       (ushort *)pRVar13,(uchar *)pRVar10,local_168,(uint)bVar18);

+            if (local_134 == 0) goto LAB_7;

+            goto LAB_12;

+          }

+          cVar2 = Feature_MSRC107417_IsEnabled();

+          if ((cVar2 == '\0') ||

+             ((local_128[local_178 - 1] == (RDP_SERVER_REDIRECTION_PACKET)0x0 &&

+              (local_128[local_178 - 2] == (RDP_SERVER_REDIRECTION_PACKET)0x0)))) {

+            memcpy(local_d8,local_128,(ulonglong)local_178);

+            local_168 = 0;

+            pRVar13 = local_d8;

+            pRVar10 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+            goto LAB_33;

+          }

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpX_GetActivityIdPrefix();

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xd6,

+                     &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+          }

+          uVar5 = 0x80004005;

+          goto LAB_13;

+        }

+        pRVar7 = (RDP_SERVER_REDIRECTION_PACKET *)PAL_System_MemAlloc(local_138,1);

+        if (pRVar7 == (RDP_SERVER_REDIRECTION_PACKET *)0x0) {

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpX_GetActivityIdPrefix();

+            uVar8 = 0xd4;

+            goto LAB_34;

+          }

+          goto LAB_35;

+        }

+        pRVar10 = local_198;

+        pRVar15 = pRVar7;

+        if (local_15c != 0) {

+          do {

+            uVar9 = *(uint *)pRVar13;

+            memcpy(pRVar15,*(void **)pRVar10,(ulonglong)uVar9);

+            uVar5 = *(uint *)pRVar13;

+            uVar12 = uVar12 - 1;

+            pRVar13 = pRVar13 + 4;

+            pRVar10 = pRVar10 + 8;

+            pRVar15 = pRVar15 + uVar5;

+          } while (uVar12 != 0);

+        }

+        uVar5 = CTSConnectionHandler::SetServerAddressesToConnect

+                          (*(CTSConnectionHandler **)(this + 0x120),(ushort *)pRVar7,uVar9,local_15c

+                          );

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

+          cVar2 = Feature_MSRC107417_IsEnabled();

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

+            pRVar7 = (RDP_SERVER_REDIRECTION_PACKET *)0x0;

+          }

+          goto LAB_32;

+        }

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar3 = RdpX_GetActivityIdPrefix();

+          WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xd5,

+                     &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+        }

+        goto LAB_14;

+      }

+      memcpy(_Dst,local_f0,(ulonglong)local_160);

+      if ((uVar9 & 0x20) == 0) {

+        uVar5 = (**(code **)(**(longlong **)(this + 400) + 0x38))

+                          (*(longlong **)(this + 400),"UserName");

+      }

+      else {

+        CTSConnectionHandler::SetRedirectionUserName(*(CTSConnectionHandler **)(this + 0x120),_Dst);

+      }

+      LocalFree(_Dst);

+      if (-1 < (int)uVar5) goto LAB_27;

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

+          ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+      goto LAB_2;

+      uVar3 = RdpX_GetActivityIdPrefix();

+      uVar8 = 199;

+LAB_28:

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar8,

+                 &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+      goto LAB_2;

+    }

+    iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,4,

+                            (ushort *)L"TARGET_NET_ADDRESSES - wrong size");

+    if (iVar4 == 0) {

+      uVar5 = 0x9f104a63;

+      goto LAB_9;

+    }

+    iVar4 = CheckReadNBytes((uchar *)(pRVar13 + 4),(uchar *)pRVar10,(ulonglong)*(uint *)pRVar13,

+                            (ushort *)L"TARGET_NET_ADDRESSES - wrong total bytes size");

+    if (iVar4 == 0) {

+      uVar5 = 0x9f104a6d;

+      goto LAB_9;

+    }

+    iVar4 = CheckReadNBytes((uchar *)(pRVar13 + 4),(uchar *)pRVar10,4,

+                            (ushort *)

+                            L"TARGET_NET_ADDRESSES - wrong size while getting number of addresses");

+    if (iVar4 == 0) {

+      uVar5 = 0x9f104a73;

+      goto LAB_9;

+    }

+    local_15c = *(uint *)(pRVar13 + 4);

+    pRVar13 = pRVar13 + 8;

+    if (0x19 < local_15c) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return -0x7fffbffb;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+        return -0x7fffbffb;

+      }

+      if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+        return -0x7fffbffb;

+      }

+      uVar3 = RdpX_GetActivityIdPrefix();

+      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xbf,

+                &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+      return -0x7fffbffb;

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x1000) != 0)) &&

+       (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+      RdpX_GetActivityIdPrefix();

+      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xc0);

+    }

+    pRVar15 = (RDP_SERVER_REDIRECTION_PACKET *)PAL_System_MemAlloc((ulonglong)local_15c * 8,1);

+    if (pRVar15 == (RDP_SERVER_REDIRECTION_PACKET *)0x0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar3 = RdpX_GetActivityIdPrefix();

+        WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xc1,

+                  &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+      }

+      return -0x7ff8fff2;

+    }

+    pRVar16 = (RDP_SERVER_REDIRECTION_PACKET *)PAL_System_MemAlloc((ulonglong)local_15c * 4,1);

+    local_198 = pRVar15;

+    local_190 = pRVar16;

+    if (pRVar16 != (RDP_SERVER_REDIRECTION_PACKET *)0x0) {

+      local_188 = 0;

+      pRVar7 = pRVar15;

+      pRVar17 = pRVar16;

+      if (local_15c != 0) {

+        do {

+          local_130 = pRVar7;

+          iVar4 = CheckReadNBytes((uchar *)pRVar13,(uchar *)pRVar10,4,

+                                  (ushort *)

+                                  L"can not read TARGET_NET_ADDRESS_IPV6V4_LIST Addressessize");

+          if (iVar4 == 0) {

+LAB_36:

+            uVar5 = 0x9f104a93;

+            goto LAB_4;

+          }

+          *(uint *)pRVar17 = *(uint *)pRVar13;

+          *(RDP_SERVER_REDIRECTION_PACKET **)pRVar7 = pRVar13 + 4;

+          iVar4 = CheckReadNBytes((uchar *)(pRVar13 + 4),(uchar *)pRVar10,

+                                  (ulonglong)*(uint *)pRVar17,

+                                  (ushort *)L"can not read TARGET_NET_ADDRESS_IPV6V4_LIST Addresses"

+                                 );

+          if (iVar4 == 0) goto LAB_36;

+          pRVar13 = pRVar13 + (ulonglong)*(uint *)pRVar17 + 4;

+          cVar2 = Feature_MSRC107417_IsEnabled();

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

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

+              TRACE_ABORT_FROM_MACRO_FN

+                        ((ushort *)L"Bad string size, expecting widechar string size here");

+              uVar5 = 0x9f104a97;

+              goto LAB_4;

+            }

+            if (*(uint *)pRVar17 < 2) {

+              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                  ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                uVar3 = RdpX_GetActivityIdPrefix();

+                WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xc3,

+                         &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+              }

+              uVar5 = 0x9f104a9c;

+              goto LAB_4;

+            }

+          }

+          if ((*(char *)((ulonglong)(*(uint *)pRVar17 - 1) + *(longlong *)pRVar7) != '\0') ||

+             (*(char *)((ulonglong)(*(uint *)pRVar17 - 2) + *(longlong *)pRVar7) != '\0')) {

+            if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+               (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+              uVar3 = RdpX_GetActivityIdPrefix();

+              uVar8 = 0xc4;

+LAB_37:

+              WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar8,

+                       &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+            }

+LAB_38:

+            uVar5 = 0x80004005;

+            goto LAB_39;

+          }

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x1000) != 0)) &&

+             (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpX_GetActivityIdPrefix();

+            WPP_SF_DdS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xc5,

+                       &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+          }

+          uVar11 = *(uint *)pRVar17 + local_138;

+          if ((uVar11 < local_138) || (uVar11 < *(uint *)pRVar17)) {

+            if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+               (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+              uVar3 = RdpX_GetActivityIdPrefix();

+              uVar8 = 0xc6;

+              goto LAB_37;

+            }

+            goto LAB_38;

+          }

+          local_188 = local_188 + 1;

+          local_130 = local_130 + 8;

+          pRVar7 = local_130;

+          pRVar17 = pRVar17 + 4;

+          uVar9 = local_134;

+          local_138 = uVar11;

+        } while (local_188 < local_15c);

+      }

+      goto LAB_26;

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar3 = RdpX_GetActivityIdPrefix();

+      uVar8 = 0xc2;

+LAB_34:

+      WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar8,

+                &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar3);

+    }

+LAB_35:

+    uVar5 = 0x8007000e;

+    pRVar15 = local_198;

+    pRVar16 = local_190;

+  }

+LAB_39:

+  LocalFree(pRVar15);

+LAB_6:

+  if (pRVar16 != (RDP_SERVER_REDIRECTION_PACKET *)0x0) {

+    LocalFree(pRVar16);

+  }

+  return uVar5;

+}

+
```

## `W32DrPRN::RenamePrinterCacheInfo`  (modified)

```diff
--- W32DrPRN::RenamePrinterCacheInfo
+++ W32DrPRN::RenamePrinterCacheInfo
@@ -1,2 +1,282 @@
-Failed to decompile mstscax.dll - .ProgramDB W32DrPRN::RenamePrinterCacheInfo : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: static unsigned long __cdecl W32DrPRN::RenamePrinterCacheInfo(struct

+   tagRDPDR_PRINTER_RENAME_CACHEDATA * __ptr64,unsigned int) */

+

+ulong __cdecl

+W32DrPRN::RenamePrinterCacheInfo(tagRDPDR_PRINTER_RENAME_CACHEDATA *param_1,uint param_2)

+

+{

+  tagRDPDR_PRINTER_RENAME_CACHEDATA *ptVar1;

+  tagRDPDR_PRINTER_RENAME_CACHEDATA *ptVar2;

+  bool bVar3;

+  uint uVar4;

+  uint uVar5;

+  int iVar6;

+  ulong uVar7;

+  undefined4 uVar8;

+  ulonglong uVar9;

+  LPBYTE lpData;

+  LPBYTE pBVar10;

+  LPBYTE pBVar11;

+  DWORD local_res10 [2];

+  DWORD local_res18 [2];

+  int local_res20;

+  DWORD DVar12;

+  LPBYTE local_88;

+  int local_80;

+  DWORD local_7c;

+  HKEY local_78;

+  HKEY local_70;

+  tagRDPDR_PRINTER_RENAME_CACHEDATA *local_68;

+  wchar_t *local_60;

+  HKEY local_58;

+  ulonglong local_50;

+  tagRDPDR_PRINTER_RENAME_CACHEDATA *local_48;

+  

+  pBVar11 = (LPBYTE)0x0;

+  local_50 = 0x2000;

+  local_78 = (HKEY)0x0;

+  lpData = (LPBYTE)0x0;

+  local_70 = (HKEY)0x0;

+  local_58 = (HKEY)0x0;

+  local_7c = 0;

+  local_res18[0] = 0;

+  local_res10[0] = 0;

+  local_80 = 0;

+  local_res20 = 0;

+  local_60 = L"PrinterCacheData";

+  if (param_2 < 8) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return 0xd;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return 0xd;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return 0xd;

+    }

+    uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar8 = 0x1e;

+LAB_0:

+    uVar7 = 0xd;

+    lpData = pBVar11;

+    DVar12 = 0xd;

+  }

+  else {

+    uVar4 = *(uint *)param_1;

+    if (0x7fe < uVar4 - 2) {

+      uVar7 = 0x57;

+      pBVar10 = lpData;

+      goto LAB_1;

+    }

+    if (0x7fe < *(int *)(param_1 + 4) - 2U) {

+      return 0x57;

+    }

+    uVar5 = uVar4 + 8 + *(int *)(param_1 + 4);

+    if ((param_2 < uVar5) || (_maxCacheDataSize < uVar5)) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return 0xd;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+        return 0xd;

+      }

+      if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+        return 0xd;

+      }

+      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar8 = 0x1f;

+      goto LAB_0;

+    }

+    ptVar1 = param_1 + 8;

+    ptVar2 = ptVar1 + uVar4;

+    *(undefined2 *)(param_1 + ((ulonglong)uVar4 & 0xfffffffffffffffe) + 6) = 0;

+    *(undefined2 *)(ptVar2 + (ulonglong)(*(uint *)(param_1 + 4) >> 1) * 2 + -2) = 0;

+    local_68 = ptVar2;

+    local_48 = ptVar1;

+    if ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) {

+      if (((WPP_GLOBAL_Control[0x1c] & 1) != 0) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x20,

+                  &WPP_cb0558ffa05b37481ed09b2e2605ae8a_Traceguids,uVar4,ptVar1);

+      }

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x21,

+                  &WPP_cb0558ffa05b37481ed09b2e2605ae8a_Traceguids,uVar4,ptVar2);

+      }

+    }

+    iVar6 = _wcsicmp((wchar_t *)ptVar1,(wchar_t *)ptVar2);

+    uVar7 = 0;

+    pBVar10 = pBVar11;

+    if (iVar6 == 0) goto LAB_1;

+    uVar7 = RegCreateKeyExW((HKEY)0xffffffff80000001,

+                            L"Software\\Microsoft\\Terminal Server Client\\Default\\AddIns\\RDPDR",0

+                            ,(LPWSTR)0x0,0,0xf003f,(LPSECURITY_ATTRIBUTES)0x0,&local_78,&local_7c);

+    if (uVar7 == 0) {

+      uVar7 = RegOpenKeyExW(local_78,(LPCWSTR)ptVar1,0,0xf003f,&local_70);

+      if (uVar7 == 0) {

+        uVar9 = 0x2000;

+        lpData = operator_new(0x2000);

+        while (pBVar10 = lpData, local_88 = lpData, lpData != (LPBYTE)0x0) {

+          local_res10[0] = (DWORD)uVar9;

+          uVar7 = RegQueryValueExW(local_70,local_60,(LPDWORD)0x0,local_res18,lpData,local_res10);

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+            WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x24,

+                      &WPP_cb0558ffa05b37481ed09b2e2605ae8a_Traceguids,uVar4,uVar7);

+          }

+          DVar12 = local_res18[0];

+          if (uVar7 == 0) {

+            if (local_res18[0] != 3) {

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

+                  ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+              goto LAB_1;

+              uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+              uVar8 = 0x26;

+              goto LAB_2;

+            }

+            bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>::

+                    __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_1252772153> *)

+                                        &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1252772153>::GetImpl(void)'

+                                         ::__l2::impl);

+            ptVar1 = local_68;

+            if (bVar3) {

+              if ((local_res20 == 0) &&

+                 (uVar7 = DrPRN::UpdatePrinterNameInCacheData

+                                    (&local_88,local_res10,(uchar *)local_68,*(ulong *)(param_1 + 4)

+                                    ), lpData = local_88, uVar7 != 0)) {

+                pBVar10 = local_88;

+                if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                   (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19]))))

+                {

+                  uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                  WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x27,

+                            &WPP_cb0558ffa05b37481ed09b2e2605ae8a_Traceguids,uVar4,uVar7);

+                  pBVar10 = local_88;

+                }

+                goto LAB_1;

+              }

+            }

+            else {

+              DrPRN::UpdatePrinterNameInCacheData

+                        (&local_88,local_res10,(uchar *)local_68,*(ulong *)(param_1 + 4));

+              lpData = local_88;

+            }

+            uVar7 = RegCreateKeyExW(local_78,(LPCWSTR)ptVar1,0,(LPWSTR)0x0,0,0xf003f,

+                                    (LPSECURITY_ATTRIBUTES)0x0,&local_58,&local_7c);

+            pBVar10 = lpData;

+            if (uVar7 != 0) {

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

+                  ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+              goto LAB_1;

+              uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+              uVar8 = 0x28;

+              DVar12 = uVar7;

+              goto LAB_2;

+            }

+            uVar7 = RegSetValueExW(local_58,local_60,0,local_res18[0],lpData,local_res10[0]);

+            ptVar2 = local_48;

+            if (uVar7 == 0) {

+              if (local_res20 != 0) {

+                RenamePrinter((ushort *)local_48,(ushort *)ptVar1);

+              }

+              uVar7 = RegCloseKey(local_70);

+              if (uVar7 == 0) {

+                local_70 = (HKEY)0x0;

+                uVar7 = RegDeleteKeyW(local_78,(LPCWSTR)ptVar2);

+                if (((uVar7 == 0) || ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control)) ||

+                   (((WPP_GLOBAL_Control[0x1c] & 1) == 0 || ((byte)WPP_GLOBAL_Control[0x19] < 2))))

+                goto LAB_1;

+                uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                uVar8 = 0x2b;

+                DVar12 = uVar7;

+              }

+              else {

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

+                    ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+                goto LAB_1;

+                uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                uVar8 = 0x2a;

+                DVar12 = uVar7;

+              }

+            }

+            else {

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

+                  ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+              goto LAB_1;

+              uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+              uVar8 = 0x29;

+              DVar12 = uVar7;

+            }

+            goto LAB_2;

+          }

+          if (uVar7 == 0xea) {

+            if (local_80 != 0) {

+LAB_3:

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

+                  ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+              goto LAB_1;

+              uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+              uVar8 = 0x25;

+              DVar12 = uVar7;

+              goto LAB_2;

+            }

+            uVar9 = (ulonglong)(((local_res10[0] >> 0xd) + 1) * 0x2000);

+            local_50 = uVar9;

+            operator_delete(lpData);

+            local_80 = 1;

+          }

+          else {

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

+            pBVar11 = &DAT_4;

+            local_res20 = 1;

+            local_60 = L"AutoPrinterCacheData";

+            operator_delete(lpData);

+            uVar9 = local_50;

+          }

+          lpData = operator_new(uVar9 & 0xffffffff);

+        }

+        uVar7 = 8;

+        goto LAB_1;

+      }

+      pBVar10 = lpData;

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

+          ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+      goto LAB_1;

+      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar8 = 0x23;

+      DVar12 = uVar7;

+    }

+    else {

+      pBVar10 = lpData;

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

+          ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+      goto LAB_1;

+      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar8 = 0x22;

+      lpData = pBVar11;

+      DVar12 = uVar7;

+    }

+  }

+LAB_2:

+  WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar8,

+            &WPP_cb0558ffa05b37481ed09b2e2605ae8a_Traceguids,uVar4,DVar12);

+  pBVar10 = lpData;

+LAB_1:

+  if (local_78 != (HKEY)0x0) {

+    RegCloseKey(local_78);

+  }

+  if (local_70 != (HKEY)0x0) {

+    RegCloseKey(local_70);

+  }

+  if (local_58 != (HKEY)0x0) {

+    RegCloseKey(local_58);

+  }

+  if (pBVar10 != (LPBYTE)0x0) {

+    operator_delete(pBVar10);

+  }

+  return uVar7;

+}

+
```

## `W32SCard::FlushIRPWorkerThreadFunc`  (modified)

```diff
--- W32SCard::FlushIRPWorkerThreadFunc
+++ W32SCard::FlushIRPWorkerThreadFunc
@@ -1,2 +1,166 @@
-Failed to decompile mstscax.dll - .ProgramDB W32SCard::FlushIRPWorkerThreadFunc : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* protected: void __cdecl W32SCard::FlushIRPWorkerThreadFunc(void) __ptr64 */

+

+void __thiscall W32SCard::FlushIRPWorkerThreadFunc(W32SCard *this)

+

+{

+  LPCRITICAL_SECTION lpCriticalSection;

+  undefined4 uVar1;

+  longlong lVar2;

+  HANDLE hSourceHandle;

+  undefined1 auVar3 [16];

+  bool bVar4;

+  BOOL BVar5;

+  DWORD DVar6;

+  __uint64 _Var7;

+  HANDLE *lpHandles;

+  HANDLE hTargetProcessHandle;

+  HANDLE hSourceProcessHandle;

+  longlong *plVar8;

+  ulonglong uVar9;

+  HANDLE *ppvVar10;

+  DWORD nCount;

+  HANDLE *ppvVar11;

+  HANDLE *ppvVar12;

+  HANDLE *ppvVar13;

+  uint uVar14;

+  

+  ppvVar12 = (HANDLE *)0x0;

+  *(undefined4 *)(this + 0x324) = 1;

+  lpCriticalSection = (LPCRITICAL_SECTION)(this + 0x2a8);

+  ppvVar11 = (HANDLE *)0x0;

+  EnterCriticalSection(lpCriticalSection);

+  EnterCriticalSection((LPCRITICAL_SECTION)(this + 0x2d0));

+  ppvVar13 = ppvVar12;

+  lpHandles = ppvVar12;

+  if ((*(longlong *)(this + 0x288) != 0) &&

+     (plVar8 = *(longlong **)(this + 0x298), ppvVar13 = ppvVar11, lpHandles = (HANDLE *)0x0,

+     plVar8 != (longlong *)0x0)) {

+    ppvVar13 = ppvVar12;

+    lpHandles = ppvVar12;

+    if (*(uint *)(this + 0x2a0) != 0) {

+      uVar9 = (ulonglong)*(uint *)(this + 0x2a0);

+      ppvVar10 = ppvVar12;

+      do {

+        lVar2 = *plVar8;

+        plVar8 = plVar8 + 1;

+        uVar14 = (uint)ppvVar10 + 1;

+        if (lVar2 == 0) {

+          uVar14 = (uint)ppvVar10;

+        }

+        ppvVar10 = (HANDLE *)CONCAT44(0,uVar14);

+        uVar9 = uVar9 - 1;

+      } while (uVar9 != 0);

+      ppvVar13 = ppvVar11;

+      lpHandles = (HANDLE *)0x0;

+      if (uVar14 != 0) {

+        auVar3._8_8_ = 0;

+        auVar3._0_8_ = ppvVar10;

+        _Var7 = SUB168(ZEXT416(8) * auVar3,0);

+        if (SUB168(ZEXT416(8) * auVar3,8) != 0) {

+          _Var7 = 0xffffffffffffffff;

+        }

+        lpHandles = operator_new(_Var7);

+        if ((lpHandles != (HANDLE *)0x0) && (ppvVar13 = ppvVar12, *(int *)(this + 0x2a0) != 0)) {

+LAB_0:

+          if (*(longlong *)(*(longlong *)(this + 0x298) + (longlong)ppvVar12 * 8) == 0)

+          goto LAB_1;

+          hTargetProcessHandle = GetCurrentProcess();

+          hSourceHandle = *(HANDLE *)(*(longlong *)(this + 0x298) + (longlong)ppvVar12 * 8);

+          hSourceProcessHandle = GetCurrentProcess();

+          BVar5 = DuplicateHandle(hSourceProcessHandle,hSourceHandle,hTargetProcessHandle,

+                                  lpHandles + (longlong)ppvVar13,0,0,2);

+          if (BVar5 != 0) {

+            ppvVar13 = (HANDLE *)(ulonglong)((int)ppvVar13 + 1);

+            goto LAB_1;

+          }

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar14 = RdpWppGetCurrentThreadActivityIdPrefix();

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x15,

+                     &WPP_de34e2354ea93c6e600faf96ae5f54fc_Traceguids,uVar14);

+          }

+          ppvVar11 = lpHandles;

+          if ((int)ppvVar13 != 0) {

+            do {

+              CloseHandle(*ppvVar11);

+              ppvVar13 = (HANDLE *)((longlong)ppvVar13 + -1);

+              ppvVar11 = ppvVar11 + 1;

+            } while (ppvVar13 != (HANDLE *)0x0);

+          }

+          ppvVar13 = (HANDLE *)0x0;

+        }

+      }

+    }

+LAB_2:

+    uVar9 = 0;

+    if (*(int *)(this + 0x290) != 0) {

+      do {

+        if (*(longlong *)(*(longlong *)(this + 0x288) + uVar9 * 8) != 0) {

+          (**(code **)(this + 0x468))();

+        }

+        uVar14 = (int)uVar9 + 1;

+        uVar9 = (ulonglong)uVar14;

+      } while (uVar14 < *(uint *)(this + 0x290));

+    }

+  }

+  uVar9 = 0;

+  LeaveCriticalSection(lpCriticalSection);

+  LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x2d0));

+  bVar4 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_1480569144> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1480569144>::GetImpl(void)'

+                      ::__l2::impl);

+  nCount = (DWORD)ppvVar13;

+  if (bVar4) {

+    if ((lpHandles != (HANDLE *)0x0) && (ppvVar11 = lpHandles, ppvVar12 = ppvVar13, nCount != 0)) {

+      do {

+        WaitForSingleObject(*ppvVar11,0xffffffff);

+        ppvVar12 = (HANDLE *)((longlong)ppvVar12 + -1);

+        ppvVar11 = ppvVar11 + 1;

+      } while (ppvVar12 != (HANDLE *)0x0);

+    }

+  }

+  else if (((lpHandles != (HANDLE *)0x0) &&

+           (DVar6 = WaitForMultipleObjects(nCount,lpHandles,1,0xffffffff), DVar6 == 0x102)) &&

+          (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control &&

+           (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))))) {

+    uVar1 = *(undefined4 *)(this + 800);

+    uVar14 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x16,

+              &WPP_de34e2354ea93c6e600faf96ae5f54fc_Traceguids,uVar14,uVar1);

+  }

+  EnterCriticalSection(lpCriticalSection);

+  if ((*(longlong *)(this + 0x288) != 0) && (*(int *)(this + 0x290) != 0)) {

+    do {

+      if (*(longlong *)(*(longlong *)(this + 0x288) + uVar9 * 8) != 0) {

+        (**(code **)(this + 0x3a8))();

+        *(undefined8 *)(*(longlong *)(this + 0x288) + uVar9 * 8) = 0;

+      }

+      uVar14 = (int)uVar9 + 1;

+      uVar9 = (ulonglong)uVar14;

+    } while (uVar14 < *(uint *)(this + 0x290));

+  }

+  LeaveCriticalSection(lpCriticalSection);

+  if (lpHandles != (HANDLE *)0x0) {

+    ppvVar11 = lpHandles;

+    if (nCount != 0) {

+      do {

+        CloseHandle(*ppvVar11);

+        ppvVar13 = (HANDLE *)((longlong)ppvVar13 + -1);

+        ppvVar11 = ppvVar11 + 1;

+      } while (ppvVar13 != (HANDLE *)0x0);

+    }

+    operator_delete(lpHandles);

+  }

+  *(undefined4 *)(this + 0x324) = 0;

+  return;

+LAB_1:

+  uVar14 = (int)ppvVar12 + 1;

+  ppvVar12 = (HANDLE *)(ulonglong)uVar14;

+  if (*(uint *)(this + 0x2a0) <= uVar14) goto LAB_2;

+  goto LAB_0;

+}

+
```

## `BasicInputClientChannel::SetChannelPointerToInputHandler`  (modified)

```diff
--- BasicInputClientChannel::SetChannelPointerToInputHandler
+++ BasicInputClientChannel::SetChannelPointerToInputHandler
@@ -1,2 +1,60 @@
-Failed to decompile mstscax.dll - .ProgramDB BasicInputClientChannel::SetChannelPointerToInputHandler : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl BasicInputClientChannel::SetChannelPointerToInputHandler(struct

+   IWTSVirtualChannel * __ptr64) __ptr64 */

+

+long __thiscall

+BasicInputClientChannel::SetChannelPointerToInputHandler

+          (BasicInputClientChannel *this,IWTSVirtualChannel *param_1)

+

+{

+  undefined4 uVar1;

+  int iVar2;

+  longlong *plVar3;

+  longlong *local_res8 [2];

+  CIH *local_res18;

+  CTSCriticalSection *local_res20;

+  

+  local_res8[0] = (longlong *)0x0;

+  local_res18 = (CIH *)0x0;

+  local_res20 = (CTSCriticalSection *)(this + 0x40);

+  CTSCriticalSection::Lock(local_res20);

+  plVar3 = (longlong *)0x0;

+  if (*(longlong *)(this + 0x58) != 0) {

+    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)local_res8);

+    plVar3 = *(longlong **)(this + 0x58);

+    local_res8[0] = plVar3;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)local_res8);

+  }

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res20);

+  if (plVar3 == (longlong *)0x0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar1 = RdpX_GetActivityIdPrefix();

+      WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x34,

+                &WPP_f1b8636e92783f3a362c7aa8657a47da_Traceguids,uVar1,"spCoreApiInternal");

+    }

+    iVar2 = -0x7fffbffd;

+  }

+  else {

+    iVar2 = (**(code **)(*plVar3 + 0x2a8))(plVar3,&local_res18);

+    if (iVar2 < 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar1 = RdpX_GetActivityIdPrefix();

+        WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x35,

+                   &WPP_f1b8636e92783f3a362c7aa8657a47da_Traceguids,uVar1,"Unable to get IH",iVar2);

+      }

+    }

+    else {

+      CIH::IH_SetBasicInputDynamicVC(local_res18,param_1);

+    }

+  }

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)&local_res18);

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)local_res8);

+  return iVar2;

+}

+
```

## `Microsoft::WRL::ComPtr<MediaStreamAdapter>::`vector_deleting_destructor'`  (modified)

```diff
--- Microsoft::WRL::ComPtr<MediaStreamAdapter>::`vector_deleting_destructor'
+++ CameraAdapter::ActivateDevice
@@ -1,14 +1,44 @@
 

-void * __thiscall

+long __thiscall

 Microsoft::WRL::Details::

-RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IRailCloakSyncComponent>::

-_vector_deleting_destructor_(ComPtr<MediaStreamAdapter> *this,uint param_1)

+RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<6>,0,0,0,IClassFactory,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil>

+::ActivateDevice(CameraAdapter *this,bool param_1)

 

 {

+  char *pcVar1;

+  uint uVar2;

+  int iVar3;

   char *in_RAX;

-  ulonglong unaff_RBX;

+  undefined8 in_stack_00000020;

+  undefined4 uVar4;

+  int iStack0000000000000028;

+  byte in_stack_00000068;

   

+  uVar4 = (undefined4)((ulonglong)in_stack_00000020 >> 0x20);

   *in_RAX = *in_RAX + (char)in_RAX;

-  return (void *)(unaff_RBX & 0xffffffff);

+  pcVar1 = in_RAX + 0x468247c;

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

+  if (*pcVar1 == '\0') {

+    iVar3 = func_0x00018025f834();

+    if ((((iVar3 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      iStack0000000000000028 = iVar3;

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xb,

+                 &WPP_593922d82965378f67e2000ddb9e76c2_Traceguids,uVar2,

+                 "OnSelectVersionResponse failed");

+    }

+  }

+  else {

+    iVar3 = -0x7ff8fff3;

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xc,

+                &WPP_593922d82965378f67e2000ddb9e76c2_Traceguids,uVar2,

+                CONCAT44(uVar4,(uint)in_stack_00000068));

+    }

+  }

+  return iVar3;

 }
```

## `RdpWinDesktopRemoteAppUIManager::~RdpWinDesktopRemoteAppUIManager`  (modified)

```diff
--- RdpWinDesktopRemoteAppUIManager::~RdpWinDesktopRemoteAppUIManager
+++ RdpWinDesktopRemoteAppUIManager::~RdpWinDesktopRemoteAppUIManager
@@ -1,2 +1,135 @@
-Failed to decompile mstscax.dll - .ProgramDB RdpWinDesktopRemoteAppUIManager::~RdpWinDesktopRemoteAppUIManager : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual __cdecl RdpWinDesktopRemoteAppUIManager::~RdpWinDesktopRemoteAppUIManager(void)

+   __ptr64 */

+

+void __thiscall

+RdpWinDesktopRemoteAppUIManager::~RdpWinDesktopRemoteAppUIManager

+          (RdpWinDesktopRemoteAppUIManager *this)

+

+{

+  _DlistNode<wil::com_ptr_t<CRailUiaProvider,wil::err_returncode_policy>_> *p_Var1;

+  _ContainerBase<wil::com_ptr_t<CRailUiaProvider,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<CRailUiaProvider,wil::err_returncode_policy>_>_>

+  *this_00;

+  longlong lVar2;

+  

+  *(undefined ***)this = &_vftable__for__RdpXInterfaceDesktopRemoteAppCore__;

+  *(undefined ***)(this + 8) = &_vftable__for__RdpXInterfaceRemoteAppUIManager__;

+  *(undefined ***)(this + 0x10) = &_vftable__for__RdpXInterfaceDesktopRemoteAppLanguageSync__;

+  *(undefined ***)(this + 0x18) = &_vftable__for__RdpXInterfaceUIOutputMapManager__;

+  *(undefined ***)(this + 0x20) = &_vftable__for__RdpXInterfaceRemoteAppWindowGraphicsCapture__;

+  *(undefined ***)(this + 0x28) = &_vftable__for__RdpXInterfaceOutputMapManagerInternal__;

+  *(undefined ***)(this + 0x30) = &CBasePlayer::_vftable__for__INonDelegatingUnknown__;

+  *(undefined ***)(this + 0x38) = &_vftable__for__CTSObject__;

+  Terminate(this + 0x38);

+  wil::details::

+  unique_storage<wil::details::resource_policy<HINSTANCE__*___ptr64,int_(__cdecl*)(HINSTANCE__*___ptr64),&int___cdecl_FreeLibrary(struct_HINSTANCE__*___ptr64),wistd::integral_constant<unsigned___int64,0>,HINSTANCE__*___ptr64,HINSTANCE__*___ptr64,0,std::nullptr_t>_>

+  ::

+  ~unique_storage<wil::details::resource_policy<HINSTANCE__*___ptr64,int_(__cdecl*)(HINSTANCE__*___ptr64),&int___cdecl_FreeLibrary(struct_HINSTANCE__*___ptr64),wistd::integral_constant<unsigned___int64,0>,HINSTANCE__*___ptr64,HINSTANCE__*___ptr64,0,std::nullptr_t>_>

+            ((unique_storage<wil::details::resource_policy<HINSTANCE__*___ptr64,int_(__cdecl*)(HINSTANCE__*___ptr64),&int___cdecl_FreeLibrary(struct_HINSTANCE__*___ptr64),wistd::integral_constant<unsigned___int64,0>,HINSTANCE__*___ptr64,HINSTANCE__*___ptr64,0,std::nullptr_t>_>

+              *)(this + 0x568));

+  RdpXSPtr<RdpWinDesktopRemoteAppWindow>::SafeRelease

+            ((RdpXSPtr<RdpWinDesktopRemoteAppWindow> *)(this + 0x560));

+  while (p_Var1 = *(_DlistNode<wil::com_ptr_t<CRailUiaProvider,wil::err_returncode_policy>_> **)

+                   (this + 0x548),

+        p_Var1 != (_DlistNode<wil::com_ptr_t<CRailUiaProvider,wil::err_returncode_policy>_> *)

+                  (this + 0x548)) {

+    this_00 = *(_ContainerBase<wil::com_ptr_t<CRailUiaProvider,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<CRailUiaProvider,wil::err_returncode_policy>_>_>

+                **)(p_Var1 + 8);

+    lVar2 = *(longlong *)p_Var1;

+    *(longlong *)this_00 = lVar2;

+    *(_ContainerBase<wil::com_ptr_t<CRailUiaProvider,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<CRailUiaProvider,wil::err_returncode_policy>_>_>

+      **)(lVar2 + 8) = this_00;

+    utl::

+    _ContainerBase<wil::com_ptr_t<CRailUiaProvider,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<CRailUiaProvider,wil::err_returncode_policy>_>_>

+    ::_DeleteNode<utl::_DlistNode<wil::com_ptr_t<CRailUiaProvider,wil::err_returncode_policy>_>_>

+              (this_00,p_Var1);

+  }

+  *(undefined8 *)(this + 0x558) = 0;

+  wil::

+  unique_winrt_event_token<ABI::Windows::UI::UIAutomation::Core::IRemoteAutomationClientSession>::

+  ~unique_winrt_event_token<ABI::Windows::UI::UIAutomation::Core::IRemoteAutomationClientSession>

+            ((unique_winrt_event_token<ABI::Windows::UI::UIAutomation::Core::IRemoteAutomationClientSession>

+              *)(this + 0x530));

+  wil::

+  unique_winrt_event_token<ABI::Windows::UI::UIAutomation::Core::IRemoteAutomationClientSession>::

+  ~unique_winrt_event_token<ABI::Windows::UI::UIAutomation::Core::IRemoteAutomationClientSession>

+            ((unique_winrt_event_token<ABI::Windows::UI::UIAutomation::Core::IRemoteAutomationClientSession>

+              *)(this + 0x518));

+  ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)(this + 0x510));

+  RdpXSPtrArray<RdpXPlatKeySPtrValuePair<_XObjectId32,RdpXInterfaceGlobalObject>,16,4294967294>::

+  ~RdpXSPtrArray<RdpXPlatKeySPtrValuePair<_XObjectId32,RdpXInterfaceGlobalObject>,16,4294967294>

+            ((RdpXSPtrArray<RdpXPlatKeySPtrValuePair<_XObjectId32,RdpXInterfaceGlobalObject>,16,4294967294>

+              *)(this + 0x4a8));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x490));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x488));

+  wil::details::

+  unique_storage<wil::details::resource_policy<HINSTANCE__*___ptr64,int_(__cdecl*)(HINSTANCE__*___ptr64),&int___cdecl_FreeLibrary(struct_HINSTANCE__*___ptr64),wistd::integral_constant<unsigned___int64,0>,HINSTANCE__*___ptr64,HINSTANCE__*___ptr64,0,std::nullptr_t>_>

+  ::

+  ~unique_storage<wil::details::resource_policy<HINSTANCE__*___ptr64,int_(__cdecl*)(HINSTANCE__*___ptr64),&int___cdecl_FreeLibrary(struct_HINSTANCE__*___ptr64),wistd::integral_constant<unsigned___int64,0>,HINSTANCE__*___ptr64,HINSTANCE__*___ptr64,0,std::nullptr_t>_>

+            ((unique_storage<wil::details::resource_policy<HINSTANCE__*___ptr64,int_(__cdecl*)(HINSTANCE__*___ptr64),&int___cdecl_FreeLibrary(struct_HINSTANCE__*___ptr64),wistd::integral_constant<unsigned___int64,0>,HINSTANCE__*___ptr64,HINSTANCE__*___ptr64,0,std::nullptr_t>_>

+              *)(this + 0x480));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x470));

+  CTSCriticalSection::Terminate((CTSCriticalSection *)(this + 0x460));

+  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)(this + 0x458));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x450));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x448));

+  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)(this + 0x1e8));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x1c0));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x1b0));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x1a8));

+  utl::

+  _Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+  ::clear((_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+           *)(this + 0x180));

+  utl::

+  _Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>_>,0>

+  ::clear((_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>_>,0>

+           *)(this + 0x160));

+  RdpXSPtrArray<RdpWinDesktopRemoteAppWindow,16,4294967294>::

+  ~RdpXSPtrArray<RdpWinDesktopRemoteAppWindow,16,4294967294>

+            ((RdpXSPtrArray<RdpWinDesktopRemoteAppWindow,16,4294967294> *)(this + 0x140));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x138));

+  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)(this + 0x130));

+  RdpXSPtr<RdpWinRegion>::SafeRelease((RdpXSPtr<RdpWinRegion> *)(this + 0x128));

+  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)(this + 0x120));

+  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)(this + 0x118));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x108));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x100));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xf8));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xf0));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xe8));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xe0));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xd8));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xd0));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 200));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xc0));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xb8));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0xb0));

+  TCntPtr<ITSInstance>::SafeRelease((TCntPtr<ITSInstance> *)(this + 0xa8));

+  CRdpWinAudioWaveoutPlayback::CTSSinkMapMMClientWaveOut::UnBind

+            ((CTSSinkMapMMClientWaveOut *)(this + 0x80));

+  *(undefined ***)(this + 0x30) = CTSUnknown::vftable_for_INonDelegatingUnknown_;

+  *(undefined ***)(this + 0x38) = CTSObject::vftable;

+  *(uint *)(this + 0x4c) = *(uint *)(this + 0x4c) | 8;

+  return;

+}

+
```

## `CCO::OnPacketReceived`  (modified)

```diff
--- CCO::OnPacketReceived
+++ CCO::OnPacketReceived
@@ -1,2 +1,807 @@
-Failed to decompile mstscax.dll - .ProgramDB CCO::OnPacketReceived : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

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

+/* public: virtual long __cdecl CCO::OnPacketReceived(unsigned char * __ptr64,unsigned long,unsigned

+   long,unsigned long,unsigned long) __ptr64 */

+

+long __thiscall

+CCO::OnPacketReceived

+          (CCO *this,uchar *param_1,ulong param_2,ulong param_3,ulong param_4,ulong param_5)

+

+{

+  tagTS_PLAY_SOUND_PDU_DATA *ptVar1;

+  byte bVar2;

+  ushort uVar3;

+  longlong *plVar4;

+  char cVar5;

+  undefined4 uVar6;

+  uint uVar7;

+  uint uVar8;

+  long lVar9;

+  uint uVar10;

+  CSP *pCVar11;

+  wchar_t *pwVar12;

+  ushort uVar13;

+  int iVar14;

+  ulong uVar15;

+  undefined8 uVar16;

+  uint uVar17;

+  CCO *pCVar18;

+  undefined4 in_register_0000008c;

+  longlong lVar19;

+  ushort *puVar20;

+  uint uVar21;

+  uint uVar22;

+  uint uVar23;

+  tagTS_PLAY_SOUND_PDU_DATA *ptVar24;

+  CCO *pCVar25;

+  undefined1 auStackY_2f8 [32];

+  uint in_stack_fffffffffffffd38;

+  RDPClientPacketType local_2a4;

+  CCO *local_2a0;

+  ulong local_298;

+  longlong *local_290;

+  ulong local_288;

+  ulong local_284;

+  int local_280;

+  int local_27c;

+  int local_278;

+  ulong local_274;

+  tagTS_PLAY_SOUND_PDU_DATA *local_270;

+  uchar *local_268;

+  ushort local_258 [264];

+  ulonglong local_48;

+  

+  local_48 = __security_cookie ^ (ulonglong)auStackY_2f8;

+  uVar7 = 0;

+  local_278 = 0;

+  local_27c = 0;

+  local_290 = (longlong *)0x0;

+  local_2a4 = 0xc;

+  plVar4 = *(longlong **)(this + 0x38);

+  local_2a0 = this;

+  local_298 = param_2;

+  local_268 = param_1;

+  if ((plVar4 == (longlong *)0x0) ||

+     (iVar14 = (**(code **)(*plVar4 + 600))

+                         (plVar4,&IID_IRdpClientCoreEventLogCallback,&local_290,

+                          CONCAT44(in_register_0000008c,param_3)), -1 < iVar14)) {

+LAB_0:

+    if ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) {

+      if (((WPP_GLOBAL_Control[0x1c] & 1) != 0) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar6 = RdpX_GetActivityIdPrefix();

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3b,

+                  &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+      }

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar6 = RdpX_GetActivityIdPrefix();

+        WPP_SF_DqD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3c,

+                   &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+      }

+    }

+  }

+  else if ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) {

+    if (((WPP_GLOBAL_Control[0x1c] & 8) != 0) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar6 = RdpX_GetActivityIdPrefix();

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3a,

+                 &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+    }

+    goto LAB_0;

+  }

+  local_274 = 0xd06;

+  pCVar11 = (CSP *)WPP_GLOBAL_Control;

+  puVar20 = (ushort *)param_1;

+  uVar10 = 0;

+  if (param_1 == (uchar *)0x0) goto LAB_1;

+  while( true ) {

+    uVar7 = uVar10;

+    uVar10 = 0x80886918;

+    pCVar25 = this;

+    if (param_2 < 4) {

+      if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+         (pCVar11[0x19] != (CSP)0x0)) {

+        WPP_SF_DL(*(undefined **)(pCVar11 + 0x10),0x3d,

+                  &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,param_2);

+        pCVar11 = (CSP *)WPP_GLOBAL_Control;

+      }

+      uVar7 = 0x9f1042f5;

+      goto LAB_2;

+    }

+    if (*puVar20 == 0x8000) break;

+    uVar3 = *puVar20;

+    uVar23 = (uint)uVar3;

+    if (param_2 < uVar3) {

+      if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+         (pCVar11[0x19] != (CSP)0x0)) {

+        WPP_SF_DL(*(undefined **)(pCVar11 + 0x10),0x3e,

+                  &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,param_2);

+        pCVar11 = (CSP *)WPP_GLOBAL_Control;

+      }

+      uVar7 = 0x9f104301;

+      goto LAB_2;

+    }

+    uVar21 = (uint)uVar3;

+    if (((0x11 < param_2) && (pCVar11 != (CSP *)&WPP_GLOBAL_Control)) &&

+       ((((byte)pCVar11[0x1c] & 1) != 0 && (3 < (byte)pCVar11[0x19])))) {

+      uVar13 = puVar20[7];

+      uVar10 = 0x80886918;

+      RdpX_GetActivityIdPrefix();

+      in_stack_fffffffffffffd38 = (uint)(byte)uVar13;

+      WPP_SF_DqDDD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10));

+      pCVar11 = (CSP *)WPP_GLOBAL_Control;

+    }

+    uVar13 = puVar20[1] & 0xf;

+    uVar8 = uVar7;

+    if (uVar13 == 1) {

+      if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+         (3 < (byte)pCVar11[0x19])) {

+        uVar6 = RdpX_GetActivityIdPrefix();

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x54,

+                 &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+      }

+      local_2a4 = 0x1a;

+      if (uVar21 < 0xf) {

+        TRACE_ABORT_FROM_MACRO_FN

+                  ((ushort *)L"Bad TS_DEMAND_ACTIVE_PDU len [expected %u got %u]",0xf,

+                   (ulonglong)uVar21);

+        uVar7 = 0x9f104495;

+        pCVar11 = (CSP *)WPP_GLOBAL_Control;

+        goto LAB_2;

+      }

+      CTSConnectionHandler::OnConfiguringRemoteSession(*(CTSConnectionHandler **)(this + 0x120));

+      CoreFSM::CC_OnDemandActivePDU(*(CoreFSM **)(this + 0xf8),puVar20,uVar21);

+      pCVar11 = (CSP *)WPP_GLOBAL_Control;

+    }

+    else if ((((uVar13 == 2) || (uVar13 == 3)) || (uVar13 == 4)) || (uVar13 == 5)) {

+      if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+         (1 < (byte)pCVar11[0x19])) {

+        uVar6 = RdpX_GetActivityIdPrefix();

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x56,

+                  &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+        pCVar11 = (CSP *)WPP_GLOBAL_Control;

+      }

+    }

+    else if (uVar13 == 6) {

+      if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+         (3 < (byte)pCVar11[0x19])) {

+        uVar6 = RdpX_GetActivityIdPrefix();

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x55,

+                 &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+      }

+      local_2a4 = 0x1b;

+      CoreFSM::CC_Event(*(CoreFSM **)(this + 0xf8),0x69);

+      pCVar11 = (CSP *)WPP_GLOBAL_Control;

+    }

+    else {

+      uVar22 = (uint)uVar3;

+      if (uVar13 == 7) {

+        if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+           (3 < (byte)pCVar11[0x19])) {

+          uVar6 = RdpX_GetActivityIdPrefix();

+          uVar10 = 0x806d9c00;

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x40,

+                   &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+          pCVar11 = (CSP *)WPP_GLOBAL_Control;

+        }

+        pCVar25 = local_2a0;

+        local_2a4 = 0xd;

+        if (uVar23 < 0x12) {

+          TRACE_ABORT_FROM_MACRO_FN

+                    ((ushort *)L"Bad TS_SHAREDATAHEADER len [expected %u got %u]",0x12,

+                     (ulonglong)uVar23);

+          uVar7 = 0x9f104315;

+          pCVar11 = (CSP *)WPP_GLOBAL_Control;

+          pCVar25 = this;

+          goto LAB_2;

+        }

+        ptVar1 = (tagTS_PLAY_SOUND_PDU_DATA *)(puVar20 + 9);

+        ptVar24 = ptVar1;

+        uVar17 = uVar23 - 0x12;

+        if ((*(byte *)((longlong)puVar20 + 0xf) & 0x20) != 0) {

+          bVar2 = *(byte *)((longlong)puVar20 + 0xf);

+          local_270 = (tagTS_PLAY_SOUND_PDU_DATA *)0x0;

+          local_284 = 0;

+          uVar10 = bVar2 & 0x80;

+          uVar7 = internalDecompress(local_2a0,bVar2 & 0xf,uVar10,(uchar *)ptVar1,*puVar20 - 0x12,

+                                     bVar2 & 0x40,in_stack_fffffffffffffd38,(uchar **)&local_270,

+                                     &local_284,&local_274);

+          pCVar11 = (CSP *)WPP_GLOBAL_Control;

+          ptVar24 = local_270;

+          uVar17 = local_284;

+          uVar8 = uVar7;

+          if ((int)uVar7 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar6 = RdpX_GetActivityIdPrefix();

+              WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x41,

+                       &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+              pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            }

+            goto LAB_3;

+          }

+        }

+        pCVar25 = local_2a0;

+        bVar2 = (byte)puVar20[7];

+        uVar7 = (uint)bVar2;

+        this = pCVar25;

+        if (bVar2 < 0x21) {

+          uVar10 = (uint)bVar2;

+          if (bVar2 != 0x20) {

+            if (uVar7 < 0x1b) {

+              if (uVar7 != 0x1a) {

+                if (uVar10 == 2) {

+                  uVar7 = OnSlowPathUpdateReceived(local_2a0,(uchar *)ptVar24,uVar17,&local_2a4);

+                  pCVar11 = (CSP *)WPP_GLOBAL_Control;

+                  if (((int)uVar7 < 0) && ((uVar7 & 0x1f000000) == 0x1f000000)) {

+                    pwVar12 = L"OnSlowPathUpdateReceived failed";

+                    goto LAB_4;

+                  }

+                  goto LAB_5;

+                }

+                if (uVar10 != 0x14) {

+                  iVar14 = uVar10 - 0x17;

+                  goto LAB_6;

+                }

+              }

+            }

+            else {

+              if (uVar7 == 0x1b) {

+                local_2a4 = 0xe;

+                if (uVar17 < 2) {

+                  TRACE_ABORT_FROM_MACRO_FN

+                            ((ushort *)L"Bad TS_POINTER_PDU_DATA len [expected %u got %u]",2,

+                             (ulonglong)uVar17);

+                  uVar7 = 0x9f10434c;

+                  pCVar11 = (CSP *)WPP_GLOBAL_Control;

+                  pCVar25 = local_2a0;

+                  goto LAB_2;

+                }

+                if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+                   (3 < (byte)pCVar11[0x19])) {

+                  uVar6 = RdpX_GetActivityIdPrefix();

+                  WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x42,

+                           &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+                }

+                pCVar25 = local_2a0;

+                uVar7 = CCM::CM_SlowPathPDU(*(CCM **)(local_2a0 + 0x110),

+                                            (tagTS_POINTER_PDU_DATA *)ptVar24,uVar17);

+                pCVar11 = (CSP *)WPP_GLOBAL_Control;

+                this = pCVar25;

+                if ((-1 < (int)uVar7) || ((uVar7 & 0x1f000000) != 0x1f000000)) goto LAB_5;

+                pwVar12 = L"CM_SlowPathPDU failed";

+LAB_4:

+                TRACE_ERR_FROM_MACRO_FN((ushort *)pwVar12);

+                pCVar11 = (CSP *)WPP_GLOBAL_Control;

+                goto LAB_3;

+              }

+              if (uVar7 != 0x1c) {

+                iVar14 = uVar7 - 0x1d;

+LAB_6:

+                if (((iVar14 != 0) && (iVar14 != 1)) && (iVar14 != 2)) {

+LAB_7:

+                  local_2a4 = 0x21;

+                  uVar8 = OnUnknownPacket(local_2a0,(uchar *)puVar20,(uint)*puVar20);

+                  pCVar11 = (CSP *)WPP_GLOBAL_Control;

+                  if (-1 < (int)uVar8) goto LAB_5;

+                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (WPP_GLOBAL_Control[0x19] != '\0'))

+                  {

+                    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x52,

+                             &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,(char)puVar20[7]);

+                  }

+                  uVar7 = 0x9f10c46e;

+                  pCVar11 = (CSP *)WPP_GLOBAL_Control;

+                  goto LAB_2;

+                }

+              }

+            }

+          }

+          if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+             (3 < (byte)pCVar11[0x19])) {

+            uVar6 = RdpX_GetActivityIdPrefix();

+            WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x44,

+                      &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            this = local_2a0;

+          }

+        }

+        else if (bVar2 < 0x2e) {

+          if (bVar2 == 0x2d) {

+            local_2a4 = 0x14;

+            if (uVar23 < 0x1c) {

+              TRACE_ABORT_FROM_MACRO_FN

+                        ((ushort *)L"Bad TS_SET_KEYBOARD_IME_STATUS_PDU len [expected %u got %u]",

+                         0x1c,(ulonglong)uVar23);

+              uVar7 = 0x9f1043c0;

+              pCVar11 = (CSP *)WPP_GLOBAL_Control;

+              pCVar25 = local_2a0;

+              goto LAB_2;

+            }

+            if ((*(byte *)((longlong)puVar20 + 0xf) & 0x20) != 0) {

+              TRACE_ABORT_FROM_MACRO_FN

+                        ((ushort *)L"TS_SET_KEYBOARD_IME_STATUS_PDU was unexpectedly compressed");

+              uVar7 = 0x9f1183c2;

+              pCVar11 = (CSP *)WPP_GLOBAL_Control;

+              pCVar25 = local_2a0;

+              goto LAB_2;

+            }

+            if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+               (3 < (byte)pCVar11[0x19])) {

+              uVar6 = RdpX_GetActivityIdPrefix();

+              WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x49,

+                       &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+              pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            }

+            this = local_2a0;

+            plVar4 = *(longlong **)(*(longlong *)(local_2a0 + 0x100) + 0xb0);

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

+              (**(code **)(*plVar4 + 0xc0))

+                        (plVar4,*(undefined4 *)(puVar20 + 10),*(undefined4 *)(puVar20 + 0xc));

+              pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            }

+          }

+          else if (uVar7 == 0x22) {

+            local_2a4 = 0x11;

+            if (uVar17 < 8) {

+              TRACE_ABORT_FROM_MACRO_FN

+                        ((ushort *)L"Bad TS_PLAY_SOUND_PDU_DATA len [expected %u got %u]",8,

+                         (ulonglong)uVar17);

+              uVar7 = 0x9f104394;

+              pCVar11 = (CSP *)WPP_GLOBAL_Control;

+              pCVar25 = local_2a0;

+              goto LAB_2;

+            }

+            if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+               (3 < (byte)pCVar11[0x19])) {

+              uVar6 = RdpX_GetActivityIdPrefix();

+              uVar10 = 0x806d9c00;

+              pCVar11 = *(CSP **)(WPP_GLOBAL_Control + 0x10);

+              WPP_SF_D(pCVar11,0x46,&WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+            }

+            uVar7 = CSP::SP_OnPlaySoundPDU(pCVar11,ptVar24,uVar10);

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            this = local_2a0;

+            if (((int)uVar7 < 0) && ((uVar7 & 0x1f000000) == 0x1f000000)) {

+              TRACE_ERR_FROM_MACRO_FN((ushort *)L"SP_OnPlaySoundPDU failed");

+              pCVar11 = (CSP *)WPP_GLOBAL_Control;

+              pCVar25 = local_2a0;

+              goto LAB_3;

+            }

+          }

+          else if (uVar7 == 0x25) {

+            if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+               (3 < (byte)pCVar11[0x19])) {

+              uVar6 = RdpX_GetActivityIdPrefix();

+              WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x45,

+                       &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+            }

+            this = local_2a0;

+            CoreFSM::CC_Event(*(CoreFSM **)(local_2a0 + 0xf8),0x6b);

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+          }

+          else if (uVar7 == 0x26) {

+            local_2a4 = 0x12;

+            if (uVar17 < 4) {

+              TRACE_ABORT_FROM_MACRO_FN

+                        ((ushort *)L"Bad TS_SAVE_SESSION_INFO_PDU_DATA len [expected %u got %u]",4,

+                         (ulonglong)uVar17);

+              uVar7 = 0x9f1043a2;

+              pCVar11 = (CSP *)WPP_GLOBAL_Control;

+              pCVar25 = local_2a0;

+              goto LAB_2;

+            }

+            if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+               (3 < (byte)pCVar11[0x19])) {

+              uVar6 = RdpX_GetActivityIdPrefix();

+              WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x47,

+                       &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+            }

+            pCVar25 = local_2a0;

+            uVar7 = OnSaveSessionInfoPDU

+                              (local_2a0,(tagTS_SAVE_SESSION_INFO_PDU_DATA *)ptVar24,uVar17);

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            this = pCVar25;

+            if (((int)uVar7 < 0) && ((uVar7 & 0x1f000000) == 0x1f000000)) {

+              pwVar12 = L"CO_OnSaveSessionInfoPDU failed";

+              goto LAB_4;

+            }

+          }

+          else if (uVar7 == 0x28) {

+            local_2a4 = 0x10;

+            CTSConnectionHandler::OnConnected(*(CTSConnectionHandler **)(local_2a0 + 0x120));

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+          }

+          else {

+            if (uVar7 != 0x29) goto LAB_7;

+            local_2a4 = 0x13;

+            if (uVar23 < 0x16) {

+              TRACE_ABORT_FROM_MACRO_FN

+                        ((ushort *)L"Bad TS_SET_KEYBOARD_INDICATORS_PDU len [expected %u got %u]",

+                         0x16,(ulonglong)uVar22);

+              uVar7 = 0x9f1043ae;

+              pCVar11 = (CSP *)WPP_GLOBAL_Control;

+              pCVar25 = local_2a0;

+              goto LAB_2;

+            }

+            if ((*(byte *)((longlong)puVar20 + 0xf) & 0x20) != 0) {

+              TRACE_ABORT_FROM_MACRO_FN

+                        ((ushort *)L"TS_SET_KEYBOARD_INDICATORS_PDU was unexpectedly compressed");

+              uVar7 = 0x9f1183b0;

+              pCVar11 = (CSP *)WPP_GLOBAL_Control;

+              pCVar25 = local_2a0;

+              goto LAB_2;

+            }

+            if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+               (3 < (byte)pCVar11[0x19])) {

+              uVar6 = RdpX_GetActivityIdPrefix();

+              WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x48,

+                       &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+            }

+            this = local_2a0;

+            CIH::IH_UpdateKeyboardIndicators

+                      (*(CIH **)(local_2a0 + 0x100),*(ushort *)ptVar1,puVar20[10]);

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+          }

+        }

+        else if (uVar7 == 0x2f) {

+          local_2a4 = 0x15;

+          if (uVar23 < 0x16) {

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"Bad TS_SET_ERROR_INFO_PDU len [expected %u got %u]",0x16,

+                       (ulonglong)uVar23);

+            uVar7 = 0x9f1043d1;

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            pCVar25 = local_2a0;

+            goto LAB_2;

+          }

+          if ((*(byte *)((longlong)puVar20 + 0xf) & 0x20) != 0) {

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"TS_SET_ERROR_INFO_PDU was unexpectedly compressed");

+            uVar7 = 0x9f1183d3;

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            pCVar25 = local_2a0;

+            goto LAB_2;

+          }

+          if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+             (3 < (byte)pCVar11[0x19])) {

+            uVar6 = RdpX_GetActivityIdPrefix();

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4a,

+                     &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+          }

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

+             (lVar9 = StringCchPrintfW(local_258,0x104,

+                                       (ushort *)

+                                       L"Received error info PDU from server with error 0x%x",

+                                       (ulonglong)*(uint *)ptVar1), -1 < lVar9)) {

+            (**(code **)(*local_290 + 0x38))(local_290,L"CoreConnection",local_258);

+          }

+          this = local_2a0;

+          CTSConnectionHandler::SetServerErrorInfo

+                    (*(CTSConnectionHandler **)(local_2a0 + 0x120),(ulonglong)*(uint *)ptVar1);

+          pCVar11 = (CSP *)WPP_GLOBAL_Control;

+        }

+        else if (uVar7 == 0x32) {

+          local_2a4 = 0x16;

+          if (uVar22 < 0x16) {

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"Bad TS_AUTORECONNECT_STATUS_PDU len [expected %u got %u]",0x16,

+                       (ulonglong)uVar22);

+            uVar7 = 0x9f1043ed;

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            pCVar25 = local_2a0;

+            goto LAB_2;

+          }

+          if ((*(byte *)((longlong)puVar20 + 0xf) & 0x20) != 0) {

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"TS_AUTORECONNECT_STATUS_PDU was unexpectedly compressed");

+            uVar7 = 0x9f1183ef;

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            pCVar25 = local_2a0;

+            goto LAB_2;

+          }

+          if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+             (3 < (byte)pCVar11[0x19])) {

+            uVar6 = RdpX_GetActivityIdPrefix();

+            WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4b,

+                      &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+          }

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

+             (lVar9 = StringCchPrintfW(local_258,0x104,

+                                       (ushort *)L"Auto reconnect failed on server with error 0x%x",

+                                       (ulonglong)*(uint *)ptVar1), -1 < lVar9)) {

+            (**(code **)(*local_290 + 0x38))(local_290,L"CoreConnection",local_258);

+          }

+          pCVar25 = local_2a0;

+          if (*(int *)(*(longlong *)(local_2a0 + 0x120) + 0x3f0) == 0) {

+            CTSAutoReconnectionHandler::OnAutoReconnectStopped

+                      (*(CTSAutoReconnectionHandler **)(*(longlong *)(local_2a0 + 0x120) + 1000));

+          }

+          local_280 = 1;

+          uVar7 = (**(code **)(**(longlong **)(pCVar25 + 400) + 0x70))

+                            (*(longlong **)(pCVar25 + 400),"ContinueOnArcFailure",&local_280);

+          pCVar11 = (CSP *)WPP_GLOBAL_Control;

+          this = pCVar25;

+          uVar8 = uVar7;

+          if (((-1 < (int)uVar7) && (*(uint *)ptVar1 == 0)) && (local_280 == 0)) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar6 = RdpX_GetActivityIdPrefix();

+              WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4c,

+                       &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+            }

+            iVar14 = (**(code **)(**(longlong **)(pCVar25 + 400) + 0x70))

+                               (*(longlong **)(pCVar25 + 400),"RailMode",&local_278);

+            if (((iVar14 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+               (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+              uVar6 = RdpX_GetActivityIdPrefix();

+              WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4d,

+                        &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+            }

+            uVar15 = 0xe08;

+            if (local_278 != 0) {

+              uVar15 = 0x2000001;

+            }

+            goto LAB_8;

+          }

+        }

+        else if (uVar7 == 0x35) {

+          local_288 = 0;

+          local_2a4 = 0xf;

+          if (uVar17 < 4) {

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"Bad TS_INPUT_MODE_CHANGE_PDU len [expected %u got %u]",4,

+                       (ulonglong)uVar17);

+            uVar7 = 0x9f10435c;

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            pCVar25 = local_2a0;

+            goto LAB_2;

+          }

+          local_288 = *(ulong *)ptVar24;

+          uVar7 = CIH::IH_ChangeInputMode(*(CIH **)(local_2a0 + 0x100),&local_288);

+          pCVar11 = (CSP *)WPP_GLOBAL_Control;

+          if ((int)uVar7 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar6 = RdpX_GetActivityIdPrefix();

+              uVar16 = 0x43;

+LAB_9:

+              WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar16,

+                         &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+              pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            }

+            goto LAB_3;

+          }

+          uVar8 = uVar7;

+          if ((uVar7 == 0) &&

+             (plVar4 = *(longlong **)(*(longlong *)(pCVar25 + 0x120) + 0x40),

+             plVar4 != (longlong *)0x0)) {

+            (**(code **)(*plVar4 + 0x70))(plVar4,local_288 & 1);

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+          }

+        }

+        else if (uVar7 == 0x36) {

+          local_2a4 = 0x17;

+          if (uVar22 < 0x16) {

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"Bad TS_STATUS_INFO_PDU len [expected %u got %u]",0x16,

+                       (ulonglong)uVar22);

+            uVar7 = 0x9f10442f;

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            pCVar25 = local_2a0;

+            goto LAB_2;

+          }

+          if ((*(byte *)((longlong)puVar20 + 0xf) & 0x20) != 0) {

+            TRACE_ABORT_FROM_MACRO_FN((ushort *)L"TS_STATUS_INFO_PDU was unexpectedly compressed");

+            uVar7 = 0x9f118434;

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            pCVar25 = local_2a0;

+            goto LAB_2;

+          }

+          if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+             (3 < (byte)pCVar11[0x19])) {

+            uVar6 = RdpX_GetActivityIdPrefix();

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4e,

+                     &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+          }

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

+             (lVar9 = StringCchPrintfW(local_258,0x104,

+                                       (ushort *)

+                                       L"Received connection status info from server - 0x%x",

+                                       (ulonglong)*(uint *)ptVar1), -1 < lVar9)) {

+            (**(code **)(*local_290 + 0x38))(local_290,L"CoreConnection",local_258);

+          }

+          pCVar25 = local_2a0;

+          uVar7 = CTSConnectionHandler::OnStatusInfoReceived

+                            (*(CTSConnectionHandler **)(local_2a0 + 0x120),*(ulong *)ptVar1);

+          pCVar11 = (CSP *)WPP_GLOBAL_Control;

+          this = pCVar25;

+          uVar8 = uVar7;

+          if ((int)uVar7 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar6 = RdpX_GetActivityIdPrefix();

+              uVar16 = 0x4f;

+              goto LAB_9;

+            }

+            goto LAB_3;

+          }

+        }

+        else {

+          if (uVar7 != 0x37) goto LAB_7;

+          local_2a4 = 0x18;

+          if (uVar21 < 0x2a) {

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"Bad TS_MONITOR_LAYOUT_PDU len [expected %u got %u]",0x2a,

+                       (ulonglong)uVar21);

+            uVar7 = 0x9f104454;

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            pCVar25 = local_2a0;

+            goto LAB_2;

+          }

+          if ((*(byte *)((longlong)puVar20 + 0xf) & 0x20) != 0) {

+            TRACE_ABORT_FROM_MACRO_FN

+                      ((ushort *)L"TS_MONITOR_LAYOUT_PDU was unexpectedly compressed");

+            uVar7 = 0x9f118459;

+            pCVar11 = (CSP *)WPP_GLOBAL_Control;

+            pCVar25 = local_2a0;

+            goto LAB_2;

+          }

+          if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+             (3 < (byte)pCVar11[0x19])) {

+            uVar6 = RdpX_GetActivityIdPrefix();

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x50,

+                     &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+          }

+          pCVar25 = local_2a0;

+          uVar7 = CTSConnectionHandler::OnMonitorLayoutReceived

+                            (*(CTSConnectionHandler **)(local_2a0 + 0x120),(uchar *)puVar20,uVar23);

+          pCVar11 = (CSP *)WPP_GLOBAL_Control;

+          this = pCVar25;

+          uVar8 = uVar7;

+          if ((int)uVar7 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar6 = RdpX_GetActivityIdPrefix();

+              uVar16 = 0x51;

+              goto LAB_9;

+            }

+            goto LAB_3;

+          }

+        }

+      }

+      else if (uVar13 == 10) {

+        local_2a4 = 0x19;

+        if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+           (3 < (byte)pCVar11[0x19])) {

+          uVar6 = RdpX_GetActivityIdPrefix();

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x53,

+                   &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+        }

+        if (uVar22 < 9) {

+          TRACE_ABORT_FROM_MACRO_FN

+                    ((ushort *)L"Bad TS_SERVER_REDIRECTION_PDU len [expected %u got %u]",9,

+                     (ulonglong)uVar22);

+          uVar7 = 0x9f104480;

+          pCVar11 = (CSP *)WPP_GLOBAL_Control;

+          goto LAB_2;

+        }

+        cVar5 = Feature_MSRC108292_IsEnabled();

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

+          uVar23 = uVar22 - 8;

+        }

+        OnServerRedirectionPacket

+                  (this,(RDP_SERVER_REDIRECTION_PACKET *)(puVar20 + 4),uVar23,&local_27c);

+        pCVar11 = (CSP *)WPP_GLOBAL_Control;

+      }

+      else {

+        local_2a4 = 0x21;

+        if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+           (pCVar11[0x19] != (CSP)0x0)) {

+          WPP_SF_D(*(undefined **)(pCVar11 + 0x10),0x57,

+                   &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,puVar20[1]);

+          pCVar11 = (CSP *)WPP_GLOBAL_Control;

+        }

+      }

+    }

+LAB_5:

+    uVar7 = uVar8;

+    if (local_27c != 0) goto LAB_10;

+    uVar3 = *puVar20;

+    puVar20 = (ushort *)((longlong)puVar20 + (ulonglong)uVar3);

+    param_2 = param_2 - uVar3;

+    if (local_298 <= (uint)((int)puVar20 - (int)local_268)) {

+      if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+         (3 < (byte)pCVar11[0x19])) {

+        uVar10 = RdpX_GetActivityIdPrefix();

+        uVar16 = 0x5c;

+        pCVar11 = (CSP *)WPP_GLOBAL_Control;

+        goto LAB_11;

+      }

+      goto LAB_10;

+    }

+    param_1 = local_268;

+    uVar10 = uVar7;

+    if (puVar20 == (ushort *)0x0) goto LAB_10;

+  }

+  if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+     (3 < (byte)pCVar11[0x19])) {

+    uVar6 = RdpX_GetActivityIdPrefix();

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x58,

+             &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+    pCVar11 = (CSP *)WPP_GLOBAL_Control;

+  }

+  uVar3 = *(ushort *)(param_1 + 2);

+  uVar10 = (uint)uVar3;

+  if (uVar3 == 0x41) {

+    if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+       (3 < (byte)pCVar11[0x19])) {

+      uVar10 = RdpX_GetActivityIdPrefix();

+      uVar16 = 0x59;

+      pCVar11 = (CSP *)WPP_GLOBAL_Control;

+      goto LAB_11;

+    }

+  }

+  else if (uVar3 == 0x42) {

+    if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+       (3 < (byte)pCVar11[0x19])) {

+      uVar10 = RdpX_GetActivityIdPrefix();

+      uVar16 = 0x5a;

+      pCVar11 = (CSP *)WPP_GLOBAL_Control;

+      goto LAB_11;

+    }

+  }

+  else {

+    local_2a4 = 0x21;

+    if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+       (pCVar11[0x19] != (CSP)0x0)) {

+      uVar16 = 0x5b;

+LAB_11:

+      WPP_SF_D(*(undefined **)(pCVar11 + 0x10),uVar16,

+               &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar10);

+      pCVar11 = (CSP *)WPP_GLOBAL_Control;

+    }

+  }

+LAB_10:

+  pCVar25 = this;

+  if ((int)uVar7 < 0) {

+LAB_3:

+    if ((uVar7 & 0x1f000000) == 0x1f000000) {

+LAB_2:

+      if (((pCVar11 != (CSP *)&WPP_GLOBAL_Control) && (((byte)pCVar11[0x1c] & 1) != 0)) &&

+         (1 < (byte)pCVar11[0x19])) {

+        uVar6 = RdpX_GetActivityIdPrefix();

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x5e,

+                  &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+      }

+      plVar4 = *(longlong **)(pCVar25 + 0x38);

+      uVar15 = local_274;

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

+        local_2a0 = (CCO *)0x0;

+        iVar14 = (**(code **)(*plVar4 + 600))(plVar4,&IID_IRdpClientCoreEventLogCallback,&local_2a0)

+        ;

+        if (((iVar14 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+           (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+          uVar6 = RdpX_GetActivityIdPrefix();

+          WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x5f,

+                    &WPP_38dd5cf1bd2d397d4cd8f1d5b4da1445_Traceguids,uVar6);

+        }

+        if (local_2a0 != (CCO *)0x0) {

+          lVar19 = *(longlong *)local_2a0;

+          pCVar18 = local_2a0;

+          puVar20 = GetPacketTypeName(local_2a4);

+          (**(code **)(lVar19 + 0x28))(pCVar18,puVar20);

+        }

+        TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_2a0);

+        uVar15 = local_274;

+      }

+LAB_8:

+      DropLinkImmediate(pCVar25,uVar15);

+    }

+  }

+LAB_1:

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_290);

+  return uVar7;

+}

+
```

## `CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPosDevicesPermissionItem>`  (modified)

```diff
--- CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPosDevicesPermissionItem>
+++ CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPosDevicesPermissionItem>
@@ -1,2 +1,126 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPosDevicesPermissionItem> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* private: long __cdecl CRedirectPromptPermissionCollection::AddPermissionItem<class

+   CRedirectPromptPosDevicesPermissionItem>(struct HINSTANCE__ * __ptr64,class ITSCoreApi *

+   __ptr64,class ITSWin32CoreApi * __ptr64,int,int * __ptr64) __ptr64 */

+

+long __thiscall

+CRedirectPromptPermissionCollection::AddPermissionItem<CRedirectPromptPosDevicesPermissionItem>

+          (CRedirectPromptPermissionCollection *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int *param_5)

+

+{

+  bool bVar1;

+  long lVar2;

+  int iVar3;

+  uint uVar4;

+  CRedirectPromptPosDevicesPermissionItem *pCVar5;

+  void *unaff_retaddr;

+  HINSTANCE__ *local_res10;

+  ITSCoreApi *local_res18;

+  ITSWin32CoreApi *local_res20;

+  int *in_stack_ffffffffffffffd0;

+  CRedirectPromptBasePermissionItem *local_28;

+  CRedirectPromptPosDevicesPermissionItem *local_20;

+  

+  local_res10 = param_1;

+  local_res18 = param_2;

+  local_res20 = param_3;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  local_20 = (CRedirectPromptPosDevicesPermissionItem *)0x0;

+  if (bVar1) {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptPosDevicesPermissionItem,CRedirectPromptPosDevicesPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,(int *)(this + 0x48),

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) {

+LAB_0:

+      pCVar5 = local_20;

+      param_5._0_4_ = 0;

+      lVar2 = CRedirectPromptBasePermissionItem::IsPermissionRequested

+                        ((CRedirectPromptBasePermissionItem *)local_20,(int *)&param_5);

+      if (lVar2 < 0) {

+        wil::details::in1diag3::Return_Hr

+                  (unaff_retaddr,0x36f,

+                   "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+LAB_1:

+      }

+      else {

+        if ((int)param_5 != 0) {

+          local_28 = (CRedirectPromptBasePermissionItem *)0x0;

+          iVar3 = InlineIsEqualGUID(&_GUID_310888d2_4b35_4d91_b5d1_d91f68fd8beb,

+                                    &_GUID_00000000_0000_0000_c000_000000000046);

+          if (iVar3 == 0) {

+            iVar3 = InlineIsEqualGUID();

+            if (iVar3 == 0) {

+              iVar3 = InlineIsEqualGUID();

+              if (iVar3 != 0) {

+                pCVar5 = pCVar5 + 8;

+                goto LAB_2;

+              }

+              lVar2 = -0x7fffbffe;

+            }

+            else {

+LAB_2:

+              lVar2 = 0;

+              local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+              (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+            }

+            if (lVar2 < 0) {

+              wil::details::in1diag3::Return_Hr

+                        (unaff_retaddr,0x379,

+                         "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",lVar2);

+              ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+              goto LAB_1;

+            }

+          }

+          else {

+            local_28 = (CRedirectPromptBasePermissionItem *)pCVar5;

+            (**(code **)(*(longlong *)pCVar5 + 8))(pCVar5);

+          }

+          bVar1 = utl::

+                  vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                  ::push_back((vector<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>,utl::allocator<wil::com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy>_>_>

+                               *)(this + 0x28),

+                              (com_ptr_t<IRedirectPromptPermissionItem,wil::err_returncode_policy> *

+                              )&local_28);

+          if (!bVar1) {

+            lVar2 = -0x7ff8fff2;

+            wil::details::in1diag3::Return_Hr

+                      (unaff_retaddr,0x37a,

+                       "clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",-0x7ff8fff2)

+            ;

+            ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+            goto LAB_3;

+          }

+          g_wasPosDevicesRequested = 1;

+          ATL::_Copy<tagCONNECTDATA>::destroy((tagCONNECTDATA *)&local_28);

+        }

+        lVar2 = 0;

+      }

+      goto LAB_3;

+    }

+    uVar4 = 0x367;

+  }

+  else {

+    lVar2 = Microsoft::WRL::Details::

+            MakeAndInitialize<CRedirectPromptPosDevicesPermissionItem,CRedirectPromptPosDevicesPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>

+                      (&local_20,&local_res10,&local_res18,&local_res20,&param_4,

+                       in_stack_ffffffffffffffd0);

+    if (-1 < lVar2) goto LAB_0;

+    uVar4 = 0x36b;

+  }

+  wil::details::in1diag3::Return_Hr

+            (unaff_retaddr,uVar4,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2vm.cpp",

+             lVar2);

+LAB_3:

+  wil::com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>::

+  ~com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy>

+            ((com_ptr_t<CRedirectPromptPortsPermissionItem,wil::err_returncode_policy> *)&local_20);

+  return lVar2;

+}

+
```

## `W32SCard::AllocateAndChannelWriteReplyPacket`  (modified)

```diff
--- W32SCard::AllocateAndChannelWriteReplyPacket
+++ W32SCard::AllocateAndChannelWriteReplyPacket
@@ -1,2 +1,63 @@
-Failed to decompile mstscax.dll - .ProgramDB W32SCard::AllocateAndChannelWriteReplyPacket : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: void __cdecl W32SCard::AllocateAndChannelWriteReplyPacket(struct

+   tagRDPDR_IOREQUEST_PACKET * __ptr64,char * __ptr64,unsigned long) __ptr64 */

+

+void __thiscall

+W32SCard::AllocateAndChannelWriteReplyPacket

+          (W32SCard *this,tagRDPDR_IOREQUEST_PACKET *param_1,char *param_2,ulong param_3)

+

+{

+  tagRDPDR_IOCOMPLETION_PACKET *ptVar1;

+  bool bVar2;

+  long lVar3;

+  ulong local_res8 [2];

+  tagRDPDR_IOCOMPLETION_PACKET *local_28 [2];

+  

+  local_28[0] = (tagRDPDR_IOCOMPLETION_PACKET *)0x0;

+  local_res8[0] = 0;

+  bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_1480569144> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1480569144>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar2) {

+    EnterCriticalSection((LPCRITICAL_SECTION)(this + 0x2d0));

+  }

+  if ((*(int *)(this + 800) != 0) || (*(int *)(this + 0x324) != 0)) {

+    bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_1480569144> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1480569144>::GetImpl(void)'

+                        ::__l2::impl);

+    if (bVar2) {

+      LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x2d0));

+    }

+    operator_delete(param_1);

+    return;

+  }

+  if (*(uint *)(param_1 + 0x18) < param_3) {

+    lVar3 = -0x3fffffdd;

+  }

+  else {

+    lVar3 = DrUTL_AllocateReplyBuf(param_1,local_28,local_res8);

+    ptVar1 = local_28[0];

+    if (lVar3 == 0) {

+      memcpy(local_28[0] + 0x14,param_2,(ulonglong)param_3);

+      *(ulong *)(ptVar1 + 0x10) = param_3;

+      *(undefined4 *)(ptVar1 + 0xc) = 0;

+      VCManager::ChannelWrite

+                (*(VCManager **)(*(longlong *)(this + 0x38) + 0xe0),ptVar1,param_3 + 0x14);

+      operator_delete(param_1);

+      goto LAB_0;

+    }

+  }

+  DefaultIORequestMsgHandleWrapper(this,param_1,lVar3);

+LAB_0:

+  bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_1480569144> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1480569144>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar2) {

+    LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x2d0));

+  }

+  return;

+}

+
```

## `W32SCard::DefaultIORequestMsgHandleWrapper`  (modified)

```diff
--- W32SCard::DefaultIORequestMsgHandleWrapper
+++ W32SCard::DefaultIORequestMsgHandleWrapper
@@ -1,2 +1,34 @@
-Failed to decompile mstscax.dll - .ProgramDB W32SCard::DefaultIORequestMsgHandleWrapper : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: void __cdecl W32SCard::DefaultIORequestMsgHandleWrapper(struct

+   tagRDPDR_IOREQUEST_PACKET * __ptr64,long) __ptr64 */

+

+void __thiscall

+W32SCard::DefaultIORequestMsgHandleWrapper

+          (W32SCard *this,tagRDPDR_IOREQUEST_PACKET *param_1,long param_2)

+

+{

+  bool bVar1;

+  

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_1480569144> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1480569144>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar1) {

+    EnterCriticalSection((LPCRITICAL_SECTION)(this + 0x2d0));

+  }

+  if ((*(int *)(this + 800) == 0) && (*(int *)(this + 0x324) == 0)) {

+    DrDevice::DefaultIORequestMsgHandle((DrDevice *)this,param_1,param_2);

+  }

+  else {

+    operator_delete(param_1);

+  }

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_1480569144> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1480569144>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar1) {

+    LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x2d0));

+  }

+  return;

+}

+
```

## `CSecFilterServer::DoHandshake`  (modified)

```diff
--- CSecFilterServer::DoHandshake
+++ CSecFilterServer::DoHandshake
@@ -1,2 +1,124 @@
-Failed to decompile mstscax.dll - .ProgramDB CSecFilterServer::DoHandshake : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

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

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: virtual enum _XResult32 __cdecl CSecFilterServer::DoHandshake(unsigned char *

+   __ptr64,unsigned int,unsigned char * __ptr64 * __ptr64,unsigned int * __ptr64,enum _XBool32 *

+   __ptr64,unsigned int * __ptr64) __ptr64 */

+

+_XResult32 __thiscall

+CSecFilterServer::DoHandshake

+          (CSecFilterServer *this,uchar *param_1,uint param_2,uchar **param_3,uint *param_4,

+          _XBool32 *param_5,uint *param_6)

+

+{

+  CSecurityFilter *this_00;

+  wchar_t *_Str1;

+  bool bVar1;

+  char cVar2;

+  _XResult32 _Var3;

+  undefined4 uVar4;

+  long lVar5;

+  int iVar6;

+  _GUID *p_Var7;

+  _tlgProvider_t *p_Var8;

+  longlong lVar9;

+  _GUID *p_Var10;

+  _GUID *p_Var11;

+  undefined1 auStackY_f8 [32];

+  _GUID local_98;

+  undefined8 *local_88;

+  wchar_t *local_80;

+  char *local_78;

+  char *local_70;

+  undefined8 local_68;

+  char *local_60 [2];

+  undefined8 local_50;

+  undefined8 uStack_48;

+  ulonglong local_40;

+  

+  local_40 = __security_cookie ^ (ulonglong)auStackY_f8;

+  this_00 = (CSecurityFilter *)(this + 8);

+  p_Var11 = (_GUID *)param_3;

+  _Var3 = CSecurityFilter::DoHandshake(this_00,param_1,param_2,param_3,param_4,param_5,param_6);

+  if (_Var3 != 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x44] & 0x20) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x41])) {

+      uVar4 = RdpX_GetActivityIdPrefix();

+      WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x38),0x22,

+                 &WPP_bcf6cbb121023be29bda4ddf912d8228_Traceguids,uVar4);

+    }

+    if (*param_3 != (uchar *)0x0) {

+      return _Var3;

+    }

+    lVar5 = MapXResultToHR(_Var3);

+    CSecurityFilter::GenerateErrorMessage(this_00,lVar5,param_3,param_4);

+    return _Var3;

+  }

+  bVar1 = wil::details::

+          FeatureImpl<__WilFeatureTraits_Feature_AuthenticationPackageUtilizationTelemetry>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_AuthenticationPackageUtilizationTelemetry>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_AuthenticationPackageUtilizationTelemetry>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_AuthenticationPackageUtilizationTelemetry>::GetImpl(void)'

+                                  ::__l2::impl);

+  if (!bVar1) {

+    return 0;

+  }

+  if (*param_5 != 0) {

+    local_98.Data1 = 0;

+    local_98.Data2 = 0;

+    local_98.Data3 = 0;

+    p_Var10 = &local_98;

+    _Var3 = CSecurityFilter::QueryContextAttributesW(this_00,10,p_Var10);

+    if (_Var3 == 0) {

+      lVar9 = local_98._0_8_;

+      if (local_98._0_8_ != 0) {

+        p_Var7 = RdpActivityId::GetCurrentActivityId((_GUID *)local_60);

+        lVar9 = local_98._0_8_;

+        uVar4._0_1_ = '\0';

+        uVar4._1_1_ = '\0';

+        uVar4._2_1_ = '\0';

+        uVar4._3_1_ = '\0';

+        local_50._0_4_ = p_Var7->Data1;

+        local_50._4_2_ = p_Var7->Data2;

+        local_50._6_2_ = p_Var7->Data3;

+        uStack_48 = *(undefined8 *)p_Var7->Data4;

+        _Str1 = *(wchar_t **)(local_98._0_8_ + 0x10);

+        iVar6 = wcscmp(_Str1,L"NTLM");

+        if (((iVar6 == 0) ||

+            (iVar6 = wcscmp(_Str1,L"MICROSOFT_AUTHENTICATION_PACKAGE_V1_0"), iVar6 == 0)) ||

+           (iVar6 = wcscmp(_Str1,L"MSV1_0"), iVar6 == 0)) {

+          uVar4._0_1_ = '\x01';

+          uVar4._1_1_ = '\0';

+          uVar4._2_1_ = '\0';

+          uVar4._3_1_ = '\0';

+        }

+        if (4 < DAT_0) {

+          p_Var8 = (_tlgProvider_t *)&DAT_0;

+          cVar2 = _tlgKeywordOn(&DAT_0,0x470000000000);

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

+            local_88 = &local_50;

+            local_78 = "Authentication";

+            local_70 = "Stack";

+            local_60[0] = "Checkpoint";

+            local_68 = 0x1000000;

+            local_98.Data4._0_4_ = uVar4;

+            local_80 = _Str1;

+            _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_EventWriteTransfer(struct__tlgProvider_t_const*___ptr64,void_const*___ptr64,struct__GUID_const*___ptr64,struct__GUID_const*___ptr64,unsigned_int,struct__EVENT_DATA_DESCRIPTOR*___ptr64),_GUID_const*___ptr64,_GUID_const*___ptr64>

+            ::

+            Write<_tlgWrapSz<char>,_tlgWrapperByVal<8>,_tlgWrapSz<char>,_tlgWrapSz<char>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapperByRef<16>_>

+                      (p_Var8,&DAT_1,p_Var10,p_Var11,(_tlgWrapSz<char> *)local_60,

+                       (_tlgWrapperByVal<8> *)&local_68,(_tlgWrapSz<char> *)&local_70,

+                       (_tlgWrapSz<char> *)&local_78,(_tlgWrapSz<unsigned_short> *)&local_80,

+                       (_tlgWrapperByVal<4> *)local_98.Data4,(_tlgWrapperByRef<16> *)&local_88);

+            lVar9 = local_98._0_8_;

+          }

+        }

+      }

+      (**(code **)(this + 0x98))(lVar9);

+      return 0;

+    }

+    return 0;

+  }

+  return 0;

+}

+
```

## `RdpWinDesktopRemoteAppUIManager::RdpWinDesktopRemoteAppUIManager`  (modified)

```diff
--- RdpWinDesktopRemoteAppUIManager::RdpWinDesktopRemoteAppUIManager
+++ RdpWinDesktopRemoteAppUIManager::RdpWinDesktopRemoteAppUIManager
@@ -1,2 +1,151 @@
-Failed to decompile mstscax.dll - .ProgramDB RdpWinDesktopRemoteAppUIManager::RdpWinDesktopRemoteAppUIManager : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: __cdecl RdpWinDesktopRemoteAppUIManager::RdpWinDesktopRemoteAppUIManager(void) __ptr64 */

+

+RdpWinDesktopRemoteAppUIManager * __thiscall

+RdpWinDesktopRemoteAppUIManager::RdpWinDesktopRemoteAppUIManager

+          (RdpWinDesktopRemoteAppUIManager *this)

+

+{

+  RdpWinDesktopRemoteAppUIManager *pRVar1;

+  uint uVar2;

+  

+  *(undefined ***)this = &ITSPropertySet::_vftable_;

+  *(undefined ***)(this + 8) = &RdpXInterfaceRemoteAppUIManager::_vftable_;

+  *(undefined ***)(this + 0x10) = &IXPSPrintJob::_vftable_;

+  *(undefined ***)(this + 0x18) = &IAAMsgOpEvent::_vftable_;

+  *(undefined ***)(this + 0x20) = &IAAMsgOpEvent::_vftable_;

+  *(undefined ***)(this + 0x28) = &IAAMsgOpEvent::_vftable_;

+  pRVar1 = this + 0x30;

+  *(undefined4 *)(this + 0x48) = 0xdbcaabcd;

+  *(char **)(this + 0x40) = "RdpWinDesktopRemoteAppUIManager";

+  *(undefined ***)pRVar1 = CTSUnknown::vftable_for_INonDelegatingUnknown_;

+  *(undefined ***)(this + 0x38) = CTSUnknown::vftable_for_CTSObject_;

+  *(undefined4 *)(this + 0x4c) = 1;

+  *(undefined4 *)(this + 0x58) = 0;

+  *(RdpWinDesktopRemoteAppUIManager **)(this + 0x50) = pRVar1;

+  *(undefined ***)this = &_vftable__for__RdpXInterfaceDesktopRemoteAppCore__;

+  *(undefined ***)(this + 8) = &_vftable__for__RdpXInterfaceRemoteAppUIManager__;

+  *(undefined ***)(this + 0x10) = &_vftable__for__RdpXInterfaceDesktopRemoteAppLanguageSync__;

+  *(undefined ***)(this + 0x18) = &_vftable__for__RdpXInterfaceUIOutputMapManager__;

+  *(undefined ***)(this + 0x20) = &_vftable__for__RdpXInterfaceRemoteAppWindowGraphicsCapture__;

+  *(undefined ***)(this + 0x28) = &_vftable__for__RdpXInterfaceOutputMapManagerInternal__;

+  *(undefined ***)pRVar1 = &CBasePlayer::_vftable__for__INonDelegatingUnknown__;

+  *(undefined ***)(this + 0x38) = &_vftable__for__CTSObject__;

+  *(undefined ***)(this + 0x60) = &OnRequestPresenterBoundsUpdateAsyncTerminatingCallback::_vftable_

+  ;

+  *(undefined ***)(this + 0x68) = &OnRequestPresentAsyncTerminatingCallback::_vftable_;

+  *(undefined ***)(this + 0x70) = &OnRequestResendAsyncTerminatingCallback::_vftable_;

+  *(undefined ***)(this + 0x78) = &OnUiaRegistrationRequestedAsyncTerminatingCallback::_vftable_;

+  *(RdpWinDesktopRemoteAppUIManager **)(this + 0x90) = this + 0xa0;

+  *(undefined4 *)(this + 0x80) = 0x62;

+  *(undefined4 *)(this + 0x84) = 3;

+  *(undefined4 *)(this + 0x88) = 2;

+  *(undefined8 *)(this + 0x98) = 0;

+  *(undefined ***)(this + 0xa0) =

+       &OnExternalWindowListenerChangedAsyncTerminatingCallback::_vftable_;

+  *(undefined ***)(this + 0x140) =

+       &RdpXArray<RdpXInterfaceRemoteAppWindow*___ptr64,16,4294967294>::_vftable_;

+  *(undefined8 *)(this + 0xa8) = 0;

+  *(undefined8 *)(this + 0xb0) = 0;

+  *(undefined8 *)(this + 0xb8) = 0;

+  *(undefined8 *)(this + 0xc0) = 0;

+  *(undefined8 *)(this + 200) = 0;

+  *(undefined8 *)(this + 0xd0) = 0;

+  *(undefined8 *)(this + 0xd8) = 0;

+  *(undefined8 *)(this + 0xe0) = 0;

+  *(undefined8 *)(this + 0xe8) = 0;

+  *(undefined8 *)(this + 0xf0) = 0;

+  *(undefined8 *)(this + 0xf8) = 0;

+  *(undefined8 *)(this + 0x100) = 0;

+  *(undefined8 *)(this + 0x108) = 0;

+  *(undefined8 *)(this + 0x110) = 0;

+  *(undefined8 *)(this + 0x118) = 0;

+  *(undefined8 *)(this + 0x120) = 0;

+  *(undefined8 *)(this + 0x128) = 0;

+  *(undefined8 *)(this + 0x130) = 0;

+  *(undefined8 *)(this + 0x138) = 0;

+  *(undefined4 *)(this + 0x148) = 0;

+  *(undefined8 *)(this + 0x150) = 0;

+  *(undefined8 *)(this + 0x158) = 0;

+  *(undefined ***)(this + 0x140) =

+       &RdpXSPtrArray<RdpWinDesktopRemoteAppWindow,16,4294967294>::_vftable_;

+  pRVar1 = this + 0x160;

+  *(RdpWinDesktopRemoteAppUIManager **)pRVar1 = pRVar1;

+  *(RdpWinDesktopRemoteAppUIManager **)(this + 0x168) = pRVar1;

+  *(RdpWinDesktopRemoteAppUIManager **)(this + 0x170) = pRVar1;

+  *(undefined8 *)(this + 0x178) = 0;

+  pRVar1 = this + 0x180;

+  *(RdpWinDesktopRemoteAppUIManager **)pRVar1 = pRVar1;

+  *(RdpWinDesktopRemoteAppUIManager **)(this + 0x188) = pRVar1;

+  *(RdpWinDesktopRemoteAppUIManager **)(this + 400) = pRVar1;

+  *(undefined8 *)(this + 0x198) = 0;

+  *(undefined8 *)(this + 0x1a0) = 0;

+  *(undefined8 *)(this + 0x1a8) = 0;

+  *(undefined8 *)(this + 0x1b0) = 0;

+  *(undefined8 *)(this + 0x1c0) = 0;

+  *(undefined4 *)(this + 0x1e0) = 0;

+  *(undefined8 *)(this + 0x1e8) = 0;

+  *(undefined8 *)(this + 0x1b8) = 0;

+  *(undefined8 *)(this + 0x1c8) = 0;

+  *(undefined8 *)(this + 0x1d0) = 0;

+  *(undefined4 *)(this + 0x1d8) = 0;

+  *(undefined8 *)(this + 0x1f0) = 0;

+  *(undefined4 *)(this + 0x218) = 0;

+  *(undefined8 *)(this + 0x220) = 0;

+  *(undefined8 *)(this + 0x228) = 0;

+  *(undefined8 *)(this + 0x1f8) = 0;

+  *(undefined8 *)(this + 0x200) = 0;

+  *(undefined2 *)(this + 0x230) = 0;

+  *(undefined4 *)(this + 0x440) = 0;

+  *(undefined8 *)(this + 0x448) = 0;

+  TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+            ((TCntPtr<IRdpProgressiveDecompressorEx> *)(this + 0x448));

+  *(undefined8 *)(this + 0x4e8) = 0xffffffffffffffff;

+  *(undefined ***)(this + 0x498) = &RdpXArrayMap<unsigned_int,_GUID>::_vftable_;

+  *(undefined8 *)(this + 0x450) = 0;

+  *(undefined ***)(this + 0x4a8) =

+       &RdpXArray<RdpXInterfaceRemoteAppWindow*___ptr64,16,4294967294>::_vftable_;

+  *(undefined8 *)(this + 0x458) = 0;

+  *(undefined4 *)(this + 0x468) = 0;

+  *(undefined8 *)(this + 0x460) = 0;

+  *(undefined8 *)(this + 0x470) = 0;

+  *(undefined4 *)(this + 0x478) = 0;

+  *(undefined8 *)(this + 0x480) = 0;

+  *(undefined8 *)(this + 0x488) = 0;

+  *(undefined8 *)(this + 0x490) = 0;

+  *(undefined ***)(this + 0x4a8) =

+       &RdpXSPtrArray<RdpXPlatKeyValuePair<unsigned_int,_GUID>,16,4294967294>::_vftable_;

+  *(undefined4 *)(this + 0x4a0) = 0;

+  *(undefined4 *)(this + 0x4b0) = 0;

+  *(undefined8 *)(this + 0x4b8) = 0;

+  *(undefined8 *)(this + 0x4c0) = 0;

+  *(undefined4 *)(this + 0x4f0) = 0;

+  *(undefined8 *)(this + 0x4f4) = 0;

+  *(undefined8 *)(this + 0x4fc) = 0;

+  *(undefined8 *)(this + 0x508) = 0;

+  *(undefined8 *)(this + 0x510) = 0;

+  *(undefined8 *)(this + 0x518) = 0;

+  *(undefined8 *)(this + 0x520) = 0;

+  *(undefined8 *)(this + 0x528) = 0;

+  *(undefined8 *)(this + 0x530) = 0;

+  pRVar1 = this + 0x548;

+  *(undefined8 *)(this + 0x538) = 0;

+  *(undefined8 *)(this + 0x540) = 0;

+  *(RdpWinDesktopRemoteAppUIManager **)pRVar1 = pRVar1;

+  *(RdpWinDesktopRemoteAppUIManager **)(this + 0x550) = pRVar1;

+  *(undefined8 *)(this + 0x558) = 0;

+  *(undefined8 *)(this + 0x560) = 0;

+  RemoteAppPrivateApisHelpers::RemoteAppPrivateApisHelpers

+            ((RemoteAppPrivateApisHelpers *)(this + 0x568));

+  *(undefined8 *)(this + 0x598) = 0;

+  *(undefined8 *)(this + 0x5a0) = 0;

+  *(undefined8 *)(this + 0x5a8) = 0;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 0x40) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),10,

+             &WPP_143b3bf0062435bde5aab794eeedcfbb_Traceguids,uVar2);

+  }

+  return this;

+}

+
```

## `CRedirectPromptDlg2::AllowConnection`  (modified)

```diff
--- CRedirectPromptDlg2::AllowConnection
+++ CRedirectPromptDlg2::AllowConnection
@@ -1,2 +1,64 @@
-Failed to decompile mstscax.dll - .ProgramDB CRedirectPromptDlg2::AllowConnection : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: virtual int __cdecl CRedirectPromptDlg2::AllowConnection(void) __ptr64 */

+

+int __thiscall CRedirectPromptDlg2::AllowConnection(CRedirectPromptDlg2 *this)

+

+{

+  bool bVar1;

+  int iVar2;

+  int iVar3;

+  HWND__ *pHVar4;

+  void *unaff_retaddr;

+  int local_res8 [2];

+  CRedirectPromptDlg2View local_98 [144];

+  

+  local_res8[0] = 1;

+  iVar2 = (**(code **)(**(longlong **)(this + 0x28) + 0x18))(*(longlong **)(this + 0x28),local_res8)

+  ;

+  pHVar4 = (HWND__ *)0x0;

+  if ((-1 < iVar2) && (local_res8[0] == 0)) {

+    return 1;

+  }

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                                  ::__l2::impl);

+  if (((bVar1) && (*(longlong **)(this + 0x20) != (longlong *)0x0)) &&

+     (iVar2 = (**(code **)(**(longlong **)(this + 0x20) + 0x78))(), iVar2 < 0)) {

+    wil::details::in1diag3::_Log_Hr

+              (unaff_retaddr,0x7d,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2.cpp",

+               iVar2);

+  }

+  else {

+    bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+            ::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                        ::__l2::impl);

+    if (bVar1) {

+      pHVar4 = (HWND__ *)(**(code **)(**(longlong **)(this + 0x18) + 0x140))();

+    }

+    CRedirectPromptDlg2View::CRedirectPromptDlg2View

+              (local_98,pHVar4,*(HINSTANCE__ **)(this + 0x10),

+               *(IRedirectPromptDlg2ViewModel **)(this + 0x28));

+    iVar2 = CDlgBase::DoModal((CDlgBase *)local_98);

+    bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>

+            ::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetImpl(void)'

+                        ::__l2::impl);

+    if (((!bVar1) || (*(longlong **)(this + 0x20) == (longlong *)0x0)) ||

+       (iVar3 = (**(code **)(**(longlong **)(this + 0x20) + 0x80))(), -1 < iVar3)) {

+      CRedirectPromptDlg2View::~CRedirectPromptDlg2View(local_98);

+      return (uint)(iVar2 == 1);

+    }

+    wil::details::in1diag3::_Log_Hr

+              (unaff_retaddr,0x8e,"clientcore\\termsrv\\client\\core\\win32core\\rdrwrndlg2.cpp",

+               iVar3);

+    CRedirectPromptDlg2View::~CRedirectPromptDlg2View(local_98);

+  }

+  return 0;

+}

+
```

## `RdpWin32RemoteAppPresenter::Terminate`  (modified)

```diff
--- RdpWin32RemoteAppPresenter::Terminate
+++ RdpWin32RemoteAppPresenter::Terminate
@@ -1,2 +1,42 @@
-Failed to decompile mstscax.dll - .ProgramDB RdpWin32RemoteAppPresenter::Terminate : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: virtual long __cdecl RdpWin32RemoteAppPresenter::Terminate(void) __ptr64 */

+

+long __thiscall RdpWin32RemoteAppPresenter::Terminate(RdpWin32RemoteAppPresenter *this)

+

+{

+  RdpWin32RemoteAppPresenter *this_00;

+  TCntPtr<ITSThread> *this_01;

+  longlong *plVar1;

+  bool bVar2;

+  CTSCriticalSection *local_res8;

+  

+  local_res8 = (CTSCriticalSection *)(this + 0x30);

+  CTSCriticalSection::Lock(local_res8);

+  this_01 = (TCntPtr<ITSThread> *)(this + 0x170);

+  if (*(longlong *)this_01 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(this_01);

+    *(undefined8 *)this_01 = 0;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)this_01);

+  }

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res8);

+  this_00 = this + -0x10;

+  DiscardGDIResources(this_00);

+  DiscardDeviceResources(this_00);

+  (**(code **)(*(longlong *)this_00 + 0x68))(this_00);

+  bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::GetImpl(void)'

+                                  ::__l2::impl);

+  if ((!bVar2) && (plVar1 = *(longlong **)(this + 0x150), plVar1 != (longlong *)0x0)) {

+    (**(code **)(*plVar1 + 0x18))(plVar1,*(undefined4 *)(this + 0x40));

+  }

+  if (*(LPCVOID *)(this + 0x88) != (LPCVOID)0x0) {

+    UnmapViewOfFile(*(LPCVOID *)(this + 0x88));

+  }

+  *(uint *)(this + 0x14) = *(uint *)(this + 0x14) | 4;

+  return 0;

+}

+
```

## `CRdrServerRequestHandler::DoCapabilities`  (modified)

```diff
--- CRdrServerRequestHandler::DoCapabilities
+++ CRdrServerRequestHandler::DoCapabilities
@@ -1,2 +1,74 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdrServerRequestHandler::DoCapabilities : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: long __cdecl CRdrServerRequestHandler::DoCapabilities(unsigned char * __ptr64,unsigned

+   long) __ptr64 */

+

+long __thiscall

+CRdrServerRequestHandler::DoCapabilities

+          (CRdrServerRequestHandler *this,uchar *param_1,ulong param_2)

+

+{

+  ushort uVar1;

+  bool bVar2;

+  int iVar3;

+  uint uVar4;

+  longlong *plVar5;

+  uint local_res20;

+  undefined2 local_res24;

+  longlong *local_18;

+  CTSCriticalSection *local_10;

+  

+  plVar5 = (longlong *)0x0;

+  local_18 = (longlong *)0x0;

+  if (param_2 < 10) {

+    iVar3 = -0x7fff0001;

+    goto LAB_0;

+  }

+  uVar1 = *(ushort *)(param_1 + 8);

+  *(uint *)(this + 0x90) = (uint)uVar1;

+  *(uint *)(*(longlong *)(this + 0x98) + 0x48) = (uint)uVar1;

+  local_res20 = *(uint *)param_1 & 0xffffff;

+  local_res24 = 6;

+  bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_4198753594> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_4198753594>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar2) {

+    local_10 = (CTSCriticalSection *)(this + 0x80);

+    CTSCriticalSection::Lock(local_10);

+    if (*(longlong *)(this + 0x50) != 0) {

+      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_18);

+      plVar5 = *(longlong **)(this + 0x50);

+      local_18 = plVar5;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_18);

+    }

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_10);

+LAB_1:

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

+      iVar3 = (**(code **)(*plVar5 + 0x18))(plVar5,6,&local_res20,0);

+      if ((((iVar3 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1a,

+                   &WPP_f26f1544384632a256a4da45cfc15c0a_Traceguids,uVar4,"Channel->Write failed",

+                   iVar3);

+      }

+      goto LAB_0;

+    }

+  }

+  else if (*(longlong *)(this + 0x50) != 0) {

+    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_18);

+    plVar5 = *(longlong **)(this + 0x50);

+    local_18 = plVar5;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_18);

+    goto LAB_1;

+  }

+  iVar3 = 0;

+LAB_0:

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_18);

+  return iVar3;

+}

+
```

## `CIH::AddQoeTimeStampEvent`  (modified)

```diff
--- CIH::AddQoeTimeStampEvent
+++ CIH::AddQoeTimeStampEvent
@@ -1,2 +1,95 @@
-Failed to decompile mstscax.dll - .ProgramDB CIH::AddQoeTimeStampEvent : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl CIH::AddQoeTimeStampEvent(void) __ptr64 */

+

+long __thiscall CIH::AddQoeTimeStampEvent(CIH *this)

+

+{

+  longlong lVar1;

+  char cVar2;

+  int iVar3;

+  undefined4 uVar4;

+  longlong lVar5;

+  ulonglong uVar6;

+  undefined8 uVar7;

+  long lVar8;

+  CIH *pCVar9;

+  undefined4 local_res8 [2];

+  CTSCriticalSection *local_res10;

+  

+  lVar8 = -0x7fffbffb;

+  iVar3 = IsEnabled(this + 0x30);

+  if (iVar3 == 0) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return -0x7fffbffb;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return -0x7fffbffb;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 4) {

+      return -0x7fffbffb;

+    }

+    uVar4 = RdpX_GetActivityIdPrefix();

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x38,

+             &WPP_1c30b51fc4083f89a2c4652859aa9177_Traceguids,uVar4);

+    return -0x7fffbffb;

+  }

+  local_res10 = (CTSCriticalSection *)(this + 0x78);

+  CTSCriticalSection::Lock(local_res10);

+  pCVar9 = this + 0x48;

+  cVar2 = FeatureMsrc108622();

+  if ((cVar2 == '\0') || (*(longlong *)pCVar9 != 0)) {

+    if (*(uint *)(this + 0x50) <= (uint)*(ushort *)(*(longlong *)pCVar9 + 0x12)) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (2 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpX_GetActivityIdPrefix();

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3a,

+                 &WPP_1c30b51fc4083f89a2c4652859aa9177_Traceguids,uVar4);

+      }

+      goto LAB_0;

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpX_GetActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3b,

+               &WPP_1c30b51fc4083f89a2c4652859aa9177_Traceguids,uVar4);

+    }

+    cVar2 = FeatureMsrc108622();

+    if ((cVar2 != '\0') || (*(longlong *)pCVar9 != 0)) {

+      pCVar9 = this + 0x48;

+      lVar5 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+      lVar1 = *(longlong *)pCVar9;

+      uVar6 = (ulonglong)*(ushort *)(lVar1 + 0x12);

+      local_res8[0] = 0;

+      *(undefined8 *)(lVar1 + 0x16 + uVar6 * 0xc) = 0;

+      *(undefined4 *)(lVar1 + 0x1e + uVar6 * 0xc) = 0;

+      *(undefined2 *)(lVar1 + 0x1a + uVar6 * 0xc) = 0xa0;

+      PAL_System_TimeGetTickCount(local_res8);

+      *(undefined4 *)(lVar1 + 0x16 + uVar6 * 0xc) = local_res8[0];

+      *(int *)(lVar1 + 0x1c + uVar6 * 0xc) = (int)(lVar5 / 10000);

+      *(short *)(*(longlong *)pCVar9 + 0x12) = *(short *)(*(longlong *)pCVar9 + 0x12) + 1;

+      **(short **)pCVar9 = **(short **)pCVar9 + 0xc;

+      *(short *)(*(longlong *)pCVar9 + 0xc) = *(short *)(*(longlong *)pCVar9 + 0xc) + 0xc;

+      CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res10);

+      return 0;

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpX_GetActivityIdPrefix();

+      uVar7 = 0x3c;

+      goto LAB_1;

+    }

+  }

+  else if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+           ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar4 = RdpX_GetActivityIdPrefix();

+    uVar7 = 0x39;

+LAB_1:

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar7,

+             &WPP_1c30b51fc4083f89a2c4652859aa9177_Traceguids,uVar4);

+  }

+  lVar8 = 1;

+LAB_0:

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res10);

+  return lVar8;

+}

+
```

## `DrPRN::UpdatePrinterNameInCacheData`  (modified)

```diff
--- DrPRN::UpdatePrinterNameInCacheData
+++ DrPRN::UpdatePrinterNameInCacheData
@@ -1,2 +1,70 @@
-Failed to decompile mstscax.dll - .ProgramDB DrPRN::UpdatePrinterNameInCacheData : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: static unsigned long __cdecl DrPRN::UpdatePrinterNameInCacheData(unsigned char *

+   __ptr64 * __ptr64,unsigned long * __ptr64,unsigned char * __ptr64,unsigned long) */

+

+ulong __cdecl

+DrPRN::UpdatePrinterNameInCacheData(uchar **param_1,ulong *param_2,uchar *param_3,ulong param_4)

+

+{

+  uint uVar1;

+  int iVar2;

+  int iVar3;

+  uchar *_Src;

+  bool bVar4;

+  uchar *_Dst;

+  uint uVar5;

+  uint uVar6;

+  

+  uVar1 = *param_2;

+  bVar4 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_1252772153> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1252772153>::GetImpl(void)'

+                      ::__l2::impl);

+  if ((bVar4) && (uVar1 < 0x18)) {

+    return 0xd;

+  }

+  _Src = *param_1;

+  if ((*(uint *)(_Src + 0x10) <= uVar1) &&

+     (uVar6 = (uVar1 - *(int *)(_Src + 0x10)) + param_4, param_4 <= uVar6)) {

+    bVar4 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_1252772153> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1252772153>::GetImpl(void)'

+                        ::__l2::impl);

+    if (bVar4) {

+      uVar5 = *(int *)(_Src + 0x14) + *(int *)(_Src + 0x10);

+      if (uVar5 < *(uint *)(_Src + 0x10)) {

+        return 0x216;

+      }

+      if (uVar1 < uVar5) {

+        return 0x216;

+      }

+      bVar4 = uVar1 - uVar5 < 0x18;

+    }

+    else {

+      uVar5 = *(int *)(_Src + 0x14) + *(uint *)(_Src + 0x10);

+      if (uVar1 < uVar5) {

+        return 0x216;

+      }

+      bVar4 = uVar5 < *(uint *)(_Src + 0x10);

+    }

+    if (!bVar4) {

+      _Dst = operator_new((ulonglong)uVar6);

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

+        memcpy(_Dst,_Src,(ulonglong)((uVar1 - *(int *)(_Src + 0x10)) - *(int *)(_Src + 0x14)));

+        iVar2 = *(int *)(_Src + 0x10);

+        iVar3 = *(int *)(_Src + 0x14);

+        memcpy(_Dst + ((uVar1 - iVar2) - iVar3),param_3,(ulonglong)param_4);

+        memcpy(_Dst + ((uVar1 - iVar2) - iVar3) + param_4,_Src + (uVar1 - *(uint *)(_Src + 0x14)),

+               (ulonglong)*(uint *)(_Src + 0x14));

+        *(ulong *)(_Dst + 0x10) = param_4;

+        *param_1 = _Dst;

+        *param_2 = uVar6;

+        operator_delete(_Src);

+        return 0;

+      }

+      return 8;

+    }

+  }

+  return 0x216;

+}

+
```

## `CRdrServerRequestHandler::DoCreateFileRedirector`  (modified)

```diff
--- CRdrServerRequestHandler::DoCreateFileRedirector
+++ CRdrServerRequestHandler::DoCreateFileRedirector
@@ -1,2 +1,91 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdrServerRequestHandler::DoCreateFileRedirector : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: long __cdecl CRdrServerRequestHandler::DoCreateFileRedirector(unsigned char *

+   __ptr64,unsigned long) __ptr64 */

+

+long __thiscall

+CRdrServerRequestHandler::DoCreateFileRedirector

+          (CRdrServerRequestHandler *this,uchar *param_1,ulong param_2)

+

+{

+  bool bVar1;

+  int iVar2;

+  uint uVar3;

+  undefined8 uVar4;

+  longlong *plVar5;

+  ulonglong uVar6;

+  longlong *local_res20;

+  CTSCriticalSection *local_28 [2];

+  

+  plVar5 = (longlong *)0x0;

+  uVar6 = 0;

+  local_res20 = (longlong *)0x0;

+  if (param_2 < 0x1c) {

+LAB_0:

+    iVar2 = -0x7fff0001;

+  }

+  else {

+    if (*(uint *)(this + 0x90) < 5) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x17,

+                 &WPP_f26f1544384632a256a4da45cfc15c0a_Traceguids,uVar3);

+        uVar6 = 0;

+      }

+    }

+    else {

+      uVar6 = -(ulonglong)(this != (CRdrServerRequestHandler *)0x0) & (ulonglong)(this + 0x10);

+    }

+    bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_4198753594> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_4198753594>::GetImpl(void)'

+                        ::__l2::impl);

+    if (bVar1) {

+      local_28[0] = (CTSCriticalSection *)(this + 0x80);

+      CTSCriticalSection::Lock(local_28[0]);

+      if (*(longlong *)(this + 0x58) != 0) {

+        TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+        plVar5 = *(longlong **)(this + 0x58);

+        local_res20 = plVar5;

+        TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                  ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_res20);

+      }

+      CTSAutoLock::~CTSAutoLock((CTSAutoLock *)local_28);

+      if (plVar5 == (longlong *)0x0) goto LAB_0;

+      iVar2 = (**(code **)(*plVar5 + 0x18))

+                        (plVar5,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc),

+                         *(undefined4 *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x14),

+                         *(undefined4 *)(param_1 + 0x18),*(uint *)param_1 & 0xffffff,

+                         -(ulonglong)(this != (CRdrServerRequestHandler *)0x0) &

+                         (ulonglong)(this + 8),uVar6);

+      if (((-1 < iVar2) || ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control)) ||

+         (((WPP_GLOBAL_Control[0x1c] & 8) == 0 || ((byte)WPP_GLOBAL_Control[0x19] < 2))))

+      goto LAB_1;

+      uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar4 = 0x18;

+    }

+    else {

+      iVar2 = (**(code **)(**(longlong **)(this + 0x58) + 0x18))

+                        (*(longlong **)(this + 0x58),*(undefined4 *)(param_1 + 8),

+                         *(undefined4 *)(param_1 + 0xc),*(undefined4 *)(param_1 + 0x10),

+                         *(undefined4 *)(param_1 + 0x14),*(undefined4 *)(param_1 + 0x18),

+                         *(uint *)param_1 & 0xffffff,

+                         -(ulonglong)(this != (CRdrServerRequestHandler *)0x0) &

+                         (ulonglong)(this + 8),uVar6);

+      if (((-1 < iVar2) || ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control)) ||

+         (((WPP_GLOBAL_Control[0x1c] & 8) == 0 || ((byte)WPP_GLOBAL_Control[0x19] < 2))))

+      goto LAB_1;

+      uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar4 = 0x19;

+    }

+    WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar4,

+               &WPP_f26f1544384632a256a4da45cfc15c0a_Traceguids,uVar3,

+               "spIIrpRedirector->Create failed",iVar2);

+  }

+LAB_1:

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res20);

+  return iVar2;

+}

+
```

## `RdpWin32RemoteAppPresenter::SetOutputMapManager`  (modified)

```diff
--- RdpWin32RemoteAppPresenter::SetOutputMapManager
+++ RdpWin32RemoteAppPresenter::SetOutputMapManager
@@ -1,2 +1,20 @@
-Failed to decompile mstscax.dll - .ProgramDB RdpWin32RemoteAppPresenter::SetOutputMapManager : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: void __cdecl RdpWin32RemoteAppPresenter::SetOutputMapManager(struct

+   RdpXInterfaceOutputMapManagerInternal * __ptr64) __ptr64 */

+

+void __thiscall

+RdpWin32RemoteAppPresenter::SetOutputMapManager

+          (RdpWin32RemoteAppPresenter *this,RdpXInterfaceOutputMapManagerInternal *param_1)

+

+{

+  CTSCriticalSection *local_res8;

+  

+  local_res8 = (CTSCriticalSection *)(this + 0x40);

+  CTSCriticalSection::Lock(local_res8);

+  RdpXSPtr<RdpXInterfaceTapClientShellCallback>::operator=

+            ((RdpXSPtr<RdpXInterfaceTapClientShellCallback> *)(this + 0x160),

+             (RdpXInterfaceTapClientShellCallback *)param_1);

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res8);

+  return;

+}

+
```

## `RdpWinDesktopRemoteAppUIManager::Terminate`  (modified)

```diff
--- RdpWinDesktopRemoteAppUIManager::Terminate
+++ RdpWinDesktopRemoteAppUIManager::Terminate
@@ -1,2 +1,302 @@
-Failed to decompile mstscax.dll - .ProgramDB RdpWinDesktopRemoteAppUIManager::Terminate : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: virtual long __cdecl RdpWinDesktopRemoteAppUIManager::Terminate(void) __ptr64 */

+

+long __thiscall RdpWinDesktopRemoteAppUIManager::Terminate(RdpWinDesktopRemoteAppUIManager *this)

+

+{

+  TCntPtr<ITSThread> *pTVar1;

+  TCntPtr<ITSInstance> *this_00;

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *pTVar2;

+  longlong lVar3;

+  longlong *plVar4;

+  bool bVar5;

+  int iVar6;

+  _TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_> *p_Var7;

+  RdpXInterfaceDesktopRemoteAppCore *in_RDX;

+  undefined8 uVar8;

+  void *unaff_retaddr;

+  CTSCriticalSection *local_res8;

+  

+  local_res8 = (CTSCriticalSection *)(this + 0x428);

+  CTSCriticalSection::Lock(local_res8);

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x78);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+  }

+  this_00 = (TCntPtr<ITSInstance> *)(this + 0x70);

+  if (*(longlong *)this_00 != 0) {

+    TCntPtr<ITSInstance>::SafeRelease(this_00);

+    *(undefined8 *)this_00 = 0;

+    TCntPtr<ITSInstance>::SafeAddRef(this_00);

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x418);

+  if (*(longlong *)pTVar2 != 0) {

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+    *(undefined8 *)pTVar2 = 0;

+  }

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x410);

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

+    (**(code **)(**(longlong **)pTVar1 + 0x38))();

+    if (*(longlong *)pTVar1 != 0) {

+      TCntPtr<ITSThread>::SafeRelease(pTVar1);

+      *(undefined8 *)pTVar1 = 0;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xa0);

+  if (*(longlong *)pTVar2 != 0) {

+    RemoteAppTaskbarHandler::Terminate((RemoteAppTaskbarHandler *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x98);

+  if (*(longlong *)pTVar2 != 0) {

+    WindowsRemoteAppLib::CRailEventsWindow::Terminate

+              ((CRailEventsWindow *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xa8);

+  if (*(longlong *)pTVar2 != 0) {

+    WindowsRemoteAppLib::CRdpWinTextScaleMonitor::Terminate

+              ((CRdpWinTextScaleMonitor *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xb0);

+  if (*(longlong *)pTVar2 != 0) {

+    WindowsRemoteAppLib::CRdpWinUISettingsMonitor::Terminate

+              ((CRdpWinUISettingsMonitor *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xb8);

+  if (*(longlong *)pTVar2 != 0) {

+    WindowsRemoteAppLib::CRdpWinCaretBlinkMonitor::Terminate

+              ((CRdpWinCaretBlinkMonitor *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xc0);

+  if (*(longlong *)pTVar2 != 0) {

+    WindowsRemoteAppLib::CRdpWinClosedCaptionSettingsMonitor::Terminate

+              ((CRdpWinClosedCaptionSettingsMonitor *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 200);

+  if (*(longlong *)pTVar2 != 0) {

+    WindowsRemoteAppLib::CRdpWinAccentColorSettingsMonitor::Terminate

+              ((CRdpWinAccentColorSettingsMonitor *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xd0);

+  if (*(longlong *)pTVar2 != 0) {

+    WindowsRemoteAppLib::CRdpWinLightThemeSettingsMonitor::Terminate

+              ((CRdpWinLightThemeSettingsMonitor *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x90);

+  if (*(longlong *)pTVar2 != 0) {

+    (**(code **)(*(longlong *)(*(longlong *)pTVar2 + 8) + 0x18))();

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x88);

+  if (*(longlong *)pTVar2 != 0) {

+    WindowsRemoteAppLib::CWinManager::Terminate((CWinManager *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x80);

+  if (*(longlong *)pTVar2 != 0) {

+    WindowsRemoteAppLib::CRailUiVisibleUiState::Terminate

+              ((CRailUiVisibleUiState *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x178);

+  if (*(longlong *)pTVar2 != 0) {

+    WindowsRemoteAppLib::CIdleSynchronizer::Terminate

+              ((CIdleSynchronizer *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x188);

+  if (*(longlong *)pTVar2 != 0) {

+    WindowsRemoteAppLib::CRailScalWindow::Terminate((CRailScalWindow *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+    }

+  }

+  if (*(int *)(this + 0xdc) != 0) {

+    CRdpWinAudioWaveoutPlayback::CTSSinkMapMMClientWaveOut::UnBind

+              ((CTSSinkMapMMClientWaveOut *)(this + 0x48));

+    *(undefined4 *)(this + 0xdc) = 0;

+  }

+  lVar3 = *(longlong *)(this + 0x528);

+  if (lVar3 != 0) {

+    (**(code **)(*(longlong *)(lVar3 + 8) + 0x18))();

+    RdpXSPtr<RdpWinDesktopRemoteAppWindow>::operator=

+              ((RdpXSPtr<RdpWinDesktopRemoteAppWindow> *)(this + 0x528),

+               (RdpWinDesktopRemoteAppWindow *)in_RDX);

+  }

+  (**(code **)(*(longlong *)(this + 0x108) + 0x30))();

+  AcquireSRWLockExclusive((PSRWLOCK)(this + 0x168));

+  bVar5 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::GetImpl(void)'

+                                  ::__l2::impl);

+  if (bVar5) {

+    for (p_Var7 = *(_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                    **)(this + 0x158);

+        p_Var7 != (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                   *)(this + 0x148);

+        p_Var7 = (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                  *)utl::

+                    _TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                    ::_Traverse(p_Var7,true)) {

+      uVar8 = 0;

+      RdpWin32RemoteAppPresenter::SetOutputMapManager

+                (*(RdpWin32RemoteAppPresenter **)(p_Var7 + 0x20),

+                 (RdpXInterfaceOutputMapManagerInternal *)0x0);

+      in_RDX = (RdpXInterfaceDesktopRemoteAppCore *)CONCAT71((int7)((ulonglong)uVar8 >> 8),1);

+    }

+    utl::

+    _Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+    ::clear((_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+             *)(this + 0x148));

+  }

+  else {

+    for (p_Var7 = *(_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                    **)(this + 0x138);

+        p_Var7 != (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                   *)(this + 0x128);

+        p_Var7 = (_TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                  *)utl::

+                    _TreeNodeHeader<utl::pair<unsigned_int_const_,RdpXSPtr<RdpXInterfaceOutputMap>_>_>

+                    ::_Traverse(p_Var7,true)) {

+      uVar8 = 0;

+      RdpWin32RemoteAppPresenter::SetOutputMapManager

+                (*(RdpWin32RemoteAppPresenter **)(p_Var7 + 0x20),

+                 (RdpXInterfaceOutputMapManagerInternal *)0x0);

+      in_RDX = (RdpXInterfaceDesktopRemoteAppCore *)CONCAT71((int7)((ulonglong)uVar8 >> 8),1);

+    }

+    utl::

+    _Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>_>,0>

+    ::clear((_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>_>,0>

+             *)(this + 0x128));

+  }

+  ReleaseSRWLockExclusive((PSRWLOCK)(this + 0x168));

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x100);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+  }

+  RdpXSPtr<RdpXInterfaceDesktopRemoteAppCore>::operator=

+            ((RdpXSPtr<RdpXInterfaceDesktopRemoteAppCore> *)(this + 0xe0),in_RDX);

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x438);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+  }

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x458);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+  }

+  if ((longlong)*(HANDLE *)(this + 0x4b0) - 1U < 0xfffffffffffffffe) {

+    CloseHandle(*(HANDLE *)(this + 0x4b0));

+    *(undefined8 *)(this + 0x4b0) = 0;

+  }

+  plVar4 = *(longlong **)(this + 0x4d8);

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

+    iVar6 = (**(code **)(*plVar4 + 0x38))();

+    if (iVar6 < 0) {

+      wil::details::in1diag3::_Log_Hr

+                (unaff_retaddr,0x24c,

+                 "clientcore\\termsrv\\rdp\\win\\remoteapp\\remoteappplugin\\implementation\\remoteappdesktopuimanager.cpp"

+                 ,iVar6);

+    }

+    wil::

+    unique_winrt_event_token<ABI::Windows::UI::UIAutomation::Core::IRemoteAutomationClientSession>::

+    reset((unique_winrt_event_token<ABI::Windows::UI::UIAutomation::Core::IRemoteAutomationClientSession>

+           *)(this + 0x4e0));

+    wil::

+    unique_winrt_event_token<ABI::Windows::UI::UIAutomation::Core::IRemoteAutomationClientSession>::

+    reset((unique_winrt_event_token<ABI::Windows::UI::UIAutomation::Core::IRemoteAutomationClientSession>

+           *)(this + 0x4f8));

+    wil::com_ptr_t<IWTSVirtualChannel,wil::err_returncode_policy>::reset

+              ((com_ptr_t<IWTSVirtualChannel,wil::err_returncode_policy> *)(this + 0x4d8));

+  }

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x450);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+  }

+  *(uint *)(this + 0x14) = *(uint *)(this + 0x14) | 4;

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res8);

+  return 0;

+}

+
```

## `<lambda_53f6325545704e2271227e84df1043cb>::operator()`  (modified)

```diff
--- <lambda_53f6325545704e2271227e84df1043cb>::operator()
+++ RdpWinDesktopRemoteAppUIManager::RdpWinDesktopRemoteAppUIManager
@@ -1,2 +1,2 @@
-Failed to decompile mstscax.dll - .ProgramDB <lambda_53f6325545704e2271227e84df1043cb>::operator() : Error: Decompile error: 
+Failed to decompile mstscax.dll - .ProgramDB RdpWinDesktopRemoteAppUIManager::RdpWinDesktopRemoteAppUIManager : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `Microsoft::WRL::Details::RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IWTSListenerCallback,IDeviceEnumerator>::Release`  (modified)

```diff
--- Microsoft::WRL::Details::RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IWTSListenerCallback,IDeviceEnumerator>::Release
+++ Microsoft::WRL::Details::DelegateArgTraits<long_(__cdecl_Windows::Foundation::ITypedEventHandler_impl<Windows::Foundation::Internal::AggregateType<Windows::UI::Input::GestureRecognizer*___ptr64,Windows::UI::Input::IGestureRecognizer*___ptr64>,Windows::Foundation::Internal::AggregateType<Windows::UI::Input::ManipulationStartedEventArgs*___ptr64,Windows::UI::Input::IManipulationStartedEventArgs*___ptr64>_>::*)(Windows::UI::Input::IGestureRecognizer*___ptr64,Windows::UI::Input::IManipulationStartedEventArgs*___ptr64)___ptr64>::DelegateInvokeHelper<Windows::Foundation::ITypedEventHandler<Windows::UI::Input::GestureRecognizer*___ptr64,Windows::UI::Input::ManipulationStartedEventArgs*___ptr64>,<lambda_e909e439077b1cafdad48a0df4585816>,1,Windows::UI::Input::IGestureRecognizer*___ptr64,Windows::UI::Input::IManipulationStartedEventArgs*___ptr64>::`vector_deleting_destructor'
@@ -1,2 +1,2 @@
-Failed to decompile mstscax.dll - .ProgramDB Microsoft::WRL::Details::RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IWTSListenerCallback,IDeviceEnumerator>::Release : Error: Decompile error: 
+Failed to decompile mstscax.dll - .ProgramDB Microsoft::WRL::Details::DelegateArgTraits<long_(__cdecl_Windows::Foundation::ITypedEventHandler_impl<Windows::Foundation::Internal::AggregateType<Windows::UI::Input::GestureRecognizer*___ptr64,Windows::UI::Input::IGestureRecognizer*___ptr64>,Windows::Foundation::Internal::AggregateType<Windows::UI::Input::ManipulationStartedEventArgs*___ptr64,Windows::UI::Input::IManipulationStartedEventArgs*___ptr64>_>::*)(Windows::UI::Input::IGestureRecognizer*___ptr64,Windows::UI::Input::IManipulationStartedEventArgs*___ptr64)___ptr64>::DelegateInvokeHelper<Windows::Foundation::ITypedEventHandler<Windows::UI::Input::GestureRecognizer*___ptr64,Windows::UI::Input::ManipulationStartedEventArgs*___ptr64>,<lambda_e909e439077b1cafdad48a0df4585816>,1,Windows::UI::Input::IGestureRecognizer*___ptr64,Windows::UI::Input::IManipulationStartedEventArgs*___ptr64>::`vector_deleting_destructor' : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `Microsoft::WRL::Details::RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IRedirectPromptPermissionCollection>::Release`  (modified)

```diff
--- Microsoft::WRL::Details::RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IRedirectPromptPermissionCollection>::Release
+++ Microsoft::WRL::Details::DelegateArgTraits<long_(__cdecl_Windows::Foundation::ITypedEventHandler_impl<Windows::Foundation::Internal::AggregateType<Windows::UI::Input::GestureRecognizer*___ptr64,Windows::UI::Input::IGestureRecognizer*___ptr64>,Windows::Foundation::Internal::AggregateType<Windows::UI::Input::ManipulationStartedEventArgs*___ptr64,Windows::UI::Input::IManipulationStartedEventArgs*___ptr64>_>::*)(Windows::UI::Input::IGestureRecognizer*___ptr64,Windows::UI::Input::IManipulationStartedEventArgs*___ptr64)___ptr64>::DelegateInvokeHelper<Windows::Foundation::ITypedEventHandler<Windows::UI::Input::GestureRecognizer*___ptr64,Windows::UI::Input::ManipulationStartedEventArgs*___ptr64>,<lambda_e909e439077b1cafdad48a0df4585816>,1,Windows::UI::Input::IGestureRecognizer*___ptr64,Windows::UI::Input::IManipulationStartedEventArgs*___ptr64>::`vector_deleting_destructor'
@@ -1,15 +1,2 @@
-

-ulong __thiscall

-CloakSyncComponent::Release

-          (RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IRedirectPromptPermissionCollection>

-           *this)

-

-{

-  code *pcVar1;

-  ulong uVar2;

-  

-  pcVar1 = (code *)swi(3);

-  uVar2 = (*pcVar1)();

-  return uVar2;

-}

-

+Failed to decompile mstscax.dll - .ProgramDB Microsoft::WRL::Details::DelegateArgTraits<long_(__cdecl_Windows::Foundation::ITypedEventHandler_impl<Windows::Foundation::Internal::AggregateType<Windows::UI::Input::GestureRecognizer*___ptr64,Windows::UI::Input::IGestureRecognizer*___ptr64>,Windows::Foundation::Internal::AggregateType<Windows::UI::Input::ManipulationStartedEventArgs*___ptr64,Windows::UI::Input::IManipulationStartedEventArgs*___ptr64>_>::*)(Windows::UI::Input::IGestureRecognizer*___ptr64,Windows::UI::Input::IManipulationStartedEventArgs*___ptr64)___ptr64>::DelegateInvokeHelper<Windows::Foundation::ITypedEventHandler<Windows::UI::Input::GestureRecognizer*___ptr64,Windows::UI::Input::ManipulationStartedEventArgs*___ptr64>,<lambda_e909e439077b1cafdad48a0df4585816>,1,Windows::UI::Input::IGestureRecognizer*___ptr64,Windows::UI::Input::IManipulationStartedEventArgs*___ptr64>::`vector_deleting_destructor' : Error: Decompile error: 
+Marshaling error: Did not see expected closing element
```

## `utl::_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>_>,0>::clear`  (modified)

```diff
--- utl::_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>_>,0>::clear
+++ utl::_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>::clear
@@ -1,2 +1,66 @@
-Failed to decompile mstscax.dll - .ProgramDB utl::_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpWin32RemoteAppPresenter*___ptr64>_>,0>::clear : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: void __cdecl utl::_Tree<unsigned int,struct utl::pair<unsigned int const ,class

+   RdpXSPtr<class RdpWin32RemoteAppPresenter> >,struct utl::less<unsigned int>,class

+   utl::allocator<struct utl::pair<unsigned int const ,class RdpXSPtr<class

+   RdpWin32RemoteAppPresenter> > >,0>::clear(void) __ptr64 */

+

+void __thiscall

+utl::

+_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+::clear(_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+        *this)

+

+{

+  _Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+  *this_00;

+  _Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+  *p_Var1;

+  _Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+  *p_Var2;

+  

+  this_00 = this;

+  p_Var1 = *(_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+             **)(this + 0x10);

+  if (*(_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+        **)(this + 0x10) == this) {

+    return;

+  }

+  do {

+    do {

+      p_Var2 = p_Var1;

+      p_Var1 = *(_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+                 **)(p_Var2 + 8);

+    } while (*(_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+               **)(p_Var2 + 8) !=

+             (_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+              *)&_TreeSentinel);

+    while (p_Var1 = p_Var2, *(void ***)(p_Var2 + 0x10) == &_TreeSentinel) {

+      do {

+        p_Var2 = (_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+                  *)(*(ulonglong *)p_Var1 & 0xfffffffffffffffe);

+        _ContainerBase<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>_>

+        ::

+        _DeleteNode<utl::_TreeNode<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>_>

+                  ((_ContainerBase<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>_>

+                    *)this_00,

+                   (_TreeNode<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>

+                    *)p_Var1);

+        if (p_Var2 == this) {

+          *(_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+            **)this = this;

+          *(_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+            **)(this + 8) = this;

+          *(_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+            **)(this + 0x10) = this;

+          *(undefined8 *)(this + 0x18) = 0;

+          return;

+        }

+        p_Var1 = p_Var2;

+      } while (*(void ***)(p_Var2 + 8) == &_TreeSentinel);

+      *(void ***)(p_Var2 + 8) = &_TreeSentinel;

+    }

+    p_Var1 = *(_Tree<unsigned_int,utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>,utl::less<unsigned_int>,utl::allocator<utl::pair<unsigned_int_const_,RdpXSPtr<RdpWin32RemoteAppPresenter>_>_>,0>

+               **)(p_Var2 + 0x10);

+  } while( true );

+}

+
```

## `CAsyncIIrpStub::Activate`  (modified)

```diff
--- CAsyncIIrpStub::Activate
+++ FeatureMsrc108622
@@ -1,29 +1,13 @@
 

-/* public: virtual long __cdecl CAsyncIIrpStub::Activate(struct IDeviceCollection * __ptr64) __ptr64

-    */

-

-long __thiscall CAsyncIIrpStub::Activate(CAsyncIIrpStub *this,IDeviceCollection *param_1)

+bool FeatureMsrc108622(void)

 

 {

-  TCntPtr<ITSThread> *this_00;

-  long lVar1;

-  uint uVar2;

+  bool bVar1;

   

-  this_00 = (TCntPtr<ITSThread> *)(this + 0x38);

-  if (*(longlong *)this_00 != 0) {

-    TCntPtr<ITSThread>::SafeRelease(this_00);

-    *(undefined8 *)this_00 = 0;

-    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

-              ((TCntPtr<IRdpProgressiveDecompressorEx> *)this_00);

-  }

-  lVar1 = CIrpRedirector::CreateInstance((IAsyncIIrpProxy **)this_00,param_1);

-  if ((((lVar1 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

-      ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

-    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

-    WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xc,

-               &WPP_bac39d95deb13f2c16bdb4d5bb87b640_Traceguids,uVar2,

-               "CIrpRedirector::CreateInstance",lVar1);

-  }

-  return lVar1;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3638552890>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3638552890> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3638552890>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3638552890>::GetImpl(void)'

+                      ::__l2::impl);

+  return bVar1;

 }
```

## `Microsoft::WRL::Details::MakeAndInitialize<MediaStreamAdapter,MediaStreamAdapter,int&___ptr64,IMFStreamDescriptor*___ptr64,unsigned_long&___ptr64>`  (modified)

```diff
--- Microsoft::WRL::Details::MakeAndInitialize<MediaStreamAdapter,MediaStreamAdapter,int&___ptr64,IMFStreamDescriptor*___ptr64,unsigned_long&___ptr64>
+++ Microsoft::WRL::Details::MakeAndInitialize<MediaStreamAdapter,MediaStreamAdapter,int&___ptr64,IMFStreamDescriptor*___ptr64,unsigned_long&___ptr64>
@@ -1,2 +1,22 @@
-Failed to decompile mstscax.dll - .ProgramDB Microsoft::WRL::Details::MakeAndInitialize<MediaStreamAdapter,MediaStreamAdapter,int&___ptr64,IMFStreamDescriptor*___ptr64,unsigned_long&___ptr64> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* long __cdecl Microsoft::WRL::Details::MakeAndInitialize<class MediaStreamAdapter,class

+   MediaStreamAdapter,int & __ptr64,struct IMFStreamDescriptor * __ptr64,unsigned long &

+   __ptr64>(class Microsoft::WRL::Details::ComPtrRef<class Microsoft::WRL::ComPtr<class

+   MediaStreamAdapter> >,int & __ptr64,struct IMFStreamDescriptor * __ptr64 && __ptr64,unsigned long

+   & __ptr64) */

+

+long __cdecl

+Microsoft::WRL::Details::

+MakeAndInitialize<MediaStreamAdapter,MediaStreamAdapter,int&___ptr64,IMFStreamDescriptor*___ptr64,unsigned_long&___ptr64>

+          (ComPtr<IMediaSinkCallback> *param_1,int *param_2,IMFStreamDescriptor **param_3,

+          ulong *param_4)

+

+{

+  long lVar1;

+  

+  ComPtr<IMediaSinkCallback>::InternalRelease(param_1);

+  lVar1 = MakeAndInitialize<MediaStreamAdapter,MediaStreamAdapter,int&___ptr64,IMFStreamDescriptor*___ptr64,unsigned_long&___ptr64>

+                    ((MediaStreamAdapter **)param_1,param_2,param_3,param_4);

+  return lVar1;

+}

+
```

## `KERNEL32.DLL::ReleaseSRWLockExclusive`  (modified)

```diff
--- KERNEL32.DLL::ReleaseSRWLockExclusive calling
+++ KERNEL32.DLL::ReleaseSRWLockExclusive calling
@@ -1 +1 @@
-<lambda_53f6325545704e2271227e84df1043cb>::operator()
+<lambda_7d79673f8c1f749f5c9f0bd313772f5c>::operator()
@@ -2,0 +3 @@
+CameraAdapter::ActivateDevice2
@@ -3,0 +5 @@
+CameraAdapter::DoDeactivateDevice
@@ -37,0 +40,6 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_296728890>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_296728890>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3343370555>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3343370555>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_ClearCodecSubCodecBoundsCheck>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_ClearCodecSubCodecBoundsCheck>::ReportUsage
```

## `KERNEL32.DLL::EnterCriticalSection`  (modified)

```diff
--- KERNEL32.DLL::EnterCriticalSection calling
+++ KERNEL32.DLL::EnterCriticalSection calling
@@ -266,0 +267,2 @@
+W32SCard::AllocateAndChannelWriteReplyPacket
+W32SCard::DefaultIORequestMsgHandleWrapper
@@ -271,0 +274 @@
+W32SCard::Terminate
@@ -272,0 +276 @@
+W32SCard::~W32SCard
```

## `USER32.DLL::SetDlgItemTextW`  (modified)

```diff
--- USER32.DLL::SetDlgItemTextW calling
+++ USER32.DLL::SetDlgItemTextW calling
@@ -7,0 +8 @@
+CRedirectPromptDlg2View::PopulatePermissions
```

## `KERNEL32.DLL::AcquireSRWLockExclusive`  (modified)

```diff
--- KERNEL32.DLL::AcquireSRWLockExclusive calling
+++ KERNEL32.DLL::AcquireSRWLockExclusive calling
@@ -2 +2 @@
-<lambda_53f6325545704e2271227e84df1043cb>::operator()
+<lambda_7d79673f8c1f749f5c9f0bd313772f5c>::operator()
@@ -3,0 +4 @@
+CameraAdapter::ActivateDevice2
@@ -4,0 +6 @@
+CameraAdapter::DoDeactivateDevice
@@ -55,0 +58,2 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>::GetCachedFeatureEnabledState
@@ -57,0 +62,11 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_1894756665>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_2739128634>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_296728890>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_296728890>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3343370555>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3343370555>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3446137144>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3621774648>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3638552890>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_4188256568>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>::GetCachedFeatureEnabledState
@@ -58,0 +74 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_AuthenticationPackageUtilizationTelemetry>::GetCachedFeatureEnabledState
@@ -59,0 +76,4 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_ClearCodecSubCodecBoundsCheck>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_ClearCodecSubCodecBoundsCheck>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_DisconnectOnSmartCardAbsence>::GetCachedFeatureEnabledState
@@ -62,0 +83 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::GetCachedFeatureEnabledState
@@ -70 +91 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_Servicing_MSRC98236>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::GetCachedFeatureEnabledState
@@ -74 +94,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_Standalone_26_02_NonSec>::GetCachedFeatureEnabledState
@@ -76,0 +97,2 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_Standalone_26_05_NonSec>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_Standalone_26_06_NonSec>::GetCachedFeatureEnabledState
@@ -81 +103,2 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_TestLoc1Perf>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_TestLoc02>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_TestLoc03>::GetCachedFeatureEnabledState
@@ -83 +105,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_TouchpadPublicApis3>::GetCachedFeatureEnabledState
@@ -88 +109,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_WebAuthnRedirectionInVMConnect>::GetCachedFeatureEnabledState
```

## `KERNEL32.DLL::SetThreadpoolTimer`  (modified)

```diff
--- KERNEL32.DLL::SetThreadpoolTimer calling
+++ KERNEL32.DLL::SetThreadpoolTimer calling
@@ -11,0 +12,3 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_296728890>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3343370555>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_ClearCodecSubCodecBoundsCheck>::ReportUsage
```

## `KERNEL32.DLL::WaitForSingleObject`  (modified)

```diff
--- KERNEL32.DLL::WaitForSingleObject calling
+++ KERNEL32.DLL::WaitForSingleObject calling
@@ -42,0 +43 @@
+W32SCard::FlushIRPWorkerThreadFunc
```

## `MSVCRT.DLL::wcsrchr`  (modified)

```diff
--- MSVCRT.DLL::wcsrchr calling
+++ MSVCRT.DLL::wcsrchr calling
@@ -10 +9,0 @@
-DynVCPluginLoader::_LoadExternalPlugins
```

## `KERNEL32.DLL::CreateThreadpoolTimer`  (modified)

```diff
--- KERNEL32.DLL::CreateThreadpoolTimer calling
+++ KERNEL32.DLL::CreateThreadpoolTimer calling
@@ -6,0 +7,3 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_296728890>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3343370555>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_ClearCodecSubCodecBoundsCheck>::ReportUsage
```

## `KERNEL32.DLL::LeaveCriticalSection`  (modified)

```diff
--- KERNEL32.DLL::LeaveCriticalSection calling
+++ KERNEL32.DLL::LeaveCriticalSection calling
@@ -254,0 +255,2 @@
+W32SCard::AllocateAndChannelWriteReplyPacket
+W32SCard::DefaultIORequestMsgHandleWrapper
@@ -257,0 +260 @@
+W32SCard::Terminate
@@ -258,0 +262 @@
+W32SCard::~W32SCard
```

## `KERNEL32.DLL::GetTickCount`  (modified)

```diff
--- KERNEL32.DLL::GetTickCount calling
+++ KERNEL32.DLL::GetTickCount calling
@@ -8 +7,0 @@
-CIH::AddQoeTimeStampEvent
@@ -10 +8,0 @@
-CIH::IHMaybeSendPDU
```

## `KERNEL32.DLL::GetLastError`  (modified)

```diff
--- KERNEL32.DLL::GetLastError calling
+++ KERNEL32.DLL::SetThreadpoolTimer calling
@@ -1,607 +1,5 @@
-AACredHelper::CleanUpCreds
-AACredHelper::ReadCreds
-ATL::AtlHresultFromLastError
-ATL::CRegKey::DeleteSubKey
-AddHvsiIconOverlay
-AsyncCallback::Initialize
-CAARpcClientChannel::Close
-CAARpcClientChannel::SendData
-CAARpcClientTransport::CreateTunnel
-CAARpcClientTunnel::AuthorizeTunnel
-CAARpcClientTunnel::Close
-CAARpcClientTunnel::Create
-CAARpcClientTunnel::CreateChannel
-CAARpcClientTunnel::EstablishRPCConnection
-CAARpcClientTunnel::MakeServiceMessageRequest
-CAAUDPClientChannel::DTLSStartTimer
-CAAUDPClientChannel::DTLSStopTimer
-CAAUDPClientChannel::InternalConnect
-CAAUDPClientChannel::OnSendDataComplete
-CAAUDPClientChannel::SecureTunnel
-CAAUDPClientChannel::Shutdown
-CAAUDPClientRawTransport::ConnectToServer
-CAAUDPClientRawTransport::SetOption
-CAAUDPClientTransport::CreateTunnel
-CAAUDPClientTunnel::CreateChannel
-CAagIO::IOCompletionCallback
-CAagIO::StartIO
-CAagIO::StopIO
-CAagIO::WaitForIOThreadsToTerminate
-CAudioInputTestData::Initialize
-CAutoReconnectDlg::Destroy
-CAutoReconnectDlg::OnInitDialog
-CAutoReconnectDlg::StartModeless
-CAutoReconnectDlg::StaticDialogBoxProc
-CAutoReconnectDlg::UpdateConnectionAttempts
-CAutoReconnectUI::CAutoReconnectUI
-CBBar::CreateToolBar
-CBBar::CreateToolBars
-CBBar::GetBBarDimensions
-CBBar::GetRemoteCommandsPopupMenuPosition
-CBBar::GetToolBarIcons
-CBBar::Initialize
-CBBar::IsMouseOverBBar
-CBBar::MoveMouseOffBBar
-CBBar::OnAutoHideTimer
-CBBar::OnEraseBackground
-CBBar::OnMouseLeave
-CBBar::RenderText
-CBBar::ShowBBar
-CBBar::WndProc
-CBasePlayer::ApplyFormats
-CBasePlayer::CreateVideoWindow
-CBasePlayer::Initialize
-CBasePlayer::OnGeometryInformation
-CBasePlayer::OnWindowInformation
-CBasePlayer::OnWindowPosChanged
-CBasePlayer::RegisterPlayerWindowClass
-CBasePlayer::STATIC_PlayerWndProc
-CBasePlayer::SetVideoWindow
-CBasePlayer::SwitchVideoWindowParent
-CBecomeForegroundAppWindow::BecomeForegroundWindow
-CBecomeForegroundAppWindow::RegHotKey
-CBecomeForegroundAppWindow::SendKey
-CBecomeForegroundAppWindow::UnRegHotKey
-CCLX::CoreObjectPhase2Initialize
-CCancelIoFunc::CancelIoFunc
-CClientFileNamePacker::RemapFileNameForResponse
-CClientHdropPacker::RemapDropFilesForResponse
-CClientRdrFileTransfer::CreateTempPathBase
-CClientRdrFileTransfer::DeleteSubdirectory
-CClientRdrFileTransfer::GetTempDrive
-CClientUDPProxyTransport::Connect
-CClientUDPProxyTransport::FecOnBufferAvailable
-CClientUtilsWin32::MonitorFromDevNum
-CClientUtilsWin32::UT_GetAppContainerRegistryLocation
-CClientUtilsWin32::UT_GetKnownLowILSafeTempDir
-CClipBase::CreateDataChannelEvents
-CClipBase::CreateGetDataEvents
-CClipBase::GetCloudHistoryDataHandle
-CClipBase::GetDynamicVirtualChannel
-CClipBase::IsRunningInWdagContainer
-CClipBase::OnFormatDataRequest
-CClipBase::ResetFormatDataEvents
-CClipBase::SendFormatDataResponse
-CClipClient::GetEnterpriseDataId
-CClipClient::OnDataChannelResponse
-CClipClient::OnNewChannelConnection
-CClipReliableClipFunctions::Initialize
-CCustomEventManager::CreateMessageWindow
-CDTLSFilterClient::DTLSStartTimer
-CDTLSFilterClient::DTLSStopTimer
-CDeviceCollection::AddDevicesByDevInterface
-CDeviceCollection::AddDevicesBySetupClass
-CDeviceCollection::AddRedirectableDevices
-CDeviceCollection::CheckDeviceReady
-CDeviceCollection::InitializeDriveLetter2DeviceNumberTable
-CDeviceUpdates::CreateMsgWindow
-CDlgBase::CreateModalDialog
-CDlgBase::CreateNonModalDialog
-CDlgBase::DoModal
-CDlgBase::DoNonModal
-CDlgBase::SetControlText
-CDlgBase::StaticDialogBoxProc
-CDynLibLoader::LoadLibraryW
-CEtwEventProv::Initialize
-CEtwEventProvHelper::Initialize
-CFileContentsFileReader::Read
-CFileContentsFileReader::ResetDataCache
-CFileContentsFileReader::ValidateData
-CFileNamePacker::DecodeFileName
-CFileNamePacker::EncodeFileName
-CFileNamePacker::RemapFileName
-CFileRedirector::InitializeByFilename
-CFileRedirector::IoCancel
-CFormatDataPacker::DecodeFormatData
-CFormatDataPacker::EncodeFormatData
-CGlobalMemory::LockGlobalMemory
-CGlobalMemory::SynthesizeHGlobalFromStream
-CHdropData::ConvertHdropToUnicode
-CHdropPacker::EncodeHdrop
-CHdropPacker::RemapDropFiles
-CHdropToFgdConverter::AddDirectoryToFgd
-CHdropToFgdConverter::AddItemToFgd
-CHdropToFgdConverter::DoConversion
-CHdropToFgdConverter::DoConversionWorker
-CHintWnd::GetHintWndDimensions
-CHintWnd::Initialize
-CHintWnd::OnEraseBackground
-CHintWnd::OnPaint
-CHttpIoConnectionWinHttp::Initialize
-CHttpIoRequestWinHttp::AddRequestHeader
-CHttpIoRequestWinHttp::ContinueProcessingCallback
-CHttpIoRequestWinHttp::EnableCertRevocation
-CHttpIoRequestWinHttp::EnableNativeAuthentication
-CHttpIoRequestWinHttp::GetBytesTransferred
-CHttpIoRequestWinHttp::GetResponseHeader
-CHttpIoRequestWinHttp::GetResponseStatusCode
-CHttpIoRequestWinHttp::GetStatusText
-CHttpIoRequestWinHttp::Initialize
-CHttpIoRequestWinHttp::IoReadDataAsync
-CHttpIoRequestWinHttp::IoWriteDataAsync
-CHttpIoRequestWinHttp::SendSimpleRequestAsync
-CHttpIoRequestWinHttp::SendStreamModeRequestAsync
-CHttpIoRequestWinHttp::SetHttpCallback
-CHttpIoRequestWinHttp::SetTimeout
-CHttpIoRequestWinHttp::StatusCallback
-CHttpIoRequestWinHttp::WebSocketCompleteUpgrade
-CHttpIoSessionWinHttp::Initialize
-CHttpIoSessionWinHttp::SetTimeout
-CHttpIoSessionWinHttp::TryNextProxyInTheList
-CHttpProxyResolver::GetProxyForAutoSettings
-CHttpProxyResolver::ResolveProxy
-CHvsiApi::GetDevInfoHandle
-CHvsiApi::IsHvsiAllowedMicrosoftPrinterRedirection
-CInfoPanel::BindingUpdateAudioDelay
-CInfoPanel::CPropertyBinder::CPropertyBinder
-CInfoPanel::CopySessionInfoToClipboard
-CInfoPanel::CopyToClipboard
-CInfoPanel::CreateToolBar
-CInfoPanel::CreateToolBars
-CInfoPanel::Initialize
-CInfoPanel::OnEraseBackground
-CLegacyClipboardApi::Initialize
-CLocalDevice::GetDeviceProperty
-CLocalDevice::GetDeviceProperty2
-CLocalDevice::GetFileName
-CLocalDevice::InitializeDriveLetterBitmap
-CLocalDevice::IsDevicePresent
-CLocalDeviceInterfaces::Initialize
-CMFApi::Init
-CMTTransportStack::ResetResolutionTimer
-CMetaFilePacker::DecodeMetaFile
-CMetaFilePacker::EncodeMetaFile
-CMsRdpClientShell::GetClientProcess
-CMsRdpClientShell::LaunchClientProcess
-CMsTscAx::CreatePowerStateMonitorWindow
-CMsTscAx::STATIC_PowerStateMonitorWndThreadProc
-CMsTscAx::put_FullScreenTitle
-CNamedPipeStream::CloseStream
-CNamedPipeStream::Open
-CNamedPipeStream::PostReceive
-CNamedPipeStream::ProcessIoCompletionResponse
-CNamedPipeStream::Terminate
-CNamedPipeStream::WriteBuffer
-COP::CoreObjectPhase2Initialize
-COP::CreateDesktopCompatibleDC
-COP::LoadRotationData
-COP::PresentContentD2D
-COP::PresentContentDX11
-COP::UpdateClxShadowBitmap
-COPWnd::BlackOut
-COPWnd::CopyShadowToDC
-COPWnd::Initialize
-COPWnd::RealizePalette
-COPWnd::ResetDisconnectedBitmap
-COPWnd::StartDimmingWindow
-CPCStreamWorker::DecoupleStreamEvent
-CPalettePacker::DecodePalette
-CPalettePacker::EncodePalette
-CPnpRdrConfig::GenerateXml
-CPrintProgressDlg::DialogBoxProc
-CProgressBand::InitBitmaps
-CRDPENCCONStream::CloseStream
-CRDPENCCONStream::Initialize
-CRDPENCCONStreamWorker::InitializeInstance
-CRDPENCDirectConnector::AsyncResolveServerName
-CRDPENCDirectConnector::STATIC_ThreadProcResolveServerName
-CRDPENCDirectConnector::ThreadProc
-CRDPENCDirectHvConnector::ThreadProc
-CRDPENCNATHelper::GenerateExternalPortNumber
-CRDPENCNATHelper::Initialize
-CRDPENCONTCPListener::InitializeInstance
-CRDPENCTeredoHelper::LoadTeredoLib
-CRDPIce::PrepareNanoIceInitializationParameters
-CRDPUDPICECandidateList::WaitFor
-CRIMStreamProxy::CMessageEntry::Wait
-CRIMStreamProxy::ReceiveMessage
-CRdpEncTransportWorker::AssociateSocketWithIOPort
-CRdpEncTransportWorker::Terminate
-CRdpIceLocalEndpoint::InitializeEndpoint
-CRdpSettingsFileStream::DoOpenForRead
-CRdpSettingsFileStream::DoOpenForWrite
-CRdpSettingsFileStream::GetSettingsString
-CRdpSettingsFileStream::ResetFilePointerToStart
-CRdpSettingsFileStream::Write
-CRdpUdpConnection::Initialize
-CRdpUdpLocalEndpoint::CreateSendISN
-CRdpUdpLocalEndpoint::Initialize
-CRdpUdpLocalEndpoint::InitializeEndpoint
-CRdpUdpLocalEndpoint::InitializeThreads
-CRdpUdpLocalEndpoint::SendFromPendingQueue
-CRdpUdpPortRedirectorEndpoint::InitializeEndpoint
-CRdpUdpStream::GatewayWorkerThread
-CRdpUdpStream::InitializeInstance
-CRdpUdpStreamWrapperCallback::TelemetryLog
-CRdpUdpTransport::Initialize
-CRdpWinAudioWaveoutPlayback::AcquireWinMMFunctions
-CRdpWinAudioWaveoutPlayback::CreateMsgWindow
-CRdpWinAudioWaveoutPlayback::InitializeInstance
-CRdpWinAudioWaveoutPlayback::RenderThreadProc
-CRdpWinAudioWaveoutPlayback::STATIC_ThreadProc
-CRdpWinAudioWaveoutPlayback::vcwaveClose
-CRdpWinConnector::IsRequiredCheckLoopback
-CRdpWinGatewayHelper::CreateAuthBlob
-CRdpWinGatewayHelper::GetAuthCookie
-CRdpWinGatewayHelper::RemoveGatewayCredentials
-CRdpWinTransportHelpers::ComputerNameDnsFullyQualified
-CRdpWindowedMappedRenderer::GeometryPlugin_RegisterAndCreateWindowEx
-CRdpWindowedMappedRenderer::RenderTargetWndProc
-CRdpWindowedMappedRenderer::STATIC_RenderTargetWndProc
-CRdpWindowedMappedRenderer::SetRenderTargetWindowOnTop
-CRdpWindowedMappedRenderer::SetTopLevelWindowId
-CRdrFileTransfer::CopyHdropToTempPath
-CRdrFileTransfer::CreateTempPath
-CRdrWnd::CreateRdrWindow
-CRdrWnd::RegisterRdrWindowClass
-CRecordingTestConsumer::EncodeScreenData
-CRecordingTestConsumer::Initialize
-CRedirectPromptDlg2View::PopulatePermissions
-CRedirectPromptDlg::CheckSendingCredentials
-CRedirectPromptDlg::CreateToolTip
-CRedirectPromptDlg::DisplayCertificate
-CRedirectPromptDlg::GetPublisherThumbprint
-CRedirectPromptDlg::UpdateCredentialsControl
-CRegistryMonitor::Initialize
-CRegistryMonitor::Terminate
-CReliableClipUpdateHandler::RegisterForUpdateNotifications
-CReliableClipUpdateHandler::SnapShotClipboard
-CReliableClipUpdateHandler::UnregisterFromUpdateNotifications
-CRemoteDesktopClientSettings::ConvertBinaryToString
-CSL::SLGetClientDir
-CScaleFactorAccess::GetImmersiveScaleFactorInternal
-CSecurityFilterHelper::CSecurityFilterHelper
-CSecurityFilterHelper::DuplicateHandle
-CSecurityFilterHelper::GetCertificateContext
-CShortFormatNamePacker::DecodeFormatNames
-CSimpleDataObject::Initialize
-CSimpleRegistryWatcher::StartUpdateWatcher
-CSimpleRegistryWatcher::StopUpdateWatcher
-CSndInputChannelCallback::Initialize
-CSndInputChannelCallback::staticMsgWndProc
-CStubCancelFileIo::Initialize
-CTSClientPrintDriver::AsyncDocumentProperties
-CTSClientPrintDriver::AsyncPrinterProperties
-CTSClientPrintDriver::CancelUI
-CTSClientPrintDriver::DocumentPropertiesW
-CTSClientPrintDriver::FixPaperSizeForm
-CTSClientPrintDriver::InitializePrinter
-CTSClientPrintDriver::ModernDocumentProperties
-CTSClientPrintDriver::ModernPrinterProperties
-CTSClientPrintDriver::MxdcGetPDEVAdjustment
-CTSClientPrintDriver::PrinterProperties
-CTSClientPrintTicket::CreateDriverUniqueUri
-CTSClientPrintTicket::GetDriverInfo3
-CTSClientPrintTicket::GetTicketInstance
-CTSClientPrintTicket::NoPT_ConvertDevModeToPrintTicket
-CTSClientPrintTicket::NoPT_GetPrintCapabilities
-CTSClientPrintTicket::OpenPTProvider
-CTSCredManAssistant::DeleteSavedCreds
-CTSCredManAssistant::GetSavedCreds
-CTSCredManAssistant::Initialize
-CTSCredManAssistant::MohoroDeleteSavedCreds
-CTSCredManAssistant::MohoroSaveCreds
-CTSCredManAssistant::PrepareForCredWriteOld
-CTSCredManAssistant::SaveCreds
-CTSCryptUtils::BinaryToString
-CTSCryptUtils::BinaryToUrlEncodedStringA
-CTSCryptUtils::BinaryToUrlEncodedStringW
-CTSCryptUtils::ComputeSha256Hash
-CTSCryptUtils::ImportPublicKeyFromCert
-CTSCryptUtils::ProtectCredential
-CTSCryptUtils::StringToBinary
-CTSCryptUtils::UnSerializeCertificate
-CTSCryptUtils::UnprotectCredential
-CTSDXPlayer::RenderPin
-CTSDXPlayer::SpecificInitialize
-CTSGraphics::RegionAlloc
-CTSGraphics::RegionAllocInLogicalCoords
-CTSGraphics::RegionClear
-CTSGraphics::RegionDuplicate
-CTSGraphics::RegionOperationRects
-CTSGraphicsBitmap::InitializeMonochromeBitmap
-CTSGraphicsBitmap::InitializePaletteDIB
-CTSGraphicsBitmap::InitializeRGBDIB
-CTSGraphicsBitmap::SetBitsEncoding1
-CTSGraphicsPalette::Initialize
-CTSGraphicsPalette::UpdateDIB
-CTSGraphicsPen::Initialize
-CTSGraphicsSurfaceBase::AddUpdateRegion
-CTSGraphicsSurfaceBase::BitBlt
-CTSGraphicsSurfaceBase::CreateDesktopCompatibleDC
-CTSGraphicsSurfaceBase::DrawBorder
-CTSGraphicsSurfaceBase::DrawEllipse
-CTSGraphicsSurfaceBase::DrawFilledRegion
-CTSGraphicsSurfaceBase::DrawPolyLine
-CTSGraphicsSurfaceBase::DrawPolygon
-CTSGraphicsSurfaceBase::DrawRectangle
-CTSGraphicsSurfaceBase::FastBlt
-CTSGraphicsSurfaceBase::GetBrushOrigin
-CTSGraphicsSurfaceBase::GetClippingRegion
-CTSGraphicsSurfaceBase::GetTextAlignment
-CTSGraphicsSurfaceBase::OpaqueBlt
-CTSGraphicsSurfaceBase::PatBlt
-CTSGraphicsSurfaceBase::SetBackgroundColor
-CTSGraphicsSurfaceBase::SetBackgroundMode
-CTSGraphicsSurfaceBase::SetBrushOrigin
-CTSGraphicsSurfaceBase::SetClippingRegion
-CTSGraphicsSurfaceBase::SetForegroundColor
-CTSGraphicsSurfaceBase::SetPaletteOnHDC
-CTSGraphicsSurfaceBase::SetTextAlignment
-CTSGraphicsSurfacePrimary::ClearShadowSurface
-CTSInput::CaptureRelativeMouse
-CTSInput::CoreObjectPhase2Terminate
-CTSInput::CreateLargeColorCursor
-CTSInput::EnableTouchVisuals
-CTSInput::GetKeyboardSubType
-CTSInput::IHInputCaptureWndProc
-CTSInput::ReinsertKeyboardHook
-CTSInput::ReleaseRelativeMouse
-CTSInput::SetMouseCursorPositionThreadWorker
-CTSMFPlayer::SpecificInitialize
-CTSMfWrapper::AcquireMFFunctions
-CTSMfWrapper::AcquireMFPlatFunctions
-CTSWin32CoreApi::ChangeVolumeControlTitle
-CTSWin32CoreApi::GetDesktopBitmapBitsOnRcv
-CTSWin32CoreApi::GetErrorDescription
-CThread::ResumeThread
-CThread::StartThread
-CThread::StopThread
-CThread::SuspendThread
-CTsAuthUi::DisplayAuthDialog
-CTsAuthUi::DisplayAuthErrorDialog
-CTsAuthUi::DisplayNonContinuableErrorDialog
-CTsAuthUi::DisplayRedirectionWarning
-CTsAuthUi::Initialize
-CTsProxyFuncTable::GetTransportModule
-CTsProxyFuncTable::GetTransportModuleName
-CTsProxyFuncTable::Initialize
-CTsProxyProfileManager::LoadProxyStrings
-CTsRdpCertSignature::FreeCertArray
-CTsRdpCertSignature::GetCertificateThumbPrint
-CTsRdpCertSignature::GetHandleToMsgStore
-CTsRdpCertSignature::Sign
-CTsRdpCertSignature::ValidateCertificate
-CTsRdpCertSignature::VerifySignature
-CTsUsbDevice::CancelRequests
-CTsUsbDevice::CompletionThread
-CTsUsbDevice::Initialize
-CTsUsbDevice::PnpQueryDeviceTextDescription
-CTsUsbDevice::RetractDevice
-CTsUsbDevice::UrbTransferDataRequest
-CTsUsbDevice::UsbdiGetVersion
-CTsUsbIoContro2::SubmitIoControlAsync
-CTsWindow::InitWindowClass
-CTscCertErrorDialog::DisplayCertSubjectName
-CTscCertErrorDialog::EnableCertErrorBullet
-CTscCertErrorDialog::OnInitDialog
-CTscComHelper::GetCookie
-CTscComHelper::GetRandomNumber
-CTscComHelper::WriteCookieToFile
-CTscComHelper::WriteRdpFileContentsToDisk
-CTscCredentialsQueryUi::CreateInputAuthBlob
-CTscCredentialsQueryUi::GetSmartCardCertHash
-CTscCredentialsQueryUi::GetUserNameFromMarshalledCredential
-CTscCredentialsQueryUi::IsDeviceAADJoined
-CTscCredentialsQueryUi::UnpackBlob
-CTscCredsAssistant::GetPromptTextId
-CTscServerAuthErrorDialog::OnInitDialog
-CTscServerNotAuthenticatedDialog::CalcTextRect
-CTscServerNotAuthenticatedDialog::DisplayErrorDescription
-CUCCRecordingDataConsumerStub::StartRecording
-CUDPPacketList::Initialize
-CUH_Cache::CreateCacheFile
-CUH_Cache::CreateDirectoryW
-CUH_Cache::DuplicateFileHandle
-CUH_Cache::GrabPersistentCacheLock
-CUH_Cache::ReadFile
-CUH_Cache::WriteFile
-CUI::CoreObjectPhase2Initialize
-CUI::Initialize
-CUI::OnNotifyConnectCompleteUiThreadWorker
-CUI::SetCroppedViewRect
-CUI::SetMainWindowSize
-CUI::SetShutdownEvent
-CUI::UIActivateSuperPan
-CUI::UIMainWndProc
-CUI::UIRecalculateScrollbars
-CUI::UIUpdateScreenMode
-CUI::UI_OnIdleTimeoutWarningEvent
-CUI::UI_OnRemoteApplicationDisplayed
-CUrbDrPlugin::UnredirectDevice
-CUsbDeviceEnumerator::FindDevicesBy
-CUsbDeviceEnumerator::GetDevicesToRedirect
-CUsbDeviceEnumerator::Initialize
-CUsbDeviceEnumerator::QueryDeviceText
-CUsbRedirectionControl::DisableRedirection
-CUsbRedirectionControl::EnableRedirection
-CUsbRedirectionControl::EnableRedirectionListener
-CUsbRedirectionControl::Initialize
-CUsbRedirectionControl::QueryDeviceProprietaryId
-CUsbRedirectionControl::RemoteServerReady
-CUsbRedirectionControl::RetractDevice
-CWAMTokenHandler::DetermineOwnerWindow
-CWAMTokenHandler::PreGetClaimsToken
-CWAMTokenHandler::RestoreWebAccountId
-CWAMTokenHandler::STATIC_TokenHandlerWndThreadProc
-CWAMTokenHandler::SaveWebAccountId
-CWSStream::ConnectUsingRdpNanoStack
-CWSStream::Initialize
-CWorkspaceClientExt::InitializePublisherThumbPrint
-CXPSPrintJob2::Initialize
-CXPSPrintJob::Close
-CXPSPrintJob::GetProgramFile
-CXPSPrintTempFile::CreateTempFile
-CXPSPrintTempFile::WriteTempFile
-CacDecoding::DecodingThreadCommon::Init
-CacDecoding::DecodingThreadContext::Init
-CacheFileWriter::Create
-CacheFileWriter::DeleteOldFiles
-CertHelper::ValidateAadP2PCertificate
-CheckDeviceForInterface
-CommctrlIsolationAwarePrivatetRgCebPnQQeRff_pbZPgYQP_QYY
-CommctrlIsolationAwarePrivatetRgCebPnQQeRff_pbZPgYQP_QYY$fin$0
-ConvertAuthCookieBytesToUTF16LE
-ConvertWstrToStr
-CreateClaimsAuthResponseHeader
-CreateGuid
-CreateHashFromMTCookie
-CreatePath
-CreatePrintableHash
-CreateSubordinateSessionNamedPipe
-DecryptSecret
-DeviceEnumeratorListenerCallback::PostPrivateDeviceChangeMessage
-DeviceEnumeratorListenerCallback::RegisterForDeviceNotifications
-DeviceEnumeratorListenerCallback::UnregisterFromDeviceNotifications
-DeviceEnumeratorListenerCallback::staticMsgWndProc
-DrFile::CloseFileHandle
-DrPRT::SerialGetBaudRate
-DrPRT::SerialGetLineControl
-DrPRT::SerialHandleEscapeCode
-DrPRT::SerialImmediateChar
-DrPRT::SerialSetBaudRate
-DrPRT::SerialSetLineControl
-DumpHashes
-DynVCPluginLoader::_LoadOnePluginDirect
-DynVCPluginLoader::_LoadOnePluginViaCom
-EnterpriseClipboardApi::Initialize
-ExtractHostNameFromUrl
-FeedbackHubUpdateActivityID
-FrameBufferClientChannel::CreateDesktopCompatibleDC
-FrameBufferClientChannel::GetLogonSid
-FrameBufferClientChannel::OpenGlobalObjects
-GetActivityIdControlApi
-GetCaptionText
-GetCertContextFromCertHash
-GetClientIdentifier
-GetClientOS
-GetCurrentRoleInstance
-GetCurrentUTCTimeString
-GetCurrentUserName
-GetMessageText
-GetOverriddenPlatformCookie
-GetPrintQueuesClassGUID
-GetPrinterHardwareIDsList
-GetPrinterRegistryProperty
-HRESULTFromLastErrorError
-HWndSurfacePresenter::AsyncWaitAndRetryPresent
-HWndSurfacePresenter::Initialize
-HWndSurfacePresenter::STATIC_ThreadProcWaitAndRetryPresent
-HWndSurfacePresenter::ThreadProcWaitAndRetryPresent
-HWndSurfacePresenterDComp::Initialize
-HashDataEx
-HmacHashDataEx
-HttpsRequest::GetAllResponseHeaders
-HttpsRequest::Initialize
-HttpsRequest::LogServerCertificateInfo
-HttpsRequest::ReadResponseContentAsync
-HttpsRequest::StatusCallback
-ICETransportContext_CreateInstance
-ImportKey
-InternalGatherCreds
-IsDeviceAADJoined
-IsHvsiAllowedLocalPrinterRedirection
-IsLocalUser
-IsWindowsFirstPartyApp
-IsXPSDriver
-IsolationAwareCreateMappedBitmap
-IsolationAwareCreateMappedBitmap$fin$0
-IsolationAwareCreateWindowExW
-IsolationAwareCreateWindowExW$fin$0
-IsolationAwareDefSubclassProc
-IsolationAwareDefSubclassProc$fin$0
-IsolationAwareGetClassInfoExW
-IsolationAwareGetClassInfoExW$fin$0
-IsolationAwareImageList_Add
-IsolationAwareImageList_Add$fin$0
-IsolationAwareImageList_AddMasked
-IsolationAwareImageList_AddMasked$fin$0
-IsolationAwareImageList_Create
-IsolationAwareImageList_Destroy
-IsolationAwareImageList_Destroy$fin$0
-IsolationAwareImageList_LoadImageW
-IsolationAwareImageList_LoadImageW$fin$0
-IsolationAwareImageList_Replace
-IsolationAwareImageList_Replace$fin$0
-IsolationAwareInitCommonControlsEx
-IsolationAwareLoadLibraryA
-IsolationAwareLoadLibraryA$fin$0
-IsolationAwareLoadLibraryExW
-IsolationAwareLoadLibraryExW$fin$0
-IsolationAwareLoadLibraryW
-IsolationAwareLoadLibraryW$fin$0
-IsolationAwarePrivatenPgViNgRzlnPgpgk
-IsolationAwareRegisterClassExW
-IsolationAwareRegisterClassExW$fin$0
-IsolationAwareRegisterClassW
-IsolationAwareRemoveWindowSubclass
-IsolationAwareRemoveWindowSubclass$fin$0
-IsolationAwareSetWindowSubclass
-IsolationAwareSetWindowSubclass$fin$0
-IsolationAwareUnregisterClassW
-IsolationAwareUnregisterClassW$fin$0
-JsonHelper::UTF8ToWideChar
-JsonHelper::WideCharToUTF8
-JsonHelper::WideCharToUTF8AsByteArray
-LoadHttpHelperLibrary
-LockClipboard
-MFApiWrapper::InitFunctionPointers
-Microsoft::RdpNano::Dll::Load
-Microsoft::RdpNano::Dll::Unload
-NamedPipeAdaptor::BeginReadPipe
-NamedPipeAdaptor::BeginWritePipe
-NamedPipeAdaptor::ClosePipe
-NamedPipeAdaptor::CompleteReadPipe
-NamedPipeAdaptor::OpenPipeInternal
-PAL_System_SemaphoreAcquire
-PAL_System_ThreadAlloc
-PAL_System_ThreadFree
-PAL_System_ThreadGetDeathCondition
-PAL_System_ThreadQuit
-PAL_System_ThreadSignalPulse
-PAL_System_TimerInit
-PAL_System_Win32_CredProtect
-PAL_System_Win32_CredUnprotect
-PAL_System_Win32_IsRunningInAppContainer
-PAL_System_Win32_ThreadRegisterWindowClass
-PAL_System_Win32_ThreadUnRegisterWindowClass
-PAL_System_Win32_TimerGetHWND
-PAL_System_Win32_TimerRegisterWindowClass
-PAL_System_Win32_TimerUnRegisterWindowClass
-PrintRegion
-ProvisionCSPWithSCPin
-RDPConvertToAnsi
-RDPConvertToUnicode
-RDPENCGDIHLP_CreateDIB
-RDPENCGDIHLP_Get8BPPPaletteEntries
-RDPENCHLP_SetETWActivityID
-RDPENCRYPTHLP_GenerateRandom
-RDPENCRYPTHLP_StringToBinary
-RDSAADAUTH::ValidateAadP2PCertificate
-RadcValidateAndCreateActualUrl
-RdpBatteryStatusRedirectionClientChannel::SetUpPowerStatusNotifications
-RdpConnectionHealthStateChangedDialog::OnInitDialog
-RdpConnectionHealthStateChangedDialog::StartModeless
-RdpConnectionHealthStateChangedDialog::StaticDialogBoxProc
-RdpEdpSrpApi::Initialize
-RdpInputSink::MapScreenToApp
+CTSThreadInternal::ThreadWatchdogStart
+CancelTimerCallbacksAndDeleteTimer
+EnableFlushTimer
+PAL_System_WinCommon_StopThreadpoolTimer
+RdpTaskScheduler::CancelWatchdogTimer
@@ -609 +7 @@
-RdpTaskScheduler::Initialize
+RdpTaskScheduler::ResetTimer
@@ -611,66 +8,0 @@
-RdpWin32RemoteAppPresenter::CopyOffsetWindowContents
-RdpWin32RemoteAppPresenter::GenerateUpdateLayeredWindowData
-RdpWin32RemoteAppPresenter::InitializeObject
-RdpWin32RemoteAppPresenter::OnWmPaint
-RdpWin32RemoteAppPresenter::PinCompositionTargetToWindow
-RdpWin32RemoteAppPresenter::PresentWithSharedMemoryTexture
-RdpWin32RemoteAppPresenter::ProtectInternal
-RdpWin32RemoteAppPresenter::WhiteOutWindow
-RdpWinCriticalSection::Initialize
-RdpWinDesktopRemoteAppUIManager::ExpandEnvironmentVariable
-RdpWinDesktopRemoteAppUIManager::Initialize
-RdpWinDesktopRemoteAppUIManager::SetPowerDisplayRequest
-RdpWinDesktopRemoteAppWindow::AddRemoteAppIconOverlay
-RdpWinDesktopRemoteAppWindow::AllowTaskbarButtonCreatedMessage
-RdpWinDesktopRemoteAppWindow::ApplyAction
-RdpWinDesktopRemoteAppWindow::FixCenteredPopup
-RdpWinDesktopRemoteAppWindow::FixupTopMostWindowsInZorder
-RdpWinDesktopRemoteAppWindow::GetBounds
-RdpWinDesktopRemoteAppWindow::Initialize
-RdpWinDesktopRemoteAppWindow::InitiateMouseLocalMoveSize
-RdpWinDesktopRemoteAppWindow::MaximizeForSpan
-RdpWinDesktopRemoteAppWindow::NormalizeString
-RdpWinDesktopRemoteAppWindow::OnMoveSizeIntercept
-RdpWinDesktopRemoteAppWindow::OnRailWindowUpdated
-RdpWinDesktopRemoteAppWindow::OnServerMoveSizeStart
-RdpWinDesktopRemoteAppWindow::ProcessWindowChangeFromServer
-RdpWinDesktopRemoteAppWindow::RdpWinDesktopRemoteAppWindow
-RdpWinDesktopRemoteAppWindow::SetClippingRgnToMonitor
-RdpWinDesktopRemoteAppWindow::UpdateWindowOwner
-RdpWinDesktopRemoteAppWindow::UpdateWindowPosition
-RdpWinDesktopRemoteAppWindow::UpdateWindowRegion
-RdpWinDesktopRemoteAppWindow::UpdateWindowShow
-RdpWinDesktopRemoteAppWindow::UpdateWindowStyle
-RdpWinDesktopRemoteAppWindow::WindowCreateHelper
-RdpWinDesktopRemoteAppWindow::xGetMonitorInfo
-RdpWinDesktopRemoteAppWindowHvsi::WindowCreateHelper
-RdpWinDesktopRemoteAppWindowHvsi::WndProc
-RdpWinDesktopSubRegion::Protect
-RdpWinExperienceSettings::UpdateBWValueToDisplay
-RdpWinExperienceSettings::UpdateLatencyValueToDisplay
-RdpWinExperienceSettings::UpdateQualityValueToDisplay
-RdpWinExperienceSettings::UpdateUDPValueToDisplay
-RdpWinExperienceSettings::UpdateURCPValueToDisplay
-RdpWinGdiTexture2D::CreateDesktopCompatibleDC
-RdpWinLegacySubRegion::Protect
-RdpWinRadcHttpRequest::Exec
-RdpWinRadcHttpRequest::GetHttpHeaderFromResponse
-RdpWinRadcHttpRequest::GetProxyConfig
-RdpWinRadcHttpRequest::InitializeInstance
-RdpWinRadcHttpRequest::IsValidRedirectUrl
-RdpWinRadcHttpRequest::OnRedirectPending
-RdpWinRadcHttpRequest::PerformRequest
-RdpWinRadcHttpRequest::PrepareRequest
-RdpWinRadcHttpRequest::ReadResponseBody
-RdpWinRadcHttpRequest::SafeEndRequest
-RdpWinRadcHttpRequest::SetActivityIdIfExists
-RdpWinRadcHttpRequest::SetAuthCookieIfExists
-RdpWinRadcHttpRequest::SetClaimsTokenIfExists
-RdpWinRadcHttpRequest::SetClientVersionHeader
-RdpWinRadcHttpRequest::SetIfNoneMatchHeaderIfExists
-RdpWinRadcHttpRequest::TerminateInstance
-RdpWinRadcHttpRequest::TryFindClaimsAuthChallenge
-RdpWinRadcHttpRequestFactory::Initialize
-RdpWinRegion::CreateGDIRegion
-RdpWinSafeRundown::InitializeInstance
-RdpWinTaskScheduler::InitializeInstance
@@ -678,120 +10,2 @@
-RdpWinTaskScheduler::QueueUserTask
-RdpXInterfaceUriComponentsWinHttp::Initialize
-RecorderObj::ShadowBitmapUpdated
-RemoteAppGfxRedirSharedBufferPool::Initialize
-RemoteAppTaskbarHandler::GetAppIDForWindow
-SetPrivilege
-SimpleHttpsClient::Initialize
-SimpleHttpsClient::SendRequestAsync
-TSExpandableTaskDialogExCallback
-TS_SECURITY_FIPS_DecryptData
-TS_SECURITY_FIPS_Enable
-TS_SECURITY_FIPS_EncryptData
-TS_SECURITY_FIPS_MakeSessionKeys
-ThreadPool::AddNewThreadToPool
-ThreadPool::PooledThread
-TouchPointerCursorOverlay::DrawCursorHW
-TouchPointerCursorOverlay::DrawCursorSW
-TouchPointerCursorOverlay::PositionCursor
-TryParseClaimsAuthnHeader
-TsCertUnSerializeCertificate
-TsCertValidateCertificate
-TsCryptCertContainsEnhancedKeyUsage
-TsCryptConstructCertChain
-TsCryptDecodeObject
-TsCryptGetCertContext
-TsCryptGetCertTimeStatus
-TsScardInitialize
-TsScardQueryInsertionMonitor
-W32DispatchQueue::Initialize
-W32DrAutoPrn::AsyncWriteIOFunc
-W32DrAutoPrn::ClosePrinter
-W32DrAutoPrn::DisablePrinterPopup
-W32DrAutoPrn::EnumerateEx
-W32DrAutoPrn::GetPrinterInfoAndSessionID
-W32DrAutoPrn::GetRDPDefaultPrinter
-W32DrAutoPrn::W32DrAutoPrn
-W32DrAutoPrn::W32DrOpenPrinter
-W32DrCOM::Enumerate
-W32DrDevice::MsgIrpClose
-W32DrDevice::MsgIrpFlushBuffers
-W32DrDeviceAsync::AsyncIOCTLFunc
-W32DrDeviceAsync::AsyncMsgIrpCreateFunc
-W32DrDeviceAsync::AsyncReadIOFunc
-W32DrDeviceAsync::AsyncWriteIOFunc
-W32DrDeviceAsync::StartIOFunc
-W32DrDeviceOverlapped::CompleteIOFunc
-W32DrDeviceOverlapped::MsgIrpCreate
-W32DrDeviceOverlapped::StartIOCTL
-W32DrDeviceOverlapped::StartReadIO
-W32DrDeviceOverlapped::StartWriteIO
-W32DrLPT::Enumerate
-W32DrPRN::RenamePrinter
-W32DrPRT::InitializeSerialPort
-W32DrPRT::SerialConfigSize
-W32DrPRT::SerialGetChars
-W32DrPRT::SerialGetCommStatus
-W32DrPRT::SerialGetConfig
-W32DrPRT::SerialGetHandflow
-W32DrPRT::SerialGetModemStatus
-W32DrPRT::SerialGetProperties
-W32DrPRT::SerialGetTimeouts
-W32DrPRT::SerialGetWaitMask
-W32DrPRT::SerialPurge
-W32DrPRT::SerialSetChars
-W32DrPRT::SerialSetHandflow
-W32DrPRT::SerialSetQueueSize
-W32DrPRT::SerialSetTimeouts
-W32DrPRT::SerialSetWaitMask
-W32DrPRT::StartWaitOnMaskFunc
-W32Drive::AsyncNotifyChangeDir
-W32Drive::MsgIrpLockControl
-W32Drive::MsgIrpQueryDirectory
-W32Drive::MsgIrpQueryFileInfo
-W32Drive::MsgIrpQuerySdInfo
-W32Drive::MsgIrpQueryVolumeInfo
-W32Drive::MsgIrpSetFileInfo
-W32Drive::MsgIrpSetSdInfo
-W32Drive::StartFSFunc
-W32ProcObj::CreatePrinterChangesMonitoringThread
-W32ProcObj::CreateWorkerThreadEntry
-W32ProcObj::DispatchAsyncIORequest
-W32ProcObj::DispatchAsyncIORequest_Private
-W32ProcObj::GetClientComputerName
-W32ProcObj::Initialize
-W32ProcObj::OnDeviceChange
-W32ProcObj::PrinterChangesMonitoringThreadFunc
-W32SCard::FlushIRPs
-W32SCard::GetStartedEvent
-W32SCard::InternalMsgIrpDeviceControl
-W32SCard::ReleaseStartedEvent
-WTSWindowInfoService::GetWindowInfo
-WinbaseIsolationAwarePrivatetRgzlnPgpgk
-WindowsRemoteAppLib::CIdleSynchronizer::Start
-WindowsRemoteAppLib::CRailBoolSysparamMonitor::Resend
-WindowsRemoteAppLib::CRailCaretWidthMonitor::Resend
-WindowsRemoteAppLib::CRailFilterKeysMonitor::Resend
-WindowsRemoteAppLib::CRailHighContrastMonitor::Resend
-WindowsRemoteAppLib::CRailNotify::SetIcon
-WindowsRemoteAppLib::CRailScalWindow::Initialize
-WindowsRemoteAppLib::CRailStickyKeysMonitor::Resend
-WindowsRemoteAppLib::CRailSystemParametersWindow::Initialize
-WindowsRemoteAppLib::CRailToggleKeysMonitor::Resend
-WindowsRemoteAppLib::CRailUi::UpdateMousePos
-WindowsRemoteAppLib::CRailUiManager::Initialize
-WindowsRemoteAppLib::CRailWorkAreaMonitor::Resend
-WindowsRemoteAppLib::CRdpWin32HookEvents::InstallEventHooks
-WindowsRemoteAppLib::CRdpWinLanguageEvents::ListenToWinEventObjectCreate
-WindowsRemoteAppLib::CRdpWinLanguageEvents::ListenToWinEventSystemForeground
-WindowsRemoteAppLib::CRdpWinLanguageEvents::OnForegroundWindowChange
-WindowsRemoteAppLib::CRdpWinLanguageEvents::OnWindowCreate
-WindowsRemoteAppLib::CTSWindowInformation::Initialize
-WindowsRemoteAppLib::CTSWindowInformation::SetRects
-WindowsRemoteAppLib::CWinManager::DoZorder
-WindowsRemoteAppLib::CWinManager::EnforceServerZOrderUnder
-WindowsRemoteAppLib::CWinManager::GetWindowClassName
-WindowsRemoteAppLib::CWinManager::GetWindowTitle
-WindowsRemoteAppLib::RailLanguagebarHandler::OnWindowInformation
-WindowsRemoteAppLib::RailLanguagebarHandler::RefreshRailDeskband
-WindowsRemoteAppLib::RailLanguagebarHandler::ShowRailDeskband
-__delayLoadHelper2
+wil::details::DestroyThreadPoolTimer<wil::details::SystemThreadPoolMethods,0>::Destroy
+wil::details::EnsureCoalescedTimer<wil::details::EnabledStateManager>
@@ -801,9 +14,0 @@
-wil::details::GetLastErrorFail
-wil::details_abi::SemaphoreValue::GetValueFromSemaphore
-wil::details_abi::SemaphoreValue::TryGetValueInternal
-wil::event_t<wil::details::unique_storage<wil::details::resource_policy<void*___ptr64,void_(__cdecl*)(void*___ptr64)_noexcept,&void___cdecl_wil::details::CloseHandle(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,void*___ptr64,void*___ptr64,0,std::nullptr_t>_>,wil::err_returncode_policy>::create
-wil::get_token_information_nothrow<_TOKEN_GROUPS_AND_PRIVILEGES,0>
-wil::last_error_context::last_error_context
-wil::mutex_t<wil::details::unique_storage<wil::details::resource_policy<void*___ptr64,void_(__cdecl*)(void*___ptr64)_noexcept,&void___cdecl_wil::details::CloseHandle(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,void*___ptr64,void*___ptr64,0,std::nullptr_t>_>,wil::err_returncode_policy>::create
-wil::semaphore_t<wil::details::unique_storage<wil::details::resource_policy<void*___ptr64,void_(__cdecl*)(void*___ptr64)_noexcept,&void___cdecl_wil::details::CloseHandle(void*___ptr64),wistd::integral_constant<unsigned___int64,0>,void*___ptr64,void*___ptr64,0,std::nullptr_t>_>,wil::err_returncode_policy>::create
-xDrawTransparentBitmap
```

## `KERNEL32.DLL::SetLastError`  (modified)

```diff
--- KERNEL32.DLL::SetLastError calling
+++ KERNEL32.DLL::SetLastError calling
@@ -61,0 +62,3 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_296728890>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3343370555>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_ClearCodecSubCodecBoundsCheck>::ReportUsage
```
