# CVE-2020-0609 — mstscax.dll patch diff

`mstscax.dll` 10.0.18362.449 -> 10.0.18362.592 (ghidriff).

## `DecompressRLEX`  (modified)

```diff
--- DecompressRLEX
+++ DecompressRLEX
@@ -1,30 +1,191 @@
+

+/* long __cdecl DecompressRLEX(unsigned char const * __ptr64 & __ptr64,unsigned char const *

+   __ptr64,class PixelMap & __ptr64) */

 

 long __cdecl DecompressRLEX(uchar **param_1,uchar *param_2,PixelMap *param_3)

 

 {

-  int *piVar1;

-  short sVar2;

-  undefined4 uVar3;

-  undefined8 in_RAX;

-  longlong lVar4;

-  undefined8 unaff_RBX;

-  longlong unaff_RBP;

-  ClearDecompressor *unaff_R15;

+  uint *puVar1;

+  byte *pbVar2;

+  byte bVar3;

+  byte *pbVar4;

+  char cVar5;

+  char cVar6;

+  byte bVar7;

+  undefined4 uVar8;

+  undefined4 uVar9;

+  undefined4 uVar10;

+  uint *puVar11;

+  uint uVar12;

+  int iVar13;

+  uint *puVar14;

+  undefined **ppuVar15;

+  uint uVar16;

+  byte bVar17;

+  byte bVar18;

+  uint uVar19;

+  int iVar20;

+  uint *puVar21;

+  long lVar22;

+  byte bVar23;

+  undefined8 in_stack_ffffffffffffff98;

+  undefined8 uVar24;

+  uchar *puVar25;

+  undefined8 in_stack_ffffffffffffffa0;

   

-  sVar2 = (short)(char)((ulonglong)unaff_RBX >> 8);

-  lVar4 = CONCAT62((int6)((ulonglong)in_RAX >> 0x10),

-                   CONCAT11((char)((short)in_RAX % sVar2),(char)((short)in_RAX / sVar2)));

-  piVar1 = (int *)(lVar4 + -0x73);

-  *piVar1 = *piVar1 + -1;

-  if (((param_1 != (uchar **)(ulonglong)((int)lVar4 + 0x7bee2e)) &&

-      ((*(uint *)((longlong)param_1 + 0x1c) & 0x100) != 0)) &&

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

-    uVar3 = RdpX_GetActivityIdPrefix();

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

-             &WPP_1e24bb0281903cc1455d70aea08aca71_Traceguids,uVar3);

+  uVar10 = (undefined4)((ulonglong)in_stack_ffffffffffffffa0 >> 0x20);

+  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffff98 >> 0x20);

+  pbVar4 = *param_1;

+  if ((param_2 <= pbVar4) || (*(int *)(param_3 + 8) < 0)) {

+    return -0x7ff8ffa9;

   }

-  ClearDecompressor::LogError(unaff_R15,*(uint *)(unaff_RBP + 0x5f),-0x7ff8ffa9);

-  PixelMap::~PixelMap((PixelMap *)(unaff_RBP + -0x49));

+  bVar3 = *pbVar4;

+  *param_1 = pbVar4 + 1;

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

+      ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])

+     ) {

+    uVar8 = RdpX_GetActivityIdPrefix();

+    uVar24 = CONCAT44(uVar9,(uint)bVar3);

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

+              &WPP_0d370e1277e036cd761f55ce6c53ee1e_Traceguids,uVar8,uVar24);

+    uVar9 = (undefined4)((ulonglong)uVar24 >> 0x20);

+  }

+  ppuVar15 = (undefined **)WPP_GLOBAL_Control;

+  if (bVar3 < 0x80) {

+    puVar25 = *param_1;

+    if (param_2 < puVar25 + ((uint)bVar3 + (uint)bVar3 * 2)) {

+      return -0x7ff8ff86;

+    }

+    *param_1 = puVar25 + ((uint)bVar3 + (uint)bVar3 * 2);

+    uVar12 = bVar3 - 1;

+    lVar22 = 0;

+    uVar12 = uVar12 | uVar12 >> 1;

+    bVar17 = 0;

+    uVar12 = uVar12 | uVar12 >> 2;

+    bVar18 = 0;

+    iVar20 = 0;

+    uVar12 = uVar12 | uVar12 >> 4;

+    uVar16 = 0;

+    uVar12 = uVar12 | uVar12 >> 8;

+    uVar12 = uVar12 >> 0x10 | uVar12;

+    uVar12 = (uVar12 >> 1 & 0x55555555) + (uVar12 & 0x55555555);

+    uVar12 = (uVar12 >> 2 & 0x33333333) + (uVar12 & 0x33333333);

+    uVar12 = (uVar12 >> 4) + uVar12 & 0xf0f0f0f;

+    iVar13 = uVar12 + (uVar12 >> 8);

+    cVar5 = (char)iVar13;

+    cVar6 = (char)((uint)iVar13 >> 0x10);

+    bVar7 = ('\x01' << (cVar5 + cVar6 & 0x1fU)) - 1;

+    bVar23 = 0;

+    if (((ppuVar15 != &WPP_GLOBAL_Control) && ((*(uint *)((longlong)ppuVar15 + 0x1c) & 0x100) != 0))

+       && (4 < *(byte *)((longlong)ppuVar15 + 0x19))) {

+      uVar8 = RdpX_GetActivityIdPrefix();

+      uVar24 = CONCAT44(uVar9,(uint)bVar7);

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

+                &WPP_0d370e1277e036cd761f55ce6c53ee1e_Traceguids,uVar8,uVar24);

+      uVar9 = (undefined4)((ulonglong)uVar24 >> 0x20);

+      ppuVar15 = (undefined **)WPP_GLOBAL_Control;

+    }

+    puVar21 = *(uint **)(param_3 + 0x18);

+    puVar11 = (uint *)((ulonglong)(uint)(*(int *)(param_3 + 4) * *(int *)(param_3 + 8)) +

+                      (longlong)puVar21);

+    do {

+      if (puVar11 <= puVar21) {

+        puVar25 = *param_1;

+        if (puVar25 != param_2) {

+          lVar22 = -0x7ff8ffa9;

+          if (ppuVar15 == &WPP_GLOBAL_Control) {

+            return -0x7ff8ffa9;

+          }

+          if (((*(uint *)((longlong)ppuVar15 + 0x1c) & 0x100) != 0) &&

+             (1 < *(byte *)((longlong)ppuVar15 + 0x19))) {

+            uVar9 = RdpX_GetActivityIdPrefix();

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

+                       &WPP_0d370e1277e036cd761f55ce6c53ee1e_Traceguids,uVar9,puVar25,param_2);

+            uVar9 = (undefined4)((ulonglong)puVar25 >> 0x20);

+            ppuVar15 = (undefined **)WPP_GLOBAL_Control;

+          }

+        }

+        if (((ppuVar15 != &WPP_GLOBAL_Control) &&

+            ((*(uint *)((longlong)ppuVar15 + 0x1c) & 0x100) != 0)) &&

+           (4 < *(byte *)((longlong)ppuVar15 + 0x19))) {

+          uVar10 = RdpX_GetActivityIdPrefix();

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

+                    &WPP_0d370e1277e036cd761f55ce6c53ee1e_Traceguids,uVar10,

+                    CONCAT44(uVar9,(uint)bVar23));

+        }

+        return lVar22;

+      }

+      uVar12 = *(uint *)param_3;

+      for (puVar14 = puVar21; puVar14 < puVar21 + uVar12; puVar14 = puVar14 + 1) {

+        if (iVar20 == 0) {

+          if (bVar17 == 0) {

+            pbVar4 = *param_1;

+            bVar23 = bVar23 + 1;

+            if (param_2 < pbVar4 + 2) {

+              return -0x7ff8ff86;

+            }

+            bVar18 = *pbVar4 & bVar7;

+            bVar17 = *pbVar4 >> (cVar5 + cVar6 & 0x1fU);

+            *param_1 = pbVar4 + 1;

+            if ((bVar3 <= bVar18) || (bVar18 < bVar17)) {

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

+                if (((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0) &&

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

+                  uVar8 = RdpX_GetActivityIdPrefix();

+                  uVar24 = CONCAT44(uVar9,(uint)bVar18);

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

+                             &WPP_0d370e1277e036cd761f55ce6c53ee1e_Traceguids,uVar8,uVar24,

+                             CONCAT44(uVar10,(uint)bVar17));

+                  uVar9 = (undefined4)((ulonglong)uVar24 >> 0x20);

+                }

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

+                    ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) &&

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

+                  uVar10 = RdpX_GetActivityIdPrefix();

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

+                            &WPP_0d370e1277e036cd761f55ce6c53ee1e_Traceguids,uVar10,

+                            CONCAT44(uVar9,(uint)bVar23));

+                }

+              }

+              return -0x7ff8ffa9;

+            }

+            uVar19 = (uint)pbVar4[1];

+            bVar18 = bVar18 - bVar17;

+            pbVar2 = puVar25 + (ulonglong)bVar18 * 3;

+            uVar16 = ((pbVar2[2] | 0xffffff00) << 8 | (uint)pbVar2[1]) << 8 | (uint)*pbVar2;

+            *param_1 = pbVar4 + 2;

+            if (uVar19 == 0xff) {

+              puVar1 = (uint *)(pbVar4 + 4);

+              if (param_2 < puVar1) {

+                return -0x7ff8ff86;

+              }

+              uVar19 = (uint)*(ushort *)(pbVar4 + 2);

+              *param_1 = (uchar *)puVar1;

+              if (uVar19 == 0xffff) {

+                if (param_2 < pbVar4 + 8) {

+                  return -0x7ff8ff86;

+                }

+                uVar19 = *puVar1;

+                *param_1 = pbVar4 + 8;

+              }

+            }

+          }

+          else {

+            bVar18 = bVar18 + 1;

+            bVar17 = bVar17 - 1;

+            pbVar4 = puVar25 + (ulonglong)bVar18 * 3;

+            uVar16 = ((pbVar4[2] | 0xffffff00) << 8 | (uint)pbVar4[1]) << 8 | (uint)*pbVar4;

+            uVar19 = 0;

+          }

+          iVar20 = uVar19 + 1;

+        }

+        *puVar14 = uVar16;

+        iVar20 = iVar20 + -1;

+      }

+      puVar21 = (uint *)((longlong)puVar21 + (longlong)*(int *)(param_3 + 8));

+      ppuVar15 = (undefined **)WPP_GLOBAL_Control;

+    } while( true );

+  }

   return -0x7ff8ffa9;

 }
```

## `IsFeedbackHubTraceRunning`  (modified)

```diff
--- IsFeedbackHubTraceRunning
+++ IsFeedbackHubTraceRunning
@@ -1,137 +1,50 @@
 

-/* WARNING: Instruction at (ram,0x000180175fac) overlaps instruction at (ram,0x000180175faa)

-    */

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

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

-/* WARNING: Enum "enum_689": Some values do not have unique names */

-/* WARNING: Enum "enum_690": Some values do not have unique names */

+/* int __cdecl IsFeedbackHubTraceRunning(void) */

 

 int __cdecl IsFeedbackHubTraceRunning(void)

 

 {

-  char *pcVar1;

-  short sVar2;

-  short sVar3;

-  UINT32 UVar4;

-  DISPLAYCONFIG_2DREGION DVar5;

-  char cVar6;

-  uint uVar7;

-  uint uVar8;

-  char *in_RAX;

-  __uint64 _Var10;

-  DISPLAYCONFIG_MODE_INFO *modeInfoArray;

-  short *psVar11;

-  char cVar12;

-  longlong in_RCX;

-  undefined8 uVar13;

-  ulonglong unaff_RBX;

-  longlong unaff_RBP;

-  uint unaff_EDI;

-  short *unaff_R13;

-  DISPLAYCONFIG_PATH_INFO *unaff_R14;

-  UINT32 unaff_R15D;

-  ulonglong uVar14;

-  uint in_stack_00000030;

-  LUID *in_stack_00000038;

-  UINT32 *in_stack_00000040;

-  UINT32 *in_stack_00000048;

-  undefined8 *in_stack_00000050;

-  char *pcVar9;

+  bool bVar1;

+  uint uVar2;

+  _GUID *in_R8;

+  _GUID *in_R9;

+  char *local_res8;

+  char *local_res10 [3];

   

-  cVar6 = (char)in_RAX + *in_RAX;

-  pcVar9 = (char *)CONCAT71((int7)((ulonglong)in_RAX >> 8),cVar6);

-  cVar12 = (char)in_RCX;

-  *(char *)(unaff_RBX - 0x47cbdbb4) = *(char *)(unaff_RBX - 0x47cbdbb4) + cVar12;

-  *pcVar9 = *pcVar9 + cVar6;

-  pcVar1 = pcVar9 + -9;

-  cVar6 = *pcVar1;

-  *pcVar1 = *pcVar1 + cVar12;

-  if (in_RCX != 1 && *pcVar1 == '\0') {

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

-    halt_baddata();

-  }

-  _Var10 = (ulonglong)pcVar9 & 0xffffffff;

-  if (SCARRY1(cVar6,cVar12)) {

-    _Var10 = (__uint64)unaff_EDI;

-  }

-  modeInfoArray = operator_new(_Var10);

-  if (modeInfoArray == (DISPLAYCONFIG_MODE_INFO *)0x0) {

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

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

-       ((byte)unaff_R15D <= (byte)WPP_GLOBAL_Control[0x19])) {

-      uVar7 = RdpWppGetCurrentThreadActivityIdPrefix();

-      WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x42,

-                &WPP_f6dd11f984cc3fc0cf39563e1bf2662a_Traceguids,uVar7,"DISPLAYCONFIG_MODE_INFO");

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

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_DisableFeedbackHubTrace> *)

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

+                               ::__l2::impl);

+  if (bVar1) {

+    if (4 < DAT_0) {

+      local_res8 = (char *)((ulonglong)local_res8 & 0xffffffff00000000);

+      local_res10[0] = "IsFeedbackHubTraceRunning";

+      _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<4>_>

+                ((_tlgProvider_t *)&DAT_0,&DAT_18085c3dc,in_R8,in_R9,

+                 (_tlgWrapSz<char> *)local_res10,(_tlgWrapperByVal<4> *)&local_res8);

     }

-    unaff_RBX = 0x8007000e;

+    uVar2 = 0;

   }

   else {

-    uVar7 = QueryDisplayConfig(unaff_R15D,&stack0x00000030,unaff_R14,(UINT32 *)&stack0x00000034,

-                               modeInfoArray,(DISPLAYCONFIG_TOPOLOGY_ID *)0x0);

-    if (uVar7 == 0) {

-      for (uVar14 = 0; (uint)uVar14 < in_stack_00000030; uVar14 = (ulonglong)((uint)uVar14 + 1)) {

-        *(undefined4 *)(unaff_RBP + -0x51) = 1;

-        *(LUID *)(unaff_RBP + -0x49) = unaff_R14[uVar14].sourceInfo.adapterId;

-        *(UINT32 *)(unaff_RBP + -0x41) = unaff_R14[uVar14].sourceInfo.id;

-        *(undefined4 *)(unaff_RBP + -0x4d) = 0x54;

-        memset((void *)(unaff_RBP + -0x3d),0,0x40);

-        uVar7 = DisplayConfigGetDeviceInfo((DISPLAYCONFIG_DEVICE_INFO_HEADER *)(unaff_RBP + -0x51));

-        if (uVar7 != 0) {

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

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

-          goto LAB_0;

-          uVar8 = RdpWppGetCurrentThreadActivityIdPrefix();

-          uVar13 = 0x44;

-          goto LAB_1;

-        }

-        psVar11 = unaff_R13;

-        do {

-          sVar2 = *psVar11;

-          sVar3 = *(short *)((longlong)psVar11 + ((unaff_RBP + -0x3d) - (longlong)unaff_R13));

-          if (sVar2 != sVar3) break;

-          psVar11 = psVar11 + 1;

-        } while (sVar3 != 0);

-        if (sVar2 == sVar3) {

-          unaff_RBX = 0;

-          uVar13 = *(undefined8 *)

-                    &modeInfoArray[unaff_R14[uVar14].targetInfo.modeInfoIdx].field3_0x10.sourceMode.

-                     position.y;

-          DVar5 = modeInfoArray[unaff_R14[uVar14].targetInfo.modeInfoIdx].field3_0x10.targetMode.

-                  targetVideoSignalInfo.activeSize;

-          *in_stack_00000038 = unaff_R14[uVar14].targetInfo.adapterId;

-          UVar4 = unaff_R14[uVar14].sourceInfo.id;

-          *(undefined8 *)(unaff_RBP + -0x79) = uVar13;

-          *(DISPLAYCONFIG_2DREGION *)(unaff_RBP + -0x71) = DVar5;

-          *in_stack_00000040 = UVar4;

-          *in_stack_00000048 = unaff_R14[uVar14].targetInfo.id;

-          *in_stack_00000050 = *(undefined8 *)(unaff_RBP + -0x79);

-          break;

-        }

-      }

+    if (4 < DAT_0) {

+      in_R8 = (_GUID *)0x0;

+      local_res8 = "IsFeedbackHubTraceRunning was called";

+      _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>_>

+                ((_tlgProvider_t *)&DAT_0,&DAT_18085c356,(_GUID *)0x0,in_R9,

+                 (_tlgWrapSz<char> *)&local_res8);

     }

-    else {

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

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

-         ((byte)unaff_R15D <= (byte)WPP_GLOBAL_Control[0x19])) {

-        uVar8 = RdpWppGetCurrentThreadActivityIdPrefix();

-        uVar13 = 0x43;

-LAB_1:

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

-                  &WPP_f6dd11f984cc3fc0cf39563e1bf2662a_Traceguids,uVar8,uVar7);

-      }

-LAB_0:

-      if ((int)uVar7 < 1) {

-        unaff_RBX = (ulonglong)uVar7;

-      }

-      else {

-        unaff_RBX = (ulonglong)(uVar7 & 0xffff | 0x80070000);

-      }

+    uVar2 = (uint)(DAT_0 != 0);

+    if (4 < DAT_0) {

+      local_res8 = (char *)CONCAT44(local_res8._4_4_,uVar2);

+      local_res10[0] = "IsFeedbackHubTraceRunning finished";

+      _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<4>_>

+                ((_tlgProvider_t *)&DAT_0,&DAT_18085c3ad,in_R8,in_R9,

+                 (_tlgWrapSz<char> *)local_res10,(_tlgWrapperByVal<4> *)&local_res8);

     }

   }

-  operator_delete(unaff_R14);

-  if (modeInfoArray != (DISPLAYCONFIG_MODE_INFO *)0x0) {

-    operator_delete(modeInfoArray);

-  }

-  return (int)unaff_RBX;

+  return uVar2;

 }
```

## ``dynamic_initializer_for_'g_cfType''`  (modified)

```diff
--- `dynamic_initializer_for_'g_cfType''
+++ `dynamic_initializer_for_'g_cfType''
@@ -1,8 +1,8 @@
 

-void _dynamic_initializer_for__g_cfType__(_func_5014 *param_1)

+void _dynamic_initializer_for__g_cfType__(void)

 

 {

-  atexit(param_1);

+  atexit(_dynamic_atexit_destructor_for__g_cfType__);

   return;

 }
```

## `RdpRemoteAppCore::OnRailPdu`  (modified)

```diff
--- RdpRemoteAppCore::OnRailPdu
+++ RdpRemoteAppCore::OnRailPdu
@@ -1,2 +1,3287 @@
-Failed to decompile mstscax.dll - .ProgramDB RdpRemoteAppCore::OnRailPdu : 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 long __cdecl RdpRemoteAppCore::OnRailPdu(struct tagTS_RAIL_PDU * __ptr64,unsigned

+   int) __ptr64 */

+

+long __thiscall

+RdpRemoteAppCore::OnRailPdu(RdpRemoteAppCore *this,tagTS_RAIL_PDU *param_1,uint param_2)

+

+{

+  tagTS_RAIL_ORDER_LOCALMOVESIZE_BODY *ptVar1;

+  RdpRemoteAppCore *pRVar2;

+  ushort uVar3;

+  short sVar4;

+  ulong uVar5;

+  undefined4 uVar6;

+  long lVar7;

+  _XResult32 _Var8;

+  int iVar9;

+  _XBool32 _Var10;

+  code *pcVar11;

+  RdpInterfaceDesktopRemoteAppWindow *pRVar12;

+  ITSClientPlatformInstance *pIVar13;

+  RdpXInterfaceShellNotifyInformationInternal **ppRVar14;

+  ITSClientPlatformInstance *pIVar15;

+  __uint64 _Var16;

+  void *pvVar17;

+  ITSClientPlatformInstance *pIVar18;

+  ulonglong uVar19;

+  int iVar20;

+  uint uVar21;

+  RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *pRVar22;

+  longlong *plVar23;

+  TCntPtr<ITSThread> *this_00;

+  RdpXSPtr<RdpXInterfaceCriticalSection> *this_01;

+  undefined4 uVar24;

+  wchar_t *pwVar25;

+  tagTS_RAIL_PDU *ptVar26;

+  undefined8 uVar27;

+  uint *puVar28;

+  int *piVar29;

+  TCntPtr<ITSClientPlatformInstance> *this_02;

+  long lVar30;

+  uint uVar31;

+  int iVar32;

+  ulonglong uVar33;

+  int iVar34;

+  tagTS_RAIL_PDU *ptVar35;

+  ulonglong uVar36;

+  tagTS_RAIL_PDU tVar37;

+  ushort uVar38;

+  int iVar39;

+  longlong lVar40;

+  undefined1 auStackY_bf8 [32];

+  int local_b38;

+  int local_b34;

+  int local_b30;

+  ComPlainSmartPtr<ITSWindowInformation> local_b20 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_b18 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_b10 [8];

+  uint local_b08;

+  ComPlainSmartPtr<ITSWindowInformation> local_b00 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_af8 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_af0 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_ae8 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_ae0 [8];

+  tagTS_RAIL_PDU *local_ad8;

+  uint local_ad0;

+  uint local_acc;

+  ComPlainSmartPtr<ITSWindowInformation> local_ac8 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_ac0 [8];

+  uint local_ab8;

+  undefined8 local_ab0;

+  ITSWndPluginEx *local_aa8;

+  longlong *local_aa0;

+  ComPlainSmartPtr<ITSWindowInformation> local_a98 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a90 [8];

+  RdpXInterfaceRemoteAppWindow *local_a88;

+  ComPlainSmartPtr<ITSWindowInformation> local_a80 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a78 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a70 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a68 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a60 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a58 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a50 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a48 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a40 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a38 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a30 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a28 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a20 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a18 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a10 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_a08 [8];

+  uint local_a00;

+  longlong *local_9f8;

+  ComPlainSmartPtr<ITSWindowInformation> local_9f0 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_9e8 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_9e0 [8];

+  uint local_9d8;

+  RdpXInterfaceRemoteAppWindow *local_9d0;

+  RdpXInterfaceRemoteAppWindow *local_9c8;

+  ComPlainSmartPtr<ITSWindowInformation> local_9c0 [8];

+  longlong *local_9b8;

+  RdpXInterfaceRemoteAppWindow *local_9b0;

+  undefined8 local_9a8;

+  longlong *local_9a0;

+  RdpXInterfaceRemoteAppWindow *local_998;

+  longlong *local_990;

+  RdpXInterfaceRemoteAppMoveInfo *local_988;

+  RdpXInterfaceRemoteAppWindow *local_980;

+  RdpXInterfaceRemoteAppWindow *local_978;

+  RdpXInterfaceRemoteAppWindow *local_970;

+  RdpXInterfaceRemoteAppWindow *local_968;

+  ComPlainSmartPtr<ITSWindowInformation> local_960 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_958 [8];

+  ComPlainSmartPtr<ITSWindowInformation> local_950 [8];

+  undefined8 local_948;

+  undefined8 uStack_940;

+  tagTS_RAIL_PDU *local_938;

+  ushort *local_930;

+  __uint64 local_928;

+  tagTS_RAIL_PDU *local_920;

+  undefined8 local_918;

+  undefined8 uStack_910;

+  undefined8 local_908;

+  ulonglong uStack_900;

+  uint local_8f8;

+  undefined4 local_8f4;

+  undefined4 local_8f0;

+  uint local_8ec;

+  int local_8e8;

+  int local_8e4;

+  int local_8e0;

+  int local_8dc;

+  int local_8d8;

+  int local_8d4;

+  uint local_8d0;

+  int local_8cc;

+  undefined8 local_8c8;

+  undefined8 uStack_8c0;

+  undefined8 local_8b8;

+  int aiStack_8b0 [10];

+  ushort local_888 [264];

+  ushort local_678 [264];

+  ushort local_468 [264];

+  ushort local_258 [264];

+  ulonglong local_48;

+  

+  local_48 = __security_cookie ^ (ulonglong)auStackY_bf8;

+  uVar19 = 0;

+  lVar7 = 0;

+  lVar30 = 0;

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

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

+      return -0x7fffbffd;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+      return -0x7fffbffd;

+    }

+    iVar34 = 0;

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return -0x7fffbffd;

+    }

+    uVar6 = RdpX_GetActivityIdPrefix();

+LAB_0:

+    WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),iVar34 + 0x3e,

+              &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+    return -0x7fffbffd;

+  }

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

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

+      return -0x7fffbffd;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+      return -0x7fffbffd;

+    }

+    iVar34 = 2;

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return -0x7fffbffd;

+    }

+    uVar6 = RdpX_GetActivityIdPrefix();

+    goto LAB_0;

+  }

+  if (param_2 < 4) {

+    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;

+    }

+    uVar6 = RdpX_GetActivityIdPrefix();

+    uVar24 = 0x41;

+LAB_1:

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

+             &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+    return -0x7fffbffb;

+  }

+  if (param_2 < *(ushort *)(param_1 + 2)) {

+    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;

+    }

+    uVar6 = RdpX_GetActivityIdPrefix();

+    uVar24 = 0x42;

+    goto LAB_1;

+  }

+  RDPRailTraceLogging::TraceRailPDU(param_1);

+  uVar3 = *(ushort *)param_1;

+  if (0x80 < uVar3) goto LAB_2;

+  iVar34 = 0;

+  if (uVar3 == 0x80) {

+LAB_3:

+    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),0x46,

+               &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+    }

+    if (*(ushort *)(param_1 + 2) < 0x10) {

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

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

+        RdpX_GetActivityIdPrefix();

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

+                 &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+      }

+      LogRemoteAppError(this + 0x10,(ushort *)L"TS_RAIL_ORDER_EXEC_RESULT too short",0x80004005,0,0)

+      ;

+      return -0x7fffbffb;

+    }

+    if ((ulonglong)*(ushort *)(param_1 + 2) == (ulonglong)*(ushort *)(param_1 + 0xe) + 0x10) {

+      memset(local_258,0,0x208);

+      StringCchCopyNW(local_258,0x104,(ushort *)(param_1 + 0x10),

+                      (ulonglong)(*(ushort *)(param_1 + 0xe) >> 1));

+      LogRemoteAppEventF(this + 0x10,

+                         (ushort *)

+                         L"ExecResultRailOrderReceived: ApplicationName=%s, Flags=0x%hx, Result=0x%hx, RawResult=0x%x"

+                         ,0,local_258);

+      lVar7 = OnExecResult(this + -0x30,(tagTS_RAIL_ORDER_EXEC_RESULT_BODY *)(param_1 + 4));

+      return lVar7;

+    }

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

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

+      RdpX_GetActivityIdPrefix();

+      WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x48,

+                 &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+    }

+    lVar7 = -0x7fffbffb;

+    uVar31 = 0x80004005;

+    pwVar25 = L"TS_RAIL_ORDER_EXEC_RESULT wrong size got[%u] expected[%u]";

+LAB_4:

+    LogRemoteAppErrorF(this + 0x10,(ushort *)pwVar25,uVar31,0);

+    return lVar7;

+  }

+  uVar38 = 0;

+  if (uVar3 < 0x19) {

+    if (uVar3 == 0x18) {

+      if (*(short *)(param_1 + 2) == 0x41c) {

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

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

+          uVar6 = RdpX_GetActivityIdPrefix();

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

+                      &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+        }

+        CUT::PathFindFileNameW((ushort *)(param_1 + 0x214));

+        CUT::PathFindFileNameW((ushort *)(param_1 + 8));

+        LogRemoteAppEventF(this + 0x10,

+                           (ushort *)

+                           L"GetAppIdRespExRailOrderReceived: WindowId=0x%x, CensoredAppId=%s, ProcessId=%u, CensoredProcessImageName=%s"

+                           ,0,(ulonglong)*(uint *)(param_1 + 4));

+        local_9c8 = (RdpXInterfaceRemoteAppWindow *)0x0;

+        pRVar2 = this + -0x30;

+        lVar7 = GetRemoteAppWindow(pRVar2,*(ulong *)(param_1 + 4),&local_9c8);

+        if (lVar7 < 0) {

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

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

+                      &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+        }

+        else {

+          lVar7 = UpdateProcessInfo(pRVar2,local_9c8,*(ulong *)(param_1 + 0x210),

+                                    (ushort *)(param_1 + 0x214));

+          if (((lVar7 < 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_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x58,

+                       &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+          lVar7 = UpdateAppID(pRVar2,local_9c8,(ushort *)(param_1 + 8));

+          if (((lVar7 < 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_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x59,

+                       &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+        }

+        pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_9c8;

+        goto LAB_5;

+      }

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

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

+        RdpX_GetActivityIdPrefix();

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

+                  &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+      }

+      pwVar25 = L"Invalid size for TS_RAIL_ORDER_GET_APPID_RESP_EX [%d]";

+      lVar7 = -0x7fffbffb;

+      uVar31 = 0x80004005;

+      goto LAB_6;

+    }

+    if (uVar3 < 0x10) {

+      if (uVar3 == 0xf) {

+        if (*(short *)(param_1 + 2) == 0x210) {

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

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

+                      &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+          CUT::PathFindFileNameW((ushort *)(param_1 + 8));

+          LogRemoteAppEventF(this + 0x10,

+                             (ushort *)

+                             L"GetAppIdRespRailOrderReceived: WindowId=0x%x, CensoredAppId=%s",0,

+                             (ulonglong)*(uint *)(param_1 + 4));

+          lVar7 = UpdateAppID(this + -0x30,*(ulong *)(param_1 + 4),(ushort *)(param_1 + 8));

+          if (-1 < lVar7) {

+            return lVar7;

+          }

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

+            return lVar7;

+          }

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

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

+                         &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              return lVar7;

+            }

+            return lVar7;

+          }

+          return lVar7;

+        }

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

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

+          RdpX_GetActivityIdPrefix();

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

+                    &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+        }

+        pwVar25 = L"Invalid size for TS_RAIL_ORDER_GET_APPID_RESP [%d]";

+        lVar7 = -0x7fffbffb;

+        uVar31 = 0x80004005;

+        goto LAB_6;

+      }

+      if (uVar3 == 3) {

+        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_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x5a,

+                   &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+        }

+        OnRailOrderSysParam(this + -0x30,param_1);

+        return 0;

+      }

+      if (uVar3 == 5) {

+LAB_7:

+        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_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x43,

+                   &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+        }

+        pRVar2 = this + -0x30;

+        lVar7 = SetV2CoreProperty(pRVar2,4);

+        if (((lVar7 < 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_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x44,

+                     &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+        }

+        lVar7 = ReceiveHandshake(pRVar2,param_1,(ulong *)(this + 0xac));

+        if (-1 < lVar7) {

+          lVar7 = OnHandshakeOrCaps(pRVar2,1);

+          return lVar7;

+        }

+        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_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x45,

+                     &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+        }

+        lVar7 = RdpRemoteAppPlugin::DisconnectSession

+                          ((RdpRemoteAppPlugin *)(*(longlong *)(this + 0x58) + 0x50));

+        return lVar7;

+      }

+      if (uVar3 == 7) goto LAB_3;

+      if (uVar3 == 9) {

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

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

+          RdpX_GetActivityIdPrefix();

+          WPP_SF_DdDd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x49,

+                      &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+        }

+        if (*(short *)(param_1 + 2) == 0x10) {

+          ptVar1 = (tagTS_RAIL_ORDER_LOCALMOVESIZE_BODY *)(param_1 + 4);

+          LogRemoteAppEventF(this + 0x10,

+                             (ushort *)

+                             L"LocalMoveSizeRailOrderReceived: WindowId=0x%x, IsStart=%hu, Type=0x%hx, X=%hi, Y=%hi"

+                             ,0,(ulonglong)*(uint *)ptVar1);

+          local_9d0 = (RdpXInterfaceRemoteAppWindow *)0x0;

+          local_9f8 = (longlong *)0x0;

+          lVar7 = GetRemoteAppWindow(this + -0x30,*(ulong *)ptVar1,&local_9d0);

+          if (lVar7 < 0) {

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

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

+                         &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+            }

+          }

+          else {

+            pRVar12 = GetDesktopRemoteAppWindow(this + -0x30,local_9d0);

+            RdpXSPtr<RdpXInterfaceTapClientShellCallback>::operator=

+                      ((RdpXSPtr<RdpXInterfaceTapClientShellCallback> *)&local_9f8,

+                       (RdpXInterfaceTapClientShellCallback *)pRVar12);

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

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

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

+                           &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+              lVar7 = 1;

+            }

+            else if (*(short *)(param_1 + 8) == 0) {

+              if (*(short *)(param_1 + 10) == 9) {

+                iVar34 = (int)*(short *)(param_1 + 0xc);

+              }

+              else {

+                iVar34 = -1;

+              }

+              (**(code **)(*local_9f8 + 400))(local_9f8,1,0,iVar34);

+            }

+            else {

+              local_988 = (RdpXInterfaceRemoteAppMoveInfo *)0x0;

+              _Var8 = RemoteAppMoveSizeInfo::CreateInstance(ptVar1,&local_988);

+              lVar7 = MapXResultToHR(_Var8);

+              if (lVar7 < 0) {

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

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

+                {

+                  uVar6 = RdpX_GetActivityIdPrefix();

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

+                             &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                }

+              }

+              else {

+                (**(code **)(*local_9f8 + 0x188))(local_9f8,local_988);

+              }

+              RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                        ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_988);

+            }

+          }

+          RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                    ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_9f8);

+          pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_9d0;

+          goto LAB_5;

+        }

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

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

+          RdpX_GetActivityIdPrefix();

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

+                    &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+        }

+        pwVar25 = L"Invalid size for TS_RAIL_ORDER_LOCALMOVESIZE [%d]";

+        lVar7 = -0x7fffbffb;

+        uVar31 = 0x80004005;

+        goto LAB_6;

+      }

+      if (uVar3 == 10) {

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

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

+          RdpX_GetActivityIdPrefix();

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

+                    &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+        }

+        if (*(short *)(param_1 + 2) == 0x18) {

+          local_ad8 = param_1 + 8;

+          LogRemoteAppEventF(this + 0x10,

+                             (ushort *)

+                             L"MinMaxInfoRailOrderReceived: WindowId=0x%x, MaxWidth=%hi, MaxHeight=%hi, MaxPosX=%hi, MaxPosY=%hi, MinTrackWidth=%hi, MinTrackHeight=%hi, MaxTrackWidth=%hi, MaxTraceHeight=%hi"

+                             ,0,(ulonglong)*(uint *)(param_1 + 4));

+          local_9b0 = (RdpXInterfaceRemoteAppWindow *)0x0;

+          local_9b8 = (longlong *)0x0;

+          lVar7 = GetRemoteAppWindow(this + -0x30,*(ulong *)(param_1 + 4),&local_9b0);

+          if (lVar7 < 0) {

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

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

+                         &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+            }

+          }

+          else {

+            pRVar12 = GetDesktopRemoteAppWindow(this + -0x30,local_9b0);

+            RdpXSPtr<RdpXInterfaceTapClientShellCallback>::operator=

+                      ((RdpXSPtr<RdpXInterfaceTapClientShellCallback> *)&local_9b8,

+                       (RdpXInterfaceTapClientShellCallback *)pRVar12);

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

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

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

+                           &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+              lVar7 = 1;

+            }

+            else {

+              piVar29 = aiStack_8b0;

+              local_8b8 = 0;

+              aiStack_8b0[0] = 0;

+              aiStack_8b0[1] = 0;

+              aiStack_8b0[6] = 0;

+              aiStack_8b0[7] = 0;

+              aiStack_8b0[2] = 0;

+              aiStack_8b0[3] = 0;

+              aiStack_8b0[4] = 0;

+              aiStack_8b0[5] = 0;

+              lVar40 = 8;

+              ptVar26 = local_ad8;

+              do {

+                sVar4 = *(short *)ptVar26;

+                ptVar26 = ptVar26 + 2;

+                *piVar29 = (int)sVar4;

+                piVar29 = piVar29 + 1;

+                lVar40 = lVar40 + -1;

+              } while (lVar40 != 0);

+              (**(code **)(*local_9b8 + 0x198))(local_9b8,&local_8b8);

+            }

+          }

+          RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                    ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_9b8);

+          pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_9b0;

+          goto LAB_5;

+        }

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

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

+          RdpX_GetActivityIdPrefix();

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

+                    &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+        }

+        pwVar25 = L"Invalid size for TS_RAIL_ORDER_MINMAXINFO [%d]";

+        lVar7 = -0x7fffbffb;

+        uVar31 = 0x80004005;

+        goto LAB_6;

+      }

+      if (uVar3 == 0xd) {

+        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),0x5b);

+        }

+        if (*(short *)(param_1 + 2) == 8) {

+          LogRemoteAppEventF(this + 0x10,(ushort *)L"LangBarInfoRailOrderReceived: Status=0x%x",0,

+                             (ulonglong)*(uint *)(param_1 + 4));

+          pIVar13 = *(ITSClientPlatformInstance **)(this + 0x88);

+          if (pIVar13 == (ITSClientPlatformInstance *)0x0) {

+            return 0;

+          }

+          uVar31 = *(uint *)(param_1 + 4);

+          pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x18);

+          goto LAB_8;

+        }

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

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

+          RdpX_GetActivityIdPrefix();

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

+                    &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+        }

+        pwVar25 = L"Invalid size for TS_RAIL_ORDER_LANGBARINFO [%d]";

+        lVar7 = -0x7fffbffb;

+        uVar31 = 0x80004005;

+        goto LAB_6;

+      }

+    }

+    else {

+      if (uVar3 == 0x10) {

+        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),0x5d);

+        }

+        if (*(ushort *)(param_1 + 2) < 0x10) {

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

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

+            RdpX_GetActivityIdPrefix();

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

+                      &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+          }

+          pwVar25 = L"Invalid size for TS_RAIL_ORDER_TASKBARINFO [%d]";

+          lVar7 = -0x7fffbffb;

+          uVar31 = 0x80004005;

+          goto LAB_6;

+        }

+        LogRemoteAppEventF(this + 0x10,

+                           (ushort *)

+                           L"TaskbarInfoRailOrderReceived: Message=0x%x, WindowIdTab=0x%x, Body=0x%x"

+                           ,0,(ulonglong)*(uint *)(param_1 + 4));

+        uStack_900 = 0;

+        uVar5 = *(ulong *)(param_1 + 8);

+        iVar34 = *(int *)(param_1 + 4);

+        local_908 = *(undefined8 *)(param_1 + 4);

+        if (iVar34 == 5) {

+          uStack_900 = (ulonglong)*(uint *)(param_1 + 0xc) << 0x20;

+        }

+        else {

+          if (3 < iVar34 - 1U) {

+            if (iVar34 == 6) {

+              local_978 = (RdpXInterfaceRemoteAppWindow *)0x0;

+              lVar7 = GetRemoteAppWindow(this + -0x30,uVar5,&local_978);

+              if (-1 < lVar7) {

+                (**(code **)(*(longlong *)local_978 + 0x108))(local_978,0x100000);

+                pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_978;

+                goto LAB_9;

+              }

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

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

+              {

+                uVar6 = RdpX_GetActivityIdPrefix();

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

+                          &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+              pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_978;

+              goto LAB_5;

+            }

+            if (iVar34 == 7) {

+              local_970 = (RdpXInterfaceRemoteAppWindow *)0x0;

+              lVar7 = GetRemoteAppWindow(this + -0x30,uVar5,&local_970);

+              if (-1 < lVar7) {

+                (**(code **)(*(longlong *)local_970 + 0x108))(local_970,0x200000);

+                pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_970;

+                goto LAB_9;

+              }

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

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

+              {

+                uVar6 = RdpX_GetActivityIdPrefix();

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

+                          &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+              pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_970;

+              goto LAB_5;

+            }

+            if (iVar34 != 8) {

+              if (iVar34 == 9) {

+                local_998 = (RdpXInterfaceRemoteAppWindow *)0x0;

+                local_9a0 = (longlong *)0x0;

+                if ((uint)*(ushort *)(param_1 + 2) < *(ushort *)(param_1 + 0xc) + 0xe) {

+                  if ((((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),0x6a,

+                              &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                  }

+                  lVar7 = -0x7fff0001;

+                }

+                else {

+                  lVar7 = GetRemoteAppWindow(this + -0x30,uVar5,&local_998);

+                  if (-1 < lVar7) {

+                    pRVar12 = GetDesktopRemoteAppWindow(this + -0x30,local_998);

+                    RdpXSPtr<RdpXInterfaceTapClientShellCallback>::operator=

+                              ((RdpXSPtr<RdpXInterfaceTapClientShellCallback> *)&local_9a0,

+                               (RdpXInterfaceTapClientShellCallback *)pRVar12);

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

+                       ((ushort)(*(short *)(param_1 + 0xc) - 3U) < 0x206)) {

+                      _Var8 = (**(code **)(*local_9a0 + 0x1a8))

+                                        (local_9a0,param_1 + 0xe,*(ushort *)(param_1 + 0xc) >> 1);

+                      lVar7 = MapXResultToHR(_Var8);

+                      if ((lVar7 < 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_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x6c,

+                                   &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                      }

+                    }

+                    RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::

+                    ~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                              ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_9a0);

+                    pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_998;

+                    goto LAB_9;

+                  }

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

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

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

+                    uVar6 = RdpX_GetActivityIdPrefix();

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

+                              &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                  }

+                }

+                RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                          ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_9a0);

+                pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_998;

+                goto LAB_5;

+              }

+              if (iVar34 != 10) {

+                return 0;

+              }

+              local_968 = (RdpXInterfaceRemoteAppWindow *)0x0;

+              local_990 = (longlong *)0x0;

+              lVar7 = GetRemoteAppWindow(this + -0x30,uVar5,&local_968);

+              if (lVar7 < 0) {

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

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

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

+                  uVar6 = RdpX_GetActivityIdPrefix();

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

+                            &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                }

+                RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                          ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_990);

+                pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_968;

+                goto LAB_5;

+              }

+              pRVar12 = GetDesktopRemoteAppWindow(this + -0x30,local_968);

+              RdpXSPtr<RdpXInterfaceTapClientShellCallback>::operator=

+                        ((RdpXSPtr<RdpXInterfaceTapClientShellCallback> *)&local_990,

+                         (RdpXInterfaceTapClientShellCallback *)pRVar12);

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

+                _Var8 = (**(code **)(*local_990 + 0x1a0))(local_990,0);

+                lVar7 = MapXResultToHR(_Var8);

+                if (((lVar7 < 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_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x6e,

+                             &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                }

+                _Var8 = (**(code **)(*local_990 + 0x1a8))(local_990,0,0);

+                lVar7 = MapXResultToHR(_Var8);

+                if (((lVar7 < 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_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x6f,

+                             &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                }

+              }

+              RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                        ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_990);

+              pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_968;

+              goto LAB_9;

+            }

+            local_a88 = (RdpXInterfaceRemoteAppWindow *)0x0;

+            local_aa0 = (longlong *)0x0;

+            local_aa8 = (ITSWndPluginEx *)0x0;

+            local_ab0 = 0;

+            lVar7 = GetWndPlugin(this + -0x30,&local_aa8);

+            if (lVar7 < 0) {

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar27 = 0x61;

+LAB_10:

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

+                           &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+            }

+            else {

+              lVar7 = GetRemoteAppWindow(this + -0x30,*(ulong *)(param_1 + 8),&local_a88);

+              if (lVar7 < 0) {

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

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

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

+                  uVar6 = RdpX_GetActivityIdPrefix();

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

+                            &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                }

+              }

+              else {

+                if (param_1[0xd] == (tagTS_RAIL_PDU)0x0) {

+                  uVar31 = 0;

+                  tVar37 = (tagTS_RAIL_PDU)0x20;

+                  if (*(ushort *)(param_1 + 2) < 0x24) {

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

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

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

+                      uVar6 = RdpX_GetActivityIdPrefix();

+                      uVar27 = 0x65;

+LAB_11:

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

+                                &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                    }

+                  }

+                  else {

+                    if (((byte)param_1[0x13] & 2) != 0) {

+                      tVar37 = param_1[0x18];

+                      uVar31 = (uint)*(ushort *)(param_1 + 0x1a);

+                    }

+                    if (*(int *)(param_1 + 0x20) + 0x24 + uVar31 + *(int *)(param_1 + 0x1c) <=

+                        (uint)*(ushort *)(param_1 + 2)) {

+                      local_ad8 = *(tagTS_RAIL_PDU **)local_aa8;

+                      lVar7 = (**(code **)(local_ad8 + 0x40))

+                                        (local_aa8,param_1[0x12],*(undefined2 *)(param_1 + 0x10),

+                                         tVar37);

+                      if (-1 < lVar7) goto LAB_12;

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

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

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

+                        uVar6 = RdpX_GetActivityIdPrefix();

+                        uVar27 = 0x67;

+                        goto LAB_10;

+                      }

+                      goto LAB_13;

+                    }

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

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

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

+                      uVar6 = RdpX_GetActivityIdPrefix();

+                      uVar27 = 0x66;

+                      goto LAB_11;

+                    }

+                  }

+                }

+                else {

+                  if (0x13 < *(ushort *)(param_1 + 2)) {

+                    lVar7 = (**(code **)(*(longlong *)local_aa8 + 0x38))

+                                      (local_aa8,param_1[0x12],*(undefined2 *)(param_1 + 0x10),

+                                       &local_ab0);

+                    if (-1 < lVar7) {

+LAB_12:

+                      pRVar12 = GetDesktopRemoteAppWindow(this + -0x30,local_a88);

+                      RdpXSPtr<RdpXInterfaceTapClientShellCallback>::operator=

+                                ((RdpXSPtr<RdpXInterfaceTapClientShellCallback> *)&local_aa0,

+                                 (RdpXInterfaceTapClientShellCallback *)pRVar12);

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

+                        iVar34 = (**(code **)(*local_aa0 + 0x1a0))(local_aa0,local_ab0);

+                        if ((((iVar34 < 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_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x68,

+                                     &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                        }

+                        _Var8 = (**(code **)(*local_aa0 + 0x1a8))(local_aa0,0,0);

+                        lVar7 = MapXResultToHR(_Var8);

+                        if (((lVar7 < 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_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x69,

+                                     &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                        }

+                      }

+                      RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::

+                      ~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                                ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_ab0);

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

+                      RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::

+                      ~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                                ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_aa0);

+                      pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_a88;

+LAB_9:

+                      RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::

+                      ~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>(pRVar22);

+                      return 0;

+                    }

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

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

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

+                      uVar6 = RdpX_GetActivityIdPrefix();

+                      uVar27 = 100;

+                      goto LAB_10;

+                    }

+                    goto LAB_13;

+                  }

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

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

+                     ) {

+                    uVar6 = RdpX_GetActivityIdPrefix();

+                    uVar27 = 99;

+                    goto LAB_11;

+                  }

+                }

+                lVar7 = -0x7fff0001;

+              }

+            }

+LAB_13:

+            RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                      ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_ab0);

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

+            RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                      ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_aa0);

+            pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_a88;

+            goto LAB_5;

+          }

+          uStack_900 = (ulonglong)*(uint *)(param_1 + 0xc);

+        }

+        plVar23 = *(longlong **)(this + 0x78);

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

+          return 0;

+        }

+        puVar28 = (uint *)&local_908;

+        pcVar11 = *(code **)(*plVar23 + 0xa0);

+LAB_14:

+        (*pcVar11)(plVar23,puVar28);

+        return 0;

+      }

+      if (uVar3 == 0x12) {

+        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),0x70);

+        }

+        if (*(short *)(param_1 + 2) != 0x14) {

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

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

+            RdpX_GetActivityIdPrefix();

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

+                      &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+          }

+          pwVar25 = L"Invalid size for TS_RAIL_ORDER_COMPARTMENTINFO [%d]";

+          lVar7 = -0x7fffbffb;

+          uVar31 = 0x80004005;

+          goto LAB_6;

+        }

+        LogRemoteAppEventF(this + 0x10,

+                           (ushort *)

+                           L"CompartmentInfoRailOrderReceived: Open=%d, ConversionMode=0x%x, SentenceMode=0x%x, KanaOn=%d"

+                           ,0,(ulonglong)*(uint *)(param_1 + 4));

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

+          return 0;

+        }

+        local_8f4 = *(undefined4 *)(param_1 + 8);

+        local_8f0 = *(undefined4 *)(param_1 + 0xc);

+        puVar28 = &local_8f8;

+        local_8ec = (uint)(*(int *)(param_1 + 0x10) != 0);

+        local_8f8 = (uint)(*(int *)(param_1 + 4) != 0);

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

+        pcVar11 = *(code **)(*plVar23 + 0x30);

+        goto LAB_14;

+      }

+      if (uVar3 == 0x13) goto LAB_7;

+      if (uVar3 == 0x14) {

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

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

+          RdpX_GetActivityIdPrefix();

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x72);

+        }

+        if (*(short *)(param_1 + 2) == 8) {

+          LogRemoteAppEventF(this + 0x10,

+                             (ushort *)L"ZOrderSyncRailOrderReceived: MarkerWindowId=0x%x",0,

+                             (ulonglong)*(uint *)(param_1 + 4));

+          *(undefined4 *)(this + 0xdc) = *(undefined4 *)(param_1 + 4);

+          return 0;

+        }

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

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

+          RdpX_GetActivityIdPrefix();

+          WPP_SF_DdL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x73,

+                     &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+        }

+        lVar7 = -0x7fff0001;

+        uVar31 = 0x8000ffff;

+        pwVar25 = L"Invalid size for TS_RAIL_ORDER_ZORDER_SYNC: [%d]. Expected size: [%lu]";

+        goto LAB_4;

+      }

+      if (uVar3 == 0x15) {

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

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

+          RdpX_GetActivityIdPrefix();

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x74);

+        }

+        if (*(short *)(param_1 + 2) == 9) {

+          LogRemoteAppEventF(this + 0x10,

+                             (ushort *)L"CloakRailOrderReceived: WindowId=0x%x, Cloaked=%d",0,

+                             (ulonglong)*(uint *)(param_1 + 4));

+          if (*(longlong **)(this + 0x78) == (longlong *)0x0) {

+            return 0;

+          }

+          iVar34 = (**(code **)(**(longlong **)(this + 0x78) + 0x78))();

+          if (iVar34 == 0) {

+            return 0;

+          }

+          local_980 = (RdpXInterfaceRemoteAppWindow *)0x0;

+          local_9a8 = 0;

+          lVar7 = GetRemoteAppWindow(this + -0x30,*(ulong *)(param_1 + 4),&local_980);

+          if (-1 < lVar7) {

+            pRVar12 = GetDesktopRemoteAppWindow(this + -0x30,local_980);

+            RdpXSPtr<RdpXInterfaceTapClientShellCallback>::operator=

+                      ((RdpXSPtr<RdpXInterfaceTapClientShellCallback> *)&local_9a8,

+                       (RdpXInterfaceTapClientShellCallback *)pRVar12);

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)&local_9a8);

+            if (pIVar13 != (ITSClientPlatformInstance *)0x0) {

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)&local_9a8);

+              (**(code **)(*(longlong *)pIVar13 + 0x1b8))(pIVar13,param_1[8] != (tagTS_RAIL_PDU)0x0)

+              ;

+            }

+            RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                      ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_9a8);

+            pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_980;

+            goto LAB_9;

+          }

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

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

+                      &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+          RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                    ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_9a8);

+          pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)&local_980;

+          goto LAB_5;

+        }

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

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

+          RdpX_GetActivityIdPrefix();

+          WPP_SF_DdL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x75,

+                     &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+        }

+        lVar7 = -0x7fff0001;

+        uVar31 = 0x8000ffff;

+        pwVar25 = L"Invalid size for TS_RAIL_ORDER_CLOAK: [%d]. Expected size: [%lu]";

+        goto LAB_4;

+      }

+      if (uVar3 == 0x16) {

+        if ((*(short *)(param_1 + 2) != 8) &&

+           (LogRemoteAppError(this + 0x10,

+                              (ushort *)

+                              L"Invalid size of TS_RAIL_ORDER_POWER_DISPLAY_REQUEST_BODY PDU",

+                              0x8000ffff,0,0), *(short *)(param_1 + 2) != 8)) {

+          if (((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),0x77,

+                      &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+          return -0x7fff0001;

+        }

+        LogRemoteAppEventF(this + 0x10,(ushort *)L"PowerDisplayRequestRailOrderReceived: Active=%d",

+                           0,(ulonglong)*(uint *)(param_1 + 4));

+        iVar34 = *(int *)(param_1 + 4);

+        pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                            ((TCntPtr<ITSClientPlatformInstance> *)(this + 0x78));

+        if (pIVar13 == (ITSClientPlatformInstance *)0x0) {

+          return 0;

+        }

+        pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                            ((TCntPtr<ITSClientPlatformInstance> *)(this + 0x78));

+        uVar31 = (uint)(iVar34 != 0);

+        pcVar11 = *(code **)(*(longlong *)pIVar13 + 0xb8);

+LAB_8:

+        (*pcVar11)(pIVar13,uVar31);

+        return 0;

+      }

+    }

+LAB_2:

+    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),0xd3,

+               &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+    }

+    pwVar25 = L"Unknown orderType[0x%x]";

+    lVar7 = -0x7fff0001;

+    uVar31 = 0x8000ffff;

+LAB_6:

+    LogRemoteAppErrorF(this + 0x10,(ushort *)pwVar25,uVar31,0);

+    return lVar7;

+  }

+  if (uVar3 < 0x22) {

+    if (uVar3 == 0x21) {

+      ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_9c0);

+      if ((*(ushort *)(param_1 + 2) < 0xe) &&

+         (LogRemoteAppError(this + 0x10,

+                            (ushort *)L"Invalid size of TS_RAIL_ORDER_WINDOW_APPBAR_INFO_BODY PDU",

+                            0x8000ffff,0,0), *(ushort *)(param_1 + 2) < 0xe)) {

+        if ((((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),0xa1,

+                    &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+        }

+        lVar7 = -0x7fff0001;

+      }

+      else {

+        LogRemoteAppEventF(this + 0x10,

+                           (ushort *)

+                           L"WindowAppBarInfoRailOrderReceived: WindowId=0x%x, FieldsValidFlags=0x%x, ShouldRegisterAppBar=%hhu, AppBarEdge=%hhu"

+                           ,0,(ulonglong)*(uint *)(param_1 + 4));

+        ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                             ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_9c0);

+        lVar7 = GetRemoteAppWindow(this + -0x30,*(ulong *)(param_1 + 4),

+                                   (RdpXInterfaceRemoteAppWindow **)ppRVar14);

+        if (lVar7 < 0) {

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

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

+                      &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+        }

+        else {

+          if (((byte)param_1[8] & 0x40) != 0) {

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

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

+                        &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+            }

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_9c0);

+            (**(code **)(*(longlong *)pIVar13 + 0x158))(pIVar13,param_1[0xc] == (tagTS_RAIL_PDU)0x1)

+            ;

+          }

+          if (((byte)param_1[8] & 1) != 0) {

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

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

+                        &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+            }

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_9c0);

+            (**(code **)(*(longlong *)pIVar13 + 0x160))(pIVar13,param_1[0xd]);

+          }

+        }

+      }

+      pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_9c0;

+      goto LAB_5;

+    }

+    if (uVar3 != 0x1b) {

+      if (uVar3 != 0x1c) {

+        if (uVar3 != 0x1d) {

+          if (uVar3 != 0x1e) {

+            if (uVar3 != 0x1f) {

+              if (uVar3 != 0x20) goto LAB_2;

+              ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                        (local_a28);

+              ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                        (local_a30);

+              ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                        (local_a38);

+              if ((*(ushort *)(param_1 + 2) < 0x10) &&

+                 (LogRemoteAppError(this + 0x10,

+                                    (ushort *)

+                                    L"Invalid size of TS_RAIL_ORDER_WINDOW_CACHED_ICON PDU",

+                                    0x8000ffff,0,0), *(ushort *)(param_1 + 2) < 0x10)) {

+                if ((((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),0x9c,

+                            &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                }

+                lVar7 = -0x7fff0001;

+              }

+              else {

+                LogRemoteAppEventF(this + 0x10,

+                                   (ushort *)

+                                   L"WindowCachedIconRailOrderReceived: WindowId=0x%x, NumIcons=%hhu, CacheEntry=0x%hx, CacheId=0x%hhx, IconFlags=0x%hhx"

+                                   ,0,(ulonglong)*(uint *)(param_1 + 4));

+                ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                     ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)

+                                      local_a28);

+                lVar7 = GetRemoteAppWindow(this + -0x30,*(ulong *)(param_1 + 4),

+                                           (RdpXInterfaceRemoteAppWindow **)ppRVar14);

+                if (lVar7 < 0) {

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

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

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

+                    uVar6 = RdpX_GetActivityIdPrefix();

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

+                              &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                  }

+                }

+                else {

+                  ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                       ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)

+                                        local_a30);

+                  lVar7 = GetWndPlugin(this + -0x30,(ITSWndPluginEx **)ppRVar14);

+                  if (lVar7 < 0) {

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

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

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

+                      uVar6 = RdpX_GetActivityIdPrefix();

+                      uVar27 = 0x9e;

+                      goto LAB_15;

+                    }

+                  }

+                  else {

+                    pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                        ((TCntPtr<ITSClientPlatformInstance> *)local_a30);

+                    pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x38);

+                    ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                         ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)

+                                          local_a38);

+                    lVar7 = (*pcVar11)(pIVar13,param_1[0xe],*(undefined2 *)(param_1 + 0xc),ppRVar14)

+                    ;

+                    if (lVar7 < 0) {

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

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

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

+                        uVar6 = RdpX_GetActivityIdPrefix();

+                        uVar27 = 0x9f;

+LAB_15:

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

+                                   &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                      }

+                    }

+                    else {

+                      pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                          ((TCntPtr<ITSClientPlatformInstance> *)local_a28);

+                      tVar37 = param_1[0xf];

+                      pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x58);

+                      pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                          ((TCntPtr<ITSClientPlatformInstance> *)local_a38);

+                      lVar7 = (*pcVar11)(pIVar13,pIVar15,tVar37 == (tagTS_RAIL_PDU)0x1);

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

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

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

+                        uVar6 = RdpX_GetActivityIdPrefix();

+                        uVar27 = 0xa0;

+                        goto LAB_15;

+                      }

+                    }

+                  }

+                }

+              }

+              RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                        ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a38);

+              TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)local_a30);

+              pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a28;

+              goto LAB_5;

+            }

+            ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                      (local_a48);

+            ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                      (local_a50);

+            ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                      (local_a58);

+            tVar37 = (tagTS_RAIL_PDU)0x20;

+            if ((*(ushort *)(param_1 + 2) < 0x20) &&

+               (LogRemoteAppError(this + 0x10,

+                                  (ushort *)L"Invalid size of TS_RAIL_ORDER_WINDOW_ICON_BODY PDU",

+                                  0x8000ffff,0,0), *(ushort *)(param_1 + 2) < 0x20)) {

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar27 = 0x96;

+LAB_16:

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

+                          &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+LAB_17:

+              lVar7 = -0x7fff0001;

+            }

+            else {

+              ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                   ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)

+                                    local_a48);

+              lVar7 = GetRemoteAppWindow(this + -0x30,*(ulong *)(param_1 + 4),

+                                         (RdpXInterfaceRemoteAppWindow **)ppRVar14);

+              if (lVar7 < 0) {

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

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

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

+                  uVar6 = RdpX_GetActivityIdPrefix();

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

+                            &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                }

+              }

+              else {

+                ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                     ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)

+                                      local_a50);

+                lVar7 = GetWndPlugin(this + -0x30,(ITSWndPluginEx **)ppRVar14);

+                if (lVar7 < 0) {

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

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

+                     ) {

+                    uVar6 = RdpX_GetActivityIdPrefix();

+                    uVar27 = 0x98;

+                    goto LAB_18;

+                  }

+                }

+                else {

+                  if (((byte)param_1[0xf] & 2) == 0) {

+                    uVar31 = 0;

+                  }

+                  else {

+                    tVar37 = param_1[0x14];

+                    uVar31 = (uint)*(ushort *)(param_1 + 0x16);

+                  }

+                  uVar31 = *(int *)(param_1 + 0x1c) + 0x20 + uVar31 + *(int *)(param_1 + 0x18);

+                  if (*(ushort *)(param_1 + 2) < uVar31) {

+                    LogRemoteAppError(this + 0x10,

+                                      (ushort *)

+                                      L"Invalid size of TS_RAIL_ORDER_WINDOW_ICON_BODY PDU",

+                                      0x8000ffff,0,0);

+                  }

+                  if (*(ushort *)(param_1 + 2) < uVar31) {

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

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

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

+                      uVar6 = RdpX_GetActivityIdPrefix();

+                      uVar27 = 0x99;

+                      goto LAB_16;

+                    }

+                    goto LAB_17;

+                  }

+                  LogRemoteAppEventF(this + 0x10,

+                                     (ushort *)

+                                     L"WindowIconRailOrderReceived: WindowId=0x%x, NumIcons=%hhu, CacheEntry=0x%hx, CacheId=0x%hhx, IconFlags=0x%hhx, Width=%hu, Height=%hu, Bpp=%hhu, ColorTableBytes=%hu, BitsMaskBytes=%u, BitsColorBytes=%u"

+                                     ,0,(ulonglong)*(uint *)(param_1 + 4));

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_a50);

+                  pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x40);

+                  RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                            ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_a58);

+                  lVar7 = (*pcVar11)(pIVar13,param_1[0xe],*(undefined2 *)(param_1 + 0xc),

+                                     CONCAT31((int3)((uint)*(undefined4 *)(param_1 + 0x18) >> 8),

+                                              tVar37));

+                  if (lVar7 < 0) {

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

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

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

+                      uVar6 = RdpX_GetActivityIdPrefix();

+                      uVar27 = 0x9a;

+LAB_18:

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

+                                 &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                    }

+                  }

+                  else {

+                    pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                        ((TCntPtr<ITSClientPlatformInstance> *)local_a48);

+                    tVar37 = param_1[0xf];

+                    pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x58);

+                    pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                        ((TCntPtr<ITSClientPlatformInstance> *)local_a58);

+                    lVar7 = (*pcVar11)(pIVar13,pIVar15,(byte)tVar37 & 1);

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

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

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

+                      uVar6 = RdpX_GetActivityIdPrefix();

+                      uVar27 = 0x9b;

+                      goto LAB_18;

+                    }

+                  }

+                }

+              }

+            }

+            RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                      ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a58);

+            TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)local_a50);

+            pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a48;

+            goto LAB_5;

+          }

+          ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_a18);

+          ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_a20);

+          if ((*(ushort *)(param_1 + 2) < 8) &&

+             (LogRemoteAppError(this + 0x10,

+                                (ushort *)L"Invalid size of TS_RAIL_ORDER_WINDOW_DELETE_BODY PDU",

+                                0x8000ffff,0,0), *(ushort *)(param_1 + 2) < 8)) {

+            if ((((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),0x92,

+                        &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+            }

+            lVar7 = -0x7fff0001;

+          }

+          else {

+            LogRemoteAppEventF(this + 0x10,(ushort *)L"WindowDeleteRailOrderReceived: WindowId=0x%x"

+                               ,0,(ulonglong)*(uint *)(param_1 + 4));

+            ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                 ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_a18

+                                 );

+            lVar7 = GetRemoteAppWindow(this + -0x30,*(ulong *)(param_1 + 4),

+                                       (RdpXInterfaceRemoteAppWindow **)ppRVar14);

+            if (lVar7 < 0) {

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

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

+              {

+                uVar6 = RdpX_GetActivityIdPrefix();

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

+                          &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+            }

+            else {

+              ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                   ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)

+                                    local_a20);

+              lVar7 = GetWndPlugin(this + -0x30,(ITSWndPluginEx **)ppRVar14);

+              if (lVar7 < 0) {

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

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

+                {

+                  uVar6 = RdpX_GetActivityIdPrefix();

+                  uVar27 = 0x94;

+LAB_19:

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

+                             &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                }

+              }

+              else {

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_a18);

+                pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_a20);

+                iVar34 = (**(code **)(*(longlong *)pIVar15 + 0x58))(pIVar15);

+                iVar9 = (**(code **)(*(longlong *)pIVar13 + 0x48))(pIVar13);

+                if (iVar9 == iVar34) {

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_a20);

+                  (**(code **)(*(longlong *)pIVar13 + 0x60))(pIVar13,0);

+                }

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)(this + 0x80));

+                pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x40);

+                pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_a18);

+                uVar6 = (**(code **)(*(longlong *)pIVar15 + 0x48))(pIVar15);

+                _Var8 = (*pcVar11)(pIVar13,uVar6);

+                lVar7 = MapXResultToHR(_Var8);

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

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

+                {

+                  uVar6 = RdpX_GetActivityIdPrefix();

+                  uVar27 = 0x95;

+                  goto LAB_19;

+                }

+              }

+            }

+          }

+          TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)local_a20);

+          pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a18;

+          goto LAB_5;

+        }

+        ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_af8);

+        local_918 = (tagTS_RAIL_PDU *)0x0;

+        uStack_910 = 0;

+        if (*(ushort *)(param_1 + 2) < 0x58) {

+          LogRemoteAppError(this + 0x10,

+                            (ushort *)L"Invalid size of TS_RAIL_ORDER_WINDOW_GEOMETRY_BODY PDU",

+                            0x8000ffff,0,0);

+        }

+        if (*(ushort *)(param_1 + 2) < 0x58) {

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

+            uVar27 = 0x8d;

+LAB_20:

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

+                      &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+LAB_21:

+          lVar7 = -0x7fff0001;

+        }

+        else {

+          uVar31 = (uint)*(ushort *)(param_1 + 0x44) * 0x10 + 0x48;

+          if (*(ushort *)(param_1 + 2) < uVar31) {

+            LogRemoteAppError(this + 0x10,

+                              (ushort *)L"Invalid size of TS_RAIL_ORDER_WINDOW_GEOMETRY_BODY PDU",

+                              0x8000ffff,0,0);

+          }

+          if (*(ushort *)(param_1 + 2) < uVar31) {

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

+              uVar27 = 0x8e;

+              goto LAB_20;

+            }

+            goto LAB_21;

+          }

+          LogRemoteAppEventF(this + 0x10,

+                             (ushort *)

+                             L"WindowGeometryRailOrderReceived: WindowId=0x%x, FieldsValidFlags=0x%x, Style=0x%08x, StyleEx=0x%08x, ShowState=%hhu, OffsetX=%i, OffsetY=%i, Width=%i, Height=%i, WindowClientDeltaX=%i, WindowClientDeltaY=%i, ResizeMarginLeft=%i, ResizeMarginTop=%i, ResizeMarginRight=%i, ResizeMarginBottom=%i, NumVisibilityRects=%hu"

+                             ,0,(ulonglong)*(uint *)(param_1 + 4));

+          if (*(int *)(param_1 + 4) == -1) {

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

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

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

+                       &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+            }

+          }

+          else {

+            ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                 ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_af8

+                                 );

+            lVar7 = GetRemoteAppWindow(this + -0x30,*(ulong *)(param_1 + 4),

+                                       (RdpXInterfaceRemoteAppWindow **)ppRVar14);

+            if (lVar7 < 0) {

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

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

+              {

+                uVar6 = RdpX_GetActivityIdPrefix();

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

+                          &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+            }

+            else {

+              if (((byte)param_1[8] & 8) != 0) {

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                (**(code **)(*(longlong *)pIVar13 + 0x50))

+                          (pIVar13,*(undefined4 *)(param_1 + 0xc),*(undefined4 *)(param_1 + 0x10));

+              }

+              iVar34 = *(int *)(param_1 + 0x24);

+              iVar9 = *(int *)(param_1 + 0x28);

+              iVar32 = *(int *)(param_1 + 0x1c);

+              iVar39 = *(int *)(param_1 + 0x20);

+              if (((byte)param_1[8] & 0x80) == 0) {

+                ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                          (local_958);

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                pRVar12 = GetDesktopRemoteAppWindow

+                                    (this + -0x30,(RdpXInterfaceRemoteAppWindow *)pIVar13);

+                RdpXSPtr<RdpXInterfaceTapClientShellCallback>::operator=

+                          ((RdpXSPtr<RdpXInterfaceTapClientShellCallback> *)local_958,

+                           (RdpXInterfaceTapClientShellCallback *)pRVar12);

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_958);

+                if (pIVar13 != (ITSClientPlatformInstance *)0x0) {

+                  ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                            (local_960);

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_958);

+                  pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x1b0);

+                  ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                       ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)

+                                        local_960);

+                  iVar20 = (*pcVar11)(pIVar13,ppRVar14);

+                  if ((-1 < iVar20) &&

+                     (pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                          ((TCntPtr<ITSClientPlatformInstance> *)local_960),

+                     pIVar13 != (ITSClientPlatformInstance *)0x0)) {

+                    pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                        ((TCntPtr<ITSClientPlatformInstance> *)local_960);

+                    (**(code **)(*(longlong *)pIVar13 + 0x118))

+                              (pIVar13,&local_918,(longlong)&local_918 + 4,&uStack_910);

+                  }

+                  ComPlainSmartPtr<IRdpPipeTestPlaybackEvents>::

+                  ~ComPlainSmartPtr<IRdpPipeTestPlaybackEvents>

+                            ((ComPlainSmartPtr<IRdpPipeTestPlaybackEvents> *)local_960);

+                }

+                RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                          ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_958);

+              }

+              else if ((((-1 < *(int *)(param_1 + 0x34)) && (-1 < *(int *)(param_1 + 0x38))) &&

+                       (-1 < *(int *)(param_1 + 0x3c))) && (-1 < *(int *)(param_1 + 0x40))) {

+                local_918 = (tagTS_RAIL_PDU *)

+                            CONCAT44(*(int *)(param_1 + 0x38),*(int *)(param_1 + 0x34));

+                uStack_910 = CONCAT44(*(int *)(param_1 + 0x40),*(int *)(param_1 + 0x3c));

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                local_948 = local_918;

+                uStack_940 = uStack_910;

+                (**(code **)(*(longlong *)pIVar13 + 0x150))(pIVar13,&local_948);

+              }

+              iVar32 = iVar32 + (int)local_918;

+              iVar34 = iVar34 - ((int)local_918 + local_918._4_4_);

+              iVar20 = uStack_910._4_4_ + (int)uStack_910;

+              iVar39 = iVar39 + (int)uStack_910;

+              if ((*(uint *)(param_1 + 8) & 0x8000) != 0) {

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                (**(code **)(*(longlong *)pIVar13 + 0x100))

+                          (pIVar13,*(undefined4 *)(param_1 + 0x2c),*(undefined4 *)(param_1 + 0x30));

+                if ((*(uint *)(param_1 + 8) & 0x800) != 0) {

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                  (**(code **)(*(longlong *)pIVar13 + 0xe0))

+                            (pIVar13,*(int *)(param_1 + 0x2c) + iVar32,

+                             *(int *)(param_1 + 0x30) + iVar39);

+                }

+              }

+              if ((*(uint *)(param_1 + 8) & 0xc00) == 0xc00) {

+                local_8e8 = iVar32;

+                local_8e4 = iVar39;

+                local_8e0 = iVar34;

+                local_8dc = iVar9 - iVar20;

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                (**(code **)(*(longlong *)pIVar13 + 0xf8))(pIVar13,&local_8e8);

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                (**(code **)(*(longlong *)pIVar13 + 0xa0))(pIVar13,(longlong)iVar32);

+              }

+              else {

+                if ((*(uint *)(param_1 + 8) & 0x800) != 0) {

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                  (**(code **)(*(longlong *)pIVar13 + 0xe8))(pIVar13,iVar32,iVar39);

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                  (**(code **)(*(longlong *)pIVar13 + 0xa0))(pIVar13,(longlong)iVar32);

+                }

+                if ((*(uint *)(param_1 + 8) & 0x400) != 0) {

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                  (**(code **)(*(longlong *)pIVar13 + 0xf0))(pIVar13,iVar34);

+                }

+              }

+              if ((*(uint *)(param_1 + 8) & 0x100) != 0) {

+                _Var16 = SUB168(ZEXT816(0x10) * ZEXT216(*(ushort *)(param_1 + 0x44)),0);

+                if (SUB168(ZEXT816(0x10) * ZEXT216(*(ushort *)(param_1 + 0x44)),8) != 0) {

+                  _Var16 = 0xffffffffffffffff;

+                }

+                pvVar17 = operator_new(_Var16);

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

+                  if ((((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),0x91,

+                              &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                  }

+                  lVar7 = -0x7ff8fff2;

+                  goto LAB_22;

+                }

+                if (*(short *)(param_1 + 0x44) != 0) {

+                  piVar29 = (int *)((longlong)pvVar17 + 8);

+                  do {

+                    piVar29[-2] = *(int *)(param_1 + (0x40 - (longlong)pvVar17) + (longlong)piVar29)

+                    ;

+                    piVar29[-1] = *(int *)(param_1 + (0x44 - (longlong)pvVar17) + (longlong)piVar29)

+                    ;

+                    *piVar29 = *(int *)(param_1 + (0x48 - (longlong)pvVar17) + (longlong)piVar29) -

+                               *(int *)(param_1 + (0x40 - (longlong)pvVar17) + (longlong)piVar29);

+                    piVar29[1] = *(int *)(param_1 + (0x4c - (longlong)pvVar17) + (longlong)piVar29)

+                                 - *(int *)(param_1 + (0x44 - (longlong)pvVar17) + (longlong)piVar29

+                                           );

+                    LogRemoteAppEventF(this + 0x10,

+                                       (ushort *)

+                                       L"WindowGeometryRailOrderReceived_VisibilityRect[%i]: WindowId=0x%x, Left=%i, Top=%i, Right=%i, Bottom=%i"

+                                       ,0,uVar19);

+                    uVar31 = (int)uVar19 + 1;

+                    uVar19 = (ulonglong)uVar31;

+                    piVar29 = piVar29 + 4;

+                  } while ((int)uVar31 < (int)(uint)*(ushort *)(param_1 + 0x44));

+                }

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                (**(code **)(*(longlong *)pIVar13 + 0xb0))

+                          (pIVar13,*(undefined2 *)(param_1 + 0x44),pvVar17);

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                (**(code **)(*(longlong *)pIVar13 + 0xa8))

+                          (pIVar13,*(undefined2 *)(param_1 + 0x44),pvVar17);

+                operator_delete(pvVar17);

+              }

+              if (((byte)param_1[8] & 0x10) != 0) {

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_af8);

+                (**(code **)(*(longlong *)pIVar13 + 0x80))(pIVar13,param_1[0x14]);

+              }

+              lVar7 = 0;

+            }

+          }

+        }

+LAB_22:

+        pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_af8;

+        goto LAB_5;

+      }

+      ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_a98);

+      if (*(ushort *)(param_1 + 2) < 0x1e) {

+        LogRemoteAppError(this + 0x10,

+                          (ushort *)L"Invalid size of TS_RAIL_ORDER_WINDOW_CHANGE_BODY PDU",

+                          0x8000ffff,0,0);

+      }

+      if (*(ushort *)(param_1 + 2) < 0x1e) {

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

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

+          uVar6 = RdpX_GetActivityIdPrefix();

+          uVar27 = 0x89;

+LAB_23:

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

+                    &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+        }

+LAB_24:

+        lVar7 = -0x7fff0001;

+      }

+      else {

+        uVar3 = *(ushort *)(param_1 + 0x1a);

+        if ((uint)*(ushort *)(param_1 + 2) < uVar3 + 0x1c) {

+          LogRemoteAppError(this + 0x10,

+                            (ushort *)L"Invalid size of TS_RAIL_ORDER_WINDOW_CHANGE_BODY PDU",

+                            0x8000ffff,0,0);

+        }

+        if ((uint)*(ushort *)(param_1 + 2) < uVar3 + 0x1c) {

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

+            uVar27 = 0x8a;

+            goto LAB_23;

+          }

+          goto LAB_24;

+        }

+        if (*(int *)(param_1 + 4) == -1) {

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

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

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

+                     &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+        }

+        else {

+          ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                               ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_a98);

+          lVar7 = GetRemoteAppWindow(this + -0x30,*(ulong *)(param_1 + 4),

+                                     (RdpXInterfaceRemoteAppWindow **)ppRVar14);

+          if (lVar7 < 0) {

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

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

+                        &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+            }

+          }

+          else {

+            if (((byte)param_1[8] & 2) != 0) {

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_a98);

+              (**(code **)(*(longlong *)pIVar13 + 0x78))(pIVar13);

+            }

+            if (((byte)param_1[8] & 8) != 0) {

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_a98);

+              (**(code **)(*(longlong *)pIVar13 + 0x50))

+                        (pIVar13,*(undefined4 *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x14));

+            }

+            if ((*(uint *)(param_1 + 8) & 0x80000) != 0) {

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_a98);

+              (**(code **)(*(longlong *)pIVar13 + 0x138))(pIVar13);

+            }

+            memset(local_888,0,0x20a);

+            if ((((byte)param_1[8] & 4) != 0) && (*(short *)(param_1 + 0x1a) != 0)) {

+              memcpy_s(local_888,0x208,param_1 + 0x1c,(ulonglong)*(ushort *)(param_1 + 0x1a));

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_a98);

+              (**(code **)(*(longlong *)pIVar13 + 0x68))(pIVar13,local_888);

+            }

+            CUT::ObfuscateFilePathW(local_888);

+            LogRemoteAppEventF(this + 0x10,

+                               (ushort *)

+                               L"WindowChangeRailOrderReceived: WindowsId=0x%x, FieldsValidFlags=0x%x, WindowOwnerId=0x%x, Style=0x%08x, StyleEx=0x%08x, ShowState=%hhu, EnforceServerZOrder=%hhu, TitleBytes=%hu, Title=%s"

+                               ,0,(ulonglong)*(uint *)(param_1 + 4));

+            if (((byte)param_1[8] & 0x10) != 0) {

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_a98);

+              (**(code **)(*(longlong *)pIVar13 + 0x80))(pIVar13,param_1[0x18]);

+            }

+            lVar7 = 0;

+          }

+        }

+      }

+      pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a98;

+      goto LAB_5;

+    }

+    ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_b20);

+    ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_ac8);

+    if (*(ushort *)(param_1 + 2) < 0x58) {

+      LogRemoteAppError(this + 0x10,

+                        (ushort *)L"Invalid size of TS_RAIL_ORDER_WINDOW_CREATE_BODY PDU",0x8000ffff

+                        ,0,0);

+    }

+    if (*(ushort *)(param_1 + 2) < 0x58) {

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

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

+        uVar6 = RdpX_GetActivityIdPrefix();

+        uVar24 = 0x7f;

+LAB_25:

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

+                  &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+      }

+LAB_26:

+      lVar7 = -0x7fff0001;

+    }

+    else {

+      uVar31 = *(ushort *)(param_1 + 0x1a) + 0x48 + (uint)*(ushort *)(param_1 + 0x44) * 0x10;

+      if (*(ushort *)(param_1 + 2) < uVar31) {

+        LogRemoteAppError(this + 0x10,

+                          (ushort *)L"Invalid size of TS_RAIL_ORDER_WINDOW_CREATE_BODY PDU",

+                          0x8000ffff,0,0);

+      }

+      if (*(ushort *)(param_1 + 2) < uVar31) {

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

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

+          uVar6 = RdpX_GetActivityIdPrefix();

+          uVar24 = 0x80;

+          goto LAB_25;

+        }

+        goto LAB_26;

+      }

+      if (*(int *)(param_1 + 4) == -1) {

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

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

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

+          uVar6 = RdpX_GetActivityIdPrefix();

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

+                   &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+        }

+      }

+      else {

+        ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                             ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_ac8);

+        lVar7 = GetWndPlugin(this + -0x30,(ITSWndPluginEx **)ppRVar14);

+        if (lVar7 < 0) {

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

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

+                       &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+        }

+        else {

+          ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                               ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_b20);

+          lVar7 = GetRemoteAppWindow(this + -0x30,*(ulong *)(param_1 + 4),

+                                     (RdpXInterfaceRemoteAppWindow **)ppRVar14);

+          if (lVar7 < 0) {

+            ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                      (local_a08);

+            ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                      (local_a60);

+            ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                      (local_a10);

+            local_8c8 = 0;

+            uStack_8c0 = 0;

+            ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                 ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_a08

+                                 );

+            _Var8 = CreateWindowCallbacks

+                              (this + 0x10,*(uint *)(param_1 + 4),

+                               (RdpXInterfaceRemoteAppWindowCallbacks **)ppRVar14);

+            lVar7 = MapXResultToHR(_Var8);

+            if (lVar7 < 0) {

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar27 = 0x83;

+LAB_27:

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

+                           &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+            }

+            else {

+              ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                   ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)

+                                    local_a60);

+              _Var8 = RdpX_CreateObject((RdpXInterface *)0x0,0,0x43,0x69,ppRVar14);

+              lVar7 = MapXResultToHR(_Var8);

+              if (lVar7 < 0) {

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

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

+                {

+                  uVar6 = RdpX_GetActivityIdPrefix();

+                  uVar27 = 0x84;

+                  goto LAB_27;

+                }

+              }

+              else {

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)(this + 0x68));

+                pcVar11 = *(code **)(*(longlong *)pIVar13 + 0xd8);

+                ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                     ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)

+                                      local_a10);

+                lVar7 = (*pcVar11)(pIVar13,ppRVar14);

+                if (lVar7 < 0) {

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

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

+                     ) {

+                    uVar6 = RdpX_GetActivityIdPrefix();

+                    uVar27 = 0x85;

+                    goto LAB_27;

+                  }

+                }

+                else {

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_a60);

+                  pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x18);

+                  pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_a10);

+                  _Var8 = (*pcVar11)(pIVar13,pIVar15);

+                  lVar7 = MapXResultToHR(_Var8);

+                  if (lVar7 < 0) {

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

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

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

+                      uVar6 = RdpX_GetActivityIdPrefix();

+                      uVar27 = 0x86;

+                      goto LAB_27;

+                    }

+                  }

+                  else {

+                    pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                        ((TCntPtr<ITSClientPlatformInstance> *)(this + 0x80));

+                    pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x30);

+                    RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                              ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_b20);

+                    pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                        ((TCntPtr<ITSClientPlatformInstance> *)local_a08);

+                    uVar6 = *(undefined4 *)(param_1 + 4);

+                    pIVar18 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                        ((TCntPtr<ITSClientPlatformInstance> *)local_a60);

+                    _Var8 = (*pcVar11)(pIVar13,pIVar18,uVar6,pIVar15);

+                    lVar7 = MapXResultToHR(_Var8);

+                    if (-1 < lVar7) {

+                      pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                          ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+                      pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x140);

+                      pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                          ((TCntPtr<ITSClientPlatformInstance> *)local_ac8);

+                      iVar9 = (**(code **)(*(longlong *)pIVar15 + 0x88))(pIVar15);

+                      _Var8 = (*pcVar11)(pIVar13,iVar9 != 0);

+                      lVar7 = MapXResultToHR(_Var8);

+                      pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                          ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+                      (**(code **)(*(longlong *)pIVar13 + 0x78))

+                                (pIVar13,*(undefined4 *)(param_1 + 0xc));

+                      ComPlainSmartPtr<IRdpPipeTestPlaybackEvents>::

+                      ~ComPlainSmartPtr<IRdpPipeTestPlaybackEvents>

+                                ((ComPlainSmartPtr<IRdpPipeTestPlaybackEvents> *)local_a10);

+                      RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::

+                      ~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                                ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a60);

+                      RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::

+                      ~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                                ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a08);

+                      goto LAB_28;

+                    }

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

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

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

+                      uVar6 = RdpX_GetActivityIdPrefix();

+                      uVar27 = 0x87;

+                      goto LAB_27;

+                    }

+                  }

+                }

+              }

+            }

+            ComPlainSmartPtr<IRdpPipeTestPlaybackEvents>::

+            ~ComPlainSmartPtr<IRdpPipeTestPlaybackEvents>

+                      ((ComPlainSmartPtr<IRdpPipeTestPlaybackEvents> *)local_a10);

+            RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                      ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a60);

+            RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                      ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a08);

+          }

+          else {

+LAB_28:

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_ac8);

+            iVar9 = (**(code **)(*(longlong *)pIVar13 + 0x88))(pIVar13);

+            if (iVar9 != 0) {

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+              (**(code **)(*(longlong *)pIVar13 + 200))(pIVar13,2);

+            }

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+            (**(code **)(*(longlong *)pIVar13 + 0x50))

+                      (pIVar13,*(undefined4 *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x14));

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+            (**(code **)(*(longlong *)pIVar13 + 0x138))(pIVar13);

+            memset(local_678,0,0x20a);

+            if (2 < *(ushort *)(param_1 + 0x1a)) {

+              if (*(short *)(param_1 + 0x44) != 0) {

+                iVar34 = *(ushort *)(param_1 + 0x44) - 1;

+              }

+              memcpy_s(local_678,0x208,param_1 + (longlong)iVar34 * 0x10 + 0x58,

+                       (ulonglong)*(ushort *)(param_1 + 0x1a));

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+              (**(code **)(*(longlong *)pIVar13 + 0x68))(pIVar13,local_678);

+            }

+            CUT::ObfuscateFilePathW(local_678);

+            LogRemoteAppEventF(this + 0x10,

+                               (ushort *)

+                               L"WindowCreateRailOrderReceived: WindowId=0x%x, FieldsValidFlags=0x%x, WindowOwnerId=0x%x, Style=0x%08x, StyleEx=0x%08x, ShowState=%hhu, EnforceServerZOrder=%hhu, TitleBytes=%hu, Title=%s, OffsetX=%i, OffsetY=%i, Width=%i, Height=%i, WindowClientDeltaX=%i, WindowClientDeltaY=%i, ResizeMarginLeft=%i, ResizeMarginTop=%i, ResizeMarginRight=%i, ResizeMarginBottom=%i, NumVisibilityRects=%hu"

+                               ,0,(ulonglong)*(uint *)(param_1 + 4));

+            local_b30 = *(int *)(param_1 + 0x20);

+            local_b34 = *(int *)(param_1 + 0x1c);

+            local_ad0 = *(uint *)(param_1 + 0x24);

+            local_b38 = *(int *)(param_1 + 0x28);

+            local_acc = *(uint *)(param_1 + 0x34);

+            if (((-1 < (int)local_acc) &&

+                (local_b08 = *(uint *)(param_1 + 0x38), -1 < (int)local_b08)) &&

+               ((iVar34 = *(int *)(param_1 + 0x3c), -1 < iVar34 &&

+                (iVar9 = *(int *)(param_1 + 0x40), -1 < iVar9)))) {

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+              local_948 = (tagTS_RAIL_PDU *)CONCAT44(local_b08,local_acc);

+              uStack_940 = CONCAT44(iVar9,iVar34);

+              (**(code **)(*(longlong *)pIVar13 + 0x150))(pIVar13,&local_948);

+              local_b34 = local_b34 + *(int *)(param_1 + 0x34);

+              local_ad0 = local_ad0 - (*(int *)(param_1 + 0x34) + *(int *)(param_1 + 0x38));

+              local_b30 = local_b30 + *(int *)(param_1 + 0x3c);

+              local_b38 = local_b38 - (*(int *)(param_1 + 0x40) + *(int *)(param_1 + 0x3c));

+            }

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+            (**(code **)(*(longlong *)pIVar13 + 0xe0))

+                      (pIVar13,*(int *)(param_1 + 0x2c) + local_b34,

+                       *(int *)(param_1 + 0x30) + local_b30);

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+            (**(code **)(*(longlong *)pIVar13 + 0x100))

+                      (pIVar13,*(undefined4 *)(param_1 + 0x2c),*(undefined4 *)(param_1 + 0x30));

+            local_8d0 = local_ad0;

+            local_8cc = local_b38;

+            local_8d4 = local_b30;

+            local_8d8 = local_b34;

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+            (**(code **)(*(longlong *)pIVar13 + 0xf8))(pIVar13,&local_8d8);

+            _Var16 = SUB168(ZEXT816(0x10) * ZEXT216(*(ushort *)(param_1 + 0x44)),0);

+            if (SUB168(ZEXT816(0x10) * ZEXT216(*(ushort *)(param_1 + 0x44)),8) != 0) {

+              _Var16 = 0xffffffffffffffff;

+            }

+            ptVar26 = operator_new(_Var16);

+            local_ad8 = ptVar26;

+            if (ptVar26 == (tagTS_RAIL_PDU *)0x0) {

+              if ((((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),0x88,

+                          &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+              lVar7 = -0x7ff8fff2;

+            }

+            else {

+              local_b08 = 0;

+              if (*(short *)(param_1 + 0x44) != 0) {

+                uVar31 = 0;

+                ptVar35 = ptVar26 + 8;

+                do {

+                  *(int *)(ptVar35 + -8) =

+                       *(int *)(ptVar35 + (longlong)(param_1 + (0x40 - (longlong)ptVar26)));

+                  *(int *)(ptVar35 + -4) =

+                       *(int *)(ptVar35 + (longlong)(param_1 + (0x44 - (longlong)ptVar26)));

+                  *(int *)ptVar35 =

+                       *(int *)(ptVar35 + (longlong)(param_1 + (0x48 - (longlong)ptVar26))) -

+                       *(int *)(ptVar35 + (longlong)(param_1 + (0x40 - (longlong)ptVar26)));

+                  *(int *)(ptVar35 + 4) =

+                       *(int *)(ptVar35 + (longlong)(param_1 + (0x4c - (longlong)ptVar26))) -

+                       *(int *)(ptVar35 + (longlong)(param_1 + (0x44 - (longlong)ptVar26)));

+                  LogRemoteAppEventF(this + 0x10,

+                                     (ushort *)

+                                     L"WindowCreateRailOrderReceived_VisibilityRect[%i]: WindowId=0x%x, Left=%i, Top=%i, Right=%i, Bottom=%i"

+                                     ,0,(ulonglong)uVar31);

+                  uVar31 = uVar31 + 1;

+                  ptVar35 = ptVar35 + 0x10;

+                } while ((int)uVar31 < (int)(uint)*(ushort *)(param_1 + 0x44));

+              }

+              ptVar26 = local_ad8;

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+              (**(code **)(*(longlong *)pIVar13 + 0xb0))

+                        (pIVar13,*(undefined2 *)(param_1 + 0x44),ptVar26);

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+              (**(code **)(*(longlong *)pIVar13 + 0xa0))

+                        (pIVar13,(longlong)local_b34,(longlong)local_b30);

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+              (**(code **)(*(longlong *)pIVar13 + 0xa8))

+                        (pIVar13,*(undefined2 *)(param_1 + 0x44),ptVar26);

+              operator_delete(ptVar26);

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)(this + 0x88));

+              if (pIVar13 != (ITSClientPlatformInstance *)0x0) {

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)(this + 0x88));

+                pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x28);

+                pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+                uVar6 = (**(code **)(*(longlong *)pIVar15 + 0x48))(pIVar15);

+                (*pcVar11)(pIVar13,uVar6);

+              }

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_b20);

+              (**(code **)(*(longlong *)pIVar13 + 0x80))(pIVar13,param_1[0x18]);

+            }

+          }

+        }

+      }

+    }

+    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)local_ac8);

+    pRVar22 = (RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_b20;

+LAB_5:

+    RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>(pRVar22);

+    return lVar7;

+  }

+  if (uVar3 != 0x22) {

+    if (uVar3 != 0x23) {

+      if (uVar3 != 0x24) {

+        if (uVar3 == 0x25) {

+          ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_a78);

+          ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_9e8);

+          if ((*(short *)(param_1 + 2) == 0xc) ||

+             (LogRemoteAppError(this + 0x10,

+                                (ushort *)L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_DELETE PDU",

+                                0x8000ffff,0,0), *(short *)(param_1 + 2) == 0xc)) {

+            LogRemoteAppEventF(this + 0x10,

+                               (ushort *)

+                               L"NotifyIconDeleteRailOrderReceived: WindowId=0x%x, NotifyIconId=0x%x"

+                               ,0,(ulonglong)*(uint *)(param_1 + 4));

+            ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                 ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_9e8

+                                 );

+            lVar7 = GetWndPlugin(this + -0x30,(ITSWndPluginEx **)ppRVar14);

+            if (lVar7 < 0) {

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar27 = 0xcb;

+                goto LAB_29;

+              }

+            }

+            else {

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_9e8);

+              pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x48);

+              ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                   ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)

+                                    local_a78);

+              lVar7 = (*pcVar11)(pIVar13,*(undefined4 *)(param_1 + 4),*(undefined4 *)(param_1 + 8),

+                                 ppRVar14);

+              if (lVar7 < 0) {

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

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

+                {

+                  uVar6 = RdpX_GetActivityIdPrefix();

+                  uVar27 = 0xcc;

+LAB_29:

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

+                             &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                }

+              }

+              else {

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_a78);

+                (**(code **)(*(longlong *)pIVar13 + 0x80))(pIVar13);

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_a78);

+                (**(code **)(*(longlong *)pIVar13 + 0x78))(pIVar13,2);

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_a78);

+                pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_a78);

+                uVar31 = (**(code **)(*(longlong *)pIVar15 + 0x48))(pIVar15);

+                lVar7 = OnShellNotifyInformation

+                                  (this,uVar31,(RdpXInterfaceShellNotifyInformation *)pIVar13);

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

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

+                {

+                  uVar6 = RdpX_GetActivityIdPrefix();

+                  uVar27 = 0xcd;

+                  goto LAB_29;

+                }

+              }

+            }

+          }

+          else {

+            if ((((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),0xca,

+                        &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+            }

+            lVar7 = -0x7fff0001;

+          }

+          TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)local_9e8);

+          this_01 = (RdpXSPtr<RdpXInterfaceCriticalSection> *)local_a78;

+          goto LAB_30;

+        }

+        if (uVar3 != 0x26) {

+          if (uVar3 != 0x27) goto LAB_2;

+          ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_a80);

+          if ((*(short *)(param_1 + 2) == 8) ||

+             (LogRemoteAppError(this + 0x10,

+                                (ushort *)L"Invalid size of TS_RAIL_ORDER_SYNC_STATE_BODY PDU",

+                                0x8000ffff,0,0), *(short *)(param_1 + 2) == 8)) {

+            LogRemoteAppEventF(this + 0x10,(ushort *)L"SyncStateRailOrderReceived: SyncFlags=0x%x",0

+                               ,(ulonglong)*(uint *)(param_1 + 4));

+            ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                 ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_a80

+                                 );

+            lVar7 = GetWndPlugin(this + -0x30,(ITSWndPluginEx **)ppRVar14);

+            if (lVar7 < 0) {

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

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

+                           &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+            }

+            else {

+              if (((byte)param_1[4] & 1) == 0) {

+                if (((byte)param_1[4] & 2) != 0) {

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

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

+                     ) {

+                    uVar6 = RdpX_GetActivityIdPrefix();

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

+                             &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                  }

+                  if (((byte)param_1[4] & 8) == 0) {

+                    pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                        ((TCntPtr<ITSClientPlatformInstance> *)local_a80);

+                    (**(code **)(*(longlong *)pIVar13 + 0x90))(pIVar13);

+                  }

+                  else {

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

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

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

+                      uVar6 = RdpX_GetActivityIdPrefix();

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

+                               &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                    }

+                    pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                        ((TCntPtr<ITSClientPlatformInstance> *)local_a80);

+                    (**(code **)(*(longlong *)pIVar13 + 0x78))(pIVar13);

+                    _Var10 = IsRemoteAppV2Enabled(this + 0x10);

+                    if (_Var10 != 0) {

+                      this_02 = (TCntPtr<ITSClientPlatformInstance> *)(this + 0x80);

+                      local_ad8 = (tagTS_RAIL_PDU *)this_02;

+                      pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->(this_02);

+                      local_b08 = (**(code **)(*(longlong *)pIVar13 + 0x78))(pIVar13);

+                      if (local_b08 != 0) {

+                        do {

+                          ComPlainSmartPtr<ITSWindowInformation>::

+                          ComPlainSmartPtr<ITSWindowInformation>(local_950);

+                          pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->(this_02);

+                          pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x80);

+                          ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::

+                                     operator&((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>

+                                                *)local_950);

+                          iVar34 = (*pcVar11)(pIVar13,uVar19,ppRVar14);

+                          if (iVar34 != 0) {

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

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

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

+                              uVar6 = RdpX_GetActivityIdPrefix();

+                              WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x7d,

+                                         &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                            }

+                            RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::

+                            ~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                                      ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_950);

+                            goto LAB_31;

+                          }

+                          pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                              ((TCntPtr<ITSClientPlatformInstance> *)local_950);

+                          (**(code **)(*(longlong *)pIVar13 + 0x180))(pIVar13);

+                          RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::

+                          ~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                                    ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_950);

+                          uVar31 = (int)uVar19 + 1;

+                          uVar19 = (ulonglong)uVar31;

+                          this_02 = (TCntPtr<ITSClientPlatformInstance> *)local_ad8;

+                        } while (uVar31 < local_b08);

+                      }

+                    }

+                  }

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_a80);

+                  uVar27 = 1;

+                  goto LAB_32;

+                }

+              }

+              else {

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

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

+                {

+                  uVar6 = RdpX_GetActivityIdPrefix();

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

+                           &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                }

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_a80);

+                uVar27 = 0;

+LAB_32:

+                (**(code **)(*(longlong *)pIVar13 + 0x70))(pIVar13,uVar27);

+              }

+              if (((byte)param_1[4] & 4) != 0) {

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

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

+                {

+                  uVar6 = RdpX_GetActivityIdPrefix();

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

+                           &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                }

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_a80);

+                (**(code **)(*(longlong *)pIVar13 + 0x80))(pIVar13);

+              }

+            }

+          }

+          else {

+            if ((((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),0x78,

+                        &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+            }

+            lVar7 = -0x7fff0001;

+          }

+LAB_31:

+          this_00 = (TCntPtr<ITSThread> *)local_a80;

+          goto LAB_33;

+        }

+        ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_9f0);

+        if ((*(ushort *)(param_1 + 2) < 0x14) &&

+           (LogRemoteAppError(this + 0x10,(ushort *)L"Invalid size of TS_RAIL_ORDER_ZORDER_BODY PDU"

+                              ,0x8000ffff,0,0), *(ushort *)(param_1 + 2) < 0x14)) {

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

+            uVar27 = 0xce;

+LAB_34:

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

+                      &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+LAB_35:

+          lVar7 = -0x7fff0001;

+        }

+        else {

+          if (0x100 < *(uint *)(param_1 + 4)) {

+            LogRemoteAppError(this + 0x10,

+                              (ushort *)

+                              L"numWindows in TS_RAIL_ORDER_ZORDER_BODY PDU is unexpectedly big",

+                              0x8000ffff,0,0);

+          }

+          if (0x100 < *(uint *)(param_1 + 4)) {

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

+              uVar27 = 0xcf;

+              goto LAB_34;

+            }

+            goto LAB_35;

+          }

+          uVar31 = *(uint *)(param_1 + 4) * 4 + 0x10;

+          if (*(ushort *)(param_1 + 2) < uVar31) {

+            LogRemoteAppError(this + 0x10,(ushort *)L"Invalid size of TS_RAIL_ORDER_ZORDER_BODY PDU"

+                              ,0x8000ffff,0,0);

+          }

+          if (*(ushort *)(param_1 + 2) < uVar31) {

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

+              uVar27 = 0xd0;

+              goto LAB_34;

+            }

+            goto LAB_35;

+          }

+          memset(local_468,0,0x208);

+          local_930 = local_468;

+          local_928 = 0x104;

+          uVar36 = (ulonglong)*(uint *)(param_1 + 4);

+          uVar33 = uVar19;

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

+            do {

+              if ((int)uVar19 < 0) break;

+              pwVar25 = L"0x%x,";

+              if ((int)uVar36 - 1U <= (uint)uVar33) {

+                pwVar25 = L"0x%x";

+              }

+              uVar31 = StringCchPrintfExW(local_930,local_928,&local_930,&local_928,0,

+                                          (ushort *)pwVar25);

+              if ((((int)uVar31 < 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_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xd1,

+                           &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+              uVar19 = (ulonglong)uVar31;

+              uVar36 = (ulonglong)*(uint *)(param_1 + 4);

+              uVar31 = (uint)uVar33 + 1;

+              uVar33 = (ulonglong)uVar31;

+            } while (uVar31 < *(uint *)(param_1 + 4));

+          }

+          LogRemoteAppEventF(this + 0x10,

+                             (ushort *)

+                             L"ZOrderRailOrderReceived: NumWindows=%u, FieldsValidFlags=0x%x, ActiveWindowId=0x%x, WindowIds=[%s]"

+                             ,0,uVar36);

+          ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                               ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_9f0);

+          lVar7 = GetWndPlugin(this + -0x30,(ITSWndPluginEx **)ppRVar14);

+          if (lVar7 < 0) {

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

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

+                         &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+            }

+          }

+          else {

+            uVar21 = *(uint *)(param_1 + 8) >> 4 & 2;

+            uVar31 = uVar21 | 1;

+            if (((byte)param_1[8] & 0x10) == 0) {

+              uVar31 = uVar21;

+            }

+            if (uVar31 != 0) {

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_9f0);

+              (**(code **)(*(longlong *)pIVar13 + 0x68))

+                        (pIVar13,uVar31,*(undefined4 *)(param_1 + 0xc),*(undefined4 *)(param_1 + 4))

+              ;

+            }

+          }

+        }

+        this_00 = (TCntPtr<ITSThread> *)local_9f0;

+LAB_33:

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

+        return lVar7;

+      }

+      ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_ac0);

+      ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_a90);

+      if (*(ushort *)(param_1 + 2) < 0x14) {

+        LogRemoteAppError(this + 0x10,

+                          (ushort *)L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_TOAST_BODY",

+                          0x8000ffff,0,0);

+      }

+      if (*(ushort *)(param_1 + 2) < 0x14) {

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

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

+          uVar6 = RdpX_GetActivityIdPrefix();

+          uVar27 = 0xc2;

+LAB_36:

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

+                    &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+        }

+LAB_37:

+        lVar7 = -0x7fff0001;

+      }

+      else {

+        uVar31 = *(ushort *)(param_1 + 0x10) + 0x14 + (uint)*(ushort *)(param_1 + 0x12);

+        if (*(ushort *)(param_1 + 2) < uVar31) {

+          LogRemoteAppError(this + 0x10,

+                            (ushort *)L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_TOAST_BODY PDU",

+                            0x8000ffff,0,0);

+        }

+        if (*(ushort *)(param_1 + 2) < uVar31) {

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

+            uVar27 = 0xc3;

+            goto LAB_36;

+          }

+          goto LAB_37;

+        }

+        ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                             ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_a90);

+        lVar7 = GetWndPlugin(this + -0x30,(ITSWndPluginEx **)ppRVar14);

+        if (lVar7 < 0) {

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

+            uVar27 = 0xc4;

+LAB_38:

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

+                       &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+        }

+        else {

+          pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                              ((TCntPtr<ITSClientPlatformInstance> *)local_a90);

+          pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x48);

+          ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                               ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_ac0);

+          lVar7 = (*pcVar11)(pIVar13,*(undefined4 *)(param_1 + 4),*(undefined4 *)(param_1 + 8),

+                             ppRVar14);

+          if (lVar7 < 0) {

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

+              uVar27 = 0xc5;

+              goto LAB_38;

+            }

+          }

+          else {

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_ac0);

+            (**(code **)(*(longlong *)pIVar13 + 0x80))(pIVar13);

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

+            ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                      (local_a40);

+            ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                 ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_a40

+                                 );

+            _Var8 = RdpX_Strings_CreateConstXChar16StringWithSpecifiedSize

+                              (*(ushort *)(param_1 + 0x10) >> 1,param_1 + 0x14,ppRVar14);

+            lVar7 = MapXResultToHR(_Var8);

+            if (lVar7 < 0) {

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

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

+                           &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+            }

+            else {

+              ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                        (local_9e0);

+              RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                        ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_9e0);

+              _Var8 = RdpX_Strings_CreateConstXChar16StringWithSpecifiedSize

+                                (*(ushort *)(param_1 + 0x12) >> 1,param_1 + 0x14 + uVar3);

+              lVar7 = MapXResultToHR(_Var8);

+              if (lVar7 < 0) {

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

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

+                {

+                  uVar6 = RdpX_GetActivityIdPrefix();

+                  uVar27 = 199;

+                  goto LAB_39;

+                }

+              }

+              else {

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_9e0);

+                if (pIVar13 != (ITSClientPlatformInstance *)0x0) {

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_9e0);

+                  (**(code **)(*(longlong *)pIVar13 + 0x18))(pIVar13);

+                }

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_a40);

+                if (pIVar13 != (ITSClientPlatformInstance *)0x0) {

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_a40);

+                  (**(code **)(*(longlong *)pIVar13 + 0x18))(pIVar13);

+                }

+                LogRemoteAppEventF(this + 0x10,

+                                   (ushort *)

+                                   L"NotifyIconToastRailOrderReceived: WindowId=0x%x, NotifyIconId=0x%x, ToastFlags=0x%x, Toast=%s, ToastTitle=%s"

+                                   ,0,(ulonglong)*(uint *)(param_1 + 4));

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_ac0);

+                lVar7 = (**(code **)(*(longlong *)pIVar13 + 0x60))

+                                  (pIVar13,0,*(undefined4 *)(param_1 + 0xc),

+                                   *(ushort *)(param_1 + 0x10) >> 1);

+                if (lVar7 < 0) {

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

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

+                     ) {

+                    uVar6 = RdpX_GetActivityIdPrefix();

+                    uVar27 = 200;

+LAB_39:

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

+                               &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                  }

+                }

+                else {

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_ac0);

+                  pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_ac0);

+                  uVar31 = (**(code **)(*(longlong *)pIVar15 + 0x48))(pIVar15);

+                  lVar7 = OnShellNotifyInformation

+                                    (this,uVar31,(RdpXInterfaceShellNotifyInformation *)pIVar13);

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

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

+                     ) {

+                    uVar6 = RdpX_GetActivityIdPrefix();

+                    uVar27 = 0xc9;

+                    goto LAB_39;

+                  }

+                }

+              }

+              RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                        ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_9e0);

+            }

+            RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                      ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a40);

+          }

+        }

+      }

+      TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)local_a90);

+      this_01 = (RdpXSPtr<RdpXInterfaceCriticalSection> *)local_ac0;

+      goto LAB_30;

+    }

+    ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_b10);

+    ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_af0);

+    if (*(ushort *)(param_1 + 2) < 0x18) {

+      LogRemoteAppError(this + 0x10,

+                        (ushort *)L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_BODY for Change PDU",

+                        0x8000ffff,0,0);

+    }

+    if (*(ushort *)(param_1 + 2) < 0x18) {

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

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

+        uVar6 = RdpX_GetActivityIdPrefix();

+        uVar27 = 0xb4;

+LAB_40:

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

+                  &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+      }

+LAB_41:

+      lVar7 = -0x7fff0001;

+    }

+    else {

+      uVar31 = (uint)*(ushort *)(param_1 + 0xc);

+      if ((uint)*(ushort *)(param_1 + 2) < uVar31 + 0x18) {

+        LogRemoteAppError(this + 0x10,

+                          (ushort *)L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_BODY for Change PDU",

+                          0x8000ffff,0,0);

+      }

+      if ((uint)*(ushort *)(param_1 + 2) < uVar31 + 0x18) {

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

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

+          uVar6 = RdpX_GetActivityIdPrefix();

+          uVar27 = 0xb5;

+          goto LAB_40;

+        }

+        goto LAB_41;

+      }

+      ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                           ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_af0);

+      lVar7 = GetWndPlugin(this + -0x30,(ITSWndPluginEx **)ppRVar14);

+      if (lVar7 < 0) {

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

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

+          uVar6 = RdpX_GetActivityIdPrefix();

+          uVar27 = 0xb6;

+LAB_42:

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

+                     &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+        }

+      }

+      else {

+        pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                            ((TCntPtr<ITSClientPlatformInstance> *)local_af0);

+        pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x48);

+        RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                  ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_b10);

+        lVar7 = (*pcVar11)(pIVar13,*(undefined4 *)(param_1 + 4),*(undefined4 *)(param_1 + 8));

+        if (lVar7 < 0) {

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

+            uVar27 = 0xb7;

+            goto LAB_42;

+          }

+        }

+        else {

+          pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                              ((TCntPtr<ITSClientPlatformInstance> *)local_b10);

+          (**(code **)(*(longlong *)pIVar13 + 0x80))(pIVar13);

+          ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_ae0);

+          if (*(short *)(param_1 + 0xc) == 0) {

+LAB_43:

+            if (((byte)param_1[0x14] & 4) != 0) {

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_b10);

+              lVar7 = (**(code **)(*(longlong *)pIVar13 + 0x68))

+                                (pIVar13,*(undefined4 *)(param_1 + 0x10));

+              if (lVar7 < 0) {

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

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

+                {

+                  uVar6 = RdpX_GetActivityIdPrefix();

+                  uVar27 = 0xba;

+                  goto LAB_44;

+                }

+                goto LAB_45;

+              }

+            }

+            if (param_1[0xe] == (tagTS_RAIL_PDU)0x0) {

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_ae0);

+              if (pIVar13 != (ITSClientPlatformInstance *)0x0) {

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_ae0);

+                (**(code **)(*(longlong *)pIVar13 + 0x18))(pIVar13);

+              }

+              LogRemoteAppEventF(this + 0x10,

+                                 (ushort *)

+                                 L"NotifyIconChangeRailOrderReceived_NoIcons: WindowId=0x%x, NotifyIconId=0x%x, NumIcons=%hhu, IsCachedIcon=%hhu, StateFlags=0x%x, PDUFlags=0x%x, ToolTipBytes=%hu, ToolTip=%s"

+                                 ,0,(ulonglong)*(uint *)(param_1 + 4));

+LAB_46:

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_b10);

+              iVar34 = (**(code **)(*(longlong *)pIVar13 + 0x48))(pIVar13);

+              if (iVar34 != 0) {

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_b10);

+                pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_b10);

+                uVar31 = (**(code **)(*(longlong *)pIVar15 + 0x48))(pIVar15);

+                lVar7 = OnShellNotifyInformation

+                                  (this,uVar31,(RdpXInterfaceShellNotifyInformation *)pIVar13);

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

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

+                {

+                  uVar6 = RdpX_GetActivityIdPrefix();

+                  uVar27 = 0xc1;

+                  goto LAB_44;

+                }

+              }

+            }

+            else {

+              ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>

+                        (local_a70);

+              uVar33 = (ulonglong)*(ushort *)(param_1 + 0xc);

+              if (param_1[0xf] == (tagTS_RAIL_PDU)0x0) {

+                uVar31 = uVar31 + 0x2c;

+                if (*(ushort *)(param_1 + 2) < uVar31) {

+                  LogRemoteAppError(this + 0x10,

+                                    (ushort *)

+                                    L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_BODY for Change PDU",

+                                    0x8000ffff,0,0);

+                }

+                if (*(ushort *)(param_1 + 2) < uVar31) {

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

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

+                     ) {

+                    uVar6 = RdpX_GetActivityIdPrefix();

+                    uVar27 = 0xbd;

+LAB_47:

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

+                              &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                  }

+                }

+                else {

+                  if (((byte)param_1[uVar33 + 0x1b] & 2) == 0) {

+                    tVar37 = (tagTS_RAIL_PDU)0x20;

+                  }

+                  else {

+                    tVar37 = param_1[uVar33 + 0x20];

+                    uVar19 = (ulonglong)*(ushort *)(param_1 + uVar33 + 0x22);

+                  }

+                  local_938 = param_1 + uVar19 + uVar33 + 0x2c;

+                  local_ad8 = local_938 + *(uint *)(param_1 + uVar33 + 0x24);

+                  uVar31 = uVar31 + *(uint *)(param_1 + uVar33 + 0x24) + (int)uVar19 +

+                                    *(int *)(param_1 + uVar33 + 0x28);

+                  if (*(ushort *)(param_1 + 2) < uVar31) {

+                    LogRemoteAppError(this + 0x10,

+                                      (ushort *)

+                                      L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_BODY for Change PDU"

+                                      ,0x8000ffff,0,0);

+                  }

+                  if (uVar31 <= *(ushort *)(param_1 + 2)) {

+                    local_b08 = *(uint *)(param_1 + uVar33 + 0x24);

+                    local_acc = (uint)*(ushort *)(param_1 + uVar33 + 0x22);

+                    local_ad0 = (uint)*(ushort *)(param_1 + uVar33 + 0x1e);

+                    local_a00 = (uint)(byte)param_1[uVar33 + 0x1b];

+                    local_9d8 = (uint)(byte)param_1[uVar33 + 0x1a];

+                    local_ab8 = (uint)*(ushort *)(param_1 + uVar33 + 0x18);

+                    pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                        ((TCntPtr<ITSClientPlatformInstance> *)local_ae0);

+                    if (pIVar13 != (ITSClientPlatformInstance *)0x0) {

+                      pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                          ((TCntPtr<ITSClientPlatformInstance> *)local_ae0);

+                      (**(code **)(*(longlong *)pIVar13 + 0x18))(pIVar13);

+                    }

+                    LogRemoteAppEventF(this + 0x10,

+                                       (ushort *)

+                                       L"NotifyIconChangeRailOrderReceived_NonCached: WindowId=0x%x, NotifyIconId=0x%x, NumIcons=%hhu, IsCachedIcon=%hhu,StateFlags=0x%x, PDUFlags=0x%x, ToolTipBytes=%hu, ToolTip=%s, CacheEntry=0x%hx, CacheId=0x%hhx, IconFlags=0x%hhx, Width=%hu, Height=%hu, Bpp=%hhu, ColorTableBytes=%hu, BitsMaskBytes=%u, BitsColorBytes=%u"

+                                       ,0,(ulonglong)*(uint *)(param_1 + 4));

+                    pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                        ((TCntPtr<ITSClientPlatformInstance> *)local_af0);

+                    pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x40);

+                    RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                              ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_a70);

+                    lVar7 = (*pcVar11)(pIVar13,param_1[uVar33 + 0x1a],

+                                       *(undefined2 *)(param_1 + uVar33 + 0x18),

+                                       CONCAT31((int3)((uint)*(undefined4 *)

+                                                              (param_1 + uVar33 + 0x24) >> 8),tVar37

+                                               ));

+                    if (lVar7 < 0) {

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

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

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

+                        uVar6 = RdpX_GetActivityIdPrefix();

+                        uVar27 = 0xbf;

+                        goto LAB_48;

+                      }

+                      goto LAB_49;

+                    }

+                    goto LAB_50;

+                  }

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

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

+                     ) {

+                    uVar6 = RdpX_GetActivityIdPrefix();

+                    uVar27 = 0xbe;

+                    goto LAB_47;

+                  }

+                }

+LAB_51:

+                lVar7 = -0x7fff0001;

+              }

+              else {

+                if ((uint)*(ushort *)(param_1 + 2) < uVar31 + 0x1c) {

+                  LogRemoteAppError(this + 0x10,

+                                    (ushort *)

+                                    L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_BODY for Create PDU",

+                                    0x8000ffff,0,0);

+                }

+                if ((uint)*(ushort *)(param_1 + 2) < uVar31 + 0x1c) {

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

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

+                     ) {

+                    uVar6 = RdpX_GetActivityIdPrefix();

+                    uVar27 = 0xbb;

+                    goto LAB_47;

+                  }

+                  goto LAB_51;

+                }

+                local_b08 = (uint)(byte)param_1[uVar33 + 0x1a];

+                local_acc = (uint)*(ushort *)(param_1 + uVar33 + 0x18);

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_ae0);

+                if (pIVar13 != (ITSClientPlatformInstance *)0x0) {

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_ae0);

+                  (**(code **)(*(longlong *)pIVar13 + 0x18))(pIVar13);

+                }

+                LogRemoteAppEventF(this + 0x10,

+                                   (ushort *)

+                                   L"NotifyIconChangeRailOrderReceived_Cached: WindowId=0x%x, NotifyIconId=0x%x, NumIcons=%hhu, IsCachedIcon=%hhu, StateFlags=0x%x, PDUFlags=0x%x, ToolTipBytes=%hu, ToolTip=%s, CacheEntry=0x%hx, CacheId=0x%hhx, IconFlags=0x%hhx"

+                                   ,0,(ulonglong)*(uint *)(param_1 + 4));

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_af0);

+                pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x38);

+                ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                     ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)

+                                      local_a70);

+                lVar7 = (*pcVar11)(pIVar13,param_1[uVar33 + 0x1a],

+                                   *(undefined2 *)(param_1 + uVar33 + 0x18),ppRVar14);

+                if (lVar7 < 0) {

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

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

+                     ) {

+                    uVar6 = RdpX_GetActivityIdPrefix();

+                    uVar27 = 0xbc;

+LAB_48:

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

+                               &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+                  }

+                }

+                else {

+LAB_50:

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_b10);

+                  pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x50);

+                  pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_a70);

+                  lVar7 = (*pcVar11)(pIVar13,pIVar15);

+                  if (-1 < lVar7) {

+                    RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::

+                    ~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                              ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a70);

+                    goto LAB_46;

+                  }

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

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

+                     ) {

+                    uVar6 = RdpX_GetActivityIdPrefix();

+                    uVar27 = 0xc0;

+                    goto LAB_48;

+                  }

+                }

+              }

+LAB_49:

+              RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                        ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a70);

+            }

+          }

+          else {

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_b10);

+            lVar7 = (**(code **)(*(longlong *)pIVar13 + 0x58))

+                              (pIVar13,*(ushort *)(param_1 + 0xc) >> 1,param_1 + 0x18);

+            if (lVar7 < 0) {

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar27 = 0xb8;

+LAB_44:

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

+                           &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+            }

+            else {

+              ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                   ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)

+                                    local_ae0);

+              _Var8 = RdpX_Strings_CreateConstXChar16StringWithSpecifiedSize

+                                (*(ushort *)(param_1 + 0xc) >> 1,param_1 + 0x18,ppRVar14);

+              lVar7 = MapXResultToHR(_Var8);

+              if (-1 < lVar7) goto LAB_43;

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar27 = 0xb9;

+                goto LAB_44;

+              }

+            }

+          }

+LAB_45:

+          RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                    ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_ae0);

+        }

+      }

+    }

+    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)local_af0);

+    this_01 = (RdpXSPtr<RdpXInterfaceCriticalSection> *)local_b10;

+    goto LAB_30;

+  }

+  ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_b18);

+  ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_b00);

+  if (*(ushort *)(param_1 + 2) < 0x18) {

+    LogRemoteAppError(this + 0x10,

+                      (ushort *)L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_BODY for Create PDU",

+                      0x8000ffff,0,0);

+  }

+  if (*(ushort *)(param_1 + 2) < 0x18) {

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

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

+      uVar6 = RdpX_GetActivityIdPrefix();

+      uVar27 = 0xa5;

+LAB_52:

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

+                &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+    }

+LAB_53:

+    lVar7 = -0x7fff0001;

+  }

+  else {

+    uVar31 = (uint)*(ushort *)(param_1 + 0xc);

+    if ((uint)*(ushort *)(param_1 + 2) < uVar31 + 0x18) {

+      LogRemoteAppError(this + 0x10,

+                        (ushort *)L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_BODY for Create PDU",

+                        0x8000ffff,0,0);

+    }

+    if ((uint)*(ushort *)(param_1 + 2) < uVar31 + 0x18) {

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

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

+        uVar6 = RdpX_GetActivityIdPrefix();

+        uVar27 = 0xa6;

+        goto LAB_52;

+      }

+      goto LAB_53;

+    }

+    ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                         ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_b00);

+    lVar7 = GetWndPlugin(this + -0x30,(ITSWndPluginEx **)ppRVar14);

+    if (lVar7 < 0) {

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

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

+        uVar6 = RdpX_GetActivityIdPrefix();

+        uVar27 = 0xa7;

+LAB_54:

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

+                   &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+      }

+    }

+    else {

+      pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                          ((TCntPtr<ITSClientPlatformInstance> *)local_b00);

+      pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x48);

+      RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_b18);

+      iVar34 = (*pcVar11)(pIVar13,*(undefined4 *)(param_1 + 4),*(undefined4 *)(param_1 + 8));

+      if (iVar34 < 0) {

+        pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                            ((TCntPtr<ITSClientPlatformInstance> *)local_b00);

+        pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x50);

+        RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                  ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_b18);

+        lVar7 = (*pcVar11)(pIVar13,*(undefined4 *)(param_1 + 4),*(undefined4 *)(param_1 + 8));

+        if (lVar7 < 0) {

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

+            uVar27 = 0xa8;

+            goto LAB_54;

+          }

+          goto LAB_55;

+        }

+        pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                            ((TCntPtr<ITSClientPlatformInstance> *)local_b18);

+        (**(code **)(*(longlong *)pIVar13 + 0x78))(pIVar13,1);

+      }

+      else {

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

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

+          RdpX_GetActivityIdPrefix();

+          WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xa9,

+                     &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids);

+        }

+        pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                            ((TCntPtr<ITSClientPlatformInstance> *)local_b18);

+        (**(code **)(*(longlong *)pIVar13 + 0x80))(pIVar13);

+      }

+      pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                          ((TCntPtr<ITSClientPlatformInstance> *)local_b00);

+      iVar34 = (**(code **)(*(longlong *)pIVar13 + 0x88))(pIVar13);

+      if (iVar34 != 0) {

+        pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                            ((TCntPtr<ITSClientPlatformInstance> *)local_b18);

+        (**(code **)(*(longlong *)pIVar13 + 0x88))(pIVar13,2);

+      }

+      pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                          ((TCntPtr<ITSClientPlatformInstance> *)local_b18);

+      (**(code **)(*(longlong *)pIVar13 + 0x70))(pIVar13,4);

+      ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_ae8);

+      if (*(short *)(param_1 + 0xc) == 0) {

+LAB_56:

+        if (((byte)param_1[0x14] & 4) != 0) {

+          pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                              ((TCntPtr<ITSClientPlatformInstance> *)local_b18);

+          lVar7 = (**(code **)(*(longlong *)pIVar13 + 0x68))

+                            (pIVar13,*(undefined4 *)(param_1 + 0x10));

+          if (lVar7 < 0) {

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

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

+              uVar6 = RdpX_GetActivityIdPrefix();

+              uVar27 = 0xac;

+              goto LAB_57;

+            }

+            goto LAB_58;

+          }

+        }

+        if (param_1[0xe] == (tagTS_RAIL_PDU)0x0) {

+          pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                              ((TCntPtr<ITSClientPlatformInstance> *)local_ae8);

+          if (pIVar13 != (ITSClientPlatformInstance *)0x0) {

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_ae8);

+            (**(code **)(*(longlong *)pIVar13 + 0x18))(pIVar13);

+          }

+          LogRemoteAppEventF(this + 0x10,

+                             (ushort *)

+                             L"NotifyIconCreateRailOrderReceived_NoIcons: WindowId=0x%x, NotifyIconId=0x%x, NumIcons=%hhu, IsCachedIcon=%hhu, StateFlags=0x%x, PDUFlags=0x%x, ToolTipBytes=%hu, ToolTip=%s"

+                             ,0,(ulonglong)*(uint *)(param_1 + 4));

+LAB_59:

+          pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                              ((TCntPtr<ITSClientPlatformInstance> *)local_b18);

+          pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                              ((TCntPtr<ITSClientPlatformInstance> *)local_b18);

+          uVar31 = (**(code **)(*(longlong *)pIVar15 + 0x48))(pIVar15);

+          lVar7 = OnShellNotifyInformation

+                            (this,uVar31,(RdpXInterfaceShellNotifyInformation *)pIVar13);

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

+            uVar27 = 0xb3;

+            goto LAB_57;

+          }

+        }

+        else {

+          ComPlainSmartPtr<ITSWindowInformation>::ComPlainSmartPtr<ITSWindowInformation>(local_a68);

+          local_ad8 = (tagTS_RAIL_PDU *)(ulonglong)*(ushort *)(param_1 + 0xc);

+          if (param_1[0xf] == (tagTS_RAIL_PDU)0x0) {

+            uVar31 = uVar31 + 0x2c;

+            if (*(ushort *)(param_1 + 2) < uVar31) {

+              LogRemoteAppError(this + 0x10,

+                                (ushort *)

+                                L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_BODY for Create PDU",

+                                0x8000ffff,0,0);

+            }

+            if (*(ushort *)(param_1 + 2) < uVar31) {

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar27 = 0xaf;

+LAB_60:

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

+                          &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+            }

+            else {

+              if (((byte)(local_ad8 + 0x1b)[(longlong)param_1] & 2) == 0) {

+                tVar37 = (tagTS_RAIL_PDU)0x20;

+              }

+              else {

+                tVar37 = (local_ad8 + 0x20)[(longlong)param_1];

+                uVar38 = *(ushort *)(local_ad8 + 0x22 + (longlong)param_1);

+              }

+              local_948 = param_1 + 0x2c + (longlong)local_ad8;

+              local_920 = local_948 + uVar38;

+              local_938 = local_920 + *(uint *)(local_ad8 + 0x24 + (longlong)param_1);

+              uVar31 = uVar31 + (uint)uVar38 + *(int *)(local_ad8 + 0x28 + (longlong)param_1) +

+                                *(uint *)(local_ad8 + 0x24 + (longlong)param_1);

+              if (*(ushort *)(param_1 + 2) < uVar31) {

+                LogRemoteAppError(this + 0x10,

+                                  (ushort *)

+                                  L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_BODY for Create PDU",

+                                  0x8000ffff,0,0);

+              }

+              if (uVar31 <= *(ushort *)(param_1 + 2)) {

+                local_ab8 = (uint)*(ushort *)(local_ad8 + 0x22 + (longlong)param_1);

+                local_9d8 = (uint)(byte)(local_ad8 + 0x20)[(longlong)param_1];

+                local_a00 = (uint)*(ushort *)(local_ad8 + 0x1e + (longlong)param_1);

+                local_b08 = (uint)*(ushort *)(local_ad8 + 0x1c + (longlong)param_1);

+                local_acc = (uint)(byte)(local_ad8 + 0x1b)[(longlong)param_1];

+                local_ad0 = (uint)*(ushort *)(local_ad8 + 0x18 + (longlong)param_1);

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_ae8);

+                if (pIVar13 != (ITSClientPlatformInstance *)0x0) {

+                  pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                      ((TCntPtr<ITSClientPlatformInstance> *)local_ae8);

+                  (**(code **)(*(longlong *)pIVar13 + 0x18))(pIVar13);

+                }

+                LogRemoteAppEventF(this + 0x10,

+                                   (ushort *)

+                                   L"NotifyIconCreateRailOrderReceived_NonCached: WindowId=0x%x, NotifyIconId=0x%x, NumIcons=%hhu, IsCachedIcon=%hhu, StateFlags=0x%x, PDUFlags=0x%x, ToolTipBytes=%hu, ToolTip=%s, CacheEntry=0x%hx, CacheId=0x%hhx, IconFlags=0x%hhx, Width=%hu, Height=%hu, Bpp=%hhu, ColorTableBytes=%hu, BitsMaskBytes=%u, BitsColorBytes=%u"

+                                   ,0,(ulonglong)*(uint *)(param_1 + 4));

+                pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                    ((TCntPtr<ITSClientPlatformInstance> *)local_b00);

+                pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x40);

+                RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                          ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_a68);

+                lVar7 = (*pcVar11)(pIVar13,(local_ad8 + 0x1a)[(longlong)param_1],

+                                   *(undefined2 *)(local_ad8 + 0x18 + (longlong)param_1),

+                                   CONCAT31((int3)((uint)*(undefined4 *)

+                                                          (local_ad8 + 0x24 + (longlong)param_1) >>

+                                                  8),tVar37));

+                if (lVar7 < 0) {

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

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

+                     ) {

+                    uVar6 = RdpX_GetActivityIdPrefix();

+                    uVar27 = 0xb1;

+                    goto LAB_61;

+                  }

+                  goto LAB_62;

+                }

+                goto LAB_63;

+              }

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar27 = 0xb0;

+                goto LAB_60;

+              }

+            }

+LAB_64:

+            lVar7 = -0x7fff0001;

+          }

+          else {

+            if ((uint)*(ushort *)(param_1 + 2) < uVar31 + 0x1c) {

+              LogRemoteAppError(this + 0x10,

+                                (ushort *)

+                                L"Invalid size of TS_RAIL_ORDER_NOTIFYICON_BODY for Create PDU",

+                                0x8000ffff,0,0);

+            }

+            if ((uint)*(ushort *)(param_1 + 2) < uVar31 + 0x1c) {

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar27 = 0xad;

+                goto LAB_60;

+              }

+              goto LAB_64;

+            }

+            local_ab8 = (uint)*(ushort *)(local_ad8 + 0x18 + (longlong)param_1);

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_ae8);

+            if (pIVar13 != (ITSClientPlatformInstance *)0x0) {

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_ae8);

+              (**(code **)(*(longlong *)pIVar13 + 0x18))(pIVar13);

+            }

+            LogRemoteAppEventF(this + 0x10,

+                               (ushort *)

+                               L"NotifyIconCreateRailOrderReceived_Cached: WindowId=0x%x, NotifyIconId=0x%x, NumIcons=%hhu, IsCachedIcon=%hhu, StateFlags=0x%x, PDUFlags=0x%x, ToolTipBytes=%hu, ToolTip=%s, CacheEntry=0x%hx, CacheId=0x%hhx, IconFlags=0x%hhx"

+                               ,0,(ulonglong)*(uint *)(param_1 + 4));

+            pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                ((TCntPtr<ITSClientPlatformInstance> *)local_b00);

+            pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x38);

+            ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                                 ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_a68

+                                 );

+            lVar7 = (*pcVar11)(pIVar13,(local_ad8 + 0x1a)[(longlong)param_1],

+                               *(undefined2 *)(local_ad8 + 0x18 + (longlong)param_1),ppRVar14);

+            if (lVar7 < 0) {

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar27 = 0xae;

+LAB_61:

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

+                           &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+              }

+            }

+            else {

+LAB_63:

+              pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_b18);

+              pcVar11 = *(code **)(*(longlong *)pIVar13 + 0x50);

+              pIVar15 = TCntPtr<ITSClientPlatformInstance>::operator->

+                                  ((TCntPtr<ITSClientPlatformInstance> *)local_a68);

+              lVar7 = (*pcVar11)(pIVar13,pIVar15);

+              if (-1 < lVar7) {

+                RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                          ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a68);

+                goto LAB_59;

+              }

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

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

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar27 = 0xb2;

+                goto LAB_61;

+              }

+            }

+          }

+LAB_62:

+          RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                    ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_a68);

+        }

+      }

+      else {

+        pIVar13 = TCntPtr<ITSClientPlatformInstance>::operator->

+                            ((TCntPtr<ITSClientPlatformInstance> *)local_b18);

+        lVar7 = (**(code **)(*(longlong *)pIVar13 + 0x58))

+                          (pIVar13,*(ushort *)(param_1 + 0xc) >> 1,param_1 + 0x18);

+        if (lVar7 < 0) {

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

+            uVar27 = 0xaa;

+LAB_57:

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

+                       &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar6);

+          }

+        }

+        else {

+          ppRVar14 = RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal>::operator&

+                               ((RdpXSPtr<RdpXInterfaceShellNotifyInformationInternal> *)local_ae8);

+          _Var8 = RdpX_Strings_CreateConstXChar16StringWithSpecifiedSize

+                            (*(ushort *)(param_1 + 0xc) >> 1,param_1 + 0x18,ppRVar14);

+          lVar7 = MapXResultToHR(_Var8);

+          if (-1 < lVar7) goto LAB_56;

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

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

+            uVar6 = RdpX_GetActivityIdPrefix();

+            uVar27 = 0xab;

+            goto LAB_57;

+          }

+        }

+      }

+LAB_58:

+      RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>::~RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo>

+                ((RdpXSPtr<RdpXInterfaceRemoteAppMoveInfo> *)local_ae8);

+    }

+  }

+LAB_55:

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)local_b00);

+  this_01 = (RdpXSPtr<RdpXInterfaceCriticalSection> *)local_b18;

+LAB_30:

+  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease(this_01);

+  return lVar7;

+}

+
```

## `CProxyDataObjectManager::Terminate`  (modified)

```diff
--- CProxyDataObjectManager::Terminate
+++ CProxyDataObjectManager::Terminate
@@ -1,2 +1,110 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyDataObjectManager::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 CProxyDataObjectManager::Terminate(void) __ptr64 */

+

+long __thiscall CProxyDataObjectManager::Terminate(CProxyDataObjectManager *this)

+

+{

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *pTVar1;

+  int iVar2;

+  CProxyDataObject *pCVar3;

+  bool bVar4;

+  uint uVar5;

+  int iVar6;

+  ulong uVar7;

+  CProxyDataObject *local_res8;

+  

+  bVar4 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

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

+                      ::__l2::impl);

+  if (bVar4) {

+    EnterCriticalSection((LPCRITICAL_SECTION)(this + 0x30));

+    NotifyDataObjectOnMgrTermination(this + -8);

+    iVar2 = *(int *)(this + 0x6c);

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

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

+      uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

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

+                &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar5,iVar2);

+    }

+    uVar7 = 1;

+    if (1 < iVar2) {

+      do {

+        local_res8 = (CProxyDataObject *)0x0;

+        iVar6 = SmartArray<CProxyDataObject,unsigned_long>::GetAt

+                          ((SmartArray<CProxyDataObject,unsigned_long> *)(this + 0x68),uVar7,

+                           &local_res8);

+        if ((iVar6 != 0) && (local_res8 != (CProxyDataObject *)0x0)) {

+          (**(code **)(**(longlong **)(local_res8 + 0x20) + 0x10))();

+          iVar6 = SmartArray<CProxyDataObject,unsigned_long>::AddAt

+                            ((SmartArray<CProxyDataObject,unsigned_long> *)(this + 0x68),uVar7,

+                             (CProxyDataObject *)0x0);

+          if (((iVar6 == 0) &&

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

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

+            uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

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

+                      &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar5,uVar7);

+          }

+        }

+        uVar7 = uVar7 + 1;

+      } while ((int)uVar7 < iVar2);

+    }

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

+    pTVar1 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x60);

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

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

+      *(undefined8 *)pTVar1 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar1);

+    }

+    LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x30));

+  }

+  else {

+    iVar2 = *(int *)(this + 0x6c);

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

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

+      uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

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

+                &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar5,iVar2);

+    }

+    uVar7 = 1;

+    if (1 < iVar2) {

+      do {

+        local_res8 = (CProxyDataObject *)0x0;

+        iVar6 = SmartArray<CProxyDataObject,unsigned_long>::GetAt

+                          ((SmartArray<CProxyDataObject,unsigned_long> *)(this + 0x68),uVar7,

+                           &local_res8);

+        pCVar3 = local_res8;

+        if ((iVar6 != 0) && (local_res8 != (CProxyDataObject *)0x0)) {

+          CProxyDataObject::OnManagerTerminating(local_res8);

+          (**(code **)(**(longlong **)(pCVar3 + 0x20) + 0x10))();

+          iVar6 = SmartArray<CProxyDataObject,unsigned_long>::AddAt

+                            ((SmartArray<CProxyDataObject,unsigned_long> *)(this + 0x68),uVar7,

+                             (CProxyDataObject *)0x0);

+          if (((iVar6 == 0) &&

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

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

+            uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

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

+                      &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar5,uVar7);

+          }

+        }

+        uVar7 = uVar7 + 1;

+      } while ((int)uVar7 < iVar2);

+    }

+    pTVar1 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x60);

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

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

+      *(undefined8 *)pTVar1 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar1);

+    }

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

+  }

+  *(uint *)(this + 0x14) = *(uint *)(this + 0x14) | 4;

+  return 0;

+}

+
```

## `CHdropToFgdConverter::ClearFgdCache`  (modified)

```diff
--- CHdropToFgdConverter::ClearFgdCache
+++ CHdropToFgdConverter::ClearFgdCache
@@ -1,2 +1,22 @@
-Failed to decompile mstscax.dll - .ProgramDB CHdropToFgdConverter::ClearFgdCache : 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: void __cdecl CHdropToFgdConverter::ClearFgdCache(void) __ptr64 */

+

+void __thiscall CHdropToFgdConverter::ClearFgdCache(CHdropToFgdConverter *this)

+

+{

+  if (*(HLOCAL *)this != (HLOCAL)0x0) {

+    LocalFree(*(HLOCAL *)this);

+    *(undefined8 *)this = 0;

+  }

+  if (*(HLOCAL *)(this + 8) != (HLOCAL)0x0) {

+    LocalFree(*(HLOCAL *)(this + 8));

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

+  }

+  if (*(longlong **)(this + 0x18) != (longlong *)0x0) {

+    (**(code **)(**(longlong **)(this + 0x18) + 0x50))();

+  }

+  return;

+}

+
```

## `AvcDecoder::DecodeHeader`  (modified)

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

+/* private: long __cdecl AvcDecoder::DecodeHeader(unsigned char const * __ptr64,unsigned

+   int,unsigned int * __ptr64) __ptr64 */

+

+long __thiscall AvcDecoder::DecodeHeader(AvcDecoder *this,uchar *param_1,uint param_2,uint *param_3)

+

+{

+  byte bVar1;

+  ushort uVar2;

+  uint uVar3;

+  bool bVar4;

+  undefined4 uVar5;

+  undefined4 uVar6;

+  int iVar7;

+  __uint64 _Var8;

+  void *pvVar9;

+  int iVar10;

+  char *pcVar11;

+  uint uVar12;

+  undefined8 uVar13;

+  uint uVar14;

+  long lVar15;

+  ushort *puVar16;

+  ushort *puVar17;

+  longlong lVar18;

+  uint uVar19;

+  uint uVar20;

+  ulonglong uVar21;

+  uint uVar22;

+  undefined8 in_stack_ffffffffffffff88;

+  longlong local_60;

+  ulonglong local_50;

+  undefined8 uStack_48;

+  

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

+  if (param_2 < 4) {

+    lVar15 = -0x7fff0001;

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

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

+    goto LAB_0;

+    uVar5 = RdpX_GetActivityIdPrefix();

+    uVar13 = 0x47;

+    pcVar11 = "Invalid input buffer - too small for numRects.";

+  }

+  else {

+    uVar3 = *(uint *)param_1;

+    puVar16 = (ushort *)(param_1 + 4);

+    if (uVar3 == 0) {

+      *(undefined4 *)(this + 0x48) = 0;

+      operator_delete__(*(void **)(this + 0x40));

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

+      *param_3 = 0;

+      return 0;

+    }

+    uVar21 = (ulonglong)uVar3;

+    if (((ulonglong)uVar3 * 10 < 0x100000000) && ((ulonglong)uVar3 * 10 <= (ulonglong)(param_2 - 4))

+       ) {

+      *(uint *)(this + 0x48) = uVar3;

+      operator_delete__(*(void **)(this + 0x40));

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

+      _Var8 = SUB168(ZEXT816(0x18) * ZEXT416(*(uint *)(this + 0x48)),0);

+      if (SUB168(ZEXT816(0x18) * ZEXT416(*(uint *)(this + 0x48)),8) != 0) {

+        _Var8 = 0xffffffffffffffff;

+      }

+      pvVar9 = operator_new(_Var8);

+      operator_delete__(*(void **)(this + 0x40));

+      uVar19 = 0;

+      *(void **)(this + 0x40) = pvVar9;

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

+        if (uVar3 != 0) {

+          local_60 = 0;

+          puVar17 = puVar16;

+          do {

+            iVar7 = (int)(short)puVar17[2];

+            iVar10 = (int)(short)puVar17[3];

+            uVar12 = (uint)*puVar17;

+            uVar14 = iVar7 - uVar12;

+            uVar2 = puVar17[1];

+            uVar20 = (uint)uVar2;

+            puVar17 = puVar17 + 4;

+            uVar22 = iVar10 - (uint)uVar2;

+            local_50 = (ulonglong)CONCAT24(uVar2,uVar12);

+            uStack_48 = CONCAT44(uVar22,uVar14);

+            bVar4 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>::

+                    __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_3215164728> *)

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

+                                         ::__l2::impl);

+            if (bVar4) {

+              if (((iVar7 <= (int)uVar12) || (iVar10 <= (int)uVar20)) ||

+                 ((*(uint *)this < uVar14 ||

+                  (((*(uint *)(this + 4) < uVar22 || (*(uint *)this < uVar12 + uVar14)) ||

+                   (*(uint *)(this + 4) < uVar22 + uVar20)))))) {

+                lVar15 = -0x7fff0001;

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

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

+                goto LAB_0;

+                uVar5 = RdpX_GetActivityIdPrefix();

+                uVar13 = 0x4a;

+LAB_1:

+                pcVar11 = "Invalid input buffer - invalid rect received.";

+                goto LAB_2;

+              }

+            }

+            else if ((((iVar7 <= (int)uVar12) || (iVar10 <= (int)uVar20)) ||

+                     (*(uint *)this < uVar14)) || (*(uint *)(this + 4) < uVar22)) {

+              lVar15 = -0x7fff0001;

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

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

+                uVar5 = RdpX_GetActivityIdPrefix();

+                uVar13 = 0x4b;

+                goto LAB_1;

+              }

+              goto LAB_0;

+            }

+            puVar16 = puVar16 + 4;

+            lVar18 = *(longlong *)(this + 0x40);

+            uVar19 = uVar19 + 1;

+            *(ulonglong *)(local_60 + lVar18) = local_50;

+            ((ulonglong *)(local_60 + lVar18))[1] = uStack_48;

+            local_60 = local_60 + 0x18;

+          } while (uVar19 < uVar3);

+          lVar18 = 0;

+          do {

+            uVar2 = *puVar16;

+            *(uint *)(lVar18 + 0x14 + *(longlong *)(this + 0x40)) = (uint)(byte)((byte)uVar2 >> 7);

+            bVar1 = *(byte *)((longlong)puVar16 + 1);

+            *(byte *)(lVar18 + 0x10 + *(longlong *)(this + 0x40)) = (byte)uVar2 & 0x7f;

+            *(byte *)(lVar18 + 0x11 + *(longlong *)(this + 0x40)) = bVar1;

+            uVar21 = uVar21 - 1;

+            puVar16 = puVar16 + 1;

+            lVar18 = lVar18 + 0x18;

+          } while (uVar21 != 0);

+        }

+        *param_3 = uVar3;

+        return 0;

+      }

+      if ((((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),0x49,

+                  &WPP_409a8a59682237a7ddc3f8fcc3aa60d6_Traceguids,uVar6,CONCAT44(uVar5,0x8007000e))

+        ;

+      }

+      lVar15 = -0x7ff8fff2;

+      goto LAB_0;

+    }

+    lVar15 = -0x7fff0001;

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

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

+    goto LAB_0;

+    uVar5 = RdpX_GetActivityIdPrefix();

+    uVar13 = 0x48;

+    pcVar11 = "Invalid header received.";

+  }

+LAB_2:

+  lVar15 = -0x7fff0001;

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

+             &WPP_409a8a59682237a7ddc3f8fcc3aa60d6_Traceguids,uVar5,pcVar11,0x8000ffff);

+LAB_0:

+  *(undefined4 *)(this + 0x48) = 0;

+  return lVar15;

+}

+
```

## `CCommonPNPPDUHandler::ReadAndVerifyPDUHeader`  (modified)

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

+/* protected: virtual long __cdecl CCommonPNPPDUHandler::ReadAndVerifyPDUHeader(long,unsigned char *

+   __ptr64) __ptr64 */

+

+long __thiscall

+CCommonPNPPDUHandler::ReadAndVerifyPDUHeader(CCommonPNPPDUHandler *this,long param_1,uchar *param_2)

+

+{

+  bool bVar1;

+  uint uVar2;

+  char *pcVar3;

+  int *piVar4;

+  undefined8 uVar5;

+  

+  if ((uint)param_1 < 8) {

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

+      return -0x7fffbffb;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+      return -0x7fffbffb;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return -0x7fffbffb;

+    }

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar5 = 0xc;

+    pcVar3 = "cbSize < sizeof(IRPDR_HEADER";

+  }

+  else if (param_1 == *(int *)param_2) {

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

+                      ((FeatureImpl<__WilFeatureTraits_Feature_735818040> *)

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

+                        ::__l2::impl);

+    uVar2 = 0;

+    if (bVar1) {

+      piVar4 = &DAT_0;

+      do {

+        if (*(int *)(param_2 + 4) == *piVar4) {

+          if (*(uint *)(&DAT_1 + (longlong)(int)uVar2 * 0x10) < *(uint *)param_2) {

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

+              return -0x7fffbffb;

+            }

+            if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+              return -0x7fffbffb;

+            }

+            if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+              return -0x7fffbffb;

+            }

+            uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+            uVar5 = 0xe;

+            pcVar3 = "pHeader->Size > IrpDrPduArray[i].MaxSize";

+            goto LAB_2;

+          }

+          if (*(uint *)param_2 < *(uint *)(&DAT_3 + (longlong)(int)uVar2 * 0x10)) {

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

+              return -0x7fffbffb;

+            }

+            if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+              return -0x7fffbffb;

+            }

+            if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+              return -0x7fffbffb;

+            }

+            uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+            uVar5 = 0xf;

+            pcVar3 = "pHeader->Size < IrpDrPduArray[i].MinSize";

+            goto LAB_2;

+          }

+          break;

+        }

+        uVar2 = uVar2 + 1;

+        piVar4 = piVar4 + 4;

+      } while (uVar2 < 4);

+      if (uVar2 != 4) {

+        return 0;

+      }

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

+        return -0x7fffbffb;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+        return -0x7fffbffb;

+      }

+      if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+        return -0x7fffbffb;

+      }

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar5 = 0x10;

+    }

+    else {

+      piVar4 = &DAT_4;

+      do {

+        if (*(int *)(param_2 + 4) == *piVar4) {

+          if (*(uint *)(&DAT_5 + (longlong)(int)uVar2 * 0x10) < *(uint *)param_2) {

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

+              return -0x7fffbffb;

+            }

+            if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+              return -0x7fffbffb;

+            }

+            if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+              return -0x7fffbffb;

+            }

+            uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+            uVar5 = 0x11;

+            pcVar3 = "pHeader->Size > IrpDrPduArray_old[i].MaxSize";

+            goto LAB_2;

+          }

+          if (*(uint *)param_2 < *(uint *)(&DAT_6 + (longlong)(int)uVar2 * 0x10)) {

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

+              return -0x7fffbffb;

+            }

+            if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+              return -0x7fffbffb;

+            }

+            if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+              return -0x7fffbffb;

+            }

+            uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+            uVar5 = 0x12;

+            pcVar3 = "pHeader->Size < IrpDrPduArray_old[i].MinSize";

+            goto LAB_2;

+          }

+          break;

+        }

+        uVar2 = uVar2 + 1;

+        piVar4 = piVar4 + 4;

+      } while (uVar2 < 4);

+      if (uVar2 != 4) {

+        return 0;

+      }

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

+        return -0x7fffbffb;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+        return -0x7fffbffb;

+      }

+      if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+        return -0x7fffbffb;

+      }

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar5 = 0x13;

+    }

+    pcVar3 = "i == numberPDUS";

+  }

+  else {

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

+      return -0x7fffbffb;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+      return -0x7fffbffb;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return -0x7fffbffb;

+    }

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar5 = 0xd;

+    pcVar3 = "cbSize != pHeader->Size";

+  }

+LAB_2:

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

+             &WPP_e2b56b352adb3f7cce4d744ee53ca915_Traceguids,uVar2,pcVar3,0x80004005);

+  return -0x7fffbffb;

+}

+
```

## `FrameBufferClientChannel::CreateClientAck`  (modified)

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

+/* private: long __cdecl FrameBufferClientChannel::CreateClientAck(unsigned char * __ptr64 *

+   __ptr64,unsigned long * __ptr64) __ptr64 */

+

+long __thiscall

+FrameBufferClientChannel::CreateClientAck

+          (FrameBufferClientChannel *this,uchar **param_1,ulong *param_2)

+

+{

+  bool bVar1;

+  uint uVar2;

+  uchar *puVar3;

+  long lVar4;

+  

+  lVar4 = 0;

+  puVar3 = operator_new(9);

+  if (puVar3 == (uchar *)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_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x32,

+                &WPP_41b64d9d951b324b68b841c61c3f12ba_Traceguids,uVar2,0x8007000e);

+    }

+    lVar4 = -0x7ff8fff2;

+  }

+  else {

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

+                      ((FeatureImpl<__WilFeatureTraits_Feature_143638841> *)

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

+                        ::__l2::impl);

+    if (bVar1) {

+      puVar3[8] = '\0';

+    }

+    puVar3[0] = '\t';

+    puVar3[1] = '\0';

+    puVar3[2] = '\0';

+    puVar3[3] = '\0';

+    puVar3[4] = '\x03';

+    puVar3[5] = '\0';

+    puVar3[6] = '\0';

+    puVar3[7] = '\0';

+    *param_2 = 9;

+    *param_1 = puVar3;

+  }

+  return lVar4;

+}

+
```

## `CUH::UHSendDrawNineGridErrorPDU`  (modified)

```diff
--- CUH::UHSendDrawNineGridErrorPDU
+++ CUH::UHSendDrawNineGridErrorPDU
@@ -1,2 +1,107 @@
-Failed to decompile mstscax.dll - .ProgramDB CUH::UHSendDrawNineGridErrorPDU : 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 CUH::UHSendDrawNineGridErrorPDU(void) __ptr64 */

+

+long __thiscall CUH::UHSendDrawNineGridErrorPDU(CUH *this)

+

+{

+  CTSRdpConnectionStack *this_00;

+  bool bVar1;

+  undefined4 uVar2;

+  long lVar3;

+  ulong uVar4;

+  undefined8 *puVar5;

+  undefined4 uVar6;

+  int in_R8D;

+  ITSNetBuffer *local_res8;

+  CTSRdpConnectionStack *local_res10;

+  

+  this_00 = *(CTSRdpConnectionStack **)(this + 0x820);

+  local_res8 = (ITSNetBuffer *)0x0;

+  local_res10 = this_00;

+  TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+            ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)&local_res10);

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

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

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

+      uVar2 = RdpX_GetActivityIdPrefix();

+      uVar6 = 0x50;

+      goto LAB_0;

+    }

+  }

+  else {

+    if (*(int *)(this + 0x390) != 0) {

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

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

+        uVar2 = RdpX_GetActivityIdPrefix();

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

+                 &WPP_9a0d9d550f633384007dbcf4fa3c3c61_Traceguids,uVar2);

+      }

+      lVar3 = -0x7fff0001;

+      goto LAB_1;

+    }

+    lVar3 = CTSRdpConnectionStack::GetBuffer(this_00,0x16,in_R8D,&local_res8);

+    if (lVar3 < 0) {

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

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

+        uVar2 = RdpX_GetActivityIdPrefix();

+        uVar6 = 0x55;

+LAB_0:

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

+                 &WPP_9a0d9d550f633384007dbcf4fa3c3c61_Traceguids,uVar2);

+      }

+    }

+    else {

+      puVar5 = (undefined8 *)(**(code **)(*(longlong *)local_res8 + 0x28))();

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

+                        ((FeatureImpl<__WilFeatureTraits_Feature_64729402> *)

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

+                          ::__l2::impl);

+      if (bVar1) {

+        *puVar5 = 0;

+        puVar5[1] = 0;

+        *(undefined4 *)(puVar5 + 2) = 0;

+        *(undefined2 *)((longlong)puVar5 + 0x14) = 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),0x52,

+                 &WPP_9a0d9d550f633384007dbcf4fa3c3c61_Traceguids,uVar2);

+      }

+      *(undefined4 *)puVar5 = 0x170016;

+      uVar4 = CTSRdpConnectionStack::GetClientMCSID(this_00);

+      *(short *)((longlong)puVar5 + 4) = (short)uVar4;

+      uVar4 = CTSRdpConnectionStack::GetShareID(this_00);

+      *(ulong *)((longlong)puVar5 + 6) = uVar4;

+      *(undefined2 *)((longlong)puVar5 + 10) = 0x100;

+      *(undefined4 *)((longlong)puVar5 + 0xe) = 0x30;

+      *(undefined4 *)((longlong)puVar5 + 0x12) = 1;

+      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),0x53,

+                 &WPP_9a0d9d550f633384007dbcf4fa3c3c61_Traceguids,uVar2);

+      }

+      lVar3 = CTSRdpConnectionStack::SendBuffer(this_00,local_res8,0x16,8);

+      if (-1 < lVar3) {

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

+        goto LAB_1;

+      }

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

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

+        uVar2 = RdpX_GetActivityIdPrefix();

+        uVar6 = 0x54;

+        goto LAB_0;

+      }

+    }

+  }

+  lVar3 = -0x7fffbffb;

+LAB_1:

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)&local_res10);

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

+  return lVar3;

+}

+
```

## `CHdropToFgdConverter::DoConversionWorker`  (modified)

```diff
--- CHdropToFgdConverter::DoConversionWorker
+++ CHdropToFgdConverter::DoConversionWorker
@@ -1,2 +1,163 @@
-Failed to decompile mstscax.dll - .ProgramDB CHdropToFgdConverter::DoConversionWorker : 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: long __cdecl CHdropToFgdConverter::DoConversionWorker(struct HDROP__ * __ptr64,struct

+   _DROPFILES * __ptr64,unsigned __int64) __ptr64 */

+

+long __thiscall

+CHdropToFgdConverter::DoConversionWorker

+          (CHdropToFgdConverter *this,HDROP__ *param_1,_DROPFILES *param_2,__uint64 param_3)

+

+{

+  HLOCAL hMem;

+  bool bVar1;

+  bool bVar2;

+  UINT UVar3;

+  DWORD DVar4;

+  uint uVar5;

+  int iVar6;

+  longlong lVar7;

+  wchar_t *pwVar8;

+  HGLOBAL pvVar9;

+  undefined8 uVar10;

+  UINT iFile;

+  undefined1 auStackY_298 [32];

+  HDROP__ *local_268 [2];

+  WCHAR local_258 [264];

+  ulonglong local_48;

+  

+  local_48 = __security_cookie ^ (ulonglong)auStackY_298;

+  local_268[0] = (HDROP)0x0;

+  bVar2 = false;

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

+  if (*(longlong **)(this + 0x18) != (longlong *)0x0) {

+    (**(code **)(**(longlong **)(this + 0x18) + 0x50))();

+  }

+  UVar3 = DragQueryFileW(param_1,0xffffffff,(LPWSTR)0x0,0);

+  bVar1 = bVar2;

+  if ((*(int *)(param_2 + 0x10) == 0) &&

+     (DVar4 = CHdropData::ConvertHdropToUnicode(local_268,param_2,param_3), param_1 = local_268[0],

+     bVar1 = true, (int)DVar4 < 0)) {

+    bVar1 = bVar2;

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

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

+      uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

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

+                 &WPP_54668a42b12137b072b482f5c892786f_Traceguids,uVar5);

+      param_1 = local_268[0];

+    }

+  }

+  else {

+    iVar6 = UVar3 * 0x250 + 4;

+    *(int *)(this + 0x10) = iVar6;

+    lVar7 = PAL_System_MemAlloc(iVar6,1);

+    *(longlong *)(this + 8) = lVar7;

+    if (lVar7 == 0) {

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

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

+        uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar10 = 0x11;

+LAB_0:

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

+                  &WPP_54668a42b12137b072b482f5c892786f_Traceguids,uVar5);

+      }

+    }

+    else {

+      lVar7 = PAL_System_MemAlloc(*(undefined4 *)(this + 0x10),1);

+      *(longlong *)this = lVar7;

+      if (lVar7 != 0) {

+        iFile = 0;

+        if (UVar3 != 0) {

+          do {

+            DragQueryFileW(param_1,iFile,local_258,0x104);

+            DVar4 = GetFileAttributesW(local_258);

+            if (DVar4 == 0xffffffff) {

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

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

+                uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

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

+                          &WPP_54668a42b12137b072b482f5c892786f_Traceguids,uVar5);

+              }

+              DVar4 = GetLastError();

+              if (0 < (int)DVar4) {

+                DVar4 = DVar4 & 0xffff | 0x80070000;

+              }

+              if (-1 < (int)DVar4) goto LAB_1;

+              goto LAB_2;

+            }

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

+              pwVar8 = wcsrchr(local_258,L'\\');

+              if (pwVar8 == (wchar_t *)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),0x15,

+                           &WPP_54668a42b12137b072b482f5c892786f_Traceguids,uVar5);

+                }

+                DVar4 = 0x8000ffff;

+                goto LAB_2;

+              }

+              DVar4 = AddItemToFgd(this,(ushort *)local_258,(ushort *)(pwVar8 + 1),

+                                   (_WIN32_FIND_DATAW *)0x0,0);

+              if ((int)DVar4 < 0) {

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

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

+                {

+                  uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+                  uVar10 = 0x16;

+                  goto LAB_3;

+                }

+                goto LAB_2;

+              }

+            }

+            else {

+              DVar4 = AddDirectoryToFgd(this,(ushort *)local_258);

+              if ((int)DVar4 < 0) {

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

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

+                {

+                  uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+                  uVar10 = 0x14;

+LAB_3:

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

+                             &WPP_54668a42b12137b072b482f5c892786f_Traceguids,uVar5);

+                }

+                goto LAB_2;

+              }

+            }

+            iFile = iFile + 1;

+          } while (iFile < UVar3);

+        }

+        DVar4 = 0;

+        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();

+        uVar10 = 0x12;

+        goto LAB_0;

+      }

+    }

+    DVar4 = 0x8007000e;

+  }

+LAB_2:

+  hMem = *(HLOCAL *)(this + 8);

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

+    LocalFree(hMem);

+  }

+  if (*(HLOCAL *)this != (HLOCAL)0x0) {

+    LocalFree(*(HLOCAL *)this);

+  }

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

+  *(undefined8 *)this = 0;

+LAB_1:

+  if (((bVar1) && (pvVar9 = GlobalFree(param_1), pvVar9 != (HGLOBAL)0x0)) &&

+     (DVar4 = GetLastError(), 0 < (int)DVar4)) {

+    DVar4 = DVar4 & 0xffff | 0x80070000;

+  }

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

+  return DVar4;

+}

+
```

## `CaCpuDecompressor::Transfer`  (modified)

```diff
--- CaCpuDecompressor::Transfer
+++ CaCpuDecompressor::Transfer
@@ -1,2 +1,95 @@
-Failed to decompile mstscax.dll - .ProgramDB CaCpuDecompressor::Transfer : 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: long __cdecl CaCpuDecompressor::Transfer(struct tagPOINT * __ptr64 const,struct

+   tagSIZE * __ptr64 const,unsigned char * __ptr64,unsigned int) __ptr64 */

+

+long __thiscall

+CaCpuDecompressor::Transfer

+          (CaCpuDecompressor *this,tagPOINT *param_1,tagSIZE *param_2,uchar *param_3,uint param_4)

+

+{

+  longlong *plVar1;

+  bool bVar2;

+  long lVar3;

+  long lVar4;

+  void *pvVar5;

+  uint uVar6;

+  ulonglong uVar7;

+  int iVar8;

+  ulonglong uVar9;

+  int iVar10;

+  ulonglong uVar11;

+  longlong lVar12;

+  int local_res8 [2];

+  

+  local_res8[0] = 1;

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

+  lVar3 = 0;

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

+    (**(code **)(*plVar1 + 0x20))(plVar1,L"CAIMG::FlipImage",local_res8);

+  }

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

+                    ((FeatureImpl<__WilFeatureTraits_Feature_553358650> *)

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

+                      ::__l2::impl);

+  if (bVar2) {

+    if ((((-1 < param_1->x) && (-1 < param_1->y)) && (0 < param_2->cx)) && (0 < param_2->cy)) {

+      uVar9 = (longlong)*(int *)(this + 0x50) * 4;

+      uVar11 = (longlong)param_2->cx * 4;

+      if ((*(int *)(this + 0x50) < 1) || ((longlong)uVar9 < 1)) {

+        return -0x7fff0001;

+      }

+      if ((((longlong)param_1->x + (longlong)param_2->cx <= (longlong)*(int *)(this + 0x50)) &&

+          ((longlong)param_1->y + (longlong)param_2->cy <=

+           (longlong)*(int *)(this + 0x40) / (longlong)uVar9)) &&

+         ((uVar11 != 0 && ((longlong)param_2->cy <= (longlong)(ulonglong)param_4 / (longlong)uVar11)

+          ))) {

+        if ((0x7fffffff < (longlong)uVar9) || (0x7fffffff < (longlong)uVar11)) {

+          return -0x7ff8fdea;

+        }

+        goto LAB_0;

+      }

+    }

+    lVar4 = -0x7ff8ffa9;

+  }

+  else {

+    uVar9 = (ulonglong)(uint)(*(int *)(this + 0x50) << 2);

+    uVar11 = (ulonglong)(uint)(param_2->cx << 2);

+LAB_0:

+    uVar6 = param_2->cy;

+    uVar7 = (ulonglong)uVar6;

+    lVar12 = (longlong)(param_1->x << 2);

+    iVar10 = (int)uVar11;

+    iVar8 = (int)uVar9;

+    lVar4 = lVar3;

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

+      pvVar5 = (void *)((longlong)(param_1->y * iVar8) + *(longlong *)(this + 0x48) + lVar12);

+      if (0 < (int)uVar6) {

+        do {

+          memcpy(param_3,pvVar5,(longlong)iVar10);

+          pvVar5 = (void *)((longlong)pvVar5 + (longlong)iVar8);

+          param_3 = param_3 + iVar10;

+          uVar7 = uVar7 - 1;

+        } while (uVar7 != 0);

+      }

+    }

+    else {

+      pvVar5 = (void *)((longlong)(int)((uVar6 + param_1->y) * iVar8) + *(longlong *)(this + 0x48) +

+                       lVar12);

+      lVar4 = 0;

+      if (0 < (int)uVar6) {

+        do {

+          pvVar5 = (void *)((longlong)pvVar5 - (longlong)iVar8);

+          memcpy(param_3,pvVar5,(longlong)iVar10);

+          param_3 = param_3 + iVar10;

+          uVar6 = (int)uVar7 - 1;

+          uVar7 = (ulonglong)uVar6;

+          lVar4 = lVar3;

+        } while (0 < (int)uVar6);

+      }

+    }

+  }

+  return lVar4;

+}

+
```

## `CNC::NC_OnMCSConnected`  (modified)

```diff
--- CNC::NC_OnMCSConnected
+++ CNC::NC_OnMCSConnected
@@ -1,2 +1,765 @@
-Failed to decompile mstscax.dll - .ProgramDB CNC::NC_OnMCSConnected : 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 CNC::NC_OnMCSConnected(unsigned int,unsigned char * __ptr64,unsigned int)

+   __ptr64 */

+

+long __thiscall CNC::NC_OnMCSConnected(CNC *this,uint param_1,uchar *param_2,uint param_3)

+

+{

+  void *pvVar1;

+  byte bVar2;

+  short sVar3;

+  undefined2 uVar4;

+  uint uVar5;

+  longlong *plVar6;

+  void *pvVar7;

+  char cVar8;

+  undefined4 uVar9;

+  undefined4 uVar10;

+  int iVar11;

+  undefined4 uVar12;

+  void *pvVar13;

+  tagRNS_UD_HEADER *ptVar14;

+  ulong uVar15;

+  undefined8 uVar16;

+  byte *pbVar17;

+  byte *pbVar18;

+  ushort uVar19;

+  byte *pbVar20;

+  ulonglong _Size;

+  int local_res10;

+  char *in_stack_ffffffffffffffa8;

+  byte *local_48 [2];

+  

+  if (param_1 != 0) {

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

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

+      uVar9 = RdpX_GetActivityIdPrefix();

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

+                &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,param_1);

+    }

+    uVar15 = 0x3104;

+    goto LAB_0;

+  }

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

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

+    uVar9 = RdpX_GetActivityIdPrefix();

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

+             &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+  }

+  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);

+  pbVar17 = param_2 + 7;

+  if ((pbVar17 < param_2) ||

+     (pbVar18 = param_2 + param_3, local_48[0] = pbVar18, pbVar18 <= pbVar17)) {

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

+       (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (WPP_GLOBAL_Control[0x19] != '\0')))) {

+      uVar16 = 0xd;

+LAB_1:

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar16,

+              &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids);

+    }

+  }

+  else {

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

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

+      bVar2 = *pbVar17;

+      uVar10 = RdpX_GetActivityIdPrefix();

+      in_stack_ffffffffffffffa8 = (char *)CONCAT44(uVar9,(uint)bVar2);

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

+                &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar10,in_stack_ffffffffffffffa8);

+    }

+    uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);

+    pbVar20 = param_2 + 8;

+    if ((((char)*pbVar17 < '\0') &&

+        (pbVar20 = param_2 + 9, (undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

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

+      bVar2 = *pbVar20;

+      uVar10 = RdpX_GetActivityIdPrefix();

+      in_stack_ffffffffffffffa8 = (char *)CONCAT44(uVar9,(uint)bVar2);

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

+                &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar10,in_stack_ffffffffffffffa8);

+    }

+    if (((param_2 <= pbVar20 + 9) && (3 < param_3)) &&

+       ((pbVar17 = pbVar20 + 0xd, param_2 <= pbVar17 && (pbVar17 <= pbVar18)))) {

+      if (*(int *)(pbVar20 + 9) != 0x6e44634d) {

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

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

+          uVar9 = RdpX_GetActivityIdPrefix();

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

+                   &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+        }

+        uVar15 = 0x3404;

+        goto LAB_0;

+      }

+      if (pbVar18 <= pbVar17) {

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

+            ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (WPP_GLOBAL_Control[0x19] != '\0')) {

+          uVar16 = 0x12;

+          goto LAB_1;

+        }

+        goto LAB_2;

+      }

+      bVar2 = *pbVar17;

+      uVar19 = (ushort)bVar2;

+      pbVar17 = pbVar20 + 0xe;

+      if ((char)bVar2 < '\0') {

+        if ((pbVar17 < param_2) || (pbVar18 <= pbVar17)) {

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

+             (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (WPP_GLOBAL_Control[0x19] != '\0')))) {

+            uVar16 = 0x13;

+            goto LAB_1;

+          }

+          goto LAB_2;

+        }

+        uVar19 = (bVar2 & 0x3f) << 8 | (ushort)*pbVar17;

+        pbVar17 = pbVar20 + 0xf;

+      }

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

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

+        uVar9 = RdpX_GetActivityIdPrefix();

+        in_stack_ffffffffffffffa8 =

+             (char *)CONCAT62((int6)((ulonglong)in_stack_ffffffffffffffa8 >> 0x10),uVar19);

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

+                  &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,in_stack_ffffffffffffffa8);

+      }

+      *(uint *)(this + 0x34) = (uint)uVar19;

+      if (*(HLOCAL *)(this + 0x98) != (HLOCAL)0x0) {

+        LocalFree(*(HLOCAL *)(this + 0x98));

+      }

+      if ((pbVar17 < param_2) || (param_3 <= uVar19 && uVar19 != param_3)) {

+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),0x15,

+                  &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids);

+        }

+      }

+      else {

+        _Size = (ulonglong)uVar19;

+        if ((pbVar17 + _Size < param_2) || (local_48[0] < pbVar17 + _Size)) goto LAB_3;

+        pvVar13 = (void *)PAL_System_MemAlloc(_Size,1);

+        *(void **)(this + 0x98) = pvVar13;

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

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

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

+            uVar9 = RdpX_GetActivityIdPrefix();

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

+                      &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,(uint)uVar19);

+          }

+          return -0x7ff8fff2;

+        }

+        memcpy(pvVar13,pbVar17,_Size);

+        ptVar14 = CTSRdpConnectionStack::ParseUserData

+                            (*(tagRNS_UD_HEADER **)(this + 0x98),*(uint *)(this + 0x34),0xc01);

+        uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);

+        if (ptVar14 != (tagRNS_UD_HEADER *)0x0) {

+          if (7 < *(ushort *)(ptVar14 + 2)) {

+            *(undefined4 *)(this + 0x90) = *(undefined4 *)(ptVar14 + 4);

+          }

+          uVar5 = *(uint *)(this + 0x90);

+          if ((uVar5 & 0xffff0000) != 0x80000) {

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

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

+              uVar9 = *(undefined4 *)(ptVar14 + 4);

+              uVar10 = RdpX_GetActivityIdPrefix();

+              WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x18,

+                         &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar10,0x80011,uVar9);

+            }

+            uVar15 = 0x3a04;

+            goto LAB_0;

+          }

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

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

+            uVar10 = RdpX_GetActivityIdPrefix();

+            in_stack_ffffffffffffffa8 = (char *)CONCAT44(uVar9,uVar5);

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

+                      &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar10,

+                      in_stack_ffffffffffffffa8);

+          }

+          if ((((*(ushort *)(this + 0x90) < 0xb) &&

+               (iVar11 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                   (*(longlong **)(this + 0xd0),"UseURCPSupported",0), iVar11 < 0))

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

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

+            uVar9 = RdpX_GetActivityIdPrefix();

+            in_stack_ffffffffffffffa8 = "SetProperty(TS_PROP_CORE_USE_URCP) failed!";

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

+                       &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                       "SetProperty(TS_PROP_CORE_USE_URCP) failed!",iVar11);

+          }

+          local_48[0] = (byte *)((ulonglong)local_48[0] & 0xffffffff00000000);

+          plVar6 = *(longlong **)(this + 200);

+          if (*(ushort *)(ptVar14 + 2) < 0xc) {

+            local_res10 = (**(code **)(*plVar6 + 0x70))(plVar6,"NegRspPktReceived",local_48);

+            uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);

+            if (-1 < local_res10) {

+              if ((int)local_48[0] == 0) goto LAB_4;

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

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

+                uVar9 = RdpX_GetActivityIdPrefix();

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

+                         &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+              }

+LAB_5:

+              uVar15 = 0x609;

+              goto LAB_6;

+            }

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

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

+            goto LAB_7;

+            uVar10 = RdpX_GetActivityIdPrefix();

+            uVar16 = 0x1e;

+          }

+          else {

+            iVar11 = *(int *)(ptVar14 + 8);

+            local_res10 = (**(code **)(*plVar6 + 0x58))(plVar6,"ClientRequestedProtocols");

+            uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);

+            if (-1 < local_res10) {

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

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

+                uVar10 = (int)local_48[0];

+                uVar12 = RdpX_GetActivityIdPrefix();

+                in_stack_ffffffffffffffa8 = (char *)CONCAT44(uVar9,uVar10);

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

+                          &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar12,

+                          in_stack_ffffffffffffffa8);

+              }

+              pbVar17 = local_48[0];

+              if ((int)local_48[0] != iVar11) {

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

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

+                {

+                  uVar9 = RdpX_GetActivityIdPrefix();

+                  WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1d,

+                             &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                             (ulonglong)pbVar17 & 0xffffffff,iVar11);

+                }

+                goto LAB_5;

+              }

+LAB_4:

+              if (0xf < *(ushort *)(ptVar14 + 2)) {

+                uVar5 = *(uint *)(ptVar14 + 0xc);

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

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

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

+                     ) {

+                    uVar9 = RdpX_GetActivityIdPrefix();

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

+                             &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+                  }

+                  local_res10 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                          (*(longlong **)(this + 0xd0),"ServerSupportsEdgeActions",1

+                                          );

+                  if ((((local_res10 < 0) &&

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

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

+                     ) {

+                    uVar9 = RdpX_GetActivityIdPrefix();

+                    in_stack_ffffffffffffffa8 =

+                         "SetProperty(TS_PROP_CORE_EDGE_ACTIONS_V1_SUPPORTED) failed!";

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

+                               &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                               "SetProperty(TS_PROP_CORE_EDGE_ACTIONS_V1_SUPPORTED) failed!",

+                               local_res10);

+                  }

+                }

+                if ((uVar5 & 4) != 0) {

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

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

+                     ) {

+                    uVar9 = RdpX_GetActivityIdPrefix();

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

+                             &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+                  }

+                  local_res10 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                          (*(longlong **)(this + 0xd0),"ServerSupportsEdgeActions2",

+                                           1);

+                  if (((local_res10 < 0) &&

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

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

+                     ) {

+                    uVar9 = RdpX_GetActivityIdPrefix();

+                    in_stack_ffffffffffffffa8 =

+                         "SetProperty(TS_PROP_CORE_EDGE_ACTIONS_V2_SUPPORTED) failed!";

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

+                               &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                               "SetProperty(TS_PROP_CORE_EDGE_ACTIONS_V2_SUPPORTED) failed!",

+                               local_res10);

+                  }

+                }

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

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

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

+                     ) {

+                    uVar9 = RdpX_GetActivityIdPrefix();

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

+                             &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+                  }

+                  local_res10 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                          (*(longlong **)(this + 0xd0),"DynamicTimeZoneSupported",1)

+                  ;

+                  if (((local_res10 < 0) &&

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

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

+                     ) {

+                    uVar9 = RdpX_GetActivityIdPrefix();

+                    in_stack_ffffffffffffffa8 =

+                         "SetProperty(TS_PROP_CORE_DYNAMIC_TIME_ZONE_SUPPORTED) failed!";

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

+                               &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                               "SetProperty(TS_PROP_CORE_DYNAMIC_TIME_ZONE_SUPPORTED) failed!",

+                               local_res10);

+                  }

+                }

+                if ((uVar5 & 8) != 0) {

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

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

+                     ) {

+                    uVar9 = RdpX_GetActivityIdPrefix();

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

+                             &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+                  }

+                  *(undefined4 *)(this + 700) = 1;

+                }

+              }

+              ptVar14 = CTSRdpConnectionStack::ParseUserData

+                                  (*(tagRNS_UD_HEADER **)(this + 0x98),*(uint *)(this + 0x34),0xc03)

+              ;

+              if (ptVar14 == (tagRNS_UD_HEADER *)0x0) {

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

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

+                {

+                  uVar9 = RdpX_GetActivityIdPrefix();

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

+                           &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+                }

+                uVar15 = 0x3504;

+                goto LAB_6;

+              }

+              cVar8 = Feature_MSRC113297_IsEnabled();

+              if ((cVar8 != '\0') && (*(ushort *)(ptVar14 + 2) < 8)) {

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

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

+                goto LAB_8;

+                RdpX_GetActivityIdPrefix();

+                uVar9 = 0x28;

+LAB_9:

+                WPP_SF_DHD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar9);

+                goto LAB_8;

+              }

+              *(tagRNS_UD_HEADER **)(this + 0x80) = ptVar14;

+              sVar3 = *(short *)(ptVar14 + 4);

+              if (sVar3 == -1) {

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

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

+                {

+                  uVar9 = RdpX_GetActivityIdPrefix();

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

+                           &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+                }

+                uVar15 = 0x3804;

+                goto LAB_6;

+              }

+              *(short *)(this + 0x30) = sVar3;

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

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

+                uVar9 = RdpX_GetActivityIdPrefix();

+                in_stack_ffffffffffffffa8 =

+                     (char *)CONCAT62((int6)((ulonglong)in_stack_ffffffffffffffa8 >> 0x10),sVar3);

+                WPP_SF_DH(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x2a,

+                          &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                          in_stack_ffffffffffffffa8);

+              }

+              uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);

+              pvVar7 = *(void **)(this + 0x80);

+              uVar19 = *(ushort *)((longlong)pvVar7 + 6);

+              pvVar13 = (void *)((longlong)pvVar7 + 8);

+              if (pvVar13 < pvVar7) {

+LAB_10:

+                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),0x2b,

+                          &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids);

+                }

+              }

+              else {

+                if ((((ulonglong)*(ushort *)((longlong)pvVar7 + 2) < (ulonglong)uVar19 * 2) ||

+                    (pvVar1 = (void *)((ulonglong)uVar19 * 2 + (longlong)pvVar13), pvVar1 < pvVar7))

+                   || ((void *)((longlong)pvVar7 + (ulonglong)*(ushort *)((longlong)pvVar7 + 2)) <

+                       pvVar1)) goto LAB_10;

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

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

+                {

+                  uVar10 = RdpX_GetActivityIdPrefix();

+                  in_stack_ffffffffffffffa8 = (char *)CONCAT44(uVar9,(uint)uVar19);

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

+                            &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar10,

+                            in_stack_ffffffffffffffa8);

+                }

+                if (*(ushort *)(this + 0x90) < 3) {

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

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

+                     ) {

+                    uVar4 = *(undefined2 *)(this + 0x90);

+                    uVar9 = RdpX_GetActivityIdPrefix();

+                    in_stack_ffffffffffffffa8 =

+                         (char *)CONCAT62((int6)((ulonglong)in_stack_ffffffffffffffa8 >> 0x10),uVar4

+                                         );

+                    WPP_SF_DH(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x2e,

+                              &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                              in_stack_ffffffffffffffa8);

+                  }

+LAB_11:

+                  *(undefined4 *)(this + 0x3c) = 0;

+                }

+                else {

+                  *(uint *)(this + 0x3c) = (uint)*(ushort *)(*(longlong *)(this + 0x80) + 6);

+                  if (0x1c < (ushort)(uVar19 - 1)) {

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

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

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

+                      uVar9 = RdpX_GetActivityIdPrefix();

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

+                               &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+                    }

+                    goto LAB_11;

+                  }

+                  memcpy(this + 0x44,pvVar13,

+                         (ulonglong)*(ushort *)(*(longlong *)(this + 0x80) + 6) * 2);

+                }

+                ptVar14 = CTSRdpConnectionStack::ParseUserData

+                                    (*(tagRNS_UD_HEADER **)(this + 0x98),*(uint *)(this + 0x34),

+                                     0xc04);

+                if (ptVar14 == (tagRNS_UD_HEADER *)0x0) {

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

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

+                     ) {

+                    uVar9 = RdpX_GetActivityIdPrefix();

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

+                             &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+                  }

+                  local_res10 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                          (*(longlong **)(this + 0xd0),"McsMsgChannelID",0);

+                  if (((local_res10 < 0) &&

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

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

+                     ) {

+                    uVar9 = RdpX_GetActivityIdPrefix();

+                    in_stack_ffffffffffffffa8 =

+                         "Set Property for TS_PROP_CORE_MCS_MSGCHANNEL_ID failed";

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

+                               &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                               "Set Property for TS_PROP_CORE_MCS_MSGCHANNEL_ID failed",local_res10)

+                    ;

+                  }

+                }

+                else {

+                  cVar8 = Feature_MSRC113297_IsEnabled();

+                  if ((cVar8 != '\0') && (*(ushort *)(ptVar14 + 2) < 6)) {

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

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

+                        ))) {

+                      RdpX_GetActivityIdPrefix();

+                      uVar9 = 0x2f;

+                      goto LAB_9;

+                    }

+                    goto LAB_8;

+                  }

+                  *(tagRNS_UD_HEADER **)(this + 0x88) = ptVar14;

+                  uVar4 = *(undefined2 *)(ptVar14 + 4);

+                  *(undefined2 *)(this + 0x32) = uVar4;

+                  local_res10 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                          (*(longlong **)(this + 0xd0),"McsMsgChannelID",uVar4);

+                  if (local_res10 < 0) {

+                    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) goto LAB_12;

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

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

+                      uVar9 = RdpX_GetActivityIdPrefix();

+                      in_stack_ffffffffffffffa8 =

+                           "Set Property for TS_PROP_CORE_MCS_MSGCHANNEL_ID failed";

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

+                                 &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                                 "Set Property for TS_PROP_CORE_MCS_MSGCHANNEL_ID failed",

+                                 local_res10);

+                    }

+                  }

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

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

+                     ) {

+                    uVar4 = *(undefined2 *)(this + 0x32);

+                    uVar9 = RdpX_GetActivityIdPrefix();

+                    in_stack_ffffffffffffffa8 =

+                         (char *)CONCAT62((int6)((ulonglong)in_stack_ffffffffffffffa8 >> 0x10),uVar4

+                                         );

+                    WPP_SF_DH(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x31,

+                              &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                              in_stack_ffffffffffffffa8);

+                  }

+                }

+LAB_12:

+                ptVar14 = CTSRdpConnectionStack::ParseUserData

+                                    (*(tagRNS_UD_HEADER **)(this + 0x98),*(uint *)(this + 0x34),

+                                     0xc08);

+                uVar9 = 0;

+                if (ptVar14 != (tagRNS_UD_HEADER *)0x0) {

+                  cVar8 = Feature_MSRC113297_IsEnabled();

+                  if ((cVar8 != '\0') && (*(ushort *)(ptVar14 + 2) < 8)) {

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

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

+                        ))) {

+                      RdpX_GetActivityIdPrefix();

+                      uVar9 = 0x34;

+                      goto LAB_9;

+                    }

+                    goto LAB_8;

+                  }

+                  uVar9 = *(undefined4 *)(ptVar14 + 4);

+                }

+                local_res10 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                        (*(longlong **)(this + 0xd0),"MultiTransportServerFlag",

+                                         uVar9);

+                if (local_res10 < 0) {

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

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

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

+                      uVar10 = RdpX_GetActivityIdPrefix();

+                      in_stack_ffffffffffffffa8 =

+                           "Set Property for TS_PROP_CORE_MULTITRANSPORTS_FLAG_SERVER failed";

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

+                                 &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar10,

+                                 "Set Property for TS_PROP_CORE_MULTITRANSPORTS_FLAG_SERVER failed",

+                                 local_res10);

+                    }

+                    goto LAB_13;

+                  }

+                }

+                else {

+LAB_13:

+                  uVar10 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);

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

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

+                     ) {

+                    uVar12 = RdpX_GetActivityIdPrefix();

+                    in_stack_ffffffffffffffa8 = (char *)CONCAT44(uVar10,uVar9);

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

+                              &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar12,

+                              in_stack_ffffffffffffffa8);

+                  }

+                }

+                ptVar14 = CTSRdpConnectionStack::ParseUserData

+                                    (*(tagRNS_UD_HEADER **)(this + 0x98),*(uint *)(this + 0x34),

+                                     0xc09);

+                uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);

+                if (ptVar14 == (tagRNS_UD_HEADER *)0x0) {

+                  iVar11 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                     (*(longlong **)(this + 0xd0),"ConctrlEarlyStart",0);

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

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

+                     ) {

+                    uVar10 = RdpX_GetActivityIdPrefix();

+                    uVar9 = (undefined4)

+                            ((ulonglong)"SetProperty(TS_PROP_CORE_CONCTRL_EARLY_START) failed!" >>

+                            0x20);

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

+                               &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar10,

+                               "SetProperty(TS_PROP_CORE_CONCTRL_EARLY_START) failed!",iVar11);

+                  }

+                  local_res10 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                          (*(longlong **)(this + 0xd0),"McsConctrlChannelID",

+                                           0xffffffff);

+                  if (((local_res10 < 0) &&

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

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

+                     ) {

+                    uVar10 = RdpX_GetActivityIdPrefix();

+                    uVar9 = (undefined4)

+                            ((ulonglong)

+                             "Set Property for TS_PROP_CORE_MCS_CONCTRL_CHANNEL_ID failed" >> 0x20);

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

+                               &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar10,

+                               "Set Property for TS_PROP_CORE_MCS_CONCTRL_CHANNEL_ID failed",

+                               local_res10);

+                  }

+LAB_14:

+                  ptVar14 = CTSRdpConnectionStack::ParseUserData

+                                      (*(tagRNS_UD_HEADER **)(this + 0x98),*(uint *)(this + 0x34),

+                                       0xc0a);

+                  if (ptVar14 == (tagRNS_UD_HEADER *)0x0) {

+                    iVar11 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                       (*(longlong **)(this + 0xd0),"LicensingMode",0);

+                    if (((-1 < iVar11) || ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control))

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

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

+                    uVar9 = RdpX_GetActivityIdPrefix();

+                    uVar16 = 0x43;

+LAB_16:

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

+                               &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                               "SetProperty(TS_PROP_CORE_LICENSING_MODE) failed!",iVar11);

+LAB_15:

+                    CMCS::MCS_AttachUser(*(CMCS **)(this + 0xa0));

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

+                    return 0;

+                  }

+                  cVar8 = Feature_MSRC113297_IsEnabled();

+                  if ((cVar8 == '\0') || (7 < *(ushort *)(ptVar14 + 2))) {

+                    uVar19 = *(ushort *)(ptVar14 + 4);

+                    if (uVar19 == 1) {

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

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

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

+                        uVar19 = *(ushort *)(ptVar14 + 6);

+                        uVar10 = RdpX_GetActivityIdPrefix();

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

+                                  &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar10,

+                                  CONCAT44(uVar9,(uint)uVar19));

+                      }

+                      iVar11 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                         (*(longlong **)(this + 0xd0),"LicensingMode",

+                                          *(undefined2 *)(ptVar14 + 6));

+                      if (((-1 < iVar11) ||

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

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

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

+                      uVar9 = RdpX_GetActivityIdPrefix();

+                      uVar16 = 0x42;

+                      goto LAB_16;

+                    }

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

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

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

+                      uVar10 = RdpX_GetActivityIdPrefix();

+                      uVar16 = 0x40;

+                      goto LAB_17;

+                    }

+                  }

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

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

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

+                    RdpX_GetActivityIdPrefix();

+                    uVar9 = 0x3f;

+                    goto LAB_9;

+                  }

+                }

+                else {

+                  cVar8 = Feature_MSRC113297_IsEnabled();

+                  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);

+                  if ((cVar8 == '\0') || (7 < *(ushort *)(ptVar14 + 2))) {

+                    uVar19 = *(ushort *)(ptVar14 + 4);

+                    if (uVar19 == 1) {

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

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

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

+                        uVar9 = RdpX_GetActivityIdPrefix();

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

+                                 &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+                      }

+                      iVar11 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                         (*(longlong **)(this + 0xd0),"ConctrlEarlyStart",1);

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

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

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

+                        uVar9 = RdpX_GetActivityIdPrefix();

+                        in_stack_ffffffffffffffa8 =

+                             "SetProperty(TS_PROP_CORE_CONCTRL_EARLY_START) failed!";

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

+                                   &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                                   "SetProperty(TS_PROP_CORE_CONCTRL_EARLY_START) failed!",iVar11);

+                      }

+                      local_res10 = (**(code **)(**(longlong **)(this + 0xd0) + 0x18))

+                                              (*(longlong **)(this + 0xd0),"McsConctrlChannelID",

+                                               *(undefined2 *)(ptVar14 + 6));

+                      uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);

+                      if (local_res10 < 0) {

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

+                        goto LAB_14;

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

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

+                          uVar9 = RdpX_GetActivityIdPrefix();

+                          in_stack_ffffffffffffffa8 =

+                               "Set Property for TS_PROP_CORE_MCS_CONCTRL_CHANNEL_ID failed";

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

+                                     &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,

+                                     "Set Property for TS_PROP_CORE_MCS_CONCTRL_CHANNEL_ID failed",

+                                     local_res10);

+                        }

+                      }

+                      uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);

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

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

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

+                        uVar4 = *(undefined2 *)(ptVar14 + 6);

+                        uVar9 = RdpX_GetActivityIdPrefix();

+                        uVar16 = CONCAT62((int6)((ulonglong)in_stack_ffffffffffffffa8 >> 0x10),uVar4

+                                         );

+                        WPP_SF_DH(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x3c,

+                                  &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9,uVar16);

+                        uVar9 = (undefined4)((ulonglong)uVar16 >> 0x20);

+                      }

+                      goto LAB_14;

+                    }

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

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

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

+                    uVar10 = RdpX_GetActivityIdPrefix();

+                    uVar16 = 0x38;

+LAB_17:

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

+                              &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar10,

+                              CONCAT44(uVar9,(uint)uVar19));

+                  }

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

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

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

+                    RdpX_GetActivityIdPrefix();

+                    uVar9 = 0x37;

+                    goto LAB_9;

+                  }

+                }

+              }

+LAB_8:

+              uVar15 = 0x2904;

+LAB_6:

+              *(ulong *)(this + 0x38) = uVar15;

+              CMCS::Disconnect(*(CMCS **)(this + 0xa0),uVar15);

+              return local_res10;

+            }

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

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

+            goto LAB_7;

+            uVar10 = RdpX_GetActivityIdPrefix();

+            uVar16 = 0x1b;

+          }

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

+                    &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar10,

+                    CONCAT44(uVar9,local_res10));

+LAB_7:

+          *(undefined4 *)(this + 0x38) = 0x609;

+          CMCS::Disconnect(*(CMCS **)(this + 0xa0),0x609);

+          return local_res10;

+        }

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

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

+          uVar9 = RdpX_GetActivityIdPrefix();

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

+                   &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar9);

+        }

+      }

+      uVar15 = 0x3904;

+      goto LAB_0;

+    }

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

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (WPP_GLOBAL_Control[0x19] != '\0')) {

+      uVar16 = 0x10;

+      goto LAB_1;

+    }

+  }

+LAB_2:

+  uVar15 = 0x2904;

+LAB_0:

+  *(ulong *)(this + 0x38) = uVar15;

+  CMCS::Disconnect(*(CMCS **)(this + 0xa0),uVar15);

+  return -0x7fffbffb;

+}

+
```

## `CRdrServerRequestHandler::OnCustomEvent`  (modified)

```diff
--- CRdrServerRequestHandler::OnCustomEvent
+++ CRdrServerRequestHandler::OnCustomEvent
@@ -1,2 +1,95 @@
-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 *_Dst;

+  longlong lVar6;

+  longlong *plVar7;

+  longlong *local_38;

+  CTSCriticalSection *local_30;

+  

+  plVar7 = (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_852928d963083be7bf554339e5c32f33_Traceguids,uVar4);

+  }

+  uVar4 = param_2 + 0x19;

+  if ((uVar4 < 0x19) || (uVar4 < param_2)) {

+    lVar5 = -0x7ff8ffa9;

+    goto LAB_0;

+  }

+  _Dst = operator_new((ulonglong)uVar4);

+  if (_Dst == (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_852928d963083be7bf554339e5c32f33_Traceguids,uVar4);

+    }

+    lVar5 = -0x7ff8fff2;

+    goto LAB_0;

+  }

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

+                    ((FeatureImpl<__WilFeatureTraits_Feature_2884880696> *)

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

+                      ::__l2::impl);

+  if (bVar3) {

+    memset(_Dst,0,(ulonglong)uVar4);

+  }

+  uVar1 = *(undefined8 *)param_1;

+  uVar2 = *(undefined8 *)param_1->Data4;

+  *(undefined1 *)((longlong)_Dst + 3) = 1;

+  *(ulong *)((longlong)_Dst + 0x14) = param_2;

+  *(undefined8 *)((longlong)_Dst + 4) = uVar1;

+  *(undefined8 *)((longlong)_Dst + 0xc) = uVar2;

+  memcpy((void *)((longlong)_Dst + 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);

+      plVar7 = *(longlong **)(this + 0x40);

+      local_38 = plVar7;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

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

+    }

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

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

+      lVar6 = *plVar7;

+      goto LAB_1;

+    }

+LAB_2:

+    lVar5 = -0x7fffbffb;

+  }

+  else {

+    plVar7 = *(longlong **)(this + 0x40);

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

+    lVar6 = *plVar7;

+LAB_1:

+    lVar5 = (**(code **)(lVar6 + 0x18))(plVar7,uVar4,_Dst,0);

+  }

+  operator_delete(_Dst);

+LAB_0:

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

+  return lVar5;

+}

+
```

## `CRdpAudioController::DataArrived`  (modified)

```diff
--- CRdpAudioController::DataArrived
+++ CRdpAudioController::DataArrived
@@ -1,2 +1,348 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdpAudioController::DataArrived : 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 CRdpAudioController::DataArrived(void * __ptr64,void *

+   __ptr64,enum _XBool32) __ptr64 */

+

+_XResult32 __thiscall

+CRdpAudioController::DataArrived

+          (CRdpAudioController *this,void *param_1,void *param_2,_XBool32 param_3)

+

+{

+  CTSCriticalSection *this_00;

+  byte bVar1;

+  CRdpAudioController CVar2;

+  ushort uVar3;

+  CTSCriticalSection *pCVar4;

+  ulong uVar5;

+  char cVar6;

+  bool bVar7;

+  undefined2 uVar8;

+  undefined4 uVar9;

+  undefined4 uVar10;

+  int iVar11;

+  undefined4 uVar12;

+  long lVar13;

+  long lVar14;

+  undefined4 uVar15;

+  _XResult32 _Var16;

+  longlong *plVar17;

+  uint uVar18;

+  undefined8 uVar19;

+  uint uVar20;

+  longlong lVar21;

+  uint uVar22;

+  undefined1 *_Dst;

+  CTSCriticalSection *local_res10 [2];

+  _XBool32 local_res20;

+  undefined8 in_stack_ffffffffffffff88;

+  CRdpAudioController *pCVar23;

+  ulong *puVar24;

+  undefined8 in_stack_ffffffffffffff90;

+  ulong local_68;

+  ulong local_64;

+  SNDFORMATITEM *local_60;

+  undefined8 local_58;

+  longlong *local_50;

+  CTSCriticalSection *local_48 [2];

+  

+  uVar10 = (undefined4)((ulonglong)in_stack_ffffffffffffff90 >> 0x20);

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

+  lVar13 = 0;

+  local_60 = (SNDFORMATITEM *)0x0;

+  _Dst = (undefined1 *)0x0;

+  local_64 = 0;

+  local_68 = 0;

+  local_58 = 0;

+  local_res10[0] = param_1;

+  local_res20 = param_3;

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

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

+    uVar9 = RdpX_GetActivityIdPrefix();

+    uVar19 = CONCAT44(uVar10,param_3);

+    pCVar23 = this + -0x30;

+    WPP_SF_DqD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x18,

+               &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar9,pCVar23,uVar19);

+    uVar10 = (undefined4)((ulonglong)uVar19 >> 0x20);

+    uVar9 = (undefined4)((ulonglong)pCVar23 >> 0x20);

+  }

+  local_50 = (longlong *)0x0;

+  cVar6 = MSRC108255UseKIR();

+  plVar17 = (longlong *)0x0;

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

+    local_48[0] = (CTSCriticalSection *)(this + 0x10118);

+    CTSCriticalSection::Lock(local_48[0]);

+    RdpXSPtr<RdpXInterfaceTapProtocolServerEvents>::operator=

+              ((RdpXSPtr<RdpXInterfaceTapProtocolServerEvents> *)&local_50,

+               (RdpXSPtr<struct_RdpXInterfaceTapProtocolServerEvents> *)(this + 0x10098));

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)local_48);

+    plVar17 = local_50;

+  }

+  bVar1 = *(byte *)param_1;

+  lVar14 = lVar13;

+  if (bVar1 == 1) {

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

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

+      CVar2 = this[0x1010c];

+      uVar15 = RdpX_GetActivityIdPrefix();

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

+                &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar15,

+                CONCAT44(uVar9,(uint)(byte)CVar2));

+    }

+    lVar13 = StartCloseTimer(this + -0x30);

+    if (((lVar13 < 0) && ((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),0x1a,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar9,"StartCloseTimer() failed.",

+                 CONCAT44(uVar10,lVar13));

+    }

+    goto LAB_0;

+  }

+  if (bVar1 == 2) {

+LAB_1:

+    lVar13 = StopCloseTimer(this + -0x30);

+    if ((((lVar13 < 0) && ((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),0x1d,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar9,"StopCloseTimer() failed.",

+                 CONCAT44(uVar10,lVar13));

+    }

+    lVar14 = OnWaveData(this + -0x30,param_1,param_2,local_res20);

+    goto LAB_0;

+  }

+  if (bVar1 == 3) {

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

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

+      uVar9 = RdpX_GetActivityIdPrefix();

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

+               &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar9);

+    }

+    if (3 < *(ushort *)((longlong)param_1 + 2)) {

+      cVar6 = MSRC108255UseKIR();

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

+        plVar17 = *(longlong **)(this + 0x10098);

+        if (plVar17 == (longlong *)0x0) goto LAB_0;

+        lVar21 = *plVar17;

+      }

+      else {

+        if (plVar17 == (longlong *)0x0) goto LAB_0;

+        lVar21 = *plVar17;

+      }

+      (**(code **)(lVar21 + 0x40))(plVar17,*(undefined4 *)param_2);

+      goto LAB_0;

+    }

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

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

+    goto LAB_0;

+    uVar9 = RdpX_GetActivityIdPrefix();

+    uVar19 = 0x1c;

+  }

+  else if (bVar1 == 6) {

+    if (3 < *(ushort *)((longlong)param_1 + 2)) {

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

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

+        uVar10 = RdpX_GetActivityIdPrefix();

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

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar10);

+      }

+      local_58._0_4_ = CONCAT22(4,(undefined2)local_58);

+      uVar18 = (uint)(undefined4)local_58 >> 8;

+      local_58 = CONCAT71((uint7)(uint3)uVar18,6);

+      local_58 = CONCAT26(*(undefined2 *)((longlong)param_2 + 2),

+                          CONCAT24(*(undefined2 *)param_2,(undefined4)local_58));

+      iVar11 = (**(code **)(**(longlong **)(this + 0x10080) + 0x18))

+                         (*(longlong **)(this + 0x10080),8,&local_58);

+      lVar14 = 0;

+      if (iVar11 != 0) {

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

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

+          uVar10 = RdpX_GetActivityIdPrefix();

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

+                    &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar10,CONCAT44(uVar9,iVar11));

+        }

+        lVar14 = 0;

+      }

+      goto LAB_0;

+    }

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

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

+    goto LAB_0;

+    uVar9 = RdpX_GetActivityIdPrefix();

+    uVar19 = 0x1e;

+  }

+  else {

+    if (bVar1 != 7) {

+      if (bVar1 != 0xd) {

+        lVar14 = 0;

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

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

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

+          uVar10 = RdpX_GetActivityIdPrefix();

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

+                    &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar10,

+                    CONCAT44(uVar9,(uint)bVar1));

+        }

+        goto LAB_0;

+      }

+      goto LAB_1;

+    }

+    if (0x13 < *(ushort *)((longlong)param_1 + 2)) {

+      if ((*(longlong **)(this + 0x30) != (longlong *)0x0) &&

+         (iVar11 = (**(code **)(**(longlong **)(this + 0x30) + 0x18))(), iVar11 != 0)) {

+        (**(code **)(**(longlong **)(this + 0x30) + 0x180))

+                  (*(longlong **)(this + 0x30),(longlong)param_2 + -4);

+      }

+      *(uint *)(this + 0x1013c) = (uint)*(ushort *)((longlong)param_2 + 0x11);

+      (**(code **)(**(longlong **)(this + 0x10090) + 0x58))();

+      cVar6 = MSRC108255UseKIR();

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

+        plVar17 = *(longlong **)(this + 0x10098);

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

+          lVar21 = *plVar17;

+          goto LAB_2;

+        }

+      }

+      else if (plVar17 != (longlong *)0x0) {

+        lVar21 = *plVar17;

+LAB_2:

+        (**(code **)(lVar21 + 0x60))(plVar17,*(undefined4 *)(this + 0x1013c));

+      }

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

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

+        uVar15 = *(undefined4 *)(this + 0x1013c);

+        uVar3 = *(ushort *)((longlong)param_2 + 0xe);

+        uVar12 = RdpX_GetActivityIdPrefix();

+        WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x22,

+                   &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar12,

+                   CONCAT44(uVar9,(uint)uVar3),CONCAT44(uVar10,uVar15));

+        param_1 = local_res10[0];

+      }

+      lVar21 = (longlong)param_2 + 0x14;

+      uVar18 = *(ushort *)((longlong)param_1 + 2) - 0x14;

+      uVar22 = 0;

+      if (*(ushort *)((longlong)param_2 + 0xe) != 0) {

+        do {

+          if (uVar18 < 0x12) {

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

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

+              uVar9 = RdpX_GetActivityIdPrefix();

+              uVar19 = 0x23;

+LAB_3:

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

+                       &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar9);

+            }

+            goto LAB_4;

+          }

+          uVar20 = *(ushort *)(lVar21 + 0x10) + 0x12;

+          if (uVar18 < uVar20) {

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

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

+              uVar9 = RdpX_GetActivityIdPrefix();

+              uVar19 = 0x24;

+              goto LAB_3;

+            }

+            goto LAB_4;

+          }

+          uVar18 = uVar18 - uVar20;

+          lVar21 = lVar21 + (ulonglong)uVar20;

+          uVar22 = uVar22 + 1;

+        } while (uVar22 < *(ushort *)((longlong)param_2 + 0xe));

+      }

+      this_00 = (CTSCriticalSection *)(this + 0x10118);

+      this[0x1010d] = *(CRdpAudioController *)((longlong)param_2 + 0x10);

+      local_res10[0] = this_00;

+      CTSCriticalSection::Lock(this_00);

+      pCVar23 = this + -0x30;

+      CleanSoundFormats(pCVar23);

+      if (*(longlong **)(this + 0x10090) != (longlong *)0x0) {

+        (**(code **)(**(longlong **)(this + 0x10090) + 0x38))();

+      }

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

+      puVar24 = &local_64;

+      bVar7 = ChooseSoundFormat(pCVar23,(uint)*(ushort *)((longlong)param_2 + 0xe),

+                                (SNDFORMATITEM *)((longlong)param_2 + 0x14),&local_60,puVar24,

+                                &local_68);

+      uVar9 = (undefined4)((ulonglong)puVar24 >> 0x20);

+      if (bVar7) {

+        local_res10[0] = this_00;

+        CTSCriticalSection::Lock(this_00);

+        bVar7 = SaveSoundFormats(pCVar23,local_60,local_68);

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

+        if (!bVar7) {

+          free(local_60);

+          local_60 = (SNDFORMATITEM *)0x0;

+          local_68 = 0;

+          local_64 = 0;

+        }

+      }

+      uVar5 = local_68;

+      local_res10[0] = (CTSCriticalSection *)CONCAT44(local_res10[0]._4_4_,local_64 + 0x18);

+      _Dst = malloc((ulonglong)(local_64 + 0x18));

+      pCVar4 = local_res10[0];

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

+        memset(_Dst,0,(ulonglong)local_res10[0] & 0xffffffff);

+        *_Dst = 7;

+        *(short *)(_Dst + 0x12) = (short)uVar5;

+        *(short *)(_Dst + 2) = (short)pCVar4 + -4;

+        local_res10[0] = this_00;

+        CTSCriticalSection::Lock(this_00);

+        if (this[0x38] == (CRdpAudioController)0x0) {

+          vcwaveGetDevCaps(this + -0x30,(SNDFORMATMSG *)(this + 0x39));

+          this[0x38] = (CRdpAudioController)0x1;

+        }

+        uVar18 = *(uint *)(this + 0x3d);

+        *(undefined2 *)(_Dst + 0x10) = *(undefined2 *)(this + 0x49);

+        *(uint *)(_Dst + 4) = uVar18;

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

+          *(undefined4 *)(_Dst + 8) = *(undefined4 *)(this + 0x41);

+        }

+        if ((uVar18 & 4) != 0) {

+          *(undefined4 *)(_Dst + 0xc) = *(undefined4 *)(this + 0x45);

+        }

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

+        uVar8 = 1;

+        if (*(short *)((longlong)param_2 + 0x11) != 1) {

+          uVar8 = 8;

+        }

+        *(undefined2 *)(_Dst + 0x15) = uVar8;

+        memcpy(_Dst + 0x18,local_60,(ulonglong)local_64);

+        iVar11 = (**(code **)(**(longlong **)(this + 0x10080) + 0x18))

+                           (*(longlong **)(this + 0x10080),(ulonglong)pCVar4 & 0xffffffff,_Dst,0);

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

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

+          uVar10 = RdpX_GetActivityIdPrefix();

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

+                    &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar10,CONCAT44(uVar9,iVar11));

+        }

+        if (5 < *(ushort *)((longlong)param_2 + 0x11)) {

+          sendQualityMode(this + -0x30);

+        }

+      }

+LAB_4:

+      if (local_60 != (SNDFORMATITEM *)0x0) {

+        free(local_60);

+        local_60 = (SNDFORMATITEM *)0x0;

+      }

+      lVar14 = 0;

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

+        free(_Dst);

+      }

+      goto LAB_0;

+    }

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

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

+    goto LAB_0;

+    uVar9 = RdpX_GetActivityIdPrefix();

+    uVar19 = 0x21;

+  }

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

+           &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar9);

+LAB_0:

+  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)&local_50);

+  _Var16 = MapHRToXResult(lVar14);

+  return _Var16;

+}

+
```

## `Microsoft::WRL::Details::MakeAndInitialize<CRedirectPromptWebAuthnPermissionItem,CRedirectPromptWebAuthnPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>`  (modified)

```diff
--- Microsoft::WRL::Details::MakeAndInitialize<CRedirectPromptWebAuthnPermissionItem,CRedirectPromptWebAuthnPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>
+++ Microsoft::WRL::Details::MakeAndInitialize<CRedirectPromptWebAuthnPermissionItem,CRedirectPromptWebAuthnPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64>
@@ -1,2 +1,59 @@
-Failed to decompile mstscax.dll - .ProgramDB Microsoft::WRL::Details::MakeAndInitialize<CRedirectPromptWebAuthnPermissionItem,CRedirectPromptWebAuthnPermissionItem,HINSTANCE__*___ptr64&___ptr64,ITSCoreApi*___ptr64&___ptr64,ITSWin32CoreApi*___ptr64&___ptr64,int&___ptr64,int&___ptr64> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* long __cdecl Microsoft::WRL::Details::MakeAndInitialize<class

+   CRedirectPromptWebAuthnPermissionItem,class CRedirectPromptWebAuthnPermissionItem,struct

+   HINSTANCE__ * __ptr64 & __ptr64,class ITSCoreApi * __ptr64 & __ptr64,class ITSWin32CoreApi *

+   __ptr64 & __ptr64,int & __ptr64,int & __ptr64>(class CRedirectPromptWebAuthnPermissionItem *

+   __ptr64 * __ptr64,struct HINSTANCE__ * __ptr64 & __ptr64,class ITSCoreApi * __ptr64 &

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

+

+long __cdecl

+Microsoft::WRL::Details::

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

+          (CRedirectPromptWebAuthnPermissionItem **param_1,HINSTANCE__ **param_2,

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

+

+{

+  long lVar1;

+  CRedirectPromptBasePermissionItem *this;

+  CRedirectPromptBasePermissionItem *local_res8;

+  

+  *param_1 = (CRedirectPromptWebAuthnPermissionItem *)0x0;

+  this = operator_new(0x60,&std::nothrow);

+  if (this == (CRedirectPromptBasePermissionItem *)0x0) {

+    lVar1 = -0x7ff8fff2;

+    local_res8 = (CRedirectPromptBasePermissionItem *)0x0;

+  }

+  else {

+    local_res8 = this;

+    CRedirectPromptBasePermissionItem::CRedirectPromptBasePermissionItem(this,(ushort *)L"WebAuthn")

+    ;

+    local_res8 = (CRedirectPromptBasePermissionItem *)0x0;

+    *(undefined ***)this =

+         &CRedirectPromptWebAuthnPermissionItem::

+          _vftable__for__IRedirectPromptPermissionItemInternal__;

+    *(undefined ***)(this + 8) =

+         &CRedirectPromptDrivesPermissionItem::

+          _vftable__for__Microsoft__WRL__Details__ImplementsHelper<Microsoft::WRL::RuntimeClassFlags<2>,1,IRedirectPromptPermissionItem>__

+    ;

+    lVar1 = CRedirectPromptWebAuthnPermissionItem::RuntimeClassInitialize

+                      ((CRedirectPromptWebAuthnPermissionItem *)this,*param_2,*param_3,*param_4,

+                       *param_5,g_wasWebAuthnRequested);

+    if (lVar1 < 0) {

+      RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IRedirectPromptPermissionItemInternal,IRedirectPromptPermissionItem>

+      ::Release((RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IRedirectPromptPermissionItemInternal,IRedirectPromptPermissionItem>

+                 *)this);

+    }

+    else {

+      SafeUnknownIncrementReference((long *)(this + 0x14));

+      *param_1 = (CRedirectPromptWebAuthnPermissionItem *)this;

+      RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IRedirectPromptPermissionItemInternal,IRedirectPromptPermissionItem>

+      ::Release((RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IRedirectPromptPermissionItemInternal,IRedirectPromptPermissionItem>

+                 *)this);

+      lVar1 = 0;

+    }

+  }

+  CacNx::Own<CacDecodingNx::Decoding>::~Own<CacDecodingNx::Decoding>

+            ((Own<CacDecodingNx::Decoding> *)&local_res8);

+  return lVar1;

+}

+
```

## `CProxyStream::CProxyStream`  (modified)

```diff
--- CProxyStream::CProxyStream
+++ CProxyStream::CProxyStream
@@ -1,2 +1,57 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyStream::CProxyStream : 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: __cdecl CProxyStream::CProxyStream(class CProxyStreamManager * __ptr64,class

+   CProxyDataObject * __ptr64,unsigned long,long,long,int) __ptr64 */

+

+CProxyStream * __thiscall

+CProxyStream::CProxyStream

+          (CProxyStream *this,CProxyStreamManager *param_1,CProxyDataObject *param_2,ulong param_3,

+          long param_4,long param_5,int param_6)

+

+{

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *this_00;

+  bool bVar1;

+  

+  *(undefined4 *)(this + 0x18) = 0xdbcaabcd;

+  *(char **)(this + 0x10) = "CProxyStream";

+  this_00 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xc0);

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

+  *(undefined ***)this = CTSUnknown::vftable_for_INonDelegatingUnknown_;

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

+  *(undefined ***)(this + 8) = CTSUnknown::vftable_for_CTSObject_;

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

+  *(undefined8 *)this_00 = 0;

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

+  *(undefined ***)(this + 8) = &_vftable__for__CTSObject__;

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

+  *(CProxyStreamManager **)(this + 0x38) = param_1;

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

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

+    *(CProxyDataObject **)this_00 = param_2;

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

+  }

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

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

+  *(undefined4 *)(this + 0x98) = 0;

+  *(undefined4 *)(this + 0xb0) = 0xffffffff;

+  *(undefined4 *)(this + 0x6c) = 0;

+  *(undefined4 *)(this + 0x70) = 0;

+  *(undefined4 *)(this + 0x74) = 0;

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

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

+  *(long *)(this + 0x68) = param_5;

+  *(int *)(this + 0xb8) = param_6;

+  *(long *)(this + 0x9c) = param_4;

+  *(ulong *)(this + 0xb4) = param_3;

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

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

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

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

+                      ::__l2::impl);

+  if (bVar1) {

+    InitializeCriticalSection((LPCRITICAL_SECTION)(this + 0x40));

+  }

+  return this;

+}

+
```

## `CRdpAudioController::OnTerminate`  (modified)

```diff
--- CRdpAudioController::OnTerminate
+++ CRdpAudioController::OnTerminate
@@ -1,2 +1,140 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdpAudioController::OnTerminate : 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 CRdpAudioController::OnTerminate(void) __ptr64 */

+

+_XResult32 __thiscall CRdpAudioController::OnTerminate(CRdpAudioController *this)

+

+{

+  RdpXSPtr<RdpXInterfaceDesktopRemoteAppCore> *this_00;

+  TCntPtr<ITSThread> *pTVar1;

+  longlong *plVar2;

+  char cVar3;

+  undefined4 uVar4;

+  _XResult32 _Var5;

+  RdpXInterfaceDesktopRemoteAppCore *in_RDX;

+  CTSCriticalSection *local_res10;

+  CTSCriticalSection *local_res18 [2];

+  

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

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

+    uVar4 = RdpX_GetActivityIdPrefix();

+    in_RDX = (RdpXInterfaceDesktopRemoteAppCore *)0x12;

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

+              &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar4,this + -0x30);

+  }

+  this_00 = (RdpXSPtr<RdpXInterfaceDesktopRemoteAppCore> *)(this + 0x10098);

+  cVar3 = MSRC108255UseKIR();

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

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

+      (**(code **)(**(longlong **)this_00 + 0x20))();

+    }

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

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

+      (**(code **)(*plVar2 + 0x20))();

+      RdpXSPtr<RdpXInterfaceDesktopRemoteAppCore>::operator=

+                ((RdpXSPtr<RdpXInterfaceDesktopRemoteAppCore> *)(this + 0x10090),in_RDX);

+    }

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

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

+      (**(code **)(*plVar2 + 0x20))();

+      RdpXSPtr<RdpXInterfaceRandomAccessInputStream>::operator=

+                ((RdpXSPtr<RdpXInterfaceRandomAccessInputStream> *)(this + 0x10188),

+                 (RdpXInterfaceRandomAccessInputStream *)in_RDX);

+    }

+    if (*(CRDPAudioVideoSyncHandler **)(this + 0x10180) != (CRDPAudioVideoSyncHandler *)0x0) {

+      CRDPAudioVideoSyncHandler::_scalar_deleting_destructor_

+                (*(CRDPAudioVideoSyncHandler **)(this + 0x10180),(uint)in_RDX);

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

+    }

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

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

+      (**(code **)(*plVar2 + 0x20))();

+      in_RDX = (RdpXInterfaceDesktopRemoteAppCore *)0x0;

+      RdpXSPtr<RdpXInterfaceTapProtocolImage>::operator=

+                ((RdpXSPtr<RdpXInterfaceTapProtocolImage> *)(this + 0x100a0),

+                 (RdpXInterfaceTapProtocolImage *)0x0);

+    }

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

+    CTSCriticalSection::Lock(local_res10);

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

+      RdpXSPtr<RdpXInterfaceRandomAccessInputStream>::operator=

+                ((RdpXSPtr<RdpXInterfaceRandomAccessInputStream> *)(this + 0x100a8),

+                 (RdpXInterfaceRandomAccessInputStream *)in_RDX);

+    }

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

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

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

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

+      *(undefined8 *)pTVar1 = 0;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

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

+    }

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

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

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

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

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

+    }

+    RdpXSPtr<RdpXInterfaceDesktopRemoteAppCore>::operator=(this_00,in_RDX);

+  }

+  else {

+    local_res18[0] = (CTSCriticalSection *)(this + 0x10118);

+    CTSCriticalSection::Lock(local_res18[0]);

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

+      (**(code **)(**(longlong **)this_00 + 0x20))();

+    }

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

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

+      (**(code **)(*plVar2 + 0x20))();

+      RdpXSPtr<RdpXInterfaceDesktopRemoteAppCore>::operator=

+                ((RdpXSPtr<RdpXInterfaceDesktopRemoteAppCore> *)(this + 0x10090),in_RDX);

+    }

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

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

+      (**(code **)(*plVar2 + 0x20))();

+      RdpXSPtr<RdpXInterfaceRandomAccessInputStream>::operator=

+                ((RdpXSPtr<RdpXInterfaceRandomAccessInputStream> *)(this + 0x10188),

+                 (RdpXInterfaceRandomAccessInputStream *)in_RDX);

+    }

+    if (*(CRDPAudioVideoSyncHandler **)(this + 0x10180) != (CRDPAudioVideoSyncHandler *)0x0) {

+      CRDPAudioVideoSyncHandler::_scalar_deleting_destructor_

+                (*(CRDPAudioVideoSyncHandler **)(this + 0x10180),(uint)in_RDX);

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

+    }

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

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

+      (**(code **)(*plVar2 + 0x20))();

+      in_RDX = (RdpXInterfaceDesktopRemoteAppCore *)0x0;

+      RdpXSPtr<RdpXInterfaceTapProtocolImage>::operator=

+                ((RdpXSPtr<RdpXInterfaceTapProtocolImage> *)(this + 0x100a0),

+                 (RdpXInterfaceTapProtocolImage *)0x0);

+    }

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

+    CTSCriticalSection::Lock(local_res10);

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

+      RdpXSPtr<RdpXInterfaceRandomAccessInputStream>::operator=

+                ((RdpXSPtr<RdpXInterfaceRandomAccessInputStream> *)(this + 0x100a8),

+                 (RdpXInterfaceRandomAccessInputStream *)in_RDX);

+    }

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

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

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

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

+      *(undefined8 *)pTVar1 = 0;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

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

+    }

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

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

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

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

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

+    }

+    RdpXSPtr<RdpXInterfaceDesktopRemoteAppCore>::operator=(this_00,in_RDX);

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)local_res18);

+  }

+  _Var5 = MapHRToXResult(0);

+  return _Var5;

+}

+
```

## `ClearDecompressor::DecodeTextBand`  (modified)

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

+/* private: long __cdecl ClearDecompressor::DecodeTextBand(struct HBandHeader const *

+   __ptr64,unsigned char const * __ptr64 & __ptr64,unsigned char const * __ptr64,class PixelMap &

+   __ptr64) __ptr64 */

+

+long __thiscall

+ClearDecompressor::DecodeTextBand

+          (ClearDecompressor *this,HBandHeader *param_1,uchar **param_2,uchar *param_3,

+          PixelMap *param_4)

+

+{

+  int iVar1;

+  ushort *puVar2;

+  ushort uVar3;

+  undefined4 uVar4;

+  ulonglong uVar5;

+  ulonglong uVar6;

+  undefined *puVar7;

+  uint uVar8;

+  ushort *puVar9;

+  int *piVar10;

+  undefined8 uVar11;

+  uint uVar12;

+  byte bVar13;

+  byte bVar14;

+  ushort uVar15;

+  uint uVar16;

+  undefined **ppuVar17;

+  int *piVar18;

+  longlong lVar19;

+  int iVar20;

+  ushort uVar21;

+  

+  uVar15 = *(ushort *)(param_1 + 6);

+  uVar12 = ((uint)uVar15 - (uint)*(ushort *)(param_1 + 4)) + 1;

+  if (((uVar12 < 0x35) && (*(ushort *)(param_1 + 4) <= uVar15)) &&

+     (uVar21 = *(ushort *)param_1, uVar21 <= *(ushort *)(param_1 + 2))) {

+    if (((uint)*(ushort *)(param_1 + 2) < *(uint *)param_4) &&

+       ((uint)uVar15 < *(uint *)(param_4 + 4))) {

+      if (*(int *)(param_4 + 8) < 0) {

+        return -0x7ff8ffa9;

+      }

+      iVar20 = ((byte)param_1[8] - 0x1000000) +

+               (uint)(byte)param_1[10] * 0x10000 + (uint)(byte)param_1[9] * 0x100;

+      ppuVar17 = (undefined **)WPP_GLOBAL_Control;

+      while( true ) {

+        puVar2 = (ushort *)*param_2;

+        puVar9 = puVar2 + 1;

+        if (param_3 < puVar9) {

+          return -0x7ff8ff86;

+        }

+        uVar15 = *puVar2;

+        *param_2 = (uchar *)puVar9;

+        if (-1 < (short)uVar15) break;

+        piVar18 = (int *)((ulonglong)(uVar15 & 0x7fff) * 0xd4 + *(longlong *)(this + 0x40));

+        bVar13 = *(byte *)(piVar18 + 0x34);

+        if (bVar13 == uVar12) {

+LAB_0:

+          piVar10 = (int *)((ulonglong)(*(int *)(param_4 + 0xc) + 1 >> 3 & 0xff) * (ulonglong)uVar21

+                            + (longlong)

+                              (int)((uint)*(ushort *)(param_1 + 4) * *(int *)(param_4 + 8)) +

+                           *(longlong *)(param_4 + 0x18));

+          if (uVar12 != 0) {

+            uVar6 = (ulonglong)uVar12;

+            do {

+              iVar1 = *piVar18;

+              piVar18 = piVar18 + 1;

+              *piVar10 = iVar1;

+              piVar10 = (int *)((longlong)piVar10 + (longlong)*(int *)(param_4 + 8));

+              uVar6 = uVar6 - 1;

+              ppuVar17 = (undefined **)WPP_GLOBAL_Control;

+            } while (uVar6 != 0);

+          }

+        }

+        else if (((ppuVar17 != &WPP_GLOBAL_Control) &&

+                 ((*(uint *)((longlong)ppuVar17 + 0x1c) & 0x100) != 0)) &&

+                (1 < *(byte *)((longlong)ppuVar17 + 0x19))) {

+          uVar4 = RdpX_GetActivityIdPrefix();

+          WPP_SF_DDDDD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),99,

+                       &WPP_1e24bb0281903cc1455d70aea08aca71_Traceguids,uVar4,uVar12,(uint)bVar13,

+                       uVar21,uVar15 & 0x7fff);

+          ppuVar17 = (undefined **)WPP_GLOBAL_Control;

+        }

+LAB_1:

+        uVar21 = uVar21 + 1;

+        if (*(ushort *)(param_1 + 2) < uVar21) {

+          return 0;

+        }

+      }

+      if ((uVar15 & 0x4000) == 0) {

+        bVar13 = (byte)uVar15;

+        bVar14 = (byte)(uVar15 >> 8);

+        if ((bVar13 <= bVar14) && (bVar14 <= uVar12)) {

+          bVar14 = bVar14 - bVar13;

+          lVar19 = (ulonglong)*(uint *)(this + 0x54) * 0xd4 + *(longlong *)(this + 0x48);

+          *(uint *)(this + 0x54) = *(uint *)(this + 0x54) + 1 & 0x3fff;

+          *(byte *)(lVar19 + 0xd0) = bVar14;

+          if (param_3 < (byte *)((ulonglong)((uint)bVar14 + (uint)bVar14 * 2) + (longlong)puVar9)) {

+            return -0x7ff8ff86;

+          }

+          uVar8 = 0;

+          if (bVar14 != 0) {

+            do {

+              bVar14 = *(byte *)((longlong)puVar9 + 1);

+              uVar15 = puVar9[1];

+              uVar3 = *puVar9;

+              puVar9 = (ushort *)((longlong)puVar9 + 3);

+              *param_2 = (uchar *)puVar9;

+              uVar6 = (ulonglong)uVar8;

+              uVar8 = uVar8 + 1;

+              *(uint *)(lVar19 + uVar6 * 4) =

+                   (((byte)uVar15 | 0xffffff00) << 8 | (uint)bVar14) << 8 | (uint)(byte)uVar3;

+            } while (uVar8 < *(byte *)(lVar19 + 0xd0));

+          }

+          goto LAB_2;

+        }

+        if (ppuVar17 == &WPP_GLOBAL_Control) {

+          return -0x7ff8ffa9;

+        }

+        if ((*(byte *)((longlong)ppuVar17 + 0x1c) & 8) == 0) {

+          return -0x7ff8ffa9;

+        }

+        if (*(char *)((longlong)ppuVar17 + 0x19) == '\0') {

+          return -0x7ff8ffa9;

+        }

+        uVar11 = 0x66;

+      }

+      else {

+        uVar15 = uVar15 & 0xbfff;

+        if (uVar15 < 0x4000) {

+          if (param_3 < (uchar *)((longlong)puVar2 + 3U)) {

+            return -0x7ff8ff86;

+          }

+          bVar13 = (byte)*puVar9;

+          *param_2 = (uchar *)((longlong)puVar2 + 3U);

+          lVar19 = (ulonglong)uVar15 * 0xd4 + *(longlong *)(this + 0x48);

+          bVar14 = *(byte *)(lVar19 + 0xd0);

+          if (uVar12 < (uint)bVar13 + (uint)bVar14) {

+            if (((ppuVar17 != &WPP_GLOBAL_Control) &&

+                ((*(uint *)((longlong)ppuVar17 + 0x1c) & 0x100) != 0)) &&

+               (1 < *(byte *)((longlong)ppuVar17 + 0x19))) {

+              uVar4 = RdpX_GetActivityIdPrefix();

+              WPP_SF_Dddddd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x65,

+                            &WPP_1e24bb0281903cc1455d70aea08aca71_Traceguids,uVar4,uVar12,

+                            (uint)bVar14,(uint)bVar13,uVar21,uVar15);

+              ppuVar17 = (undefined **)WPP_GLOBAL_Control;

+            }

+            goto LAB_1;

+          }

+LAB_2:

+          uVar8 = 0;

+          piVar18 = (int *)((ulonglong)*(uint *)(this + 0x50) * 0xd4 + *(longlong *)(this + 0x40));

+          *(uint *)(this + 0x50) = *(uint *)(this + 0x50) + 1 & 0x7fff;

+          *(char *)(piVar18 + 0x34) = (char)uVar12;

+          if (bVar13 != 0) {

+            uVar8 = (uint)bVar13;

+            piVar10 = piVar18;

+            for (uVar6 = (ulonglong)uVar8; uVar6 != 0; uVar6 = uVar6 - 1) {

+              *piVar10 = iVar20;

+              piVar10 = piVar10 + 1;

+            }

+          }

+          uVar6 = 0;

+          if (*(char *)(lVar19 + 0xd0) != '\0') {

+            do {

+              uVar16 = (int)uVar6 + 1;

+              uVar5 = (ulonglong)uVar8;

+              uVar8 = uVar8 + 1;

+              piVar18[uVar5] = *(int *)(lVar19 + uVar6 * 4);

+              uVar6 = (ulonglong)uVar16;

+            } while (uVar16 < *(byte *)(lVar19 + 0xd0));

+          }

+          ppuVar17 = (undefined **)WPP_GLOBAL_Control;

+          if (uVar8 < uVar12) {

+            piVar10 = piVar18 + uVar8;

+            for (uVar6 = (ulonglong)(uVar12 - uVar8); ppuVar17 = (undefined **)WPP_GLOBAL_Control,

+                uVar6 != 0; uVar6 = uVar6 - 1) {

+              *piVar10 = iVar20;

+              piVar10 = piVar10 + 1;

+            }

+          }

+          goto LAB_0;

+        }

+        if (ppuVar17 == &WPP_GLOBAL_Control) {

+          return -0x7ff8ffa9;

+        }

+        if ((*(byte *)((longlong)ppuVar17 + 0x1c) & 8) == 0) {

+          return -0x7ff8ffa9;

+        }

+        if (*(char *)((longlong)ppuVar17 + 0x19) == '\0') {

+          return -0x7ff8ffa9;

+        }

+        uVar11 = 100;

+      }

+      puVar7 = ppuVar17[2];

+      goto LAB_3;

+    }

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

+      return -0x7ff8ffa9;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+      return -0x7ff8ffa9;

+    }

+    if (WPP_GLOBAL_Control[0x19] == '\0') {

+      return -0x7ff8ffa9;

+    }

+    uVar11 = 0x61;

+  }

+  else {

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

+      return -0x7ff8ffa9;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+      return -0x7ff8ffa9;

+    }

+    if (WPP_GLOBAL_Control[0x19] == '\0') {

+      return -0x7ff8ffa9;

+    }

+    uVar11 = 0x60;

+  }

+  puVar7 = *(undefined **)(WPP_GLOBAL_Control + 0x10);

+LAB_3:

+  WPP_SF_(puVar7,uVar11,&WPP_1e24bb0281903cc1455d70aea08aca71_Traceguids);

+  return -0x7ff8ffa9;

+}

+
```

## `CRdrServerRequestHandler::CompleteRead`  (modified)

```diff
--- CRdrServerRequestHandler::CompleteRead
+++ CRdrServerRequestHandler::CompleteRead
@@ -1,2 +1,68 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdrServerRequestHandler::CompleteRead : 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::CompleteRead(unsigned long,long,unsigned

+   long,unsigned char * __ptr64) __ptr64 */

+

+long __thiscall

+CRdrServerRequestHandler::CompleteRead

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

+

+{

+  longlong *plVar1;

+  bool bVar2;

+  long lVar3;

+  uint uVar4;

+  long lVar5;

+  uint *_Dst;

+  uint uVar6;

+  longlong *local_res8;

+  CTSCriticalSection *local_38 [2];

+  

+  local_38[0] = (CTSCriticalSection *)(this + 0x80);

+  lVar5 = 0;

+  local_res8 = (longlong *)0x0;

+  CTSCriticalSection::Lock(local_38[0]);

+  uVar6 = param_3 + 0xd;

+  _Dst = operator_new((ulonglong)uVar6);

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

+    lVar5 = -0x7ff8fff2;

+  }

+  else {

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

+                      ((FeatureImpl<__WilFeatureTraits_Feature_2884880696> *)

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

+                        ::__l2::impl);

+    if (bVar2) {

+      memset(_Dst,0,(ulonglong)uVar6);

+    }

+    lVar3 = RemovePendingRequest(this,param_1);

+    if ((((lVar3 < 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),0x1b,

+                 &WPP_852928d963083be7bf554339e5c32f33_Traceguids,uVar4,

+                 "RemovePendingRequest failed",lVar3);

+    }

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

+    _Dst[1] = param_2;

+    _Dst[2] = param_3;

+    *_Dst = *_Dst ^ (*_Dst ^ param_1) & 0xffffff;

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

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

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

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

+      local_res8 = plVar1;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

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

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

+        lVar5 = (**(code **)(*plVar1 + 0x18))(plVar1,uVar6,_Dst,0);

+      }

+    }

+    operator_delete(_Dst);

+  }

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)local_38);

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

+  return lVar5;

+}

+
```

## `HevcDecoder::DecodeHeader`  (modified)

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

+/* private: long __cdecl HevcDecoder::DecodeHeader(unsigned char const * __ptr64,unsigned

+   int,unsigned int * __ptr64,unsigned int * __ptr64) __ptr64 */

+

+long __thiscall

+HevcDecoder::DecodeHeader(HevcDecoder *this,uchar *param_1,uint param_2,uint *param_3,uint *param_4)

+

+{

+  byte bVar1;

+  ushort uVar2;

+  bool bVar3;

+  undefined4 uVar4;

+  undefined4 uVar5;

+  int iVar6;

+  __uint64 _Var7;

+  void *pvVar8;

+  int iVar9;

+  char *pcVar10;

+  HevcDecoder *pHVar11;

+  undefined8 uVar12;

+  long lVar13;

+  uint *puVar14;

+  uint *puVar15;

+  uint uVar16;

+  uint uVar17;

+  longlong lVar18;

+  uint uVar19;

+  uint uVar20;

+  ulonglong uVar21;

+  uint uVar22;

+  undefined8 in_stack_ffffffffffffff88;

+  uint local_68;

+  uint local_64;

+  longlong local_60;

+  ulonglong local_48;

+  undefined8 uStack_40;

+  

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

+  local_68 = 0;

+  if (param_2 < 4) {

+    lVar13 = -0x7fff0001;

+    uVar20 = 0;

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

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

+    goto LAB_0;

+    uVar4 = RdpX_GetActivityIdPrefix();

+    uVar12 = 0x4f;

+    pcVar10 = "Invalid input buffer - too small for numRects.";

+    uVar20 = 0;

+LAB_1:

+    lVar13 = -0x7fff0001;

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

+               &WPP_a68698842d863de124b28399938b906e_Traceguids,uVar4,pcVar10,0x8000ffff);

+  }

+  else {

+    uVar20 = *(uint *)param_1;

+    uVar21 = (ulonglong)uVar20;

+    puVar14 = (uint *)(param_1 + 4);

+    puVar15 = puVar14;

+    if (uVar20 == 0) {

+      *(undefined4 *)(this + 0x48) = 0;

+      operator_delete__(*(void **)(this + 0x40));

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

+LAB_2:

+      lVar13 = 0;

+      uVar16 = (param_2 - 4) + uVar20 * -10;

+      if (uVar16 < 4) {

+        local_68 = 0x29;

+        lVar13 = -0x7fff0001;

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

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

+          uVar4 = RdpX_GetActivityIdPrefix();

+          uVar12 = 0x54;

+          pcVar10 = "Invalid input buffer - too small for m_cbNALUInfoLength.";

+          goto LAB_1;

+        }

+      }

+      else {

+        uVar17 = *puVar15;

+        *(uint *)(this + 0x868) = uVar17;

+        if (uVar17 == 0) {

+          local_68 = 0x2a;

+          lVar13 = -0x7fff0001;

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

+              ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) &&

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

+            uVar4 = RdpX_GetActivityIdPrefix();

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

+                     &WPP_a68698842d863de124b28399938b906e_Traceguids,uVar4);

+          }

+        }

+        else if (uVar16 - 4 < uVar17) {

+          local_68 = 0x28;

+          lVar13 = -0x7fff0001;

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

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

+            uVar4 = RdpX_GetActivityIdPrefix();

+            uVar12 = 0x55;

+            pcVar10 = "Invalid header received - too small for NALU info buffer";

+            goto LAB_1;

+          }

+        }

+        else {

+          bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3540497722>::

+                  __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_3540497722> *)

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

+                                       ::__l2::impl);

+          if ((!bVar3) || (*(uint *)(this + 0x868) < 0x801)) {

+            uVar16 = *(uint *)(this + 0x868) >> 2;

+            uVar21 = (ulonglong)uVar16;

+            if (uVar16 != 0) {

+              pHVar11 = this + 0x68;

+              do {

+                puVar15 = puVar15 + 1;

+                *(uint *)pHVar11 = *puVar15;

+                pHVar11 = pHVar11 + 4;

+                uVar21 = uVar21 - 1;

+              } while (uVar21 != 0);

+            }

+            goto LAB_3;

+          }

+          local_68 = 0x28;

+          lVar13 = -0x7fff0001;

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

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

+            uVar4 = RdpX_GetActivityIdPrefix();

+            uVar12 = 0x56;

+            pcVar10 = "Invalid NALU length info - exceeds buffer capacity or misaligned";

+            goto LAB_1;

+          }

+        }

+      }

+    }

+    else if ((uVar21 * 10 < 0x100000000) && (uVar21 * 10 <= (ulonglong)(param_2 - 4))) {

+      *(uint *)(this + 0x48) = uVar20;

+      operator_delete__(*(void **)(this + 0x40));

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

+      _Var7 = SUB168(ZEXT816(0x18) * ZEXT416(*(uint *)(this + 0x48)),0);

+      if (SUB168(ZEXT816(0x18) * ZEXT416(*(uint *)(this + 0x48)),8) != 0) {

+        _Var7 = 0xffffffffffffffff;

+      }

+      pvVar8 = operator_new(_Var7);

+      operator_delete__(*(void **)(this + 0x40));

+      *(void **)(this + 0x40) = pvVar8;

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

+        local_64 = 0;

+        if (uVar20 != 0) {

+          local_60 = 0;

+          do {

+            iVar6 = (int)(short)(ushort)puVar14[1];

+            uVar22 = (uint)(ushort)*puVar14;

+            iVar9 = (int)(short)*(ushort *)((longlong)puVar14 + 6);

+            uVar17 = iVar6 - uVar22;

+            uVar2 = *(ushort *)((longlong)puVar14 + 2);

+            uVar16 = (uint)uVar2;

+            puVar14 = puVar14 + 2;

+            uVar19 = iVar9 - (uint)uVar2;

+            local_48 = (ulonglong)CONCAT24(uVar2,uVar22);

+            uStack_40 = CONCAT44(uVar19,uVar17);

+            bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>::

+                    __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_3215164728> *)

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

+                                         ::__l2::impl);

+            if (bVar3) {

+              if (((iVar6 <= (int)uVar22) || (iVar9 <= (int)uVar16)) ||

+                 ((*(uint *)this < uVar17 ||

+                  (((*(uint *)(this + 4) < uVar19 || (*(uint *)this < uVar17 + uVar22)) ||

+                   (*(uint *)(this + 4) < uVar19 + uVar16)))))) {

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

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

+                {

+                  uVar4 = RdpX_GetActivityIdPrefix();

+                  uVar12 = 0x52;

+LAB_4:

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

+                             &WPP_a68698842d863de124b28399938b906e_Traceguids,uVar4,

+                             "Invalid input buffer - invalid rect received.",0x8000ffff);

+                }

+LAB_5:

+                lVar13 = -0x7fff0001;

+                goto LAB_0;

+              }

+            }

+            else if ((((iVar6 <= (int)uVar22) || (iVar9 <= (int)uVar16)) || (*(uint *)this < uVar17)

+                     ) || (*(uint *)(this + 4) < uVar19)) {

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

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

+                uVar4 = RdpX_GetActivityIdPrefix();

+                uVar12 = 0x53;

+                goto LAB_4;

+              }

+              goto LAB_5;

+            }

+            puVar15 = puVar15 + 2;

+            lVar18 = *(longlong *)(this + 0x40);

+            *(ulonglong *)(lVar18 + local_60) = local_48;

+            ((ulonglong *)(lVar18 + local_60))[1] = uStack_40;

+            local_60 = local_60 + 0x18;

+            local_64 = local_64 + 1;

+          } while (local_64 < uVar20);

+          lVar18 = 0;

+          do {

+            uVar16 = *puVar15;

+            lVar18 = lVar18 + 0x18;

+            *(uint *)(*(longlong *)(this + 0x40) + -4 + lVar18) = (uint)(byte)((byte)uVar16 >> 7);

+            bVar1 = *(byte *)((longlong)puVar15 + 1);

+            puVar15 = (uint *)((longlong)puVar15 + 2);

+            *(byte *)(*(longlong *)(this + 0x40) + -8 + lVar18) = (byte)uVar16 & 0x7f;

+            *(byte *)(*(longlong *)(this + 0x40) + -7 + lVar18) = bVar1;

+            uVar21 = uVar21 - 1;

+          } while (uVar21 != 0);

+        }

+        goto LAB_2;

+      }

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

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

+        uVar5 = RdpX_GetActivityIdPrefix();

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

+                  &WPP_a68698842d863de124b28399938b906e_Traceguids,uVar5,CONCAT44(uVar4,0x8007000e))

+        ;

+      }

+      lVar13 = -0x7ff8fff2;

+    }

+    else {

+      lVar13 = -0x7fff0001;

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

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

+        uVar4 = RdpX_GetActivityIdPrefix();

+        uVar12 = 0x50;

+        pcVar10 = "Invalid header received.";

+        goto LAB_1;

+      }

+    }

+  }

+LAB_0:

+  *(undefined4 *)(this + 0x48) = 0;

+  LogError(this,local_68,lVar13);

+LAB_3:

+  iVar6 = *(int *)(this + 0x868);

+  *param_3 = uVar20;

+  *param_4 = iVar6 + uVar20 * 10 + 8;

+  return lVar13;

+}

+
```

## `RdpRemoteAppCore::SetV2CoreProperty`  (modified)

```diff
--- RdpRemoteAppCore::SetV2CoreProperty
+++ RdpRemoteAppCore::SetV2CoreProperty
@@ -1,2 +1,105 @@
-Failed to decompile mstscax.dll - .ProgramDB RdpRemoteAppCore::SetV2CoreProperty : 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: long __cdecl RdpRemoteAppCore::SetV2CoreProperty(unsigned long) __ptr64 */

+

+long __thiscall RdpRemoteAppCore::SetV2CoreProperty(RdpRemoteAppCore *this,ulong param_1)

+

+{

+  int iVar1;

+  undefined4 uVar2;

+  int iVar3;

+  undefined4 uVar4;

+  longlong *plVar5;

+  char *pcVar6;

+  undefined8 uVar7;

+  _GUID *p_Var8;

+  _GUID *in_R9;

+  _GUID local_res8;

+  ulong local_res18 [2];

+  longlong *local_res20;

+  undefined8 in_stack_ffffffffffffffb8;

+  undefined8 in_stack_ffffffffffffffc0;

+  longlong *local_38;

+  char *local_30;

+  

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

+  uVar2 = (undefined4)((ulonglong)in_stack_ffffffffffffffb8 >> 0x20);

+  local_38 = (longlong *)0x0;

+  local_res20 = (longlong *)0x0;

+  iVar1 = (**(code **)(**(longlong **)(this + 0x98) + 0xa0))(*(longlong **)(this + 0x98),&local_38);

+  if (iVar1 < 0) {

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

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

+    goto LAB_0;

+    uVar2 = RdpX_GetActivityIdPrefix();

+    uVar7 = 0x13e;

+    pcVar6 = "Failed to get the core Api";

+LAB_1:

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

+               &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar2,pcVar6,CONCAT44(uVar4,iVar1));

+  }

+  else {

+    plVar5 = (longlong *)(**(code **)(*local_38 + 0x28))();

+    if (plVar5 == (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_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x13f,

+                  &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar4,CONCAT44(uVar2,0x8000ffff))

+        ;

+      }

+      iVar1 = -0x7fff0001;

+      goto LAB_0;

+    }

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

+    local_res20 = plVar5;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

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

+    if (param_1 == 4) {

+      local_res8.Data1 = 0;

+      p_Var8 = &local_res8;

+      iVar1 = (**(code **)(*plVar5 + 0x58))(plVar5,"RailV2Enabled");

+      if (iVar1 < 0) {

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

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

+        goto LAB_0;

+        uVar2 = RdpX_GetActivityIdPrefix();

+        uVar7 = 0x140;

+        pcVar6 = "GetBoolProperty(TS_PROP_CORE_CONNECTION_IS_RAIL_V2) failed";

+        goto LAB_1;

+      }

+      if (local_res8.Data1 != 0) {

+        if (4 < DAT_2) {

+          local_res18[0] = local_res8.Data1;

+          local_30 = "SetV2CoreProperty_NotSettingDefaultV1SVC";

+          _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<4>_>

+                    ((_tlgProvider_t *)&DAT_2,&DAT_18086472e,p_Var8,in_R9,

+                     (_tlgWrapSz<char> *)&local_30,(_tlgWrapperByVal<4> *)local_res18);

+        }

+        iVar1 = 0;

+        goto LAB_0;

+      }

+    }

+    iVar1 = (**(code **)(*plVar5 + 0x18))(plVar5,"RailV2Enabled");

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

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

+      uVar2 = RdpX_GetActivityIdPrefix();

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

+                 &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar2,

+                 "Failed to set the V2 core property",CONCAT44(uVar4,iVar1));

+    }

+    if (*(longlong **)(this + 0xa8) != (longlong *)0x0) {

+      iVar3 = (**(code **)(**(longlong **)(this + 0xa8) + 0x88))();

+      if (iVar3 == 1) {

+        LogRemoteAppEventF(this + 0x40,(ushort *)L"RemoteAppV2=%lu",0,(ulonglong)param_1);

+      }

+    }

+  }

+LAB_0:

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

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

+  return iVar1;

+}

+
```

## `CProxyStreamManager::~CProxyStreamManager`  (modified)

```diff
--- CProxyStreamManager::~CProxyStreamManager
+++ CProxyStreamManager::~CProxyStreamManager
@@ -1,2 +1,71 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyStreamManager::~CProxyStreamManager : 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: virtual __cdecl CProxyStreamManager::~CProxyStreamManager(void) __ptr64 */

+

+void __thiscall CProxyStreamManager::~CProxyStreamManager(CProxyStreamManager *this)

+

+{

+  DynArray<SmartArray<CProxyStream,long>::CCleanType,long> *this_00;

+  bool bVar1;

+  uint uVar2;

+  int iVar3;

+  int iVar4;

+  longlong local_res8;

+  

+  *(undefined ***)this = &CBasePlayer::_vftable__for__INonDelegatingUnknown__;

+  *(undefined ***)(this + 8) = &_vftable__for__CTSObject__;

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

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

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

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

+             &WPP_0590a41147183e8365b9646d033b00c8_Traceguids,uVar2);

+  }

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

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

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

+                      ::__l2::impl);

+  if (bVar1) {

+    DeleteCriticalSection((LPCRITICAL_SECTION)(this + 0x88));

+  }

+  if (*(int *)(this + 0x30) != 0) {

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

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

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

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

+               &WPP_0590a41147183e8365b9646d033b00c8_Traceguids,uVar2);

+    }

+    DeleteCriticalSection((LPCRITICAL_SECTION)(this + 0x38));

+  }

+  this_00 = (DynArray<SmartArray<CProxyStream,long>::CCleanType,long> *)(this + 0x70);

+  iVar4 = 0;

+  if (0 < *(int *)(this + 0x74)) {

+    do {

+      local_res8 = 0;

+      iVar3 = DynArray<SmartArray<CProxyStream,long>::CCleanType,long>::GetAt

+                        (this_00,iVar4,(CCleanType *)&local_res8);

+      if ((iVar3 != 0) && (local_res8 != 0)) {

+        (**(code **)(**(longlong **)(local_res8 + 0x20) + 0x10))();

+        local_res8 = 0;

+        DynArray<SmartArray<CProxyStream,long>::CCleanType,long>::AddAt

+                  (this_00,iVar4,(CCleanType *)&local_res8);

+        *(int *)(this + 0x80) = *(int *)(this + 0x80) + -1;

+      }

+      iVar4 = iVar4 + 1;

+    } while (iVar4 < *(int *)(this + 0x74));

+  }

+  if (-1 < *(int *)this_00) {

+    *(undefined4 *)(this + 0x74) = 0;

+  }

+  DynArray<SmartArray<CameraRedirConfig,unsigned_long>::CCleanType,unsigned_long>::

+  ~DynArray<SmartArray<CameraRedirConfig,unsigned_long>::CCleanType,unsigned_long>

+            ((DynArray<SmartArray<CameraRedirConfig,unsigned_long>::CCleanType,unsigned_long> *)

+             (this + 0xb0));

+  SmartArray<CProxyStream,long>::~SmartArray<CProxyStream,long>

+            ((SmartArray<CProxyStream,long> *)this_00);

+  *(undefined ***)this = CTSUnknown::vftable_for_INonDelegatingUnknown_;

+  *(uint *)(this + 0x1c) = *(uint *)(this + 0x1c) | 8;

+  *(undefined ***)(this + 8) = CTSObject::vftable;

+  return;

+}

+
```

## `CUH::UHSendBitmapCacheErrorPDU`  (modified)

```diff
--- CUH::UHSendBitmapCacheErrorPDU
+++ CUH::UHSendBitmapCacheErrorPDU
@@ -1,2 +1,94 @@
-Failed to decompile mstscax.dll - .ProgramDB CUH::UHSendBitmapCacheErrorPDU : 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: int __cdecl CUH::UHSendBitmapCacheErrorPDU(unsigned char) __ptr64 */

+

+int __thiscall CUH::UHSendBitmapCacheErrorPDU(CUH *this,uchar param_1)

+

+{

+  CTSRdpConnectionStack *this_00;

+  bool bVar1;

+  undefined4 uVar2;

+  long lVar3;

+  ulong uVar4;

+  uint uVar5;

+  undefined4 *puVar6;

+  undefined8 uVar7;

+  uint uVar8;

+  int in_R8D;

+  ITSNetBuffer *local_res8;

+  CTSRdpConnectionStack *local_res18 [2];

+  

+  this_00 = *(CTSRdpConnectionStack **)(this + 0x820);

+  uVar5 = 0;

+  uVar8 = 0;

+  local_res8 = (ITSNetBuffer *)0x0;

+  local_res18[0] = this_00;

+  TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+            ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)local_res18);

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

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_0;

+    uVar2 = RdpX_GetActivityIdPrefix();

+    uVar7 = 0x45;

+  }

+  else {

+    lVar3 = CTSRdpConnectionStack::GetBuffer(this_00,0x1e,in_R8D,&local_res8);

+    if (-1 < lVar3) {

+      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),0x46,

+                 &WPP_9a0d9d550f633384007dbcf4fa3c3c61_Traceguids,uVar2);

+      }

+      puVar6 = (undefined4 *)(**(code **)(*(longlong *)local_res8 + 0x28))();

+      bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_1205842233>::__private_IsEnabled

+                        ((FeatureImpl<__WilFeatureTraits_Feature_1205842233> *)

+                         &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_1205842233>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_1205842233>::GetImpl(void)'

+                          ::__l2::impl);

+      if (bVar1) {

+        *(undefined8 *)(puVar6 + 1) = 0;

+        *(undefined8 *)(puVar6 + 3) = 0;

+        *(undefined8 *)(puVar6 + 5) = 0;

+        *(undefined2 *)(puVar6 + 7) = 0;

+      }

+      *puVar6 = 0x17001e;

+      uVar4 = CTSRdpConnectionStack::GetClientMCSID(this_00);

+      *(short *)(puVar6 + 1) = (short)uVar4;

+      uVar4 = CTSRdpConnectionStack::GetShareID(this_00);

+      *(ulong *)((longlong)puVar6 + 6) = uVar4;

+      *(undefined2 *)((longlong)puVar6 + 10) = 0x100;

+      *(undefined4 *)((longlong)puVar6 + 0xe) = 0x2c;

+      *(undefined4 *)((longlong)puVar6 + 0x12) = 1;

+      *(uchar *)((longlong)puVar6 + 0x16) = param_1;

+      *(undefined1 *)((longlong)puVar6 + 0x17) = 1;

+      *(undefined2 *)(puVar6 + 6) = 0;

+      *(undefined4 *)((longlong)puVar6 + 0x1a) = 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),0x47,

+                 &WPP_9a0d9d550f633384007dbcf4fa3c3c61_Traceguids,uVar2);

+      }

+      uVar5 = CTSRdpConnectionStack::SendBuffer(this_00,local_res8,0x1e,8);

+      uVar5 = ~uVar5 >> 0x1f;

+      goto LAB_0;

+    }

+    uVar5 = uVar8;

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 3))

+    goto LAB_0;

+    uVar2 = RdpX_GetActivityIdPrefix();

+    uVar7 = 0x48;

+  }

+  WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar7,

+           &WPP_9a0d9d550f633384007dbcf4fa3c3c61_Traceguids,uVar2);

+  uVar5 = uVar8;

+LAB_0:

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)local_res18);

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res8);

+  return uVar5;

+}

+
```

## `CTsRdpCertSignature::GetCertificateThumbPrintByBCryptAlgorithm`  (modified)

```diff
--- CTsRdpCertSignature::GetCertificateThumbPrintByBCryptAlgorithm
+++ CTsRdpSignature::NonDelegatingQueryInterface
@@ -1,114 +1,40 @@
 

-/* private: long __cdecl CTsRdpCertSignature::GetCertificateThumbPrintByBCryptAlgorithm(unsigned

-   short const * __ptr64,unsigned char * __ptr64 * __ptr64,unsigned long * __ptr64) __ptr64 */

+/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

+   guard_dispatch_icall */

+/* public: virtual long __cdecl CTsRdpSignature::NonDelegatingQueryInterface(struct _GUID const &

+   __ptr64,void * __ptr64 * __ptr64) __ptr64 */

 

 long __thiscall

-CTsRdpCertSignature::GetCertificateThumbPrintByBCryptAlgorithm

-          (CTsRdpCertSignature *this,ushort *param_1,uchar **param_2,ulong *param_3)

+CTsRdpSignature::NonDelegatingQueryInterface(CTsRdpSignature *this,_GUID *param_1,void **param_2)

 

 {

-  uint uVar1;

-  uint uVar2;

-  uchar *hMem;

-  char *pcVar3;

-  undefined8 uVar4;

-  uint uVar5;

-  ulong local_res18 [2];

-  ULONG *pcbResult;

-  uchar *puVar7;

-  ULONG local_28 [2];

-  BCRYPT_ALG_HANDLE local_20;

-  undefined4 uVar6;

+  longlong lVar1;

+  long lVar2;

   

-  local_20 = (BCRYPT_HANDLE)0x0;

-  local_res18[0] = 0;

-  local_28[0] = 0;

-  if ((param_2 == (uchar **)0x0) || (param_3 == (ulong *)0x0)) {

-    uVar5 = 0x80070057;

-    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

-      return -0x7ff8ffa9;

-    }

-    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

-      return -0x7ff8ffa9;

-    }

-    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

-      return -0x7ff8ffa9;

-    }

-    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

-    uVar4 = 0x12;

-    uVar1 = 0x80070057;

-    pcVar3 = "GetCertificateThumbPrintByBCryptAlgorithm: invalid args";

+  lVar1._0_4_ = param_1->Data1;

+  lVar1._4_2_ = param_1->Data2;

+  lVar1._6_2_ = param_1->Data3;

+  if (lVar1 == 0) {

+    lVar1 = *(longlong *)param_1->Data4 + -0x46000000000000c0;

+  }

+  lVar2 = 0;

+  if (lVar1 == 0) {

+    CTSUnknown::NonDelegatingQueryInterface((CTSUnknown *)this,param_1,param_2);

+    lVar2 = 0;

   }

   else {

-    *param_2 = (uchar *)0x0;

-    *param_3 = 0;

-    if (*(longlong *)(this + 0x68) == 0) {

-      return 0;

+    lVar1 = *(longlong *)param_1 + -0x40dcc6277272b1de;

+    if (lVar1 == 0) {

+      lVar1 = *(longlong *)param_1->Data4 + 0xf6a3cec25a8ec45;

     }

-    uVar1 = BCryptOpenAlgorithmProvider(&local_20,(LPCWSTR)param_1,(LPCWSTR)0x0,0);

-    if (((int)uVar1 < 0) && (uVar5 = uVar1 | 0x10000000, (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;

-      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

-      uVar4 = 0x13;

-      uVar1 = uVar1 | 0x10000000;

-      pcVar3 = "BCryptOpenAlgorithmProvider failed";

+    if (lVar1 == 0) {

+      *param_2 = (void *)(-(ulonglong)(this != (CTsRdpSignature *)0x0) & (ulonglong)(this + 0x30));

+      (**(code **)(*(longlong *)(this + 0x30) + 8))();

     }

     else {

-      pcbResult = local_28;

-      uVar1 = BCryptGetProperty(local_20,L"HashDigestLength",(PUCHAR)local_res18,4,pcbResult,0);

-      uVar6 = (undefined4)((ulonglong)pcbResult >> 0x20);

-      if ((-1 < (int)uVar1) || (uVar5 = uVar1 | 0x10000000, -1 < (int)uVar5)) {

-        hMem = (uchar *)PAL_System_MemAlloc(local_res18[0],1);

-        if (hMem == (uchar *)0x0) {

-          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

-            uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

-            WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x15,

-                      &WPP_836fe736e3db3df6a54e2b58f6c76f3b_Traceguids,uVar5,"BYTE[]");

-          }

-          uVar5 = 0x8007000e;

-        }

-        else {

-          puVar7 = hMem;

-          uVar1 = BCryptHash(local_20,0,0,*(undefined8 *)(*(longlong *)(this + 0x68) + 8),

-                             CONCAT44(uVar6,*(undefined4 *)(*(longlong *)(this + 0x68) + 0x10)),hMem

-                             ,local_res18[0]);

-          uVar6 = (undefined4)((ulonglong)puVar7 >> 0x20);

-          if (((int)uVar1 < 0) && (uVar5 = uVar1 | 0x10000000, (int)uVar5 < 0)) {

-            if ((((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),0x16,

-                         &WPP_836fe736e3db3df6a54e2b58f6c76f3b_Traceguids,uVar2,"BCryptHash failed",

-                         CONCAT44(uVar6,uVar1) | 0x10000000);

-            }

-            LocalFree(hMem);

-          }

-          else {

-            uVar5 = 0;

-            *param_3 = local_res18[0];

-            *param_2 = hMem;

-          }

-        }

-        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;

-      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

-      uVar4 = 0x14;

-      uVar1 = uVar1 | 0x10000000;

-      pcVar3 = "BCryptGetProperty failed";

+      lVar2 = -0x7fffbffe;

     }

   }

-  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar4,

-             &WPP_836fe736e3db3df6a54e2b58f6c76f3b_Traceguids,uVar2,pcVar3,uVar1);

-LAB_0:

-  if (local_20 != (BCRYPT_ALG_HANDLE)0x0) {

-    BCryptCloseAlgorithmProvider(local_20,0);

-  }

-  return uVar5;

+  return lVar2;

 }
```

## `AvcDecompressor::MapCPUSampleToTexture`  (modified)

```diff
--- AvcDecompressor::MapCPUSampleToTexture
+++ AvcDecompressor::MapCPUSampleToTexture
@@ -1,2 +1,109 @@
-Failed to decompile mstscax.dll - .ProgramDB AvcDecompressor::MapCPUSampleToTexture : 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: long __cdecl AvcDecompressor::MapCPUSampleToTexture(struct IMFSample * __ptr64,struct

+   RdpXInterfaceTexture2D * __ptr64) __ptr64 */

+

+long __thiscall

+AvcDecompressor::MapCPUSampleToTexture

+          (AvcDecompressor *this,IMFSample *param_1,RdpXInterfaceTexture2D *param_2)

+

+{

+  int iVar1;

+  bool bVar2;

+  undefined4 uVar3;

+  int iVar4;

+  uint uVar5;

+  _XResult32 _Var6;

+  char *pcVar7;

+  undefined8 uVar8;

+  uchar *puVar9;

+  uint uVar10;

+  int *piVar11;

+  ulong local_res10 [2];

+  ulong local_res20 [2];

+  uchar *local_48;

+  undefined8 local_40;

+  undefined8 *local_38;

+  undefined4 local_30;

+  

+  local_48 = (uchar *)0x0;

+  local_38 = &local_40;

+  local_res10[0] = 0;

+  local_res20[0] = 0;

+  local_40 = 0;

+  local_30 = 0;

+  iVar4 = (**(code **)(*(longlong *)param_1 + 0x148))(param_1,&local_40);

+  if (iVar4 < 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();

+    uVar8 = 0x5e;

+    pcVar7 = "spRgbSample->ConvertToContiguousBuffer() failed";

+  }

+  else {

+    iVar4 = RAIIBufferLock::Lock((RAIIBufferLock *)&local_38,&local_48,local_res10,local_res20);

+    if (-1 < iVar4) {

+      iVar1 = *(int *)(this + 0x18);

+      uVar10 = 0;

+      if (*(int *)(this + 0xdc) != 0) {

+        do {

+          piVar11 = (int *)((ulonglong)uVar10 * 0x1c + *(longlong *)(this + 0x88));

+          puVar9 = local_48 + (longlong)(*piVar11 << 2) + (ulonglong)(uint)(iVar1 * 4 * piVar11[1]);

+          bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>::

+                  __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_3215164728> *)

+                                      &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3215164728>::GetImpl(void)'

+                                       ::__l2::impl);

+          uVar5 = local_res10[0];

+          if (bVar2) {

+            uVar5 = (int)puVar9 - (int)local_48;

+            if ((puVar9 < local_48) || (local_res10[0] < uVar5)) {

+              iVar4 = -0x7ff8ffa9;

+              if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                 (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+                uVar3 = RdpX_GetActivityIdPrefix();

+                uVar8 = 0x60;

+                iVar4 = -0x7ff8ffa9;

+                pcVar7 = "Invalid pixel buffer offset";

+                goto LAB_1;

+              }

+              break;

+            }

+            uVar5 = local_res10[0] - uVar5;

+          }

+          _Var6 = (**(code **)(*(longlong *)param_2 + 0x48))

+                            (param_2,0,puVar9,uVar5,piVar11[2],piVar11[3],iVar1 * 4,*piVar11,

+                             piVar11[1]);

+          iVar4 = MapXResultToHR(_Var6);

+          if (iVar4 < 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 = 0x61;

+              pcVar7 = "SetSurfacePixels failed!";

+              goto LAB_1;

+            }

+            break;

+          }

+          uVar10 = uVar10 + 1;

+        } while (uVar10 < *(uint *)(this + 0xdc));

+      }

+      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;

+    uVar3 = RdpX_GetActivityIdPrefix();

+    uVar8 = 0x5f;

+    pcVar7 = "raiiBufLock(spRgbMediaBuffer).Lock() failed";

+  }

+LAB_1:

+  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar8,

+             &WPP_368028ab3193319f7cbdcfaf447eac55_Traceguids,uVar3,pcVar7,iVar4);

+LAB_0:

+  RAIIBufferLock::~RAIIBufferLock((RAIIBufferLock *)&local_38);

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_40);

+  return iVar4;

+}

+
```

## `CClipBase::Terminate`  (modified)

```diff
--- CClipBase::Terminate
+++ CClipBase::Terminate
@@ -1,2 +1,165 @@
-Failed to decompile mstscax.dll - .ProgramDB CClipBase::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 */

+/* protected: virtual long __cdecl CClipBase::Terminate(void) __ptr64 */

+

+long __thiscall CClipBase::Terminate(CClipBase *this)

+

+{

+  TCntPtr<ITSThread> *pTVar1;

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *pTVar2;

+  TCntPtr<CTSObjectPool<CRDPENCCONStreamBufferPoolObject>_> *this_00;

+  LPCRITICAL_SECTION lpCriticalSection;

+  uint uVar3;

+  int iVar4;

+  int iVar5;

+  CClipBase *pCVar6;

+  

+  iVar4 = (**(code **)(*(longlong *)(this + -8) + 0x60))();

+  iVar5 = 0;

+  if ((((iVar4 < 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_95e9326cdea9352825b64f07fc278838_Traceguids,uVar3,

+               "RemoveNotificationSinks failed!",iVar4);

+  }

+  if (*(short *)(this + 0xd0) != 0) {

+    UnregisterClassW(L"RdpClipRdrWindowClass",*(HINSTANCE *)(this + 0xd8));

+    *(undefined2 *)(this + 0xd0) = 0;

+  }

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x340);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x108);

+  if (*(longlong *)pTVar2 != 0) {

+    CProxyDataObjectManager::Terminate((CProxyDataObjectManager *)(*(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 + 0x110);

+  if (*(longlong *)pTVar2 != 0) {

+    CProxyStreamManager::Terminate((CProxyStreamManager *)(*(longlong *)pTVar2 + 8));

+    if (*(longlong *)pTVar2 != 0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+      *(undefined8 *)pTVar2 = 0;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+    }

+  }

+  pCVar6 = this + 0x48;

+  iVar4 = iVar5;

+  do {

+    if (*(longlong *)pCVar6 != 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x20,

+                  &WPP_95e9326cdea9352825b64f07fc278838_Traceguids,uVar3,iVar4);

+      }

+      CloseHandle(*(HANDLE *)pCVar6);

+      *(longlong *)pCVar6 = 0;

+    }

+    iVar4 = iVar4 + 1;

+    pCVar6 = pCVar6 + 8;

+  } while (iVar4 < 3);

+  pCVar6 = this + 0x60;

+  do {

+    if (*(longlong *)pCVar6 != 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x21,

+                  &WPP_95e9326cdea9352825b64f07fc278838_Traceguids,uVar3,iVar5);

+      }

+      CloseHandle(*(HANDLE *)pCVar6);

+      *(longlong *)pCVar6 = 0;

+    }

+    iVar5 = iVar5 + 1;

+    pCVar6 = pCVar6 + 8;

+  } while (iVar5 < 3);

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x298);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x260);

+  if (*(longlong *)pTVar2 != 0) {

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+    *(undefined8 *)pTVar2 = 0;

+  }

+  this_00 = (TCntPtr<CTSObjectPool<CRDPENCCONStreamBufferPoolObject>_> *)(this + 0x158);

+  if (*(longlong *)this_00 != 0) {

+    TCntPtr<CTSObjectPool<CRDPENCCONStreamBufferPoolObject>_>::SafeRelease(this_00);

+    *(undefined8 *)this_00 = 0;

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x268);

+  if (*(longlong *)pTVar2 != 0) {

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+    *(undefined8 *)pTVar2 = 0;

+  }

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x270);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+  }

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x278);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+  }

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x2a0);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+  }

+  pTVar1 = (TCntPtr<ITSThread> *)(this + 0x330);

+  if (*(longlong *)pTVar1 != 0) {

+    TCntPtr<ITSThread>::SafeRelease(pTVar1);

+    *(undefined8 *)pTVar1 = 0;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar1);

+  }

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x350);

+  if (*(longlong *)pTVar2 != 0) {

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+    *(undefined8 *)pTVar2 = 0;

+  }

+  lpCriticalSection = (LPCRITICAL_SECTION)(this + 0x2c0);

+  EnterCriticalSection(lpCriticalSection);

+  pTVar2 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x118);

+  if (*(longlong *)pTVar2 != 0) {

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(pTVar2);

+    *(undefined8 *)pTVar2 = 0;

+    TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+              ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)pTVar2);

+  }

+  SmartMap<CFileContentsReaderManager,unsigned_long>::Empty

+            ((SmartMap<CFileContentsReaderManager,unsigned_long> *)(this + 0x2a8));

+  LeaveCriticalSection(lpCriticalSection);

+  if (*(int *)(this + 0x2b8) != 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x22,

+               &WPP_95e9326cdea9352825b64f07fc278838_Traceguids,uVar3);

+    }

+    DeleteCriticalSection(lpCriticalSection);

+    *(undefined4 *)(this + 0x2b8) = 0;

+  }

+  *(uint *)(this + 0x14) = *(uint *)(this + 0x14) | 4;

+  return 0;

+}

+
```

## `CFormatDataPacker::EncodeFormatData`  (modified)

```diff
--- CFormatDataPacker::EncodeFormatData
+++ CFormatDataPacker::EncodeFormatData
@@ -1,2 +1,237 @@
-Failed to decompile mstscax.dll - .ProgramDB CFormatDataPacker::EncodeFormatData : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl CFormatDataPacker::EncodeFormatData(void * __ptr64 * __ptr64,int *

+   __ptr64,unsigned long,void * __ptr64) __ptr64 */

+

+long __thiscall

+CFormatDataPacker::EncodeFormatData

+          (CFormatDataPacker *this,void **param_1,int *param_2,ulong param_3,void *param_4)

+

+{

+  undefined4 uVar1;

+  uint uVar2;

+  long lVar3;

+  DWORD DVar4;

+  BOOL BVar5;

+  uint uVar6;

+  SIZE_T SVar7;

+  undefined4 *puVar8;

+  char *pcVar9;

+  CFormatDataPacker *this_00;

+  wchar_t *pwVar10;

+  undefined8 uVar11;

+  

+  *param_1 = (void *)0x0;

+  *param_2 = 0;

+  if (param_3 == 9) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      this = *(CFormatDataPacker **)(WPP_GLOBAL_Control + 0x10);

+      WPP_SF_D(this,0xd,&WPP_35388d02b2cb32d569d5bfa31caa89e3_Traceguids,uVar2);

+    }

+    lVar3 = CPalettePacker::EncodePalette((CPalettePacker *)this,param_1,param_4);

+    if (-1 < lVar3) {

+LAB_0:

+      *param_2 = 1;

+      return lVar3;

+    }

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return lVar3;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+      return lVar3;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return lVar3;

+    }

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar11 = 0xe;

+    pcVar9 = "EncodePalette failed!";

+  }

+  else if (param_3 == 3) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      this = *(CFormatDataPacker **)(WPP_GLOBAL_Control + 0x10);

+      WPP_SF_D(this,0xf,&WPP_35388d02b2cb32d569d5bfa31caa89e3_Traceguids,uVar2);

+    }

+    lVar3 = CMetaFilePacker::EncodeMetaFile((CMetaFilePacker *)this,param_1,param_4);

+    if (-1 < lVar3) goto LAB_0;

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return lVar3;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+      return lVar3;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return lVar3;

+    }

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar11 = 0x10;

+    pcVar9 = "EncodeMetaFile failed!";

+  }

+  else if (param_3 == 0xf) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x11,

+               &WPP_35388d02b2cb32d569d5bfa31caa89e3_Traceguids,uVar2);

+    }

+    if (*(CRdrFileTransfer **)(this + 0x50) == (CRdrFileTransfer *)0x0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return -0x7fffbffd;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+        return -0x7fffbffd;

+      }

+      if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+        return -0x7fffbffd;

+      }

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar11 = 0x13;

+LAB_1:

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar11,

+               &WPP_35388d02b2cb32d569d5bfa31caa89e3_Traceguids,uVar2);

+      return -0x7fffbffd;

+    }

+    lVar3 = CHdropPacker::EncodeHdrop

+                      (*(CHdropPacker **)(this + 0x40),param_1,param_4,

+                       *(CRdrFileTransfer **)(this + 0x50));

+    if (-1 < lVar3) goto LAB_0;

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return lVar3;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+      return lVar3;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return lVar3;

+    }

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar11 = 0x12;

+    pcVar9 = "EncodeHdrop failed!";

+  }

+  else {

+    this_00 = this;

+    uVar2 = CClipFormatTypes::FileNameW((CClipFormatTypes *)this);

+    if ((param_3 == uVar2) ||

+       (uVar2 = CClipFormatTypes::FileNameA((CClipFormatTypes *)this_00), param_3 == uVar2)) {

+      uVar2 = CClipFormatTypes::FileNameW((CClipFormatTypes *)this_00);

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+        pwVar10 = L"FileNameW";

+        if (param_3 != uVar2) {

+          pwVar10 = L"FileNameA";

+        }

+        WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x14,

+                  &WPP_35388d02b2cb32d569d5bfa31caa89e3_Traceguids,uVar6,pwVar10);

+      }

+      if (*(CRdrFileTransfer **)(this + 0x50) == (CRdrFileTransfer *)0x0) {

+        if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+          return -0x7fffbffd;

+        }

+        if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+          return -0x7fffbffd;

+        }

+        if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+          return -0x7fffbffd;

+        }

+        uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar11 = 0x16;

+        goto LAB_1;

+      }

+      lVar3 = CFileNamePacker::EncodeFileName

+                        (*(CFileNamePacker **)(this + 0x48),param_1,param_4,(uint)(param_3 == uVar2)

+                         ,*(CRdrFileTransfer **)(this + 0x50));

+      if (-1 < lVar3) goto LAB_0;

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return lVar3;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+        return lVar3;

+      }

+      if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+        return lVar3;

+      }

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar11 = 0x15;

+      pcVar9 = "EncodeFileName failed!";

+    }

+    else {

+      uVar2 = CClipFormatTypes::PreferredDropEffect((CClipFormatTypes *)this_00);

+      if (param_3 == uVar2) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x17,

+                   &WPP_35388d02b2cb32d569d5bfa31caa89e3_Traceguids,uVar2);

+        }

+        SVar7 = GlobalSize(param_4);

+        if (SVar7 < 4) {

+          return -0x7fff0001;

+        }

+        puVar8 = GlobalLock(param_4);

+        if (puVar8 != (undefined4 *)0x0) {

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar1 = *puVar8;

+            uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+            WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x18,

+                      &WPP_35388d02b2cb32d569d5bfa31caa89e3_Traceguids,uVar2,uVar1);

+          }

+          *puVar8 = 1;

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+            WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x19,

+                      &WPP_35388d02b2cb32d569d5bfa31caa89e3_Traceguids,uVar2,1);

+          }

+          BVar5 = GlobalUnlock(param_4);

+          if ((BVar5 != 0) || (DVar4 = GetLastError(), DVar4 == 0)) {

+            *param_1 = param_4;

+            goto LAB_2;

+          }

+        }

+        DVar4 = GetLastError();

+        if (0 < (int)DVar4) {

+          return DVar4 & 0xffff | 0x80070000;

+        }

+        return DVar4;

+      }

+      uVar2 = CClipFormatTypes::ZoneIdentifier((CClipFormatTypes *)this_00);

+      if (param_3 != uVar2) {

+        *param_1 = param_4;

+LAB_2:

+        *param_2 = 0;

+        return 0;

+      }

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x1a,

+                 &WPP_35388d02b2cb32d569d5bfa31caa89e3_Traceguids,uVar2);

+      }

+      lVar3 = CZoneIDFilter::FilterZoneID((CZoneIDFilter *)(this + 0x38),param_1,param_2,param_4);

+      if (-1 < lVar3) {

+        return lVar3;

+      }

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return lVar3;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+        return lVar3;

+      }

+      if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+        return lVar3;

+      }

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar11 = 0x1b;

+      pcVar9 = "FilterZoneID failed!";

+    }

+  }

+  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar11,

+             &WPP_35388d02b2cb32d569d5bfa31caa89e3_Traceguids,uVar2,pcVar9,lVar3);

+  return lVar3;

+}

+
```

## `CProxyDataObjectManager::CreateInstance`  (modified)

```diff
--- CProxyDataObjectManager::CreateInstance
+++ CProxyDataObjectManager::CreateInstance
@@ -1,2 +1,74 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyDataObjectManager::CreateInstance : 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: static long __cdecl CProxyDataObjectManager::CreateInstance(class IFormatDataAcquire *

+   __ptr64,class CProxyStreamManager * __ptr64,class CProxyDataObjectManager * __ptr64 * __ptr64) */

+

+long __cdecl

+CProxyDataObjectManager::CreateInstance

+          (IFormatDataAcquire *param_1,CProxyStreamManager *param_2,

+          CProxyDataObjectManager **param_3)

+

+{

+  long lVar1;

+  uint uVar2;

+  CProxyDataObjectManager *pCVar3;

+  char *pcVar4;

+  undefined4 uVar5;

+  CProxyDataObjectManager *local_res20;

+  

+  local_res20 = (CProxyDataObjectManager *)0x0;

+  pCVar3 = operator_new(0xd8);

+  if (pCVar3 != (CProxyDataObjectManager *)0x0) {

+    pCVar3 = (CProxyDataObjectManager *)CProxyDataObjectManager(pCVar3,param_1,param_2);

+    if (pCVar3 != (CProxyDataObjectManager *)0x0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+                ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)&local_res20);

+      local_res20 = pCVar3;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)&local_res20);

+      lVar1 = Initialize(pCVar3 + 8);

+      if (lVar1 < 0) {

+        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+            ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+        goto LAB_0;

+        uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar5 = 0xc;

+        pcVar4 = "Failed to initialize CProxyDataObjectManager!";

+      }

+      else {

+        if (param_3 != (CProxyDataObjectManager **)0x0) {

+          *param_3 = pCVar3;

+          if (pCVar3 != (CProxyDataObjectManager *)0x0) {

+            (**(code **)(**(longlong **)(pCVar3 + 0x20) + 8))();

+          }

+          lVar1 = 0;

+          goto LAB_0;

+        }

+        lVar1 = -0x7fffbffd;

+        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+            ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+        goto LAB_0;

+        uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar5 = 0xd;

+        lVar1 = -0x7fffbffd;

+        pcVar4 = "CopyTo ppProxyDataObjectManager failed!";

+      }

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar5,

+                 &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar2,pcVar4,lVar1);

+      goto LAB_0;

+    }

+  }

+  lVar1 = -0x7ff8fff2;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xe,

+             &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar2);

+  }

+LAB_0:

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)&local_res20);

+  return lVar1;

+}

+
```

## `DecompressRLEX`  (modified)

```diff
--- DecompressRLEX
+++ ClearDecompressor::DecodeTextBand
@@ -1,191 +1,2 @@
-

-/* long __cdecl DecompressRLEX(unsigned char const * __ptr64 & __ptr64,unsigned char const *

-   __ptr64,class PixelMap & __ptr64) */

-

-long __cdecl DecompressRLEX(uchar **param_1,uchar *param_2,PixelMap *param_3)

-

-{

-  uint *puVar1;

-  byte *pbVar2;

-  byte bVar3;

-  byte *pbVar4;

-  char cVar5;

-  char cVar6;

-  byte bVar7;

-  undefined4 uVar8;

-  undefined4 uVar9;

-  undefined4 uVar10;

-  uint *puVar11;

-  uint uVar12;

-  int iVar13;

-  uint *puVar14;

-  undefined **ppuVar15;

-  uint uVar16;

-  byte bVar17;

-  byte bVar18;

-  uint uVar19;

-  int iVar20;

-  uint *puVar21;

-  long lVar22;

-  byte bVar23;

-  undefined8 in_stack_ffffffffffffff98;

-  undefined8 uVar24;

-  uchar *puVar25;

-  undefined8 in_stack_ffffffffffffffa0;

-  

-  uVar10 = (undefined4)((ulonglong)in_stack_ffffffffffffffa0 >> 0x20);

-  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffff98 >> 0x20);

-  pbVar4 = *param_1;

-  if ((param_2 <= pbVar4) || (*(int *)(param_3 + 8) < 0)) {

-    return -0x7ff8ffa9;

-  }

-  bVar3 = *pbVar4;

-  *param_1 = pbVar4 + 1;

-  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-      ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])

-     ) {

-    uVar8 = RdpX_GetActivityIdPrefix();

-    uVar24 = CONCAT44(uVar9,(uint)bVar3);

-    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x10,

-              &WPP_0d370e1277e036cd761f55ce6c53ee1e_Traceguids,uVar8,uVar24);

-    uVar9 = (undefined4)((ulonglong)uVar24 >> 0x20);

-  }

-  ppuVar15 = (undefined **)WPP_GLOBAL_Control;

-  if (bVar3 < 0x80) {

-    puVar25 = *param_1;

-    if (param_2 < puVar25 + ((uint)bVar3 + (uint)bVar3 * 2)) {

-      return -0x7ff8ff86;

-    }

-    *param_1 = puVar25 + ((uint)bVar3 + (uint)bVar3 * 2);

-    uVar12 = bVar3 - 1;

-    lVar22 = 0;

-    uVar12 = uVar12 | uVar12 >> 1;

-    bVar17 = 0;

-    uVar12 = uVar12 | uVar12 >> 2;

-    bVar18 = 0;

-    iVar20 = 0;

-    uVar12 = uVar12 | uVar12 >> 4;

-    uVar16 = 0;

-    uVar12 = uVar12 | uVar12 >> 8;

-    uVar12 = uVar12 >> 0x10 | uVar12;

-    uVar12 = (uVar12 >> 1 & 0x55555555) + (uVar12 & 0x55555555);

-    uVar12 = (uVar12 >> 2 & 0x33333333) + (uVar12 & 0x33333333);

-    uVar12 = (uVar12 >> 4) + uVar12 & 0xf0f0f0f;

-    iVar13 = uVar12 + (uVar12 >> 8);

-    cVar5 = (char)iVar13;

-    cVar6 = (char)((uint)iVar13 >> 0x10);

-    bVar7 = ('\x01' << (cVar5 + cVar6 & 0x1fU)) - 1;

-    bVar23 = 0;

-    if (((ppuVar15 != &WPP_GLOBAL_Control) && ((*(uint *)((longlong)ppuVar15 + 0x1c) & 0x100) != 0))

-       && (4 < *(byte *)((longlong)ppuVar15 + 0x19))) {

-      uVar8 = RdpX_GetActivityIdPrefix();

-      uVar24 = CONCAT44(uVar9,(uint)bVar7);

-      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x11,

-                &WPP_0d370e1277e036cd761f55ce6c53ee1e_Traceguids,uVar8,uVar24);

-      uVar9 = (undefined4)((ulonglong)uVar24 >> 0x20);

-      ppuVar15 = (undefined **)WPP_GLOBAL_Control;

-    }

-    puVar21 = *(uint **)(param_3 + 0x18);

-    puVar11 = (uint *)((ulonglong)(uint)(*(int *)(param_3 + 4) * *(int *)(param_3 + 8)) +

-                      (longlong)puVar21);

-    do {

-      if (puVar11 <= puVar21) {

-        puVar25 = *param_1;

-        if (puVar25 != param_2) {

-          lVar22 = -0x7ff8ffa9;

-          if (ppuVar15 == &WPP_GLOBAL_Control) {

-            return -0x7ff8ffa9;

-          }

-          if (((*(uint *)((longlong)ppuVar15 + 0x1c) & 0x100) != 0) &&

-             (1 < *(byte *)((longlong)ppuVar15 + 0x19))) {

-            uVar9 = RdpX_GetActivityIdPrefix();

-            WPP_SF_Dqq(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x14,

-                       &WPP_0d370e1277e036cd761f55ce6c53ee1e_Traceguids,uVar9,puVar25,param_2);

-            uVar9 = (undefined4)((ulonglong)puVar25 >> 0x20);

-            ppuVar15 = (undefined **)WPP_GLOBAL_Control;

-          }

-        }

-        if (((ppuVar15 != &WPP_GLOBAL_Control) &&

-            ((*(uint *)((longlong)ppuVar15 + 0x1c) & 0x100) != 0)) &&

-           (4 < *(byte *)((longlong)ppuVar15 + 0x19))) {

-          uVar10 = RdpX_GetActivityIdPrefix();

-          WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x15,

-                    &WPP_0d370e1277e036cd761f55ce6c53ee1e_Traceguids,uVar10,

-                    CONCAT44(uVar9,(uint)bVar23));

-        }

-        return lVar22;

-      }

-      uVar12 = *(uint *)param_3;

-      for (puVar14 = puVar21; puVar14 < puVar21 + uVar12; puVar14 = puVar14 + 1) {

-        if (iVar20 == 0) {

-          if (bVar17 == 0) {

-            pbVar4 = *param_1;

-            bVar23 = bVar23 + 1;

-            if (param_2 < pbVar4 + 2) {

-              return -0x7ff8ff86;

-            }

-            bVar18 = *pbVar4 & bVar7;

-            bVar17 = *pbVar4 >> (cVar5 + cVar6 & 0x1fU);

-            *param_1 = pbVar4 + 1;

-            if ((bVar3 <= bVar18) || (bVar18 < bVar17)) {

-              if ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) {

-                if (((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0) &&

-                   (1 < (byte)WPP_GLOBAL_Control[0x19])) {

-                  uVar8 = RdpX_GetActivityIdPrefix();

-                  uVar24 = CONCAT44(uVar9,(uint)bVar18);

-                  WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x12,

-                             &WPP_0d370e1277e036cd761f55ce6c53ee1e_Traceguids,uVar8,uVar24,

-                             CONCAT44(uVar10,(uint)bVar17));

-                  uVar9 = (undefined4)((ulonglong)uVar24 >> 0x20);

-                }

-                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-                    ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) &&

-                   (1 < (byte)WPP_GLOBAL_Control[0x19])) {

-                  uVar10 = RdpX_GetActivityIdPrefix();

-                  WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x13,

-                            &WPP_0d370e1277e036cd761f55ce6c53ee1e_Traceguids,uVar10,

-                            CONCAT44(uVar9,(uint)bVar23));

-                }

-              }

-              return -0x7ff8ffa9;

-            }

-            uVar19 = (uint)pbVar4[1];

-            bVar18 = bVar18 - bVar17;

-            pbVar2 = puVar25 + (ulonglong)bVar18 * 3;

-            uVar16 = ((pbVar2[2] | 0xffffff00) << 8 | (uint)pbVar2[1]) << 8 | (uint)*pbVar2;

-            *param_1 = pbVar4 + 2;

-            if (uVar19 == 0xff) {

-              puVar1 = (uint *)(pbVar4 + 4);

-              if (param_2 < puVar1) {

-                return -0x7ff8ff86;

-              }

-              uVar19 = (uint)*(ushort *)(pbVar4 + 2);

-              *param_1 = (uchar *)puVar1;

-              if (uVar19 == 0xffff) {

-                if (param_2 < pbVar4 + 8) {

-                  return -0x7ff8ff86;

-                }

-                uVar19 = *puVar1;

-                *param_1 = pbVar4 + 8;

-              }

-            }

-          }

-          else {

-            bVar18 = bVar18 + 1;

-            bVar17 = bVar17 - 1;

-            pbVar4 = puVar25 + (ulonglong)bVar18 * 3;

-            uVar16 = ((pbVar4[2] | 0xffffff00) << 8 | (uint)pbVar4[1]) << 8 | (uint)*pbVar4;

-            uVar19 = 0;

-          }

-          iVar20 = uVar19 + 1;

-        }

-        *puVar14 = uVar16;

-        iVar20 = iVar20 + -1;

-      }

-      puVar21 = (uint *)((longlong)puVar21 + (longlong)*(int *)(param_3 + 8));

-      ppuVar15 = (undefined **)WPP_GLOBAL_Control;

-    } while( true );

-  }

-  return -0x7ff8ffa9;

-}

-

+Failed to decompile mstscax.dll - .ProgramDB ClearDecompressor::DecodeTextBand : Error: Decompile error: 
+Marshaling error: Did not see expected closing element
```

## `CRdpAudioController::GetDataConsumedByAudioDevice`  (modified)

```diff
--- CRdpAudioController::GetDataConsumedByAudioDevice
+++ CRdpAudioController::GetDataConsumedByAudioDevice
@@ -1,2 +1,121 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdpAudioController::GetDataConsumedByAudioDevice : 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 CRdpAudioController::GetDataConsumedByAudioDevice(unsigned long *

+   __ptr64) __ptr64 */

+

+long __thiscall

+CRdpAudioController::GetDataConsumedByAudioDevice(CRdpAudioController *this,ulong *param_1)

+

+{

+  uint uVar1;

+  uint uVar2;

+  char cVar3;

+  undefined4 uVar4;

+  int iVar5;

+  undefined4 uVar6;

+  ulong uVar7;

+  longlong *plVar8;

+  uint local_res10 [2];

+  longlong *local_res18;

+  CTSCriticalSection *local_res20;

+  undefined8 in_stack_ffffffffffffffb8;

+  undefined4 uVar10;

+  undefined8 uVar9;

+  

+  uVar10 = (undefined4)((ulonglong)in_stack_ffffffffffffffb8 >> 0x20);

+  local_res10[0] = 0;

+  local_res18 = (longlong *)0x0;

+  if (param_1 == (ulong *)0x0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpX_GetActivityIdPrefix();

+      uVar10 = 1;

+      WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x33,

+                &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar4,"pdwDataConsumed");

+    }

+    iVar5 = -0x7fffbffd;

+  }

+  else {

+    *param_1 = 0;

+    cVar3 = MSRC108255UseKIR();

+    if (cVar3 == '\0') {

+      plVar8 = *(longlong **)(this + 0x100c8);

+      if (plVar8 != (longlong *)0x0) goto LAB_0;

+      iVar5 = -0x7fffbffb;

+    }

+    else {

+      local_res20 = (CTSCriticalSection *)(this + 0x10148);

+      CTSCriticalSection::Lock(local_res20);

+      RdpXSPtr<RdpXInterfaceTapProtocolServerEvents>::operator=

+                ((RdpXSPtr<RdpXInterfaceTapProtocolServerEvents> *)&local_res18,

+                 (RdpXSPtr<struct_RdpXInterfaceTapProtocolServerEvents> *)(this + 0x100c8));

+      CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res20);

+      plVar8 = local_res18;

+      if (local_res18 == (longlong *)0x0) {

+        iVar5 = -0x7fffbffb;

+      }

+      else {

+LAB_0:

+        iVar5 = (**(code **)(*plVar8 + 0x58))(plVar8,local_res10);

+      }

+      uVar1 = local_res10[0];

+      if (-1 < iVar5) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+           (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar4 = *(undefined4 *)(this + 0x10108);

+          uVar6 = RdpX_GetActivityIdPrefix();

+          uVar9 = CONCAT44(uVar10,uVar1);

+          WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x34,

+                     &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar6,uVar9,uVar4);

+          uVar10 = (undefined4)((ulonglong)uVar9 >> 0x20);

+        }

+        uVar2 = local_res10[0];

+        uVar1 = *(uint *)(this + 0x10100);

+        if (local_res10[0] < uVar1) {

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+             (2 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar4 = RdpX_GetActivityIdPrefix();

+            uVar9 = CONCAT44(uVar10,uVar2);

+            WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x35,

+                       &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar4,uVar9,uVar1);

+            uVar10 = (undefined4)((ulonglong)uVar9 >> 0x20);

+          }

+          uVar7 = (local_res10[0] - *(int *)(this + 0x10100)) - 1;

+        }

+        else {

+          uVar7 = local_res10[0] - uVar1;

+        }

+        *param_1 = uVar7;

+        *(uint *)(this + 0x10100) = local_res10[0];

+        goto LAB_1;

+      }

+    }

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) goto LAB_2;

+    if (((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0) &&

+       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = *(undefined4 *)(this + 0x10140);

+      uVar6 = RdpX_GetActivityIdPrefix();

+      uVar9 = CONCAT44(uVar10,iVar5);

+      WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x36,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar6,uVar9,uVar4);

+      uVar10 = (undefined4)((ulonglong)uVar9 >> 0x20);

+    }

+  }

+LAB_1:

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])

+     ) {

+    uVar7 = *param_1;

+    uVar4 = RdpX_GetActivityIdPrefix();

+    WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x37,

+               &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar4,CONCAT44(uVar10,iVar5),uVar7);

+  }

+LAB_2:

+  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)&local_res18);

+  return iVar5;

+}

+
```

## `AlphaDecompressor::DecompressInternal`  (modified)

```diff
--- AlphaDecompressor::DecompressInternal
+++ AlphaDecompressor::DecompressInternal
@@ -1,2 +1,185 @@
-Failed to decompile mstscax.dll - .ProgramDB AlphaDecompressor::DecompressInternal : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl AlphaDecompressor::DecompressInternal(struct RDP_BITMAP_INFO const *

+   __ptr64,unsigned char const * __ptr64,unsigned int,unsigned char * __ptr64,unsigned int) __ptr64

+    */

+

+long __thiscall

+AlphaDecompressor::DecompressInternal

+          (AlphaDecompressor *this,RDP_BITMAP_INFO *param_1,uchar *param_2,uint param_3,

+          uchar *param_4,uint param_5)

+

+{

+  uchar *puVar1;

+  bool bVar2;

+  undefined4 uVar3;

+  undefined4 uVar4;

+  long lVar5;

+  uchar *puVar6;

+  undefined8 uVar7;

+  uchar *puVar8;

+  byte bVar9;

+  uint uVar10;

+  uint uVar11;

+  uint uVar12;

+  uint uVar13;

+  uchar *puVar14;

+  uint uVar15;

+  uint uVar17;

+  undefined8 in_stack_ffffffffffffff88;

+  uchar *local_58;

+  undefined8 local_50;

+  undefined8 local_48;

+  undefined8 local_40;

+  undefined8 uStack_38;

+  uint uVar16;

+  

+  uVar4 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);

+  local_50 = 0;

+  local_48 = 0;

+  uVar17 = 10;

+  local_40 = 0;

+  uStack_38 = 0;

+  if ((*(int *)(param_1 + 0x10) == 0xf) ||

+     ((bVar9 = (char)*(int *)(param_1 + 0x10) + 1U & 0xf8, bVar9 != 0x20 && (bVar9 != 8)))) {

+    if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+       (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+      uVar3 = RdpX_GetActivityIdPrefix();

+      uVar7 = 0xb;

+LAB_0:

+      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar7,

+                &WPP_3b2bb279df80363bfcdae6c01f5a6a78_Traceguids,uVar3,CONCAT44(uVar4,0x80070057));

+    }

+LAB_1:

+    lVar5 = -0x7ff8ffa9;

+  }

+  else {

+    bVar2 = SetPixelMapInternal((PixelMap *)&local_50,param_1,param_4,param_5);

+    if (!bVar2) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar3 = RdpX_GetActivityIdPrefix();

+        uVar7 = 0xc;

+        goto LAB_0;

+      }

+      goto LAB_1;

+    }

+    puVar1 = param_2 + param_3;

+    uVar10 = -(uint)(bVar9 != 8) & 3;

+    uVar13 = *(int *)(param_1 + 0x10) + 1 >> 3 & 0xff;

+    if (3 < uVar13 - 1) {

+      PixelMap::~PixelMap((PixelMap *)&local_50);

+      return -0x7ff8ffa9;

+    }

+    uVar11 = *(uint *)(param_1 + 0xc);

+    uVar12 = *(uint *)(param_1 + 8);

+    uVar15 = -uVar11;

+    if ((int)-uVar11 < 0) {

+      uVar15 = uVar11;

+    }

+    if (((uint)(0x7fffffff / (ulonglong)uVar12) < uVar15) || (param_5 < uVar15 * uVar12)) {

+      if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+         (((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0 &&

+          (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+        uVar4 = RdpX_GetActivityIdPrefix(WPP_GLOBAL_Control,0x7fffffff % (ulonglong)uVar12);

+        uVar7 = 0xd;

+LAB_2:

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar7,

+                 &WPP_3b2bb279df80363bfcdae6c01f5a6a78_Traceguids,uVar4);

+      }

+      goto LAB_1;

+    }

+    uVar15 = 0xb;

+    uVar16 = 0xb;

+    uVar17 = uVar15;

+    if (param_3 < 4) {

+      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),0xe,

+                &WPP_3b2bb279df80363bfcdae6c01f5a6a78_Traceguids);

+        uVar17 = uVar16;

+      }

+      goto LAB_1;

+    }

+    local_58 = param_2 + 4;

+    if (*(short *)param_2 != 0x414c) {

+      uVar17 = uVar16;

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) &&

+         (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpX_GetActivityIdPrefix();

+        uVar7 = 0xf;

+        uVar17 = uVar15;

+        goto LAB_2;

+      }

+      goto LAB_1;

+    }

+    if (*(short *)(param_2 + 2) != 1) {

+      uVar11 = *(uint *)(param_1 + 4);

+      uVar17 = 0xd;

+      if (local_58 + uVar11 * uVar12 <= puVar1) {

+        uVar15 = 0;

+        puVar8 = local_58;

+        if (uVar12 != 0) {

+          puVar14 = param_4;

+          do {

+            uVar12 = 0;

+            puVar6 = puVar14 + uVar10;

+            if (uVar11 != 0) {

+              do {

+                if ((puVar6 < param_4) || (param_4 + param_5 <= puVar6)) goto LAB_1;

+                uVar12 = uVar12 + 1;

+                *puVar6 = *puVar8;

+                puVar8 = puVar8 + 1;

+                uVar11 = *(uint *)(param_1 + 4);

+                puVar6 = puVar6 + (int)uVar13;

+              } while (uVar12 < uVar11);

+            }

+            uVar15 = uVar15 + 1;

+            puVar14 = puVar14 + *(int *)(param_1 + 0xc);

+          } while (uVar15 < *(uint *)(param_1 + 8));

+        }

+        lVar5 = 0;

+        goto LAB_3;

+      }

+      goto LAB_1;

+    }

+    uVar17 = 0xc;

+    lVar5 = ChannelRunLengthDecode

+                      (&local_58,puVar1,param_4,*(int *)(param_1 + 4),uVar12,uVar11,uVar13,uVar10);

+    puVar8 = local_58;

+    if (-1 < lVar5) {

+LAB_3:

+      uVar17 = 0xe;

+      if (puVar8 == puVar1) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) &&

+           (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar3 = RdpX_GetActivityIdPrefix();

+          WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x12,

+                    &WPP_3b2bb279df80363bfcdae6c01f5a6a78_Traceguids,uVar3,CONCAT44(uVar4,param_3));

+        }

+        goto LAB_4;

+      }

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x100) != 0)) &&

+         (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpX_GetActivityIdPrefix();

+        uVar7 = 0x11;

+        goto LAB_2;

+      }

+      goto LAB_1;

+    }

+    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),0x10,

+                 &WPP_3b2bb279df80363bfcdae6c01f5a6a78_Traceguids,uVar4,

+                 "ChannelRunLengthDecode failed",lVar5);

+    }

+  }

+  LogError(this,uVar17,lVar5);

+LAB_4:

+  PixelMap::~PixelMap((PixelMap *)&local_50);

+  return lVar5;

+}

+
```

## `CProxyStream::OnManagerTerminating`  (modified)

```diff
--- CProxyStream::OnManagerTerminating
+++ CProxyStream::OnManagerTerminating
@@ -1,2 +1,36 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyStream::OnManagerTerminating : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: void __cdecl CProxyStream::OnManagerTerminating(void) __ptr64 */

+

+void __thiscall CProxyStream::OnManagerTerminating(CProxyStream *this)

+

+{

+  undefined4 uVar1;

+  undefined4 uVar2;

+  undefined4 uVar3;

+  bool bVar4;

+  uint uVar5;

+  

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar1 = *(undefined4 *)(this + 0xb4);

+    uVar2 = *(undefined4 *)(this + 0x9c);

+    uVar3 = *(undefined4 *)(this + 0x68);

+    uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DdDd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x2c,

+                &WPP_0590a41147183e8365b9646d033b00c8_Traceguids,uVar5,uVar3,uVar2,uVar1);

+  }

+  bVar4 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3624641849>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar4) {

+    EnterCriticalSection((LPCRITICAL_SECTION)(this + 0x40));

+    *(undefined8 *)(this + 0x38) = 0;

+    LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x40));

+  }

+  else {

+    *(undefined8 *)(this + 0x38) = 0;

+  }

+  return;

+}

+
```

## `CProxyStreamManager::CreateInstance`  (modified)

```diff
--- CProxyStreamManager::CreateInstance
+++ CProxyStreamManager::CreateInstance
@@ -1,2 +1,72 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyStreamManager::CreateInstance : 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: static long __cdecl CProxyStreamManager::CreateInstance(class IStreamDataAcquire *

+   __ptr64,class CProxyStreamManager * __ptr64 * __ptr64) */

+

+long __cdecl

+CProxyStreamManager::CreateInstance(IStreamDataAcquire *param_1,CProxyStreamManager **param_2)

+

+{

+  long lVar1;

+  uint uVar2;

+  CProxyStreamManager *pCVar3;

+  char *pcVar4;

+  undefined4 uVar5;

+  CProxyStreamManager *local_res18 [2];

+  

+  local_res18[0] = (CProxyStreamManager *)0x0;

+  pCVar3 = operator_new(0xc0);

+  if (pCVar3 != (CProxyStreamManager *)0x0) {

+    pCVar3 = (CProxyStreamManager *)CProxyStreamManager(pCVar3,param_1);

+    if (pCVar3 != (CProxyStreamManager *)0x0) {

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+                ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)local_res18);

+      local_res18[0] = pCVar3;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)local_res18);

+      lVar1 = Initialize(pCVar3 + 8);

+      if (lVar1 < 0) {

+        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+            ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+        goto LAB_0;

+        uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar5 = 0xc;

+        pcVar4 = "Failed to initialize CProxyStreamManager!";

+      }

+      else {

+        if (param_2 != (CProxyStreamManager **)0x0) {

+          *param_2 = pCVar3;

+          if (pCVar3 != (CProxyStreamManager *)0x0) {

+            (**(code **)(**(longlong **)(pCVar3 + 0x20) + 8))();

+          }

+          lVar1 = 0;

+          goto LAB_0;

+        }

+        lVar1 = -0x7fffbffd;

+        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+            ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+        goto LAB_0;

+        uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar5 = 0xd;

+        lVar1 = -0x7fffbffd;

+        pcVar4 = "CopyTo ppProxyStreamManager failed!";

+      }

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar5,

+                 &WPP_0590a41147183e8365b9646d033b00c8_Traceguids,uVar2,pcVar4,lVar1);

+      goto LAB_0;

+    }

+  }

+  lVar1 = -0x7ff8fff2;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xe,

+             &WPP_0590a41147183e8365b9646d033b00c8_Traceguids,uVar2);

+  }

+LAB_0:

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)local_res18);

+  return lVar1;

+}

+
```

## `CHdropToFgdConverter::AddItemToFgd`  (modified)

```diff
--- CHdropToFgdConverter::AddItemToFgd
+++ CProxyDataObjectManager::CProxyDataObjectManager
@@ -1,2 +1,2 @@
-Failed to decompile mstscax.dll - .ProgramDB CHdropToFgdConverter::AddItemToFgd : Error: Decompile error: 
+Failed to decompile mstscax.dll - .ProgramDB CProxyDataObjectManager::CProxyDataObjectManager : Error: Decompile error: 
 Marshaling error: Did not see expected closing element
```

## `RdpRemoteAppCore::OnChannelEstablished`  (modified)

```diff
--- RdpRemoteAppCore::OnChannelEstablished
+++ RdpRemoteAppCore::OnChannelEstablished
@@ -1,2 +1,95 @@
-Failed to decompile mstscax.dll - .ProgramDB RdpRemoteAppCore::OnChannelEstablished : 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 RdpRemoteAppCore::OnChannelEstablished(unsigned long,unsigned long)

+   __ptr64 */

+

+long __thiscall

+RdpRemoteAppCore::OnChannelEstablished(RdpRemoteAppCore *this,ulong param_1,ulong param_2)

+

+{

+  undefined4 uVar1;

+  long lVar2;

+  int iVar3;

+  char *pcVar4;

+  undefined8 uVar5;

+  RdpRemoteAppCore *this_00;

+  undefined8 local_res8;

+  undefined8 in_stack_ffffffffffffffd8;

+  

+  uVar1 = (undefined4)((ulonglong)in_stack_ffffffffffffffd8 >> 0x20);

+  local_res8 = 0;

+  iVar3 = (**(code **)(**(longlong **)(this + 0x68) + 0xa0))

+                    (*(longlong **)(this + 0x68),&local_res8);

+  if (iVar3 < 0) {

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_0;

+    uVar1 = RdpX_GetActivityIdPrefix();

+    uVar5 = 0x136;

+    pcVar4 = "Failed to get the core Api";

+  }

+  else {

+    LogRemoteAppEventF(this + 0x10,

+                       (ushort *)L"CapsConfirmRailOrderReceived: MaxPduType=0x%x, Flags=0x%x",0,

+                       (ulonglong)param_1,CONCAT44(uVar1,param_2));

+    if ((param_2 & 1) != 0) {

+      *(undefined4 *)(this + 0xb0) = 0;

+      *(undefined4 *)(this + 0xc0) = 0;

+      if (*(longlong *)(this + 0x78) != 0) {

+        *(uint *)(this + 0xa0) = *(uint *)(this + 0xa0) & 0xfffffdef;

+      }

+      LogRemoteAppEventInternal(this + -0x30,10);

+    }

+    this_00 = this + -0x30;

+    if (*(int *)(this + 0xcc) == 0) {

+      lVar2 = SetV2CoreProperty(this_00,1);

+      if ((((lVar2 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar1 = RdpX_GetActivityIdPrefix();

+        uVar5 = 0x139;

+LAB_1:

+        WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar5,

+                   &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar1,

+                   "Failed to set the V2 core property",lVar2);

+      }

+    }

+    else if ((param_2 & 2) == 0) {

+      lVar2 = SetV2CoreProperty(this_00,2);

+      if (((lVar2 < 0) && ((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),0x138,

+                   &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar1,

+                   "Failed to set the V2 core property",lVar2);

+      }

+      *(undefined4 *)(this + 0xcc) = 0;

+    }

+    else {

+      lVar2 = SetV2CoreProperty(this_00,3);

+      if (((lVar2 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+         (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+        uVar1 = RdpX_GetActivityIdPrefix();

+        uVar5 = 0x137;

+        goto LAB_1;

+      }

+    }

+    iVar3 = OnHandshakeOrCaps(this_00,0);

+    if (-1 < iVar3) {

+      iVar3 = 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;

+    uVar1 = RdpX_GetActivityIdPrefix();

+    uVar5 = 0x13a;

+    pcVar4 = "OnHandshakeOrCaps failed";

+  }

+  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar5,

+             &WPP_f1fc68a2768b3b5b3c1efafcb8f7d719_Traceguids,uVar1,pcVar4,iVar3);

+LAB_0:

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res8);

+  return iVar3;

+}

+
```

## `CHdropToFgdConverter::ClearFgdCache`  (modified)

```diff
--- CHdropToFgdConverter::ClearFgdCache
+++ CProxyDataObject::~CProxyDataObject
@@ -1,22 +1,115 @@
 

 /* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

    guard_dispatch_icall */

-/* public: void __cdecl CHdropToFgdConverter::ClearFgdCache(void) __ptr64 */

+/* protected: virtual __cdecl CProxyDataObject::~CProxyDataObject(void) __ptr64 */

 

-void __thiscall CHdropToFgdConverter::ClearFgdCache(CHdropToFgdConverter *this)

+void __thiscall CProxyDataObject::~CProxyDataObject(CProxyDataObject *this)

 

 {

-  if (*(HLOCAL *)this != (HLOCAL)0x0) {

-    LocalFree(*(HLOCAL *)this);

-    *(undefined8 *)this = 0;

+  undefined4 uVar1;

+  CProxyDataObjectManager *this_00;

+  longlong *plVar2;

+  HLOCAL pvVar3;

+  HLOCAL hMem;

+  bool bVar4;

+  uint uVar5;

+  CProxyDataObjectManager *local_res8;

+  

+  *(undefined ***)this = &_vftable__for__INonDelegatingUnknown__;

+  *(undefined ***)(this + 8) = &_vftable__for__CTSObject__;

+  *(undefined ***)(this + 0x30) = &_vftable__for__IDataObject__;

+  *(undefined ***)(this + 0x38) = &_vftable__for__IRdpProxyDataObject__;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar1 = *(undefined4 *)(this + 0x104);

+    uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x29,

+              &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar5,uVar1);

   }

-  if (*(HLOCAL *)(this + 8) != (HLOCAL)0x0) {

-    LocalFree(*(HLOCAL *)(this + 8));

-    *(undefined8 *)(this + 8) = 0;

+  if (*(int *)(this + 0x104) != -1) {

+    bVar4 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3624641849>::GetImpl(void)'

+                        ::__l2::impl);

+    if (bVar4) {

+      EnterCriticalSection((LPCRITICAL_SECTION)(this + 0x50));

+      this_00 = *(CProxyDataObjectManager **)(this + 0x48);

+      local_res8 = this_00;

+      TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)&local_res8);

+      LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x50));

+      if (this_00 == (CProxyDataObjectManager *)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),0x2a,

+                   &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar5);

+        }

+      }

+      else {

+        CProxyDataObjectManager::UnregisterAndCleanupDataObjectForTracking

+                  (this_00,*(ulong *)(this + 0x104));

+      }

+      TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+                ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)&local_res8);

+    }

+    else if ((*(longlong *)(this + 0x48) == 0) ||

+            (plVar2 = *(longlong **)(*(longlong *)(this + 0x48) + 0x60), plVar2 == (longlong *)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),0x2b,

+                 &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar5);

+      }

+    }

+    else {

+      (**(code **)(*plVar2 + 0x38))(plVar2,*(undefined4 *)(this + 0x104));

+      CProxyDataObjectManager::ReleaseUniqueId

+                (*(CProxyDataObjectManager **)(this + 0x48),*(ulong *)(this + 0x104));

+    }

   }

-  if (*(longlong **)(this + 0x18) != (longlong *)0x0) {

-    (**(code **)(**(longlong **)(this + 0x18) + 0x50))();

+  ReleaseStgMedium((LPSTGMEDIUM)(this + 0x78));

+  *(undefined8 *)(this + 0x78) = 0;

+  *(undefined8 *)(this + 0x80) = 0;

+  *(undefined8 *)(this + 0x88) = 0;

+  ReleaseStgMedium((LPSTGMEDIUM)(this + 0x90));

+  *(undefined8 *)(this + 0x90) = 0;

+  *(undefined8 *)(this + 0x98) = 0;

+  *(undefined8 *)(this + 0xa0) = 0;

+  ReleaseStgMedium((LPSTGMEDIUM)(this + 0xa8));

+  *(undefined8 *)(this + 0xa8) = 0;

+  *(undefined8 *)(this + 0xb0) = 0;

+  *(undefined8 *)(this + 0xb8) = 0;

+  ReleaseStgMedium((LPSTGMEDIUM)(this + 0xc0));

+  *(undefined8 *)(this + 0xc0) = 0;

+  *(undefined8 *)(this + 200) = 0;

+  *(undefined8 *)(this + 0xd0) = 0;

+  ReleaseStgMedium((LPSTGMEDIUM)(this + 0xd8));

+  *(undefined8 *)(this + 0xd8) = 0;

+  *(undefined8 *)(this + 0xe0) = 0;

+  *(undefined8 *)(this + 0xe8) = 0;

+  hMem = *(HLOCAL *)(this + 0xf0);

+  while (hMem != (HLOCAL)0x0) {

+    pvVar3 = *(HLOCAL *)((longlong)hMem + 0x20);

+    LocalFree(hMem);

+    hMem = pvVar3;

   }

+  *(undefined8 *)(this + 0xf0) = 0;

+  *(undefined8 *)(this + 0xf8) = 0;

+  *(undefined4 *)(this + 0x100) = 0;

+  *(undefined8 *)(this + 0x48) = 0;

+  bVar4 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3624641849>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar4) {

+    DeleteCriticalSection((LPCRITICAL_SECTION)(this + 0x50));

+  }

+  *(uint *)(this + 0x1c) = *(uint *)(this + 0x1c) | 4;

+  *(undefined ***)this = CTSUnknown::vftable_for_INonDelegatingUnknown_;

+  *(uint *)(this + 0x1c) = *(uint *)(this + 0x1c) | 8;

+  *(undefined ***)(this + 8) = CTSObject::vftable;

   return;

 }
```

## `PlanarDecompressor::Decompress`  (modified)

```diff
--- PlanarDecompressor::Decompress
+++ PlanarDecompressor::Decompress
@@ -1,2 +1,280 @@
-Failed to decompile mstscax.dll - .ProgramDB PlanarDecompressor::Decompress : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl PlanarDecompressor::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

+PlanarDecompressor::Decompress

+          (PlanarDecompressor *this,RDP_COMPRESSION_PARAMETERS *param_1,RDP_BITMAP_INFO *param_2,

+          uchar *param_3,uint param_4,uchar *param_5,uint param_6)

+

+{

+  ushort uVar1;

+  uint uVar2;

+  int iVar3;

+  int iVar4;

+  bool bVar5;

+  undefined4 uVar6;

+  uint uVar7;

+  undefined4 uVar8;

+  long lVar9;

+  uint uVar10;

+  uint uVar11;

+  char *pcVar12;

+  undefined8 uVar13;

+  PixelMap *pPVar14;

+  char cVar15;

+  byte bVar16;

+  byte bVar17;

+  ushort uVar18;

+  uint uVar19;

+  int iVar20;

+  PlanarDecompressor *local_res18;

+  uchar *local_res20;

+  undefined8 in_stack_ffffffffffffff08;

+  undefined8 in_stack_ffffffffffffff10;

+  uchar *puVar21;

+  uchar local_88 [2];

+  ushort local_86;

+  ushort local_84;

+  int local_80 [2];

+  int local_78 [8];

+  undefined8 local_58;

+  undefined8 local_50;

+  undefined8 local_48;

+  undefined8 uStack_40;

+  

+  uVar8 = (undefined4)((ulonglong)in_stack_ffffffffffffff10 >> 0x20);

+  local_78[0] = 0;

+  local_78[1] = 0;

+  local_78[2] = 0;

+  local_78[3] = 0;

+  local_58 = 0;

+  local_50 = 0;

+  local_78[4] = 0;

+  local_78[5] = 0;

+  local_78[6] = 0;

+  local_78[7] = 0;

+  local_48 = 0;

+  uStack_40 = 0;

+  local_res20 = param_3;

+  if (param_2 == (RDP_BITMAP_INFO *)0x0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar6 = RdpX_GetActivityIdPrefix();

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x17,

+                 &WPP_a8adb151b25432f5001e7825cc13b459_Traceguids,uVar6,"pBitmapInfo",

+                 CONCAT44(uVar8,0x80004003));

+    }

+    lVar9 = -0x7fffbffd;

+    goto LAB_0;

+  }

+  local_84 = *(ushort *)(param_2 + 4);

+  uVar1 = *(ushort *)(param_2 + 8);

+  uVar10 = (uint)local_84;

+  uVar19 = *(uint *)(param_2 + 4);

+  local_86 = uVar1;

+  if (uVar10 == uVar19) {

+    uVar2 = *(uint *)(param_2 + 8);

+    uVar7 = (uint)uVar1;

+    if (uVar7 == uVar2) {

+      if (*(int *)(param_2 + 0x10) == 0xf) {

+        uVar11 = 0xf;

+      }

+      else {

+        uVar11 = *(int *)(param_2 + 0x10) + 1U & 0xf8;

+      }

+      uVar6 = (undefined4)((ulonglong)in_stack_ffffffffffffff08 >> 0x20);

+      bVar5 = PixelMap::Attach((PixelMap *)local_78,param_5,param_6,uVar19,uVar2,

+                               *(int *)(param_2 + 0xc),uVar11,0,0,uVar19,uVar2);

+      uVar13 = local_78._8_8_;

+      if (bVar5) {

+        iVar4 = local_78[3];

+        if (*(int *)(param_2 + 0xc) < 0) {

+          iVar3 = -local_78[2];

+          if (-local_78[2] < 0) {

+            iVar3 = local_78[2];

+          }

+          if (iVar3 != (local_78[3] + 1 >> 3 & 0xffU) * local_78[0]) goto LAB_1;

+        }

+        uVar19 = local_78[3] + 1;

+        pPVar14 = (PixelMap *)local_78;

+        iVar3 = -local_78[2];

+        if (-local_78[2] < 0) {

+          iVar3 = local_78[2];

+        }

+        iVar20 = ((int)uVar19 >> 3 & 0xffU) * local_78[0];

+        if (iVar3 == iVar20) {

+LAB_2:

+          iVar3 = -*(int *)(pPVar14 + 8);

+          if (-*(int *)(pPVar14 + 8) < 0) {

+            iVar3 = *(int *)(pPVar14 + 8);

+          }

+          if (iVar3 == (*(int *)(pPVar14 + 0xc) + 1 >> 3 & 0xffU) * *(int *)pPVar14) {

+            cVar15 = SUB81(uVar13,4);

+            uVar18 = local_86;

+            if ((iVar4 == 0xf) || ((cVar15 + 1U & 0xf8) != 0x20)) {

+LAB_3:

+              if (iVar4 == 0xf) {

+                bVar17 = 0xf;

+              }

+              else {

+                bVar17 = cVar15 + 1U & 0xf8;

+              }

+              if (iVar4 == 0xf) {

+                bVar16 = 0xf;

+              }

+              else {

+                bVar16 = cVar15 + 1U & 0xf8;

+              }

+              lVar9 = Planar::BD_DecompressBitmap

+                                (local_res20,*(uchar **)(pPVar14 + 0x18),param_4,

+                                 iVar3 * *(int *)(pPVar14 + 4),1,bVar16,0,local_84,uVar18,

+                                 *(uchar **)(this + 0x48),*(uint *)(this + 0x50),

+                                 (uint)(bVar17 == 0x20),0,0,0,0,(ITSGraphicsSurface *)0x0,(int *)0x0

+                                );

+              if (-1 < lVar9) {

+                if ((pPVar14 != (PixelMap *)local_78) &&

+                   (bVar5 = PixelMap::CopyFrom((PixelMap *)local_78,pPVar14), !bVar5)) {

+                  if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                     (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))

+                     ) {

+                    uVar8 = RdpX_GetActivityIdPrefix();

+                    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x20,

+                              &WPP_a8adb151b25432f5001e7825cc13b459_Traceguids,uVar8,

+                              CONCAT44(uVar6,0x80004005));

+                  }

+                  lVar9 = -0x7fffbffb;

+                }

+                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;

+              uVar6 = RdpX_GetActivityIdPrefix();

+              uVar13 = 0x1f;

+              pcVar12 = "BD_DecompressBitmap failed";

+            }

+            else {

+              local_88[0] = '\0';

+              local_res18 = (PlanarDecompressor *)((ulonglong)local_res18 & 0xffffffffffffff00);

+              local_80[0] = 0;

+              if (iVar4 == 0xf) {

+                bVar17 = 0xf;

+              }

+              else {

+                bVar17 = cVar15 + 1U & 0xf8;

+              }

+              puVar21 = local_88;

+              lVar9 = Planar::BD_GetCompressionSettings

+                                (local_res20,param_4,1,bVar17,1,puVar21,(uchar *)&local_res18,

+                                 local_80);

+              uVar8 = (undefined4)((ulonglong)puVar21 >> 0x20);

+              if (lVar9 < 0) {

+                if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                    ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+                goto LAB_0;

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar13 = 0x1c;

+                pcVar12 = "BD_GetCompressionSettings failed";

+              }

+              else {

+                if (iVar4 == 0xf) {

+                  bVar17 = 0xf;

+                }

+                else {

+                  bVar17 = cVar15 + 1U & 0xf8;

+                }

+                uVar19 = Planar::BD_PlanarBitmapSize

+                                   (bVar17,(uint)((char)local_res18 != '\0'),local_84,uVar1,

+                                    local_80[0]);

+                if (uVar19 == 0) {

+                  lVar9 = -0x7ff8ffa9;

+                  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),0x1d,

+                            &WPP_a8adb151b25432f5001e7825cc13b459_Traceguids);

+                  }

+                  goto LAB_0;

+                }

+                lVar9 = EnsureBufferStorage((uchar **)(this + 0x48),(uint *)(this + 0x50),uVar19);

+                uVar18 = uVar1;

+                if (-1 < lVar9) goto LAB_3;

+                if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                    ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+                goto LAB_0;

+                uVar6 = RdpX_GetActivityIdPrefix();

+                uVar13 = 0x1e;

+                pcVar12 = "EnsureBufferStorage failed";

+              }

+            }

+LAB_4:

+            WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar13,

+                       &WPP_a8adb151b25432f5001e7825cc13b459_Traceguids,uVar6,pcVar12,

+                       CONCAT44(uVar8,lVar9));

+            goto LAB_0;

+          }

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar8 = RdpX_GetActivityIdPrefix();

+            uVar13 = 0x1b;

+LAB_5:

+            WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar13,

+                      &WPP_a8adb151b25432f5001e7825cc13b459_Traceguids,uVar8,

+                      CONCAT44(uVar6,0x8000ffff));

+          }

+        }

+        else {

+          local_res18 = this + 0x38;

+          lVar9 = EnsureBufferStorage((uchar **)local_res18,(uint *)(this + 0x40),

+                                      local_78[1] * iVar3);

+          if (lVar9 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+            goto LAB_0;

+            uVar6 = RdpX_GetActivityIdPrefix();

+            uVar13 = 0x19;

+            pcVar12 = "OOM allocating Planar decode buffer";

+            goto LAB_4;

+          }

+          if (iVar4 == 0xf) {

+            uVar19 = 0xf;

+          }

+          else {

+            uVar19 = uVar19 & 0xf8;

+          }

+          bVar5 = PixelMap::Attach((PixelMap *)&local_58,*(uchar **)local_res18,

+                                   *(uint *)(this + 0x40),uVar10,uVar7,iVar20,uVar19,0,0,uVar10,

+                                   uVar7);

+          if (bVar5) {

+            pPVar14 = (PixelMap *)&local_58;

+            goto LAB_2;

+          }

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar8 = RdpX_GetActivityIdPrefix();

+            uVar13 = 0x1a;

+            goto LAB_5;

+          }

+        }

+        lVar9 = -0x7fff0001;

+        goto LAB_0;

+      }

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar8 = RdpX_GetActivityIdPrefix();

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x18,

+                  &WPP_a8adb151b25432f5001e7825cc13b459_Traceguids,uVar8,CONCAT44(uVar6,0x80070057))

+        ;

+      }

+    }

+  }

+LAB_1:

+  lVar9 = -0x7ff8ffa9;

+LAB_0:

+  PixelMap::~PixelMap((PixelMap *)&local_58);

+  PixelMap::~PixelMap((PixelMap *)local_78);

+  return lVar9;

+}

+
```

## `CacNx::SurfaceDecoderCpu::Init`  (modified)

```diff
--- CacNx::SurfaceDecoderCpu::Init
+++ CacNx::SurfaceDecoderCpu::Init
@@ -1,2 +1,109 @@
-Failed to decompile mstscax.dll - .ProgramDB CacNx::SurfaceDecoderCpu::Init : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: long __cdecl CacNx::SurfaceDecoderCpu::Init(class CacNx::DecodingEngineCpu *

+   __ptr64,struct CacNx::SurfaceDecoderArgs const & __ptr64) __ptr64 */

+

+long __thiscall

+CacNx::SurfaceDecoderCpu::Init

+          (SurfaceDecoderCpu *this,DecodingEngineCpu *param_1,SurfaceDecoderArgs *param_2)

+

+{

+  int iVar1;

+  int iVar2;

+  bool bVar3;

+  long lVar4;

+  void *pvVar5;

+  undefined4 uVar6;

+  undefined8 uVar7;

+  size_t _Size;

+  wchar_t *pwVar8;

+  

+  lVar4 = SurfaceDecoder::init((SurfaceDecoder *)this,(DecodingEngine *)param_1,param_2);

+  if (lVar4 < 0) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return lVar4;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 4) == 0) goto LAB_0;

+    uVar7 = 10;

+    pwVar8 = L"\"Failed to initialize the surface decoder\"";

+LAB_1:

+    WPP_SF_SD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar7,

+              &WPP_e36ae2978b813d6ec27982507b887d1d_Traceguids,pwVar8,lVar4);

+  }

+  else {

+    *(DecodingEngineCpu **)(this + 0xd8) = param_1;

+    bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_2141685050>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_2141685050> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_2141685050>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_2141685050>::GetImpl(void)'

+                        ::__l2::impl);

+    if (bVar3) {

+      _Size = (longlong)*(int *)(param_2 + 4) * (longlong)*(int *)param_2 * 4;

+      if (_Size == 0) {

+        lVar4 = -0x7ff8ffa9;

+        if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+          return -0x7ff8ffa9;

+        }

+        if ((WPP_GLOBAL_Control[0x1c] & 4) == 0) goto LAB_0;

+        uVar7 = 0xb;

+        lVar4 = -0x7ff8ffa9;

+        pwVar8 = L"\"Frame buffer allocation size overflow or zero\"";

+        goto LAB_1;

+      }

+      free(*(void **)(this + 0xe0));

+    }

+    else {

+      iVar1 = *(int *)param_2;

+      iVar2 = *(int *)(param_2 + 4);

+      free(*(void **)(this + 0xe0));

+      _Size = (size_t)(iVar2 * iVar1 * 4);

+    }

+    pvVar5 = malloc(_Size);

+    *(void **)(this + 0xe0) = pvVar5;

+    if (pvVar5 == (void *)0x0) {

+      lVar4 = -0x7ff8fff2;

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return -0x7ff8fff2;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 4) == 0) goto LAB_0;

+      uVar6 = 0xc;

+    }

+    else {

+      if (*(longlong *)(this + 0xe8) != 0) {

+LAB_2:

+        if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+          return lVar4;

+        }

+        if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+          return lVar4;

+        }

+        if ((byte)WPP_GLOBAL_Control[0x19] < 4) {

+          return lVar4;

+        }

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xf,

+                &WPP_e36ae2978b813d6ec27982507b887d1d_Traceguids);

+        return lVar4;

+      }

+      pvVar5 = malloc((ulonglong)(uint)(*(int *)(this + 0x28) * *(int *)(this + 0x28)) *

+                      *(longlong *)(this + 0xb8));

+      free((void *)0x0);

+      *(void **)(this + 0xe8) = pvVar5;

+      if (pvVar5 != (void *)0x0) goto LAB_2;

+      lVar4 = -0x7ff8fff2;

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return -0x7ff8fff2;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 4) == 0) goto LAB_0;

+      uVar6 = 0xd;

+    }

+    lVar4 = -0x7ff8fff2;

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar6,

+            &WPP_e36ae2978b813d6ec27982507b887d1d_Traceguids);

+  }

+LAB_0:

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (2 < (byte)WPP_GLOBAL_Control[0x19])) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xe,

+             &WPP_e36ae2978b813d6ec27982507b887d1d_Traceguids,lVar4);

+  }

+  return lVar4;

+}

+
```

## `CProxyStream::CreateInstance`  (modified)

```diff
--- CProxyStream::CreateInstance
+++ CProxyStream::CreateInstance
@@ -1,2 +1,83 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyStream::CreateInstance : 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: static long __cdecl CProxyStream::CreateInstance(class CProxyStreamManager *

+   __ptr64,class CProxyDataObject * __ptr64,unsigned long,long,long,int,class CProxyStream * __ptr64

+   * __ptr64) */

+

+long __cdecl

+CProxyStream::CreateInstance

+          (CProxyStreamManager *param_1,CProxyDataObject *param_2,ulong param_3,long param_4,

+          long param_5,int param_6,CProxyStream **param_7)

+

+{

+  bool bVar1;

+  int iVar2;

+  uint uVar3;

+  CProxyStream *pCVar4;

+  undefined8 uVar5;

+  long lVar6;

+  CProxyStream *local_28 [2];

+  

+  lVar6 = 0;

+  local_28[0] = (CProxyStream *)0x0;

+  pCVar4 = operator_new(200);

+  if (pCVar4 == (CProxyStream *)0x0) {

+LAB_0:

+    lVar6 = -0x7ff8fff2;

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_1;

+    uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar5 = 0x2a;

+  }

+  else {

+    pCVar4 = (CProxyStream *)CProxyStream(pCVar4,param_1,param_2,param_3,param_4,param_5,param_6);

+    if (pCVar4 == (CProxyStream *)0x0) goto LAB_0;

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+              ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)local_28);

+    local_28[0] = pCVar4;

+    (**(code **)(**(longlong **)(pCVar4 + 0x20) + 8))();

+    bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3624641849>::GetImpl(void)'

+                        ::__l2::impl);

+    if ((!bVar1) || (param_1 == (CProxyStreamManager *)0x0)) {

+LAB_2:

+      *(uint *)(pCVar4 + 0x1c) = *(uint *)(pCVar4 + 0x1c) | 2;

+      if (param_7 == (CProxyStream **)0x0) {

+        lVar6 = -0x7fffbffd;

+        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),0x29,

+                     &WPP_0590a41147183e8365b9646d033b00c8_Traceguids,uVar3,

+                     "CopyTo ppProxyStream failed!",0x80004003);

+        }

+      }

+      else {

+        *param_7 = pCVar4;

+        if (pCVar4 != (CProxyStream *)0x0) {

+          (**(code **)(**(longlong **)(pCVar4 + 0x20) + 8))();

+        }

+      }

+      goto LAB_1;

+    }

+    iVar2 = CProxyStreamManager::RegisterProxyStreamObjectForTracking(param_1,pCVar4,param_5);

+    if (iVar2 != 0) goto LAB_2;

+    lVar6 = -0x7ff8fff2;

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_1;

+    uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar5 = 0x27;

+  }

+  lVar6 = -0x7ff8fff2;

+  WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar5,

+           &WPP_0590a41147183e8365b9646d033b00c8_Traceguids,uVar3);

+LAB_1:

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)local_28);

+  return lVar6;

+}

+
```

## `CaDecProgressiveSurfaceContext::Initialize`  (modified)

```diff
--- CaDecProgressiveSurfaceContext::Initialize
+++ CaDecProgressiveSurfaceContext::Initialize
@@ -1,2 +1,97 @@
-Failed to decompile mstscax.dll - .ProgramDB CaDecProgressiveSurfaceContext::Initialize : 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: long __cdecl CaDecProgressiveSurfaceContext::Initialize(class CacNx::IDecodingEngine *

+   __ptr64,int,int,bool) __ptr64 */

+

+long __thiscall

+CaDecProgressiveSurfaceContext::Initialize

+          (CaDecProgressiveSurfaceContext *this,IDecodingEngine *param_1,int param_2,int param_3,

+          bool param_4)

+

+{

+  longlong *plVar1;

+  bool bVar2;

+  uint uVar3;

+  int iVar4;

+  undefined8 uVar5;

+  undefined1 auStack_78 [32];

+  char *local_58;

+  int local_50;

+  longlong *local_48;

+  int local_40;

+  int local_3c;

+  bool local_38;

+  undefined2 local_37;

+  undefined1 local_35;

+  ulonglong local_30;

+  

+  local_30 = __security_cookie ^ (ulonglong)auStack_78;

+  if (param_1 == (IDecodingEngine *)0x0) {

+    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),0x12,

+               &WPP_1123d0add87a34d2255591ff8a24582a_Traceguids,uVar3);

+    }

+    return -0x7ff8ffa9;

+  }

+  bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_2141685050>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_2141685050> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_2141685050>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_2141685050>::GetImpl(void)'

+                      ::__l2::impl);

+  if ((bVar2) && ((param_2 < 1 || (param_3 < 1)))) {

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+      return -0x7ff8ffa9;

+    }

+    if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+      return -0x7ff8ffa9;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+      return -0x7ff8ffa9;

+    }

+    uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+    local_58 = (char *)CONCAT44(local_58._4_4_,param_2);

+    local_50 = param_3;

+    WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x13,

+               &WPP_1123d0add87a34d2255591ff8a24582a_Traceguids,uVar3);

+    return -0x7ff8ffa9;

+  }

+  local_38 = param_4;

+  local_48 = (longlong *)0x0;

+  local_37 = 0;

+  local_35 = 0;

+  local_40 = param_2;

+  local_3c = param_3;

+  iVar4 = (**(code **)(*(longlong *)param_1 + 0x18))(param_1,&local_40,&local_48);

+  if (iVar4 < 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 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar5 = 0x14;

+    local_58 = "Failed to create the surface decoder";

+  }

+  else {

+    iVar4 = (**(code **)*local_48)(local_48,&IID_ISurfaceDecoderCpu,this + 0x38);

+    if (((-1 < iVar4) || ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control)) ||

+       (((WPP_GLOBAL_Control[0x1c] & 8) == 0 || ((byte)WPP_GLOBAL_Control[0x19] < 2))))

+    goto LAB_0;

+    uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar5 = 0x15;

+    local_58 = "QueryInterface failed for CacNx::ISurfaceDecoderCpu interface";

+  }

+  local_50 = iVar4;

+  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar5,

+             &WPP_1123d0add87a34d2255591ff8a24582a_Traceguids,uVar3);

+LAB_0:

+  plVar1 = local_48;

+  if (local_48 != (longlong *)0x0) {

+    local_48 = (longlong *)0x0;

+    (**(code **)(*plVar1 + 0x10))();

+    return iVar4;

+  }

+  return iVar4;

+}

+
```

## `CProxyStreamManager::Terminate`  (modified)

```diff
--- CProxyStreamManager::Terminate
+++ CProxyStreamManager::Terminate
@@ -1,2 +1,66 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyStreamManager::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 CProxyStreamManager::Terminate(void) __ptr64 */

+

+long __thiscall CProxyStreamManager::Terminate(CProxyStreamManager *this)

+

+{

+  int iVar1;

+  CProxyStream *this_00;

+  bool bVar2;

+  uint uVar3;

+  int iVar4;

+  int iVar5;

+  CProxyStream *local_res8;

+  

+  EnterCriticalSection((LPCRITICAL_SECTION)(this + 0x30));

+  bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3624641849>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar2) {

+    NotifyProxyStreamObjectsOnMgrTermination(this + -8);

+  }

+  iVar1 = *(int *)(this + 0x6c);

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x10,

+              &WPP_0590a41147183e8365b9646d033b00c8_Traceguids,uVar3,iVar1);

+  }

+  iVar5 = 1;

+  if (1 < iVar1) {

+    do {

+      local_res8 = (CProxyStream *)0x0;

+      iVar4 = SmartArray<CProxyStream,long>::GetAt

+                        ((SmartArray<CProxyStream,long> *)(this + 0x68),iVar5,&local_res8);

+      this_00 = local_res8;

+      if ((iVar4 != 0) && (local_res8 != (CProxyStream *)0x0)) {

+        bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::

+                __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

+                                    &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3624641849>::GetImpl(void)'

+                                     ::__l2::impl);

+        if (!bVar2) {

+          CProxyStream::OnManagerTerminating(this_00);

+        }

+        (**(code **)(**(longlong **)(this_00 + 0x20) + 0x10))();

+        iVar4 = SmartArray<CProxyStream,long>::AddAt

+                          ((SmartArray<CProxyStream,long> *)(this + 0x68),iVar5,(CProxyStream *)0x0)

+        ;

+        if (((iVar4 == 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+           (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+          uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+          WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x11,

+                    &WPP_0590a41147183e8365b9646d033b00c8_Traceguids,uVar3,iVar5);

+        }

+      }

+      iVar5 = iVar5 + 1;

+    } while (iVar5 < iVar1);

+  }

+  LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x30));

+  *(undefined8 *)(this + 0x60) = 0;

+  *(uint *)(this + 0x14) = *(uint *)(this + 0x14) | 4;

+  return 0;

+}

+
```

## `CClipBase::GetCloudHistoryDataHandle`  (modified)

```diff
--- CClipBase::GetCloudHistoryDataHandle
+++ CClipBase::GetCloudHistoryDataHandle
@@ -1,2 +1,187 @@
-Failed to decompile mstscax.dll - .ProgramDB CClipBase::GetCloudHistoryDataHandle : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: long __cdecl CClipBase::GetCloudHistoryDataHandle(void * __ptr64 * __ptr64) __ptr64 */

+

+long __thiscall CClipBase::GetCloudHistoryDataHandle(CClipBase *this,void **param_1)

+

+{

+  bool bVar1;

+  DWORD DVar2;

+  uint uVar3;

+  errno_t eVar4;

+  BOOL BVar5;

+  HGLOBAL pvVar6;

+  LPVOID _Dst;

+  char *pcVar7;

+  undefined4 uVar8;

+  undefined8 uVar9;

+  long lVar10;

+  CClipBase *local_res8;

+  undefined8 in_stack_ffffffffffffffd8;

+  

+  uVar8 = (undefined4)((ulonglong)in_stack_ffffffffffffffd8 >> 0x20);

+  local_res8 = this;

+  pvVar6 = GlobalAlloc(0x40,4);

+  *param_1 = pvVar6;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixBug62354957>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_FixBug62354957> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixBug62354957>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_FixBug62354957>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar1) {

+    if (*param_1 == (void *)0x0) {

+      DVar2 = GetLastError();

+      if (0 < (int)DVar2) {

+        DVar2 = DVar2 & 0xffff | 0x80070000;

+      }

+      if ((int)DVar2 < 0) {

+        if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+          return DVar2;

+        }

+        if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+          return DVar2;

+        }

+        if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+          return DVar2;

+        }

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar9 = 0x50;

+LAB_0:

+        pcVar7 = "GlobalAlloc failed.";

+        goto LAB_1;

+      }

+    }

+LAB_2:

+    _Dst = GlobalLock(*param_1);

+    bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixBug62354957>::

+            __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_FixBug62354957> *)

+                                &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixBug62354957>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_FixBug62354957>::GetImpl(void)'

+                                 ::__l2::impl);

+    if (bVar1) {

+      if (_Dst == (LPVOID)0x0) {

+        DVar2 = GetLastError();

+        if (0 < (int)DVar2) {

+          DVar2 = DVar2 & 0xffff | 0x80070000;

+        }

+        if ((int)DVar2 < 0) {

+          if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+            return DVar2;

+          }

+          if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+            return DVar2;

+          }

+          if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+            return DVar2;

+          }

+          uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+          uVar9 = 0x53;

+LAB_3:

+          pcVar7 = "GlobalLock failed.";

+LAB_1:

+          WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar9,

+                     &WPP_95e9326cdea9352825b64f07fc278838_Traceguids,uVar3,pcVar7,DVar2);

+          return DVar2;

+        }

+      }

+    }

+    else {

+      if (_Dst == (LPVOID)0x0) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+          uVar8 = 0x54;

+          pcVar7 = "PVOID";

+          goto LAB_4;

+        }

+        goto LAB_5;

+      }

+      DVar2 = GetLastError();

+      if (0 < (int)DVar2) {

+        DVar2 = DVar2 & 0xffff | 0x80070000;

+      }

+      if ((int)DVar2 < 0) {

+        if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+          return DVar2;

+        }

+        if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+          return DVar2;

+        }

+        if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+          return DVar2;

+        }

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar9 = 0x55;

+        goto LAB_3;

+      }

+    }

+    local_res8 = (CClipBase *)((ulonglong)local_res8 & 0xffffffff00000000);

+    eVar4 = memcpy_s(_Dst,4,&local_res8,4);

+    if (eVar4 == 0) {

+      BVar5 = GlobalUnlock(*param_1);

+      if ((BVar5 == 0) && (DVar2 = GetLastError(), DVar2 != 0)) {

+        DVar2 = GetLastError();

+        if (0 < (int)DVar2) {

+          DVar2 = DVar2 & 0xffff | 0x80070000;

+        }

+        if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+          return DVar2;

+        }

+        if ((WPP_GLOBAL_Control[0x1c] & 1) == 0) {

+          return DVar2;

+        }

+        if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+          return DVar2;

+        }

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x57,

+                 &WPP_95e9326cdea9352825b64f07fc278838_Traceguids,uVar3);

+        return DVar2;

+      }

+      lVar10 = 0;

+    }

+    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),0x56,

+                  &WPP_95e9326cdea9352825b64f07fc278838_Traceguids,uVar3,CONCAT44(uVar8,0x8000ffff))

+        ;

+      }

+      lVar10 = -0x7fff0001;

+    }

+  }

+  else {

+    if (*param_1 != (void *)0x0) {

+      DVar2 = GetLastError();

+      if (0 < (int)DVar2) {

+        DVar2 = DVar2 & 0xffff | 0x80070000;

+      }

+      if ((int)DVar2 < 0) {

+        if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+          return DVar2;

+        }

+        if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+          return DVar2;

+        }

+        if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+          return DVar2;

+        }

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar9 = 0x52;

+        goto LAB_0;

+      }

+      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();

+      uVar8 = 0x51;

+      pcVar7 = "HANDLE";

+LAB_4:

+      WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar8,

+                &WPP_95e9326cdea9352825b64f07fc278838_Traceguids,uVar3,pcVar7);

+    }

+LAB_5:

+    lVar10 = -0x7ff8fff2;

+  }

+  return lVar10;

+}

+
```

## `CRdpAudioController::vcwaveGetDevCaps`  (modified)

```diff
--- CRdpAudioController::vcwaveGetDevCaps
+++ CRdpAudioController::vcwaveGetDevCaps
@@ -1,2 +1,72 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdpAudioController::vcwaveGetDevCaps : 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: void __cdecl CRdpAudioController::vcwaveGetDevCaps(struct SNDFORMATMSG * __ptr64) __ptr64

+    */

+

+void __thiscall

+CRdpAudioController::vcwaveGetDevCaps(CRdpAudioController *this,SNDFORMATMSG *param_1)

+

+{

+  char cVar1;

+  undefined4 uVar2;

+  int iVar3;

+  undefined4 uVar4;

+  longlong *plVar5;

+  undefined4 local_res10 [2];

+  undefined4 local_res18 [2];

+  longlong *local_res20;

+  undefined8 in_stack_ffffffffffffffb8;

+  CRdpAudioController *pCVar6;

+  CTSCriticalSection *local_38 [2];

+  

+  uVar2 = (undefined4)((ulonglong)in_stack_ffffffffffffffb8 >> 0x20);

+  local_res18[0] = 0;

+  local_res10[0] = 0;

+  local_res20 = (longlong *)0x0;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar2 = RdpX_GetActivityIdPrefix();

+    pCVar6 = this;

+    WPP_SF_DP(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4a,

+              &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar2,this);

+    uVar2 = (undefined4)((ulonglong)pCVar6 >> 0x20);

+  }

+  *(undefined8 *)(param_1 + 4) = 0;

+  *(undefined4 *)(param_1 + 0xc) = 0;

+  *(undefined2 *)(param_1 + 0x10) = 0;

+  cVar1 = MSRC108255UseKIR();

+  if (cVar1 == '\0') {

+    plVar5 = *(longlong **)(this + 0x100c8);

+  }

+  else {

+    local_38[0] = (CTSCriticalSection *)(this + 0x10148);

+    CTSCriticalSection::Lock(local_38[0]);

+    RdpXSPtr<RdpXInterfaceTapProtocolServerEvents>::operator=

+              ((RdpXSPtr<RdpXInterfaceTapProtocolServerEvents> *)&local_res20,

+               (RdpXSPtr<struct_RdpXInterfaceTapProtocolServerEvents> *)(this + 0x100c8));

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)local_38);

+    plVar5 = local_res20;

+  }

+  if (plVar5 != (longlong *)0x0) {

+    iVar3 = (**(code **)(*plVar5 + 0x48))(plVar5,local_res18,local_res10);

+    if (iVar3 != 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_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4b,

+                  &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar4,CONCAT44(uVar2,iVar3));

+      }

+      goto LAB_0;

+    }

+  }

+  *(undefined4 *)(param_1 + 8) = local_res10[0];

+  *(undefined4 *)(param_1 + 0xc) = local_res18[0];

+  *(undefined2 *)(param_1 + 0x10) = 0;

+  *(undefined4 *)(param_1 + 4) = 7;

+LAB_0:

+  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)&local_res20);

+  return;

+}

+
```

## `CProxyDataObject::CProxyDataObject`  (modified)

```diff
--- CProxyDataObject::CProxyDataObject
+++ CProxyDataObject::CProxyDataObject
@@ -1,2 +1,54 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyDataObject::CProxyDataObject : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: __cdecl CProxyDataObject::CProxyDataObject(class CProxyDataObjectManager *

+   __ptr64,int,unsigned long) __ptr64 */

+

+CProxyDataObject * __thiscall

+CProxyDataObject::CProxyDataObject

+          (CProxyDataObject *this,CProxyDataObjectManager *param_1,int param_2,ulong param_3)

+

+{

+  bool bVar1;

+  

+  *(undefined4 *)(this + 0x18) = 0xdbcaabcd;

+  *(char **)(this + 0x10) = "CProxyDataObject";

+  *(undefined4 *)(this + 0x1c) = 1;

+  *(undefined ***)this = CTSUnknown::vftable_for_INonDelegatingUnknown_;

+  *(CProxyDataObject **)(this + 0x20) = this;

+  *(undefined ***)(this + 8) = CTSUnknown::vftable_for_CTSObject_;

+  *(undefined ***)this = &_vftable__for__INonDelegatingUnknown__;

+  *(undefined ***)(this + 8) = &_vftable__for__CTSObject__;

+  *(undefined ***)(this + 0x30) = &_vftable__for__IDataObject__;

+  *(undefined4 *)(this + 0x28) = 0;

+  *(undefined ***)(this + 0x38) = &_vftable__for__IRdpProxyDataObject__;

+  *(undefined8 *)(this + 0xf0) = 0;

+  *(undefined8 *)(this + 0xf8) = 0;

+  *(undefined4 *)(this + 0x100) = 0;

+  *(CProxyDataObjectManager **)(this + 0x48) = param_1;

+  *(CProxyDataObjectManager **)(this + 0x40) = param_1;

+  *(undefined8 *)(this + 0x78) = 0;

+  *(undefined8 *)(this + 0x80) = 0;

+  *(undefined8 *)(this + 0x88) = 0;

+  *(undefined8 *)(this + 0x90) = 0;

+  *(undefined8 *)(this + 0x98) = 0;

+  *(undefined8 *)(this + 0xa0) = 0;

+  *(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;

+  *(ulong *)(this + 0x104) = param_3;

+  *(int *)(this + 0x108) = param_2;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3624641849>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar1) {

+    InitializeCriticalSection((LPCRITICAL_SECTION)(this + 0x50));

+  }

+  return this;

+}

+
```

## `CRdrServerRequestHandler::CompleteIoControl`  (modified)

```diff
--- CRdrServerRequestHandler::CompleteIoControl
+++ CRdrServerRequestHandler::CompleteIoControl
@@ -1,2 +1,77 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdrServerRequestHandler::CompleteIoControl : 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::CompleteIoControl(unsigned long,long,unsigned

+   long,unsigned long,unsigned char * __ptr64) __ptr64 */

+

+long __thiscall

+CRdrServerRequestHandler::CompleteIoControl

+          (CRdrServerRequestHandler *this,ulong param_1,long param_2,ulong param_3,ulong param_4,

+          uchar *param_5)

+

+{

+  longlong lVar1;

+  bool bVar2;

+  long lVar3;

+  uint uVar4;

+  long lVar5;

+  uint *_Dst;

+  longlong local_res8;

+  CTSCriticalSection *local_48 [2];

+  

+  local_48[0] = (CTSCriticalSection *)(this + 0x80);

+  lVar5 = 0;

+  local_res8 = 0;

+  CTSCriticalSection::Lock(local_48[0]);

+  lVar3 = RemovePendingRequest(this,param_1);

+  if ((((lVar3 < 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),0x1d,

+               &WPP_852928d963083be7bf554339e5c32f33_Traceguids,uVar4,"RemovePendingRequest failed",

+               lVar3);

+  }

+  if (param_3 <= param_4) {

+    param_4 = param_3;

+  }

+  uVar4 = param_4 + 0xd;

+  if ((uVar4 < param_4) || (uVar4 < 0xd)) {

+    lVar5 = -0x7ff8ffa9;

+  }

+  else {

+    _Dst = operator_new((ulonglong)uVar4);

+    if (_Dst == (uint *)0x0) {

+      lVar5 = -0x7ff8fff2;

+    }

+    else {

+      bVar2 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_2884880696>::__private_IsEnabled

+                        ((FeatureImpl<__WilFeatureTraits_Feature_2884880696> *)

+                         &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_2884880696>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_2884880696>::GetImpl(void)'

+                          ::__l2::impl);

+      if (bVar2) {

+        memset(_Dst,0,(ulonglong)uVar4);

+      }

+      *(undefined1 *)((longlong)_Dst + 3) = 0;

+      _Dst[2] = param_3;

+      *_Dst = *_Dst ^ (*_Dst ^ param_1) & 0xffffff;

+      _Dst[1] = param_2;

+      memcpy(_Dst + 3,param_5,(ulonglong)param_4);

+      if (*(longlong *)(this + 0x50) != 0) {

+        TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res8);

+        lVar1 = *(longlong *)(this + 0x50);

+        local_res8 = lVar1;

+        TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                  ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_res8);

+        if (lVar1 != 0) {

+          lVar5 = (**(code **)(**(longlong **)(this + 0x50) + 0x18))

+                            (*(longlong **)(this + 0x50),uVar4,_Dst,0);

+        }

+      }

+      operator_delete(_Dst);

+    }

+  }

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)local_48);

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res8);

+  return lVar5;

+}

+
```

## `_tlgWriteTransfer_EventWriteTransfer`  (modified)

```diff
--- _tlgWriteTransfer_EventWriteTransfer
+++ _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<4>_>
@@ -1,10 +1,2 @@
-

-/* WARNING: Control flow encountered bad instruction data */

-

-void _tlgWriteTransfer_EventWriteTransfer(void)

-

-{

-                    /* WARNING: Bad instruction - Truncating control flow here */

-  halt_baddata();

-}

-

+Failed to decompile mstscax.dll - .ProgramDB _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<4>_> : Error: Decompile error: 
+Marshaling error: Did not see expected closing element
```

## `CRemoteDesktopClientSettings::IsThumbPrintInRegistry`  (modified)

```diff
--- CRemoteDesktopClientSettings::IsThumbPrintInRegistry
+++ CRemoteDesktopClientSettings::IsThumbPrintInRegistry
@@ -1,2 +1,262 @@
-Failed to decompile mstscax.dll - .ProgramDB CRemoteDesktopClientSettings::IsThumbPrintInRegistry : 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: int __cdecl CRemoteDesktopClientSettings::IsThumbPrintInRegistry(struct HKEY__ *

+   __ptr64,unsigned char * __ptr64,unsigned long,unsigned char * __ptr64,unsigned long,unsigned char

+   * __ptr64,unsigned long,unsigned char * __ptr64,unsigned long) __ptr64 */

+

+int __thiscall

+CRemoteDesktopClientSettings::IsThumbPrintInRegistry

+          (CRemoteDesktopClientSettings *this,HKEY__ *param_1,uchar *param_2,ulong param_3,

+          uchar *param_4,ulong param_5,uchar *param_6,ulong param_7,uchar *param_8,ulong param_9)

+

+{

+  OLECHAR OVar1;

+  longlong lVar2;

+  bool bVar3;

+  BSTR pOVar4;

+  int iVar5;

+  uint uVar6;

+  int iVar7;

+  uint uVar8;

+  long lVar9;

+  wchar_t *pwVar10;

+  long lVar11;

+  uchar *puVar12;

+  ulonglong uVar13;

+  uchar *puVar14;

+  uchar *puVar15;

+  char *pcVar16;

+  ulong uVar17;

+  uint uVar18;

+  undefined1 auStackY_388 [32];

+  ushort *in_stack_fffffffffffffc98;

+  uint local_358;

+  uint local_354;

+  BSTR local_350;

+  ulong local_348 [2];

+  undefined8 *local_340;

+  longlong *local_338;

+  ulong local_330;

+  uint local_32c;

+  wchar_t *local_328;

+  wchar_t *local_320;

+  CRemoteDesktopClientSettings *local_318;

+  HKEY__ *local_310;

+  uchar auStack_308 [8];

+  uchar *local_300;

+  undefined8 uStack_2f8;

+  wchar_t local_2f0 [28];

+  OLECHAR local_2b8 [7];

+  OLECHAR local_2aa [249];

+  uchar local_b8 [128];

+  ulonglong local_38;

+  

+  local_38 = __security_cookie ^ (ulonglong)auStackY_388;

+  local_340 = (undefined8 *)CONCAT44(local_340._4_4_,param_3);

+  lVar11 = 0;

+  local_328 = (wchar_t *)0x0;

+  local_348[0] = 0;

+  local_320 = (wchar_t *)0x0;

+  local_32c = 0;

+  uVar8 = 0;

+  local_354 = 0;

+  pcVar16 = "None";

+  local_338 = (longlong *)((ulonglong)local_338 & 0xffffffff00000000);

+  local_358 = 0;

+  local_318 = this;

+  local_310 = param_1;

+  local_300 = param_2;

+  iVar5 = CPolicy::AllocReadRegistryPolicyString

+                    ((uint)(param_1 != (HKEY__ *)0xffffffff80000001),(ushort *)param_1,

+                     (ushort **)&local_328,(int *)local_348,in_stack_fffffffffffffc98);

+  uVar18 = uVar8;

+  if (iVar5 == 0) {

+    local_358 = uVar8;

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x12d,

+               &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar6);

+    }

+  }

+  else {

+    local_330 = 0;

+    lVar9 = CPolicy::ReadEffectivePolicyDWORD

+                      ((ushort *)L"DisableSHA1CertThumbprints",&local_330,

+                       (ushort *)L"Software\\Policies\\Microsoft\\Windows NT\\Terminal Services\\");

+    if (-1 < lVar9) {

+      local_358 = (uint)(local_330 != 0);

+    }

+    pwVar10 = wcstok_s(local_328,L",",&local_320);

+    if (pwVar10 != (wchar_t *)0x0) {

+LAB_0:

+      puVar12 = (uchar *)0x0;

+      lVar9 = StringCchCopyW((ushort *)local_2b8,0x100,(ushort *)pwVar10);

+      if (lVar9 < 0) {

+LAB_1:

+        pwVar10 = wcstok_s((wchar_t *)0x0,L",",&local_320);

+        lVar11 = lVar9;

+      }

+      else {

+        CUT::RemoveWhiteSpace((ushort *)local_2b8);

+        if ((local_2b8[0] == L'\x200e') &&

+           (local_2b8[0] = local_2b8[1], puVar14 = puVar12, local_2b8[1] != L'\0')) {

+          do {

+            puVar15 = (uchar *)(ulonglong)((int)puVar14 + 1);

+            OVar1 = local_2b8[(int)puVar14 + 2];

+            local_2b8[(longlong)puVar15] = OVar1;

+            puVar14 = puVar15;

+          } while (OVar1 != L'\0');

+          param_3 = (uint)local_340;

+        }

+        local_350 = local_2b8;

+        builtin_wcsncpy(local_2f0,L"sha256:",8);

+        uVar13 = 0xffffffffffffffff;

+        bVar3 = true;

+        builtin_wcsncpy(local_2f0 + 8,L"sha384:",8);

+        builtin_wcsncpy(local_2f0 + 0x10,L"sha512:",8);

+        do {

+          uVar13 = uVar13 + 1;

+        } while (local_2b8[uVar13] != L'\0');

+        iVar5 = (int)uVar13;

+        if (0x7fffffff < uVar13) {

+          lVar11 = -0x7ff8fdea;

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar8 = RdpWppGetCurrentThreadActivityIdPrefix();

+            WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x12e,

+                       &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar8);

+          }

+LAB_2:

+          uVar8 = local_354;

+          uVar18 = (uint)local_338;

+          goto LAB_3;

+        }

+        if ((((((param_4 == (uchar *)0x0) || (param_5 == 0)) || (iVar5 < 8)) ||

+             (iVar7 = CompareStringOrdinal(local_2b8,7,local_2f0,7,1), puVar14 = param_4,

+             uVar17 = param_5, iVar7 != 2)) &&

+            (((param_6 == (uchar *)0x0 || (param_7 == 0)) ||

+             ((iVar5 < 8 ||

+              (iVar7 = CompareStringOrdinal(local_2b8,7,local_2f0 + 8,7,1), puVar14 = param_6,

+              uVar17 = param_7, iVar7 != 2)))))) &&

+           (((param_8 == (uchar *)0x0 || (param_9 == 0)) ||

+            ((iVar5 < 8 ||

+             (iVar7 = CompareStringOrdinal(local_2b8,7,local_2f0 + 0x10,7,1), puVar14 = param_8,

+             uVar17 = param_9, iVar7 != 2)))))) {

+          puVar14 = puVar12;

+          if ((local_300 != (uchar *)0x0) && (param_3 != 0)) {

+            puVar12 = (uchar *)(ulonglong)param_3;

+            puVar14 = local_300;

+          }

+          uVar17 = (ulong)puVar12;

+          local_32c = 1;

+        }

+        else {

+          uVar13 = (ulonglong)(iVar5 - 7);

+          local_354 = 1;

+          local_350 = local_2aa;

+          bVar3 = false;

+        }

+        lVar9 = 0;

+        lVar11 = 0;

+        if (((puVar14 != (uchar *)0x0) && (uVar17 != 0)) && ((!bVar3 || (local_358 == 0)))) {

+          local_348[0] = 0x80;

+          iVar5 = CUT::StringToBinary((ulong)uVar13,(ushort *)local_350,local_b8,local_348);

+          if (((iVar5 == 0) || (uVar17 != local_348[0] - 1)) ||

+             (iVar5 = memcmp(puVar14,local_b8,(ulonglong)(local_348[0] - 1)), iVar5 != 0))

+          goto LAB_1;

+          uVar18 = 1;

+          uVar8 = local_354;

+          if (bVar3) {

+            local_350 = (OLECHAR *)0x0;

+            local_340 = (undefined8 *)0x0;

+            local_338 = (longlong *)0x0;

+            local_300 = (uchar *)0x0;

+            uStack_2f8 = 0;

+            pcVar16 = "SHA1";

+            lVar9 = RDPLOCAL_CreateInstance

+                              ((IUnknown *)0x0,(_GUID *)&CLSID_RDPEventLogSession,

+                               (_GUID *)&IID_IRDPEventLog,&local_350);

+            if (((-1 < lVar9) &&

+                (iVar5 = (**(code **)(*(longlong *)local_350 + 0x18))

+                                   (local_350,&local_300,&local_340), -1 < iVar5)) &&

+               (iVar5 = (**(code **)*local_340)

+                                  (local_340,&IID_IRdpClientCoreEventLogCallback,&local_338),

+               -1 < iVar5)) {

+              (**(code **)(*local_338 + 0x50))

+                        (local_338,local_2b8,L"(IRemoteDesktopClientSettings interface)");

+            }

+            TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_338);

+            TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_340);

+            pOVar4 = local_350;

+            if (local_350 != (OLECHAR *)0x0) {

+              local_350 = (OLECHAR *)0x0;

+              (**(code **)(*(longlong *)pOVar4 + 0x10))();

+            }

+          }

+          else if (puVar14 == param_4) {

+            pcVar16 = "SHA256";

+          }

+          else if (puVar14 == param_6) {

+            pcVar16 = "SHA384";

+          }

+          else {

+            uVar18 = 1;

+            if (puVar14 == param_8) {

+              pcVar16 = "SHA512";

+            }

+          }

+          goto LAB_3;

+        }

+        pwVar10 = wcstok_s((wchar_t *)0x0,L",",&local_320);

+        lVar11 = lVar9;

+      }

+      if (pwVar10 == (wchar_t *)0x0) goto LAB_2;

+      param_3 = (uint)local_340;

+      goto LAB_0;

+    }

+  }

+LAB_3:

+  uVar13 = (ulonglong)_tls_index;

+  if (local_310 == (HKEY__ *)0xffffffff80000002) {

+    lVar2 = *(longlong *)((longlong)ThreadLocalStoragePointer + uVar13 * 8);

+    *(undefined4 *)(lVar2 + 0x20) = 0;

+    *(undefined4 *)(lVar2 + 0x28) = 0;

+    *(undefined4 *)(lVar2 + 0x24) = 1;

+  }

+  lVar2 = *(longlong *)((longlong)ThreadLocalStoragePointer + uVar13 * 8);

+  *(uint *)(lVar2 + 0x20) = *(uint *)(lVar2 + 0x20) | local_32c;

+  *(uint *)(lVar2 + 0x28) = *(uint *)(lVar2 + 0x28) | uVar8;

+  *(uint *)(lVar2 + 0x24) = *(uint *)(lVar2 + 0x24) & local_358;

+  if ((uVar18 != 0) || (local_310 == (HKEY__ *)0xffffffff80000001)) {

+    local_310 = (HKEY__ *)0x0;

+    auStack_308[0] = '\0';

+    auStack_308[1] = '\0';

+    auStack_308[2] = '\0';

+    auStack_308[3] = '\0';

+    auStack_308[4] = '\0';

+    auStack_308[5] = '\0';

+    auStack_308[6] = '\0';

+    auStack_308[7] = '\0';

+    local_350 = (OLECHAR *)0x0;

+    if ((*(CMsTscAx **)(local_318 + 0x48) != (CMsTscAx *)0x0) &&

+       (lVar9 = CMsTscAx::GetBSTRProperty

+                          (*(CMsTscAx **)(local_318 + 0x48),"CorrelationId",(ushort **)&local_350),

+       pOVar4 = local_350, -1 < lVar9)) {

+      if ((local_350 != (BSTR)0x0) && (*local_350 != L'\0')) {

+        (*(code *)__imp_IIDFromString)(local_350,&local_310);

+      }

+      SysFreeString(pOVar4);

+    }

+    MSTSCAXTelemetry::LogCertThumbprintMatchStats

+              (pcVar16,*(int *)(lVar2 + 0x24),*(int *)(lVar2 + 0x20),*(int *)(lVar2 + 0x28),

+               (_GUID *)&local_310,lVar11);

+  }

+  if (local_328 != (wchar_t *)0x0) {

+    LocalFree(local_328);

+  }

+  return uVar18;

+}

+
```

## `CProxyDataObject::CreateInstance`  (modified)

```diff
--- CProxyDataObject::CreateInstance
+++ CProxyDataObject::CreateInstance
@@ -1,2 +1,96 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyDataObject::CreateInstance : 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: static long __cdecl CProxyDataObject::CreateInstance(class CProxyDataObjectManager *

+   __ptr64,int,unsigned long,class CProxyDataObject * __ptr64 * __ptr64) */

+

+long __cdecl

+CProxyDataObject::CreateInstance

+          (CProxyDataObjectManager *param_1,int param_2,ulong param_3,CProxyDataObject **param_4)

+

+{

+  bool bVar1;

+  int iVar2;

+  uint uVar3;

+  long lVar4;

+  CProxyDataObject *pCVar5;

+  char *pcVar6;

+  undefined4 uVar7;

+  undefined8 uVar8;

+  CProxyDataObject *local_18 [2];

+  

+  local_18[0] = (CProxyDataObject *)0x0;

+  pCVar5 = operator_new(0x110);

+  if (pCVar5 == (CProxyDataObject *)0x0) {

+LAB_0:

+    lVar4 = -0x7ff8fff2;

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_1;

+    uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar8 = 0x30;

+  }

+  else {

+    pCVar5 = (CProxyDataObject *)CProxyDataObject(pCVar5,param_1,param_2,param_3);

+    if (pCVar5 == (CProxyDataObject *)0x0) goto LAB_0;

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+              ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)local_18);

+    local_18[0] = pCVar5;

+    (**(code **)(**(longlong **)(pCVar5 + 0x20) + 8))();

+    bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3624641849>::GetImpl(void)'

+                        ::__l2::impl);

+    if ((!bVar1) || (param_1 == (CProxyDataObjectManager *)0x0)) {

+LAB_2:

+      lVar4 = Initialize(pCVar5 + 8);

+      if (lVar4 < 0) {

+        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+            ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+        goto LAB_1;

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar7 = 0x2e;

+        pcVar6 = "Failed to initialize CProxyDataObject!";

+      }

+      else {

+        if (param_4 != (CProxyDataObject **)0x0) {

+          *param_4 = pCVar5;

+          if (pCVar5 != (CProxyDataObject *)0x0) {

+            (**(code **)(**(longlong **)(pCVar5 + 0x20) + 8))();

+          }

+          lVar4 = 0;

+          goto LAB_1;

+        }

+        lVar4 = -0x7fffbffd;

+        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+            ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+        goto LAB_1;

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar7 = 0x2f;

+        lVar4 = -0x7fffbffd;

+        pcVar6 = "CopyTo ppProxyDataObject failed!";

+      }

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar7,

+                 &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar3,pcVar6,lVar4);

+      goto LAB_1;

+    }

+    iVar2 = CProxyDataObjectManager::RegisterDataObjectForTracking(param_1,pCVar5,param_3);

+    if (iVar2 != 0) goto LAB_2;

+    CProxyDataObjectManager::ReleaseUniqueId(param_1,param_3);

+    *(undefined4 *)(pCVar5 + 0x104) = 0xffffffff;

+    lVar4 = -0x7ff8fff2;

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_1;

+    uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar8 = 0x2d;

+  }

+  lVar4 = -0x7ff8fff2;

+  WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar8,

+           &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar3);

+LAB_1:

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)local_18);

+  return lVar4;

+}

+
```

## `CMsTscAx::Connect`  (modified)

```diff
--- CMsTscAx::Connect
+++ CMsTscAx::Connect
@@ -1,2 +1,159 @@
-Failed to decompile mstscax.dll - .ProgramDB CMsTscAx::Connect : 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 CMsTscAx::Connect(void) __ptr64 */

+

+long __thiscall CMsTscAx::Connect(CMsTscAx *this)

+

+{

+  CMsTscAx *this_00;

+  bool bVar1;

+  long lVar2;

+  uint uVar3;

+  BOOL BVar4;

+  long lVar5;

+  FeatureImpl<struct___WilFeatureTraits_Feature_IsoBrokerV3Apis> *this_01;

+  char *pcVar6;

+  undefined8 uVar7;

+  short asStack_20 [12];

+  

+  if (*(int *)(this + 0x78) != 0) {

+    return -0x7fffbffb;

+  }

+  this_00 = this + -0x608;

+  lVar2 = SetCustomPerfLogger(this_00,0);

+  if ((((lVar2 < 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),0x1dc,

+               &WPP_6643dbcd82b63734680c920b734a5dfc_Traceguids,uVar3,

+               "Failed to set custom perf logger!",lVar2);

+  }

+  BVar4 = IsWindow(*(HWND *)(this + -0x598));

+  if ((BVar4 == 0) && (BVar4 = IsWindow(*(HWND *)(this + 0x7a0)), BVar4 == 0)) {

+    *(undefined4 *)(this + 0x70) = 1;

+    return 0;

+  }

+  this_01 = &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_IsoBrokerV3Apis>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_IsoBrokerV3Apis>::GetImpl(void)'

+             ::__l2::impl;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_IsoBrokerV3Apis>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_IsoBrokerV3Apis> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_IsoBrokerV3Apis>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_IsoBrokerV3Apis>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar1) {

+    asStack_20[0] = 0;

+    asStack_20[1] = 0;

+    asStack_20[2] = 0;

+    asStack_20[3] = 0;

+    lVar2 = GetVBOOLPropertyInternal

+                      ((CMsTscAx *)this_01,*(ITSPropertySet **)(this + 0x738),

+                       "ConnectToChildSession",asStack_20);

+    if ((lVar2 < 0) || (asStack_20[0] != -1)) {

+      bVar1 = false;

+    }

+    else {

+      bVar1 = true;

+    }

+    lVar2 = GetVBOOLPropertyInternal

+                      ((CMsTscAx *)this_01,*(ITSPropertySet **)(this + 0x738),

+                       "ConnectToAgentSession",asStack_20);

+    if ((lVar2 < 0) || (asStack_20[0] != -1)) {

+      if ((bVar1) && (lVar2 = ConfigureConnectToChildSession(this_00), lVar2 < 0)) {

+        if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+          return lVar2;

+        }

+        if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+          return lVar2;

+        }

+        if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+          return lVar2;

+        }

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar7 = 0x1df;

+        goto LAB_0;

+      }

+    }

+    else {

+      if (bVar1) {

+        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),0x1dd,

+                   &WPP_6643dbcd82b63734680c920b734a5dfc_Traceguids,uVar3);

+        }

+        return -0x7fff0001;

+      }

+      lVar2 = ConfigureConnectToAgentSession(this_00);

+      if (lVar2 < 0) {

+        if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+          return lVar2;

+        }

+        if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+          return lVar2;

+        }

+        if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+          return lVar2;

+        }

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar7 = 0x1de;

+        pcVar6 = "Failed configuring for agent session, exiting";

+        goto LAB_1;

+      }

+    }

+  }

+  else {

+    lVar2 = ConfigureConnectToChildSessionOld(this_00);

+    if (lVar2 < 0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) {

+        return lVar2;

+      }

+      if ((WPP_GLOBAL_Control[0x1c] & 8) == 0) {

+        return lVar2;

+      }

+      if ((byte)WPP_GLOBAL_Control[0x19] < 2) {

+        return lVar2;

+      }

+      uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar7 = 0x1e0;

+LAB_0:

+      pcVar6 = "Failed configuring for child session, exiting";

+LAB_1:

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar7,

+                 &WPP_6643dbcd82b63734680c920b734a5dfc_Traceguids,uVar3,pcVar6,lVar2);

+      return lVar2;

+    }

+  }

+  lVar2 = StartEstablishConnection(this_00);

+  if (lVar2 < 0) {

+    return lVar2;

+  }

+  if (*(longlong *)(this + 0x6d8) == 0) {

+    lVar5 = InitializeConnectionDiagnostics(this_00);

+    if (lVar5 < 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar7 = 0x1e2;

+LAB_2:

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar7,

+                  &WPP_6643dbcd82b63734680c920b734a5dfc_Traceguids,uVar3,lVar5);

+      }

+    }

+    else {

+      lVar5 = StartConnectionDiagnostics(this_00);

+      if (((lVar5 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+         (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+        uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar7 = 0x1e3;

+        goto LAB_2;

+      }

+    }

+    if (*(longlong *)(this + 0x6d8) == 0) goto LAB_3;

+  }

+  CreatePowerStateMonitorWindow(this_00);

+LAB_3:

+  LogTelemetryData(*(CMstscAdvSettings **)(this + 0x6a0));

+  (**(code **)(*(longlong *)this_00 + 0x28))(this_00);

+  return lVar2;

+}

+
```

## `CRdpAudioController::OnWaveData`  (modified)

```diff
--- CRdpAudioController::OnWaveData
+++ CRdpAudioController::OnWaveData
@@ -1,2 +1,775 @@
-Failed to decompile mstscax.dll - .ProgramDB CRdpAudioController::OnWaveData : 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: virtual long __cdecl CRdpAudioController::OnWaveData(void * __ptr64,void * __ptr64,enum

+   _XBool32) __ptr64 */

+

+long __thiscall

+CRdpAudioController::OnWaveData

+          (CRdpAudioController *this,void *param_1,void *param_2,_XBool32 param_3)

+

+{

+  CTSCriticalSection *pCVar1;

+  CRdpAudioController CVar2;

+  byte bVar3;

+  ushort uVar4;

+  ushort uVar5;

+  ushort uVar6;

+  short sVar7;

+  undefined *puVar8;

+  __int64 _Var9;

+  char cVar10;

+  byte bVar11;

+  undefined4 uVar12;

+  int iVar13;

+  undefined4 uVar14;

+  undefined4 uVar15;

+  long lVar16;

+  undefined4 uVar17;

+  undefined4 uVar18;

+  uint uVar19;

+  _XResult32 _Var20;

+  undefined4 uVar21;

+  undefined8 uVar22;

+  void *_Dst;

+  char *pcVar23;

+  longlong *plVar24;

+  undefined8 uVar25;

+  longlong lVar26;

+  longlong *plVar27;

+  uint uVar28;

+  size_t _Size;

+  int local_res8;

+  uint local_res10 [2];

+  CRdpAudioController *local_res18;

+  byte local_res20;

+  undefined8 in_stack_ffffffffffffff58;

+  CRdpAudioController *pCVar29;

+  __int64 _Var30;

+  undefined8 in_stack_ffffffffffffff60;

+  uint *puVar31;

+  undefined8 in_stack_ffffffffffffff68;

+  undefined8 uVar32;

+  undefined8 in_stack_ffffffffffffff70;

+  uint local_88;

+  CTSCriticalSection *local_80;

+  uint local_78;

+  int local_74;

+  ulong local_70 [2];

+  CTSCriticalSection *local_68;

+  void *local_60;

+  longlong *local_58;

+  __int64 local_50 [2];

+  

+  uVar21 = (undefined4)((ulonglong)in_stack_ffffffffffffff60 >> 0x20);

+  uVar18 = (undefined4)((ulonglong)in_stack_ffffffffffffff68 >> 0x20);

+  uVar12 = (undefined4)((ulonglong)in_stack_ffffffffffffff58 >> 0x20);

+  uVar17 = (undefined4)((ulonglong)in_stack_ffffffffffffff70 >> 0x20);

+  local_res8 = 0;

+  local_res18 = param_2;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar12 = RdpX_GetActivityIdPrefix();

+    pCVar29 = this;

+    WPP_SF_DP(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x79,

+              &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar12,this);

+    uVar12 = (undefined4)((ulonglong)pCVar29 >> 0x20);

+  }

+  local_res20 = 0;

+  local_88 = 0;

+  local_res10[0] = 0;

+  local_50[0] = 0;

+  *(_XBool32 *)(this + 0x101c0) = param_3;

+  local_60 = (void *)0x0;

+  local_70[0] = 0;

+  iVar13 = PAL_System_TimeGetTickCount(local_70);

+  if (((iVar13 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+     (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+    uVar14 = RdpX_GetActivityIdPrefix();

+    uVar25 = CONCAT44(uVar21,iVar13);

+    uVar12 = 1;

+    WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),10,

+               &WPP_3aa477e76bce3d825a570da1d94c539c_Traceguids,uVar14,

+               "PAL_System_TimeGetTickCount failed",uVar25);

+    uVar21 = (undefined4)((ulonglong)uVar25 >> 0x20);

+  }

+  local_74 = 0;

+  local_58 = (longlong *)0x0;

+  cVar10 = MSRC108255UseKIR();

+  plVar27 = (longlong *)0x0;

+  if (cVar10 != '\0') {

+    local_80 = (CTSCriticalSection *)(this + 0x10148);

+    CTSCriticalSection::Lock(local_80);

+    RdpXSPtr<RdpXInterfaceTapProtocolServerEvents>::operator=

+              ((RdpXSPtr<RdpXInterfaceTapProtocolServerEvents> *)&local_58,

+               (RdpXSPtr<struct_RdpXInterfaceTapProtocolServerEvents> *)(this + 0x100c8));

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_80);

+    plVar27 = local_58;

+  }

+  if (*(char *)param_1 == '\r') {

+    iVar13 = 0x10;

+    local_78 = 0x10;

+    local_60 = param_1;

+    if (6 < *(uint *)(this + 0x1016c)) {

+      *(ulonglong *)(this + 0x10120) = (ulonglong)*(uint *)((longlong)param_1 + 0xc) * 10000;

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar14 = *(undefined4 *)((longlong)param_1 + 0xc);

+        bVar11 = *(byte *)((longlong)param_1 + 8);

+        uVar15 = RdpX_GetActivityIdPrefix();

+        uVar22 = CONCAT44(uVar21,uVar14);

+        uVar25 = CONCAT44(uVar12,(uint)bVar11);

+        WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x7a,

+                   &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar15,uVar25,uVar22);

+        uVar21 = (undefined4)((ulonglong)uVar22 >> 0x20);

+        uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+      }

+      iVar13 = 0x10;

+    }

+  }

+  else {

+    iVar13 = 0xc;

+    local_78 = 0xc;

+  }

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar4 = *(ushort *)((longlong)param_1 + 2);

+    uVar5 = *(ushort *)((longlong)param_1 + 4);

+    uVar6 = *(ushort *)((longlong)param_1 + 6);

+    bVar11 = *(byte *)((longlong)param_1 + 8);

+    uVar14 = RdpX_GetActivityIdPrefix();

+    uVar32 = CONCAT44(uVar18,((uint)uVar4 - iVar13) + 4);

+    uVar22 = CONCAT44(uVar21,(uint)uVar6);

+    uVar25 = CONCAT44(uVar12,(uint)bVar11);

+    WPP_SF_DDDDD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x7d,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar14,uVar25,uVar22,uVar32,

+                 CONCAT44(uVar17,(uint)uVar5));

+    uVar21 = (undefined4)((ulonglong)uVar22 >> 0x20);

+    uVar18 = (undefined4)((ulonglong)uVar32 >> 0x20);

+    uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+  }

+  DetectLoss(this,*(uchar *)((longlong)param_1 + 8));

+  DetectGlitch(this);

+  pCVar1 = (CTSCriticalSection *)(this + 0x10148);

+  local_80 = pCVar1;

+  CTSCriticalSection::Lock(pCVar1);

+  iVar13 = *(int *)(this + 0x10140);

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_80);

+  if (iVar13 == 3) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar12 = RdpX_GetActivityIdPrefix();

+      WPP_SF_DqD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x7e,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar12,this,CONCAT44(uVar21,3));

+    }

+    SendConfirmation(this,*(uchar *)((longlong)param_1 + 8),*(ushort *)((longlong)param_1 + 4));

+    goto LAB_0;

+  }

+  if (((local_60 != (void *)0x0) &&

+      (lVar26 = (ulonglong)*(uint *)((longlong)local_60 + 0xc) * 10000, lVar26 != 0)) &&

+     (lVar26 < *(longlong *)(this + 0x101a0))) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      RdpX_GetActivityIdPrefix();

+      WPP_SF_Dqdii(*(undefined8 *)(WPP_GLOBAL_Control + 0x10));

+    }

+    SendConfirmation(this,*(uchar *)((longlong)param_1 + 8),*(ushort *)((longlong)param_1 + 4));

+    local_res8 = 0;

+    goto LAB_0;

+  }

+  local_68 = pCVar1;

+  CTSCriticalSection::Lock(pCVar1);

+  if (*(int *)(this + 0x10140) == 3) {

+LAB_1:

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_68);

+    goto LAB_0;

+  }

+  cVar10 = MSRC108255UseKIR();

+  if (*(int *)(this + 0x10140) == 1) {

+    if (cVar10 == '\0') {

+      if ((*(longlong **)(this + 0x100c8) == (longlong *)0x0) ||

+         (local_res8 = (**(code **)(**(longlong **)(this + 0x100c8) + 0x28))(), -1 < local_res8))

+      goto LAB_2;

+      if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+         (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+        uVar12 = RdpX_GetActivityIdPrefix();

+        uVar25 = 0x81;

+        pcVar23 = "m_spPlayback->Start failed.";

+        goto LAB_3;

+      }

+    }

+    else {

+      if ((plVar27 == (longlong *)0x0) ||

+         (local_res8 = (**(code **)(*plVar27 + 0x28))(plVar27), -1 < local_res8))

+      goto LAB_2;

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar12 = RdpX_GetActivityIdPrefix();

+        uVar25 = 0x80;

+        pcVar23 = "spPlayback->Start failed.";

+LAB_3:

+        WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar25,

+                   &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar12,pcVar23,

+                   CONCAT44(uVar21,local_res8));

+      }

+    }

+LAB_4:

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_68);

+    goto LAB_0;

+  }

+LAB_2:

+  *(undefined4 *)(this + 0x10140) = 2;

+  if (5 < *(uint *)(this + 0x1016c)) {

+    lVar16 = SendConfirmation(this,*(uchar *)((longlong)param_1 + 8),

+                              *(ushort *)((longlong)param_1 + 4));

+    if ((((lVar16 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar17 = RdpX_GetActivityIdPrefix();

+      uVar25 = CONCAT44(uVar21,lVar16);

+      uVar12 = 1;

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x82,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,

+                 "SendConfirmation() failed.",uVar25);

+      uVar21 = (undefined4)((ulonglong)uVar25 >> 0x20);

+    }

+    local_res8 = 0;

+  }

+  uVar28 = local_78;

+  uVar4 = *(ushort *)((longlong)param_1 + 2);

+  if ((ulonglong)uVar4 < (ulonglong)local_78 - 4) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar18 = RdpX_GetActivityIdPrefix();

+      WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x83,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar18,

+                 CONCAT44(uVar12,(uint)uVar4),CONCAT44(uVar21,uVar28));

+    }

+    goto LAB_1;

+  }

+  local_80 = (CTSCriticalSection *)RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+    CVar2 = this[0x1013c];

+    uVar12 = RdpX_GetActivityIdPrefix();

+    uVar25 = CONCAT44(uVar21,(uint)(byte)CVar2);

+    pCVar29 = this;

+    WPP_SF_DqD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x84,

+               &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar12,this,uVar25);

+    uVar21 = (undefined4)((ulonglong)uVar25 >> 0x20);

+    uVar12 = (undefined4)((ulonglong)pCVar29 >> 0x20);

+  }

+  bVar11 = local_res20;

+  if (this[0x1013c] == (CRdpAudioController)0x0) {

+    local_res20 = 1;

+    DetermineJitterBufferSize(this);

+    local_88 = *(uint *)(this + 0x10168);

+    *(undefined4 *)(this + 0x10180) = 0;

+    *(undefined8 *)(this + 0x10188) = 0;

+    uVar25 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+    *(undefined8 *)(this + 0x100f8) = uVar25;

+    *(undefined8 *)(this + 0x101a0) = 0;

+    bVar11 = 1;

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        (bVar11 = 1, (WPP_GLOBAL_Control[0x1c] & 4) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19]))

+    {

+      lVar26 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+      uVar17 = RdpX_GetActivityIdPrefix();

+      uVar22 = CONCAT44(uVar21,local_88);

+      uVar25 = CONCAT44(uVar12,(int)(lVar26 / 10000));

+      WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x85,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,uVar25,uVar22);

+      uVar21 = (undefined4)((ulonglong)uVar22 >> 0x20);

+      uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+      bVar11 = local_res20;

+    }

+  }

+  this[0x1013c] = (CRdpAudioController)0x1;

+  if (((this[0x10171] == (CRdpAudioController)0x0) || (bVar11 != 0)) ||

+     (*(CRDPAudioVideoSyncHandler **)(this + 0x101b0) == (CRDPAudioVideoSyncHandler *)0x0))

+  goto LAB_5;

+  CRDPAudioVideoSyncHandler::GetAggregatedLag

+            (*(CRDPAudioVideoSyncHandler **)(this + 0x101b0),local_50);

+  _Var9 = local_50[0];

+  lVar26 = 0x346dc5d63886594b;

+  if (local_50[0] < 0) {

+    lVar26 = -0x346dc5d63886594b;

+  }

+  uVar28 = (int)(SUB168(SEXT816(lVar26) * SEXT816(local_50[0]),8) >> 0xb) -

+           (SUB164(SEXT816(lVar26) * SEXT816(local_50[0]),0xc) >> 0x1f);

+  if ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) {

+    if (((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0) &&

+       (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      RdpX_GetActivityIdPrefix();

+      _Var30 = _Var9;

+      WPP_SF_DiLd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10));

+      uVar12 = (undefined4)((ulonglong)_Var30 >> 0x20);

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+       (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      iVar13 = *(int *)(this + 0x101a8);

+      uVar12 = RdpX_GetActivityIdPrefix();

+      uVar25 = CONCAT44(uVar21,-iVar13);

+      lVar26 = _Var9 / 10000;

+      WPP_SF_DqD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x87,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar12,lVar26,uVar25);

+      uVar21 = (undefined4)((ulonglong)uVar25 >> 0x20);

+      uVar12 = (undefined4)((ulonglong)lVar26 >> 0x20);

+    }

+  }

+  if (((_Var9 < 1) || (uVar28 < 0x33)) || (999 < *(uint *)(this + 0x10180))) {

+    if ((_Var9 < 0) && (_Var9 / 10000 <= (longlong)-*(int *)(this + 0x101a8))) {

+      if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+         (((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0 &&

+          (4 < (byte)WPP_GLOBAL_Control[0x19])))) {

+        uVar25 = *(undefined8 *)(this + 0x10188);

+        uVar22 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+        uVar12 = RdpX_GetActivityIdPrefix();

+        WPP_SF_Dqq(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x8c,

+                   &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar12,uVar22,uVar25);

+        uVar21 = (undefined4)((ulonglong)uVar25 >> 0x20);

+        uVar12 = (undefined4)((ulonglong)uVar22 >> 0x20);

+      }

+      lVar26 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+      uVar19 = *(uint *)(this + 0x101ac);

+      lVar26 = (lVar26 - *(longlong *)(this + 0x10188)) / 10000;

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+         (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar17 = RdpX_GetActivityIdPrefix();

+        uVar25 = CONCAT44(uVar12,(uint)(lVar26 <= (longlong)(ulonglong)uVar19));

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x8d,

+                  &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,uVar25);

+        uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+      }

+      if (((longlong)(ulonglong)uVar19 < lVar26) || (*(longlong *)(this + 0x10188) == 0)) {

+        if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+           (((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0 &&

+            (2 < (byte)WPP_GLOBAL_Control[0x19])))) {

+          uVar17 = RdpX_GetActivityIdPrefix();

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x8e,

+                   &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17);

+        }

+        if (*(int *)(this + 0x10180) == 0) {

+LAB_6:

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 4) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+            lVar26 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+            uVar17 = RdpX_GetActivityIdPrefix();

+            uVar22 = CONCAT44(uVar21,uVar28);

+            uVar25 = CONCAT44(uVar12,(int)(lVar26 / 10000));

+            WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x90,

+                       &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,uVar25,uVar22);

+            uVar21 = (undefined4)((ulonglong)uVar22 >> 0x20);

+            uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+          }

+        }

+        else {

+          *(undefined4 *)(this + 0x10180) = 0;

+          if ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) {

+            if (((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0) &&

+               (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar17 = RdpX_GetActivityIdPrefix();

+              WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x8f,

+                       &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17);

+            }

+            goto LAB_6;

+          }

+        }

+        if (200 < uVar28) {

+          uVar28 = 200;

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+             (uVar28 = 200, 4 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar17 = RdpX_GetActivityIdPrefix();

+            uVar25 = CONCAT44(uVar12,200);

+            WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x91,

+                      &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,uVar25);

+            uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+          }

+        }

+        uVar25 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+        *(undefined8 *)(this + 0x10188) = uVar25;

+        local_74 = 1;

+        local_res20 = 1;

+        goto LAB_7;

+      }

+    }

+  }

+  else {

+    if (200 < uVar28) {

+      uVar28 = 200;

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+         (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar17 = RdpX_GetActivityIdPrefix();

+        uVar25 = CONCAT44(uVar12,200);

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x88,

+                  &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,uVar25);

+        uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+        uVar28 = 200;

+      }

+    }

+    uVar19 = 1000 - *(int *)(this + 0x10180);

+    if ((((uVar19 < uVar28) &&

+         (uVar28 = uVar19, (undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+        ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+       (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar17 = RdpX_GetActivityIdPrefix();

+      uVar25 = CONCAT44(uVar12,uVar19);

+      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x89,

+                &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,uVar25);

+      uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+    }

+    uVar19 = *(int *)(this + 0x10180) + uVar28;

+    *(uint *)(this + 0x10180) = uVar19;

+    if (((999 < uVar19) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+       (((WPP_GLOBAL_Control[0x1c] & 4) != 0 && (4 < (byte)WPP_GLOBAL_Control[0x19])))) {

+      lVar26 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+      uVar17 = RdpX_GetActivityIdPrefix();

+      uVar22 = CONCAT44(uVar21,uVar19);

+      uVar25 = CONCAT44(uVar12,(int)(lVar26 / 10000));

+      WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x8a,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,uVar25,uVar22);

+      uVar21 = (undefined4)((ulonglong)uVar22 >> 0x20);

+      uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+    }

+    local_res20 = 1;

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+       (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar17 = *(undefined4 *)(this + 0x10180);

+      uVar14 = RdpX_GetActivityIdPrefix();

+      uVar22 = CONCAT44(uVar21,uVar17);

+      uVar25 = CONCAT44(uVar12,uVar28);

+      WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x8b,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar14,uVar25,uVar22);

+      uVar21 = (undefined4)((ulonglong)uVar22 >> 0x20);

+      uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+    }

+LAB_7:

+    local_88 = (uVar28 * 0x2b110) / 1000 & 0xfffffffe;

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 4) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      lVar26 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+      uVar17 = RdpX_GetActivityIdPrefix();

+      uVar22 = CONCAT44(uVar21,uVar28);

+      uVar25 = CONCAT44(uVar12,(int)(lVar26 / 10000));

+      WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x92,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,uVar25,uVar22);

+      uVar21 = (undefined4)((ulonglong)uVar22 >> 0x20);

+      uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+    }

+    CRDPAudioVideoSyncHandler::ResetLaggingTime(*(CRDPAudioVideoSyncHandler **)(this + 0x101b0));

+  }

+LAB_5:

+  if ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) {

+    if (((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0) &&

+       (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar17 = RdpX_GetActivityIdPrefix();

+      uVar32 = CONCAT44(uVar18,local_88);

+      uVar22 = CONCAT44(uVar21,(uint)local_res20);

+      uVar25 = CONCAT44(uVar12,local_74);

+      WPP_SF_DdDd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x93,

+                  &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,uVar25,uVar22,uVar32);

+      uVar21 = (undefined4)((ulonglong)uVar22 >> 0x20);

+      uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+      uVar18 = (undefined4)((ulonglong)uVar32 >> 0x20);

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+       (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar17 = *(undefined4 *)(this + 0x10180);

+      uVar14 = RdpX_GetActivityIdPrefix();

+      uVar25 = CONCAT44(uVar12,uVar17);

+      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x94,

+                &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar14,uVar25);

+      uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+    }

+  }

+  pCVar1 = local_80;

+  if (local_res20 != 0) {

+    *(CTSCriticalSection **)(this + 0x100e0) = local_80;

+  }

+  if ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) {

+    if (((WPP_GLOBAL_Control[0x1c] & 4) != 0) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      bVar11 = *(byte *)((longlong)param_1 + 8);

+      lVar26 = (longlong)local_80 - *(longlong *)(this + 0x100e0);

+      uVar17 = RdpX_GetActivityIdPrefix();

+      uVar32 = CONCAT44(uVar18,(int)(lVar26 / 10000));

+      uVar22 = CONCAT44(uVar21,(uint)bVar11);

+      uVar25 = CONCAT44(uVar12,(int)((longlong)pCVar1 / 10000));

+      WPP_SF_DdDd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x95,

+                  &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,uVar25,uVar22,uVar32);

+      uVar21 = (undefined4)((ulonglong)uVar22 >> 0x20);

+      uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+      uVar18 = (undefined4)((ulonglong)uVar32 >> 0x20);

+    }

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 4) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      bVar11 = *(byte *)((longlong)param_1 + 8);

+      lVar26 = *(longlong *)(this + 0x100e0);

+      uVar17 = RdpX_GetActivityIdPrefix();

+      uVar22 = CONCAT44(uVar21,(uint)bVar11);

+      uVar25 = CONCAT44(uVar12,(int)((longlong)pCVar1 / 10000));

+      WPP_SF_DdDd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x96,

+                  &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,uVar25,uVar22,

+                  CONCAT44(uVar18,(int)(((longlong)pCVar1 - lVar26) / 10000)));

+      uVar21 = (undefined4)((ulonglong)uVar22 >> 0x20);

+      uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+    }

+  }

+  bVar11 = local_res20;

+  uVar28 = *(uint *)(this + 0x94);

+  *(CTSCriticalSection **)(this + 0x100e0) = pCVar1;

+  uVar4 = *(ushort *)((longlong)param_1 + 6);

+  if (uVar28 != uVar4) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar18 = RdpX_GetActivityIdPrefix();

+      uVar22 = CONCAT44(uVar21,(uint)uVar4);

+      uVar25 = CONCAT44(uVar12,uVar28);

+      WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x97,

+                 &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar18,uVar25,uVar22);

+      uVar21 = (undefined4)((ulonglong)uVar22 >> 0x20);

+      uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+    }

+    local_res8 = OnNewFormat(this,(uint)*(ushort *)((longlong)param_1 + 6));

+    if (local_res8 != 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar21 = RdpX_GetActivityIdPrefix();

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x98,

+                  &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar21,

+                  CONCAT44(uVar12,local_res8));

+      }

+      goto LAB_4;

+    }

+    uVar28 = (uint)*(ushort *)((longlong)param_1 + 6);

+    *(uint *)(this + 0x94) = uVar28;

+  }

+  this[0x1013d] = *(CRdpAudioController *)((longlong)param_1 + 8);

+  if (*(longlong *)(this + 0x88) == 0) goto LAB_1;

+  sVar7 = **(short **)(*(longlong *)(this + 0x88) + (ulonglong)uVar28 * 8);

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_68);

+  if ((sVar7 == 1) &&

+     (iVar13 = (**(code **)(**(longlong **)(this + 0x100c0) + 0x50))(), iVar13 == 0)) {

+    local_res10[0] = (*(ushort *)((longlong)param_1 + 2) - local_78) + 4;

+    pCVar29 = local_res18;

+  }

+  else {

+    if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+       (((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0 && (4 < (byte)WPP_GLOBAL_Control[0x19])

+        ))) {

+      uVar21 = RdpX_GetActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x99,

+               &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar21);

+    }

+    puVar31 = local_res10;

+    uVar25 = CONCAT44(uVar12,0x10000);

+    _Var20 = (**(code **)(**(longlong **)(this + 0x100c0) + 0x48))

+                       (*(longlong **)(this + 0x100c0),local_res18,

+                        (*(ushort *)((longlong)param_1 + 2) - local_78) + 4,this + 0xac,uVar25,

+                        puVar31);

+    uVar21 = (undefined4)((ulonglong)puVar31 >> 0x20);

+    uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+    pCVar29 = this + 0xac;

+    if (_Var20 != 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+         (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar21 = RdpX_GetActivityIdPrefix();

+        WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x9a,

+                  &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar21,

+                  CONCAT44(uVar12,local_res8));

+      }

+      local_res8 = MapXResultToHR(_Var20);

+      goto LAB_0;

+    }

+  }

+  local_res18 = pCVar29;

+  if (local_74 != 0) {

+    CleanData(this);

+    cVar10 = MSRC108255UseKIR();

+    if (cVar10 == '\0') {

+      plVar24 = *(longlong **)(this + 0x100c8);

+      lVar26 = *plVar24;

+LAB_8:

+      (**(code **)(lVar26 + 0x38))(plVar24);

+    }

+    else if (plVar27 != (longlong *)0x0) {

+      lVar26 = *plVar27;

+      plVar24 = plVar27;

+      goto LAB_8;

+    }

+    bVar11 = 1;

+    local_res20 = 1;

+  }

+  uVar28 = local_res10[0];

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+    bVar3 = *(byte *)((longlong)param_1 + 8);

+    uVar18 = RdpX_GetActivityIdPrefix();

+    uVar22 = CONCAT44(uVar21,uVar28);

+    uVar25 = CONCAT44(uVar12,(uint)bVar3);

+    WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x9b,

+               &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar18,uVar25,uVar22);

+    uVar21 = (undefined4)((ulonglong)uVar22 >> 0x20);

+    uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+  }

+  _Size = (size_t)local_res10[0];

+  if (((bVar11 != 0) &&

+      (_Size = _Size + local_88, (undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+     (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (4 < (byte)WPP_GLOBAL_Control[0x19])))) {

+    uVar18 = RdpX_GetActivityIdPrefix();

+    uVar25 = CONCAT44(uVar12,local_88);

+    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x9c,

+              &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar18,uVar25);

+    uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+  }

+  uVar28 = local_res10[0];

+  puVar8 = WPP_GLOBAL_Control;

+  _Dst = malloc(_Size);

+  if (_Dst == (void *)0x0) {

+    if ((((undefined **)puVar8 != &WPP_GLOBAL_Control) && ((puVar8[0x1c] & 1) != 0)) &&

+       (1 < (byte)puVar8[0x19])) {

+      uVar21 = RdpX_GetActivityIdPrefix();

+      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x9d,

+                &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar21,CONCAT44(uVar12,(int)_Size))

+      ;

+    }

+    local_res8 = -0x7ff8fff2;

+    goto LAB_0;

+  }

+  memset(_Dst,0,_Size);

+  if ((local_res20 == 0) || (local_88 == 0)) {

+    memcpy(_Dst,local_res18,(ulonglong)uVar28);

+  }

+  else {

+    memset(_Dst,0,(ulonglong)local_88);

+    memcpy((void *)((ulonglong)local_88 + (longlong)_Dst),local_res18,(ulonglong)uVar28);

+    local_res10[0] = uVar28 + local_88;

+  }

+  cVar10 = MSRC108255UseKIR();

+  if (cVar10 == '\0') {

+    plVar27 = *(longlong **)(this + 0x100c8);

+    if (plVar27 != (longlong *)0x0) {

+      uVar25 = CONCAT44(uVar12,local_res10[0]);

+      local_res8 = (**(code **)(*plVar27 + 0x50))

+                             (plVar27,*(undefined1 *)((longlong)param_1 + 8),

+                              *(undefined2 *)((longlong)param_1 + 4),_Dst,uVar25);

+      uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+      if (local_res8 == 0) {

+        if ((*(uint *)(this + 0x1016c) < 7) ||

+           (local_res8 = SaveDataBufferedInDevice

+                                   (this,*(uchar *)((longlong)param_1 + 8),

+                                    *(ushort *)((longlong)param_1 + 4),

+                                    *(ulong *)((longlong)local_60 + 0xc),local_res10[0],local_88,

+                                    local_70[0]), -1 < local_res8)) {

+          iVar13 = *(int *)(this + 0x10108) + local_res10[0];

+          *(int *)(this + 0x10108) = iVar13;

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar18 = RdpX_GetActivityIdPrefix();

+            uVar25 = CONCAT44(uVar12,iVar13);

+            WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xa4,

+                      &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar18,uVar25);

+            uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+          }

+          uVar25 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+          local_80 = (CTSCriticalSection *)0x0;

+          *(undefined8 *)(this + 0x10178) = uVar25;

+          GetRemotePresentationTime(this + 0x40,(__int64 *)&local_80);

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 4) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+            lVar26 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+            uVar18 = (undefined4)(lVar26 / 10000);

+            uVar17 = RdpX_GetActivityIdPrefix();

+            lVar26 = SUB168(SEXT816(0x346dc5d63886594b) * SEXT816((longlong)local_80),8);

+            uVar25 = 0xa5;

+            goto LAB_9;

+          }

+        }

+        else if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+          uVar12 = RdpX_GetActivityIdPrefix();

+          uVar25 = 0xa3;

+          goto LAB_10;

+        }

+      }

+      else if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+               ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar21 = RdpX_GetActivityIdPrefix();

+        uVar25 = 0xa2;

+        goto LAB_11;

+      }

+    }

+  }

+  else if (plVar27 != (longlong *)0x0) {

+    uVar25 = CONCAT44(uVar12,local_res10[0]);

+    local_res8 = (**(code **)(*plVar27 + 0x50))

+                           (plVar27,*(undefined1 *)((longlong)param_1 + 8),

+                            *(undefined2 *)((longlong)param_1 + 4),_Dst,uVar25);

+    uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+    if (local_res8 == 0) {

+      if ((*(uint *)(this + 0x1016c) < 7) ||

+         (local_res8 = SaveDataBufferedInDevice

+                                 (this,*(uchar *)((longlong)param_1 + 8),

+                                  *(ushort *)((longlong)param_1 + 4),

+                                  *(ulong *)((longlong)local_60 + 0xc),local_res10[0],local_88,

+                                  local_70[0]), -1 < local_res8)) {

+        iVar13 = *(int *)(this + 0x10108) + local_res10[0];

+        *(int *)(this + 0x10108) = iVar13;

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar18 = RdpX_GetActivityIdPrefix();

+          uVar25 = CONCAT44(uVar12,iVar13);

+          WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xa0,

+                    &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar18,uVar25);

+          uVar12 = (undefined4)((ulonglong)uVar25 >> 0x20);

+        }

+        uVar25 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+        local_80 = (CTSCriticalSection *)0x0;

+        *(undefined8 *)(this + 0x10178) = uVar25;

+        GetRemotePresentationTime(this + 0x40,(__int64 *)&local_80);

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 4) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+          lVar26 = RdpX_DateTime_GetHighResolutionTimeSinceReboot();

+          uVar18 = (undefined4)(lVar26 / 10000);

+          uVar17 = RdpX_GetActivityIdPrefix();

+          lVar26 = SUB168(SEXT816(0x346dc5d63886594b) * SEXT816((longlong)local_80),8);

+          uVar25 = 0xa1;

+LAB_9:

+          WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar25,

+                     &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar17,

+                     CONCAT44(uVar12,(int)(lVar26 >> 0xb) - (int)(lVar26 >> 0x3f)),

+                     CONCAT44(uVar21,uVar18));

+        }

+      }

+      else if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+        uVar12 = RdpX_GetActivityIdPrefix();

+        uVar25 = 0x9f;

+LAB_10:

+        WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar25,

+                   &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar12,

+                   "SaveDataBufferedInDevice failed",CONCAT44(uVar21,local_res8));

+      }

+    }

+    else if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+             ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar21 = RdpX_GetActivityIdPrefix();

+      uVar25 = 0x9e;

+LAB_11:

+      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar25,

+                &WPP_4711615244a434b31b024eca4940ee0c_Traceguids,uVar21,CONCAT44(uVar12,local_res8))

+      ;

+    }

+  }

+  free(_Dst);

+LAB_0:

+  RdpXSPtr<RdpXInterfaceCriticalSection>::SafeRelease

+            ((RdpXSPtr<RdpXInterfaceCriticalSection> *)&local_58);

+  return local_res8;

+}

+
```

## `CClipBase::~CClipBase`  (modified)

```diff
--- CClipBase::~CClipBase
+++ CClipBase::~CClipBase
@@ -1,2 +1,46 @@
-Failed to decompile mstscax.dll - .ProgramDB CClipBase::~CClipBase : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual __cdecl CClipBase::~CClipBase(void) __ptr64 */

+

+void __thiscall CClipBase::~CClipBase(CClipBase *this)

+

+{

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x358));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x348));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x340));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x338));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x330));

+  EnterpriseClipboardApi::Terminate((EnterpriseClipboardApi *)(this + 800));

+  CFormatListCache::~CFormatListCache((CFormatListCache *)(this + 0x2f0));

+  SmartMap<CFileContentsReaderManager,unsigned_long>::

+  ~SmartMap<CFileContentsReaderManager,unsigned_long>

+            ((SmartMap<CFileContentsReaderManager,unsigned_long> *)(this + 0x2b0));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x2a8));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x2a0));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x298));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x290));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x288));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x280));

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x278));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x270));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x268));

+  TCntPtr<CTSObjectPool<CRDPENCCONStreamBufferPoolObject>_>::SafeRelease

+            ((TCntPtr<CTSObjectPool<CRDPENCCONStreamBufferPoolObject>_> *)(this + 0x160));

+  *(undefined8 *)(this + 0x140) = 0;

+  CHdropToFgdConverter::ClearFgdCache((CHdropToFgdConverter *)(this + 0x128));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x120));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x118));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x110));

+  CFormatIdMap::Clear((CFormatIdMap *)(this + 200));

+  *(undefined ***)this = CTSUnknown::vftable_for_INonDelegatingUnknown_;

+  *(uint *)(this + 0x1c) = *(uint *)(this + 0x1c) | 8;

+  *(undefined ***)(this + 8) = CTSObject::vftable;

+  return;

+}

+
```

## `CProxyDataObjectManager::CProxyDataObjectManager`  (modified)

```diff
--- CProxyDataObjectManager::CProxyDataObjectManager
+++ CProxyDataObjectManager::CProxyDataObjectManager
@@ -1,2 +1,49 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyDataObjectManager::CProxyDataObjectManager : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: __cdecl CProxyDataObjectManager::CProxyDataObjectManager(class IFormatDataAcquire *

+   __ptr64,class CProxyStreamManager * __ptr64) __ptr64 */

+

+CProxyDataObjectManager * __thiscall

+CProxyDataObjectManager::CProxyDataObjectManager

+          (CProxyDataObjectManager *this,IFormatDataAcquire *param_1,CProxyStreamManager *param_2)

+

+{

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *this_00;

+  bool bVar1;

+  

+  *(undefined4 *)(this + 0x18) = 0xdbcaabcd;

+  *(char **)(this + 0x10) = "CProxyDataObjectManager";

+  this_00 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x68);

+  *(undefined4 *)(this + 0x1c) = 1;

+  *(undefined ***)this = CTSUnknown::vftable_for_INonDelegatingUnknown_;

+  *(CProxyDataObjectManager **)(this + 0x20) = this;

+  *(undefined ***)(this + 8) = CTSUnknown::vftable_for_CTSObject_;

+  *(undefined4 *)(this + 0x28) = 0;

+  *(undefined ***)this = &CBasePlayer::_vftable__for__INonDelegatingUnknown__;

+  *(undefined8 *)this_00 = 0;

+  *(undefined8 *)(this + 0x70) = 0;

+  *(undefined8 *)(this + 0x78) = 0;

+  *(undefined4 *)(this + 0x80) = 0;

+  *(undefined8 *)(this + 0x88) = 0;

+  *(undefined8 *)(this + 0x90) = 0;

+  *(undefined8 *)(this + 200) = 0;

+  *(undefined8 *)(this + 0xd0) = 0;

+  *(undefined ***)(this + 8) = &_vftable__for__CTSObject__;

+  *(IFormatDataAcquire **)(this + 0x60) = param_1;

+  if (param_2 != (CProxyStreamManager *)0x0) {

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(this_00);

+    *(CProxyStreamManager **)this_00 = param_2;

+    TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+              ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)this_00);

+  }

+  *(undefined4 *)(this + 0x30) = 0;

+  *(undefined4 *)(this + 0x98) = 0;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3624641849>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar1) {

+    InitializeCriticalSection((LPCRITICAL_SECTION)(this + 0xa0));

+  }

+  return this;

+}

+
```

## `CProxyStream::~CProxyStream`  (modified)

```diff
--- CProxyStream::~CProxyStream
+++ CProxyStream::~CProxyStream
@@ -1,2 +1,70 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyStream::~CProxyStream : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: virtual __cdecl CProxyStream::~CProxyStream(void) __ptr64 */

+

+void __thiscall CProxyStream::~CProxyStream(CProxyStream *this)

+

+{

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *this_00;

+  undefined4 uVar1;

+  undefined4 uVar2;

+  CProxyStreamManager *this_01;

+  bool bVar3;

+  uint uVar4;

+  CProxyStreamManager *local_res8;

+  

+  *(undefined ***)this = &_vftable__for__INonDelegatingUnknown__;

+  *(undefined ***)(this + 8) = &_vftable__for__CTSObject__;

+  *(undefined ***)(this + 0x30) = &_vftable_;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar1 = *(undefined4 *)(this + 0x68);

+    uVar2 = *(undefined4 *)(this + 0xb4);

+    uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x25,

+               &WPP_0590a41147183e8365b9646d033b00c8_Traceguids,uVar4,uVar2,uVar1);

+  }

+  this_00 = (TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xc0);

+  if (*(longlong *)this_00 != 0) {

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease(this_00);

+    *(undefined8 *)this_00 = 0;

+  }

+  bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3624641849>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar3) {

+    EnterCriticalSection((LPCRITICAL_SECTION)(this + 0x40));

+    this_01 = *(CProxyStreamManager **)(this + 0x38);

+    local_res8 = this_01;

+    TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+              ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)&local_res8);

+    LeaveCriticalSection((LPCRITICAL_SECTION)(this + 0x40));

+    if (this_01 != (CProxyStreamManager *)0x0) {

+      CProxyStreamManager::UnregisterProxyStreamObjectForTracking(this_01,*(ulong *)(this + 0x68));

+    }

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+              ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)&local_res8);

+  }

+  *(undefined8 *)(this + 0x38) = 0;

+  *(undefined8 *)(this + 0x80) = 0;

+  *(undefined8 *)(this + 0x90) = 0;

+  if (*(HLOCAL *)(this + 0xa0) != (HLOCAL)0x0) {

+    LocalFree(*(HLOCAL *)(this + 0xa0));

+    *(undefined8 *)(this + 0xa0) = 0;

+  }

+  bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3624641849>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar3) {

+    DeleteCriticalSection((LPCRITICAL_SECTION)(this + 0x40));

+  }

+  *(uint *)(this + 0x1c) = *(uint *)(this + 0x1c) | 4;

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0xc0));

+  *(undefined ***)this = CTSUnknown::vftable_for_INonDelegatingUnknown_;

+  *(uint *)(this + 0x1c) = *(uint *)(this + 0x1c) | 8;

+  *(undefined ***)(this + 8) = CTSObject::vftable;

+  return;

+}

+
```

## `CaCpuDecompressor::Initialize`  (modified)

```diff
--- CaCpuDecompressor::Initialize
+++ CaCpuDecompressor::Initialize
@@ -1,2 +1,68 @@
-Failed to decompile mstscax.dll - .ProgramDB CaCpuDecompressor::Initialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: long __cdecl CaCpuDecompressor::Initialize(unsigned char * __ptr64,unsigned

+   int,unsigned int * __ptr64) __ptr64 */

+

+long __thiscall

+CaCpuDecompressor::Initialize(CaCpuDecompressor *this,uchar *param_1,uint param_2,uint *param_3)

+

+{

+  bool bVar1;

+  long lVar2;

+  longlong lVar3;

+  ulonglong uVar4;

+  uint local_res10 [2];

+  int local_28;

+  int local_24;

+  

+  local_res10[0] = 0;

+  if (param_1 != (uchar *)0x0) {

+    lVar2 = CacCommon::InitDecoderProps

+                      (CONCAT71((int7)((ulonglong)&local_28 >> 8),0x1c),param_2,param_1,local_res10,

+                       &local_28);

+    if (lVar2 < 0) goto LAB_0;

+    bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_553358650> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_553358650>::GetImpl(void)'

+                        ::__l2::impl);

+    if ((((!bVar1) || ((0 < local_28 && (0 < local_24)))) && (local_28 < 0x3e81)) &&

+       (local_24 < 0x3e81)) {

+      lVar3 = PAL_System_MemAlloc(0x400,1);

+      *(longlong *)(this + 0x60) = lVar3;

+      if (lVar3 != 0) {

+        *(undefined4 *)(this + 0x58) = 0x80;

+        bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>::__private_IsEnabled

+                          ((FeatureImpl<__WilFeatureTraits_Feature_553358650> *)

+                           &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_553358650>::GetImpl(void)'

+                            ::__l2::impl);

+        if (bVar1) {

+          uVar4 = (longlong)local_24 * (longlong)local_28 * 4;

+          if (0x7fffffff < uVar4) {

+            lVar2 = -0x7ff8fdea;

+            goto LAB_0;

+          }

+        }

+        else {

+          uVar4 = (ulonglong)(uint)(local_24 * local_28 * 4);

+        }

+        *(int *)(this + 0x40) = (int)uVar4;

+        lVar3 = PAL_System_MemAlloc((longlong)(int)uVar4,1);

+        *(longlong *)(this + 0x48) = lVar3;

+        if (lVar3 != 0) {

+          lVar2 = Cac::CacCodec::CreateDecoder((DecoderProps *)&local_28,(IDecoder **)(this + 0x38))

+          ;

+          if (-1 < lVar2) {

+            lVar2 = 0;

+          }

+          goto LAB_0;

+        }

+      }

+      lVar2 = -0x7ff8fff2;

+      goto LAB_0;

+    }

+  }

+  lVar2 = -0x7ff8ffa9;

+LAB_0:

+  *param_3 = local_res10[0];

+  return lVar2;

+}

+
```

## `CSndInputChannelCallback::OnFormatsReceived`  (modified)

```diff
--- CSndInputChannelCallback::OnFormatsReceived
+++ CSndInputChannelCallback::OnFormatsReceived
@@ -1,2 +1,315 @@
-Failed to decompile mstscax.dll - .ProgramDB CSndInputChannelCallback::OnFormatsReceived : 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 CSndInputChannelCallback::OnFormatsReceived(unsigned char *

+   __ptr64,unsigned long) __ptr64 */

+

+long __thiscall

+CSndInputChannelCallback::OnFormatsReceived

+          (CSndInputChannelCallback *this,uchar *param_1,ulong param_2)

+

+{

+  CTSCriticalSection *this_00;

+  CSndInputChannelCallback *pCVar1;

+  uchar *puVar2;

+  bool bVar3;

+  uint uVar4;

+  int iVar5;

+  uint uVar6;

+  long lVar7;

+  uint uVar8;

+  undefined1 *puVar9;

+  __uint64 _Var10;

+  CSndInputChannelCallback *_Dst;

+  void *pvVar11;

+  longlong lVar12;

+  char *pcVar13;

+  ulonglong uVar14;

+  undefined8 uVar15;

+  longlong *plVar16;

+  longlong *plVar17;

+  undefined1 local_res8 [8];

+  CTSCriticalSection *local_res10;

+  ulong local_res18 [2];

+  uint local_res20;

+  CTSCriticalSection *local_90;

+  tWAVEFORMATEX *local_88;

+  uint local_80;

+  undefined1 *local_78;

+  longlong *local_70;

+  longlong *local_68;

+  uint local_60;

+  uchar *local_58;

+  

+  local_res10 = (CTSCriticalSection *)param_1;

+  local_res18[0] = param_2;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])

+     ) {

+    uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x59,

+              &WPP_f208c3f4e6be38a0d52dfbc3aa0d224e_Traceguids,uVar4,param_2);

+  }

+  local_res20 = 0;

+  this_00 = (CTSCriticalSection *)(this + 0x101f0);

+  plVar17 = (longlong *)0x0;

+  local_58 = (uchar *)0x0;

+  plVar16 = (longlong *)0x0;

+  local_78 = (undefined1 *)0x0;

+  local_res8[0] = 0;

+  local_68 = (longlong *)0x0;

+  local_70 = (longlong *)0x0;

+  local_90 = this_00;

+  CTSCriticalSection::Lock(this_00);

+  pCVar1 = this + 0x101e0;

+  if (*(longlong *)pCVar1 != 0) {

+    uVar14 = 0;

+    if (*(int *)(this + 0x101e8) != 0) {

+      do {

+        pvVar11 = *(void **)(*(longlong *)pCVar1 + uVar14 * 8);

+        if (pvVar11 != (void *)0x0) {

+          operator_delete(pvVar11);

+          *(undefined8 *)(*(longlong *)pCVar1 + uVar14 * 8) = 0;

+        }

+        uVar4 = (int)uVar14 + 1;

+        uVar14 = (ulonglong)uVar4;

+      } while (uVar4 < *(uint *)(this + 0x101e8));

+    }

+    operator_delete(*(void **)pCVar1);

+    *(longlong *)pCVar1 = 0;

+    *(undefined4 *)(this + 0x101e8) = 0;

+    param_1 = (uchar *)local_res10;

+  }

+  if (*(longlong *)(this + 0x40) != 0) {

+    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_70);

+    plVar16 = *(longlong **)(this + 0x40);

+    local_70 = plVar16;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_70);

+  }

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_90);

+  if (local_res18[0] < 9) {

+    iVar5 = -0x7ff8ffa9;

+    goto LAB_0;

+  }

+  if ((plVar16 != (longlong *)0x0) && (iVar5 = (**(code **)(*plVar16 + 0x18))(plVar16), iVar5 != 0))

+  {

+    (**(code **)(*plVar16 + 0x160))(plVar16,param_1,local_res18);

+  }

+  uVar4 = *(uint *)(param_1 + 1);

+  local_80 = uVar4;

+  local_58 = param_1;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])

+     ) {

+    uVar6 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x5a,

+              &WPP_f208c3f4e6be38a0d52dfbc3aa0d224e_Traceguids,uVar6,uVar4);

+  }

+  uVar4 = 0x400;

+  if (0x400 < local_res18[0]) {

+    uVar4 = local_res18[0];

+  }

+  local_60 = uVar4;

+  bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_143638841>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_143638841> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_143638841>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_143638841>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar3) {

+    puVar9 = operator_new((ulonglong)uVar4);

+    if (puVar9 == (undefined1 *)0x0) {

+      puVar9 = (undefined1 *)0x0;

+      goto LAB_1;

+    }

+    memset(puVar9,0,(ulonglong)uVar4);

+  }

+  else {

+    puVar9 = operator_new((ulonglong)uVar4);

+LAB_1:

+    if (puVar9 == (undefined1 *)0x0) {

+      iVar5 = -0x7ff8fff2;

+      goto LAB_0;

+    }

+  }

+  local_90 = this_00;

+  local_78 = puVar9;

+  CTSCriticalSection::Lock(this_00);

+  uVar4 = local_80;

+  _Var10 = SUB168(ZEXT816(8) * ZEXT416(local_80),0);

+  if (SUB168(ZEXT816(8) * ZEXT416(local_80),8) != 0) {

+    _Var10 = 0xffffffffffffffff;

+  }

+  _Dst = operator_new(_Var10);

+  *(CSndInputChannelCallback **)pCVar1 = _Dst;

+  if (_Dst == (CSndInputChannelCallback *)0x0) {

+LAB_2:

+    iVar5 = -0x7ff8fff2;

+LAB_3:

+    CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_90);

+    goto LAB_0;

+  }

+  uVar6 = 0;

+  if (uVar4 != 0) {

+    uVar8 = uVar6;

+    if ((1 < uVar4) && ((pCVar1 < _Dst || (uVar8 = 0, _Dst + (ulonglong)(uVar4 - 1) * 8 < pCVar1))))

+    {

+      do {

+        uVar6 = uVar6 + 2;

+      } while (uVar6 < (uVar4 & 0xfffffffe));

+      local_88 = (tWAVEFORMATEX *)CONCAT44(local_88._4_4_,uVar6);

+      memset(_Dst,0,(ulonglong)(uVar4 >> 1) << 4);

+      uVar8 = (uint)local_88;

+      if (uVar4 <= (uint)local_88) goto LAB_4;

+    }

+    lVar12 = (ulonglong)uVar8 * 8;

+    uVar14 = (ulonglong)(uVar4 - uVar8);

+    do {

+      *(undefined8 *)(lVar12 + *(longlong *)pCVar1) = 0;

+      lVar12 = lVar12 + 8;

+      uVar14 = uVar14 - 1;

+    } while (uVar14 != 0);

+  }

+LAB_4:

+  puVar9 = puVar9 + 9;

+  local_88 = (tWAVEFORMATEX *)(local_res10 + 9);

+  local_res10 = (CTSCriticalSection *)((ulonglong)local_res10 & 0xffffffff00000000);

+  uVar6 = param_2 - 9;

+  if (uVar4 != 0) {

+    do {

+      if (uVar6 < 0x12) {

+LAB_5:

+        iVar5 = -0x7ff8ffa9;

+        goto LAB_3;

+      }

+      uVar4 = local_88->cbSize + 0x12;

+      if (uVar4 < 0x12) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+           (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x5b,

+                   &WPP_f208c3f4e6be38a0d52dfbc3aa0d224e_Traceguids,uVar4);

+        }

+        goto LAB_5;

+      }

+      if (uVar6 < uVar4) goto LAB_5;

+      uVar4 = local_88->cbSize + 0x12;

+      lVar7 = CAudioMaster::AddFormat((CAudioMaster *)(this + 0x120),local_88);

+      if (lVar7 == 0) {

+        pvVar11 = operator_new((ulonglong)uVar4);

+        *(void **)(*(longlong *)pCVar1 + (ulonglong)local_res20 * 8) = pvVar11;

+        pvVar11 = *(void **)(*(longlong *)pCVar1 + (ulonglong)local_res20 * 8);

+        if (pvVar11 == (void *)0x0) goto LAB_2;

+        memcpy(pvVar11,local_88,(ulonglong)uVar4);

+        memcpy(puVar9,local_88,(ulonglong)uVar4);

+        puVar9 = puVar9 + uVar4;

+        local_res20 = local_res20 + 1;

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+           (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar8 = RdpWppGetCurrentThreadActivityIdPrefix();

+          WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x5c,

+                    &WPP_f208c3f4e6be38a0d52dfbc3aa0d224e_Traceguids,uVar8,local_res20);

+        }

+      }

+      uVar6 = uVar6 - uVar4;

+      local_88 = (tWAVEFORMATEX *)((longlong)&local_88->wFormatTag + (ulonglong)uVar4);

+      uVar4 = (int)local_res10 + 1;

+      local_res10 = (CTSCriticalSection *)CONCAT44(local_res10._4_4_,uVar4);

+    } while (uVar4 < local_80);

+  }

+  *(uint *)(this + 0x101e8) = local_res20;

+  *(uint *)(local_78 + 1) = local_res20;

+  if (*(longlong *)(this + 0x38) != 0) {

+    TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_68);

+    plVar17 = *(longlong **)(this + 0x38);

+    local_68 = plVar17;

+    TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+              ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_68);

+  }

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_90);

+  local_res8[0] = 5;

+  if (plVar17 == (longlong *)0x0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x5d,

+               &WPP_f208c3f4e6be38a0d52dfbc3aa0d224e_Traceguids,uVar4);

+    }

+    iVar5 = -0x7fffbffb;

+LAB_6:

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_0;

+    uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar15 = 0x5e;

+    pcVar13 = "failed sending incoming packet";

+  }

+  else {

+    iVar5 = (**(code **)(*plVar17 + 0x18))(plVar17,1,local_res8);

+    if (iVar5 < 0) goto LAB_6;

+    *local_78 = 2;

+    *(uint *)(local_78 + 1) = local_res20;

+    *(int *)(local_78 + 5) = (int)puVar9 - (int)local_78;

+    if (plVar17 == (longlong *)0x0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & 0x200) != 0)) &&

+         (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x5f,

+                 &WPP_f208c3f4e6be38a0d52dfbc3aa0d224e_Traceguids,uVar4);

+      }

+      iVar5 = -0x7fffbffb;

+    }

+    else {

+      iVar5 = (**(code **)(*plVar17 + 0x18))(plVar17,local_60,local_78,0);

+      if (-1 < iVar5) {

+        if ((plVar16 != (longlong *)0x0) &&

+           (iVar5 = (**(code **)(*plVar16 + 0x18))(plVar16), iVar5 != 0)) {

+          CAudioInputTestData::Initialize

+                    ((CAudioInputTestData *)(this + 0x10240),(tWAVEFORMATEX *)(this + 0x10200));

+        }

+        iVar5 = 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;

+    uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+    uVar15 = 0x60;

+    pcVar13 = "failed writing formats response";

+  }

+  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar15,

+             &WPP_f208c3f4e6be38a0d52dfbc3aa0d224e_Traceguids,uVar4,pcVar13,iVar5);

+LAB_0:

+  local_res10 = this_00;

+  CTSCriticalSection::Lock(this_00);

+  puVar2 = local_58;

+  if (((iVar5 < 0) && (*(longlong *)pCVar1 != 0)) && (local_58 != (uchar *)0x0)) {

+    uVar14 = 0;

+    if (*(int *)(local_58 + 1) != 0) {

+      do {

+        pvVar11 = *(void **)(*(longlong *)pCVar1 + uVar14 * 8);

+        if (pvVar11 != (void *)0x0) {

+          operator_delete(pvVar11);

+          *(undefined8 *)(*(longlong *)pCVar1 + uVar14 * 8) = 0;

+        }

+        uVar4 = (int)uVar14 + 1;

+        uVar14 = (ulonglong)uVar4;

+      } while (uVar4 < *(uint *)(puVar2 + 1));

+    }

+    operator_delete(*(void **)pCVar1);

+    *(longlong *)pCVar1 = 0;

+    *(undefined4 *)(this + 0x101e8) = 0;

+  }

+  CTSAutoLock::~CTSAutoLock((CTSAutoLock *)&local_res10);

+  if (local_78 != (undefined1 *)0x0) {

+    operator_delete(local_78);

+  }

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_70);

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_68);

+  return iVar5;

+}

+
```

## `CClipClient::Initialize`  (modified)

```diff
--- CClipClient::Initialize
+++ CClipClient::Initialize
@@ -1,2 +1,468 @@
-Failed to decompile mstscax.dll - .ProgramDB CClipClient::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 */

+/* protected: virtual long __cdecl CClipClient::Initialize(void) __ptr64 */

+

+long __thiscall CClipClient::Initialize(CClipClient *this)

+

+{

+  CClipClient *this_00;

+  TCntPtr<ITSThread> *this_01;

+  CClipClient *pCVar1;

+  TCntPtr<ITSThread> *pTVar2;

+  CClipClient *pCVar3;

+  uint uVar4;

+  long lVar5;

+  int iVar6;

+  longlong lVar7;

+  _func___int64_HWND___ptr_uint___uint64___int64 *p_Var8;

+  longlong *plVar9;

+  char *pcVar10;

+  CDataChannelManager *pCVar11;

+  undefined8 uVar12;

+  _func_void_void_ptr_ulong_uint_void_ptr_uint_uint_uint *in_R9;

+  ulong local_res8 [2];

+  longlong *local_res10;

+  char *in_stack_ffffffffffffff88;

+  undefined2 local_68 [2];

+  undefined4 local_64;

+  undefined4 local_60;

+  IRdrVirtualChannel *local_58;

+  CLIPBOARD_DATA_CHANNEL_CONTEXT local_50 [24];

+  

+  local_res10 = (longlong *)0x0;

+  local_58 = (IRdrVirtualChannel *)0x0;

+  local_res8[0] = 0;

+  if (*(int *)(this + 0x154) == 0) {

+    lVar7 = (**(code **)(*(longlong *)

+                          ((longlong)*(int *)(*(longlong *)(*(longlong *)(this + 0x3c0) + 8) + 4) +

+                          *(longlong *)(this + 0x3c0) + 8) + 0x28))();

+    this_01 = (TCntPtr<ITSThread> *)(this + 0x298);

+    if (lVar7 != *(longlong *)this_01) {

+      TCntPtr<ITSThread>::SafeRelease(this_01);

+      *(longlong *)this_01 = lVar7;

+      TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                ((TCntPtr<IRdpProgressiveDecompressorEx> *)this_01);

+    }

+    if (*(longlong *)this_01 == 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar12 = 0x17;

+LAB_0:

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar12,

+                 &WPP_72b33b17408133fe1ae2193bfc1e6eac_Traceguids,uVar4);

+      }

+LAB_1:

+      lVar5 = -0x7fff0001;

+    }

+    else {

+      lVar5 = CClipBase::Initialize((CClipBase *)this);

+      if (lVar5 < 0) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+          uVar12 = 0x18;

+          pcVar10 = "CClipBase::Initialize failed!";

+          goto LAB_2;

+        }

+      }

+      else {

+        pCVar1 = this + 0x3c8;

+        lVar5 = (**(code **)(**(longlong **)(this + 0x3c0) + 8))

+                          (*(longlong **)(this + 0x3c0),pCVar1);

+        if (lVar5 < 0) {

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+            uVar12 = 0x19;

+            pcVar10 = "GetWin32CoreAPI failed!";

+            goto LAB_2;

+          }

+        }

+        else {

+          lVar5 = (**(code **)(**(longlong **)pCVar1 + 0x298))(*(longlong **)pCVar1,this + 0x330);

+          if (lVar5 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+              uVar12 = 0x1a;

+              pcVar10 = "GetHvsiApi failed!";

+              goto LAB_2;

+            }

+          }

+          else {

+            lVar7 = (**(code **)(*(longlong *)

+                                  ((longlong)

+                                   *(int *)(*(longlong *)(*(longlong *)(this + 0x3c0) + 8) + 4) +

+                                  *(longlong *)(this + 0x3c0) + 8) + 0x48))();

+            pTVar2 = (TCntPtr<ITSThread> *)(this + 0x2a0);

+            if (lVar7 != *(longlong *)pTVar2) {

+              TCntPtr<ITSThread>::SafeRelease(pTVar2);

+              *(longlong *)pTVar2 = lVar7;

+              TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                        ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar2);

+            }

+            if (*(longlong *)pTVar2 == 0) {

+              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                  ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                uVar12 = 0x1b;

+                goto LAB_0;

+              }

+              goto LAB_1;

+            }

+            lVar5 = CReliableClipUpdateHandler::CreateInstance

+                              ((CClipUpdateHandler **)(this + 0x158));

+            if (lVar5 < 0) {

+              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                  ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                uVar12 = 0x1c;

+                pcVar10 = "CreateClipUpdateHander failed!";

+                goto LAB_2;

+              }

+            }

+            else {

+              (**(code **)(**(longlong **)pCVar1 + 0x50))();

+              lVar5 = CClientRdrFileTransfer::CreateInstance

+                                ((ushort *)(this + 0x160),*(HWND__ **)(this + 0xe0),

+                                 (CRdrFileTransfer **)(this + 0x260));

+              if (lVar5 < 0) {

+                if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                    ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19]))

+                {

+                  uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                  uVar12 = 0x1d;

+                  pcVar10 = "CClientRdrFileTransfer::CreateInstance failed!";

+                  goto LAB_2;

+                }

+              }

+              else {

+                this_00 = this + -8;

+                lVar5 = CClientFormatDataPacker::CreateInstance

+                                  (*(CRdrFileTransfer **)(this + 0x260),

+                                   (CFormatDataPacker **)(this + 0x268),(CClipBase *)this_00);

+                if (lVar5 < 0) {

+                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                      ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])

+                     ) {

+                    uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                    uVar12 = 0x1e;

+                    pcVar10 = "CClientFormatDataPacker::CreateInstance failed!";

+                    goto LAB_2;

+                  }

+                }

+                else {

+                  lVar5 = CClientClipRdrPduDispatcher::CreateInstance

+                                    (*(ITSCoreEvents **)pTVar2,(IRdrPduDispatcher **)(this + 0x278))

+                  ;

+                  if (lVar5 < 0) {

+                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                      uVar12 = 0x1f;

+                      pcVar10 = "CClientClipRdrPduDispatcher::CreateInstance failed!";

+                      goto LAB_2;

+                    }

+                  }

+                  else {

+                    pCVar3 = this + 0x270;

+                    lVar5 = CClientRdrVirtualChannel::CreateInstance

+                                      (*(IRdrPduDispatcher **)(this + 0x278),

+                                       *(void **)(this + 0x3d0),

+                                       (tagCHANNEL_ENTRY_POINTS_EX *)(this + 0x3d8),in_R9,

+                                       in_stack_ffffffffffffff88,(IRdrVirtualChannel **)pCVar3);

+                    if (lVar5 < 0) {

+                      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                         (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                        uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                        uVar12 = 0x20;

+                        pcVar10 = "CClientRdrVirtualChannel::CreateInstance failed!";

+                        goto LAB_2;

+                      }

+                    }

+                    else {

+                      local_68[0] = 0x101;

+                      local_64 = 0xffffffff;

+                      local_60 = 0xffffffff;

+                      if (*(IRdrVirtualChannel **)pCVar3 != (IRdrVirtualChannel *)0x0) {

+                        TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_58);

+                        local_58 = *(IRdrVirtualChannel **)pCVar3;

+                        TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                                  ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_58);

+                      }

+                      pCVar11 = *(CDataChannelManager **)(this + 0x350);

+                      p_Var8 = (_func___int64_HWND___ptr_uint___uint64___int64 *)

+                               CLIPBOARD_DATA_CHANNEL_CONTEXT::CLIPBOARD_DATA_CHANNEL_CONTEXT

+                                         (local_50,(CLIPBOARD_DATA_CHANNEL_CONTEXT *)local_68);

+                      lVar5 = CDataChannelManager::UpdateContext(pCVar11,0);

+                      if (lVar5 < 0) {

+                        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                           (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                          uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                          uVar12 = 0x21;

+                          pcVar10 = "UpdateContext failed.";

+                          goto LAB_2;

+                        }

+                      }

+                      else {

+                        *(undefined4 *)(this + 0x148) = 0xffffffff;

+                        *(undefined4 *)(this + 0x150) = 0x7fffffff;

+                        lVar5 = CRdrWnd::RegisterRdrWindowClass

+                                          ((ushort *)pCVar11,*(HINSTANCE__ **)(this + 0xd8),p_Var8,

+                                           (ushort *)(this + 0xd0));

+                        if (lVar5 < 0) {

+                          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                             (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                            uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                            uVar12 = 0x22;

+                            pcVar10 = "RegisterRdrWindowClass failed!";

+                            goto LAB_2;

+                          }

+                        }

+                        else {

+                          plVar9 = (longlong *)(**(code **)(**(longlong **)pCVar1 + 0x38))();

+                          if (plVar9 == (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),0x23,

+                                       &WPP_72b33b17408133fe1ae2193bfc1e6eac_Traceguids,uVar4);

+                            }

+                            goto LAB_3;

+                          }

+                          TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res10);

+                          local_res10 = plVar9;

+                          TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                                    ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_res10);

+                          lVar5 = (**(code **)(*plVar9 + 0x30))

+                                            (plVar9,"DynamicClipboardClientInferface",

+                                             -(ulonglong)(this_00 != (CClipClient *)0x0) &

+                                             (ulonglong)(this + 0x370));

+                          if (lVar5 < 0) {

+                            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                               (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                              uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                              uVar12 = 0x24;

+                              pcVar10 = 

+                              "SetIUnknownProperty(TS_PROP_WIN32CORE_DYNAMIC_CLIPCLIENT_INTERFACE) failed."

+                              ;

+                              goto LAB_2;

+                            }

+                          }

+                          else {

+                            lVar5 = CPolicy::ReadEffectivePolicyDWORD

+                                              ((ushort *)L"DisableCloudClipboardIntegration",

+                                               local_res8,

+                                               (ushort *)

+                                               L"Software\\Policies\\Microsoft\\Windows NT\\Terminal Services\\Client"

+                                              );

+                            if (lVar5 < 0) {

+                              if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                                  ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                                 (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                                uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                uVar12 = 0x25;

+                                pcVar10 = 

+                                "ReadEffectivePolicyDWORD(TSC_POLICY_DISABLE_CLOUD_CLIPBOARD_INTEGRATION) failed."

+                                ;

+                                goto LAB_2;

+                              }

+                            }

+                            else {

+                              if (lVar5 == 0) {

+                                *(uint *)(this + 0x42c) = (uint)(local_res8[0] != 0);

+                              }

+                              iVar6 = IsManualClipboardSyncEnabled(this_00);

+                              *(int *)(this + 0x428) = iVar6;

+                              if (iVar6 == 0) {

+LAB_4:

+                                *(undefined4 *)(this + 0x154) = 1;

+                                lVar7 = (**(code **)(*(longlong *)

+                                                      ((longlong)

+                                                       *(int *)(*(longlong *)

+                                                                 (*(longlong *)(this + 0x3c0) + 8) +

+                                                               4) + *(longlong *)(this + 0x3c0) + 8)

+                                                    + 0x68))();

+                                pTVar2 = (TCntPtr<ITSThread> *)(this + 0x280);

+                                if (lVar7 != *(longlong *)pTVar2) {

+                                  TCntPtr<ITSThread>::SafeRelease(pTVar2);

+                                  *(longlong *)pTVar2 = lVar7;

+                                  TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                                            ((TCntPtr<IRdpProgressiveDecompressorEx> *)pTVar2);

+                                }

+                                lVar5 = (**(code **)(**(longlong **)this_01 + 0x38))

+                                                  (*(longlong **)this_01,StaticDataRequestThreadMain

+                                                   ,this_00,this + 0x290);

+                                if (lVar5 < 0) {

+                                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                                      ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                                     (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                                    uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                    uVar12 = 0x28;

+                                    pcVar10 = "Failed to create the data request thread!";

+LAB_2:

+                                    WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar12,

+                                               &WPP_72b33b17408133fe1ae2193bfc1e6eac_Traceguids,

+                                               uVar4,pcVar10,lVar5);

+                                  }

+                                }

+                                else {

+                                  plVar9 = *(longlong **)(this + 0x290);

+                                  lVar5 = (**(code **)(*plVar9 + 0x20))(plVar9,0);

+                                  if (lVar5 < 0) {

+                                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)

+                                        && ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                                       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                                      uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                      uVar12 = 0x29;

+                                      pcVar10 = "Failed to start the data request thread!";

+                                      goto LAB_2;

+                                    }

+                                  }

+                                  else {

+                                    lVar5 = (**(code **)(**(longlong **)this_01 + 0x38))

+                                                      (*(longlong **)this_01,StaticClipThreadMain,

+                                                       this_00,this + 0x288);

+                                    if (lVar5 < 0) {

+                                      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)

+                                          && ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                                         (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                                        uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                        uVar12 = 0x2a;

+                                        pcVar10 = "Failed to create the clipboard thread!";

+                                        goto LAB_2;

+                                      }

+                                    }

+                                    else {

+                                      plVar9 = *(longlong **)(this + 0x288);

+                                      lVar5 = (**(code **)(*plVar9 + 0x20))(plVar9,0);

+                                      if (lVar5 < 0) {

+                                        if ((((undefined **)WPP_GLOBAL_Control !=

+                                              &WPP_GLOBAL_Control) &&

+                                            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                                           (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                                          uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                          uVar12 = 0x2b;

+                                          pcVar10 = "Failed to start the clipboard thread!";

+                                          goto LAB_2;

+                                        }

+                                      }

+                                      else {

+                                        lVar5 = RegisterNotificationSources(this_00);

+                                        if (lVar5 < 0) {

+                                          if ((((undefined **)WPP_GLOBAL_Control !=

+                                                &WPP_GLOBAL_Control) &&

+                                              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                                             (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                                            uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                            uVar12 = 0x2c;

+                                            pcVar10 = "RegisterNotificationSources failed.";

+                                            goto LAB_2;

+                                          }

+                                        }

+                                        else {

+                                          lVar5 = BindNotificationSinks(this_00);

+                                          if (lVar5 < 0) {

+                                            if ((((undefined **)WPP_GLOBAL_Control !=

+                                                  &WPP_GLOBAL_Control) &&

+                                                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                                               (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                                              uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                              uVar12 = 0x2d;

+                                              pcVar10 = "BindNotificationSinks failed!";

+                                              goto LAB_2;

+                                            }

+                                          }

+                                          else {

+                                            lVar5 = (**(code **)(**(longlong **)(this + 0x330) +

+                                                                0x60))(*(longlong **)(this + 0x330),

+                                                                       -(ulonglong)

+                                                                        (this_00 !=

+                                                                        (CClipClient *)0x0) &

+                                                                       (ulonglong)(this + 0x360));

+                                            if (-1 < lVar5) {

+                                              lVar5 = 0;

+                                              goto LAB_3;

+                                            }

+                                            if ((((undefined **)WPP_GLOBAL_Control !=

+                                                  &WPP_GLOBAL_Control) &&

+                                                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                                               (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                                              uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                              uVar12 = 0x2e;

+                                              pcVar10 = "SetHvsiCClipClientInstance failed!";

+                                              goto LAB_2;

+                                            }

+                                          }

+                                        }

+                                      }

+                                    }

+                                  }

+                                }

+                              }

+                              else {

+                                lVar5 = (**(code **)(*plVar9 + 0x30))

+                                                  (plVar9,"ManualClipboardSyncInterface",

+                                                   -(ulonglong)(this_00 != (CClipClient *)0x0) &

+                                                   (ulonglong)(this + 0x368));

+                                if (lVar5 < 0) {

+                                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                                      ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                                     (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                                    uVar4 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                    uVar12 = 0x26;

+                                    pcVar10 = 

+                                    "SetIUnknownProperty(TS_PROP_WIN32CORE_MANUAL_CLIP_SYNC_INTERFACE) failed."

+                                    ;

+                                    goto LAB_2;

+                                  }

+                                }

+                                else {

+                                  if (*(int *)(this + 0x460) != 0) {

+                                    *(undefined8 *)(this + 0x430) = 0;

+                                    *(undefined8 *)(this + 0x438) = 0;

+                                    goto LAB_4;

+                                  }

+                                  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),0x27,

+                                             &WPP_72b33b17408133fe1ae2193bfc1e6eac_Traceguids,uVar4)

+                                    ;

+                                  }

+                                  lVar5 = -0x7fffbffb;

+                                }

+                              }

+                            }

+                          }

+                        }

+                      }

+                    }

+                  }

+                }

+              }

+            }

+          }

+        }

+      }

+    }

+  }

+  else {

+    lVar5 = -0x7cbafc16;

+  }

+  *(undefined4 *)(this + 0x154) = 0;

+LAB_3:

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_58);

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res10);

+  return lVar5;

+}

+
```

## `CTsRdpCertSignature::GetCertificateThumbPrint`  (modified)

```diff
--- CTsRdpCertSignature::GetCertificateThumbPrint
+++ CTsRdpCertSignature::GetCertificateThumbPrint
@@ -1,2 +1,15 @@
-Failed to decompile mstscax.dll - .ProgramDB CTsRdpCertSignature::GetCertificateThumbPrint : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl CTsRdpCertSignature::GetCertificateThumbPrint(unsigned char *

+   __ptr64 * __ptr64,unsigned long * __ptr64) __ptr64 */

+

+long __thiscall

+CTsRdpCertSignature::GetCertificateThumbPrint

+          (CTsRdpCertSignature *this,uchar **param_1,ulong *param_2)

+

+{

+  long lVar1;

+  

+  lVar1 = GetCertificateThumbPrintByPropId(this + -0x60,3,param_1,param_2);

+  return lVar1;

+}

+
```

## `CUH::UHSendOffscrCacheErrorPDU`  (modified)

```diff
--- CUH::UHSendOffscrCacheErrorPDU
+++ CUH::UHSendOffscrCacheErrorPDU
@@ -1,2 +1,93 @@
-Failed to decompile mstscax.dll - .ProgramDB CUH::UHSendOffscrCacheErrorPDU : 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: int __cdecl CUH::UHSendOffscrCacheErrorPDU(void) __ptr64 */

+

+int __thiscall CUH::UHSendOffscrCacheErrorPDU(CUH *this)

+

+{

+  CTSRdpConnectionStack *this_00;

+  bool bVar1;

+  undefined4 uVar2;

+  long lVar3;

+  ulong uVar4;

+  undefined4 *puVar5;

+  undefined8 uVar6;

+  int iVar7;

+  int in_R8D;

+  ITSNetBuffer *local_res8;

+  CTSRdpConnectionStack *local_res10;

+  int iVar8;

+  

+  this_00 = *(CTSRdpConnectionStack **)(this + 0x820);

+  iVar7 = 0;

+  iVar8 = 0;

+  local_res8 = (ITSNetBuffer *)0x0;

+  local_res10 = this_00;

+  TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+            ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)&local_res10);

+  if (this_00 == (CTSRdpConnectionStack *)0x0) {

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_0;

+    uVar2 = RdpX_GetActivityIdPrefix();

+    uVar6 = 0x4b;

+  }

+  else {

+    iVar7 = iVar8;

+    if (*(int *)(this + 0x388) != 0) goto LAB_0;

+    lVar3 = CTSRdpConnectionStack::GetBuffer(this_00,0x16,in_R8D,&local_res8);

+    if (-1 < lVar3) {

+      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),0x4c,

+                 &WPP_9a0d9d550f633384007dbcf4fa3c3c61_Traceguids,uVar2);

+      }

+      puVar5 = (undefined4 *)(**(code **)(*(longlong *)local_res8 + 0x28))();

+      bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_937406778>::__private_IsEnabled

+                        ((FeatureImpl<__WilFeatureTraits_Feature_937406778> *)

+                         &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_937406778>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_937406778>::GetImpl(void)'

+                          ::__l2::impl);

+      if (bVar1) {

+        *(undefined8 *)(puVar5 + 1) = 0;

+        *(undefined8 *)(puVar5 + 3) = 0;

+        *(undefined2 *)(puVar5 + 5) = 0;

+      }

+      *puVar5 = 0x170016;

+      uVar4 = CTSRdpConnectionStack::GetClientMCSID(this_00);

+      *(short *)(puVar5 + 1) = (short)uVar4;

+      uVar4 = CTSRdpConnectionStack::GetShareID(this_00);

+      *(ulong *)((longlong)puVar5 + 6) = uVar4;

+      *(undefined2 *)((longlong)puVar5 + 10) = 0x100;

+      *(undefined4 *)((longlong)puVar5 + 0xe) = 0x2e;

+      *(undefined4 *)((longlong)puVar5 + 0x12) = 1;

+      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),0x4d,

+                 &WPP_9a0d9d550f633384007dbcf4fa3c3c61_Traceguids,uVar2);

+      }

+      lVar3 = CTSRdpConnectionStack::SendBuffer(this_00,local_res8,0x16,8);

+      if (-1 < lVar3) {

+        *(undefined4 *)(this + 0x388) = 1;

+        iVar7 = 1;

+      }

+      goto LAB_0;

+    }

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((WPP_GLOBAL_Control[0x1c] & 1) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 3))

+    goto LAB_0;

+    uVar2 = RdpX_GetActivityIdPrefix();

+    uVar6 = 0x4e;

+  }

+  WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar6,

+           &WPP_9a0d9d550f633384007dbcf4fa3c3c61_Traceguids,uVar2);

+  iVar7 = iVar8;

+LAB_0:

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)&local_res10);

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res8);

+  return iVar7;

+}

+
```

## `CTsConnectionInfoDlg::GetExpandedInfoString`  (modified)

```diff
--- CTsConnectionInfoDlg::GetExpandedInfoString
+++ CTsConnectionInfoDlg::GetExpandedInfoString
@@ -1,2 +1,497 @@
-Failed to decompile mstscax.dll - .ProgramDB CTsConnectionInfoDlg::GetExpandedInfoString : 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: long __cdecl CTsConnectionInfoDlg::GetExpandedInfoString(unsigned short *

+   __ptr64,unsigned __int64) __ptr64 */

+

+long __thiscall

+CTsConnectionInfoDlg::GetExpandedInfoString

+          (CTsConnectionInfoDlg *this,ushort *param_1,__uint64 param_2)

+

+{

+  uint uVar1;

+  int iVar2;

+  errno_t eVar3;

+  longlong *plVar4;

+  longlong *plVar5;

+  undefined8 uVar6;

+  undefined1 auStack_f28 [32];

+  wchar_t *local_f08;

+  ushort *local_f00;

+  wchar_t *local_ef8;

+  ushort *local_ef0;

+  ushort *local_ee8;

+  ushort *local_ee0;

+  ushort *local_ed8;

+  double local_ed0;

+  ushort *local_ec8;

+  ushort *local_ec0;

+  ushort *local_eb8;

+  short *local_eb0;

+  int local_ea8;

+  int local_ea4;

+  ulong local_ea0;

+  int local_e9c;

+  int local_e98 [2];

+  short *local_e90;

+  longlong *local_e88;

+  longlong *local_e80;

+  longlong *local_e78;

+  BSTR local_e70;

+  ushort *local_e68 [2];

+  ushort local_e58 [32];

+  ushort local_e18;

+  wchar_t local_e16 [36];

+  undefined2 local_dce;

+  ushort local_dc8 [32];

+  ushort local_d88 [32];

+  ushort local_d48 [32];

+  ushort local_d08 [32];

+  ushort local_cc8 [64];

+  ushort local_c48 [256];

+  ushort local_a48 [256];

+  ushort local_848 [1024];

+  ulonglong local_48;

+  

+  local_48 = __security_cookie ^ (ulonglong)auStack_f28;

+  local_e78 = (longlong *)0x0;

+  local_e80 = (longlong *)0x0;

+  local_e88 = (longlong *)0x0;

+  memset(local_848,0,0x800);

+  local_e70 = (BSTR)0x0;

+  local_e68[0] = (ushort *)0x0;

+  memset(&local_e18,0,0x50);

+  memset(local_d88,0,0x40);

+  memset(local_d08,0,0x40);

+  memset(local_a48,0,0x200);

+  local_e90 = (short *)0x0;

+  local_e9c = 0;

+  memset(local_cc8,0,0x80);

+  memset(local_d48,0,0x40);

+  memset(local_dc8,0,0x40);

+  local_ea8 = 0;

+  memset(local_c48,0,0x200);

+  memset(local_e58,0,0x40);

+  local_ea0 = 0;

+  local_ea4 = 0;

+  if (param_1 == (ushort *)0x0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar6 = 0x15;

+      local_f08 = L"szExpandedInfo";

+LAB_0:

+      WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar6,

+                &WPP_658cac5fa2c33849449416ab42560cb2_Traceguids,uVar1);

+    }

+  }

+  else if (*(longlong *)(this + 0x40) == 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar6 = 0x16;

+      local_f08 = L"m_hInstance";

+      goto LAB_0;

+    }

+  }

+  else if (*(longlong *)(this + 0x48) == 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+      uVar6 = 0x17;

+      local_f08 = L"m_spUI";

+      goto LAB_0;

+    }

+  }

+  else {

+    plVar4 = *(longlong **)(this + 0x50);

+    if (plVar4 == (longlong *)0x0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar6 = 0x18;

+        local_f08 = L"m_spWin32CoreApi";

+        goto LAB_0;

+      }

+    }

+    else if (*(longlong *)(this + 0x58) == 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar6 = 0x19;

+        local_f08 = L"m_spProxyProfileMgr";

+        goto LAB_0;

+      }

+    }

+    else {

+      iVar2 = (**(code **)(*plVar4 + 0x40))(plVar4,&local_e78);

+      if (iVar2 < 0) {

+        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+            ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+        goto LAB_1;

+        uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+        uVar6 = 0x1a;

+        local_f08 = L"GetCoreAPI failed";

+        goto LAB_2;

+      }

+      plVar4 = (longlong *)(**(code **)(*local_e78 + 0x28))();

+      if (plVar4 == (longlong *)0x0) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+          uVar6 = 0x1b;

+          local_f08 = L"spCoreProps";

+          goto LAB_0;

+        }

+      }

+      else {

+        TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_e80);

+        local_e80 = plVar4;

+        TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                  ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_e80);

+        plVar5 = (longlong *)(**(code **)(*local_e78 + 0x30))();

+        if (plVar5 != (longlong *)0x0) {

+          TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_e88);

+          local_e88 = plVar5;

+          TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+                    ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_e88);

+          iVar2 = TSLoadString(*(HINSTANCE__ **)(this + 0x40),0x466e,local_848,0x400);

+          if (iVar2 == 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+              uVar6 = 0x1d;

+              goto LAB_3;

+            }

+            goto LAB_4;

+          }

+          iVar2 = GetCurrentUTCTimeString((ushort **)&local_e70);

+          if (iVar2 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+            goto LAB_1;

+            uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+            uVar6 = 0x1e;

+            local_f08 = L"GetCurrentUTCTimeString failed";

+          }

+          else {

+            iVar2 = (**(code **)(*plVar4 + 0x78))(plVar4,"ConnectionCorrelationId",local_e68);

+            if (iVar2 < 0) {

+              if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                  ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+              goto LAB_1;

+              uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+              uVar6 = 0x1f;

+              local_f08 = L"GetStringProperty(TS_PROP_CORE_CONNECTION_CORRELATION_ID) failed";

+            }

+            else {

+              iVar2 = StringCchCopyW(&local_e18,0x28,local_e68[0]);

+              if (iVar2 < 0) {

+                if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                    ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+                goto LAB_1;

+                uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                uVar6 = 0x20;

+                local_f08 = L"StringCchCopy failed";

+              }

+              else {

+                local_dce = 0;

+                eVar3 = _wcslwr_s(local_e16,0x27);

+                if (eVar3 != 0) {

+                  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                      ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])

+                     ) {

+                    uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                    uVar6 = 0x21;

+                    goto LAB_3;

+                  }

+                  goto LAB_4;

+                }

+                RdpWinExperienceSettings::UpdateLatencyValueToDisplay

+                          (*(HINSTANCE__ **)(this + 0x40),*(ITSWin32CoreApi **)(this + 0x50),

+                           local_d88,0x20);

+                iVar2 = GetClientVersion(local_d08,0x20);

+                if (iVar2 < 0) {

+                  if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                      ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2)

+                     ) goto LAB_1;

+                  uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                  uVar6 = 0x22;

+                  local_f08 = L"GetClientVersion failed";

+                }

+                else {

+                  iVar2 = GetOSVersionString(this,local_a48,0x100);

+                  if (iVar2 < 0) {

+                    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                        ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) ||

+                       ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_1;

+                    uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                    uVar6 = 0x23;

+                    local_f08 = L"GetClientOS failed";

+                  }

+                  else {

+                    iVar2 = (**(code **)(*plVar5 + 0x70))(plVar5,"TSGTransportIsUsed",&local_ea8);

+                    if (iVar2 < 0) {

+                      if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                          ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) ||

+                         ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_1;

+                      uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                      uVar6 = 0x24;

+                      local_f08 = L"GetBoolProperty(TS_PROP_TRANSPORT_TSG_IS_USED) failed";

+                    }

+                    else {

+                      if (local_ea8 == 0) {

+                        iVar2 = TSLoadString(*(HINSTANCE__ **)(this + 0x40),0x4677,local_c48,0x100);

+                        if (iVar2 == 0) {

+                          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                             (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                            uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                            uVar6 = 0x29;

+                            goto LAB_3;

+                          }

+                        }

+                        else {

+                          iVar2 = TSLoadString(*(HINSTANCE__ **)(this + 0x40),0x4677,local_e58,0x20)

+                          ;

+                          if (iVar2 != 0) {

+LAB_5:

+                            iVar2 = (**(code **)(*plVar4 + 0x78))

+                                              (plVar4,"ServerNameUsedForAuthentication",&local_e90);

+                            if (iVar2 < 0) {

+                              if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                                  ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) ||

+                                 ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_1;

+                              uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                              uVar6 = 0x2b;

+                              local_f08 = 

+                              L"GetStringProperty(TS_PROP_CORE_SERVERNAME_USED_FOR_AUTHENTICATION) failed"

+                              ;

+                            }

+                            else {

+                              if ((local_e90 == (short *)0x0) || (*local_e90 == 0)) {

+                                iVar2 = (**(code **)(*plVar4 + 0x78))

+                                                  (plVar4,"UserSpecifiedServerName",&local_e90);

+                                if (iVar2 < 0) {

+                                  if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                                      ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) ||

+                                     ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_1;

+                                  uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                  uVar6 = 0x2c;

+                                  local_f08 = 

+                                  L"GetStringProperty(TS_PROP_CORE_USER_SPECIFIED_SERVERNAME) failed"

+                                  ;

+                                  goto LAB_2;

+                                }

+                              }

+                              iVar2 = (**(code **)(*plVar4 + 0x70))(plVar4,"RailMode",&local_e9c);

+                              if (iVar2 < 0) {

+                                if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                                    ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) ||

+                                   ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_1;

+                                uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                uVar6 = 0x2d;

+                                local_f08 = 

+                                L"GetBoolProperty(TS_PROP_CORE_CONNECTION_IS_RAIL) failed";

+                              }

+                              else {

+                                local_e98[0] = 0;

+                                iVar2 = (**(code **)(*plVar4 + 0x58))

+                                                  (plVar4,"RailV2Enabled",local_e98);

+                                if (-1 < iVar2) {

+                                  uVar1 = 0x4672;

+                                  if (local_e9c != 0) {

+                                    if ((local_e98[0] == 1) || (local_e98[0] == 2)) {

+LAB_6:

+                                      uVar1 = 0x4671;

+                                    }

+                                    else if (local_e98[0] == 3) {

+                                      uVar1 = 0x4681;

+                                    }

+                                    else {

+                                      if (local_e98[0] == 4) goto LAB_6;

+                                      uVar1 = 0x4690;

+                                    }

+                                  }

+                                  iVar2 = TSLoadString(*(HINSTANCE__ **)(this + 0x40),uVar1,

+                                                       local_cc8,0x40);

+                                  if (iVar2 == 0) {

+                                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)

+                                        && ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                                       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                                      uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                      uVar6 = 0x2f;

+LAB_3:

+                                      local_f08 = (wchar_t *)CONCAT44(local_f08._4_4_,0x80004005);

+                                      WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar6,

+                                                &WPP_658cac5fa2c33849449416ab42560cb2_Traceguids,

+                                                uVar1);

+                                    }

+                                  }

+                                  else {

+                                    iVar2 = RdpWinExperienceSettings::IsUDPEnabled

+                                                      (*(ITSWin32CoreApi **)(this + 0x50));

+                                    iVar2 = TSLoadString(*(HINSTANCE__ **)(this + 0x40),

+                                                         (iVar2 != 0) + 0x466f,local_d48,0x20);

+                                    if (iVar2 != 0) {

+                                      RdpWinExperienceSettings::UpdateBWValueToDisplay

+                                                (*(HINSTANCE__ **)(this + 0x40),

+                                                 *(ITSWin32CoreApi **)(this + 0x50),local_dc8,0x20);

+                                      local_eb0 = local_e90;

+                                      local_eb8 = local_e58;

+                                      local_ec0 = local_c48;

+                                      local_ec8 = local_cc8;

+                                      local_ed8 = local_dc8;

+                                      local_ed0 = (double)*(float *)(*(longlong *)(this + 0x48) +

+                                                                    0xc84);

+                                      local_ee0 = local_d88;

+                                      local_ee8 = local_d48;

+                                      local_ef0 = local_a48;

+                                      local_ef8 = L"x64";

+                                      local_f00 = local_d08;

+                                      local_f08 = local_e16;

+                                      iVar2 = StringCchPrintfW(param_1,0x800,local_848,local_e70);

+                                      if (-1 < iVar2) {

+                                        iVar2 = 0;

+                                        goto LAB_1;

+                                      }

+                                      if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control)

+                                          || ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) ||

+                                         ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_1;

+                                      uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                      uVar6 = 0x31;

+                                      local_f08 = L"StringCchPrintf failed";

+                                      goto LAB_2;

+                                    }

+                                    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)

+                                        && ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                                       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                                      uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                      uVar6 = 0x30;

+                                      goto LAB_3;

+                                    }

+                                  }

+                                  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_1;

+                                uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                                uVar6 = 0x2e;

+                                local_f08 = 

+                                L"GetBoolProperty(TS_PROP_CORE_CONNECTION_IS_RAIL_V2) failed";

+                              }

+                            }

+                            goto LAB_2;

+                          }

+                          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                             (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                            uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                            uVar6 = 0x2a;

+                            goto LAB_3;

+                          }

+                        }

+LAB_4:

+                        iVar2 = -0x7fffbffb;

+                        goto LAB_1;

+                      }

+                      iVar2 = CTsProxyProfileManager::GetProxyHostname

+                                        (*(CTsProxyProfileManager **)(this + 0x58),local_c48,0x100);

+                      if (iVar2 < 0) {

+                        if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                            ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) ||

+                           ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_1;

+                        uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                        uVar6 = 0x25;

+                        local_f08 = L"GetProxyHostname failed";

+                      }

+                      else {

+                        iVar2 = (**(code **)(*plVar5 + 0x58))

+                                          (plVar5,"GatewayBrokeringType",&local_ea4);

+                        if (-1 < iVar2) {

+                          if (local_ea4 == 1) {

+                            uVar1 = 0x3ad7;

+                          }

+                          else {

+                            iVar2 = CTsProxyProfileManager::GetEffectiveCredsSource

+                                              (*(CTsProxyProfileManager **)(this + 0x58),&local_ea0)

+                            ;

+                            if (iVar2 < 0) {

+                              if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+                                  ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) ||

+                                 ((byte)WPP_GLOBAL_Control[0x19] < 2)) goto LAB_1;

+                              uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                              uVar6 = 0x27;

+                              local_f08 = L"GetEffectiveCredsSource failed";

+                              goto LAB_2;

+                            }

+                            if (local_ea0 == 0) {

+                              uVar1 = 0x3ab2;

+                            }

+                            else if (local_ea0 == 1) {

+                              uVar1 = 0x3ab1;

+                            }

+                            else if (local_ea0 == 2) {

+                              uVar1 = 0x3ab3;

+                            }

+                            else if (local_ea0 == 3) {

+                              uVar1 = 0x3ab4;

+                            }

+                            else if (local_ea0 == 5) {

+                              uVar1 = 0x3ac7;

+                            }

+                            else {

+                              uVar1 = 0x3526;

+                            }

+                          }

+                          iVar2 = TSLoadString(*(HINSTANCE__ **)(this + 0x40),uVar1,local_e58,0x20);

+                          if (iVar2 != 0) goto LAB_5;

+                          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+                             (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+                            uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                            uVar6 = 0x28;

+                            goto LAB_3;

+                          }

+                          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_1;

+                        uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+                        uVar6 = 0x26;

+                        local_f08 = L"GetProperty(TS_PROP_TRANSPORT_PROXYBROKERINGTYPE) failed";

+                      }

+                    }

+                  }

+                }

+              }

+            }

+          }

+LAB_2:

+          local_f00 = (ushort *)CONCAT44(local_f00._4_4_,iVar2);

+          WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar6,

+                     &WPP_658cac5fa2c33849449416ab42560cb2_Traceguids,uVar1);

+          goto LAB_1;

+        }

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar1 = RdpWppGetCurrentThreadActivityIdPrefix();

+          uVar6 = 0x1c;

+          local_f08 = L"spTransportProps";

+          goto LAB_0;

+        }

+      }

+    }

+  }

+  iVar2 = -0x7fffbffd;

+LAB_1:

+  SysFreeString(local_e70);

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_e88);

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_e80);

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_e78);

+  return iVar2;

+}

+
```

## `CSL::SendBuffer`  (modified)

```diff
--- CSL::SendBuffer
+++ CSL::SendBuffer
@@ -1,2 +1,224 @@
-Failed to decompile mstscax.dll - .ProgramDB CSL::SendBuffer : 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 CSL::SendBuffer(class ITSNetBuffer * __ptr64,unsigned long,unsigned

+   long,unsigned long,unsigned long,unsigned long) __ptr64 */

+

+long __thiscall

+CSL::SendBuffer(CSL *this,ITSNetBuffer *param_1,ulong param_2,ulong param_3,ulong param_4,

+               ulong param_5,ulong param_6)

+

+{

+  CSL *pCVar1;

+  ulong uVar2;

+  undefined4 uVar3;

+  uint uVar4;

+  char cVar5;

+  int iVar6;

+  undefined4 uVar7;

+  int iVar8;

+  undefined4 uVar9;

+  undefined4 uVar10;

+  uchar *puVar11;

+  char *pcVar12;

+  undefined8 uVar13;

+  ulong uVar14;

+  undefined2 *local_res8;

+  undefined8 in_stack_ffffffffffffff88;

+  undefined2 *puVar15;

+  uchar *puVar16;

+  undefined2 *local_40;

+  undefined2 *local_38;

+  uchar *local_30;

+  

+  uVar9 = (undefined4)((ulonglong)in_stack_ffffffffffffff88 >> 0x20);

+  iVar8 = -0x7fffbffb;

+  CTSCriticalSection::Lock((CTSCriticalSection *)(this + 0x2b0));

+  iVar6 = SL_CHECK_STATE(this,4);

+  if (iVar6 == 0) goto LAB_0;

+  if ((*(int *)(this + 0x104) == 0) && ((param_3 & 0x20c4) == 0)) goto LAB_1;

+  puVar11 = (uchar *)(**(code **)(*(longlong *)param_1 + 0x28))(param_1);

+  local_30 = puVar11;

+  if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+     (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (4 < (byte)WPP_GLOBAL_Control[0x19])))) {

+    uVar7 = RdpX_GetActivityIdPrefix();

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x43,

+             &WPP_1c855617ef7c30c6f6ba4adc1f5b7e47_Traceguids,uVar7);

+  }

+  if ((*(int *)(this + 0x104) == 0) || ((param_3 & 8) == 0)) {

+    local_res8 = (undefined2 *)0x0;

+    iVar8 = (**(code **)(*(longlong *)param_1 + 0x40))(param_1,4,&local_res8);

+    if (-1 < iVar8) {

+      *local_res8 = (short)param_3;

+      cVar5 = Feature_MSRC121421_IsEnabled();

+      if (cVar5 != '\0') {

+        local_res8[1] = 0;

+      }

+      param_2 = param_2 + 4;

+LAB_2:

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+        RdpX_GetActivityIdPrefix();

+        WPP_SF_DqDDDDD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10));

+      }

+LAB_1:

+      CTSCriticalSection::UnLock((CTSCriticalSection *)(this + 0x2b0));

+      iVar6 = (**(code **)(**(longlong **)(this + 0x50) + 0x70))

+                        (*(longlong **)(this + 0x50),param_1,param_2,param_3,param_4,param_5,param_6

+                        );

+      if (((iVar6 < 0) && ((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),0x4e,

+                   &WPP_1c855617ef7c30c6f6ba4adc1f5b7e47_Traceguids,uVar9,

+                   "Failed to send data to lower level",iVar6);

+      }

+      return iVar6;

+    }

+    if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+        ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+    goto LAB_0;

+    uVar9 = RdpX_GetActivityIdPrefix();

+    uVar13 = 0x4c;

+    pcVar12 = "Failed to consume header SL3 space";

+  }

+  else {

+    local_38 = (undefined2 *)0x0;

+    local_40 = (undefined2 *)0x0;

+    if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+       (((WPP_GLOBAL_Control[0x1c] & 1) != 0 && (3 < (byte)WPP_GLOBAL_Control[0x19])))) {

+      uVar7 = RdpX_GetActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x44,

+               &WPP_1c855617ef7c30c6f6ba4adc1f5b7e47_Traceguids,uVar7);

+    }

+    if (*(int *)(this + 0x114) == 0x10) {

+      iVar8 = (**(code **)(*(longlong *)param_1 + 0x40))(param_1,0x10,&local_40);

+      if (-1 < iVar8) {

+        *(byte *)((longlong)local_40 + 7) = '\b' - ((byte)param_2 & 7);

+        local_40[2] = 0x10;

+        *(undefined1 *)(local_40 + 3) = 1;

+LAB_3:

+        if (*(int *)(this + 0x160) == 0x1000) {

+          uVar14 = 3;

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (2 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar7 = RdpX_GetActivityIdPrefix();

+            WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x47,

+                      &WPP_1c855617ef7c30c6f6ba4adc1f5b7e47_Traceguids,uVar7,CONCAT44(uVar9,0x1000))

+            ;

+          }

+          iVar6 = *(int *)(this + 0x114);

+          if (iVar6 != 0x10) {

+            local_res8 = *(undefined2 **)(this + 0x188);

+            pCVar1 = this + 0x178;

+            uVar2 = *(ulong *)(this + 0x15c);

+            UpdateKey((uchar *)(this + 0x168),(uchar *)pCVar1,uVar2);

+            RDP_RC4SetKey(local_res8,pCVar1,uVar2);

+            RDP_RC4(local_res8,pCVar1,uVar2);

+            if (iVar6 == 1) {

+LAB_4:

+              Salt8ByteKey((uchar *)pCVar1,uVar14);

+            }

+            else if (iVar6 != 2) {

+              uVar14 = 1;

+              goto LAB_4;

+            }

+            RDP_RC4SetKey(local_res8,pCVar1,uVar2);

+            puVar11 = local_30;

+          }

+          *(undefined4 *)(this + 0x160) = 0;

+        }

+        uVar14 = *(ulong *)(this + 0x164);

+        if (*(int *)(this + 0x114) == 0x10) {

+          local_res8 = (undefined2 *)CONCAT44(local_res8._4_4_,param_2);

+          puVar15 = local_40 + 4;

+          iVar6 = TS_SECURITY_FIPS_EncryptData

+                            (*(undefined8 *)(this + 0x240),puVar11,&local_res8,

+                             *(byte *)((longlong)local_40 + 7) + param_2,puVar15,uVar14);

+          uVar9 = (undefined4)((ulonglong)puVar15 >> 0x20);

+          if (iVar6 == 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar9 = RdpX_GetActivityIdPrefix();

+              WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4b,

+                       &WPP_1c855617ef7c30c6f6ba4adc1f5b7e47_Traceguids,uVar9);

+            }

+            SLSetReasonAndDisconnect(this,0xb);

+            iVar8 = -0x7fffbffb;

+            goto LAB_0;

+          }

+        }

+        else {

+          iVar6 = SL_GetEncSafeChecksumCS(this);

+          puVar16 = (uchar *)(local_38 + 2);

+          uVar13 = *(undefined8 *)(this + 0x188);

+          GenerateMACSignature

+                    (puVar11,param_2,(uchar *)(this + 0x1c0),*(ulong *)(this + 0x15c),puVar16,iVar6,

+                     uVar14);

+          uVar9 = (undefined4)((ulonglong)puVar16 >> 0x20);

+          RDP_RC4(uVar13,puVar11,param_2);

+        }

+        if ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) {

+          if (((WPP_GLOBAL_Control[0x1c] & 1) != 0) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar7 = RdpX_GetActivityIdPrefix();

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x49,

+                     &WPP_1c855617ef7c30c6f6ba4adc1f5b7e47_Traceguids,uVar7);

+          }

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

+            iVar6 = SL_GetEncSafeChecksumCS(this);

+            uVar7 = *(undefined4 *)(this + 0x164);

+            uVar3 = *(undefined4 *)(this + 0x118);

+            uVar10 = RdpX_GetActivityIdPrefix();

+            WPP_SF_DDDDD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4a,

+                         &WPP_1c855617ef7c30c6f6ba4adc1f5b7e47_Traceguids,uVar10,

+                         CONCAT44(uVar9,uVar3),param_2,uVar7,iVar6);

+          }

+        }

+        *(int *)(this + 0x160) = *(int *)(this + 0x160) + 1;

+        *(int *)(this + 0x164) = *(int *)(this + 0x164) + 1;

+        iVar6 = SL_GetEncSafeChecksumCS(this);

+        uVar4 = param_3 | 0x800;

+        if (iVar6 == 0) {

+          uVar4 = param_3;

+        }

+        param_3 = uVar4;

+        if (*(int *)(this + 0x114) == 0x10) {

+          *local_40 = (short)uVar4;

+          cVar5 = Feature_MSRC121421_IsEnabled();

+          if (cVar5 != '\0') {

+            local_40[1] = 0;

+          }

+          param_2 = param_2 + 0x10 + (uint)*(byte *)((longlong)local_40 + 7);

+        }

+        else {

+          param_2 = param_2 + 0xc;

+          *local_38 = (short)uVar4;

+          local_38[1] = 0;

+        }

+        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_0;

+      uVar9 = RdpX_GetActivityIdPrefix();

+      uVar13 = 0x45;

+    }

+    else {

+      iVar8 = (**(code **)(*(longlong *)param_1 + 0x40))(param_1,0xc,&local_38);

+      if (-1 < iVar8) goto LAB_3;

+      if ((((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) ||

+          ((WPP_GLOBAL_Control[0x1c] & 8) == 0)) || ((byte)WPP_GLOBAL_Control[0x19] < 2))

+      goto LAB_0;

+      uVar9 = RdpX_GetActivityIdPrefix();

+      uVar13 = 0x46;

+    }

+    pcVar12 = "Failed to consume header space";

+  }

+  WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar13,

+             &WPP_1c855617ef7c30c6f6ba4adc1f5b7e47_Traceguids,uVar9,pcVar12,iVar8);

+LAB_0:

+  CTSCriticalSection::UnLock((CTSCriticalSection *)(this + 0x2b0));

+  return iVar8;

+}

+
```

## `CaProgressiveDecompressor::Decode`  (modified)

```diff
--- CaProgressiveDecompressor::Decode
+++ CaProgressiveDecompressor::Decode
@@ -1,2 +1,124 @@
-Failed to decompile mstscax.dll - .ProgramDB CaProgressiveDecompressor::Decode : 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 CaProgressiveDecompressor::Decode(struct

+   IRdpProgressiveRectContextEx * __ptr64,unsigned char const * __ptr64,unsigned int,struct

+   RDP_BITMAP_INFO const * __ptr64,unsigned char * __ptr64,unsigned int,struct tagPOINT * __ptr64)

+   __ptr64 */

+

+long __thiscall

+CaProgressiveDecompressor::Decode

+          (CaProgressiveDecompressor *this,IRdpProgressiveRectContextEx *param_1,uchar *param_2,

+          uint param_3,RDP_BITMAP_INFO *param_4,uchar *param_5,uint param_6,tagPOINT *param_7)

+

+{

+  bool bVar1;

+  uint uVar2;

+  int iVar3;

+  RDP_BITMAP_INFO *pRVar4;

+  CaDecProgressiveRectContext *pCVar5;

+  undefined4 uVar6;

+  uint uVar7;

+  RDP_BITMAP_INFO *pRVar8;

+  CaDecProgressiveRectContext *local_res10;

+  

+  local_res10 = (CaDecProgressiveRectContext *)0x0;

+  uVar7 = 0x1e;

+  if (param_1 == (IRdpProgressiveRectContextEx *)0x0) {

+    iVar3 = -0x7ff8ffa9;

+  }

+  else {

+    iVar3 = (*(code *)**(undefined8 **)param_1)

+                      (param_1,&IID_CaDecProgressiveRectContext,&local_res10);

+    if (-1 < iVar3) {

+      bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_4280538425>::__private_IsEnabled

+                        ((FeatureImpl<__WilFeatureTraits_Feature_4280538425> *)

+                         &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_4280538425>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_4280538425>::GetImpl(void)'

+                          ::__l2::impl);

+      pRVar4 = (RDP_BITMAP_INFO *)0x0;

+      if ((bVar1) && (param_4 != (RDP_BITMAP_INFO *)0x0)) {

+        if ((*(int *)(param_4 + 0xc) < 1) ||

+           ((ulonglong)(longlong)*(int *)(param_4 + 0xc) < (ulonglong)*(uint *)(param_4 + 4) << 2))

+        {

+          uVar7 = 0x20;

+          iVar3 = -0x7ff8ffa9;

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+            uVar6 = 0xb;

+            goto LAB_0;

+          }

+        }

+        else {

+          if ((*(int *)(param_4 + 8) == 0) ||

+             ((ulonglong)*(uint *)(param_4 + 8) * (longlong)*(int *)(param_4 + 0xc) < 0x80000000))

+          goto LAB_1;

+          uVar7 = 0x20;

+          iVar3 = -0x7ff8ffa9;

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+            uVar6 = 0xc;

+            goto LAB_0;

+          }

+        }

+      }

+      else {

+LAB_1:

+        if (param_5 == (uchar *)0x0) {

+LAB_2:

+          uVar7 = 0x21;

+          pRVar8 = pRVar4;

+          if ((((param_7 == (tagPOINT *)0x0) || ((param_7->x == 0 && (param_7->y == 0)))) &&

+              (param_4 != (RDP_BITMAP_INFO *)0x0)) && (param_5 != (uchar *)0x0)) {

+            pRVar4 = (RDP_BITMAP_INFO *)param_5;

+            pRVar8 = param_4;

+          }

+          pCVar5 = local_res10;

+          iVar3 = CaDecProgressiveRectContext::Decode

+                            (local_res10,param_3,param_2,pRVar8,(uchar *)pRVar4);

+          if (-1 < iVar3) {

+            uVar7 = 0x22;

+            iVar3 = getDecodedBits((CaProgressiveDecompressor *)pCVar5,param_1,param_4,param_5,

+                                   param_7);

+          }

+          if (-1 < iVar3) goto LAB_3;

+        }

+        else if (param_4 == (RDP_BITMAP_INFO *)0x0) {

+          uVar7 = 0x1f;

+          iVar3 = -0x7ff8ffa9;

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+            uVar6 = 0xd;

+LAB_0:

+            iVar3 = -0x7ff8ffa9;

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar6,

+                     &WPP_1123d0add87a34d2255591ff8a24582a_Traceguids,uVar2);

+          }

+        }

+        else {

+          if ((uint)(*(int *)(param_4 + 0xc) * *(int *)(param_4 + 8)) <= param_6)

+          goto LAB_2;

+          uVar7 = 0x20;

+          iVar3 = -0x7ff8ffa9;

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+            uVar6 = 0xe;

+            goto LAB_0;

+          }

+        }

+      }

+    }

+  }

+  LogError(this,uVar7,iVar3);

+LAB_3:

+  pCVar5 = local_res10;

+  if (local_res10 != (CaDecProgressiveRectContext *)0x0) {

+    local_res10 = (CaDecProgressiveRectContext *)0x0;

+    (**(code **)(**(longlong **)(pCVar5 + 0x28) + 0x10))();

+  }

+  return iVar3;

+}

+
```

## `CRemoteDesktopClientSettings::LoadPublisherCategory`  (modified)

```diff
--- CRemoteDesktopClientSettings::LoadPublisherCategory
+++ CRemoteDesktopClientSettings::LoadPublisherCategory
@@ -1,2 +1,289 @@
-Failed to decompile mstscax.dll - .ProgramDB CRemoteDesktopClientSettings::LoadPublisherCategory : 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: void __cdecl CRemoteDesktopClientSettings::LoadPublisherCategory(class ITsSettingsStore

+   * __ptr64) __ptr64 */

+

+void __thiscall

+CRemoteDesktopClientSettings::LoadPublisherCategory

+          (CRemoteDesktopClientSettings *this,ITsSettingsStore *param_1)

+

+{

+  CRemoteDesktopClientSettings *pCVar1;

+  CRemoteDesktopClientSettings *pCVar2;

+  undefined4 uVar3;

+  bool bVar4;

+  uint uVar5;

+  long lVar6;

+  wchar_t *pwVar7;

+  CTsRdpCertSignature *pCVar8;

+  CTsRdpCertSignature *pCVar9;

+  int iVar10;

+  CTsRdpCertSignature *pCVar11;

+  CTsRdpCertSignature *pCVar13;

+  CTsRdpCertSignature *pCVar14;

+  CTsRdpCertSignature *pCVar15;

+  CTsRdpCertSignature *pCVar16;

+  int local_res10 [2];

+  ulong local_res18 [2];

+  ulong local_res20 [2];

+  ulong local_78 [2];

+  CTsRdpCertSignature *local_70;

+  CTsRdpCertSignature *local_68;

+  CTsRdpCertSignature *local_60;

+  longlong local_58;

+  CTsRdpCertSignature *local_50 [2];

+  CTsRdpCertSignature *pCVar12;

+  

+  pCVar12 = (CTsRdpCertSignature *)0x0;

+  pCVar11 = (CTsRdpCertSignature *)0x0;

+  local_res10[0] = 0;

+  local_58 = 0;

+  TCntPtr<IRdpProgressiveDecompressorEx>::SafeAddRef

+            ((TCntPtr<IRdpProgressiveDecompressorEx> *)&local_58);

+  local_60 = (CTsRdpCertSignature *)0x0;

+  TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+            ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)&local_60);

+  local_50[0] = (CTsRdpCertSignature *)0x0;

+  local_78[0] = 0;

+  pCVar16 = (CTsRdpCertSignature *)0x0;

+  local_70 = (CTsRdpCertSignature *)0x0;

+  pCVar14 = (CTsRdpCertSignature *)0x0;

+  local_res20[0] = 0;

+  local_68 = (CTsRdpCertSignature *)0x0;

+  local_res18[0] = 0;

+  iVar10 = (**(code **)(*(longlong *)param_1 + 0xf0))(param_1,local_res10);

+  pCVar13 = pCVar11;

+  pCVar8 = pCVar14;

+  pCVar15 = pCVar12;

+  pCVar9 = pCVar16;

+  if (iVar10 < 0) {

+    pCVar13 = pCVar12;

+    pCVar8 = pCVar12;

+    pCVar9 = pCVar12;

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        (pCVar8 = pCVar14, pCVar9 = pCVar16, (WPP_GLOBAL_Control[0x1c] & 8) != 0)) &&

+       (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x11f,

+                 &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar5,

+                 "ITsSettingsStore::GetSignatureType failed",iVar10);

+      pCVar13 = pCVar11;

+    }

+  }

+  else if (local_res10[0] == 0) {

+    pCVar13 = (CTsRdpCertSignature *)0x2;

+  }

+  else if (local_res10[0] == 1) {

+    iVar10 = (**(code **)(*(longlong *)param_1 + 0xf8))(param_1,this + 0x20);

+    if (iVar10 < 0) {

+      if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+          ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+        uVar3 = *(undefined4 *)(this + 0x20);

+        uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x120,

+                   &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar5,iVar10,uVar3);

+      }

+      if ((*(uint *)(this + 0x20) & 0x200000) == 0) {

+        if ((*(uint *)(this + 0x20) & 0x1000) == 0) {

+          if ((*(uint *)(this + 0x20) & 0x10000) != 0) {

+            pCVar13 = (CTsRdpCertSignature *)&DAT_0;

+          }

+        }

+        else {

+          if (*(int *)(this + 0x20) != 0x1002) goto LAB_1;

+          pCVar13 = pCVar12;

+          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),0x122,

+                     &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar5);

+            pCVar13 = pCVar11;

+          }

+        }

+      }

+      else {

+LAB_1:

+        pCVar13 = (CTsRdpCertSignature *)0x5;

+      }

+LAB_2:

+      iVar10 = (int)pCVar13;

+      pCVar8 = pCVar12;

+      pCVar9 = local_70;

+      goto LAB_3;

+    }

+    iVar10 = (**(code **)(*(longlong *)param_1 + 0x100))(param_1,&local_58);

+    if (-1 < iVar10) {

+      pCVar9 = (CTsRdpCertSignature *)(-(ulonglong)(local_58 != 0) & local_58 - 0x30U);

+      pCVar8 = pCVar12;

+      if (pCVar9 != (CTsRdpCertSignature *)0x0) {

+        TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+                  ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)&local_60);

+        local_60 = pCVar9;

+        TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState>::SafeAddRef

+                  ((TCntPtr<WindowsRemoteAppLib::CRailUiVisibleUiState> *)&local_60);

+        pCVar8 = pCVar9;

+      }

+      pCVar1 = this + 0x38;

+      pCVar2 = this + 0x30;

+      bVar4 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3719021881>::__private_IsEnabled

+                        ((FeatureImpl<__WilFeatureTraits_Feature_3719021881> *)

+                         &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3719021881>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3719021881>::GetImpl(void)'

+                          ::__l2::impl);

+      if (bVar4) {

+        lVar6 = CTsRdpCertSignature::GetCertificateThumbPrintByPropId

+                          (pCVar8,3,(uchar **)pCVar2,(ulong *)pCVar1);

+        if (((lVar6 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+           (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+          uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+          WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x124,

+                     &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar5,

+                     "CTsRdpCertSignature::GetCertificateThumbPrint failed",lVar6);

+        }

+        lVar6 = CTsRdpCertSignature::GetCertificateThumbPrintByPropId

+                          (pCVar8,0x6b,(uchar **)local_50,local_78);

+        if (((lVar6 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+           (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+          uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+          WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x125,

+                     &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar5,

+                     "CTsRdpCertSignature::GetCertificateThumbPrintSha256 failed",lVar6);

+        }

+        lVar6 = CTsRdpCertSignature::GetCertificateThumbPrintByBCryptAlgorithm

+                          (pCVar8,(ushort *)L"SHA384",(uchar **)&local_70,local_res20);

+        if ((((lVar6 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+          WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x126,

+                     &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar5,

+                     "CTsRdpCertSignature::GetCertificateThumbPrintSha384 failed",lVar6);

+        }

+        lVar6 = CTsRdpCertSignature::GetCertificateThumbPrintByBCryptAlgorithm

+                          (pCVar8,(ushort *)L"SHA512",(uchar **)&local_68,local_res18);

+        if (((lVar6 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+           (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+          uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+          WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x127,

+                     &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar5,

+                     "CTsRdpCertSignature::GetCertificateThumbPrintSha512 failed",lVar6);

+        }

+        pCVar12 = local_50[0];

+        iVar10 = IsTrustedCertThumbprint

+                           (this,*(uchar **)pCVar2,*(ulong *)pCVar1,(uchar *)local_50[0],local_78[0]

+                            ,(uchar *)local_70,local_res20[0],(uchar *)local_68,local_res18[0]);

+      }

+      else {

+        pCVar9 = pCVar8;

+        lVar6 = CTsRdpCertSignature::GetCertificateThumbPrintOld

+                          (pCVar8,(uchar **)pCVar2,(ulong *)pCVar1);

+        if (lVar6 < 0) {

+          pCVar8 = local_68;

+          pCVar9 = local_70;

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+            WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x128,

+                       &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar5,

+                       "CTsRdpCertSignature::GetCertificateThumbPrint failed",lVar6);

+            pCVar8 = local_68;

+            pCVar9 = local_70;

+          }

+          goto LAB_4;

+        }

+        iVar10 = IsTrustedCertThumbprintOld

+                           ((CRemoteDesktopClientSettings *)pCVar9,*(uchar **)pCVar2,

+                            *(ulong *)pCVar1);

+      }

+      iVar10 = (iVar10 != 0) + 3;

+      lVar6 = CTsRdpCertSignature::GetCertificateChainContext

+                        (pCVar8 + 0x60,(_CERT_CHAIN_CONTEXT **)(this + 0x18));

+      pCVar8 = local_68;

+      pCVar15 = pCVar12;

+      pCVar9 = local_70;

+      if (((lVar6 < 0) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

+         (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+        uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+        WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x129,

+                   &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar5,

+                   "CTsRdpCertSignature::GetCertificateChainContext failed",lVar6);

+        pCVar8 = local_68;

+        pCVar9 = local_70;

+      }

+      goto LAB_3;

+    }

+    if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) goto LAB_2;

+    pCVar8 = pCVar12;

+    pCVar9 = local_70;

+    if (((WPP_GLOBAL_Control[0x1c] & 8) != 0) &&

+       (pCVar8 = pCVar14, 1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x123,

+                 &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar5,

+                 "ITsSettingsStore::GetSignature failed",iVar10);

+      pCVar9 = local_70;

+    }

+  }

+  else {

+    if (local_res10[0] == 2) {

+      iVar10 = (**(code **)(*(longlong *)param_1 + 0xf8))(param_1,this + 0x20);

+      iVar10 = (iVar10 >> 0x1f & 0xfffffffeU) + 2;

+      pCVar8 = pCVar12;

+      pCVar15 = (CTsRdpCertSignature *)0x0;

+      pCVar9 = pCVar12;

+      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),0x12a,

+              &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids);

+    }

+  }

+LAB_4:

+  iVar10 = (int)pCVar13;

+LAB_3:

+  bVar4 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3719021881>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3719021881> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3719021881>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3719021881>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar4) {

+    if (pCVar15 != (CTsRdpCertSignature *)0x0) {

+      LocalFree(pCVar15);

+    }

+    if (pCVar9 != (CTsRdpCertSignature *)0x0) {

+      LocalFree(pCVar9);

+    }

+    if (pCVar8 != (CTsRdpCertSignature *)0x0) {

+      LocalFree(pCVar8);

+    }

+  }

+  *(int *)(this + 0x24) = iVar10;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (2 < (byte)WPP_GLOBAL_Control[0x19])) {

+    if (iVar10 == 0) {

+      pwVar7 = L"UNSIGNED";

+    }

+    else if (iVar10 == 1) {

+      pwVar7 = L"UNKNOWN";

+    }

+    else if (iVar10 == 4) {

+      pwVar7 = L"TRUSTED";

+    }

+    else if (iVar10 == 5) {

+      pwVar7 = L"BLOCKED";

+    }

+    else {

+      pwVar7 = L"USER";

+      if (iVar10 != 2) {

+        pwVar7 = L"THIRD_PARTY";

+      }

+    }

+    uVar5 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),299,

+              &WPP_bcc1246786e537bc8ba018cf5878dc26_Traceguids,uVar5,pwVar7);

+  }

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)&local_60);

+  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_58);

+  return;

+}

+
```

## `CaCpuDecompressor::Decompress`  (modified)

```diff
--- CaCpuDecompressor::Decompress
+++ CaCpuDecompressor::Decompress
@@ -1,2 +1,64 @@
-Failed to decompile mstscax.dll - .ProgramDB CaCpuDecompressor::Decompress : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: virtual long __cdecl CaCpuDecompressor::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

+CaCpuDecompressor::Decompress

+          (CaCpuDecompressor *this,RDP_COMPRESSION_PARAMETERS *param_1,RDP_BITMAP_INFO *param_2,

+          uchar *param_3,uint param_4,uchar *param_5,uint param_6)

+

+{

+  bool bVar1;

+  int iVar2;

+  ulonglong uVar3;

+  uint uVar4;

+  RDP_BITMAP_INFO *pRVar5;

+  uchar *puVar6;

+  tagSIZE local_res18;

+  tagPOINT local_18 [2];

+  

+  uVar4 = (uint)param_1;

+  local_18[0].x = 0;

+  local_18[0].y = 0;

+  if ((*(uint *)(param_2 + 4) < 0x3e81) && (*(uint *)(param_2 + 8) < 0x3e81)) {

+    pRVar5 = param_2;

+    puVar6 = param_3;

+    bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>::__private_IsEnabled

+                      ((FeatureImpl<__WilFeatureTraits_Feature_553358650> *)

+                       &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_553358650>::GetImpl(void)'

+                        ::__l2::impl);

+    if (bVar1) {

+      uVar3 = (ulonglong)*(uint *)(param_2 + 8) * (ulonglong)*(uint *)(param_2 + 4) * 4;

+    }

+    else {

+      uVar3 = (ulonglong)((*(uint *)(param_2 + 8) * *(int *)(param_2 + 4) & 0x7ffffff) << 2);

+    }

+    if (uVar3 < 0x100000000) {

+      if ((param_6 < uVar3) ||

+         ((*(longlong *)(this + 8) != 0 && ((ulonglong)(longlong)*(int *)(this + 0x10) < uVar3)))) {

+        iVar2 = -0x7ffdffed;

+      }

+      else {

+        iVar2 = Decode(this + -0x30,uVar4,(uint)pRVar5,(uint)puVar6,param_3,param_4,local_18);

+        if (-1 < iVar2) {

+          local_res18.cx = *(LONG *)(param_2 + 4);

+          local_res18.cy = *(LONG *)(param_2 + 8);

+          iVar2 = Transfer(this + -0x30,local_18,&local_res18,param_5,param_6);

+        }

+      }

+    }

+    else {

+      bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>::__private_IsEnabled

+                        ((FeatureImpl<__WilFeatureTraits_Feature_553358650> *)

+                         &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_553358650>::GetImpl(void)'

+                          ::__l2::impl);

+      iVar2 = (-(uint)bVar1 & 0x80070000) + 0x216;

+    }

+  }

+  else {

+    iVar2 = -0x7ff8ffa9;

+  }

+  return iVar2;

+}

+
```

## `HevcDecompressor::MapCPUSampleToTexture`  (modified)

```diff
--- HevcDecompressor::MapCPUSampleToTexture
+++ HevcDecompressor::MapCPUSampleToTexture
@@ -1,2 +1,120 @@
-Failed to decompile mstscax.dll - .ProgramDB HevcDecompressor::MapCPUSampleToTexture : 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: long __cdecl HevcDecompressor::MapCPUSampleToTexture(struct IMFSample * __ptr64,struct

+   RdpXInterfaceTexture2D * __ptr64) __ptr64 */

+

+long __thiscall

+HevcDecompressor::MapCPUSampleToTexture

+          (HevcDecompressor *this,IMFSample *param_1,RdpXInterfaceTexture2D *param_2)

+

+{

+  int iVar1;

+  longlong *plVar2;

+  bool bVar3;

+  int iVar4;

+  undefined4 uVar5;

+  _XResult32 _Var6;

+  int iVar7;

+  uint uVar8;

+  char *pcVar9;

+  undefined8 uVar10;

+  ulonglong uVar11;

+  ulonglong uVar12;

+  int *piVar13;

+  uint local_res10 [4];

+  undefined4 local_res20 [2];

+  longlong *local_48;

+  ulonglong local_40;

+  

+  uVar12 = 0;

+  local_40 = 0;

+  local_res10[0] = 0;

+  local_res20[0] = 0;

+  local_48 = (longlong *)0x0;

+  iVar4 = (**(code **)(*(longlong *)param_1 + 0x148))(param_1,&local_48);

+  if (iVar4 < 0) {

+    if ((((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),0x53,

+                 &WPP_21054fb6c7e6333bd7681237225dac79_Traceguids,uVar5,

+                 "spRgbSample->ConvertToContiguousBuffer() failed",iVar4);

+    }

+  }

+  else {

+    iVar4 = (**(code **)(*local_48 + 0x18))(local_48,&local_40,local_res10,local_res20);

+    if (iVar4 < 0) {

+      if ((((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),0x54,

+                   &WPP_21054fb6c7e6333bd7681237225dac79_Traceguids,uVar5,

+                   "raiiBufLock(spRgbMediaBuffer).Lock() failed",iVar4);

+      }

+    }

+    else {

+      iVar1 = *(int *)(this + 0x18);

+      iVar7 = iVar4;

+      if (*(int *)(this + 0xdc) != 0) {

+        do {

+          piVar13 = (int *)(uVar12 * 0x1c + *(longlong *)(this + 0x88));

+          uVar11 = (longlong)(*piVar13 << 2) + (uint)(iVar1 * 4 * piVar13[1]) + local_40;

+          bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>::

+                  __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_3215164728> *)

+                                      &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3215164728>::GetImpl(void)'

+                                       ::__l2::impl);

+          uVar8 = local_res10[0];

+          if (bVar3) {

+            uVar8 = (int)uVar11 - (int)local_40;

+            if ((local_40 <= uVar11) && (uVar8 <= local_res10[0])) {

+              uVar8 = local_res10[0] - uVar8;

+              goto LAB_0;

+            }

+            iVar7 = -0x7ff8ffa9;

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar5 = RdpX_GetActivityIdPrefix();

+              uVar10 = 0x55;

+              iVar7 = -0x7ff8ffa9;

+              pcVar9 = "Invalid pixel buffer offset";

+LAB_1:

+              WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),uVar10,

+                         &WPP_21054fb6c7e6333bd7681237225dac79_Traceguids,uVar5,pcVar9,iVar7);

+            }

+            break;

+          }

+LAB_0:

+          _Var6 = (**(code **)(*(longlong *)param_2 + 0x48))

+                            (param_2,0,uVar11,uVar8,piVar13[2],piVar13[3],iVar1 * 4,*piVar13,

+                             piVar13[1]);

+          iVar7 = MapXResultToHR(_Var6);

+          if (iVar7 < 0) {

+            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+                ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+              uVar5 = RdpX_GetActivityIdPrefix();

+              uVar10 = 0x56;

+              pcVar9 = "SetSurfacePixels failed!";

+              goto LAB_1;

+            }

+            break;

+          }

+          uVar8 = (int)uVar12 + 1;

+          uVar12 = (ulonglong)uVar8;

+        } while (uVar8 < *(uint *)(this + 0xdc));

+      }

+      bVar3 = -1 < iVar4;

+      iVar4 = iVar7;

+      if (bVar3) {

+        (**(code **)(*local_48 + 0x20))();

+      }

+    }

+  }

+  plVar2 = local_48;

+  if (local_48 != (longlong *)0x0) {

+    local_48 = (longlong *)0x0;

+    (**(code **)(*plVar2 + 0x10))();

+  }

+  return iVar4;

+}

+
```

## `CClientFormatDataPacker::CreateInstance`  (modified)

```diff
--- CClientFormatDataPacker::CreateInstance
+++ CClientFormatDataPacker::CreateInstance
@@ -1,2 +1,57 @@
-Failed to decompile mstscax.dll - .ProgramDB CClientFormatDataPacker::CreateInstance : 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: static long __cdecl CClientFormatDataPacker::CreateInstance(class CRdrFileTransfer *

+   __ptr64,class CFormatDataPacker * __ptr64 * __ptr64,class CClipBase * __ptr64) */

+

+long __cdecl

+CClientFormatDataPacker::CreateInstance

+          (CRdrFileTransfer *param_1,CFormatDataPacker **param_2,CClipBase *param_3)

+

+{

+  long lVar1;

+  uint uVar2;

+  CFormatDataPacker *this;

+  CClipBase *pCVar3;

+  CFormatDataPacker *local_res20;

+  

+  local_res20 = (CFormatDataPacker *)0x0;

+  pCVar3 = param_3;

+  this = operator_new(0x58);

+  if (this == (CFormatDataPacker *)0x0) {

+    lVar1 = -0x7ff8fff2;

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xb,

+               &WPP_8c14e03f949636297d406c980b8b0fb6_Traceguids,uVar2);

+    }

+  }

+  else {

+    CFormatDataPacker::CFormatDataPacker(this,param_1,(char *)pCVar3,param_3);

+    *(undefined ***)this = &CBasePlayer::_vftable__for__INonDelegatingUnknown__;

+    *(undefined ***)(this + 8) = &_vftable__for__CTSObject__;

+    TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+              ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)&local_res20);

+    local_res20 = this;

+    (**(code **)(**(longlong **)(this + 0x20) + 8))();

+    lVar1 = Initialize((CClientFormatDataPacker *)(this + 8));

+    if (lVar1 < 0) {

+      if ((((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),10,

+                   &WPP_8c14e03f949636297d406c980b8b0fb6_Traceguids,uVar2,

+                   "Failed to initialize CClientFormatDataPacker!",lVar1);

+      }

+    }

+    else {

+      *param_2 = this;

+      (**(code **)(**(longlong **)(this + 0x20) + 8))();

+    }

+  }

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)&local_res20);

+  return lVar1;

+}

+
```

## `CProxyDataObjectManager::~CProxyDataObjectManager`  (modified)

```diff
--- CProxyDataObjectManager::~CProxyDataObjectManager
+++ CProxyDataObjectManager::~CProxyDataObjectManager
@@ -1,2 +1,51 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyDataObjectManager::~CProxyDataObjectManager : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* protected: virtual __cdecl CProxyDataObjectManager::~CProxyDataObjectManager(void) __ptr64 */

+

+void __thiscall CProxyDataObjectManager::~CProxyDataObjectManager(CProxyDataObjectManager *this)

+

+{

+  bool bVar1;

+  uint uVar2;

+  

+  *(undefined ***)this = &CBasePlayer::_vftable__for__INonDelegatingUnknown__;

+  *(undefined ***)(this + 8) = &_vftable__for__CTSObject__;

+  if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+      ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+    uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),10,

+             &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar2);

+  }

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_3624641849> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_3624641849>::GetImpl(void)'

+                      ::__l2::impl);

+  if (bVar1) {

+    DeleteCriticalSection((LPCRITICAL_SECTION)(this + 0xa0));

+  }

+  if (*(int *)(this + 0x30) != 0) {

+    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (4 < (byte)WPP_GLOBAL_Control[0x19])) {

+      uVar2 = RdpWppGetCurrentThreadActivityIdPrefix();

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0xb,

+               &WPP_1ae9284f858238e05bf265744063f80f_Traceguids,uVar2);

+    }

+    DeleteCriticalSection((LPCRITICAL_SECTION)(this + 0x38));

+  }

+  DynArray<SmartArray<CameraRedirConfig,unsigned_long>::CCleanType,unsigned_long>::

+  ~DynArray<SmartArray<CameraRedirConfig,unsigned_long>::CCleanType,unsigned_long>

+            ((DynArray<SmartArray<CameraRedirConfig,unsigned_long>::CCleanType,unsigned_long> *)

+             (this + 200));

+  DynArray<SmartArray<CameraRedirConfig,unsigned_long>::CCleanType,unsigned_long>::

+  ~DynArray<SmartArray<CameraRedirConfig,unsigned_long>::CCleanType,unsigned_long>

+            ((DynArray<SmartArray<CameraRedirConfig,unsigned_long>::CCleanType,unsigned_long> *)

+             (this + 0x88));

+  SmartArray<CProxyDataObject,unsigned_long>::~SmartArray<CProxyDataObject,unsigned_long>

+            ((SmartArray<CProxyDataObject,unsigned_long> *)(this + 0x70));

+  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

+            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x68));

+  *(undefined ***)this = CTSUnknown::vftable_for_INonDelegatingUnknown_;

+  *(uint *)(this + 0x1c) = *(uint *)(this + 0x1c) | 8;

+  *(undefined ***)(this + 8) = CTSObject::vftable;

+  return;

+}

+
```

## `CNC::NC_OnMCSChannelJoinConfirm`  (modified)

```diff
--- CNC::NC_OnMCSChannelJoinConfirm
+++ wil::details::FeatureImpl<__WilFeatureTraits_Feature_2884880696>::GetCurrentFeatureEnabledState
@@ -1,221 +1,44 @@
 

-/* WARNING: Function: _guard_dispatch_icall$thunk$10345483385596137414 replaced with injection:

-   guard_dispatch_icall */

-/* public: void __cdecl CNC::NC_OnMCSChannelJoinConfirm(unsigned int,unsigned short,int * __ptr64)

-   __ptr64 */

+/* private: union wil_details_FeatureStateCache __cdecl wil::details::FeatureImpl<struct

+   __WilFeatureTraits_Feature_2884880696>::GetCurrentFeatureEnabledState(int * __ptr64) __ptr64 */

 

-void __thiscall CNC::NC_OnMCSChannelJoinConfirm(CNC *this,uint param_1,ushort param_2,int *param_3)

+int * __thiscall

+wil::details::FeatureImpl<__WilFeatureTraits_Feature_2884880696>::GetCurrentFeatureEnabledState

+          (FeatureImpl<__WilFeatureTraits_Feature_2884880696> *this,int *param_1)

 

 {

-  ushort uVar1;

-  undefined2 uVar2;

-  longlong *plVar3;

-  bool bVar4;

-  int iVar5;

-  undefined4 uVar6;

-  ulong uVar7;

-  undefined4 uVar8;

-  uint uVar9;

-  undefined4 uVar10;

-  uint uVar11;

-  CMCS *pCVar12;

-  wchar_t *pwVar13;

-  IRdpClientStateTransitionEventLogCallbacks *local_res8;

-  char *in_stack_ffffffffffffffa8;

-  undefined8 uVar14;

-  undefined8 in_stack_ffffffffffffffb0;

+  bool bVar1;

+  FEATURE_ENABLED_STATE FVar2;

+  uint uVar3;

+  uint uVar4;

+  uint uVar5;

+  uint uVar6;

+  int *in_R8;

   

-  uVar8 = (undefined4)((ulonglong)in_stack_ffffffffffffffb0 >> 0x20);

-  bVar4 = false;

-  local_res8 = (IRdpClientStateTransitionEventLogCallbacks *)0x0;

-  plVar3 = *(longlong **)(this + 0xb8);

-  *param_3 = 0;

-  if ((((plVar3 != (longlong *)0x0) &&

-       (iVar5 = (**(code **)(*plVar3 + 600))

-                          (plVar3,&IID_IRdpClientStateTransitionEventLogCallbacks,&local_res8),

-       iVar5 < 0)) && ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control)) &&

-     (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

-    uVar6 = RdpX_GetActivityIdPrefix();

-    uVar14 = CONCAT44(uVar8,iVar5);

-    in_stack_ffffffffffffffa8 = "Failed to get event log session";

-    WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4c,

-               &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar6,

-               "Failed to get event log session",uVar14);

-    uVar8 = (undefined4)((ulonglong)uVar14 >> 0x20);

-  }

-  uVar6 = (undefined4)((ulonglong)in_stack_ffffffffffffffa8 >> 0x20);

-  if (param_1 == 0) {

-    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

-      uVar6 = RdpX_GetActivityIdPrefix();

-      uVar14 = CONCAT62((int6)((ulonglong)in_stack_ffffffffffffffa8 >> 0x10),param_2);

-      WPP_SF_DH(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4e,

-                &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar6,uVar14);

-      uVar6 = (undefined4)((ulonglong)uVar14 >> 0x20);

-    }

-    uVar1 = *(ushort *)(*(longlong *)(this + 0xa0) + 0x180);

-    if (uVar1 == param_2) {

-      uVar7 = CTSRdpConnectionStack::GetClientMCSID(*(CTSRdpConnectionStack **)(this + 0xc0));

-      if (param_2 == uVar7) {

-        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-            ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

-          uVar2 = *(undefined2 *)(this + 0x30);

-          uVar8 = RdpX_GetActivityIdPrefix();

-          WPP_SF_DH(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x50,

-                    &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar8,uVar2);

-        }

-        LogMCSChannelJoinConfirmationChannelName(local_res8,param_2,(ushort *)L"user");

-        pCVar12 = *(CMCS **)(this + 0xa0);

-        uVar9 = CTSRdpConnectionStack::GetClientMCSID(*(CTSRdpConnectionStack **)(this + 0xc0));

-        uVar11 = (uint)*(ushort *)(this + 0x30);

-LAB_0:

-        CMCS::MCS_JoinChannel(pCVar12,uVar11,uVar9);

-      }

-      else {

-        if ((param_2 == *(ushort *)(this + 0x30)) || (param_2 == *(ushort *)(this + 0x32))) {

-          pwVar13 = L"i/o";

-          if (param_2 != *(ushort *)(this + 0x30)) {

-            pwVar13 = L"message";

-          }

-          LogMCSChannelJoinConfirmationChannelName(local_res8,param_2,(ushort *)pwVar13);

-          if ((param_2 == *(ushort *)(this + 0x30)) && (*(longlong *)(this + 0x88) != 0)) {

-            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-                ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

-              uVar1 = *(ushort *)(this + 0x32);

-              uVar8 = RdpX_GetActivityIdPrefix();

-              WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x51,

-                        &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar8,

-                        CONCAT44(uVar6,(uint)uVar1));

-            }

-            pCVar12 = *(CMCS **)(this + 0xa0);

-            *(undefined4 *)(this + 0x40) = 0;

-            uVar9 = CTSRdpConnectionStack::GetClientMCSID(*(CTSRdpConnectionStack **)(this + 0xc0));

-            uVar11 = (uint)*(ushort *)(this + 0x32);

-          }

-          else {

-            if (*(int *)(this + 0x3c) == 0) {

-              if ((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) {

-                if (((WPP_GLOBAL_Control[0x1c] & 1) != 0) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

-                  uVar8 = RdpX_GetActivityIdPrefix();

-                  WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x53,

-                           &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar8);

-                }

-                goto LAB_1;

-              }

-              goto LAB_2;

-            }

-            if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-                ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

-              uVar1 = *(ushort *)(this + 0x44);

-              uVar8 = RdpX_GetActivityIdPrefix();

-              WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x52,

-                        &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar8,

-                        CONCAT44(uVar6,(uint)uVar1));

-            }

-            pCVar12 = *(CMCS **)(this + 0xa0);

-            *(undefined4 *)(this + 0x40) = 0;

-            uVar9 = CTSRdpConnectionStack::GetClientMCSID(*(CTSRdpConnectionStack **)(this + 0xc0));

-            uVar11 = (uint)*(ushort *)(this + 0x44);

-          }

-          goto LAB_0;

-        }

-        uVar9 = *(uint *)(this + 0x40);

-        if (param_2 != *(ushort *)(this + (ulonglong)uVar9 * 2 + 0x44)) {

-          LogMCSChannelJoinConfirmationErrorCode(local_res8,0x38);

-          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (WPP_GLOBAL_Control[0x19] != '\0')) {

-            WPP_SF_H(*(undefined8 *)(WPP_GLOBAL_Control + 0x10));

-          }

-          goto LAB_3;

-        }

-        if (uVar9 < *(uint *)(this + 0x2b8)) {

-          pwVar13 = (wchar_t *)(this + (ulonglong)uVar9 * 0x10 + 0xd8);

-        }

-        else {

-          pwVar13 = L"invalid";

-        }

-        LogMCSChannelJoinConfirmationChannelName(local_res8,param_2,(ushort *)pwVar13);

-        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-            ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

-          RdpX_GetActivityIdPrefix();

-          WPP_SF_DdDS(*(undefined8 *)(WPP_GLOBAL_Control + 0x10));

-        }

-        uVar9 = *(int *)(this + 0x40) + 1;

-        *(uint *)(this + 0x40) = uVar9;

-        if (uVar9 == *(uint *)(this + 0x3c)) {

-          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

-            uVar8 = RdpX_GetActivityIdPrefix();

-            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x55,

-                     &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar8);

-          }

-          bVar4 = true;

-        }

-        else {

-          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

-            uVar1 = *(ushort *)(this + (ulonglong)uVar9 * 2 + 0x44);

-            uVar10 = RdpX_GetActivityIdPrefix();

-            WPP_SF_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x56,

-                       &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar10,CONCAT44(uVar6,uVar9)

-                       ,CONCAT44(uVar8,(uint)uVar1));

-          }

-          pCVar12 = *(CMCS **)(this + 0xa0);

-          uVar7 = CTSRdpConnectionStack::GetClientMCSID(*(CTSRdpConnectionStack **)(this + 0xc0));

-          CMCS::MCS_JoinChannel

-                    (pCVar12,(uint)*(ushort *)(this + (ulonglong)*(uint *)(this + 0x40) * 2 + 0x44),

-                     uVar7);

-        }

-        if (bVar4) {

-LAB_1:

-          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-              ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (3 < (byte)WPP_GLOBAL_Control[0x19])) {

-            uVar8 = RdpX_GetActivityIdPrefix();

-            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x58,

-                     &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar8);

-          }

-LAB_2:

-          *(undefined2 *)(*(longlong *)(this + 0xa0) + 0x180) = 0xffff;

-          if (local_res8 != (IRdpClientStateTransitionEventLogCallbacks *)0x0) {

-            (**(code **)(*(longlong *)local_res8 + 0x18))

-                      (local_res8,PTR_u_RDPClient_TCP_180890068,5,PTR_u_TcpStateJoining_1808901e8,6,

-                       PTR_u_TcpStateChannel_1808901f0,0xc,PTR_u_TcpEventRecvCJc_180890150);

-          }

-          *param_3 = 1;

-          goto LAB_4;

-        }

-      }

-      if (local_res8 != (IRdpClientStateTransitionEventLogCallbacks *)0x0) {

-        (**(code **)(*(longlong *)local_res8 + 0x18))

-                  (local_res8,PTR_u_RDPClient_TCP_180890068,5,PTR_u_TcpStateJoining_1808901e8,5,

-                   PTR_u_TcpStateJoining_1808901e8,0xc,PTR_u_TcpEventRecvCJc_180890150);

-      }

-      goto LAB_4;

-    }

-    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_DLL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4f,

-                 &WPP_503a0a1cfd8f33f99479c0bb2930b27b_Traceguids,uVar6,uVar1,

-                 CONCAT44(uVar8,(uint)param_2));

-    }

-    LogMCSChannelJoinConfirmationErrorCode(local_res8,0x38);

-LAB_3:

-    uVar7 = 0x3804;

+  FVar2 = WilApi_GetFeatureEnabledState(0x3aea274,3,in_R8);

+  param_1[0] = 0;

+  param_1[1] = 0;

+  uVar5 = -(uint)((FVar2 & 0x40) != 0) & 0x800 | -(uint)((FVar2 & 0x80) != 0) & 0x400;

+  uVar6 = uVar5 | (FVar2 & 3) << 7;

+  *param_1 = uVar6;

+  if ((FVar2 & 0xffffff3f) == 0) {

+    uVar3 = 0x40;

   }

   else {

-    if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

-        ((WPP_GLOBAL_Control[0x1c] & 1) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

-      RdpX_GetActivityIdPrefix();

-      WPP_SF_DHD(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x4d);

+    uVar3 = 0;

+    if ((FVar2 & 0xffffff3f) == 2) {

+      uVar3 = 0x40;

     }

-    LogMCSChannelJoinConfirmationErrorCode(local_res8,0x37);

-    uVar7 = 0x3704;

   }

-  *(ulong *)(this + 0x38) = uVar7;

-  CMCS::Disconnect(*(CMCS **)(this + 0xa0),uVar7);

-LAB_4:

-  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)&local_res8);

-  return;

+  bVar1 = false;

+  uVar4 = 1;

+  if ((uVar5 == 0xc00) || (uVar3 != 0)) {

+    bVar1 = true;

+  }

+  if ((uVar3 == 0) || (!bVar1)) {

+    uVar4 = 0;

+  }

+  *param_1 = uVar6 | uVar3 | uVar4;

+  return param_1;

 }
```

## `CClipBase::~CClipBase`  (modified)

```diff
--- CClipBase::~CClipBase
+++ operator_new
@@ -1,46 +1,19 @@
 

-/* public: virtual __cdecl CClipBase::~CClipBase(void) __ptr64 */

+/* void * __ptr64 __cdecl operator new(unsigned __int64) */

 

-void __thiscall CClipBase::~CClipBase(CClipBase *this)

+void * __cdecl operator_new(__uint64 param_1)

 

 {

-  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

-            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x358));

-  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x348));

-  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x340));

-  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x338));

-  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

-            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x330));

-  EnterpriseClipboardApi::Terminate((EnterpriseClipboardApi *)(this + 800));

-  CFormatListCache::~CFormatListCache((CFormatListCache *)(this + 0x2f0));

-  SmartMap<CFileContentsReaderManager,unsigned_long>::

-  ~SmartMap<CFileContentsReaderManager,unsigned_long>

-            ((SmartMap<CFileContentsReaderManager,unsigned_long> *)(this + 0x2b0));

-  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x2a8));

-  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x2a0));

-  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x298));

-  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x290));

-  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x288));

-  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x280));

-  TCntPtr<ITSThread>::SafeRelease((TCntPtr<ITSThread> *)(this + 0x278));

-  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

-            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x270));

-  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

-            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x268));

-  TCntPtr<CTSObjectPool<CRDPENCCONStreamBufferPoolObject>_>::SafeRelease

-            ((TCntPtr<CTSObjectPool<CRDPENCCONStreamBufferPoolObject>_> *)(this + 0x160));

-  *(undefined8 *)(this + 0x140) = 0;

-  CHdropToFgdConverter::ClearFgdCache((CHdropToFgdConverter *)(this + 0x128));

-  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

-            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x120));

-  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

-            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x118));

-  TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig>::SafeRelease

-            ((TCntPtr<RdpBatteryStatusRedirectionClientPluginConfig> *)(this + 0x110));

-  CFormatIdMap::Clear((CFormatIdMap *)(this + 200));

-  *(undefined ***)this = CTSUnknown::vftable_for_INonDelegatingUnknown_;

-  *(uint *)(this + 0x1c) = *(uint *)(this + 0x1c) | 8;

-  *(undefined ***)(this + 8) = CTSObject::vftable;

-  return;

+  int iVar1;

+  void *pvVar2;

+  

+  do {

+    pvVar2 = malloc(param_1);

+    if (pvVar2 != (void *)0x0) {

+      return pvVar2;

+    }

+    iVar1 = _callnewh(param_1);

+  } while (iVar1 != 0);

+  return (void *)0x0;

 }
```

## `CProxyDataObject::Initialize`  (modified)

```diff
--- CProxyDataObject::Initialize
+++ wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled
@@ -1,2 +1,19 @@
-Failed to decompile mstscax.dll - .ProgramDB CProxyDataObject::Initialize : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: bool __cdecl wil::details::FeatureImpl<struct

+   __WilFeatureTraits_Feature_3624641849>::__private_IsEnabled(void) __ptr64 */

+

+bool __thiscall

+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled

+          (FeatureImpl<__WilFeatureTraits_Feature_3624641849> *this)

+

+{

+  ReportingKind in_R8D;

+  __uint64 in_R9;

+  undefined1 local_res10;

+  

+  GetCachedFeatureEnabledState(this);

+  ReportUsage(this,(bool)(local_res10 & 1),in_R8D,in_R9);

+  Feature_3624641849__private_lastUsedTickCount = GetTickCount();

+  return (bool)(local_res10 & 1);

+}

+
```

## `CRedirectPromptBasePermissionItem::RuntimeClassInitialize`  (modified)

```diff
--- CRedirectPromptBasePermissionItem::RuntimeClassInitialize
+++ CRedirectPromptWebAuthnPermissionItem::RuntimeClassInitialize
@@ -1,55 +1,31 @@
+

+/* public: long __cdecl CRedirectPromptWebAuthnPermissionItem::RuntimeClassInitialize(struct

+   HINSTANCE__ * __ptr64,class ITSCoreApi * __ptr64,class ITSWin32CoreApi * __ptr64,int,int) __ptr64

+    */

 

 long __thiscall

-CUI::AsyncOnNotifyProtocolTimerFiredRcvThreadWorkerAsyncCallback::RuntimeClassInitialize

-          (CRedirectPromptBasePermissionItem *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

-          ITSWin32CoreApi *param_3,int param_4,ulong param_5,int param_6,int param_7)

+CRedirectPromptWebAuthnPermissionItem::RuntimeClassInitialize

+          (CRedirectPromptWebAuthnPermissionItem *this,HINSTANCE__ *param_1,ITSCoreApi *param_2,

+          ITSWin32CoreApi *param_3,int param_4,int param_5)

 

 {

-  long lVar1;

-  CRedirectPromptBasePermissionItem *this_00;

-  CRedirectPromptBasePermissionItem *pCStack0000000000000060;

-  int *in_stack_00000080;

+  bool bVar1;

+  long lVar2;

+  int iVar3;

   

-  *(undefined4 *)this = 0;

-  this_00 = operator_new(0x60,&std::nothrow);

-  if (this_00 == (CRedirectPromptBasePermissionItem *)0x0) {

-    lVar1 = -0x7ff8fff2;

-    pCStack0000000000000060 = (CRedirectPromptBasePermissionItem *)0x0;

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_UpdateWebAuthnPasskeysString>::

+          __private_IsEnabled((FeatureImpl<__WilFeatureTraits_Feature_UpdateWebAuthnPasskeysString>

+                               *)&`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_UpdateWebAuthnPasskeysString>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_UpdateWebAuthnPasskeysString>::GetImpl(void)'

+                                  ::__l2::impl);

+  if (bVar1) {

+    iVar3 = 0x3b00;

   }

   else {

-    pCStack0000000000000060 = this_00;

-    CRedirectPromptBasePermissionItem::CRedirectPromptBasePermissionItem

-              (this_00,(ushort *)L"Drives");

-    pCStack0000000000000060 = (CRedirectPromptBasePermissionItem *)0x0;

-    *(undefined ***)this_00 =

-         &CRedirectPromptDrivesPermissionItem::

-          _vftable__for__IRedirectPromptPermissionItemInternal__;

-    *(undefined ***)(this_00 + 8) =

-         &CRedirectPromptDrivesPermissionItem::

-          _vftable__for__Microsoft__WRL__Details__ImplementsHelper<Microsoft::WRL::RuntimeClassFlags<2>,1,IRedirectPromptPermissionItem>__

-    ;

-    lVar1 = CRedirectPromptBasePermissionItem::RuntimeClassInitialize

-                      (this_00,*(HINSTANCE__ **)param_1,*(ITSCoreApi **)param_2,

-                       *(ITSWin32CoreApi **)param_3,0x3ab9,8,*in_stack_00000080,g_wasDrivesRequested

-                      );

-    if (lVar1 < 0) {

-      Microsoft::WRL::Details::

-      RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IRedirectPromptPermissionItemInternal,IRedirectPromptPermissionItem>

-      ::Release((RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IRedirectPromptPermissionItemInternal,IRedirectPromptPermissionItem>

-                 *)this_00);

-    }

-    else {

-      Microsoft::WRL::Details::SafeUnknownIncrementReference((long *)(this_00 + 0x14));

-      *(CRedirectPromptBasePermissionItem **)this = this_00;

-      Microsoft::WRL::Details::

-      RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IRedirectPromptPermissionItemInternal,IRedirectPromptPermissionItem>

-      ::Release((RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,1,0,0,IRedirectPromptPermissionItemInternal,IRedirectPromptPermissionItem>

-                 *)this_00);

-      lVar1 = 0;

-    }

+    iVar3 = 0x3ae9;

   }

-  CacNx::Own<CacDecodingNx::Decoding>::~Own<CacDecodingNx::Decoding>

-            ((Own<CacDecodingNx::Decoding> *)&stack0x00000060);

-  return lVar1;

+  lVar2 = CRedirectPromptBasePermissionItem::RuntimeClassInitialize

+                    ((CRedirectPromptBasePermissionItem *)this,param_1,param_2,param_3,iVar3,5,

+                     param_4,param_5);

+  return lVar2;

 }
```

## `CHdropToFgdConverter::~CHdropToFgdConverter`  (modified)

```diff
--- CHdropToFgdConverter::~CHdropToFgdConverter
+++ CHdropToFgdConverter::ClearFgdCache
@@ -1,2 +1,22 @@
-Failed to decompile mstscax.dll - .ProgramDB CHdropToFgdConverter::~CHdropToFgdConverter : 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: void __cdecl CHdropToFgdConverter::ClearFgdCache(void) __ptr64 */

+

+void __thiscall CHdropToFgdConverter::ClearFgdCache(CHdropToFgdConverter *this)

+

+{

+  if (*(HLOCAL *)this != (HLOCAL)0x0) {

+    LocalFree(*(HLOCAL *)this);

+    *(undefined8 *)this = 0;

+  }

+  if (*(HLOCAL *)(this + 8) != (HLOCAL)0x0) {

+    LocalFree(*(HLOCAL *)(this + 8));

+    *(undefined8 *)(this + 8) = 0;

+  }

+  if (*(longlong **)(this + 0x18) != (longlong *)0x0) {

+    (**(code **)(**(longlong **)(this + 0x18) + 0x50))();

+  }

+  return;

+}

+
```

## `CTsRdpCertSignature::GetCertificateChainContext`  (modified)

```diff
--- CTsRdpCertSignature::GetCertificateChainContext
+++ CTsRdpCertSignature::GetCertificateThumbPrintByPropId
@@ -1,2 +1,82 @@
-Failed to decompile mstscax.dll - .ProgramDB CTsRdpCertSignature::GetCertificateChainContext : 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 CTsRdpCertSignature::GetCertificateThumbPrintByPropId(unsigned

+   long,unsigned char * __ptr64 * __ptr64,unsigned long * __ptr64) __ptr64 */

+

+long __thiscall

+CTsRdpCertSignature::GetCertificateThumbPrintByPropId

+          (CTsRdpCertSignature *this,ulong param_1,uchar **param_2,ulong *param_3)

+

+{

+  BOOL BVar1;

+  DWORD DVar2;

+  uint uVar3;

+  uchar *_Dst;

+  undefined1 auStack_d8 [32];

+  char *local_b8;

+  undefined4 local_b0;

+  DWORD local_a8 [4];

+  undefined1 local_98 [112];

+  ulonglong local_28;

+  

+  local_28 = __security_cookie ^ (ulonglong)auStack_d8;

+  local_a8[0] = 100;

+  if ((param_2 == (uchar **)0x0) || (param_3 == (ulong *)0x0)) {

+    DVar2 = 0x80070057;

+    if (((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+       (((WPP_GLOBAL_Control[0x1c] & 8) != 0 && (1 < (byte)WPP_GLOBAL_Control[0x19])))) {

+      uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+      local_b0 = 0x80070057;

+      local_b8 = "GetCertificateThumbPrint failed";

+      WPP_SF_Dsd(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x17,

+                 &WPP_836fe736e3db3df6a54e2b58f6c76f3b_Traceguids,uVar3);

+    }

+  }

+  else {

+    *param_2 = (uchar *)0x0;

+    *param_3 = 0;

+    DVar2 = 0;

+    if (*(PCCERT_CONTEXT *)(this + 0x68) != (PCCERT_CONTEXT)0x0) {

+      BVar1 = CertGetCertificateContextProperty

+                        (*(PCCERT_CONTEXT *)(this + 0x68),param_1,local_98,local_a8);

+      if (BVar1 == 0) {

+        if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+            ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+          DVar2 = GetLastError();

+          if (0 < (int)DVar2) {

+            DVar2 = DVar2 & 0xffff | 0x80070000;

+          }

+          uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+          local_b8 = (char *)CONCAT44(local_b8._4_4_,DVar2);

+          WPP_SF_DL(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x18,

+                    &WPP_836fe736e3db3df6a54e2b58f6c76f3b_Traceguids,uVar3);

+        }

+        DVar2 = GetLastError();

+        if (0 < (int)DVar2) {

+          DVar2 = DVar2 & 0xffff | 0x80070000;

+        }

+      }

+      else {

+        _Dst = (uchar *)PAL_System_MemAlloc(local_a8[0],1);

+        *param_2 = _Dst;

+        if (_Dst == (uchar *)0x0) {

+          if ((((undefined **)WPP_GLOBAL_Control != &WPP_GLOBAL_Control) &&

+              ((WPP_GLOBAL_Control[0x1c] & 8) != 0)) && (1 < (byte)WPP_GLOBAL_Control[0x19])) {

+            uVar3 = RdpWppGetCurrentThreadActivityIdPrefix();

+            local_b8 = "*ppThumbprint";

+            WPP_SF_Ds(*(undefined8 *)(WPP_GLOBAL_Control + 0x10),0x19,

+                      &WPP_836fe736e3db3df6a54e2b58f6c76f3b_Traceguids,uVar3);

+          }

+          DVar2 = 0x8007000e;

+        }

+        else {

+          memcpy(_Dst,local_98,(ulonglong)local_a8[0]);

+          *param_3 = local_a8[0];

+          DVar2 = 0;

+        }

+      }

+    }

+  }

+  return DVar2;

+}

+
```

## `CTSRdpConnectionStack::ParseUserData`  (modified)

```diff
--- CTSRdpConnectionStack::ParseUserData
+++ Feature_MSRC113297_IsEnabled
@@ -1,2 +1,13 @@
-Failed to decompile mstscax.dll - .ProgramDB CTSRdpConnectionStack::ParseUserData : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+bool Feature_MSRC113297_IsEnabled(void)

+

+{

+  bool bVar1;

+  

+  bVar1 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_843566394>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_843566394> *)

+                     &`private:_static_class_wil::details::FeatureImpl<__WilFeatureTraits_Feature_843566394>&___ptr64___cdecl_wil::Feature<__WilFeatureTraits_Feature_843566394>::GetImpl(void)'

+                      ::__l2::impl);

+  return bVar1;

+}

+
```

## `MSVCRT.DLL::wcstok_s`  (modified)

```diff
--- MSVCRT.DLL::wcstok_s calling
+++ MSVCRT.DLL::wcstok_s calling
@@ -7,0 +8 @@
+CRemoteDesktopClientSettings::IsThumbPrintInRegistryOld
```

## `KERNEL32.DLL::ReleaseSRWLockExclusive`  (modified)

```diff
--- KERNEL32.DLL::ReleaseSRWLockExclusive calling
+++ MSVCRT.DLL::wcstok_s calling
@@ -1,52 +1,10 @@
-<lambda_7d79673f8c1f749f5c9f0bd313772f5c>::operator()
-CameraAdapter::ActivateDevice
-CameraAdapter::ActivateDevice2
-CameraAdapter::DeactivateDevice
-CameraAdapter::DoDeactivateDevice
-CameraAdapter::ResetStreams
-CameraAdapter::StartStreams
-CameraAdapter::StopStreams
-ClipboardWndProc
-DloadAcquireSectionWriteAccess
-DloadReleaseSectionWriteAccess
-FlushLookUpTableBucket
-LockClipboard
-NamedPipeAdaptor::BeginReadPipe
-NamedPipeAdaptor::ClosePipe
-NamedPipeAdaptor::CompleteReadPipe
-NamedPipeAdaptor::IsTerminating
-NamedPipeAdaptor::OpenPipe
-NamedPipeAdaptor::PipeHandlerThreadLoop
-NamedPipeAdaptor::WriteMessage
-NamedPipeAdaptor::~NamedPipeAdaptor
-OleGetClipboardWithFallbackInternal
-OleSetClipboardWithFallbackInternal
-RdpTaskScheduler::CleanUp
-RdpTaskScheduler::DispatchAsyncCall
-RdpTaskScheduler::DispatchAsyncCallOnSignaledEvent
-RdpTaskScheduler::DoWork
-RdpTaskScheduler::DoWorkOnSignaledEvent
-RdpWinDesktopRemoteAppUIManager::CreateDeviceResources
-RdpWinDesktopRemoteAppUIManager::CreateUiaProxyAsync
-RdpWinDesktopRemoteAppUIManager::GetWindowOutputMap
-RdpWinDesktopRemoteAppUIManager::OnOutputCreated
-RdpWinDesktopRemoteAppUIManager::OnUiaRegistrationRequested
-RdpWinDesktopRemoteAppUIManager::SetRemoteAppCore
-RdpWinDesktopRemoteAppUIManager::Terminate
-TlgAggregateInternalProviderCallback
-TlgRegisterAggregateProviderEx
-TlgUnregisterAggregateProvider
-_Init_thread_footer
-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
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>::GetCachedFeatureEnabledState
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>::ReportUsage
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_IncreaseUdpTransportTimerInterval2>::GetCachedFeatureEnabledState
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_IncreaseUdpTransportTimerInterval2>::ReportUsage
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_StrideChecks>::GetCachedFeatureEnabledState
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_StrideChecks>::ReportUsage
-wil::details::unique_storage<wil::details::resource_policy<_RTL_SRWLOCK*___ptr64,void_(__cdecl*)(_RTL_SRWLOCK*___ptr64),&void___cdecl_ReleaseSRWLockExclusive(struct__RTL_SRWLOCK*___ptr64),wistd::integral_constant<unsigned___int64,1>,_RTL_SRWLOCK*___ptr64,_RTL_SRWLOCK*___ptr64,0,std::nullptr_t>_>::~unique_storage<wil::details::resource_policy<_RTL_SRWLOCK*___ptr64,void_(__cdecl*)(_RTL_SRWLOCK*___ptr64),&void___cdecl_ReleaseSRWLockExclusive(struct__RTL_SRWLOCK*___ptr64),wistd::integral_constant<unsigned___int64,1>,_RTL_SRWLOCK*___ptr64,_RTL_SRWLOCK*___ptr64,0,std::nullptr_t>_>
+CCLX::CoreObjectPhase2Initialize
+CHttpIoRequestWinHttp::Initialize
+CMsTscAx::put_Property
+CRdpSettingsStore::CalculateSecureSettingsLength
+CRdpSettingsStore::CopySecureSettings
+CRdpSettingsStore::VerifySensitiveSettings
+CRemoteDesktopClientSettings::IsThumbPrintInRegistry
+CTSVirtualChannelPluginLoader::ProcessExternalVirtualChannelPlugins
+CTSX224Filter::GetAllowedSecurityProtocols
+DynVCPluginLoader::_LoadExternalPlugins
```

## `KERNEL32.DLL::EnterCriticalSection`  (modified)

```diff
--- KERNEL32.DLL::EnterCriticalSection calling
+++ KERNEL32.DLL::EnterCriticalSection calling
@@ -49,0 +50,2 @@
+CProxyDataObject::OnManagerTerminating
+CProxyDataObject::~CProxyDataObject
@@ -53,0 +56 @@
+CProxyDataObjectManager::NotifyDataObjectOnMgrTermination
@@ -54,0 +58 @@
+CProxyDataObjectManager::RegisterDataObjectForTracking
@@ -56,0 +61,4 @@
+CProxyDataObjectManager::Terminate
+CProxyDataObjectManager::UnregisterAndCleanupDataObjectForTracking
+CProxyStream::OnManagerTerminating
+CProxyStream::~CProxyStream
@@ -57,0 +66 @@
+CProxyStreamManager::NotifyProxyStreamObjectsOnMgrTermination
@@ -58,0 +68 @@
+CProxyStreamManager::RegisterProxyStreamObjectForTracking
@@ -60,0 +71 @@
+CProxyStreamManager::UnregisterProxyStreamObjectForTracking
```

## `BCRYPT.DLL::BCryptCloseAlgorithmProvider`  (modified)

```diff
--- BCRYPT.DLL::BCryptCloseAlgorithmProvider calling
+++ BCRYPT.DLL::BCryptCloseAlgorithmProvider calling
@@ -1,0 +2 @@
+CTsRdpCertSignature::GetCertificateThumbPrintByBCryptAlgorithm
```

## `OLEAUT32.DLL::SysFreeString`  (modified)

```diff
--- OLEAUT32.DLL::SysFreeString calling
+++ OLEAUT32.DLL::SysFreeString calling
@@ -19,0 +20,2 @@
+CMsTscAx::ConfigureConnectToAgentSession
+CMsTscAx::ConfigureConnectToChildSession
@@ -53,0 +56 @@
+CRemoteDesktopClientSettings::IsThumbPrintInRegistry
```

## `OLEAUT32.DLL::VariantClear`  (modified)

```diff
--- OLEAUT32.DLL::VariantClear calling
+++ OLEAUT32.DLL::VariantClear calling
@@ -20,0 +21,2 @@
+CMsTscAx::ConfigureConnectToAgentSession
+CMsTscAx::ConfigureConnectToChildSession
```

## `OLEAUT32.DLL::SysAllocString`  (modified)

```diff
--- OLEAUT32.DLL::SysAllocString calling
+++ OLEAUT32.DLL::SysAllocString calling
@@ -10,0 +11,2 @@
+CMsTscAx::ConfigureConnectToAgentSession
+CMsTscAx::ConfigureConnectToChildSession
```

## `KERNEL32.DLL::AcquireSRWLockExclusive`  (modified)

```diff
--- KERNEL32.DLL::AcquireSRWLockExclusive calling
+++ KERNEL32.DLL::AcquireSRWLockExclusive calling
@@ -57,0 +58 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_1205842233>::GetCachedFeatureEnabledState
@@ -58,0 +60 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_143638841>::GetCachedFeatureEnabledState
@@ -62,0 +65,2 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_2141685050>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_2141685050>::ReportUsage
@@ -63,0 +68 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_2884880696>::GetCachedFeatureEnabledState
@@ -65,0 +71,2 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>::ReportUsage
@@ -68,0 +76,2 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3540497722>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3540497722>::ReportUsage
@@ -69,0 +79 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::GetCachedFeatureEnabledState
@@ -70,0 +81 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3719021881>::GetCachedFeatureEnabledState
@@ -73,0 +85,10 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_4280538425>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_4280538425>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_450338104>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_64729402>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_735818040>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_843566394>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_937406778>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_AgentUserConsentExperience_Wave2>::GetCachedFeatureEnabledState
@@ -78,0 +100 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_DisableFeedbackHubTrace>::GetCachedFeatureEnabledState
@@ -82,0 +105 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixBug62354957>::GetCachedFeatureEnabledState
@@ -84,2 +106,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>::GetCachedFeatureEnabledState
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>::ReportUsage
@@ -86,0 +108 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_ID58336780>::GetCachedFeatureEnabledState
@@ -89,2 +111,3 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_RailV2ConnectionInfoDisclosure>::GetCachedFeatureEnabledState
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_RdpClipDlpIntegration>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_IsoBrokerV3Apis>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_LocPerfVal>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_MSRC108255>::GetCachedFeatureEnabledState
@@ -91,0 +115 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_Servicing_MSRC108321>::GetCachedFeatureEnabledState
@@ -94,2 +117,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_Standalone_25_11_NonSec>::GetCachedFeatureEnabledState
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_Standalone_26_03_NonSec>::GetCachedFeatureEnabledState
@@ -98,0 +121 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_Standalone_26_07_NonSec>::GetCachedFeatureEnabledState
@@ -100,3 +122,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_StrideChecks>::GetCachedFeatureEnabledState
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_StrideChecks>::ReportUsage
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_Ten2Loc>::GetCachedFeatureEnabledState
@@ -106,0 +127 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_UpdateWebAuthnPasskeysString>::GetCachedFeatureEnabledState
@@ -108,2 +128,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_UxLabTest>::GetCachedFeatureEnabledState
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_ValLabTest>::GetCachedFeatureEnabledState
```

## `BCRYPT.DLL::BCryptGetProperty`  (modified)

```diff
--- BCRYPT.DLL::BCryptGetProperty calling
+++ BCRYPT.DLL::BCryptGetProperty calling
@@ -1,0 +2 @@
+CTsRdpCertSignature::GetCertificateThumbPrintByBCryptAlgorithm
```

## `KERNEL32.DLL::SetThreadpoolTimer`  (modified)

```diff
--- KERNEL32.DLL::SetThreadpoolTimer calling
+++ KERNEL32.DLL::SetThreadpoolTimer calling
@@ -11,0 +12 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_2141685050>::ReportUsage
@@ -12,0 +14 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>::ReportUsage
@@ -13,0 +16,3 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3540497722>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_4280538425>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>::ReportUsage
@@ -15 +19,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>::ReportUsage
@@ -17 +20,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_StrideChecks>::ReportUsage
```

## `CRYPT32.DLL::CertGetCertificateContextProperty`  (modified)

```diff
--- CRYPT32.DLL::CertGetCertificateContextProperty calling
+++ CRYPT32.DLL::CertGetCertificateContextProperty calling
@@ -3 +3,2 @@
-CTsRdpCertSignature::GetCertificateThumbPrint
+CTsRdpCertSignature::GetCertificateThumbPrintByPropId
+CTsRdpCertSignature::GetCertificateThumbPrintOld
```

## `BCRYPT.DLL::BCryptOpenAlgorithmProvider`  (modified)

```diff
--- BCRYPT.DLL::BCryptOpenAlgorithmProvider calling
+++ BCRYPT.DLL::BCryptOpenAlgorithmProvider calling
@@ -1,0 +2 @@
+CTsRdpCertSignature::GetCertificateThumbPrintByBCryptAlgorithm
```

## `KERNEL32.DLL::CreateThreadpoolTimer`  (modified)

```diff
--- KERNEL32.DLL::CreateThreadpoolTimer calling
+++ KERNEL32.DLL::CreateThreadpoolTimer calling
@@ -6,0 +7 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_2141685050>::ReportUsage
@@ -7,0 +9 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>::ReportUsage
@@ -8,0 +11,3 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3540497722>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_4280538425>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>::ReportUsage
@@ -10 +14,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>::ReportUsage
@@ -12 +15,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_StrideChecks>::ReportUsage
```

## `KERNEL32.DLL::InitializeCriticalSection`  (modified)

```diff
--- KERNEL32.DLL::InitializeCriticalSection calling
+++ KERNEL32.DLL::InitializeCriticalSection calling
@@ -5,0 +6,2 @@
+CProxyDataObject::CProxyDataObject
+CProxyDataObjectManager::CProxyDataObjectManager
@@ -6,0 +9,2 @@
+CProxyStream::CProxyStream
+CProxyStreamManager::CProxyStreamManager
```

## `KERNEL32.DLL::DeleteCriticalSection`  (modified)

```diff
--- KERNEL32.DLL::DeleteCriticalSection calling
+++ KERNEL32.DLL::DeleteCriticalSection calling
@@ -11,0 +12 @@
+CProxyDataObject::~CProxyDataObject
@@ -12,0 +14 @@
+CProxyStream::~CProxyStream
```

## `KERNEL32.DLL::CompareStringOrdinal`  (modified)

```diff
--- KERNEL32.DLL::CompareStringOrdinal calling
+++ KERNEL32.DLL::CompareStringOrdinal calling
@@ -2,0 +3 @@
+CRemoteDesktopClientSettings::IsThumbPrintInRegistry
```

## `KERNEL32.DLL::LeaveCriticalSection`  (modified)

```diff
--- KERNEL32.DLL::LeaveCriticalSection calling
+++ KERNEL32.DLL::LeaveCriticalSection calling
@@ -40,0 +41,2 @@
+CProxyDataObject::OnManagerTerminating
+CProxyDataObject::~CProxyDataObject
@@ -45,0 +48 @@
+CProxyDataObjectManager::RegisterDataObjectForTracking
@@ -47,0 +51,4 @@
+CProxyDataObjectManager::Terminate
+CProxyDataObjectManager::UnregisterAndCleanupDataObjectForTracking
+CProxyStream::OnManagerTerminating
+CProxyStream::~CProxyStream
@@ -49,0 +57 @@
+CProxyStreamManager::RegisterProxyStreamObjectForTracking
@@ -51,0 +60 @@
+CProxyStreamManager::UnregisterProxyStreamObjectForTracking
```

## `KERNEL32.DLL::GetTickCount`  (modified)

```diff
--- KERNEL32.DLL::GetTickCount calling
+++ KERNEL32.DLL::GetTickCount calling
@@ -13 +12,0 @@
-CRdpAudioController::OnWaveData
@@ -41,0 +41,58 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_1205842233>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_1252772153>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_143638841>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_1480569144>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_177773882>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_1892530489>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_1894756665>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_2141685050>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_2739128634>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_2884880696>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_296728890>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3343370555>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3446137144>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3540497722>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3621774648>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3624641849>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3638552890>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3719021881>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_4188256568>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_4198753594>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_4216055098>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_4280538425>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_450338104>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_64729402>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_735818040>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_843566394>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_937406778>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_AgentUserConsentExperience_Wave2>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_AuthenticationPackageUtilizationTelemetry>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_BugFixJsonHelperCannotBeUsedInMTA>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_BugFix_CameraActivationCountLeak>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_ClearCodecSubCodecBoundsCheck>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_DisableFeedbackHubTrace>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_DisconnectOnSmartCardAbsence>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_EnableInteractionModeRemoting>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_EnableMicrosoftEntraIdAuthEnforcement>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_EnablePTPRemoting>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixBug62354957>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_FixRailPresenterSetHWNDCrash>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_ID58336780>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_IncreaseUdpTransportTimerInterval2>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_IsoBrokerV3Apis>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_LocPerfVal>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_MSRC108255>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_RegressionFixesFollowingMSRC99855>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_Servicing_MSRC108321>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_Servicing_MstscaxTelemetry>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_Servicing_RDPRenderingDPI>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_Standalone_26_07_NonSec>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_Standalone_Future>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_TestLoc02>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_TestLoc03>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_TestUex12>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_UpdateWebAuthnPasskeysString>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_UxAccOptimization>::__private_IsEnabled
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_WindowInfoService>::__private_IsEnabled
```

## `KERNEL32.DLL::LocalFree`  (modified)

```diff
--- KERNEL32.DLL::LocalFree calling
+++ KERNEL32.DLL::LocalFree calling
@@ -170,0 +171,2 @@
+CRemoteDesktopClientSettings::IsThumbPrintInRegistryOld
+CRemoteDesktopClientSettings::LoadPublisherCategory
@@ -237,0 +240 @@
+CTsRdpCertSignature::GetCertificateThumbPrintByBCryptAlgorithm
@@ -336 +339 @@
-ThreadPool::`vector_deleting_destructor'
+ThreadPool::`scalar_deleting_destructor'
@@ -357 +360 @@
-W32ProcObj::`scalar_deleting_destructor'
+W32ProcObj::`vector_deleting_destructor'
```

## `KERNEL32.DLL::GetLastError`  (modified)

```diff
--- KERNEL32.DLL::GetLastError calling
+++ KERNEL32.DLL::GetLastError calling
@@ -381 +381,2 @@
-CTsRdpCertSignature::GetCertificateThumbPrint
+CTsRdpCertSignature::GetCertificateThumbPrintByPropId
+CTsRdpCertSignature::GetCertificateThumbPrintOld
@@ -797,0 +799 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_2141685050>::ReportUsage
@@ -798,0 +801 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>::ReportUsage
@@ -799,0 +803,3 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3540497722>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_4280538425>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>::ReportUsage
@@ -801 +806,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>::ReportUsage
@@ -803 +807,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_StrideChecks>::ReportUsage
```

## `KERNEL32.DLL::SetLastError`  (modified)

```diff
--- KERNEL32.DLL::SetLastError calling
+++ KERNEL32.DLL::SetLastError calling
@@ -61,0 +62 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_2141685050>::ReportUsage
@@ -62,0 +64 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3215164728>::ReportUsage
@@ -63,0 +66,3 @@
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_3540497722>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_4280538425>::ReportUsage
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_553358650>::ReportUsage
@@ -65 +69,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_FuzzedBoundaryChecks>::ReportUsage
@@ -67 +70,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_StrideChecks>::ReportUsage
```
