# CVE-2026-96086 — wlansvc.dll patch diff

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

## `RpcConnectWithInput`  (modified)

```diff
--- RpcConnectWithInput
+++ RpcConnectWithInput
@@ -1,105 +1,55 @@
 

-void RpcConnectWithInput(WlanRpcServerContext *param_1)

+ulong RpcConnectWithInput(undefined8 param_1,undefined8 param_2,undefined8 param_3,

+                         undefined8 param_4)

 

 {

-  bool bVar1;

-  ulong uVar2;

-  int iVar3;

-  int *in_RAX;

-  WlanRpcServerContext *this;

-  undefined8 uVar4;

-  ulong *unaff_RBP;

-  _GUID *unaff_RSI;

-  WlanRpcClientContext *unaff_RDI;

-  PRPC_ASYNC_STATE unaff_R12;

-  byte bVar5;

-  ulong unaff_R13D;

-  uchar **unaff_R14;

-  ulonglong unaff_R15;

-  int in_stack_00000030;

-  WlanRpcServerContext *in_stack_00000038;

-  ulong in_stack_00000070;

-  _DOT11_FTM_TARGET *in_stack_00000090;

+  ulong uVar1;

+  int iVar2;

+  undefined8 uVar3;

+  HANDLE hObject;

+  ulong local_28;

+  ulong local_24;

+  void *local_20;

   

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

-  *(char *)((longlong)in_RAX + -0x73) = *(char *)((longlong)in_RAX + -0x73) + (char)param_1;

-  uVar2 = IsCallerLocationSvc((int *)param_1);

-  bVar5 = (byte)unaff_R13D;

-  in_stack_00000070 = uVar2;

-  if (uVar2 != 0) {

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

-        (bVar5 <= (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & bVar5) != 0)) {

-      uVar4 = 0xea;

-      goto LAB_0;

-    }

-    goto LAB_1;

+  local_28 = 0;

+  local_20 = (HANDLE)0x0;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x79,

+            &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

   }

-  bVar1 = wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess

-                    (param_1,unaff_RDI);

-  if (bVar1) {

-    uVar2 = ValidatePrivileged();

-    if ((uVar2 != 0) && (in_stack_00000030 == 0)) {

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

-         ((2 < (byte)WPP_GLOBAL_Control[0x69] && ((WPP_GLOBAL_Control[0x6c] & bVar5) != 0)))) {

-        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xeb,

-                &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+  local_24 = LocalGetClientSessionId(&local_28);

+  uVar1 = local_24;

+  if (local_24 == 0) {

+    uVar1 = WimGetManuallyConnectablePortTypesBitMask(true);

+    uVar3 = param_2;

+    iVar2 = AcmIsAPIAllowed(param_2,0x40,uVar1,&local_24);

+    uVar1 = local_24;

+    if (iVar2 != 0) {

+      uVar1 = GetClientToken((int)uVar3,&local_20);

+      hObject = local_20;

+      if (uVar1 != 0) {

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

+            (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x7a,

+                   &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar1);

+        }

+        if (local_20 != (HANDLE)0x0) {

+          CloseHandle(local_20);

+        }

+        hObject = (HANDLE)0x0;

       }

-      goto LAB_2;

-    }

-    iVar3 = AcmIsAPIAllowed();

-    if (iVar3 == 0) {

-      uVar2 = in_stack_00000070;

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

-          (bVar5 <= (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & bVar5) != 0)) {

-        uVar4 = 0xec;

-LAB_0:

-        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar4,

-                 &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+      uVar1 = AcmConnectEx(2,param_2,0x25,param_3,local_28,param_4,hObject,0);

+      if (hObject != (HANDLE)0x0) {

+        CloseHandle(hObject);

       }

     }

-    else {

-      uVar2 = WimGetInterfaceContextHandle(unaff_RSI,unaff_R13D,(ulong *)0x0,&stack0x00000038);

-      if (uVar2 == 0) {

-        this = in_stack_00000038;

-        uVar2 = IntfRequestFtm(in_stack_00000038,unaff_R12,(ulong)(unaff_R15 / 0xc),

-                               in_stack_00000090,unaff_RBP,unaff_R14);

-        if (uVar2 == 0) {

-          wlansvc::rpc_server::details::WlanRpcServerContext::NotifyCamWiFiControlUsed

-                    (this,unaff_RDI);

-        }

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

-                 (bVar5 <= (byte)WPP_GLOBAL_Control[0x69])) &&

-                ((WPP_GLOBAL_Control[0x6c] & bVar5) != 0)) {

-          uVar4 = 0xee;

-          goto LAB_0;

-        }

-      }

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

-               (bVar5 <= (byte)WPP_GLOBAL_Control[0x69])) &&

-              ((WPP_GLOBAL_Control[0x6c] & bVar5) != 0)) {

-        uVar4 = 0xed;

-        goto LAB_0;

-      }

-    }

-LAB_1:

-    if (uVar2 == 0) goto LAB_3;

-  }

-  else {

-LAB_2:

-    uVar2 = 5;

   }

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

-      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & bVar5) != 0)) {

-    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xef,

-             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x7b,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar1);

   }

-  RpcAsyncAbortCall(unaff_R12,uVar2);

-LAB_3:

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

-      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & bVar5) != 0)) {

-    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xf0,

-             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

-  }

-  return;

+  return uVar1;

 }
```

## `RpcPrivateGetAvailableNetworkList`  (modified)

```diff
--- RpcPrivateGetAvailableNetworkList
+++ RpcPrivateGetAvailableNetworkList
@@ -1,10 +1,236 @@
 

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

-

-void RpcPrivateGetAvailableNetworkList(void)

+ulong RpcPrivateGetAvailableNetworkList

+                (undefined8 param_1,longlong *param_2,ulong param_3,

+                _WLAN_AVAILABLE_NETWORK_LIST_V3 **param_4)

 

 {

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

-  halt_baddata();

+  longlong lVar1;

+  bool bVar2;

+  int *piVar3;

+  uint uVar4;

+  WiFiControlAccessResult WVar5;

+  ulong uVar6;

+  int iVar7;

+  HANDLE pvVar8;

+  longlong lVar9;

+  WlanRpcServerContext *this;

+  undefined8 uVar10;

+  void *pvVar11;

+  undefined8 *puVar12;

+  undefined8 *puVar13;

+  ulong local_68;

+  int local_64 [3];

+  int *local_58;

+  int *local_50;

+  longlong local_48 [2];

+  

+  local_68 = RtlGetActiveConsoleId();

+  this = (WlanRpcServerContext *)WPP_GLOBAL_Control;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    this = *(WlanRpcServerContext **)(WPP_GLOBAL_Control + 0x60);

+    WPP_SF_(this,0x6f,&WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+  }

+  *param_4 = (_WLAN_AVAILABLE_NETWORK_LIST_V3 *)0x0;

+  uVar4 = wlansvc::rpc_server::details::WlanRpcServerContext::GetClientProcessID();

+  local_64[2] = uVar4;

+  WVar5 = wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess

+                    (this,uVar4);

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_dD(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x70,

+              &WPP_791618f6e4f933247a011d60507f9013_Traceguids,WVar5,uVar4);

+  }

+  if (WVar5 == 0) {

+    uVar6 = 5;

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

+      return 5;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+      return 5;

+    }

+    if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+      return 5;

+    }

+    uVar10 = 0x71;

+    goto LAB_0;

+  }

+  AcmGetInteractiveSession(&local_68);

+  local_50 = (int *)0x0;

+  local_64[0] = 0;

+  uVar4 = 0x21;

+  uVar10 = 0x21;

+  if (((byte)DAT_1 & 3) != 3) {

+    uVar10 = 1;

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),10,

+            &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

+  }

+  uVar6 = AcmQueryInterface(param_2,uVar10,1,local_64,&local_50,0);

+  piVar3 = local_50;

+  bVar2 = false;

+  if (uVar6 == 0) {

+    if ((local_64[0] == 4) && (*local_50 != 0)) {

+      bVar2 = true;

+    }

+    else {

+      uVar6 = 0x32;

+      bVar2 = false;

+    }

+  }

+  if ((local_50 != (int *)0x0) && (pvVar8 = GetProcessHeap(), pvVar8 != (HANDLE)0x0)) {

+    HeapFree(pvVar8,0,piVar3);

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb,

+             &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

+  }

+  if (!bVar2) {

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

+      return uVar6;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+      return uVar6;

+    }

+    if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+      return uVar6;

+    }

+    uVar10 = 0x72;

+    goto LAB_0;

+  }

+  if (((byte)DAT_1 & 3) != 3) {

+    uVar4 = 1;

+  }

+  pvVar11 = (void *)0x0;

+  local_58 = (int *)0x0;

+  local_64[1] = 0;

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

+    if ((3 < (byte)WPP_GLOBAL_Control[0x69]) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x49,

+              &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

+    }

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb0,

+              &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+    }

+  }

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

+    uVar6 = 0x57;

+LAB_2:

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb2,

+               &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+    }

+  }

+  else {

+    EnterCriticalSection((LPCRITICAL_SECTION)&DAT_3);

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x67,

+              &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+    }

+    for (puVar12 = DAT_4; puVar13 = (undefined8 *)0x0,

+        (undefined8 **)puVar12 != &DAT_4; puVar12 = (undefined8 *)*puVar12) {

+      lVar1 = puVar12[3];

+      local_48[0] = 0;

+      if (lVar1 == 0) {

+        MicrosoftTelemetryAssertTriggeredNoArgs();

+      }

+      bVar2 = true;

+      iVar7 = HtReferenceHandleWithTag(g_hHandleTable,lVar1,0,0,1,local_48);

+      if (iVar7 == 0) {

+        lVar9 = *param_2 - *(longlong *)(local_48[0] + 8);

+        if (lVar9 == 0) {

+          lVar9 = param_2[1] - *(longlong *)(local_48[0] + 0x10);

+        }

+        if ((lVar9 != 0) || ((*(uint *)(local_48[0] + 0x18) & uVar4) == 0)) {

+          bVar2 = false;

+        }

+        HtDereferenceHandleWithTag(g_hHandleTable,lVar1);

+        puVar13 = puVar12;

+        if (bVar2) break;

+      }

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

+               (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x65);

+      }

+    }

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x6a,

+               &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+    }

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

+      pvVar11 = (void *)0x0;

+    }

+    else {

+      pvVar11 = (void *)puVar13[3];

+    }

+    uVar6 = ~-(uint)(puVar13 != (undefined8 *)0x0) & 0x490;

+    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_3);

+    if (puVar13 != (undefined8 *)0x0) goto LAB_2;

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

+      if ((1 < (byte)WPP_GLOBAL_Control[0x69]) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF__guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb1,

+                      &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+      }

+      goto LAB_2;

+    }

+  }

+  if (uVar6 == 0) {

+    uVar6 = WimQueryAutoConfigParameter

+                      (1,(ulong *)(local_64 + 1),(uchar **)&local_58,(_WLAN_OPCODE_VALUE_TYPE *)0x0)

+    ;

+    if ((uVar6 == 0) && (local_58 != (int *)0x0)) {

+      uVar6 = IntfGetAvailableNetworkList(pvVar11,local_68,param_3,*local_58,1,3,param_4);

+      piVar3 = local_58;

+      pvVar8 = GetProcessHeap();

+      if (pvVar8 != (HANDLE)0x0) {

+        HeapFree(pvVar8,0,piVar3);

+      }

+    }

+    else {

+      uVar6 = IntfGetAvailableNetworkList(pvVar11,local_68,param_3,0,1,3,param_4);

+    }

+LAB_5:

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x4b,

+               &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids,uVar6);

+    }

+  }

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

+    if ((WPP_GLOBAL_Control[0x69] != '\0') && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x4a,

+               &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids,uVar6);

+    }

+    goto LAB_5;

+  }

+  if (uVar6 == 0) {

+    if (WVar5 != 2) {

+      wlansvc::rpc_server::details::WlanRpcServerContext::NotifyCamWiFiControlUsed

+                ((WlanRpcServerContext *)WPP_GLOBAL_Control,local_64[2]);

+    }

+    return 0;

+  }

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

+    return uVar6;

+  }

+  if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+    return uVar6;

+  }

+  if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+    return uVar6;

+  }

+  uVar10 = 0x73;

+LAB_0:

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

+           &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar6);

+  return uVar6;

 }
```

## `WDiagConnectCompletion`  (modified)

```diff
--- WDiagConnectCompletion
+++ WDiagConnectCompletion
@@ -1,41 +1,524 @@
 

+/* WARNING: Function: __chkstk replaced with injection: alloca_probe */

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

+/* unsigned long __cdecl WDiagConnectCompletion(struct _WD_INTERFACE_CONTEXT * __ptr64,void *

+   __ptr64,struct DOT11_SSID_LIST * __ptr64,struct _PM_PROFILE * __ptr64,enum _WLAN_CONNECTION_MODE

+   * __ptr64,enum PasspointFlag,unsigned long,unsigned long,unsigned long,int,int,unsigned

+   __int64,bool) */

 

 ulong __cdecl

 WDiagConnectCompletion

           (_WD_INTERFACE_CONTEXT *param_1,void *param_2,DOT11_SSID_LIST *param_3,

           _PM_PROFILE *param_4,_WLAN_CONNECTION_MODE *param_5,PasspointFlag param_6,ulong param_7,

           ulong param_8,ulong param_9,int param_10,int param_11,__uint64 param_12,bool param_13)

 

 {

-  uint uVar1;

-  ulonglong in_RAX;

-  longlong lVar2;

-  ulong unaff_EBX;

-  uint *unaff_RSI;

-  uint unaff_EDI;

+  short sVar1;

+  short sVar2;

   uint uVar3;

-  void *unaff_R14;

+  undefined4 uVar4;

+  undefined4 uVar5;

+  undefined4 uVar6;

+  undefined8 uVar7;

+  _WLAN_CONNECTION_ATTRIBUTES *p_Var8;

+  _WD_INTERFACE_CONTEXT *p_Var9;

+  ulong uVar10;

+  ULONGLONG UVar11;

+  undefined8 *puVar12;

+  unique_ptr<struct__WLAN_CONNECTION_ATTRIBUTES,struct_wil::function_deleter<void_(__cdecl*)(void*___ptr64),&void___cdecl_WlanFreeMemory(void*___ptr64)>_>

+  *puVar13;

+  _WD_CONNECTION_CONTEXT *p_Var14;

+  _WD_CONNECTION_CONTEXT *p_Var15;

+  _WD_CONNECTION_CONTEXT *p_Var16;

+  _WLAN_CONNECTION_MODE _Var17;

+  longlong lVar18;

+  longlong lVar19;

+  WDIAG_STATISTICS_QUERY_REASON WVar20;

+  _DiagnosticStatsDifferenceTrigger _Var21;

+  _WD_INTERFACE_CONTEXT *p_Var22;

+  DOT11_CONNECTION_INFO *pDVar23;

+  int iVar24;

+  WDIAG_ENUM_COMPONENT_ID WVar25;

+  _PM_PROFILE *p_Var26;

+  char *pcVar27;

+  _DOT11_SSID *p_Var28;

+  WDIAG_PACKET_STATISTICS *pWVar29;

+  undefined **ppuVar30;

+  ulonglong uVar31;

+  undefined1 auStackY_1108 [32];

+  _DOT11_BSS_TYPE in_stack_ffffffffffffef18;

+  uint *puVar32;

+  WDIAG_ENUM_COMPONENT_ID local_10b4;

+  int local_10b0;

+  int local_10ac;

+  ulonglong local_10a8;

+  ulong local_10a0;

+  ulong local_109c;

+  ulong local_1098;

+  ulong local_1094;

+  ULONGLONG local_1090;

+  _WLAN_CONNECTION_ATTRIBUTES *local_1088 [2];

+  _PM_PROFILE *local_1078;

+  undefined4 uStack_1070;

+  undefined4 uStack_106c;

+  DOT11_CONNECTION_INFO *local_1068;

+  undefined4 local_1058;

+  undefined1 local_1054 [156];

+  undefined4 local_fb8 [976];

+  undefined4 local_78;

+  int local_6c;

+  uint local_48;

+  short local_44;

+  ulonglong local_40;

   

-  do {

-    lVar2 = *(longlong *)((longlong)&param_9 + (longlong)param_2);

+  local_40 = __security_cookie ^ (ulonglong)auStackY_1108;

+  pDVar23 = (DOT11_CONNECTION_INFO *)0x0;

+  local_1098 = 0;

+  local_10a0 = 0;

+  local_1094 = 0;

+  local_109c = 0;

+  iVar24 = 0;

+  local_10a8 = 0;

+  local_48 = 0;

+  local_44 = 0;

+  local_1058 = 0;

+  local_1078 = param_4;

+  memset(local_1054,0,0x9c);

+  WVar20 = 0;

+  memset(local_fb8,0,0xf68);

+  local_10ac = 0;

+  local_10b4 = 0;

+  local_10b0 = 0;

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

+     ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0)) {

+    WVar20 = 0x79;

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x79,

+            &WPP_447f12960bb3313100e324df840110ec_Traceguids);

+  }

+  StopWlanDbgTracing(param_9);

+  UVar11 = GetTickCount64();

+  local_1068 = (DOT11_CONNECTION_INFO *)0x0;

+  local_1088[0] = (_WLAN_CONNECTION_ATTRIBUTES *)0x0;

+  local_1090 = UVar11;

+  if (param_11 == 0) {

+    puVar32 = &local_48;

+    WDiagQueryDot11DataEx

+              (param_1,WVar20,(WDIAG_PACKET_STATISTICS *)&local_1058,(_DOT11_SSID *)0x0,

+               (uchar *)puVar32,(WDIAG_SIGNAL_QUALITY *)0x0,&local_10a0,&local_109c,(ulong *)0x0,

+               (ulong *)0x0);

+    in_stack_ffffffffffffef18 = (_DOT11_BSS_TYPE)puVar32;

+    puVar12 = (undefined8 *)WDiagGetConnectionInfo((_WD_INTERFACE_CONTEXT *)&local_10a8);

+    uVar31 = local_10a8;

+    pDVar23 = (DOT11_CONNECTION_INFO *)*puVar12;

+    *puVar12 = 0;

+    local_10a8 = 0;

+    local_1068 = pDVar23;

+    if (uVar31 != 0) {

+      FreeWLMem();

+    }

+    puVar13 = (unique_ptr<struct__WLAN_CONNECTION_ATTRIBUTES,struct_wil::function_deleter<void_(__cdecl*)(void*___ptr64),&void___cdecl_WlanFreeMemory(void*___ptr64)>_>

+               *)WDiagGetConnectionAttributes((_WD_INTERFACE_CONTEXT *)&local_10a8);

+    wistd::

+    unique_ptr<_WLAN_CONNECTION_ATTRIBUTES,wil::function_deleter<void_(__cdecl*)(void*___ptr64),&void___cdecl_WlanFreeMemory(void*___ptr64)>_>

+    ::operator=((unique_ptr<_WLAN_CONNECTION_ATTRIBUTES,wil::function_deleter<void_(__cdecl*)(void*___ptr64),&void___cdecl_WlanFreeMemory(void*___ptr64)>_>

+                 *)local_1088,puVar13);

+    uVar31 = local_10a8;

+    local_10a8 = 0;

+    if (uVar31 != 0) {

+      FreeWLMem();

+      UVar11 = local_1090;

+      iVar24 = local_10b0;

+    }

+    local_10a8 = (ulonglong)local_48;

+    local_1098 = local_10a0;

+    local_1094 = local_109c;

+  }

+  p_Var8 = local_1088[0];

+  uVar10 = WDiagQueryIntfOpmode(param_1,&local_10b4);

+  if ((uVar10 == 0) && (local_10b0 = iVar24, local_10b4 == 4)) {

+    local_10b0 = 1;

+  }

+  p_Var28 = (_DOT11_SSID *)0xaf1;

+  pcVar27 = "WDiagConnectCompletion";

+  WDiagAcquireExLock(param_1,(_WDIAG_RW_LOCK *)(param_1 + 0xd18),"WDiagConnectCompletion",0xaf1);

+  p_Var14 = FindMatchingConnection

+                      (param_1,param_2,(_PM_PROFILE *)pcVar27,p_Var28,in_stack_ffffffffffffef18,1,1)

+  ;

+  if (p_Var14 == (_WD_CONNECTION_CONTEXT *)0x0) {

+    WDiagReleaseExLock(param_1,(_WDIAG_RW_LOCK *)(param_1 + 0xd18),"WDiagConnectCompletion",0xafb);

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

+        (WPP_GLOBAL_Control[0xe1] != '\0')) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x7a,

+              &WPP_447f12960bb3313100e324df840110ec_Traceguids);

+    }

+    if (p_Var8 != (_WLAN_CONNECTION_ATTRIBUTES *)0x0) {

+      FreeWLMem(p_Var8);

+    }

+    WVar25 = 0x490;

+    if (pDVar23 != (DOT11_CONNECTION_INFO *)0x0) {

+      FreeWLMem(pDVar23);

+    }

+    goto LAB_0;

+  }

+  WdiagInitSqmRecord((WDIAG_SQM_RECORD *)local_fb8);

+  WDiagAcquireExLock(p_Var14,(_WDIAG_RW_LOCK *)(p_Var14 + 0xf50),"WDiagConnectCompletion",0xb05);

+  *(undefined4 *)(p_Var14 + 0x4b4) = 1;

+  *(ULONGLONG *)(p_Var14 + 0x4b8) = UVar11;

+  *(undefined4 *)(p_Var14 + 0xfe8) = (undefined4)param_12;

+  *(undefined4 *)(p_Var14 + 0xfe4) = param_12._4_4_;

+  p_Var14[0xfec] = (_WD_CONNECTION_CONTEXT)param_13;

+  if (local_1078 == (_PM_PROFILE *)0x0) {

+LAB_1:

+    *(undefined4 *)(p_Var14 + 0xd18) = 0;

+    if ((param_6 & 1) == 0) {

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

+        *(undefined4 *)(p_Var14 + 0xd18) = 2;

+      }

+    }

+    else {

+      *(undefined4 *)(p_Var14 + 0xd18) = 1;

+    }

+    *(PasspointFlag *)(p_Var14 + 0xd1c) = param_6 >> 2 & 1;

+    *(PasspointFlag *)(p_Var14 + 0xd20) = param_6 >> 3 & 1;

+    *(ulong *)(p_Var14 + 0x6c0) = local_1098;

+    *(ulong *)(p_Var14 + 0x6c4) = local_1094;

+    if (((int)local_10a8 != 0) || (local_44 != 0)) {

+      *(int *)(p_Var14 + 0x5c6) = (int)local_10a8;

+      *(short *)(p_Var14 + 0x5ca) = local_44;

+    }

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

+      _Var17 = 5;

+    }

+    else {

+      _Var17 = *param_5;

+    }

+    *(_WLAN_CONNECTION_MODE *)(p_Var14 + 0x4c0) = _Var17;

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

+        (2 < (byte)WPP_GLOBAL_Control[0xe1])) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+      WPP_SF_DDDdd(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8));

+    }

+    uVar31 = (ulonglong)param_9;

+    if (param_9 == 0) {

+      WDiagGetTime((_FILETIME *)(p_Var14 + 0x7e0));

+      lVar19 = (ulonglong)((*(int *)(p_Var14 + 0x498) - 1U) % 5) * 0x270;

+      *(undefined4 *)(param_1 + lVar19 + 0x304) = 1;

+      lVar18 = 4;

+      p_Var16 = p_Var14 + 0x270;

+      p_Var9 = param_1 + lVar19 + 200;

+      do {

+        p_Var22 = p_Var9;

+        p_Var15 = p_Var16;

+        uVar7 = *(undefined8 *)(p_Var15 + 8);

+        *(undefined8 *)p_Var22 = *(undefined8 *)p_Var15;

+        *(undefined8 *)(p_Var22 + 8) = uVar7;

+        uVar7 = *(undefined8 *)(p_Var15 + 0x18);

+        *(undefined8 *)(p_Var22 + 0x10) = *(undefined8 *)(p_Var15 + 0x10);

+        *(undefined8 *)(p_Var22 + 0x18) = uVar7;

+        uVar7 = *(undefined8 *)(p_Var15 + 0x28);

+        *(undefined8 *)(p_Var22 + 0x20) = *(undefined8 *)(p_Var15 + 0x20);

+        *(undefined8 *)(p_Var22 + 0x28) = uVar7;

+        uVar7 = *(undefined8 *)(p_Var15 + 0x38);

+        *(undefined8 *)(p_Var22 + 0x30) = *(undefined8 *)(p_Var15 + 0x30);

+        *(undefined8 *)(p_Var22 + 0x38) = uVar7;

+        uVar7 = *(undefined8 *)(p_Var15 + 0x48);

+        *(undefined8 *)(p_Var22 + 0x40) = *(undefined8 *)(p_Var15 + 0x40);

+        *(undefined8 *)(p_Var22 + 0x48) = uVar7;

+        uVar7 = *(undefined8 *)(p_Var15 + 0x58);

+        *(undefined8 *)(p_Var22 + 0x50) = *(undefined8 *)(p_Var15 + 0x50);

+        *(undefined8 *)(p_Var22 + 0x58) = uVar7;

+        uVar7 = *(undefined8 *)(p_Var15 + 0x68);

+        *(undefined8 *)(p_Var22 + 0x60) = *(undefined8 *)(p_Var15 + 0x60);

+        *(undefined8 *)(p_Var22 + 0x68) = uVar7;

+        uVar7 = *(undefined8 *)(p_Var15 + 0x78);

+        *(undefined8 *)(p_Var22 + 0x70) = *(undefined8 *)(p_Var15 + 0x70);

+        *(undefined8 *)(p_Var22 + 0x78) = uVar7;

+        lVar18 = lVar18 + -1;

+        p_Var16 = p_Var15 + 0x80;

+        p_Var9 = p_Var22 + 0x80;

+      } while (lVar18 != 0);

+      uVar7 = *(undefined8 *)(p_Var15 + 0x88);

+      *(undefined8 *)(p_Var22 + 0x80) = *(undefined8 *)(p_Var15 + 0x80);

+      *(undefined8 *)(p_Var22 + 0x88) = uVar7;

+      uVar7 = *(undefined8 *)(p_Var15 + 0x98);

+      *(undefined8 *)(p_Var22 + 0x90) = *(undefined8 *)(p_Var15 + 0x90);

+      *(undefined8 *)(p_Var22 + 0x98) = uVar7;

+      uVar7 = *(undefined8 *)(p_Var15 + 0xa8);

+      *(undefined8 *)(p_Var22 + 0xa0) = *(undefined8 *)(p_Var15 + 0xa0);

+      *(undefined8 *)(p_Var22 + 0xa8) = uVar7;

+      *(undefined8 *)(p_Var22 + 0xb0) = *(undefined8 *)(p_Var15 + 0xb0);

+      *(undefined4 *)(p_Var22 + 0xb8) = *(undefined4 *)(p_Var15 + 0xb8);

+      if (((byte)*(undefined4 *)(p_Var14 + 0x4ac) & 0x18) == 8) {

+        WDiagGetTime((_FILETIME *)(p_Var14 + 0x698));

+        *(ULONGLONG *)(p_Var14 + 0x6a8) = local_1090;

+        *(uint *)(p_Var14 + 0x4ac) = *(uint *)(p_Var14 + 0x4ac) | 0x10;

+        WDiagGetTime((_FILETIME *)(p_Var14 + 0x698));

+      }

+      *(uint *)(p_Var14 + 0x4ac) = *(uint *)(p_Var14 + 0x4ac) | 0x60;

+      uVar10 = UpdateConnectivityStatistics(p_Var14,(WDIAG_PACKET_STATISTICS *)&local_1058);

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

+         ((WPP_GLOBAL_Control[0xe1] != '\0' && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)))) {

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x89,

+                 &WPP_447f12960bb3313100e324df840110ec_Traceguids);

+      }

+      *(uint *)(param_1 + 0x18) = *(uint *)(param_1 + 0x18) | 2;

+      local_10b4 = 0;

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

+          (2 < (byte)WPP_GLOBAL_Control[0xe1])) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+        WPP_SF_dD(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x8a,

+                  &WPP_447f12960bb3313100e324df840110ec_Traceguids);

+      }

+      if (((*(int *)(p_Var14 + 0xfdc) == 0) && (param_10 == 0)) && (local_10b0 != 0)) {

+        WdiagPopulateSqmRecord

+                  (p_Var14,pDVar23,p_Var8,(WDIAG_BSSID_ROAM_INFO *)0x0,param_8,

+                   (WDIAG_SQM_RECORD *)local_fb8);

+        local_10ac = 1;

+        *(undefined4 *)(p_Var14 + 0xfdc) = 1;

+        if (local_6c != 0x38001) {

+          WDiagLogConnectDiagnosticEvent(param_1,p_Var14,(WDIAG_SQM_RECORD *)local_fb8);

+          local_1078 = *(_PM_PROFILE **)(param_1 + 0xda0);

+          uStack_1070 = *(undefined4 *)(param_1 + 0xda8);

+          uStack_106c = *(undefined4 *)(param_1 + 0xdac);

+          NlmDiagSendWlanConnectionAttemptDiagnostics(&local_1078,local_fb8[0],local_6c,local_78);

+        }

+      }

+      WDiagReleaseExLock(p_Var14,(_WDIAG_RW_LOCK *)(p_Var14 + 0xf50),"WDiagConnectCompletion",0xc47)

+      ;

+      WDiagReleaseExLock(param_1,(_WDIAG_RW_LOCK *)(param_1 + 0xd18),"WDiagConnectCompletion",0xc48)

+      ;

+      if ((local_10ac != 0) && (local_6c != 0x38001)) {

+        WdiagAddSqmRecord((WDIAG_SQM_RECORD *)local_fb8);

+      }

+      if (p_Var8 != (_WLAN_CONNECTION_ATTRIBUTES *)0x0) {

+        FreeWLMem(p_Var8);

+      }

+      WVar25 = local_10b4;

+      if (pDVar23 != (DOT11_CONNECTION_INFO *)0x0) {

+        FreeWLMem(pDVar23);

+        WVar25 = local_10b4;

+      }

+      goto LAB_0;

+    }

+    ppuVar30 = (undefined **)WPP_GLOBAL_Control;

+    local_10b4 = WDiagComponentFromReasonCode(param_8,*(_WLAN_INTERFACE_TYPE *)(param_1 + 0xfc4));

+    if (((ppuVar30 != &WPP_GLOBAL_Control) && (2 < *(byte *)((longlong)ppuVar30 + 0xe1))) &&

+       ((*(byte *)((longlong)ppuVar30 + 0xe4) & 0x10) != 0)) {

+      WPP_SF_LLLd(ppuVar30[0x1b]);

+      uVar31 = (ulonglong)param_9;

+      ppuVar30 = (undefined **)WPP_GLOBAL_Control;

+    }

+    uVar3 = *(uint *)(p_Var14 + 0x4ac);

+    if ((uVar3 & 2) == 0) {

+      if (((ppuVar30 != &WPP_GLOBAL_Control) && (*(char *)((longlong)ppuVar30 + 0xe1) != '\0')) &&

+         ((*(byte *)((longlong)ppuVar30 + 0xe4) & 0x10) != 0)) {

+        WPP_SF_ddd(ppuVar30[0x1b],0x7f,&WPP_447f12960bb3313100e324df840110ec_Traceguids);

+      }

+      if (param_7 != 0) {

+        *(ulong *)(p_Var14 + 0x5d0) = param_7;

+      }

+      if (*(int *)(p_Var14 + 0x4e0) == 0) {

+        *(ulong *)(p_Var14 + 0x4e0) = param_8;

+      }

+      if (param_8 != 0) {

+        *(WDIAG_ENUM_COMPONENT_ID *)(p_Var14 + 0x4dc) = local_10b4;

+        if ((local_10b4 == 4) && (*(int *)(p_Var14 + 0x6c8) == 0)) {

+          *(ulong *)(p_Var14 + 0x6c8) = param_8;

+        }

+        goto LAB_2;

+      }

+LAB_3:

+      if (param_8 == 0x38011) {

+        *(uint *)(p_Var14 + 0x4ac) = *(uint *)(p_Var14 + 0x4ac) | 0x40000000;

+      }

+    }

+    else {

+      if ((uVar3 & 4) == 0) {

+        if (((ppuVar30 != &WPP_GLOBAL_Control) && (*(char *)((longlong)ppuVar30 + 0xe1) != '\0')) &&

+           ((*(byte *)((longlong)ppuVar30 + 0xe4) & 0x10) != 0)) {

+          WPP_SF_dD(ppuVar30[0x1b],0x80,&WPP_447f12960bb3313100e324df840110ec_Traceguids,

+                    uVar31 & 0xffffffff);

+        }

+        if (param_7 != 0) {

+          *(ulong *)(p_Var14 + 0x5d0) = param_7;

+        }

+        uVar10 = param_8;

+        if (param_8 == 0) {

+          uVar10 = param_9;

+        }

+        *(ulong *)(p_Var14 + 0x5d8) = uVar10;

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

+            (2 < (byte)WPP_GLOBAL_Control[0xe1])) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+          WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x81,

+                  &WPP_447f12960bb3313100e324df840110ec_Traceguids);

+        }

+        p_Var16 = p_Var14 + 0x500;

+        pWVar29 = (WDIAG_PACKET_STATISTICS *)&local_1058;

+        _Var21 = 2;

+      }

+      else {

+        if (((byte)uVar3 & 0x18) != 8) {

+          if (local_10b4 == 5) {

+            if (((ppuVar30 != &WPP_GLOBAL_Control) && (*(char *)((longlong)ppuVar30 + 0xe1) != '\0')

+                ) && ((*(byte *)((longlong)ppuVar30 + 0xe4) & 0x10) != 0)) {

+              WPP_SF_dD(ppuVar30[0x1b],0x86,&WPP_447f12960bb3313100e324df840110ec_Traceguids);

+            }

+            *(uint *)(p_Var14 + 0x4ac) = *(uint *)(p_Var14 + 0x4ac) | 8;

+            *(uint *)(p_Var14 + 0x6b8) = *(uint *)(p_Var14 + 0x6b8) | 0x2000;

+            if (*(int *)(p_Var14 + 0x6d4) == 0) {

+              *(ulong *)(p_Var14 + 0x6d4) = param_8;

+            }

+            if (*(int *)(p_Var14 + 0x6cc) == 0) {

+              *(ulong *)(p_Var14 + 0x6cc) = param_8;

+            }

+            WDiagGetTime((_FILETIME *)(p_Var14 + 0x698));

+            *(ULONGLONG *)(p_Var14 + 0x6a8) = local_1090;

+          }

+          else if (((ppuVar30 != &WPP_GLOBAL_Control) &&

+                   (*(char *)((longlong)ppuVar30 + 0xe1) != '\0')) &&

+                  ((*(byte *)((longlong)ppuVar30 + 0xe4) & 0x10) != 0)) {

+            WPP_SF_dD(ppuVar30[0x1b],0x87,&WPP_447f12960bb3313100e324df840110ec_Traceguids);

+          }

+          goto LAB_2;

+        }

+        if (((ppuVar30 != &WPP_GLOBAL_Control) && (*(char *)((longlong)ppuVar30 + 0xe1) != '\0')) &&

+           ((*(byte *)((longlong)ppuVar30 + 0xe4) & 0x10) != 0)) {

+          WPP_SF_dD(ppuVar30[0x1b],0x82,&WPP_447f12960bb3313100e324df840110ec_Traceguids,

+                    uVar31 & 0xffffffff);

+        }

+        *(uint *)(p_Var14 + 0x6b8) = *(uint *)(p_Var14 + 0x6b8) | 0x2000;

+        if (*(int *)(p_Var14 + 0x6d4) == 0) {

+          uVar10 = param_8;

+          if (param_8 == 0) {

+            uVar10 = param_9;

+          }

+          *(ulong *)(p_Var14 + 0x6d4) = uVar10;

+        }

+        if (*(int *)(p_Var14 + 0x6cc) == 0) {

+          uVar10 = param_8;

+          if (param_8 == 0) {

+            uVar10 = param_9;

+          }

+          *(ulong *)(p_Var14 + 0x6cc) = uVar10;

+        }

+        WDiagGetTime((_FILETIME *)(p_Var14 + 0x698));

+        *(ULONGLONG *)(p_Var14 + 0x6a8) = local_1090;

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

+            (2 < (byte)WPP_GLOBAL_Control[0xe1])) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+          WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x83,

+                  &WPP_447f12960bb3313100e324df840110ec_Traceguids);

+        }

+        pWVar29 = (WDIAG_PACKET_STATISTICS *)(p_Var14 + 0x730);

+        p_Var16 = p_Var14 + 0x5f0;

+        _Var21 = 3;

+      }

+      WDiagLogStatisticsDifference(param_1,_Var21,(WDIAG_PACKET_STATISTICS *)p_Var16,pWVar29);

+LAB_2:

+      if (param_8 != 0x38001) goto LAB_3;

+      if (*(int *)(p_Var14 + 0x6bc) == 0) {

+        *(uint *)(p_Var14 + 0x4ac) = *(uint *)(p_Var14 + 0x4ac) | 0x80000000;

+      }

+    }

+    *(uint *)(p_Var14 + 0x4ac) = *(uint *)(p_Var14 + 0x4ac) | 0x80;

+    *(uint *)(param_1 + 0x18) = *(uint *)(param_1 + 0x18) & 0xfffffffd;

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

+        (2 < (byte)WPP_GLOBAL_Control[0xe1])) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+      WPP_SF_dD(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x88,

+                &WPP_447f12960bb3313100e324df840110ec_Traceguids);

+    }

+    if (((*(int *)(p_Var14 + 0xfdc) == 0) && (param_10 == 0)) && (local_10b0 != 0)) {

+      WdiagPopulateSqmRecord

+                (p_Var14,pDVar23,p_Var8,(WDIAG_BSSID_ROAM_INFO *)0x0,param_8,

+                 (WDIAG_SQM_RECORD *)local_fb8);

+      *(undefined4 *)(p_Var14 + 0xfdc) = 1;

+      local_10ac = 1;

+      if (local_6c != 0x38001) {

+        WDiagLogConnectDiagnosticEvent(param_1,p_Var14,(WDIAG_SQM_RECORD *)local_fb8);

+        local_1078 = *(_PM_PROFILE **)(param_1 + 0xda0);

+        uStack_1070 = *(undefined4 *)(param_1 + 0xda8);

+        uStack_106c = *(undefined4 *)(param_1 + 0xdac);

+        NlmDiagSendWlanConnectionAttemptDiagnostics(&local_1078,local_fb8[0],local_6c,local_78);

+      }

+    }

+    WDiagReleaseExLock(p_Var14,(_WDIAG_RW_LOCK *)(p_Var14 + 0xf50),"WDiagConnectCompletion",0xc05);

+    WDiagReleaseExLock(param_1,(_WDIAG_RW_LOCK *)(param_1 + 0xd18),"WDiagConnectCompletion",0xc06);

+    if ((local_10ac != 0) && (local_6c != 0x38001)) {

+      WdiagAddSqmRecord((WDIAG_SQM_RECORD *)local_fb8);

+    }

+  }

+  else {

+    p_Var26 = local_1078 + 0x18;

+    p_Var16 = p_Var14 + 0x58;

+    p_Var15 = p_Var16;

     do {

-      uVar3 = (uint)in_RAX;

-      if ((lVar2 == 0) ||

-         (uVar1 = uVar3 + 1, in_RAX = (ulonglong)uVar1, uVar3 = unaff_EDI, unaff_EDI <= uVar1)) {

-        if (*unaff_RSI < uVar3) {

-          *unaff_RSI = uVar3;

-          unaff_EBX = 0x8007007a;

-        }

-        else {

-          memcpy(unaff_R14,&param_8,(ulonglong)uVar3 << 5);

-          *unaff_RSI = uVar3;

-        }

-        return unaff_EBX;

-      }

-      param_2 = (void *)(in_RAX * 0x20);

-      lVar2 = *(longlong *)(&param_8 + in_RAX * 8);

-    } while (lVar2 != 0);

-  } while( true );

+      sVar1 = *(short *)p_Var15;

+      sVar2 = *(short *)(p_Var15 + ((longlong)p_Var26 - (longlong)p_Var16));

+      if (sVar1 != sVar2) break;

+      p_Var15 = p_Var15 + 2;

+    } while (sVar2 != 0);

+    if (sVar1 == sVar2) goto LAB_1;

+    if (*(short *)p_Var16 == 0) {

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

+          (2 < (byte)WPP_GLOBAL_Control[0xe1])) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+        WPP_SF_SS(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x7c,

+                  &WPP_447f12960bb3313100e324df840110ec_Traceguids);

+      }

+      lVar18 = 4;

+      p_Var16 = p_Var14 + 0xd4c;

+      do {

+        uVar7 = *(undefined8 *)(p_Var26 + 8);

+        *(undefined8 *)p_Var16 = *(undefined8 *)p_Var26;

+        *(undefined8 *)(p_Var16 + 8) = uVar7;

+        uVar7 = *(undefined8 *)(p_Var26 + 0x18);

+        *(undefined8 *)(p_Var16 + 0x10) = *(undefined8 *)(p_Var26 + 0x10);

+        *(undefined8 *)(p_Var16 + 0x18) = uVar7;

+        uVar7 = *(undefined8 *)(p_Var26 + 0x28);

+        *(undefined8 *)(p_Var16 + 0x20) = *(undefined8 *)(p_Var26 + 0x20);

+        *(undefined8 *)(p_Var16 + 0x28) = uVar7;

+        uVar7 = *(undefined8 *)(p_Var26 + 0x38);

+        *(undefined8 *)(p_Var16 + 0x30) = *(undefined8 *)(p_Var26 + 0x30);

+        *(undefined8 *)(p_Var16 + 0x38) = uVar7;

+        uVar7 = *(undefined8 *)(p_Var26 + 0x48);

+        *(undefined8 *)(p_Var16 + 0x40) = *(undefined8 *)(p_Var26 + 0x40);

+        *(undefined8 *)(p_Var16 + 0x48) = uVar7;

+        uVar7 = *(undefined8 *)(p_Var26 + 0x58);

+        *(undefined8 *)(p_Var16 + 0x50) = *(undefined8 *)(p_Var26 + 0x50);

+        *(undefined8 *)(p_Var16 + 0x58) = uVar7;

+        uVar4 = *(undefined4 *)(p_Var26 + 100);

+        uVar5 = *(undefined4 *)(p_Var26 + 0x68);

+        uVar6 = *(undefined4 *)(p_Var26 + 0x6c);

+        *(undefined4 *)(p_Var16 + 0x60) = *(undefined4 *)(p_Var26 + 0x60);

+        *(undefined4 *)(p_Var16 + 100) = uVar4;

+        *(undefined4 *)(p_Var16 + 0x68) = uVar5;

+        *(undefined4 *)(p_Var16 + 0x6c) = uVar6;

+        uVar7 = *(undefined8 *)(p_Var26 + 0x78);

+        *(undefined8 *)(p_Var16 + 0x70) = *(undefined8 *)(p_Var26 + 0x70);

+        *(undefined8 *)(p_Var16 + 0x78) = uVar7;

+        p_Var26 = p_Var26 + 0x80;

+        lVar18 = lVar18 + -1;

+        p_Var16 = p_Var16 + 0x80;

+      } while (lVar18 != 0);

+      goto LAB_1;

+    }

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

+        (WPP_GLOBAL_Control[0xe1] != '\0')) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+      WPP_SF_SS(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x7b,

+                &WPP_447f12960bb3313100e324df840110ec_Traceguids);

+    }

+    WDiagReleaseExLock(p_Var14,(_WDIAG_RW_LOCK *)(p_Var14 + 0xf50),"WDiagConnectCompletion",0xb1b);

+    WDiagReleaseExLock(param_1,(_WDIAG_RW_LOCK *)(param_1 + 0xd18),"WDiagConnectCompletion",0xb1c);

+  }

+  if (p_Var8 != (_WLAN_CONNECTION_ATTRIBUTES *)0x0) {

+    FreeWLMem(p_Var8);

+  }

+  if (pDVar23 != (DOT11_CONNECTION_INFO *)0x0) {

+    FreeWLMem(pDVar23);

+  }

+  WVar25 = 0x490;

+LAB_0:

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

+     ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x8b,

+            &WPP_447f12960bb3313100e324df840110ec_Traceguids);

+  }

+  return WVar25;

 }
```

## `RpcGetAvailableNetworkList`  (modified)

```diff
--- RpcGetAvailableNetworkList
+++ RpcGetAvailableNetworkList
@@ -1,9 +1,226 @@
 

-undefined4 RpcGetAvailableNetworkList(void)

+ulong RpcGetAvailableNetworkList

+                (WlanRpcClientContext *param_1,longlong *param_2,ulong param_3,

+                _WLAN_AVAILABLE_NETWORK_LIST_V3 **param_4)

 

 {

-  undefined4 unaff_EDI;

+  longlong lVar1;

+  bool bVar2;

+  ulong uVar3;

+  int iVar4;

+  longlong lVar5;

+  WlanRpcServerContext *this;

+  undefined8 uVar6;

+  undefined8 *puVar7;

+  undefined8 *puVar8;

+  undefined8 *puVar9;

+  ulong local_res20 [2];

+  int local_58 [2];

+  int *local_50;

+  int *local_48;

+  longlong local_40;

   

-  return unaff_EDI;

+  puVar8 = (undefined8 *)0x0;

+  local_res20[0] = 0;

+  this = (WlanRpcServerContext *)WPP_GLOBAL_Control;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    this = *(WlanRpcServerContext **)(WPP_GLOBAL_Control + 0x60);

+    WPP_SF_(this,0x6a,&WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+  }

+  *param_4 = (_WLAN_AVAILABLE_NETWORK_LIST_V3 *)0x0;

+  bVar2 = wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess

+                    (this,param_1);

+  if (!bVar2) {

+    uVar3 = 5;

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

+      return 5;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+      return 5;

+    }

+    if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+      return 5;

+    }

+    uVar6 = 0x6b;

+    goto LAB_0;

+  }

+  uVar3 = LocalGetClientSessionId(local_res20);

+  if (uVar3 != 0) {

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

+      return uVar3;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+      return uVar3;

+    }

+    if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+      return uVar3;

+    }

+    uVar6 = 0x6c;

+    goto LAB_0;

+  }

+  local_48 = (int *)0x0;

+  local_58[0] = 0;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),10,

+            &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

+  }

+  uVar3 = AcmQueryInterface(param_2,0x25,1,local_58,&local_48,0);

+  puVar7 = puVar8;

+  if (uVar3 == 0) {

+    if ((local_58[0] == 4) && (*local_48 != 0)) {

+      puVar7 = (undefined8 *)0x1;

+    }

+    else {

+      uVar3 = 0x32;

+      puVar7 = (undefined8 *)0x0;

+    }

+  }

+  if (local_48 != (int *)0x0) {

+    FreeWLMem();

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb,

+             &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

+  }

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

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

+      return uVar3;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+      return uVar3;

+    }

+    if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+      return uVar3;

+    }

+    uVar6 = 0x6d;

+    goto LAB_0;

+  }

+  local_50 = (int *)0x0;

+  local_58[1] = 0;

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

+    if ((3 < (byte)WPP_GLOBAL_Control[0x69]) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x49,

+              &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

+    }

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb0,

+              &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+    }

+  }

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

+    uVar3 = 0x57;

+LAB_1:

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb2,

+               &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+    }

+  }

+  else {

+    EnterCriticalSection((LPCRITICAL_SECTION)&DAT_2);

+    puVar7 = DAT_3;

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x67,

+              &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+      puVar7 = DAT_3;

+    }

+    for (; puVar9 = puVar8, (undefined8 **)puVar7 != &DAT_3; puVar7 = (undefined8 *)*puVar7)

+    {

+      lVar1 = puVar7[3];

+      local_40 = 0;

+      if (lVar1 == 0) {

+        MicrosoftTelemetryAssertTriggeredNoArgs();

+      }

+      iVar4 = HtReferenceHandleWithTag(g_hHandleTable,lVar1,0,0,1,&local_40);

+      if (iVar4 == 0) {

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

+        if (lVar5 == 0) {

+          lVar5 = param_2[1] - *(longlong *)(local_40 + 0x10);

+        }

+        if ((lVar5 == 0) && ((*(byte *)(local_40 + 0x18) & 0x25) != 0)) {

+          bVar2 = true;

+        }

+        else {

+          bVar2 = false;

+        }

+        HtDereferenceHandleWithTag(g_hHandleTable,lVar1);

+        puVar9 = puVar7;

+        if (bVar2) break;

+      }

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

+               (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x65);

+      }

+    }

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x6a,

+               &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+    }

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

+      puVar8 = (undefined8 *)0x0;

+    }

+    else {

+      puVar8 = (undefined8 *)puVar9[3];

+    }

+    uVar3 = ~-(uint)(puVar9 != (undefined8 *)0x0) & 0x490;

+    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_2);

+    if (puVar9 != (undefined8 *)0x0) goto LAB_1;

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

+      if ((1 < (byte)WPP_GLOBAL_Control[0x69]) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF__guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb1,

+                      &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+      }

+      goto LAB_1;

+    }

+  }

+  if (uVar3 == 0) {

+    uVar3 = WimQueryAutoConfigParameter

+                      (1,(ulong *)(local_58 + 1),(uchar **)&local_50,(_WLAN_OPCODE_VALUE_TYPE *)0x0)

+    ;

+    if ((uVar3 == 0) && (local_50 != (int *)0x0)) {

+      uVar3 = IntfGetAvailableNetworkList(puVar8,local_res20[0],param_3,*local_50,0,0,param_4);

+      FreeWLMem(local_50);

+    }

+    else {

+      uVar3 = IntfGetAvailableNetworkList(puVar8,local_res20[0],param_3,0,0,0,param_4);

+    }

+LAB_4:

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x4b,

+               &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids,uVar3);

+    }

+  }

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

+    if ((WPP_GLOBAL_Control[0x69] != '\0') && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x4a,

+               &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids,uVar3);

+    }

+    goto LAB_4;

+  }

+  if (uVar3 == 0) {

+    wlansvc::rpc_server::details::WlanRpcServerContext::NotifyCamWiFiControlUsed

+              ((WlanRpcServerContext *)WPP_GLOBAL_Control,param_1);

+  }

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

+    return uVar3;

+  }

+  if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+    return uVar3;

+  }

+  if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+    return uVar3;

+  }

+  uVar6 = 0x6e;

+LAB_0:

+  WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar6,

+           &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar3);

+  return uVar3;

 }
```

## `RpcWfdSvcLowPrivOpenSeekerSession`  (modified)

```diff
--- RpcWfdSvcLowPrivOpenSeekerSession
+++ RpcWfdSvcLowPrivOpenSeekerSession
@@ -1,9 +1,143 @@
 

-byte RpcWfdSvcLowPrivOpenSeekerSession(undefined8 param_1)

+ulong RpcWfdSvcLowPrivOpenSeekerSession

+                (_GUID *param_1,void *param_2,undefined4 param_3,ushort *param_4,uchar *param_5,

+                ulong param_6,ulong *param_7,__uint64 *param_8)

 

 {

-  byte in_AL;

+  int iVar1;

+  ulong uVar2;

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

+  *this;

+  longlong *plVar3;

+  void **ppvVar4;

+  undefined8 uVar5;

+  WfdTelemSessionHandleInternal *pWVar6;

+  ulong local_78 [2];

+  ushort *local_70;

+  ushort *local_68;

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

+  local_60 [8];

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

+  local_58 [8];

+  undefined8 local_50;

+  int aiStack_48 [2];

+  void *local_40;

   

-  return in_AL ^ (byte)((ulonglong)param_1 >> 8);

+  local_70 = (ushort *)0x0;

+  local_68 = (ushort *)0x0;

+  local_78[0] = 0;

+  local_50 = 0;

+  aiStack_48[0] = 0;

+  aiStack_48[1] = 0;

+  local_40 = (HANDLE)0x0;

+  pWVar6 = (WfdTelemSessionHandleInternal *)0x0;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2ef,

+            &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+  }

+  this = (tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

+          *)tip2::

+            start<tip2::tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>_>

+                      ();

+  plVar3 = (longlong *)

+           tip2::

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

+           ::operator->(this);

+  *(undefined1 *)(*plVar3 + 0x110) = 3;

+  tip2::

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

+  ::

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

+            (local_60);

+  wil::

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

+  ::

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

+            (local_58);

+  if (((param_8 == (__uint64 *)0x0) || (param_2 == (void *)0x0)) ||

+     ((param_5 == (uchar *)0x0 || (param_7 == (ulong *)0x0)))) {

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

+        (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2f0,

+               &WPP_791618f6e4f933247a011d60507f9013_Traceguids,param_2);

+    }

+    uVar2 = 0x57;

+  }

+  else {

+    iVar1 = IsPreventConnectBitSet();

+    if (iVar1 == 0) {

+      uVar2 = LocalGetClientAppInfo(&local_70,&local_68);

+      if (uVar2 == 0) {

+        uVar2 = LocalGetClientSessionId(local_78);

+        if (uVar2 == 0) {

+          ppvVar4 = &local_40;

+          uVar2 = LocalQueryRpcClientToken(ppvVar4);

+          if (uVar2 == 0) {

+            uVar2 = WfdGetRpcCallerDetails

+                              (ppvVar4,(ulong *)((longlong)&local_50 + 4),aiStack_48,aiStack_48 + 1)

+            ;

+            if (uVar2 == 0) {

+              local_50 = CONCAT44(local_50._4_4_,param_3);

+              pWVar6 = WfdTelemBeginSession(param_2,param_5,4,param_1);

+              uVar2 = WFDMgrWFDSvcOpenSeekerSession

+                                (param_2,param_4,param_5,param_6,local_70,local_68,local_78[0],

+                                 (_WFD_SVC_RPC_CALL_INFO *)&local_50,pWVar6,param_7,param_8);

+              if (uVar2 == 0) goto LAB_0;

+            }

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

+                     (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+              uVar5 = 0x2f6;

+              goto LAB_1;

+            }

+          }

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

+                   (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+            uVar5 = 0x2f5;

+            goto LAB_1;

+          }

+        }

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

+                 (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+          uVar5 = 0x2f4;

+          goto LAB_1;

+        }

+      }

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

+               (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        uVar5 = 0x2f3;

+LAB_1:

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar5,

+                 &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+      }

+    }

+    else {

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

+          (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2f2,

+                &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+      }

+      uVar2 = 0x964;

+      pWVar6 = (WfdTelemSessionHandleInternal *)0x0;

+    }

+  }

+  WfdTelemSessionConnectionComplete(pWVar6,4,uVar2);

+LAB_0:

+  WfdTelemCloseHandle(pWVar6);

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

+    LocalFreeClientAppSid(local_70);

+  }

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

+    LocalFree(local_68);

+  }

+  if (local_40 != (HANDLE)0x0) {

+    CloseHandle(local_40);

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2f7,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+  }

+  return uVar2;

 }
```

## `WDiagMsmRoamCompleted`  (modified)

```diff
--- WDiagMsmRoamCompleted
+++ WDiagMsmRoamCompleted
@@ -1,36 +1,145 @@
 

+/* WARNING: Function: __chkstk replaced with injection: alloca_probe */

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

+/* unsigned long __cdecl WDiagMsmRoamCompleted(struct _WD_INTERFACE_CONTEXT * __ptr64,void *

+   __ptr64,struct _WLAN_MSM_NOTIFICATION_DATA * __ptr64) */

 

 ulong __cdecl

 WDiagMsmRoamCompleted

           (_WD_INTERFACE_CONTEXT *param_1,void *param_2,_WLAN_MSM_NOTIFICATION_DATA *param_3)

 

 {

-  longlong unaff_RBX;

-  longlong unaff_RBP;

-  _WDIAG_RW_LOCK *unaff_RSI;

-  longlong unaff_RDI;

-  void *unaff_R13;

-  void *unaff_R14;

-  _WDIAG_RW_LOCK *unaff_R15;

+  _WDIAG_RW_LOCK *p_Var1;

+  _WLAN_CONNECTION_ATTRIBUTES *p_Var2;

+  longlong lVar3;

+  ulong uVar4;

+  uint uVar5;

+  ULONGLONG UVar6;

+  unique_ptr<struct__WLAN_CONNECTION_ATTRIBUTES,struct_wil::function_deleter<void_(__cdecl*)(void*___ptr64),&void___cdecl_WlanFreeMemory(void*___ptr64)>_>

+  *puVar7;

+  _WD_CONNECTION_CONTEXT *p_Var8;

+  WDIAG_STATISTICS_QUERY_REASON WVar9;

+  char *pcVar10;

+  _DOT11_SSID *p_Var11;

+  undefined1 auStackY_1038 [32];

+  _DOT11_BSS_TYPE _Var12;

+  uchar *puVar13;

+  undefined4 local_fe8;

+  undefined2 local_fe4;

+  undefined4 local_fe0 [2];

+  _WLAN_CONNECTION_ATTRIBUTES *local_fd8;

+  DOT11_CONNECTION_INFO *local_fd0;

+  longlong local_fc8;

+  undefined4 uStack_fc0;

+  undefined4 uStack_fbc;

+  undefined4 local_fb8 [976];

+  undefined4 local_78;

+  undefined4 local_6c;

+  ulonglong local_48;

+  undefined8 uStack_40;

   

-  NlmDiagSendWlanConnectionAttemptDiagnostics(&stack0x00000070,*(undefined4 *)(unaff_RBP + -0x80));

-  *(undefined4 *)((longlong)unaff_R13 + 0x30) = 0;

-  *(undefined4 *)((longlong)unaff_R13 + 0x2c) = 0;

-  WDiagReleaseExLock(unaff_R13,unaff_RSI,"WDiagMsmRoamCompleted",0xa6a);

-  WDiagReleaseExLock(unaff_R14,unaff_R15,"WDiagMsmRoamCompleted",0xa6b);

-  WdiagAddSqmRecord((WDIAG_SQM_RECORD *)(unaff_RBP + -0x80));

-  if (unaff_RDI != 0) {

+  uStack_40 = 0x1800b9226;

+  local_48 = __security_cookie ^ (ulonglong)auStackY_1038;

+  local_fe8 = 0;

+  local_fe4 = 0;

+  WVar9 = 0;

+  memset(local_fb8,0,0xf68);

+  local_fe0[0] = 0;

+  UVar6 = GetTickCount64();

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

+     ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0)) {

+    WVar9 = 0x74;

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8));

+  }

+  puVar13 = (uchar *)&local_fe8;

+  WDiagQueryDot11DataEx

+            (param_1,WVar9,(WDIAG_PACKET_STATISTICS *)0x0,(_DOT11_SSID *)0x0,puVar13,

+             (WDIAG_SIGNAL_QUALITY *)0x0,(ulong *)0x0,(ulong *)0x0,(ulong *)0x0,(ulong *)0x0);

+  _Var12 = (_DOT11_BSS_TYPE)puVar13;

+  WDiagGetConnectionInfo((_WD_INTERFACE_CONTEXT *)&local_fd0);

+  local_fd8 = (_WLAN_CONNECTION_ATTRIBUTES *)0x0;

+  puVar7 = (unique_ptr<struct__WLAN_CONNECTION_ATTRIBUTES,struct_wil::function_deleter<void_(__cdecl*)(void*___ptr64),&void___cdecl_WlanFreeMemory(void*___ptr64)>_>

+            *)WDiagGetConnectionAttributes((_WD_INTERFACE_CONTEXT *)&local_fc8);

+  wistd::

+  unique_ptr<_WLAN_CONNECTION_ATTRIBUTES,wil::function_deleter<void_(__cdecl*)(void*___ptr64),&void___cdecl_WlanFreeMemory(void*___ptr64)>_>

+  ::operator=((unique_ptr<_WLAN_CONNECTION_ATTRIBUTES,wil::function_deleter<void_(__cdecl*)(void*___ptr64),&void___cdecl_WlanFreeMemory(void*___ptr64)>_>

+               *)&local_fd8,puVar7);

+  lVar3 = local_fc8;

+  local_fc8 = 0;

+  if (lVar3 != 0) {

     FreeWLMem();

   }

-  if (unaff_RBX != 0) {

-    FreeWLMem();

+  p_Var1 = (_WDIAG_RW_LOCK *)(param_1 + 0xd18);

+  p_Var11 = (_DOT11_SSID *)0xa2e;

+  pcVar10 = "WDiagMsmRoamCompleted";

+  WDiagAcquireExLock(param_1,p_Var1,"WDiagMsmRoamCompleted",0xa2e);

+  WdiagInitSqmRecord((WDIAG_SQM_RECORD *)local_fb8);

+  p_Var8 = FindMatchingConnection(param_1,param_2,(_PM_PROFILE *)pcVar10,p_Var11,_Var12,1,2);

+  if (p_Var8 == (_WD_CONNECTION_CONTEXT *)0x0) {

+    WDiagReleaseExLock(param_1,p_Var1,"WDiagMsmRoamCompleted",0xa39);

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

+        (WPP_GLOBAL_Control[0xe1] != '\0')) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x75,

+              &WPP_447f12960bb3313100e324df840110ec_Traceguids);

+    }

+    uVar4 = 0x490;

+    if (local_fd8 != (_WLAN_CONNECTION_ATTRIBUTES *)0x0) {

+      FreeWLMem();

+    }

   }

+  else {

+    uVar4 = AcmGetConnectionSqmFlags(param_1 + 0xda0,local_fe0);

+    if (uVar4 != 0) {

+      WDiagReleaseExLock(param_1,p_Var1,"WDiagMsmRoamCompleted",0xa43);

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

+          (WPP_GLOBAL_Control[0xe1] != '\0')) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x76,

+                 &WPP_447f12960bb3313100e324df840110ec_Traceguids,uVar4);

+      }

+      if (local_fd8 != (_WLAN_CONNECTION_ATTRIBUTES *)0x0) {

+        FreeWLMem();

+      }

+      if (local_fd0 != (DOT11_CONNECTION_INFO *)0x0) {

+        FreeWLMem();

+      }

+      goto LAB_0;

+    }

+    *(undefined4 *)(p_Var8 + 0xfe0) = local_fe0[0];

+    WDiagAcquireExLock(p_Var8,(_WDIAG_RW_LOCK *)(p_Var8 + 0xf50),"WDiagMsmRoamCompleted",0xa4a);

+    uVar5 = *(int *)(p_Var8 + 0x818) - 1U & 0xf;

+    WDiagGetTime((_FILETIME *)(p_Var8 + (ulonglong)uVar5 * 0x30 + 0x830));

+    p_Var2 = local_fd8;

+    *(ULONGLONG *)(p_Var8 + (ulonglong)uVar5 * 0x30 + 0x838) = UVar6;

+    *(undefined4 *)(p_Var8 + (ulonglong)uVar5 * 0x30 + 0x840) = local_fe8;

+    *(undefined2 *)(p_Var8 + (ulonglong)uVar5 * 0x30 + 0x844) = local_fe4;

+    WdiagPopulateSqmRecord

+              (p_Var8,local_fd0,local_fd8,

+               (WDIAG_BSSID_ROAM_INFO *)(p_Var8 + (ulonglong)uVar5 * 0x30 + 0x820),

+               *(ulong *)(p_Var8 + 0x4a0),(WDIAG_SQM_RECORD *)local_fb8);

+    WDiagLogConnectDiagnosticEvent(param_1,p_Var8,(WDIAG_SQM_RECORD *)local_fb8);

+    local_fc8 = *(longlong *)(param_1 + 0xda0);

+    uStack_fc0 = *(undefined4 *)(param_1 + 0xda8);

+    uStack_fbc = *(undefined4 *)(param_1 + 0xdac);

+    NlmDiagSendWlanConnectionAttemptDiagnostics(&local_fc8,local_fb8[0],local_6c,local_78);

+    *(undefined4 *)(p_Var8 + 0x30) = 0;

+    *(undefined4 *)(p_Var8 + 0x2c) = 0;

+    WDiagReleaseExLock(p_Var8,(_WDIAG_RW_LOCK *)(p_Var8 + 0xf50),"WDiagMsmRoamCompleted",0xa6a);

+    WDiagReleaseExLock(param_1,p_Var1,"WDiagMsmRoamCompleted",0xa6b);

+    WdiagAddSqmRecord((WDIAG_SQM_RECORD *)local_fb8);

+    uVar4 = 0;

+    if (p_Var2 != (_WLAN_CONNECTION_ATTRIBUTES *)0x0) {

+      FreeWLMem(p_Var2);

+    }

+  }

+  if (local_fd0 != (DOT11_CONNECTION_INFO *)0x0) {

+    FreeWLMem(local_fd0);

+  }

+LAB_0:

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

      ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0)) {

     WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x77,

             &WPP_447f12960bb3313100e324df840110ec_Traceguids);

   }

-  return 0;

+  return uVar4;

 }
```

## `RpcQueryInterface`  (modified)

```diff
--- RpcQueryInterface
+++ RpcQueryInterface
@@ -1,23 +1,129 @@
 

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

-

-void RpcQueryInterface(void)

+ulong RpcQueryInterface(WlanRpcClientContext *param_1,_GUID *param_2,_WLAN_INTF_OPCODE param_3,

+                       undefined4 *param_4,undefined8 *param_5,undefined4 *param_6)

 

 {

-  LPCRITICAL_SECTION unaff_R12;

+  bool bVar1;

+  bool bVar2;

+  bool bVar3;

+  ulong uVar4;

+  DWORD DVar5;

+  WlanRpcServerContext *pWVar6;

+  WlanRpcServerContext *this;

+  _GUID *this_00;

+  undefined8 uVar7;

+  ulong local_res18 [2];

+  int local_res20;

   

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

-      (1 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-    WPP_SF_S(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x30c,

-             &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

-  }

-  LeaveCriticalSection(unaff_R12);

-  FreeWLMem();

+  local_res18[0] = 0;

+  bVar1 = false;

+  bVar3 = false;

+  bVar2 = true;

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

       (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x30d,

-             &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,0);

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x60,

+            &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

   }

-  return;

+  *param_4 = 0;

+  *param_5 = 0;

+  uVar7 = 3;

+  *param_6 = 3;

+  pWVar6 = (WlanRpcServerContext *)GetTickCount64();

+  this = pWVar6;

+  local_res20 = TrackRpcQueryInterfaceEntry((__uint64)pWVar6,param_3);

+  if (param_3 == 7) {

+    bVar3 = wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess

+                      (this,param_1);

+    if (!bVar3) {

+      uVar4 = 5;

+      goto LAB_0;

+    }

+    local_res18[0] = 0;

+    bVar1 = true;

+    bVar3 = true;

+    uVar4 = IsCallerSrumSvc((int *)local_res18);

+    if ((uVar4 != 0) || (local_res18[0] == 0)) goto LAB_1;

+  }

+  else {

+    if (param_3 == 4) {

+      uVar4 = LocalGetClientSessionId(local_res18);

+      if (uVar4 != 0) goto LAB_0;

+      DVar5 = WTSGetActiveConsoleSessionId();

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

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

+            (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x61,

+                   &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+        }

+        bVar2 = false;

+      }

+      if (!bVar2) goto LAB_2;

+LAB_3:

+      if (param_3 == 1) {

+        uVar7 = 2;

+      }

+      else if (param_3 != 2) {

+        if (param_3 == 3) goto LAB_4;

+        if (param_3 == 5) {

+          uVar7 = 4;

+        }

+        else {

+          if (param_3 != 0xc) {

+            if ((int)param_3 < 0x30000000) goto LAB_1;

+            goto LAB_2;

+          }

+          uVar7 = 0xc;

+        }

+      }

+    }

+    else if (param_3 == 0x10000101) {

+LAB_1:

+      uVar7 = 6;

+    }

+    else {

+      if (param_3 != 3) goto LAB_3;

+LAB_4:

+      uVar7 = 0xb;

+    }

+    bVar3 = bVar1;

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x11,

+              &WPP_3a6abbfbb6653e334b912cc02283798e_Traceguids);

+    }

+    uVar4 = VerifyRpcClientAccess(uVar7,0x20001);

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x12,

+               &WPP_3a6abbfbb6653e334b912cc02283798e_Traceguids,uVar4);

+    }

+    if (uVar4 != 0) goto LAB_0;

+  }

+LAB_2:

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

+    if ((3 < (byte)WPP_GLOBAL_Control[0x69]) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),10,

+              &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

+    }

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb,

+               &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids,1);

+    }

+  }

+  this_00 = param_2;

+  uVar4 = AcmQueryInterface(param_2,0x35,param_3,param_4,param_5,param_6);

+  if ((uVar4 == 0) && (bVar3)) {

+    wlansvc::rpc_server::details::WlanRpcServerContext::NotifyCamWiFiControlUsed

+              ((WlanRpcServerContext *)this_00,param_1);

+  }

+LAB_0:

+  TrackRpcQueryInterfaceExit(local_res20,(__uint64)pWVar6,param_2,param_3,uVar4);

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x62,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar4);

+  }

+  return uVar4;

 }
```

## `RpcWfdSvcLowPrivAcceptSession`  (modified)

```diff
--- RpcWfdSvcLowPrivAcceptSession
+++ RpcWfdSvcLowPrivAcceptSession
@@ -1,11 +1,69 @@
 

-void RpcWfdSvcLowPrivAcceptSession(void)

+ulong RpcWfdSvcLowPrivAcceptSession

+                (void *param_1,__uint64 param_2,undefined8 param_3,_WFD_WPS_INFO *param_4)

 

 {

-  code *pcVar1;

+  int iVar1;

+  ulong uVar2;

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

+  *this;

+  longlong *plVar3;

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

+  local_res8 [8];

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

+  local_18 [16];

   

-  pcVar1 = (code *)swi(3);

-  (*pcVar1)();

-  return;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x30f,

+            &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+  }

+  this = (tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

+          *)tip2::

+            start<tip2::tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>_>

+                      ();

+  plVar3 = (longlong *)

+           tip2::

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

+           ::operator->(this);

+  *(undefined1 *)(*plVar3 + 0x110) = 8;

+  tip2::

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

+  ::

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

+            (local_res8);

+  wil::

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

+  ::

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

+            (local_18);

+  if ((param_1 == (void *)0x0) || (param_2 == 0)) {

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

+       ((WPP_GLOBAL_Control[0x69] != '\0' && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

+      WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x310,

+               &WPP_791618f6e4f933247a011d60507f9013_Traceguids,param_1);

+    }

+    uVar2 = 0x57;

+  }

+  else {

+    iVar1 = IsPreventConnectBitSet();

+    if (iVar1 == 0) {

+      uVar2 = WFDMgrWFDSvcAcceptSession(param_1,param_2,param_4);

+    }

+    else {

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

+          (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x312,

+                &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+      }

+      uVar2 = 0x964;

+    }

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x313,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+  }

+  return uVar2;

 }
```

## `RpcWfdSvcLowPrivCloseSession`  (modified)

```diff
--- RpcWfdSvcLowPrivCloseSession
+++ RpcWfdSvcLowPrivCloseSession
@@ -1,77 +1,56 @@
 

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

-

-void RpcWfdSvcLowPrivCloseSession

-               (undefined8 param_1,char *param_2,undefined1 *param_3,undefined8 param_4,

-               undefined8 param_5,undefined8 param_6,undefined8 param_7,longlong param_8,

-               undefined8 param_9,undefined8 param_10,undefined8 param_11,longlong param_12)

+ulong RpcWfdSvcLowPrivCloseSession(void *param_1,__uint64 param_2)

 

 {

-  basic_string<char,struct_std::char_traits<char>,class_std::allocator<char>_> *pbVar1;

-  uint unaff_EBX;

-  uint unaff_ESI;

-  undefined8 *unaff_RDI;

-  char cVar2;

+  ulong uVar1;

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

+  *this;

+  longlong *plVar2;

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

+  local_res8 [8];

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

+  local_res18 [8];

   

-  while( true ) {

-    cVar2 = (char)param_3;

-    pbVar1 = (basic_string<char,struct_std::char_traits<char>,class_std::allocator<char>_> *)

-             std::operator+<char,std::char_traits<char>,std::allocator<char>_>

-                       (&stack0x00000070,

-                        (basic_string<char,struct_std::char_traits<char>,class_std::allocator<char>_>

-                         *)param_2);

-    std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::append

-              ((basic_string<char,std::char_traits<char>,std::allocator<char>_> *)&param_6,pbVar1);

-    std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::

-    ~basic_string<char,std::char_traits<char>,std::allocator<char>_>

-              ((basic_string<char,std::char_traits<char>,std::allocator<char>_> *)&stack0x00000070);

-    unaff_ESI = unaff_ESI & ~unaff_EBX;

-    if (unaff_ESI == 0) break;

-    unaff_EBX = -unaff_ESI & unaff_ESI;

-    if (unaff_EBX == 1) {

-      param_2 = "Hidden";

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x317,

+            &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+  }

+  this = (tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

+          *)tip2::

+            start<tip2::tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>_>

+                      ();

+  plVar2 = (longlong *)

+           tip2::

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

+           ::operator->(this);

+  *(undefined1 *)(*plVar2 + 0x110) = 10;

+  tip2::

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

+  ::

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

+            (local_res8);

+  wil::

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

+  ::

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

+            (local_res18);

+  if ((param_1 == (void *)0x0) || (param_2 == 0)) {

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

+       ((WPP_GLOBAL_Control[0x69] != '\0' && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

+      WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x318,

+               &WPP_791618f6e4f933247a011d60507f9013_Traceguids,param_1);

     }

-    else if (unaff_EBX == 2) {

-      param_2 = "AdhocJoinOnly";

-    }

-    else if (unaff_EBX == 4) {

-      param_2 = "IgnorePrivacyBit";

-    }

-    else if (unaff_EBX == 8) {

-      param_2 = "EapolPassthrough";

-    }

-    else if (unaff_EBX == 0x10) {

-      param_2 = "DiscoveryPersistProfile";

-    }

-    else if (unaff_EBX == 0x20) {

-      param_2 = "DiscoveryPersistAutoConnect";

-    }

-    else if (unaff_EBX == 0x40) {

-      param_2 = "DiscoveryPersistOverwrite";

-    }

-    else {

-      param_2 = "ToStringFailed";

-    }

-    param_3 = (undefined1 *)&param_10;

+    uVar1 = 0x57;

   }

-  if (param_8 != 0) {

-    std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::resize

-              ((basic_string<char,std::char_traits<char>,std::allocator<char>_> *)&param_6,

-               param_8 - param_12,cVar2);

+  else {

+    uVar1 = WFDMgrWFDSvcCloseSession(param_1,param_2);

   }

-  *unaff_RDI = CONCAT71(param_6._1_7_,param_6._0_1_);

-  unaff_RDI[1] = param_7;

-  unaff_RDI[2] = param_8;

-  unaff_RDI[3] = param_9;

-  param_8 = 0;

-  param_9 = 0xf;

-  param_6._0_1_ = (basic_string<char,std::char_traits<char>,std::allocator<char>_>)0x0;

-  std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::

-  ~basic_string<char,std::char_traits<char>,std::allocator<char>_>

-            ((basic_string<char,std::char_traits<char>,std::allocator<char>_> *)&param_10);

-  std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::

-  ~basic_string<char,std::char_traits<char>,std::allocator<char>_>

-            ((basic_string<char,std::char_traits<char>,std::allocator<char>_> *)&param_6);

-  return;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x31a,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar1);

+  }

+  return uVar1;

 }
```

## `WFDDeviceWFDDiscoverComplete`  (modified)

```diff
--- WFDDeviceWFDDiscoverComplete
+++ WFDDeviceWFDDiscoverComplete
@@ -1,82 +1,105 @@
 

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

    guard_dispatch_icall */

+/* void __cdecl WFDDeviceWFDDiscoverComplete(void * __ptr64,unsigned long,struct _WFD_DEVICE_ARRAY *

+   __ptr64,unsigned long) */

 

 void __cdecl

 WFDDeviceWFDDiscoverComplete(void *param_1,ulong param_2,_WFD_DEVICE_ARRAY *param_3,ulong param_4)

 

 {

-  int iVar1;

-  undefined8 *puVar2;

-  bool bVar3;

-  undefined4 uVar4;

-  longlong in_RAX;

-  undefined8 *puVar5;

+  _WLAN_INTERFACE_CONTEXT *p_Var1;

+  longlong lVar2;

+  code *pcVar3;

+  bool bVar4;

+  ulong uVar5;

+  _tlgProvider_t *p_Var6;

+  _tlgWrapperByVal<4> *p_Var7;

+  _GUID *p_Var8;

   undefined4 in_register_0000008c;

-  PTP_CALLBACK_INSTANCE local_res8;

-  PTP_WORK local_res18;

+  _GUID *p_Var9;

+  _tlgWrapperByVal<4> *p_Var10;

+  ulong local_38;

+  ulong local_34;

+  ulong local_30 [2];

+  undefined8 local_28;

+  undefined8 uStack_20;

   

-  *(int *)(in_RAX + 8) = (int)param_1;

-  uVar4 = 0;

+  p_Var9 = (_GUID *)CONCAT44(in_register_0000008c,param_4);

+  local_28 = 0;

+  uStack_20 = 0;

+  p_Var8 = (_GUID *)param_3;

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

-      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x27,

-            &WPP_2bc2ddde112f3753c495e4ba89dfa262_Traceguids,CONCAT44(in_register_0000008c,param_4))

-    ;

+      (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    p_Var9 = (_GUID *)(ulonglong)*(uint *)((longlong)param_1 + 0x10);

+    p_Var8 = (_GUID *)&WPP_c83ba87321373721dd6a751ceee998ae_Traceguids;

+    WPP_SF_DqD(*(undefined8 *)(WPP_GLOBAL_Control + 0x60));

   }

-  while( true ) {

-    EnterCriticalSection((LPCRITICAL_SECTION)&g_vsIeProviderManager);

-    puVar2 = DAT_0;

-    DAT_0 = (undefined8 *)*DAT_0;

-    DAT_0[1] = &DAT_0;

-    iVar1 = DAT_1;

-    if ((undefined8 **)puVar2 == &DAT_0) {

-      DAT_2 = 0;

-    }

-    puVar5 = (undefined8 *)0x0;

-    if ((undefined8 **)puVar2 != &DAT_0) {

-      puVar5 = puVar2;

-    }

-    LeaveCriticalSection((LPCRITICAL_SECTION)&g_vsIeProviderManager);

-    if (puVar5 == (undefined8 *)0x0) break;

-    if (iVar1 == 0) {

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

-          (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x28,

-                &WPP_2bc2ddde112f3753c495e4ba89dfa262_Traceguids);

-      }

-      uVar4 = 0x4c7;

+  bVar4 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_59722726>::__private_IsEnabled

+                    ((FeatureImpl<__WilFeatureTraits_Feature_59722726> *)

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

+                      ::__l2::impl);

+  if (bVar4) {

+    p_Var6 = WlansvcLogger::Provider();

+    if (*(uint *)p_Var6 < 6) goto LAB_0;

+    local_38 = *(ulong *)((longlong)param_1 + 0x10);

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

+      local_34 = 0;

     }

     else {

-      EnterCriticalSection((LPCRITICAL_SECTION)&DAT_3);

-      uVar4 = (*(code *)puVar5[4])(puVar5[5]);

-      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_3);

+      local_34 = *(ulong *)(param_3 + 4);

     }

-    if ((code *)puVar5[2] != (code *)0x0) {

-      (*(code *)puVar5[2])(uVar4,puVar5[3]);

+    p_Var10 = (_tlgWrapperByVal<4> *)&local_38;

+    p_Var7 = (_tlgWrapperByVal<4> *)local_30;

+    local_30[0] = param_2;

+  }

+  else {

+    p_Var6 = WlansvcLogger::Provider();

+    if (*(uint *)p_Var6 < 6) goto LAB_0;

+    local_30[0] = *(ulong *)((longlong)param_1 + 0x10);

+    p_Var10 = (_tlgWrapperByVal<4> *)local_30;

+    p_Var7 = (_tlgWrapperByVal<4> *)&local_38;

+    local_38 = param_2;

+    local_34 = param_4;

+  }

+  _tlgWriteTemplate<long___cdecl(_tlgProvider_t_const*___ptr64,void_const*___ptr64,_GUID_const*___ptr64,_GUID_const*___ptr64,unsigned_int,_EVENT_DATA_DESCRIPTOR*___ptr64),&long___cdecl__tlgWriteTransfer_EventWriteTransfer(struct__tlgProvider_t_const*___ptr64,void_const*___ptr64,struct__GUID_const*___ptr64,struct__GUID_const*___ptr64,unsigned_int,struct__EVENT_DATA_DESCRIPTOR*___ptr64),_GUID_const*___ptr64,_GUID_const*___ptr64>

+  ::Write<_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>_>

+            (p_Var6,&DAT_1,p_Var8,p_Var9,p_Var7,(_tlgWrapperByVal<4> *)&local_34,p_Var10);

+LAB_0:

+  p_Var1 = *(_WLAN_INTERFACE_CONTEXT **)((longlong)param_1 + 0x58);

+  lVar2 = *(longlong *)((longlong)param_1 + 0x60);

+  pcVar3 = *(code **)((longlong)param_1 + 0x68);

+  **(undefined8 **)(lVar2 + 0x28) = param_3;

+  **(ulong **)(lVar2 + 0x30) = param_4;

+  IntfLockInterface(p_Var1);

+  *(undefined4 *)(p_Var1 + 0x100) = 0;

+  SetEvent(*(HANDLE *)(p_Var1 + 0x108));

+  if (*(longlong *)(p_Var1 + 0xe80) != 0) {

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

+        (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2e,

+              &WPP_c83ba87321373721dd6a751ceee998ae_Traceguids);

     }

-    FreeWLMem(puVar5);

-  }

-  EnterCriticalSection((LPCRITICAL_SECTION)&g_vsIeProviderManager);

-  if (DAT_2 == 0) {

-    bVar3 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_57277348>::__private_IsEnabled

-                      ((FeatureImpl<__WilFeatureTraits_Feature_57277348> *)

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

-                        ::__l2::impl);

-    if (bVar3) {

-      SetEventWhenCallbackReturns(local_res8,DAT_4);

-    }

-    else {

-      SetEvent(DAT_4);

+    TmCancelTimer(*(void **)(p_Var1 + 0xe80));

+    TmDeleteTimer(*(void **)(p_Var1 + 0xe80));

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2f,

+               &WPP_c83ba87321373721dd6a751ceee998ae_Traceguids);

     }

   }

-  LeaveCriticalSection((LPCRITICAL_SECTION)&g_vsIeProviderManager);

-  CloseThreadpoolWork(local_res18);

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

-      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x29,

-             &WPP_2bc2ddde112f3753c495e4ba89dfa262_Traceguids,uVar4);

+  memset(p_Var1 + 0xe48,0,0x48);

+  IntfReleaseInterface(p_Var1);

+  uVar5 = IntfEventHandler(*(void **)p_Var1,2,(void *)0x0,0);

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

+      (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_DqD(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x30,

+               &WPP_c83ba87321373721dd6a751ceee998ae_Traceguids,

+               *(undefined4 *)((longlong)param_1 + 0x10),p_Var1,uVar5);

+  }

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

+    (*pcVar3)(param_1,param_2);

   }

   return;

 }
```

## `RpcHostedNetworkPerformOperation`  (modified)

```diff
--- RpcHostedNetworkPerformOperation
+++ RpcHostedNetworkPerformOperation
@@ -1,64 +1,39 @@
 

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

-

-long RpcHostedNetworkPerformOperation

-               (vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-                *param_1,ulong param_2)

+ulong RpcHostedNetworkPerformOperation

+                (longlong param_1,ulong *param_2,_WLAN_HOSTED_NETWORK_OPERATION param_3)

 

 {

-  uint in_EAX;

-  long lVar1;

-  longlong unaff_RBP;

-  ushort *unaff_RDI;

-  long unaff_R14D;

-  int unaff_R15D;

-  undefined2 local_res20 [3];

-  undefined2 uStackX_26;

+  PRTL_CRITICAL_SECTION_DEBUG p_Var1;

+  ulong uVar2;

+  void *unaff_retaddr;

+  PRTL_CRITICAL_SECTION_DEBUG local_res20;

+  unique_storage<wil::details::resource_policy<_RTL_CRITICAL_SECTION*___ptr64,void_(__cdecl*)(_RTL_CRITICAL_SECTION*___ptr64),&void___cdecl_LeaveCriticalSection(struct__RTL_CRITICAL_SECTION*___ptr64),wistd::integral_constant<unsigned___int64,1>,_RTL_CRITICAL_SECTION*___ptr64,_RTL_CRITICAL_SECTION*___ptr64,0,std::nullptr_t>_>

+  local_28 [16];

   

-  uStackX_26 = (undefined2)in_EAX;

-  local_res20[0] = (undefined2)unaff_R15D;

-  std::

-  vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-  ::

-  vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-            (param_1);

-  std::

-  map<int,std::vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE,std::default_delete<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE,std::default_delete<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE>_>_>_>,std::less<int>,std::allocator<std::pair<int_const_,std::vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE,std::default_delete<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE,std::default_delete<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE>_>_>_>_>_>_>

-  ::

-  map<int,std::vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE,std::default_delete<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE,std::default_delete<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE>_>_>_>,std::less<int>,std::allocator<std::pair<int_const_,std::vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE,std::default_delete<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE,std::default_delete<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE>_>_>_>_>_>_>

-            ((map<int,std::vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE,std::default_delete<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE,std::default_delete<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE>_>_>_>,std::less<int>,std::allocator<std::pair<int_const_,std::vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE,std::default_delete<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE,std::default_delete<wlan::legacyparser::autocfg::_ANQP_VENUE_URL_DUPLE>_>_>_>_>_>_>

-              *)&stack0x00000040);

-  std::

-  vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-  ::

-  vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-            ((vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-              *)&stack0x00000050);

-  std::

-  vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-  ::

-  vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-            ((vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-              *)(unaff_RBP + -0x80));

-  std::

-  vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-  ::

-  vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-            ((vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-              *)(unaff_RBP + -0x68));

-  std::

-  vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-  ::

-  vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

-            ((vector<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>,std::allocator<std::unique_ptr<wlan::legacyparser::autocfg::_ANQP_PLMID,std::default_delete<wlan::legacyparser::autocfg::_ANQP_PLMID>_>_>_>

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

-  memset((void *)(unaff_RBP + -0x38),0,(ulonglong)(unaff_R15D + 0x48));

-  lVar1 = AnqpParseResponseQueryMessage

-                    ((uchar *)(ulonglong)in_EAX,param_2,(_HS20_ANQP_METADATA *)local_res20);

-  AnqpMetadataToString((_HS20_ANQP_METADATA *)local_res20,unaff_R14D,unaff_RDI);

-  AnqpReleaseMetadata((_HS20_ANQP_METADATA *)local_res20);

-  wlan::legacyparser::autocfg::_HS20_ANQP_METADATA::~_HS20_ANQP_METADATA

-            ((_HS20_ANQP_METADATA *)local_res20);

-  return lVar1;

+  wil::EnterCriticalSection((_RTL_CRITICAL_SECTION *)&local_res20);

+  if (*(char *)(param_1 + 0x220) == '\0') {

+    *(undefined1 *)(param_1 + 0x220) = 1;

+    p_Var1 = *(PRTL_CRITICAL_SECTION_DEBUG *)(param_1 + 0x218);

+    wil::details::

+    unique_storage<wil::details::resource_policy<_RTL_CRITICAL_SECTION*___ptr64,void_(__cdecl*)(_RTL_CRITICAL_SECTION*___ptr64),&void___cdecl_LeaveCriticalSection(struct__RTL_CRITICAL_SECTION*___ptr64),wistd::integral_constant<unsigned___int64,1>,_RTL_CRITICAL_SECTION*___ptr64,_RTL_CRITICAL_SECTION*___ptr64,0,std::nullptr_t>_>

+    ::

+    ~unique_storage<wil::details::resource_policy<_RTL_CRITICAL_SECTION*___ptr64,void_(__cdecl*)(_RTL_CRITICAL_SECTION*___ptr64),&void___cdecl_LeaveCriticalSection(struct__RTL_CRITICAL_SECTION*___ptr64),wistd::integral_constant<unsigned___int64,1>,_RTL_CRITICAL_SECTION*___ptr64,_RTL_CRITICAL_SECTION*___ptr64,0,std::nullptr_t>_>

+              ((unique_storage<wil::details::resource_policy<_RTL_CRITICAL_SECTION*___ptr64,void_(__cdecl*)(_RTL_CRITICAL_SECTION*___ptr64),&void___cdecl_LeaveCriticalSection(struct__RTL_CRITICAL_SECTION*___ptr64),wistd::integral_constant<unsigned___int64,1>,_RTL_CRITICAL_SECTION*___ptr64,_RTL_CRITICAL_SECTION*___ptr64,0,std::nullptr_t>_>

+                *)&local_res20);

+    local_res20 = p_Var1;

+    uVar2 = HNMgrPerformOperation(param_2,param_3,&local_res20);

+    wil::EnterCriticalSection((_RTL_CRITICAL_SECTION *)local_28);

+    *(PRTL_CRITICAL_SECTION_DEBUG *)(param_1 + 0x218) = local_res20;

+    *(undefined1 *)(param_1 + 0x220) = 0;

+    wil::details::

+    unique_storage<wil::details::resource_policy<_RTL_CRITICAL_SECTION*___ptr64,void_(__cdecl*)(_RTL_CRITICAL_SECTION*___ptr64),&void___cdecl_LeaveCriticalSection(struct__RTL_CRITICAL_SECTION*___ptr64),wistd::integral_constant<unsigned___int64,1>,_RTL_CRITICAL_SECTION*___ptr64,_RTL_CRITICAL_SECTION*___ptr64,0,std::nullptr_t>_>

+    ::

+    ~unique_storage<wil::details::resource_policy<_RTL_CRITICAL_SECTION*___ptr64,void_(__cdecl*)(_RTL_CRITICAL_SECTION*___ptr64),&void___cdecl_LeaveCriticalSection(struct__RTL_CRITICAL_SECTION*___ptr64),wistd::integral_constant<unsigned___int64,1>,_RTL_CRITICAL_SECTION*___ptr64,_RTL_CRITICAL_SECTION*___ptr64,0,std::nullptr_t>_>

+              (local_28);

+    return uVar2;

+  }

+                    /* WARNING: Subroutine does not return */

+  wil::details::in1diag3::_Throw_Win32

+            (unaff_retaddr,0x115,"onecoreuap\\net\\wlan\\autocfg\\server\\rpcsrv.cpp",0xaa);

 }
```

## `WnfPolicyCallbackAllowWiFi`  (modified)

```diff
--- WnfPolicyCallbackAllowWiFi
+++ WnfPolicyCallbackAllowWiFi
@@ -1,18 +1,128 @@
 

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

+/* long __cdecl WnfPolicyCallbackAllowWiFi(struct _WNF_STATE_NAME,unsigned long,struct _WNF_TYPE_ID

+   * __ptr64,void * __ptr64,void const * __ptr64,unsigned long) */

 

-long __cdecl WnfPolicyCallbackAllowWiFi(char param_1)

+long __cdecl WnfPolicyCallbackAllowWiFi(void)

 

 {

-  char *pcVar1;

-  char in_AL;

-  undefined7 in_register_00000001;

+  undefined8 uVar1;

+  char cVar2;

+  int iVar3;

+  ulong uVar4;

+  _tlgProvider_t *p_Var5;

+  undefined8 uVar6;

+  int iVar7;

+  _GUID *p_Var8;

+  _GUID *p_Var9;

+  _GUID *in_R9;

+  _WLAN_OPERATIONAL_STATE local_38;

+  int local_34;

+  void *local_30;

+  _tlgWrapperByVal<8> local_28 [16];

   

-  *(char *)CONCAT71(in_register_00000001,in_AL) =

-       *(char *)CONCAT71(in_register_00000001,in_AL) + in_AL;

-  pcVar1 = (char *)(CONCAT71(in_register_00000001,in_AL) + 3);

-  *pcVar1 = *pcVar1 + param_1;

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

-  halt_baddata();

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x22,

+            &WPP_27bc26e86dc13380c5077d727896746c_Traceguids);

+  }

+  local_28[0] = (_tlgWrapperByVal<8>)0x0;

+  local_28[1] = (_tlgWrapperByVal<8>)0x0;

+  local_28[2] = (_tlgWrapperByVal<8>)0x0;

+  local_28[3] = (_tlgWrapperByVal<8>)0x0;

+  local_28[4] = (_tlgWrapperByVal<8>)0x0;

+  local_28[5] = (_tlgWrapperByVal<8>)0x0;

+  local_28[6] = (_tlgWrapperByVal<8>)0x0;

+  local_28[7] = (_tlgWrapperByVal<8>)0x0;

+  local_30 = (void *)0x0;

+  local_38 = 0;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x23,

+            &WPP_27bc26e86dc13380c5077d727896746c_Traceguids);

+  }

+  p_Var8 = (_GUID *)&DAT_0;

+  GetMDMPolicyBool();

+  iVar3 = GetBooleanWiFiMDMPolicy(0);

+  p_Var5 = WlansvcLogger::Provider();

+  if ((5 < *(uint *)p_Var5) && (cVar2 = _tlgKeywordOn(p_Var5,0x400000000000), cVar2 != '\0')) {

+    local_34 = iVar3;

+    _tlgWriteTemplate<long___cdecl(_tlgProvider_t_const*___ptr64,void_const*___ptr64,_GUID_const*___ptr64,_GUID_const*___ptr64,unsigned_int,_EVENT_DATA_DESCRIPTOR*___ptr64),&long___cdecl__tlgWriteTransfer_EventWriteTransfer(struct__tlgProvider_t_const*___ptr64,void_const*___ptr64,struct__GUID_const*___ptr64,struct__GUID_const*___ptr64,unsigned_int,struct__EVENT_DATA_DESCRIPTOR*___ptr64),_GUID_const*___ptr64,_GUID_const*___ptr64>

+    ::Write<_tlgWrapperByVal<4>_>

+              (p_Var5,&DAT_1,p_Var8,in_R9,(_tlgWrapperByVal<4> *)&local_34);

+  }

+  uVar4 = AcmEnumInterfaces(1,local_28);

+  uVar1 = local_28._0_8_;

+  if (uVar4 == 0) {

+    iVar7 = 0;

+    if ((uchar  [8])local_28._0_8_ == (uchar  [8])0x0) goto LAB_2;

+    for (; iVar7 < *(int *)uVar1; iVar7 = iVar7 + 1) {

+      p_Var8 = (_GUID *)&local_30;

+      p_Var9 = (_GUID *)0x0;

+      uVar4 = WimGetInterfaceContextHandle

+                        ((_GUID *)((longlong)iVar7 * 0x214 + 8 + uVar1),1,(ulong *)0x0,

+                         (void **)p_Var8);

+      if (uVar4 != 0) {

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

+            (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x25,

+                   &WPP_27bc26e86dc13380c5077d727896746c_Traceguids,uVar4);

+        }

+        break;

+      }

+      uVar4 = IntfQueryOperationalState(local_30,&local_38);

+      if (uVar4 == 0) {

+        if (local_38 == 1) {

+          if (iVar3 != 0) goto LAB_3;

+          p_Var5 = WlansvcLogger::Provider();

+          if ((5 < *(uint *)p_Var5) && (cVar2 = _tlgKeywordOn(p_Var5,0x400000000000), cVar2 != '\0')

+             ) {

+            local_34 = 0;

+            local_28[0] = (_tlgWrapperByVal<8>)0x0;

+            local_28[1] = (_tlgWrapperByVal<8>)0x8;

+            local_28[2] = (_tlgWrapperByVal<8>)0x0;

+            local_28[3] = (_tlgWrapperByVal<8>)0x0;

+            local_28[4] = (_tlgWrapperByVal<8>)0x0;

+            local_28[5] = (_tlgWrapperByVal<8>)0x0;

+            local_28[6] = (_tlgWrapperByVal<8>)0x0;

+            local_28[7] = (_tlgWrapperByVal<8>)0x0;

+            _tlgWriteTemplate<long___cdecl(_tlgProvider_t_const*___ptr64,void_const*___ptr64,_GUID_const*___ptr64,_GUID_const*___ptr64,unsigned_int,_EVENT_DATA_DESCRIPTOR*___ptr64),&long___cdecl__tlgWriteTransfer_EventWriteTransfer(struct__tlgProvider_t_const*___ptr64,void_const*___ptr64,struct__GUID_const*___ptr64,struct__GUID_const*___ptr64,unsigned_int,struct__EVENT_DATA_DESCRIPTOR*___ptr64),_GUID_const*___ptr64,_GUID_const*___ptr64>

+            ::Write<_tlgWrapperByVal<4>,_tlgWrapperByVal<8>_>

+                      (p_Var5,&DAT_4,p_Var9,p_Var8,(_tlgWrapperByVal<4> *)&local_34,local_28

+                      );

+          }

+        }

+        else if ((local_38 != 2) || (iVar3 == 0)) goto LAB_3;

+      }

+      else {

+LAB_3:

+        uVar4 = IntfSetOperationalState(local_30,(iVar3 != 0) + 1);

+        if (uVar4 != 0) {

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

+              (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+            uVar6 = 0x26;

+            goto LAB_5;

+          }

+          break;

+        }

+      }

+    }

+  }

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

+           (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    uVar6 = 0x24;

+LAB_5:

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar6,

+             &WPP_27bc26e86dc13380c5077d727896746c_Traceguids,uVar4);

+  }

+  if ((uchar  [8])uVar1 != (uchar  [8])0x0) {

+    FreeWLMem(uVar1);

+  }

+LAB_2:

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x27,

+             &WPP_27bc26e86dc13380c5077d727896746c_Traceguids,0);

+  }

+  return 0;

 }
```

## `DecodeMacAddressString`  (modified)

```diff
--- DecodeMacAddressString
+++ DecodeMacAddressString
@@ -1,53 +1,59 @@
 

-_NLA_DATA ** DecodeMacAddressString(longlong param_1)

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

+

+undefined4 DecodeMacAddressString(wchar_t *param_1,longlong *param_2,undefined1 *param_3)

 

 {

-  ulonglong uVar1;

-  void *_Src;

-  code *pcVar2;

-  longlong in_RAX;

-  _NLA_DATA **pp_Var3;

-  __uint64 _Var4;

-  _NLA_DATA **_Dst;

-  ulonglong uVar5;

-  _NLA_DATA **_Dst_00;

-  ulonglong unaff_RBX;

-  vector<_NLA_DATA*___ptr64,std::allocator<_NLA_DATA*___ptr64>_> *unaff_RSI;

-  size_t _Size;

-  void *unaff_R12;

-  undefined8 *unaff_R13;

-  longlong unaff_R14;

+  bool bVar1;

+  int iVar2;

+  undefined1 auStack_a8 [32];

+  undefined1 *local_88;

+  undefined1 *local_80;

+  undefined1 *local_78;

+  undefined1 *local_70;

+  int *local_68;

+  int local_58 [2];

+  undefined1 local_50 [4];

+  undefined1 local_4c [4];

+  undefined1 local_48 [4];

+  undefined1 local_44 [4];

+  undefined1 local_40 [4];

+  undefined1 local_3c [4];

+  ulonglong local_38;

   

-  if ((int)in_RAX == (int)unaff_RBX) {

-    std::_Xlength_error("vector too long");

-    pcVar2 = (code *)swi(3);

-    pp_Var3 = (_NLA_DATA **)(*pcVar2)();

-    return pp_Var3;

-  }

-  uVar1 = in_RAX + 1;

-  uVar5 = *(longlong *)(param_1 + 0x10) - *(longlong *)unaff_RSI >> 3;

-  if ((uVar5 <= unaff_RBX - (uVar5 >> 1)) && (unaff_RBX = (uVar5 >> 1) + uVar5, unaff_RBX < uVar1))

-  {

-    unaff_RBX = uVar1;

-  }

-  _Var4 = std::_Get_size_of_n<8>(unaff_RBX);

-  _Dst = std::_Allocate<16,std::_Default_allocate_traits,0>(_Var4);

-  pp_Var3 = _Dst + unaff_R14;

-  *pp_Var3 = (_NLA_DATA *)*unaff_R13;

-  _Src = *(void **)unaff_RSI;

-  if (unaff_R12 == *(void **)(unaff_RSI + 8)) {

-    _Size = (longlong)*(void **)(unaff_RSI + 8) - (longlong)_Src;

-    _Dst_00 = _Dst;

-    unaff_R12 = _Src;

+  local_38 = __security_cookie ^ (ulonglong)auStack_a8;

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

+                    ((FeatureImpl<__WilFeatureTraits_Feature_59722726> *)

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

+                      ::__l2::impl);

+  if (bVar1) {

+    local_68 = local_58;

+    local_58[0] = 0;

+    local_70 = local_3c;

+    local_78 = local_40;

+    local_80 = local_44;

+    local_88 = local_48;

+    iVar2 = swscanf_s(param_1,L"%2X:%2X:%2X:%2X:%2X:%2X%n",local_50,local_4c);

+    if ((5 < iVar2) && (local_58[0] == 0x11)) {

+LAB_0:

+      *param_2 = (longlong)(param_1 + 0x11);

+      *param_3 = local_50[0];

+      param_3[1] = local_4c[0];

+      param_3[2] = local_48[0];

+      param_3[3] = local_44[0];

+      param_3[4] = local_40[0];

+      param_3[5] = local_3c[0];

+      return 0;

+    }

   }

   else {

-    memmove(_Dst,_Src,(longlong)unaff_R12 - *(longlong *)unaff_RSI);

-    _Dst_00 = pp_Var3 + 1;

-    _Size = *(longlong *)(unaff_RSI + 8) - (longlong)unaff_R12;

+    local_70 = local_3c;

+    local_78 = local_40;

+    local_80 = local_44;

+    local_88 = local_48;

+    iVar2 = swscanf_s(param_1,L"%2X:%2X:%2X:%2X:%2X:%2X",local_50,local_4c);

+    if (5 < iVar2) goto LAB_0;

   }

-  memmove(_Dst_00,unaff_R12,_Size);

-  std::vector<_NLA_DATA*___ptr64,std::allocator<_NLA_DATA*___ptr64>_>::_Change_array

-            (unaff_RSI,_Dst,uVar1,unaff_RBX);

-  return pp_Var3;

+  return 0x8007000d;

 }
```

## `CopyDot11ConnectionInfo`  (modified)

```diff
--- CopyDot11ConnectionInfo
+++ CopyDot11ConnectionInfo
@@ -1,35 +1,65 @@
 

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

+/* void __cdecl CopyDot11ConnectionInfo(struct DOT11_CONNECTION_INFO * __ptr64,struct

+   _WLAN_CONNECTION_ATTRIBUTES * __ptr64,unsigned char (* __ptr64 * __ptr64)[6],struct

+   WDIAG_WLAN_BSS_INFO_EX * __ptr64) */

 

 void __cdecl

 CopyDot11ConnectionInfo

-          (_WD_INTERFACE_CONTEXT *param_1,DOT11_CONNECTION_INFO *param_2,

-          _WLAN_CONNECTION_ATTRIBUTES *param_3,uchar **param_4,WDIAG_WLAN_BSS_INFO_EX *param_5)

+          (DOT11_CONNECTION_INFO *param_1,_WLAN_CONNECTION_ATTRIBUTES *param_2,uchar **param_3,

+          WDIAG_WLAN_BSS_INFO_EX *param_4)

 

 {

-  undefined4 unaff_EBX;

-  undefined *unaff_RSI;

-  uint unaff_EDI;

-  int unaff_R14D;

-  bool bVar1;

+  __uint64 _Var1;

+  longlong lVar2;

+  uint uVar3;

+  ulonglong uVar4;

+  int iVar5;

   

-  LOCK();

-  bVar1 = unaff_R14D == _g_nlaPluginContextBlock;

-  if (bVar1) {

-    _g_nlaPluginContextBlock = 2;

+  if ((param_1 == (DOT11_CONNECTION_INFO *)0x0) || (*(int *)(param_1 + 0x6c) == 0)) {

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

+       ((2 < (byte)WPP_GLOBAL_Control[0xe1] && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)))) {

+      WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x10,

+               &WPP_6b9e4ac0a6a03421ccf9aaba04f2e0a8_Traceguids,param_2);

+    }

+    if (param_2 == (_WLAN_CONNECTION_ATTRIBUTES *)0x0) {

+      *(undefined4 *)(param_4 + 0x30) = 0;

+    }

+    else {

+      *(undefined4 *)(param_4 + 0x30) = *(undefined4 *)(param_2 + 0x238);

+    }

   }

-  UNLOCK();

-  if (!bVar1) {

-    unaff_EBX = 0x139f;

-    MicrosoftTelemetryAssertTriggeredNoArgs();

-  }

-  g_nlaPluginEnabled = true;

-  if (((WPP_GLOBAL_Control != unaff_RSI) &&

-      ((*(uint *)(WPP_GLOBAL_Control + 0x1c) & unaff_EDI) != 0)) &&

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

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

-             &WPP_44ded7619b17311637f5701016ad5436_Traceguids,unaff_EBX);

+  else {

+    iVar5 = 0;

+    uVar4 = 0;

+    if (*(int *)(param_1 + 0x68) != 0) {

+      do {

+        lVar2 = uVar4 * 0x30;

+        if (param_1[lVar2 + 0x74] == param_1[0x70]) {

+          *param_3 = (uchar *)(param_1 + lVar2 + 0x7b);

+          *(undefined4 *)(param_4 + 0x3c) = *(undefined4 *)(param_1 + lVar2 + 0x88);

+          *(undefined4 *)(param_4 + 0x40) = *(undefined4 *)(param_1 + lVar2 + 0x8c);

+          *(int *)(param_4 + 0x38) = *(int *)(param_1 + (uVar4 + 3) * 0x30) * 1000;

+          if (*(int *)(param_1 + lVar2 + 0x94) < 0) {

+            *(int *)(param_4 + 0x34) = *(int *)(param_1 + lVar2 + 0x94);

+          }

+        }

+        if (*(int *)(param_1 + lVar2 + 0x84) == 0) {

+          iVar5 = iVar5 + *(int *)(param_1 + lVar2 + 0x98);

+        }

+        uVar3 = (int)uVar4 + 1;

+        uVar4 = (ulonglong)uVar3;

+      } while (uVar3 < *(uint *)(param_1 + 0x68));

+    }

+    *(undefined4 *)(param_4 + 0x30) = *(undefined4 *)(param_1 + 0x54);

+    *(int *)(param_4 + 0x58) = iVar5;

+    *(undefined4 *)(param_4 + 0x114) = *(undefined4 *)(param_1 + 0x58);

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

+      *(DOT11_CONNECTION_INFO *)(param_4 + 0x44) = param_1[0x6c];

+    }

+    _Var1 = WdiagMapCurrentConnectionFlags

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

+    *(__uint64 *)(param_4 + 0x48) = _Var1;

   }

   return;

 }
```

## `WdiagPopulateSqmRecord`  (modified)

```diff
--- WdiagPopulateSqmRecord
+++ WdiagPopulateSqmRecord
@@ -1,11 +1,126 @@
+

+/* void __cdecl WdiagPopulateSqmRecord(struct _WD_CONNECTION_CONTEXT * __ptr64,struct

+   DOT11_CONNECTION_INFO * __ptr64,struct _WLAN_CONNECTION_ATTRIBUTES * __ptr64,struct

+   WDIAG_BSSID_ROAM_INFO * __ptr64,unsigned long,struct WDIAG_SQM_RECORD * __ptr64) */

 

 void __cdecl

 WdiagPopulateSqmRecord

           (_WD_CONNECTION_CONTEXT *param_1,DOT11_CONNECTION_INFO *param_2,

           _WLAN_CONNECTION_ATTRIBUTES *param_3,WDIAG_BSSID_ROAM_INFO *param_4,ulong param_5,

           WDIAG_SQM_RECORD *param_6)

 

 {

+  longlong lVar1;

+  ulong uVar2;

+  int iVar3;

+  longlong lVar4;

+  WDIAG_SQM_RECORD *pWVar5;

+  

+  if ((param_1 != (_WD_CONNECTION_CONTEXT *)0x0) &&

+     (lVar1 = *(longlong *)(param_1 + 0x18), lVar1 != 0)) {

+    lVar4 = 0xda0;

+    if (*(int *)(lVar1 + 0xdc0) != 1) {

+      lVar4 = 0xdb0;

+    }

+    uVar2 = WDiagQueryDeviceInfo

+                      ((_GUID *)(lVar4 + lVar1),(ushort *)(param_6 + 4),0x100,

+                       (ushort *)(param_6 + 0x204),0x100,(ushort *)(param_6 + 0x614),0x100,

+                       (ushort *)(param_6 + 0x814),0x100,(ushort *)(param_6 + 0x404),0x100,

+                       (_SYSTEMTIME *)(param_6 + 0x604),(ushort *)(param_6 + 0xa14),0x104,

+                       (ushort *)(param_6 + 0xc1c),0x100);

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

+        (WPP_GLOBAL_Control[0xe1] != '\0')) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x14,

+               &WPP_6b9e4ac0a6a03421ccf9aaba04f2e0a8_Traceguids,uVar2);

+    }

+    if (*(int *)(*(longlong *)(param_1 + 0x18) + 0x1554) != 0) {

+      *(uint *)(param_6 + 0xf3c) = *(uint *)(param_6 + 0xf3c) | 0x10;

+      *(undefined4 *)(param_6 + 0xe1c) = 1;

+    }

+    if (*(char *)(*(longlong *)(param_1 + 0x18) + 0x1558) == '\0') {

+      iVar3 = 0;

+    }

+    else {

+      iVar3 = (*(int *)(*(longlong *)(param_1 + 0x18) + 0x155c) != 0) + 1;

+    }

+    *(int *)(param_6 + 0xe20) = iVar3;

+    pWVar5 = param_6 + 0xe2c;

+    *(undefined4 *)(param_6 + 0xf40) = *(undefined4 *)(param_1 + 0x5d0);

+    *(ulong *)(param_6 + 0xf4c) = param_5;

+    if (param_4 == (WDIAG_BSSID_ROAM_INFO *)0x0) {

+      WdiagGetAssociationAndSecurityTimes

+                (*(__uint64 *)(param_1 + 0x5b0),*(__uint64 *)(param_1 + 0x5b8),

+                 (ulong *)(param_6 + 0xe38),*(__uint64 *)(param_1 + 0x6a0),

+                 *(__uint64 *)(param_1 + 0x6a8),(ulong *)(param_6 + 0xe44));

+      if ((*(int *)(param_1 + 0xd24) == 0) && (*(short *)(param_1 + 0xd28) == 0)) {

+        *(undefined4 *)pWVar5 = *(undefined4 *)(param_1 + 0x5c6);

+        *(undefined2 *)(param_6 + 0xe30) = *(undefined2 *)(param_1 + 0x5ca);

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

+            (WPP_GLOBAL_Control[0xe1] != '\0')) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+          WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x16,

+                  &WPP_6b9e4ac0a6a03421ccf9aaba04f2e0a8_Traceguids);

+        }

+      }

+      else {

+        *(undefined4 *)pWVar5 = *(undefined4 *)(param_1 + 0xd24);

+        *(undefined2 *)(param_6 + 0xe30) = *(undefined2 *)(param_1 + 0xd28);

+      }

+      if (*(int *)(param_6 + 0xf40) != 0) {

+        pWVar5 = param_6 + 0xe32;

+      }

+    }

+    else {

+      *(undefined4 *)(param_6 + 0xf48) = *(undefined4 *)(param_4 + 0x28);

+      WdiagGetAssociationAndSecurityTimes

+                (*(__uint64 *)(param_4 + 8),*(__uint64 *)(param_4 + 0x18),(ulong *)(param_6 + 0xe38)

+                 ,*(__uint64 *)(param_1 + 0x6a0),*(__uint64 *)(param_1 + 0x6a8),

+                 (ulong *)(param_6 + 0xe44));

+      if ((*(int *)(param_4 + 0x20) == 0) && (*(short *)(param_4 + 0x24) == 0)) {

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

+            (WPP_GLOBAL_Control[0xe1] != '\0')) && ((WPP_GLOBAL_Control[0xe4] & 0x10) != 0)) {

+          WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x15,

+                  &WPP_6b9e4ac0a6a03421ccf9aaba04f2e0a8_Traceguids);

+        }

+      }

+      else {

+        *(undefined4 *)pWVar5 = *(undefined4 *)(param_4 + 0x20);

+        *(undefined2 *)(param_6 + 0xe30) = *(undefined2 *)(param_4 + 0x24);

+      }

+    }

+    *(undefined4 *)(param_6 + 0xe3c) = *(undefined4 *)(param_1 + 0x818);

+    *(undefined4 *)(param_6 + 0xe40) = *(undefined4 *)(param_1 + 0x5cc);

+    *(undefined4 *)(param_6 + 0xe48) = *(undefined4 *)(param_1 + 0x714);

+    *(undefined4 *)(param_6 + 0xe32) = *(undefined4 *)(param_1 + 0x5c0);

+    *(undefined2 *)(param_6 + 0xe36) = *(undefined2 *)(param_1 + 0x5c4);

+    *(undefined4 *)(param_6 + 0xf44) = *(undefined4 *)(param_1 + 0x5d4);

+    *(undefined4 *)(param_6 + 0xf30) = *(undefined4 *)(param_1 + 0x6e4);

+    *(undefined4 *)(param_6 + 0xf34) = *(undefined4 *)(param_1 + 0x6e8);

+    iVar3 = *(int *)(param_1 + 0x4d0);

+    *(int *)(param_6 + 0xf38) = iVar3;

+    if (iVar3 != 0) {

+      *(undefined4 *)(param_6 + 0xf50) = *(undefined4 *)(param_1 + 0x700);

+      *(undefined4 *)(param_6 + 0xf54) = *(undefined4 *)(param_1 + 0x6f0);

+    }

+    if (*(int *)(param_1 + 0x28) != 0) {

+      *(uint *)(param_6 + 0xf3c) = *(uint *)(param_6 + 0xf3c) | 4;

+    }

+    if (*(int *)(param_1 + 0x4d8) != 0) {

+      *(uint *)(param_6 + 0xf3c) = *(uint *)(param_6 + 0xf3c) | 8;

+    }

+    if (param_1[0xfec] != (_WD_CONNECTION_CONTEXT)0x0) {

+      *(uint *)(param_6 + 0xf3c) = *(uint *)(param_6 + 0xf3c) | 0x80;

+    }

+    *(uint *)(param_6 + 0xf3c) = *(uint *)(param_6 + 0xf3c) | (*(int *)(param_1 + 0x4d4) != 0) + 1;

+    *(undefined4 *)(param_6 + 0xe28) = *(undefined4 *)(param_1 + 0xfe8);

+    *(undefined4 *)(param_6 + 0xe24) = *(undefined4 *)(param_1 + 0xfe4);

+    *(undefined4 *)(param_6 + 0xe70) = *(undefined4 *)(param_1 + 0x5dc);

+    *(undefined4 *)(param_6 + 0xe74) = *(undefined4 *)(param_1 + 0x5e0);

+    GetExtendedConnectionMode

+              (param_1,param_4 != (WDIAG_BSSID_ROAM_INFO *)0x0,(_WDIAG_SQM_CONNECTION_MODE *)param_6

+              );

+    WdiagGetDot11ConnectionInfo

+              (param_1,param_2,param_3,(uchar *)pWVar5,(_DOT11_SSID *)(param_1 + 0x470),param_6);

+  }

   return;

 }
```

## `RpcGetNetworkBssList`  (modified)

```diff
--- RpcGetNetworkBssList
+++ RpcGetNetworkBssList
@@ -1,15 +1,233 @@
 

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

-

-bool RpcGetNetworkBssList(longlong param_1)

+ulong RpcGetNetworkBssList

+                (WlanRpcClientContext *param_1,longlong *param_2,_DOT11_SSID *param_3,

+                _DOT11_BSS_TYPE param_4,int param_5,WlanRpcServerContext *param_6,

+                undefined8 *param_7)

 

 {

-  undefined8 in_stack_00000138;

+  longlong lVar1;

+  int *lpMem;

+  bool bVar2;

+  ulong uVar3;

+  int iVar4;

+  HANDLE hHeap;

+  longlong lVar5;

+  WlanRpcServerContext *this;

+  undefined8 uVar6;

+  undefined8 *puVar7;

+  void *pvVar8;

+  _WLAN_BSS_LIST *p_Var9;

+  _WLAN_BSS_LIST *p_Var10;

+  undefined8 *puVar11;

+  int local_58 [2];

+  int *local_50;

+  longlong local_48;

+  _WLAN_BSS_LIST *local_40;

   

-  if (((param_1 != 0x802ad290) && (*(char *)(param_1 + 0x69) != '\0')) &&

-     ((*(byte *)(param_1 + 0x6c) & 1) != 0)) {

-    WPP_SF_(*(undefined8 *)(param_1 + 0x60),10,&WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

-  }

-  return in_stack_00000138._2_1_ == '\x01';

+  p_Var9 = (_WLAN_BSS_LIST *)0x0;

+  local_40 = (_WLAN_BSS_LIST *)0x0;

+  this = (WlanRpcServerContext *)WPP_GLOBAL_Control;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    this = *(WlanRpcServerContext **)(WPP_GLOBAL_Control + 0x60);

+    WPP_SF_(this,0x74,&WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+  }

+  *param_7 = 0;

+  *(undefined4 *)param_6 = 0;

+  bVar2 = wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess

+                    (this,param_1);

+  if (!bVar2) {

+    uVar3 = 5;

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

+      return 5;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+      return 5;

+    }

+    if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+      return 5;

+    }

+    uVar6 = 0x75;

+    goto LAB_0;

+  }

+  local_50 = (int *)0x0;

+  local_58[0] = 0;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),10,

+            &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

+  }

+  uVar3 = AcmQueryInterface(param_2,0x25,1,local_58,&local_50,0);

+  lpMem = local_50;

+  iVar4 = 0;

+  if (uVar3 == 0) {

+    if ((local_58[0] == 4) && (*local_50 != 0)) {

+      iVar4 = 1;

+    }

+    else {

+      uVar3 = 0x32;

+      iVar4 = 0;

+    }

+  }

+  if ((local_50 != (int *)0x0) && (hHeap = GetProcessHeap(), hHeap != (HANDLE)0x0)) {

+    HeapFree(hHeap,0,lpMem);

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb,

+             &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids,iVar4);

+  }

+  if (iVar4 == 0) {

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

+      return uVar3;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+      return uVar3;

+    }

+    if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+      return uVar3;

+    }

+    uVar6 = 0x76;

+    goto LAB_0;

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x4c,

+            &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

+  }

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

+    uVar3 = 0x57;

+    p_Var10 = (_WLAN_BSS_LIST *)0x0;

+LAB_1:

+    p_Var9 = p_Var10;

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x4f,

+               &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids,uVar3);

+    }

+  }

+  else {

+    p_Var10 = p_Var9;

+    if ((param_3 == (_DOT11_SSID *)0x0) || ((*(uint *)param_3 < 0x21 && (param_4 - 1 < 3)))) {

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

+         ((3 < (byte)WPP_GLOBAL_Control[0x69] && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb0,

+                &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+      }

+      EnterCriticalSection((LPCRITICAL_SECTION)&DAT_2);

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

+          (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x67,

+                &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+      }

+      for (puVar7 = DAT_3; puVar11 = (undefined8 *)0x0,

+          (undefined8 **)puVar7 != &DAT_3; puVar7 = (undefined8 *)*puVar7) {

+        lVar1 = puVar7[3];

+        local_48 = 0;

+        if (lVar1 == 0) {

+          MicrosoftTelemetryAssertTriggeredNoArgs();

+        }

+        iVar4 = HtReferenceHandleWithTag(g_hHandleTable,lVar1,0,0,1,&local_48);

+        if (iVar4 == 0) {

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

+          if (lVar5 == 0) {

+            lVar5 = param_2[1] - *(longlong *)(local_48 + 0x10);

+          }

+          if ((lVar5 == 0) && ((*(byte *)(local_48 + 0x18) & 0x25) != 0)) {

+            bVar2 = true;

+          }

+          else {

+            bVar2 = false;

+          }

+          HtDereferenceHandleWithTag(g_hHandleTable,lVar1);

+          puVar11 = puVar7;

+          if (bVar2) break;

+        }

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

+                 (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x65);

+        }

+      }

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

+          (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x6a,

+                 &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids,0);

+      }

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

+        pvVar8 = (void *)0x0;

+      }

+      else {

+        pvVar8 = (void *)puVar11[3];

+      }

+      LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_2);

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

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

+          if ((1 < (byte)WPP_GLOBAL_Control[0x69]) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+            WPP_SF__guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb1,

+                          &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids,param_2);

+          }

+          goto LAB_4;

+        }

+      }

+      else {

+LAB_4:

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

+            (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb2,

+                   &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids,

+                   ~-(uint)(puVar11 != (undefined8 *)0x0) & 0x490);

+        }

+      }

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

+        uVar3 = 0x490;

+        if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) goto LAB_5;

+        if ((WPP_GLOBAL_Control[0x69] != '\0') && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x4e,

+                   &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids,0x490);

+        }

+      }

+      else {

+        uVar3 = IntfGetNetworkBssList(pvVar8,param_3,param_4,param_5,&local_40);

+        p_Var10 = local_40;

+      }

+      goto LAB_1;

+    }

+    uVar3 = 0x57;

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

+      if ((WPP_GLOBAL_Control[0x69] != '\0') &&

+         (p_Var10 = (_WLAN_BSS_LIST *)0x0, (WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x4d,

+                &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

+        p_Var10 = p_Var9;

+      }

+      goto LAB_1;

+    }

+  }

+LAB_5:

+  if (uVar3 == 0) {

+    *(undefined4 *)param_6 = *(undefined4 *)p_Var9;

+    *param_7 = p_Var9;

+    wlansvc::rpc_server::details::WlanRpcServerContext::NotifyCamWiFiControlUsed(param_6,param_1);

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x78,

+               &WPP_791618f6e4f933247a011d60507f9013_Traceguids,0);

+    }

+    return 0;

+  }

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

+    return uVar3;

+  }

+  if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+    return uVar3;

+  }

+  if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+    return uVar3;

+  }

+  uVar6 = 0x77;

+LAB_0:

+  WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar6,

+           &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar3);

+  return uVar3;

 }
```

## `IntfLogInitTelemetry`  (modified)

```diff
--- IntfLogInitTelemetry
+++ IntfLogInitTelemetry
@@ -1,57 +1,629 @@
 

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

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

+   guard_dispatch_icall */

+/* unsigned long __cdecl IntfLogInitTelemetry(struct _WLAN_INTERFACE_CONTEXT * __ptr64,bool) */

 

 ulong __cdecl IntfLogInitTelemetry(_WLAN_INTERFACE_CONTEXT *param_1,bool param_2)

 

 {

-  char cVar1;

-  char *in_RAX;

-  undefined7 in_register_00000011;

-  int unaff_EBX;

-  ulong unaff_ESI;

-  byte unaff_DIL;

-  bool in_R8B;

-  undefined *unaff_R12;

-  undefined4 extraout_XMM0_Da;

-  undefined4 uVar3;

-  _WLAN_INTERFACE_CONTEXT *in_stack_00000050;

-  undefined4 in_stack_00000160;

-  undefined8 in_stack_00000164;

-  undefined8 in_stack_0000016c;

-  undefined4 in_stack_00000174;

-  undefined4 in_stack_00000178;

-  undefined4 in_stack_0000017c;

-  undefined4 in_stack_00000180;

-  undefined8 in_stack_00000188;

-  char *pcVar2;

+  int iVar1;

+  uint uVar2;

+  _DOT11_ADAPTER_CAPABILITIES *p_Var3;

+  _DOT11_SYSTEM_CAPABILITIES *p_Var4;

+  bool bVar5;

+  char cVar6;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *_Dst;

+  wchar_t *pwVar7;

+  longlong lVar8;

+  size_t sVar9;

+  size_t sVar10;

+  _tlgProvider_t *p_Var11;

+  uint *puVar12;

+  ulong uVar13;

+  uint uVar14;

+  undefined4 uVar15;

+  ulonglong uVar16;

+  undefined4 uVar17;

+  longlong lVar18;

+  ulonglong uVar19;

+  undefined8 uVar20;

+  uint uVar21;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *p_Var22;

+  undefined8 uVar23;

+  wchar_t *pwVar24;

+  undefined1 uVar25;

+  undefined4 uVar26;

+  _WLAN_OPCODE_VALUE_TYPE local_res8 [2];

+  byte local_res10;

+  uint local_res18 [2];

+  undefined4 local_res20 [2];

+  undefined8 in_stack_fffffffffffffcc8;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *p_Var27;

+  undefined8 in_stack_fffffffffffffcd8;

+  undefined8 uVar28;

+  undefined4 uVar30;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *p_Var29;

+  undefined8 in_stack_fffffffffffffce8;

+  undefined4 uVar32;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *p_Var31;

+  undefined8 in_stack_fffffffffffffcf8;

+  undefined4 uVar34;

+  undefined8 uVar33;

+  undefined4 uVar35;

+  uint local_1a8;

+  undefined4 local_1a4;

+  undefined4 local_1a0;

+  undefined4 local_19c;

+  undefined4 local_198;

+  undefined4 local_194;

+  undefined4 local_190;

+  undefined4 local_18c;

+  undefined4 local_188 [2];

+  uint *local_180;

+  _tlgWrapperByVal<4> local_178 [4];

+  _tlgWrapperByVal<4> local_174 [4];

+  undefined4 local_170;

+  _tlgWrapperByVal<4> local_16c [4];

+  _tlgWrapperByVal<4> local_168 [4];

+  undefined4 local_164;

+  undefined4 local_160;

+  undefined4 local_15c;

+  undefined4 local_158;

+  undefined4 local_154;

+  uint local_150;

+  uint local_14c;

+  uint local_148;

+  undefined4 local_144;

+  undefined4 local_140 [2];

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *local_138;

+  char *local_130;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *local_128;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *local_120;

+  undefined4 local_118;

+  undefined4 uStack_114;

+  undefined4 uStack_110;

+  undefined4 uStack_10c;

+  uint local_108;

+  undefined4 uStack_104;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *local_100;

+  wchar_t *local_f8;

+  wchar_t *local_f0;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *local_e8;

+  wchar_t *local_e0;

+  wchar_t *local_d8;

+  wchar_t *local_d0;

+  wchar_t *local_c8;

+  wchar_t *local_c0;

+  wchar_t *local_b8;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *local_b0;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *local_a8;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *local_a0;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *local_98;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *local_90;

+  _INTFLOGINITTELEMETRY_LOCAL_DATA *local_88;

+  undefined8 local_80;

+  _WLAN_INTERFACE_CONTEXT *local_78;

+  undefined8 uStack_70;

+  undefined4 local_68;

+  undefined4 uStack_64;

+  undefined4 uStack_60;

+  undefined4 uStack_5c;

+  ulonglong local_58;

   

-  cVar1 = (char)in_RAX + *in_RAX;

-  pcVar2 = (char *)CONCAT71((int7)((ulonglong)in_RAX >> 8),cVar1);

-  *pcVar2 = *pcVar2 + cVar1;

-  IntfOffloadNetworks(in_stack_00000050,(ulong)CONCAT71(in_register_00000011,param_2),in_R8B);

-  if (g_bNotifyWDiag != unaff_EBX) {

-    memset(&stack0x00000160,0,0x90);

-    in_stack_00000160 = 4;

-    uVar3 = extraout_XMM0_Da;

-    if (in_stack_00000050 != (_WLAN_INTERFACE_CONTEXT *)0x0) {

-      in_stack_00000164 = *(undefined8 *)(in_stack_00000050 + 8);

-      in_stack_0000016c = *(undefined8 *)(in_stack_00000050 + 0x10);

-      in_stack_00000188 = *(undefined8 *)(in_stack_00000050 + 0x2c0);

-      uVar3 = *(undefined4 *)(in_stack_00000050 + 0xca8);

-      in_stack_00000178 = *(undefined4 *)(in_stack_00000050 + 0xcac);

-      in_stack_0000017c = *(undefined4 *)(in_stack_00000050 + 0xcb0);

-      in_stack_00000180 = *(undefined4 *)(in_stack_00000050 + 0xcb4);

-      in_stack_00000174 = uVar3;

-    }

-    WDiagNotifyEvent(uVar3,&stack0x00000160);

-  }

-  if (in_stack_00000050 != (_WLAN_INTERFACE_CONTEXT *)0x0) {

-    HtDereferenceHandleWithTag(g_hHandleTable);

-  }

-  if (((WPP_GLOBAL_Control != unaff_R12) && (3 < (byte)WPP_GLOBAL_Control[0x69])) &&

-     ((WPP_GLOBAL_Control[0x6c] & unaff_DIL) != 0)) {

-    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x61);

-  }

-  return unaff_ESI;

+  uVar17 = (undefined4)((ulonglong)in_stack_fffffffffffffcc8 >> 0x20);

+  uVar15 = (undefined4)((ulonglong)in_stack_fffffffffffffcd8 >> 0x20);

+  uVar26 = (undefined4)((ulonglong)in_stack_fffffffffffffce8 >> 0x20);

+  uVar34 = (undefined4)((ulonglong)in_stack_fffffffffffffcf8 >> 0x20);

+  p_Var22 = (_INTFLOGINITTELEMETRY_LOCAL_DATA *)0x0;

+  local_108 = 0;

+  uStack_104 = 0;

+  local_118 = 0;

+  uStack_114 = 0;

+  uStack_110 = 0;

+  uStack_10c = 0;

+  local_res10 = param_2;

+  if (param_1 == (_WLAN_INTERFACE_CONTEXT *)0x0) {

+    uVar13 = 0x57;

+    _Dst = p_Var22;

+    goto LAB_0;

+  }

+  _Dst = (_INTFLOGINITTELEMETRY_LOCAL_DATA *)AllocWLMem(0xc48);

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

+LAB_1:

+    uVar13 = 0xe;

+  }

+  else {

+    memset(_Dst,0,0xc48);

+    p_Var31 = _Dst + 800;

+    p_Var29 = _Dst + 0x640;

+    p_Var27 = _Dst + 0x4b0;

+    uVar33 = CONCAT44(uVar34,200);

+    uVar28 = CONCAT44(uVar26,200);

+    uVar23 = CONCAT44(uVar15,200);

+    uVar20 = CONCAT44(uVar17,200);

+    uVar13 = WDiagQueryDeviceInfo

+                       ((_GUID *)(param_1 + 8),(ushort *)_Dst,200,(ushort *)(_Dst + 400),200,

+                        (ushort *)p_Var27,200,(ushort *)p_Var29,200,(ushort *)p_Var31,200,

+                        (_SYSTEMTIME *)(_Dst + 0xb68),(ushort *)(_Dst + 2000),0x104,

+                        (ushort *)(_Dst + 0x9d8),200);

+    uVar25 = 1;

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

+        (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x27c,

+               &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,0);

+    }

+    lVar8 = *(longlong *)(param_1 + 0x308);

+    if ((lVar8 != 0) && (*(int *)(lVar8 + 4) != 0)) {

+      do {

+        uVar17 = (undefined4)((ulonglong)uVar20 >> 0x20);

+        uVar15 = (undefined4)((ulonglong)p_Var27 >> 0x20);

+        uVar26 = (undefined4)((ulonglong)uVar23 >> 0x20);

+        uVar34 = (undefined4)((ulonglong)uVar28 >> 0x20);

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

+        uVar35 = (undefined4)((ulonglong)uVar33 >> 0x20);

+        lVar18 = (longlong)p_Var22 * 0x2c;

+        uVar21 = *(uint *)(lVar18 + 0xc + lVar8);

+        if (*(uint *)(_Dst + 0xc18) < uVar21) {

+          *(uint *)(_Dst + 0xc18) = uVar21;

+        }

+        iVar1 = *(int *)(lVar18 + 0xc + lVar8);

+        if (iVar1 == 0x960) {

+          pwVar7 = (wchar_t *)AllocWLMem(0x42);

+          uVar30 = (undefined4)((ulonglong)p_Var29 >> 0x20);

+          *(wchar_t **)(_Dst + 0xc28) = pwVar7;

+LAB_2:

+          if (pwVar7 == (wchar_t *)0x0) {

+            uVar13 = 0xe;

+            goto LAB_0;

+          }

+          uVar13 = CreatePhyTypeMask(*(ulong *)(lVar18 + 0x20 + lVar8),

+                                     (ulong *)((ulonglong)*(uint *)(lVar18 + 0x1c + lVar8) +

+                                              *(longlong *)(param_1 + 0x308)));

+          uVar14 = 0;

+          puVar12 = (uint *)((ulonglong)*(uint *)(lVar18 + 0x2c + lVar8) +

+                            *(longlong *)(param_1 + 0x308));

+          uVar21 = *(uint *)(lVar18 + 0x30 + lVar8);

+          if (uVar21 != 0) {

+            uVar16 = (ulonglong)uVar21;

+            do {

+              uVar2 = *puVar12;

+              puVar12 = puVar12 + 1;

+              uVar14 = uVar14 | uVar2 / 0x14;

+              uVar16 = uVar16 - 1;

+            } while (uVar16 != 0);

+          }

+          uVar33 = CONCAT44(uVar35,uVar13);

+          p_Var31 = (_INTFLOGINITTELEMETRY_LOCAL_DATA *)

+                    CONCAT44(uVar32,*(undefined4 *)(lVar18 + 0x20 + lVar8));

+          uVar28 = CONCAT44(uVar34,uVar14);

+          p_Var29 = (_INTFLOGINITTELEMETRY_LOCAL_DATA *)CONCAT44(uVar30,uVar21);

+          uVar23 = CONCAT44(uVar26,*(undefined4 *)(lVar18 + 0x28 + lVar8));

+          p_Var27 = (_INTFLOGINITTELEMETRY_LOCAL_DATA *)

+                    CONCAT44(uVar15,*(undefined4 *)(lVar18 + 0xc + lVar8));

+          uVar20 = CONCAT44(uVar17,*(undefined4 *)(lVar18 + 0x18 + lVar8));

+          swprintf_s(pwVar7,0x21,L"%d,%d,%d,%d,%d,%d,%d,%d",(ulonglong)*(uint *)(lVar18 + 8 + lVar8)

+                     ,uVar20,p_Var27,uVar23,p_Var29,uVar28,p_Var31,uVar33);

+        }

+        else {

+          if (iVar1 == 5000) {

+            pwVar7 = (wchar_t *)AllocWLMem(0x42);

+            uVar30 = (undefined4)((ulonglong)p_Var29 >> 0x20);

+            *(wchar_t **)(_Dst + 0xc20) = pwVar7;

+            goto LAB_2;

+          }

+          if (iVar1 == 60000) {

+            pwVar7 = (wchar_t *)AllocWLMem(0x42);

+            uVar30 = (undefined4)((ulonglong)p_Var29 >> 0x20);

+            *(wchar_t **)(_Dst + 0xc30) = pwVar7;

+            goto LAB_2;

+          }

+          if (iVar1 == 6000) {

+            pwVar7 = (wchar_t *)AllocWLMem(0x42);

+            uVar30 = (undefined4)((ulonglong)p_Var29 >> 0x20);

+            *(wchar_t **)(_Dst + 0xc38) = pwVar7;

+            goto LAB_2;

+          }

+        }

+        lVar8 = *(longlong *)(param_1 + 0x308);

+        uVar21 = (int)p_Var22 + 1;

+        p_Var22 = (_INTFLOGINITTELEMETRY_LOCAL_DATA *)(ulonglong)uVar21;

+      } while (uVar21 < *(uint *)(lVar8 + 4));

+    }

+    uVar17 = (undefined4)((ulonglong)p_Var27 >> 0x20);

+    uVar15 = (undefined4)((ulonglong)uVar23 >> 0x20);

+    uVar16 = 0;

+    if (*(longlong *)(param_1 + 0x310) != 0) {

+      lVar8 = AllocWLMem((ulonglong)(*(int *)(*(longlong *)(param_1 + 0x310) + 4) * 0x14 + 1) * 2);

+      uVar17 = (undefined4)((ulonglong)p_Var27 >> 0x20);

+      uVar15 = (undefined4)((ulonglong)uVar23 >> 0x20);

+      *(longlong *)(_Dst + 0xbf8) = lVar8;

+      if (lVar8 == 0) goto LAB_1;

+      lVar8 = *(longlong *)(param_1 + 0x310);

+      if (*(int *)(lVar8 + 4) != 0) {

+        uVar19 = (ulonglong)(*(int *)(lVar8 + 4) * 0x14 + 1);

+        do {

+          uVar15 = (undefined4)((ulonglong)uVar20 >> 0x20);

+          uVar26 = (undefined4)((ulonglong)p_Var27 >> 0x20);

+          uVar34 = (undefined4)((ulonglong)uVar23 >> 0x20);

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

+          local_res8[0] = *(_WLAN_OPCODE_VALUE_TYPE *)(lVar8 + 0x18 + uVar16 * 0x18);

+          uVar17 = *(undefined4 *)(lVar8 + 0x1c + uVar16 * 0x18);

+          local_res18[0] = *(uint *)(lVar8 + 0x14 + uVar16 * 0x18);

+          local_res20[0] = *(undefined4 *)(lVar8 + 0xc + uVar16 * 0x18);

+          local_1a8 = *(uint *)(lVar8 + 0x10 + uVar16 * 0x18);

+          if (*(wchar_t **)(_Dst + 0xbf8) == (wchar_t *)0x0) {

+            sVar9 = 0;

+          }

+          else {

+            sVar9 = wcsnlen(*(wchar_t **)(_Dst + 0xbf8),uVar19);

+          }

+          if (*(wchar_t **)(_Dst + 0xbf8) == (wchar_t *)0x0) {

+            sVar10 = 0;

+          }

+          else {

+            sVar10 = wcsnlen(*(wchar_t **)(_Dst + 0xbf8),uVar19);

+          }

+          p_Var29 = (_INTFLOGINITTELEMETRY_LOCAL_DATA *)CONCAT44(uVar32,uVar17);

+          uVar23 = CONCAT44(uVar34,local_res8[0]);

+          p_Var27 = (_INTFLOGINITTELEMETRY_LOCAL_DATA *)CONCAT44(uVar26,local_res18[0]);

+          uVar20 = CONCAT44(uVar15,local_res20[0]);

+          swprintf_s((wchar_t *)(*(longlong *)(_Dst + 0xbf8) + sVar10 * 2),uVar19 - sVar9,

+                     L"%d,%d,%d,%d,%d\t",(ulonglong)local_1a8,uVar20,p_Var27,uVar23,p_Var29);

+          uVar17 = (undefined4)((ulonglong)p_Var27 >> 0x20);

+          uVar15 = (undefined4)((ulonglong)uVar23 >> 0x20);

+          lVar8 = *(longlong *)(param_1 + 0x310);

+          uVar21 = (int)uVar16 + 1;

+          uVar16 = (ulonglong)uVar21;

+        } while (uVar21 < *(uint *)(lVar8 + 4));

+      }

+    }

+    uVar16 = 0;

+    if (*(longlong *)(param_1 + 0x300) != 0) {

+      bVar5 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_61210319>::__private_IsEnabled

+                        ((FeatureImpl<__WilFeatureTraits_Feature_61210319> *)

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

+                          ::__l2::impl);

+      if (bVar5) {

+        lVar8 = *(longlong *)(param_1 + 0x300);

+        uVar28 = CONCAT44(uVar15,(uint)*(byte *)(lVar8 + 0x104));

+        uVar23 = CONCAT44(uVar17,(uint)*(byte *)(lVar8 + 0x105));

+        uVar20 = CONCAT44((int)((ulonglong)uVar20 >> 0x20),(uint)*(byte *)(lVar8 + 0x106));

+        swprintf_s((wchar_t *)(_Dst + 0xb78),0x10,L"%d.%d.%d.%d",(ulonglong)*(byte *)(lVar8 + 0x107)

+                   ,uVar20,uVar23,uVar28,p_Var29);

+        uVar23 = CONCAT44((int)((ulonglong)uVar23 >> 0x20),(uint)*(byte *)(lVar8 + 0x101));

+        uVar20 = CONCAT44((int)((ulonglong)uVar20 >> 0x20),(uint)*(byte *)(lVar8 + 0x102));

+        swprintf_s((wchar_t *)(_Dst + 0xb98),0x10,L"%d.%d.%d.%d",(ulonglong)*(byte *)(lVar8 + 0x103)

+                   ,uVar20,uVar23,

+                   CONCAT44((int)((ulonglong)uVar28 >> 0x20),(uint)*(byte *)(lVar8 + 0x100)));

+        uVar17 = (undefined4)((ulonglong)uVar23 >> 0x20);

+        uVar20 = CONCAT44((int)((ulonglong)uVar20 >> 0x20),(uint)*(ushort *)(lVar8 + 0x1d8));

+        swprintf_s((wchar_t *)(_Dst + 3000),0x10,L"%d.%d",*(ulonglong *)(lVar8 + 0x1d8) >> 0x10,

+                   uVar20);

+        uVar20 = CONCAT44((int)((ulonglong)uVar20 >> 0x20),(uint)*(ushort *)(lVar8 + 0x1e0));

+        swprintf_s((wchar_t *)(_Dst + 0xbd8),0x10,L"%d.%d",*(ulonglong *)(lVar8 + 0x1e0) >> 0x10,

+                   uVar20);

+        uVar13 = GetInterfaceInformationFromAdapterCapabilities

+                           (*(_DOT11_ADAPTER_CAPABILITIES **)(param_1 + 0x300),_Dst);

+      }

+      else {

+        bVar5 = wil::details::FeatureImpl<__WilFeatureTraits_Feature_53299205>::__private_IsEnabled

+                          ((FeatureImpl<__WilFeatureTraits_Feature_53299205> *)

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

+                            ::__l2::impl);

+        p_Var3 = *(_DOT11_ADAPTER_CAPABILITIES **)(param_1 + 0x300);

+        if (bVar5) {

+          uVar28 = CONCAT44(uVar15,(uint)(byte)p_Var3[0x104]);

+          uVar23 = CONCAT44(uVar17,(uint)(byte)p_Var3[0x105]);

+          uVar20 = CONCAT44((int)((ulonglong)uVar20 >> 0x20),(uint)(byte)p_Var3[0x106]);

+          swprintf_s((wchar_t *)(_Dst + 0xb78),0x10,L"%d.%d.%d.%d",(ulonglong)(byte)p_Var3[0x107],

+                     uVar20,uVar23,uVar28);

+          uVar23 = CONCAT44((int)((ulonglong)uVar23 >> 0x20),(uint)(byte)p_Var3[0x101]);

+          uVar20 = CONCAT44((int)((ulonglong)uVar20 >> 0x20),(uint)(byte)p_Var3[0x102]);

+          swprintf_s((wchar_t *)(_Dst + 0xb98),0x10,L"%d.%d.%d.%d",(ulonglong)(byte)p_Var3[0x103],

+                     uVar20,uVar23,

+                     CONCAT44((int)((ulonglong)uVar28 >> 0x20),(uint)(byte)p_Var3[0x100]));

+          uVar17 = (undefined4)((ulonglong)uVar23 >> 0x20);

+          uVar20 = CONCAT44((int)((ulonglong)uVar20 >> 0x20),(uint)*(ushort *)(p_Var3 + 0x1d8));

+          swprintf_s((wchar_t *)(_Dst + 3000),0x10,L"%d.%d",*(ulonglong *)(p_Var3 + 0x1d8) >> 0x10,

+                     uVar20);

+          uVar20 = CONCAT44((int)((ulonglong)uVar20 >> 0x20),(uint)*(ushort *)(p_Var3 + 0x1e0));

+          swprintf_s((wchar_t *)(_Dst + 0xbd8),0x10,L"%d.%d",*(ulonglong *)(p_Var3 + 0x1e0) >> 0x10,

+                     uVar20);

+          uVar13 = CDRollback_CrossAkm_GetInterfaceInformationFromAdapterCapabilities

+                             (*(_DOT11_ADAPTER_CAPABILITIES **)(param_1 + 0x300),_Dst);

+        }

+        else {

+          uVar13 = CDRollback_MRsnO_GetInterfaceInformationFromAdapterCapabilities(p_Var3,_Dst);

+        }

+      }

+      if (uVar13 != 0) goto LAB_0;

+    }

+    p_Var22 = _Dst + 0xc10;

+    IntfPrivateQuerySystemCapabilities

+              (local_res18,(_DOT11_SYSTEM_CAPABILITIES **)p_Var22,local_res8);

+    uVar15 = (undefined4)((ulonglong)uVar20 >> 0x20);

+    if (*(_DOT11_SYSTEM_CAPABILITIES **)p_Var22 != (_DOT11_SYSTEM_CAPABILITIES *)0x0) {

+      pwVar7 = (wchar_t *)AllocWLMem(0x20);

+      *(wchar_t **)(_Dst + 0xc08) = pwVar7;

+      if (pwVar7 == (wchar_t *)0x0) goto LAB_1;

+      p_Var4 = *(_DOT11_SYSTEM_CAPABILITIES **)p_Var22;

+      uVar20 = CONCAT44(uVar15,*(undefined4 *)(p_Var4 + 4));

+      swprintf_s(pwVar7,0x10,L"%d,%d,%d",(ulonglong)*(uint *)p_Var4,uVar20,

+                 CONCAT44(uVar17,*(undefined4 *)(p_Var4 + 8)));

+    }

+    pwVar7 = (wchar_t *)&local_180;

+    local_180 = (uint *)0x0;

+    uVar13 = (**(code **)(*(longlong *)(param_1 + 0x2b8) + 0x40))

+                       (*(undefined8 *)(param_1 + 0x2c0),1);

+    if ((uVar13 == 0) && (local_180 != (uint *)0x0)) {

+      uVar19 = (ulonglong)(*local_180 * 0x28 + 2);

+      lVar8 = AllocWLMem();

+      *(longlong *)(_Dst + 0xc40) = lVar8;

+      if (lVar8 == 0) goto LAB_1;

+      if (*local_180 != 0) {

+        do {

+          uVar17 = (undefined4)((ulonglong)uVar20 >> 0x20);

+          sVar9 = 0;

+          local_res8[0] = local_180[uVar16 * 2 + 2];

+          local_res18[0] = local_180[uVar16 * 2 + 1];

+          if (*(wchar_t **)(_Dst + 0xc40) != (wchar_t *)0x0) {

+            sVar9 = wcsnlen(*(wchar_t **)(_Dst + 0xc40),uVar19);

+          }

+          if (*(wchar_t **)(_Dst + 0xc40) == (wchar_t *)0x0) {

+            sVar10 = 0;

+          }

+          else {

+            sVar10 = wcsnlen(*(wchar_t **)(_Dst + 0xc40),uVar19);

+          }

+          pwVar7 = L"%x,0x%x\t";

+          uVar20 = CONCAT44(uVar17,local_res8[0]);

+          swprintf_s((wchar_t *)(*(longlong *)(_Dst + 0xc40) + sVar10 * 2),uVar19 - sVar9,

+                     L"%x,0x%x\t",(ulonglong)local_res18[0],uVar20);

+          uVar21 = (int)uVar16 + 1;

+          uVar16 = (ulonglong)uVar21;

+        } while (uVar21 < *local_180);

+      }

+      FreeWLMem();

+    }

+    uVar20 = 0;

+    p_Var11 = WlansvcLogger::Provider();

+    uVar17._0_1_ = '\0';

+    uVar17._1_1_ = '\0';

+    uVar17._2_1_ = '\0';

+    uVar17._3_1_ = '\0';

+    if ((5 < *(uint *)p_Var11) && (cVar6 = _tlgKeywordOn(p_Var11,0x400000000000), cVar6 != '\0')) {

+      iVar1 = *(int *)(param_1 + 0x16ec);

+      cVar6 = '\0';

+      if (iVar1 == 1) {

+        uVar25 = 0;

+      }

+      else if (iVar1 != 2) {

+        if (iVar1 == 3) {

+          uVar25 = 2;

+        }

+        else if (iVar1 == 4) {

+          uVar25 = 3;

+        }

+        else {

+          uVar25 = 0xff;

+        }

+      }

+      local_130 = *(char **)(param_1 + 0x300);

+      local_res18[0] = CONCAT31(local_res18[0]._1_3_,uVar25);

+      if (local_130 == (char *)0x0) {

+        local_1a4 = 0;

+        local_178 = (_tlgWrapperByVal<4>  [4])uVar17;

+      }

+      else {

+        local_1a4 = *(undefined4 *)(local_130 + 0x1fc);

+        local_178 = (_tlgWrapperByVal<4>  [4])*(undefined4 *)(local_130 + 0x200);

+      }

+      local_174[0] = (_tlgWrapperByVal<4>)(uchar)DAT_3;

+      local_174[1] = (_tlgWrapperByVal<4>)DAT_3._1_1_;

+      local_174[2] = (_tlgWrapperByVal<4>)DAT_3._2_1_;

+      local_174[3] = (_tlgWrapperByVal<4>)DAT_3._3_1_;

+      if (local_130 != (char *)0x0) {

+        cVar6 = local_130[0x1f0];

+      }

+      local_res20[0] = CONCAT31(local_res20[0]._1_3_,cVar6);

+      local_170 = *(undefined4 *)(param_1 + 0x18);

+      if (local_130 == (char *)0x0) {

+        local_100 = (_INTFLOGINITTELEMETRY_LOCAL_DATA *)0x180262128;

+        local_138 = (_INTFLOGINITTELEMETRY_LOCAL_DATA *)0x180262128;

+      }

+      else {

+        local_138 = _Dst + 0xbd8;

+        local_100 = _Dst + 3000;

+      }

+      local_f8 = L"";

+      if (*(wchar_t **)(_Dst + 0xc38) != (wchar_t *)0x0) {

+        local_f8 = *(wchar_t **)(_Dst + 0xc38);

+      }

+      local_f0 = L"";

+      if (*(wchar_t **)(_Dst + 0xc40) != (wchar_t *)0x0) {

+        local_f0 = *(wchar_t **)(_Dst + 0xc40);

+      }

+      local_e8 = _Dst + 0x9d8;

+      local_e0 = L"";

+      if (*(wchar_t **)(_Dst + 0xc08) != (wchar_t *)0x0) {

+        local_e0 = *(wchar_t **)(_Dst + 0xc08);

+      }

+      local_d8 = L"";

+      if (*(wchar_t **)(_Dst + 0xc00) != (wchar_t *)0x0) {

+        local_d8 = *(wchar_t **)(_Dst + 0xc00);

+      }

+      local_d0 = L"";

+      if (*(wchar_t **)(_Dst + 0xbf8) != (wchar_t *)0x0) {

+        local_d0 = *(wchar_t **)(_Dst + 0xbf8);

+      }

+      local_c8 = L"";

+      if (*(wchar_t **)(_Dst + 0xc30) != (wchar_t *)0x0) {

+        local_c8 = *(wchar_t **)(_Dst + 0xc30);

+      }

+      local_c0 = L"";

+      if (*(wchar_t **)(_Dst + 0xc28) != (wchar_t *)0x0) {

+        local_c0 = *(wchar_t **)(_Dst + 0xc28);

+      }

+      local_b8 = L"";

+      if (*(wchar_t **)(_Dst + 0xc20) != (wchar_t *)0x0) {

+        local_b8 = *(wchar_t **)(_Dst + 0xc20);

+      }

+      local_16c = (_tlgWrapperByVal<4>  [4])uVar17;

+      if (*(longlong *)(param_1 + 0x308) != 0) {

+        local_16c = (_tlgWrapperByVal<4>  [4])*(undefined4 *)(*(longlong *)(param_1 + 0x308) + 4);

+      }

+      if (local_130 == (char *)0x0) {

+        local_res8[0] = (uint)(uint3)local_res8[0]._1_3_ << 8;

+        local_130 = "";

+        local_128 = (_INTFLOGINITTELEMETRY_LOCAL_DATA *)0x180262130;

+        local_120 = (_INTFLOGINITTELEMETRY_LOCAL_DATA *)0x180262130;

+        local_1a0 = 0;

+        local_19c = 0;

+        local_198 = 0;

+        local_194 = 0;

+        local_190 = 0;

+        local_18c = 0;

+        local_188[0] = 0;

+        local_1a8 = 0;

+        local_168 = (_tlgWrapperByVal<4>  [4])uVar17;

+      }

+      else {

+        local_res8[0] = CONCAT31(local_res8[0]._1_3_,local_130[0x194]);

+        local_1a0 = *(undefined4 *)(local_130 + 0x144);

+        local_19c = *(undefined4 *)(local_130 + 0x140);

+        local_198 = *(undefined4 *)(local_130 + 0x13c);

+        local_194 = *(undefined4 *)(local_130 + 0x120);

+        local_190 = *(undefined4 *)(local_130 + 0x11c);

+        local_18c = *(undefined4 *)(local_130 + 0x118);

+        local_188[0] = *(undefined4 *)(local_130 + 0x108);

+        local_128 = _Dst + 0xb98;

+        local_120 = _Dst + 0xb78;

+        local_1a8 = *(uint *)(local_130 + 0x100);

+        local_168 = (_tlgWrapperByVal<4>  [4])*(undefined4 *)(local_130 + 0x104);

+      }

+      local_78 = param_1 + 8;

+      local_164 = *(undefined4 *)(param_1 + 0xe8);

+      local_160 = *(undefined4 *)(param_1 + 0xc0);

+      local_15c = *(undefined4 *)(param_1 + 0xd0);

+      local_158 = *(undefined4 *)(param_1 + 0xcc);

+      local_140[0] = *(undefined4 *)(_Dst + 0xc18);

+      local_154 = *(undefined4 *)(param_1 + 0x5d0);

+      local_150 = (uint)(byte)param_1[0xcfd];

+      local_14c = (uint)(byte)param_1[0xcfc];

+      local_148 = (uint)local_res10;

+      local_144 = *(undefined4 *)(param_1 + 0xca0);

+      local_b0 = _Dst + 2000;

+      local_a8 = _Dst + 0xb68;

+      local_a0 = _Dst + 0x640;

+      local_98 = _Dst + 0x4b0;

+      local_90 = _Dst + 400;

+      local_80 = *(undefined8 *)(param_1 + 0x80);

+      local_88 = _Dst;

+      _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<_tlgWrapperByRef<16>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapperByRef<16>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<char>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<1>,_tlgWrapperByVal<4>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapperByVal<1>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<1>_>

+                (p_Var11,&DAT_4,(_GUID *)pwVar7,(_GUID *)p_Var11,

+                 (_tlgWrapperByRef<16> *)&local_78,(_tlgWrapSz<unsigned_short> *)&local_80,

+                 (_tlgWrapSz<unsigned_short> *)&local_88,(_tlgWrapSz<unsigned_short> *)&local_90,

+                 (_tlgWrapSz<unsigned_short> *)&local_98,(_tlgWrapSz<unsigned_short> *)&local_a0,

+                 (_tlgWrapperByRef<16> *)&local_a8,(_tlgWrapSz<unsigned_short> *)&local_b0,

+                 (_tlgWrapperByVal<4> *)&local_144,(_tlgWrapperByVal<4> *)&local_148,

+                 (_tlgWrapperByVal<4> *)&local_14c,(_tlgWrapperByVal<4> *)&local_150,

+                 (_tlgWrapperByVal<4> *)&local_154,(_tlgWrapperByVal<4> *)local_140,

+                 (_tlgWrapperByVal<4> *)&local_158,(_tlgWrapperByVal<4> *)&local_15c,

+                 (_tlgWrapperByVal<4> *)&local_160,(_tlgWrapperByVal<4> *)&local_164,local_168,

+                 (_tlgWrapperByVal<4> *)&local_1a8,(_tlgWrapSz<unsigned_short> *)&local_120,

+                 (_tlgWrapSz<unsigned_short> *)&local_128,(_tlgWrapSz<char> *)&local_130,

+                 (_tlgWrapperByVal<4> *)local_188,(_tlgWrapperByVal<4> *)&local_18c,

+                 (_tlgWrapperByVal<4> *)&local_190,(_tlgWrapperByVal<4> *)&local_194,

+                 (_tlgWrapperByVal<4> *)&local_198,(_tlgWrapperByVal<4> *)&local_19c,

+                 (_tlgWrapperByVal<4> *)&local_1a0,(_tlgWrapperByVal<1> *)local_res8,local_16c,

+                 (_tlgWrapSz<unsigned_short> *)&local_b8,(_tlgWrapSz<unsigned_short> *)&local_c0,

+                 (_tlgWrapSz<unsigned_short> *)&local_c8,(_tlgWrapSz<unsigned_short> *)&local_d0,

+                 (_tlgWrapSz<unsigned_short> *)&local_d8,(_tlgWrapSz<unsigned_short> *)&local_e0,

+                 (_tlgWrapSz<unsigned_short> *)&local_e8,(_tlgWrapSz<unsigned_short> *)&local_f0,

+                 (_tlgWrapSz<unsigned_short> *)&local_f8,(_tlgWrapSz<unsigned_short> *)&local_100,

+                 (_tlgWrapSz<unsigned_short> *)&local_138,(_tlgWrapperByVal<4> *)&local_170,

+                 (_tlgWrapperByVal<1> *)local_res20,local_174,local_178,

+                 (_tlgWrapperByVal<4> *)&local_1a4,(_tlgWrapperByVal<1> *)local_res18);

+    }

+    local_118 = 0;

+    uStack_104 = 0;

+    pwVar7 = L"";

+    if (*(wchar_t **)(_Dst + 0xc40) != (wchar_t *)0x0) {

+      pwVar7 = *(wchar_t **)(_Dst + 0xc40);

+    }

+    uStack_114 = (undefined4)*(undefined8 *)(param_1 + 8);

+    uStack_110 = (undefined4)((ulonglong)*(undefined8 *)(param_1 + 8) >> 0x20);

+    uStack_10c = (undefined4)*(undefined8 *)(param_1 + 0x10);

+    local_108 = (uint)((ulonglong)*(undefined8 *)(param_1 + 0x10) >> 0x20);

+    pwVar24 = L"";

+    if (*(wchar_t **)(_Dst + 0xc08) != (wchar_t *)0x0) {

+      pwVar24 = *(wchar_t **)(_Dst + 0xc08);

+    }

+    uVar15 = uVar17;

+    if (*(longlong *)(param_1 + 0x308) != 0) {

+      uVar15 = *(undefined4 *)(*(longlong *)(param_1 + 0x308) + 4);

+    }

+    lVar8 = *(longlong *)(param_1 + 0x300);

+    uVar23 = uVar20;

+    uVar26 = uVar17;

+    if (lVar8 != 0) {

+      uVar17 = *(undefined4 *)(lVar8 + 0x104);

+      uVar20 = *(undefined8 *)(lVar8 + 0x1d8);

+      uVar23 = *(undefined8 *)(lVar8 + 0x1e0);

+      uVar26 = *(undefined4 *)(lVar8 + 0x100);

+    }

+    local_78 = *(_WLAN_INTERFACE_CONTEXT **)(_Dst + 0xb68);

+    uStack_70 = *(undefined8 *)(_Dst + 0xb70);

+    local_58 = (ulonglong)local_108;

+    local_68 = 0;

+    uStack_64 = uStack_114;

+    uStack_60 = uStack_110;

+    uStack_5c = uStack_10c;

+    NetworkingTriageScenarioGetConnectedWiFiInitializingInterfaceEvent

+              (&local_68,*(undefined8 *)(param_1 + 0x80),_Dst,_Dst + 400,_Dst + 0x4b0,_Dst + 0x640,

+               &local_78,_Dst + 2000,uVar17,uVar26,uVar20,uVar23,uVar15,pwVar24,pwVar7,

+               param_1[0xcfc],param_1[0xcfd]);

+  }

+LAB_0:

+  if (*(longlong *)(_Dst + 0xbf8) != 0) {

+    FreeWLMem();

+    *(undefined8 *)(_Dst + 0xbf8) = 0;

+  }

+  if (*(longlong *)(_Dst + 0xc00) != 0) {

+    FreeWLMem();

+    *(undefined8 *)(_Dst + 0xc00) = 0;

+  }

+  if (*(longlong *)(_Dst + 0xc08) != 0) {

+    FreeWLMem();

+    *(undefined8 *)(_Dst + 0xc08) = 0;

+  }

+  if (*(longlong *)(_Dst + 0xc10) != 0) {

+    FreeWLMem();

+    *(undefined8 *)(_Dst + 0xc10) = 0;

+  }

+  if (*(longlong *)(_Dst + 0xc20) != 0) {

+    FreeWLMem();

+    *(undefined8 *)(_Dst + 0xc20) = 0;

+  }

+  if (*(longlong *)(_Dst + 0xc28) != 0) {

+    FreeWLMem();

+    *(undefined8 *)(_Dst + 0xc28) = 0;

+  }

+  if (*(longlong *)(_Dst + 0xc30) != 0) {

+    FreeWLMem();

+    *(undefined8 *)(_Dst + 0xc30) = 0;

+  }

+  if (*(longlong *)(_Dst + 0xc38) != 0) {

+    FreeWLMem();

+    *(undefined8 *)(_Dst + 0xc38) = 0;

+  }

+  if (*(longlong *)(_Dst + 0xc40) != 0) {

+    FreeWLMem();

+    *(undefined8 *)(_Dst + 0xc40) = 0;

+  }

+  FreeWLMem(_Dst);

+  return uVar13;

 }
```

## `RpcConnectEx`  (modified)

```diff
--- RpcConnectEx
+++ RpcConnectEx
@@ -1,11 +1,70 @@
 

-void RpcConnectEx(void)

+ulong RpcConnectEx(longlong param_1,longlong param_2,undefined *param_3,ulong param_4,

+                  undefined8 param_5)

 

 {

-  code *pcVar1;

+  int *piVar1;

+  ulong uVar2;

+  int iVar3;

+  ulong uVar4;

+  _WLAN_RAW_DATA_LIST *p_Var5;

+  undefined *puVar6;

+  ulong local_res8 [2];

+  void *local_res10;

   

-  pcVar1 = (code *)swi(3);

-  (*pcVar1)();

-  return;

+  p_Var5 = (_WLAN_RAW_DATA_LIST *)0x0;

+  local_res8[0] = 0;

+  local_res10 = (HANDLE)0x0;

+  puVar6 = param_3;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    puVar6 = &WPP_791618f6e4f933247a011d60507f9013_Traceguids;

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x7c);

+  }

+  uVar4 = (ulong)puVar6;

+  if ((param_2 == 0) || (param_3 == (undefined *)0x0)) {

+LAB_0:

+    uVar2 = 0x57;

+  }

+  else {

+    uVar2 = LocalQueryRpcClientToken(&local_res10);

+    if (uVar2 != 0) goto LAB_1;

+    piVar1 = (int *)CONCAT44(param_5._4_4_,(ulong)param_5);

+    if (piVar1 != (int *)0x0) {

+      if (*piVar1 != 1) {

+        MicrosoftTelemetryAssertTriggeredNoArgs();

+      }

+      if (piVar1[2] == 0) {

+        p_Var5 = (_WLAN_RAW_DATA_LIST *)(piVar1 + 3);

+        iVar3 = WlanIsValidIEDataList(*(ulong *)p_Var5,p_Var5,uVar4,param_4);

+        if (iVar3 == 0) goto LAB_0;

+      }

+    }

+    param_5._0_4_ = LocalGetClientSessionId(local_res8);

+    uVar2 = (ulong)param_5;

+    if ((ulong)param_5 == 0) {

+      uVar4 = WimGetManuallyConnectablePortTypesBitMask(false);

+      iVar3 = AcmIsAPIAllowed(param_2,0x40,uVar4,&param_5);

+      uVar2 = (ulong)param_5;

+      if (iVar3 != 0) {

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

+          McTemplateU0uq_EventWriteTransfer();

+        }

+        uVar4 = WimGetManuallyConnectablePortTypesBitMask(false);

+        uVar2 = AcmConnectEx(*(undefined4 *)(param_1 + 0x180),param_2,uVar4,param_3,local_res8[0],0,

+                             local_res10,p_Var5);

+      }

+    }

+  }

+LAB_1:

+  if (local_res10 != (HANDLE)0x0) {

+    CloseHandle(local_res10);

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x7d,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+  }

+  return uVar2;

 }
```

## `RpcWfdSvcLowPrivConfigureSession`  (modified)

```diff
--- RpcWfdSvcLowPrivConfigureSession
+++ RpcWfdSvcLowPrivConfigureSession
@@ -1,83 +1,58 @@
 

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

-

-void RpcWfdSvcLowPrivConfigureSession(void)

+ulong RpcWfdSvcLowPrivConfigureSession

+                (void *param_1,__uint64 param_2,_WFDSVC_CONFIG_OPCODE param_3,ulong param_4,

+                uchar *param_5)

 

 {

-  int in_EAX;

-  basic_string<char,struct_std::char_traits<char>,class_std::allocator<char>_> *pbVar1;

-  char *pcVar2;

-  uint unaff_EBX;

-  uint unaff_ESI;

-  undefined8 *unaff_RDI;

-  char cVar3;

-  basic_string<char,std::char_traits<char>,std::allocator<char>_> bStack0000000000000030;

-  undefined7 uStack0000000000000031;

-  undefined8 in_stack_00000038;

-  longlong in_stack_00000040;

-  undefined8 in_stack_00000048;

-  longlong in_stack_00000060;

+  ulong uVar1;

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

+  *this;

+  longlong *plVar2;

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

+  local_res8 [8];

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

+  local_28 [16];

   

-  do {

-    if (in_EAX == 2) {

-      pcVar2 = "VirtualSta";

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x314,

+            &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+  }

+  this = (tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

+          *)tip2::

+            start<tip2::tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>_>

+                      ();

+  plVar2 = (longlong *)

+           tip2::

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

+           ::operator->(this);

+  *(undefined1 *)(*plVar2 + 0x110) = 9;

+  tip2::

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

+  ::

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

+            (local_res8);

+  wil::

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

+  ::

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

+            (local_28);

+  if ((param_1 == (void *)0x0) || (param_2 == 0)) {

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

+       ((WPP_GLOBAL_Control[0x69] != '\0' && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

+      WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x315,

+               &WPP_791618f6e4f933247a011d60507f9013_Traceguids,param_1);

     }

-    else if (in_EAX == 6) {

-      pcVar2 = "WfdDevice";

-    }

-    else if (in_EAX == 0xe) {

-      pcVar2 = "WfdRole";

-    }

-    else if (in_EAX == 0x1e) {

-      pcVar2 = "SecondarySta";

-    }

-    else {

-      pcVar2 = "ToStringFailed";

-    }

-    while( true ) {

-      while( true ) {

-        cVar3 = (char)&stack0x00000050;

-        pbVar1 = (basic_string<char,struct_std::char_traits<char>,class_std::allocator<char>_> *)

-                 std::operator+<char,std::char_traits<char>,std::allocator<char>_>

-                           (&stack0x00000070,

-                            (basic_string<char,struct_std::char_traits<char>,class_std::allocator<char>_>

-                             *)pcVar2);

-        std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::append

-                  (&stack0x00000030,pbVar1);

-        std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::

-        ~basic_string<char,std::char_traits<char>,std::allocator<char>_>

-                  ((basic_string<char,std::char_traits<char>,std::allocator<char>_> *)

-                   &stack0x00000070);

-        unaff_ESI = unaff_ESI & ~unaff_EBX;

-        if (unaff_ESI == 0) {

-          if (in_stack_00000040 != 0) {

-            std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::resize

-                      (&stack0x00000030,in_stack_00000040 - in_stack_00000060,cVar3);

-          }

-          *unaff_RDI = CONCAT71(uStack0000000000000031,bStack0000000000000030);

-          unaff_RDI[1] = in_stack_00000038;

-          unaff_RDI[2] = in_stack_00000040;

-          unaff_RDI[3] = in_stack_00000048;

-          in_stack_00000040 = 0;

-          in_stack_00000048 = 0xf;

-          bStack0000000000000030 =

-               (basic_string<char,std::char_traits<char>,std::allocator<char>_>)0x0;

-          std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::

-          ~basic_string<char,std::char_traits<char>,std::allocator<char>_>

-                    ((basic_string<char,std::char_traits<char>,std::allocator<char>_> *)

-                     &stack0x00000050);

-          std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::

-          ~basic_string<char,std::char_traits<char>,std::allocator<char>_>(&stack0x00000030);

-          return;

-        }

-        unaff_EBX = -unaff_ESI & unaff_ESI;

-        if (unaff_EBX != 1) break;

-        pcVar2 = "PrimarySta";

-      }

-      in_EAX = unaff_EBX - 2;

-      if (in_EAX != 0) break;

-      pcVar2 = "HostedNetwork";

-    }

-  } while( true );

+    uVar1 = 0x57;

+  }

+  else {

+    uVar1 = WFDMgrWFDSvcConfigureSession(param_1,param_2,param_3,param_4,param_5);

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x316,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar1);

+  }

+  return uVar1;

 }
```

## `RpcWFDSvcLowPrivPublishService`  (modified)

```diff
--- RpcWFDSvcLowPrivPublishService
+++ RpcWFDSvcLowPrivPublishService
@@ -1,16 +1,138 @@
 

-undefined8

-RpcWFDSvcLowPrivPublishService

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

+ulong RpcWFDSvcLowPrivPublishService

+                (void *param_1,undefined4 param_2,uint param_3,

+                _WFDSVC_SERVICE_PUBLICATION_PARAMETERS *param_4,ulong *param_5)

 

 {

-  uint in_EAX;

+  int iVar1;

+  ulong uVar2;

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

+  *this;

+  longlong *plVar3;

+  void **ppvVar4;

+  undefined8 uVar5;

+  ulong local_res8 [2];

+  ushort *local_68;

+  ushort *local_60;

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

+  local_58 [8];

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

+  local_50 [8];

+  undefined8 local_48;

+  int aiStack_40 [2];

+  void *local_38 [2];

   

-  if (((param_1 != (in_EAX | 0x19fbab)) && (2 < *(byte *)(param_1 + 0x69))) &&

-     ((*(byte *)(param_1 + 0x6c) & 1) != 0)) {

-    WPP_SF_qL(*(undefined8 *)(param_1 + 0x60),0x24c,&WPP_791618f6e4f933247a011d60507f9013_Traceguids

-              ,param_4,*(undefined4 *)(param_4 + 0x180));

+  local_68 = (ushort *)0x0;

+  local_38[0] = (HANDLE)0x0;

+  local_60 = (ushort *)0x0;

+  local_res8[0] = 0;

+  local_48 = 0;

+  aiStack_40[0] = 0;

+  aiStack_40[1] = 0;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2e4,

+            &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

   }

-  return 0;

+  this = (tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

+          *)tip2::

+            start<tip2::tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>_>

+                      ();

+  plVar3 = (longlong *)

+           tip2::

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

+           ::operator->(this);

+  *(undefined1 *)(*plVar3 + 0x110) = 1;

+  tip2::

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

+  ::

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

+            (local_58);

+  wil::

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

+  ::

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

+            (local_50);

+  if (((param_1 == (void *)0x0) || (param_3 < 0x230)) ||

+     ((param_4 == (_WFDSVC_SERVICE_PUBLICATION_PARAMETERS *)0x0 || (param_5 == (ulong *)0x0)))) {

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

+        (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_qDqq(*(undefined8 *)(WPP_GLOBAL_Control + 0x60));

+    }

+    uVar2 = 0x57;

+  }

+  else {

+    iVar1 = IsPreventConnectBitSet();

+    if (iVar1 == 0) {

+      uVar2 = LocalGetClientAppInfo(&local_68,&local_60);

+      if (uVar2 == 0) {

+        uVar2 = LocalGetClientSessionId(local_res8);

+        if (uVar2 == 0) {

+          ppvVar4 = local_38;

+          uVar2 = LocalQueryRpcClientToken(ppvVar4);

+          if (uVar2 == 0) {

+            uVar2 = WfdGetRpcCallerDetails

+                              (ppvVar4,(ulong *)((longlong)&local_48 + 4),aiStack_40,aiStack_40 + 1)

+            ;

+            if (uVar2 == 0) {

+              local_48 = CONCAT44(local_48._4_4_,param_2);

+              uVar2 = WFDMgrWFDSvcPublishService

+                                (param_1,param_3,param_4,local_68,local_60,local_res8[0],

+                                 (_WFD_SVC_RPC_CALL_INFO *)&local_48,param_5);

+              goto LAB_0;

+            }

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

+                (WPP_GLOBAL_Control[0x69] == '\0')) || ((WPP_GLOBAL_Control[0x6c] & 1) == 0))

+            goto LAB_0;

+            uVar5 = 0x2ea;

+          }

+          else {

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

+                (WPP_GLOBAL_Control[0x69] == '\0')) || ((WPP_GLOBAL_Control[0x6c] & 1) == 0))

+            goto LAB_0;

+            uVar5 = 0x2e9;

+          }

+        }

+        else {

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

+              (WPP_GLOBAL_Control[0x69] == '\0')) || ((WPP_GLOBAL_Control[0x6c] & 1) == 0))

+          goto LAB_0;

+          uVar5 = 0x2e8;

+        }

+      }

+      else {

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

+            (WPP_GLOBAL_Control[0x69] == '\0')) || ((WPP_GLOBAL_Control[0x6c] & 1) == 0))

+        goto LAB_0;

+        uVar5 = 0x2e7;

+      }

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar5,

+               &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+    }

+    else {

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

+          (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2e6,

+                &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+      }

+      uVar2 = 0x964;

+    }

+  }

+LAB_0:

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

+    LocalFreeClientAppSid(local_68);

+  }

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

+    LocalFree(local_60);

+  }

+  if (local_38[0] != (HANDLE)0x0) {

+    CloseHandle(local_38[0]);

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2eb,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+  }

+  return uVar2;

 }
```

## `IntfNotify`  (modified)

```diff
--- IntfNotify
+++ IntfNotify
@@ -1,812 +1,910 @@
+

+/* unsigned long __cdecl IntfNotify(void * __ptr64,void * __ptr64,struct _L2_NOTIFICATION_DATA *

+   __ptr64) */

 

 ulong __cdecl IntfNotify(void *param_1,void *param_2,_L2_NOTIFICATION_DATA *param_3)

 

 {

-  int iVar1;

-  undefined8 *puVar2;

+  LPCRITICAL_SECTION p_Var1;

+  undefined4 uVar2;

   longlong *plVar3;

   ulonglong *puVar4;

-  void *pvVar5;

-  LPVOID pvVar6;

-  uint *puVar7;

-  undefined1 auVar8 [16];

+  ulonglong uVar5;

+  void *pvVar6;

+  LPVOID pvVar7;

+  uint *puVar8;

   undefined1 auVar9 [16];

-  int iVar10;

-  uint uVar11;

+  undefined1 auVar10 [16];

+  _WLAN_INTERFACE_CONTEXT *p_Var11;

   ulong uVar12;

-  ulong uVar13;

-  DWORD DVar14;

-  char *in_RAX;

-  longlong lVar15;

-  HANDLE pvVar16;

+  uint uVar13;

+  ulong uVar14;

+  HANDLE pvVar15;

   void *_Dst;

-  _WLAN_INTERFACE_CONTEXT *p_Var17;

+  int iVar16;

+  int iVar17;

   longlong lVar18;

   undefined8 uVar19;

-  LPCRITICAL_SECTION p_Var20;

-  longlong unaff_RBP;

-  undefined4 uVar21;

+  DWORD DVar20;

+  undefined8 uVar21;

   uint uVar22;

-  longlong unaff_RSI;

-  _L2_NOTIFICATION_DATA *unaff_RDI;

-  ulonglong uVar23;

-  undefined8 uVar24;

-  void *unaff_R12;

-  char cVar25;

-  uint uVar26;

-  uchar *unaff_R13;

-  undefined *unaff_R14;

-  void *unaff_R15;

-  bool bVar27;

+  DWORD DVar23;

+  bool bVar24;

+  _WLAN_INTERFACE_CONTEXT _Var25;

+  _WLAN_INTERFACE_CONTEXT *local_res20;

+  LPCRITICAL_SECTION local_78;

+  undefined4 local_70;

+  undefined8 uStack_6c;

+  undefined4 uStack_64;

+  undefined4 uStack_60;

+  undefined4 uStack_5c;

+  uchar local_58 [4];

+  undefined4 uStack_54;

+  undefined2 uStack_50;

+  undefined2 uStack_4e;

+  undefined4 uStack_4c;

+  undefined2 uStack_48;

+  uint6 uStack_46;

+  undefined2 uStack_40;

+  undefined2 local_3e;

+  undefined2 uStack_3c;

+  undefined2 local_3a;

   

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

-  iVar10 = (int)param_1;

-  uVar26 = (uint)unaff_R13;

-  if (iVar10 == 0x10004) {

-    IntfApplyGroupPolicySettings

-              (*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58),

-               *(_WLAN_GP_SETTINGS **)(unaff_RDI + 0x20));

-  }

-  else if (iVar10 == 0x10002) {

-    IntfUpdateProfileStatus(*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58));

-  }

-  else if (iVar10 == 0xf) {

-    IntfHandleProfileChange(*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58),false,false);

-  }

-  else if (iVar10 == 0x10005) {

-    IntfHandleProfileNameChange

-              (*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58),*(ushort **)(unaff_RDI + 0x20),

-               *(ushort **)(unaff_RDI + 0x20) + 0x100);

+  DVar23 = 0;

+  local_res20 = (_WLAN_INTERFACE_CONTEXT *)0x0;

+  uVar22 = 0;

+  bVar24 = false;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x14d,

+            &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

+  }

+  if ((param_3 == (_L2_NOTIFICATION_DATA *)0x0) || (param_1 == (void *)0x0)) {

+    uVar12 = 0x57;

+    goto LAB_0;

+  }

+  uVar12 = IntfValidateNotificationData(param_3);

+  if (uVar12 != 0) goto LAB_0;

+  local_78 = (LPCRITICAL_SECTION)0x0;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x24d,

+            &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

+  }

+  if ((*(int *)param_3 == 0x10) && (*(int *)(param_3 + 4) == 0xd)) {

+    uVar12 = 0x32;

   }

   else {

-    iVar10 = (int)in_RAX;

-    cVar25 = (char)unaff_RSI;

-    if (iVar10 == 8) {

-      iVar1 = *(int *)(unaff_RDI + 4);

-      if (iVar1 == 6) {

-        IntfChangePowerSetting(unaff_R15,**(_WLAN_POWER_SETTING **)(unaff_RDI + 0x20));

-        goto LAB_0;

-      }

-      if (iVar1 != 0x10009) {

-        if (iVar1 == 0x10003) {

-          pvVar5 = (void *)**(undefined8 **)(unaff_RDI + 0x20);

-          puVar2 = *(undefined8 **)(unaff_RBP + 0x58);

-          if (((WPP_GLOBAL_Control != unaff_R14) && (3 < (byte)WPP_GLOBAL_Control[0x69])) &&

-             ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    uVar12 = HtReferenceHandleWithTag(g_hHandleTable,param_1,0x494e5446,0,1,&local_78);

+    if (uVar12 == 0) {

+      if ((void *)local_78[0x38].SpinCount == (void *)0x0) {

+        uVar12 = 0x1f;

+      }

+      else {

+        uVar12 = DcmProcessNotification((void *)local_78[0x38].SpinCount,param_2,param_3);

+      }

+    }

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

+             (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x24e,

+               &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar12);

+    }

+  }

+  if (local_78 != (LPCRITICAL_SECTION)0x0) {

+    HtDereferenceHandleWithTag(g_hHandleTable,param_1,0,1);

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x24f,

+             &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar12);

+  }

+  if (uVar12 == 0) {

+    uVar12 = 0;

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x14e,

+              &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

+    }

+    goto LAB_0;

+  }

+  uVar12 = HtReferenceHandleWithTag(g_hHandleTable,param_1,0x494e5446,0,1,&local_res20);

+  if (uVar12 != 0) {

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

+        (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x14f,

+               &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar12);

+    }

+    goto LAB_0;

+  }

+  local_58[0] = '\0';

+  local_58[1] = '\0';

+  local_58[2] = '\0';

+  local_58[3] = '\0';

+  uStack_54 = 0;

+  uStack_50 = 0;

+  uStack_4e = 0;

+  uStack_4c = 0;

+  uStack_48 = 0;

+  uStack_46 = 0;

+  uStack_40 = 0;

+  local_3e = 0;

+  uStack_3c = 0;

+  local_3a = 0;

+  if ((*(_WLAN_TRACE_HEADER **)(local_res20 + 0xce0) != (_WLAN_TRACE_HEADER *)0x0) &&

+     (*(int *)param_3 == 0x10)) {

+    uStack_4c = 0;

+    iVar17 = *(int *)(param_3 + 4);

+    uStack_40 = (undefined2)iVar17;

+    local_3e = (undefined2)((uint)iVar17 >> 0x10);

+    if (((iVar17 - 1U < 0x10) && ((iVar17 - 7U & 0xfffffff6) != 0)) &&

+       ((*(int *)(param_3 + 0x18) != 0x248 || (*(longlong *)(param_3 + 0x20) == 0)))) {

+      uStack_3c = 0xd;

+    }

+    local_3a = 0;

+    uStack_48 = SUB82(param_2,0);

+    uStack_46 = (uint6)((ulonglong)param_2 >> 0x10);

+    TrAddTrace(*(_WLAN_TRACE_HEADER **)(local_res20 + 0xce0),0x20,local_58);

+  }

+  p_Var11 = local_res20;

+  iVar17 = *(int *)param_3;

+  if (iVar17 == 0x10) {

+    iVar16 = *(int *)(param_3 + 4);

+    if (iVar16 == 0xd) {

+      uVar12 = IntfInvalidateAdapter(*(void **)local_res20);

+      goto LAB_0;

+    }

+LAB_1:

+    if (iVar17 == 8) {

+      if (iVar16 == 1) {

+        IntfStartAutoConfig(local_res20);

+      }

+      else if (iVar16 == 2) {

+        IntfStopAutoConfig(local_res20);

+      }

+      else if (iVar16 == 0x10004) {

+        IntfApplyGroupPolicySettings(local_res20,*(_WLAN_GP_SETTINGS **)(param_3 + 0x20));

+      }

+      else if (iVar16 == 0x10002) {

+        IntfUpdateProfileStatus(local_res20);

+      }

+      else if (iVar16 == 0xf) {

+        IntfHandleProfileChange(local_res20,false,false);

+      }

+      else {

+        if (iVar16 != 0x10005) goto LAB_2;

+        IntfHandleProfileNameChange

+                  (local_res20,*(ushort **)(param_3 + 0x20),*(ushort **)(param_3 + 0x20) + 0x100);

+      }

+    }

+    else if ((iVar17 == 0x10) && (*(int *)(param_3 + 4) == 7)) {

+      IntfChangeRadioState(local_res20,*(_WLAN_PHY_RADIO_STATE **)(param_3 + 0x20));

+    }

+    else {

+LAB_2:

+      if (iVar17 != 8) goto LAB_3;

+      iVar16 = *(int *)(param_3 + 4);

+      if (iVar16 == 6) {

+        IntfChangePowerSetting(param_1,**(_WLAN_POWER_SETTING **)(param_3 + 0x20));

+        goto LAB_4;

+      }

+      if (iVar16 != 0x10009) {

+        if (iVar16 == 0x10003) {

+          pvVar6 = (void *)**(undefined8 **)(param_3 + 0x20);

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

+              (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

             WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2ff,

                     &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

           }

-          if (puVar2 == (undefined8 *)0x0) {

+          if (p_Var11 == (_WLAN_INTERFACE_CONTEXT *)0x0) {

             MicrosoftTelemetryAssertTriggeredNoArgs();

           }

-          if (pvVar5 == (void *)0x0) {

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

             MicrosoftTelemetryAssertTriggeredNoArgs();

           }

-          IntfClientEnableBackgroundScan(pvVar5,(void *)*puVar2,1);

-          IntfClientSetMediaStreamingMode(pvVar5,(void *)*puVar2,0);

-          if (((WPP_GLOBAL_Control != unaff_R14) && (3 < (byte)WPP_GLOBAL_Control[0x69])) &&

-             ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+          IntfClientEnableBackgroundScan(pvVar6,*(void **)p_Var11,1);

+          IntfClientSetMediaStreamingMode(pvVar6,*(void **)p_Var11,0);

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

+              (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

             uVar19 = 0x300;

-            goto LAB_1;

-          }

-          goto LAB_0;

-        }

-        if (iVar1 != 0x10006) goto LAB_2;

-        plVar3 = *(longlong **)(unaff_RDI + 0x20);

-        puVar2 = *(undefined8 **)(unaff_RBP + 0x58);

+            goto LAB_5;

+          }

+          goto LAB_4;

+        }

+        if (iVar16 != 0x10006) goto LAB_6;

+        plVar3 = *(longlong **)(param_3 + 0x20);

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

             (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

           WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60));

         }

-        if (puVar2 == (undefined8 *)0x0) {

+        if (p_Var11 == (_WLAN_INTERFACE_CONTEXT *)0x0) {

           MicrosoftTelemetryAssertTriggeredNoArgs();

         }

-        p_Var20 = (LPCRITICAL_SECTION)(puVar2 + 0x12);

-        EnterCriticalSection(p_Var20);

-        *(LPCRITICAL_SECTION *)(unaff_RBP + -0x40) = p_Var20;

-        if (puVar2[0x58] == 0) {

+        p_Var1 = (LPCRITICAL_SECTION)(p_Var11 + 0x90);

+        EnterCriticalSection(p_Var1);

+        local_78 = p_Var1;

+        if (*(longlong *)(p_Var11 + 0x2c0) == 0) {

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

               (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

             uVar19 = 0x356;

-            uVar24 = 0x139f;

-LAB_3:

+            uVar21 = 0x139f;

+LAB_7:

             WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar19,

-                     &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar24);

+                     &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar21);

           }

         }

         else {

-          lVar18 = puVar2[0x59];

-          if (((lVar18 != 0) || (lVar18 = puVar2[0x5a], lVar18 != 0)) &&

+          lVar18 = *(longlong *)(p_Var11 + 0x2c8);

+          if (((lVar18 != 0) || (lVar18 = *(longlong *)(p_Var11 + 0x2d0), lVar18 != 0)) &&

              (((*(uint *)(lVar18 + 0x290) & 0xfffffffb) == 0 &&

               ((*plVar3 == *(longlong *)(lVar18 + 0x218) &&

                (plVar3[1] == *(longlong *)(lVar18 + 0x220))))))) {

-            IntfCommandHandler((void *)*puVar2,0x10000000,(void *)0x0,0);

+            IntfCommandHandler(*(void **)p_Var11,0x10000000,(void *)0x0,0);

           }

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

               (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

             uVar19 = 0x357;

-            uVar24 = 0;

-            goto LAB_3;

-          }

-        }

-        goto LAB_4;

-      }

-      uVar21 = **(undefined4 **)(unaff_RDI + 0x20);

-      if (WPP_GLOBAL_Control != unaff_R14) {

+            uVar21 = 0;

+            goto LAB_7;

+          }

+        }

+        goto LAB_8;

+      }

+      uVar2 = **(undefined4 **)(param_3 + 0x20);

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

         if ((3 < (byte)WPP_GLOBAL_Control[0x69]) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

           WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x1bd,

                   &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

         }

-        if (((WPP_GLOBAL_Control != unaff_R14) && (2 < (byte)WPP_GLOBAL_Control[0x69])) &&

-           ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

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

+            (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

           WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x1be,

-                   &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar21);

-        }

-      }

-      OnConnectedStandbyChange();

-      if (((WPP_GLOBAL_Control == unaff_R14) || ((byte)WPP_GLOBAL_Control[0x69] < 4)) ||

-         ((WPP_GLOBAL_Control[0x6c] & 1) == 0)) goto LAB_0;

+                   &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar2);

+        }

+      }

+      OnConnectedStandbyChange(param_1);

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

+          ((byte)WPP_GLOBAL_Control[0x69] < 4)) || ((WPP_GLOBAL_Control[0x6c] & 1) == 0))

+      goto LAB_4;

       uVar19 = 0x1bf;

-LAB_1:

+LAB_5:

       WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar19,

                &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,0);

     }

-    else if (iVar10 == 0x10) {

-      iVar1 = *(int *)(unaff_RDI + 4);

-      if (iVar1 == 6) {

-        EnterCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

-        p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-        if (*(longlong *)(p_Var17 + 0x2c8) != unaff_RSI) {

-          IntfUpdateConnectionAttributes(p_Var17,0);

-          p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

+  }

+  else if (iVar17 == 8) {

+    iVar16 = *(int *)(param_3 + 4);

+    if (iVar16 != 5) goto LAB_1;

+    IntfBssTypeChange(local_res20);

+  }

+  else {

+LAB_3:

+    if (iVar17 == 0x10) {

+      iVar16 = *(int *)(param_3 + 4);

+      if (iVar16 == 6) {

+        EnterCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

+        if (*(longlong *)(local_res20 + 0x2c8) != 0) {

+          IntfUpdateConnectionAttributes(local_res20,0);

         }

         LOCK();

-        iVar10 = *(int *)(p_Var17 + 0xc9c);

-        *(uint *)(p_Var17 + 0xc9c) = uVar26;

+        iVar17 = *(int *)(local_res20 + 0xc9c);

+        *(int *)(local_res20 + 0xc9c) = 0;

         UNLOCK();

-        if (iVar10 == 1) {

-          if (((WPP_GLOBAL_Control != unaff_R14) && (2 < (byte)WPP_GLOBAL_Control[0x69])) &&

-             ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        if (iVar17 == 1) {

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

+              (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

             WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60));

           }

-          uVar21 = (undefined4)unaff_RSI;

-          if (g_nlaPluginEnabled != (bool)cVar25) {

-            uVar21 = 1;

-          }

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

-        }

-        LeaveCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

+          bVar24 = g_nlaPluginEnabled != false;

+        }

+        LeaveCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

         LOCK();

-        puVar7 = (uint *)(*(longlong *)(unaff_RBP + 0x58) + 0x1638);

-        uVar11 = *puVar7;

-        *puVar7 = uVar26;

+        iVar17 = *(int *)(local_res20 + 0x1638);

+        *(int *)(local_res20 + 0x1638) = 0;

         UNLOCK();

-        if (uVar11 != 0) {

-          if (((WPP_GLOBAL_Control != unaff_R14) && (3 < (byte)WPP_GLOBAL_Control[0x69])) &&

-             ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        if (iVar17 != 0) {

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

+              (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

             WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x151);

           }

-          IntfOffloadNetworks(*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58),1,false);

-        }

-      }

-      else if (iVar1 == 2) {

-        EnterCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

-        p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-        if (*(longlong *)(p_Var17 + 0x2d0) == unaff_RSI) {

-LAB_5:

-          LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var17 + 0x90));

+          IntfOffloadNetworks(local_res20,1,false);

+        }

+      }

+      else if (iVar16 == 2) {

+        EnterCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

+        if (*(longlong *)(local_res20 + 0x2d0) == 0) {

+LAB_9:

+          LeaveCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

         }

         else {

-          IntfUpdateConnectionAttributes(p_Var17,1);

-          LeaveCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

+          IntfUpdateConnectionAttributes(local_res20,1);

+          LeaveCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

         }

       }

       else {

-        if (iVar1 == 3) {

-          EnterCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

-          p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-          if (*(longlong *)(p_Var17 + 0x2d0) != unaff_RSI) {

-            IntfSetInterfaceState(p_Var17,7);

-            p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-          }

-          goto LAB_5;

-        }

-        if (iVar1 == 8) {

-          EnterCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

-          *(undefined4 *)(*(longlong *)(unaff_RBP + 0x58) + 0x588) =

-               **(undefined4 **)(unaff_RDI + 0x20);

-          LeaveCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

+        if (iVar16 == 3) {

+          EnterCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

+          if (*(longlong *)(local_res20 + 0x2d0) != 0) {

+            IntfSetInterfaceState(local_res20,7);

+          }

+          goto LAB_9;

+        }

+        if (iVar16 == 8) {

+          EnterCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

+          *(undefined4 *)(local_res20 + 0x588) = **(undefined4 **)(param_3 + 0x20);

+          LeaveCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

         }

         else {

-          if (iVar1 != 0x3b) goto LAB_6;

-          puVar4 = *(ulonglong **)(unaff_RDI + 0x20);

-          EnterCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

-          uVar23 = *puVar4;

-          auVar8._8_8_ = 0;

-          auVar8._0_8_ = uVar23;

-          lVar18 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar8,8);

-          *(int *)(*(longlong *)(unaff_RBP + 0x58) + 0x590) =

-               (int)((uVar23 - lVar18 >> 1) + lVar18 >> 9);

-          uVar23 = puVar4[1];

+          if (iVar16 != 0x3b) goto LAB_10;

+          puVar4 = *(ulonglong **)(param_3 + 0x20);

+          EnterCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

+          uVar5 = *puVar4;

           auVar9._8_8_ = 0;

-          auVar9._0_8_ = uVar23;

+          auVar9._0_8_ = uVar5;

           lVar18 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar9,8);

-          *(int *)(*(longlong *)(unaff_RBP + 0x58) + 0x58c) =

-               (int)((uVar23 - lVar18 >> 1) + lVar18 >> 9);

-          LeaveCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

+          *(int *)(local_res20 + 0x590) = (int)((uVar5 - lVar18 >> 1) + lVar18 >> 9);

+          uVar5 = puVar4[1];

+          auVar10._8_8_ = 0;

+          auVar10._0_8_ = uVar5;

+          lVar18 = SUB168(ZEXT816(0x624dd2f1a9fbe77) * auVar10,8);

+          *(int *)(local_res20 + 0x58c) = (int)((uVar5 - lVar18 >> 1) + lVar18 >> 9);

+          LeaveCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

         }

       }

     }

     else {

-LAB_2:

-      if ((iVar10 == 8) && (*(int *)(unaff_RDI + 4) == 0x10001)) {

-        IntfPlapTimelySessionChange

-                  (*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58),

-                   *(_ACM_WTS_SESSION_NOTIFICATION **)(unaff_RDI + 0x20));

+LAB_6:

+      if ((iVar17 == 8) && (*(int *)(param_3 + 4) == 0x10001)) {

+        IntfPlapTimelySessionChange(local_res20,*(_ACM_WTS_SESSION_NOTIFICATION **)(param_3 + 0x20))

+        ;

       }

       else {

-LAB_6:

-        if (iVar10 == 0x10) {

-          iVar1 = *(int *)(unaff_RDI + 4);

-          if (iVar1 == 10) {

-            p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-            if (((WPP_GLOBAL_Control != unaff_R14) && (3 < (byte)WPP_GLOBAL_Control[0x69])) &&

-               ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+LAB_10:

+        if (iVar17 == 0x10) {

+          iVar16 = *(int *)(param_3 + 4);

+          if (iVar16 == 10) {

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

+                (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

               WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x321,

                       &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

             }

-            if (p_Var17 == (_WLAN_INTERFACE_CONTEXT *)0x0) {

+            if (p_Var11 == (_WLAN_INTERFACE_CONTEXT *)0x0) {

               MicrosoftTelemetryAssertTriggeredNoArgs();

             }

-            EnterCriticalSection((LPCRITICAL_SECTION)(p_Var17 + 0x90));

-            lVar18 = *(longlong *)(p_Var17 + 0x2d0);

+            EnterCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x90));

+            lVar18 = *(longlong *)(p_Var11 + 0x2d0);

             if ((lVar18 != 0) &&

-               ((*(char *)(lVar18 + 0x300) != cVar25 || (*(char *)(lVar18 + 0x301) != cVar25)))) {

-              iVar10 = 0x10001;

-              IntfNotifyConnectionFailure(p_Var17,0x10001,1);

-              if (*(char *)(*(longlong *)(p_Var17 + 0x2d0) + 0x300) != cVar25) {

-                IntfCompletePlap(p_Var17,iVar10,0x10001);

-              }

-              CfgFreeSelection(*(WLAN_CONFIG_SELECTION **)(p_Var17 + 0x2d0));

-              *(uchar **)(p_Var17 + 0x2d0) = unaff_R13;

-              IntfSetInterfaceState(p_Var17,4);

-            }

-            LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var17 + 0x90));

-            if (((WPP_GLOBAL_Control != unaff_R14) && (3 < (byte)WPP_GLOBAL_Control[0x69])) &&

-               ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+               ((*(char *)(lVar18 + 0x300) != '\0' || (*(char *)(lVar18 + 0x301) != '\0')))) {

+              iVar17 = 0x10001;

+              IntfNotifyConnectionFailure(p_Var11,0x10001,1);

+              if (*(char *)(*(longlong *)(p_Var11 + 0x2d0) + 0x300) != '\0') {

+                IntfCompletePlap(p_Var11,iVar17,0x10001);

+              }

+              CfgFreeSelection(*(WLAN_CONFIG_SELECTION **)(p_Var11 + 0x2d0));

+              *(undefined8 *)(p_Var11 + 0x2d0) = 0;

+              IntfSetInterfaceState(p_Var11,4);

+            }

+            LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x90));

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

+                (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

               uVar19 = 0x322;

-              goto LAB_1;

-            }

-            goto LAB_0;

-          }

-          if (iVar1 == 0x10004) {

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

-            if (lVar18 == 0) {

+              goto LAB_5;

+            }

+          }

+          else if (iVar16 == 0x10004) {

+            if (local_res20 == (_WLAN_INTERFACE_CONTEXT *)0x0) {

               MicrosoftTelemetryAssertTriggeredNoArgs();

             }

-            if (((WPP_GLOBAL_Control != unaff_R14) && (2 < (byte)WPP_GLOBAL_Control[0x69])) &&

-               ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

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

+                (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

               WPP_SF_S(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x124,

                        &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,

-                       *(undefined8 *)(lVar18 + 0x80));

-            }

-            EnterCriticalSection((LPCRITICAL_SECTION)(lVar18 + 0x90));

-            if ((*(byte *)(lVar18 + 0x114) & 1) == 0) {

-              if (((WPP_GLOBAL_Control != unaff_R14) && (1 < (byte)WPP_GLOBAL_Control[0x69])) &&

-                 ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+                       *(undefined8 *)(p_Var11 + 0x80));

+            }

+            EnterCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x90));

+            if (((byte)p_Var11[0x114] & 1) == 0) {

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

+                  (1 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

                 WPP_SF_S(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x127,

                          &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,

-                         *(undefined8 *)(lVar18 + 0x80));

+                         *(undefined8 *)(p_Var11 + 0x80));

               }

             }

             else {

-              uVar12 = *(ulong *)(lVar18 + 0x938);

-              if (lVar18 == -0x118) {

+              uVar12 = *(ulong *)(p_Var11 + 0x938);

+              if (p_Var11 == (_WLAN_INTERFACE_CONTEXT *)0xfffffffffffffee8) {

                 MicrosoftTelemetryAssertTriggeredNoArgs();

               }

-              if (*(uchar **)(lVar18 + 400) == unaff_R13) {

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

                 MicrosoftTelemetryAssertTriggeredNoArgs();

               }

-              EnterCriticalSection((LPCRITICAL_SECTION)(lVar18 + 0x130));

-              if (*(int *)(lVar18 + 0x178) == 0x1e) {

+              EnterCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x130));

+              if (*(int *)(p_Var11 + 0x178) == 0x1e) {

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

                     (1 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0))

                 {

                   WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x29,

                           &WPP_462f6b31de263acc073a4e9b2b688c7b_Traceguids);

                 }

                 uVar12 = 0x139f;

-                LeaveCriticalSection((LPCRITICAL_SECTION)(lVar18 + 0x130));

-LAB_7:

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

-                    (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-                  WPP_SF_SD(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x126,

-                            &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,

-                            *(undefined8 *)(lVar18 + 0x80),uVar12);

+                LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x130));

+              }

+              else {

+                uVar12 = TmChangeTimer(*(void **)(p_Var11 + 400),5000,uVar12);

+                LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x130));

+                if (uVar12 == 0) {

+                  *(undefined4 *)(p_Var11 + 0xcf4) = 1;

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

+                      (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)

+                     ) {

+                    WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x125,

+                              &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,5,

+                              *(undefined8 *)(p_Var11 + 0x80));

+                  }

+                  goto LAB_11;

                 }

               }

-              else {

-                uVar12 = TmChangeTimer(*(void **)(lVar18 + 400),5000,uVar12);

-                LeaveCriticalSection((LPCRITICAL_SECTION)(lVar18 + 0x130));

-                if (uVar12 != 0) goto LAB_7;

-                *(undefined4 *)(lVar18 + 0xcf4) = 1;

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

-                    (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0))

-                {

-                  WPP_SF_DS(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x125,

-                            &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,5,

-                            *(undefined8 *)(lVar18 + 0x80));

-                }

-              }

-              unaff_R15 = *(void **)(unaff_RBP + 0x40);

-            }

-            LeaveCriticalSection((LPCRITICAL_SECTION)(lVar18 + 0x90));

-            goto LAB_0;

-          }

-          if (iVar1 == 0x10018) {

-            IntfHandleFtmResponse

-                      (*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58),

-                       *(_DOT11_FTM_RESPONSE_PARAMS **)(unaff_RDI + 0x20));

-            goto LAB_0;

-          }

-          if (iVar1 != 0x10019) {

-            if (iVar1 != 0x10012) goto LAB_8;

-            IntfHandleANQPQueryCompleted

-                      (*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58),

-                       *(_DOT11_ANQP_QUERY_COMPLETE_PARAMETERS **)(unaff_RDI + 0x20));

-            goto LAB_0;

-          }

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

-          if ((**(uint **)(unaff_RDI + 0x20) <= uVar26) ||

-             (((*(uint **)(unaff_RDI + 0x20))[1] & 1) == 0)) {

-            if ((WPP_GLOBAL_Control != unaff_R14) &&

-               ((1 < (byte)WPP_GLOBAL_Control[0x69] && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

-              WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x14b,

-                      &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

-            }

-            goto LAB_0;

-          }

-          p_Var20 = (LPCRITICAL_SECTION)(lVar18 + 0x90);

-          EnterCriticalSection(p_Var20);

-          lVar15 = *(longlong *)(lVar18 + 0x2d0);

-          if ((lVar15 == 0) && (lVar15 = *(longlong *)(lVar18 + 0x2c8), lVar15 == 0)) {

-            if ((WPP_GLOBAL_Control != unaff_R14) &&

-               ((WPP_GLOBAL_Control[0x69] != '\0' && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

-              WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x14c,

-                      &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

-            }

-            if (p_Var20 != (LPCRITICAL_SECTION)0x0) {

-              LeaveCriticalSection(p_Var20);

-            }

-            goto LAB_0;

-          }

-          *(uint *)(lVar15 + 0x31c) = *(uint *)(lVar15 + 0x31c) | 4;

-LAB_9:

-          if (p_Var20 != (LPCRITICAL_SECTION)0x0) {

-            LeaveCriticalSection(p_Var20);

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

+                  (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+                WPP_SF_SD(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x126,

+                          &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,

+                          *(undefined8 *)(p_Var11 + 0x80),uVar12);

+              }

+            }

+LAB_11:

+            LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x90));

+          }

+          else {

+            if (iVar16 == 0x10018) {

+              IntfHandleFtmResponse(local_res20,*(_DOT11_FTM_RESPONSE_PARAMS **)(param_3 + 0x20));

+              goto LAB_4;

+            }

+            if (iVar16 != 0x10019) {

+              if (iVar16 != 0x10012) goto LAB_12;

+              IntfHandleANQPQueryCompleted

+                        (local_res20,*(_DOT11_ANQP_QUERY_COMPLETE_PARAMETERS **)(param_3 + 0x20));

+              goto LAB_4;

+            }

+            if ((**(int **)(param_3 + 0x20) == 0) ||

+               ((*(byte *)(*(int **)(param_3 + 0x20) + 1) & 1) == 0)) {

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

+                 ((1 < (byte)WPP_GLOBAL_Control[0x69] && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

+                WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x14b,

+                        &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

+              }

+              goto LAB_4;

+            }

+            p_Var1 = (LPCRITICAL_SECTION)(local_res20 + 0x90);

+            EnterCriticalSection(p_Var1);

+            lVar18 = *(longlong *)(p_Var11 + 0x2d0);

+            if ((lVar18 == 0) && (lVar18 = *(longlong *)(p_Var11 + 0x2c8), lVar18 == 0)) {

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

+                 ((WPP_GLOBAL_Control[0x69] != '\0' && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

+                WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x14c,

+                        &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

+              }

+              if (p_Var1 != (LPCRITICAL_SECTION)0x0) {

+                LeaveCriticalSection(p_Var1);

+              }

+              goto LAB_4;

+            }

+            *(uint *)(lVar18 + 0x31c) = *(uint *)(lVar18 + 0x31c) | 4;

+LAB_13:

+            if ((LPCRITICAL_SECTION)(p_Var11 + 0x90) != (LPCRITICAL_SECTION)0x0) {

+              LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x90));

+            }

           }

         }

         else {

-          if (iVar10 == 8) {

-            if (*(int *)(unaff_RDI + 4) == 0x10007) {

-              IntfHandleANQPCacheChanged(*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58));

-              goto LAB_0;

-            }

-LAB_10:

-            if (iVar10 != 0x10) goto LAB_11;

-            if (*(int *)(unaff_RDI + 4) == 0x1001a) goto LAB_12;

+          if (iVar17 == 8) {

+            if (*(int *)(param_3 + 4) == 0x10007) {

+              IntfHandleANQPCacheChanged(local_res20);

+              goto LAB_4;

+            }

+LAB_14:

+            if (iVar17 != 0x10) goto LAB_15;

+            if (*(int *)(param_3 + 4) == 0x1001a) goto LAB_16;

           }

           else {

-LAB_8:

-            if (iVar10 != 2) goto LAB_10;

-            if (*(int *)(unaff_RDI + 4) == 0x10008) {

 LAB_12:

-              if (((WPP_GLOBAL_Control != unaff_R14) && (2 < (byte)WPP_GLOBAL_Control[0x69])) &&

-                 ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+            if (iVar17 != 2) goto LAB_14;

+            if (*(int *)(param_3 + 4) == 0x10008) {

+LAB_16:

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

+                  (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

                 WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x152,

                         &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

               }

-              IntfPublishWnfState(*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58),2,0x10008,0,

-                                  unaff_R13);

-              goto LAB_0;

-            }

-LAB_11:

-            if ((iVar10 == 2) && (*(int *)(unaff_RDI + 4) == 0x10009)) {

-              if ((WPP_GLOBAL_Control != unaff_R14) &&

+              IntfPublishWnfState(local_res20,2,0x10008,0,(uchar *)0x0);

+              goto LAB_4;

+            }

+LAB_15:

+            if ((iVar17 == 2) && (*(int *)(param_3 + 4) == 0x10009)) {

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

                  ((2 < (byte)WPP_GLOBAL_Control[0x69] && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

                 WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x153,

                          &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,

-                         **(undefined4 **)(unaff_RDI + 0x20));

-              }

-              IntfPublishWnfState(*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58),2,0x10009,

-                                  *(ulong *)(unaff_RDI + 0x18),*(uchar **)(unaff_RDI + 0x20));

-              goto LAB_0;

-            }

-          }

-          if (iVar10 == 8) {

-            if (*(int *)(unaff_RDI + 4) == 0x10008) {

-              p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-              if (((WPP_GLOBAL_Control != unaff_R14) && (3 < (byte)WPP_GLOBAL_Control[0x69])) &&

-                 ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+                         **(undefined4 **)(param_3 + 0x20));

+              }

+              IntfPublishWnfState(local_res20,2,0x10009,*(ulong *)(param_3 + 0x18),

+                                  *(uchar **)(param_3 + 0x20));

+              goto LAB_4;

+            }

+          }

+          if (iVar17 == 8) {

+            if (*(int *)(param_3 + 4) == 0x10008) {

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

+                  (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

                 WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x147,

                         &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

               }

-              EnterCriticalSection((LPCRITICAL_SECTION)(p_Var17 + 0x90));

-              if (((WPP_GLOBAL_Control != unaff_R14) && (2 < (byte)WPP_GLOBAL_Control[0x69])) &&

-                 ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+              EnterCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x90));

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

+                  (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

                 WPP_SF__guid_l(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x148,

-                               &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,p_Var17 + 8,

-                               *(undefined4 *)(p_Var17 + 0x18));

-              }

-              if (((byte)p_Var17[0x18] & 0x21) != 0) {

-                IntfUpdateLimitedDisruptionModeAndScanDowngrading(p_Var17);

-              }

-              if (((byte)p_Var17[0x18] & 0x10) != 0) {

-                IntfUpdateHighChannelAvailabilityMode(p_Var17);

-              }

-              LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var17 + 0x90));

-              if (((WPP_GLOBAL_Control != unaff_R14) && (3 < (byte)WPP_GLOBAL_Control[0x69])) &&

-                 ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+                               &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,p_Var11 + 8,

+                               *(undefined4 *)(p_Var11 + 0x18));

+              }

+              if (((byte)p_Var11[0x18] & 0x21) != 0) {

+                IntfUpdateLimitedDisruptionModeAndScanDowngrading(p_Var11);

+              }

+              if (((byte)p_Var11[0x18] & 0x10) != 0) {

+                IntfUpdateHighChannelAvailabilityMode(p_Var11);

+              }

+              LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x90));

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

+                  (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

                 uVar19 = 0x149;

-                goto LAB_1;

-              }

-            }

-            else if (*(int *)(unaff_RDI + 4) == 0x1000c) {

-              IntfHandleUpgradeComplete(*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58));

-            }

-          }

-          else if (iVar10 == 0x10) {

-            iVar10 = *(int *)(unaff_RDI + 4);

-            cVar25 = (char)unaff_R13;

-            if (iVar10 == 0x1001b) {

-              lVar18 = *(longlong *)(unaff_RDI + 0x20);

-              puVar2 = *(undefined8 **)(unaff_RBP + 0x58);

-              p_Var20 = (LPCRITICAL_SECTION)(puVar2 + 0x12);

-              EnterCriticalSection(p_Var20);

-              if ((*(int *)(puVar2 + 3) != 1) ||

-                 (bVar27 = *(char *)(lVar18 + 4) != cVar25,

-                 (bool)*(char *)(puVar2 + 0x2de) == bVar27)) {

+                goto LAB_5;

+              }

+            }

+            else if (*(int *)(param_3 + 4) == 0x1000c) {

+              IntfHandleUpgradeComplete(local_res20);

+            }

+          }

+          else if (iVar17 == 0x10) {

+            iVar17 = *(int *)(param_3 + 4);

+            if (iVar17 == 0x1001b) {

+              lVar18 = *(longlong *)(param_3 + 0x20);

+              p_Var1 = (LPCRITICAL_SECTION)(local_res20 + 0x90);

+              EnterCriticalSection(p_Var1);

+              if ((*(int *)(p_Var11 + 0x18) != 1) ||

+                 (_Var25 = (_WLAN_INTERFACE_CONTEXT)(*(char *)(lVar18 + 4) != '\0'),

+                 p_Var11[0x16f0] == _Var25)) {

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

                    ((WPP_GLOBAL_Control[0x69] != '\0' && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

                   WPP_SF_D_guid_DD(*(undefined8 *)(WPP_GLOBAL_Control + 0x60));

                 }

-                goto LAB_9;

-              }

-              *(bool *)(puVar2 + 0x2de) = bVar27;

-              if (p_Var20 != (LPCRITICAL_SECTION)0x0) {

-                LeaveCriticalSection(p_Var20);

+                goto LAB_13;

+              }

+              p_Var11[0x16f0] = _Var25;

+              if (p_Var1 != (LPCRITICAL_SECTION)0x0) {

+                LeaveCriticalSection(p_Var1);

               }

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

                   (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

                 WPP_SF__guid_l(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x400,

-                               &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,puVar2 + 1,

+                               &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,p_Var11 + 8,

                                *(undefined1 *)(lVar18 + 4));

               }

-              if (*(char *)(lVar18 + 4) == cVar25) {

-                IntfCheckStartSecondaryStaConnect((void *)*puVar2,false);

+              if (*(char *)(lVar18 + 4) == '\0') {

+                IntfCheckStartSecondaryStaConnect(*(void **)p_Var11,false);

               }

               else {

-                IntfCheckStopSecondaryStaConnect((void *)*puVar2,false);

-              }

-            }

-            else if (iVar10 == 0x1001c) {

-              lVar18 = *(longlong *)(unaff_RDI + 0x20);

-              p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-              p_Var20 = (LPCRITICAL_SECTION)(p_Var17 + 0x90);

-              EnterCriticalSection(p_Var20);

-              if (*(int *)(p_Var17 + 0x18) == 1) {

-                if (p_Var20 != (LPCRITICAL_SECTION)0x0) {

-                  LeaveCriticalSection(p_Var20);

+                IntfCheckStopSecondaryStaConnect(*(void **)p_Var11,false);

+              }

+            }

+            else if (iVar17 == 0x1001c) {

+              lVar18 = *(longlong *)(param_3 + 0x20);

+              p_Var1 = (LPCRITICAL_SECTION)(local_res20 + 0x90);

+              EnterCriticalSection(p_Var1);

+              if (*(int *)(p_Var11 + 0x18) == 1) {

+                if (p_Var1 != (LPCRITICAL_SECTION)0x0) {

+                  LeaveCriticalSection(p_Var1);

                 }

-                if (*(char *)(lVar18 + 4) != cVar25) {

-                  IntfRemoveModernStandbyConnectivityBlock(p_Var17);

-                  goto LAB_0;

+                if (*(char *)(lVar18 + 4) != '\0') {

+                  IntfRemoveModernStandbyConnectivityBlock(p_Var11);

+                  goto LAB_4;

                 }

-                EnterCriticalSection(p_Var20);

-                if (*(uint *)(p_Var17 + 0x16bc) == uVar26) {

+                EnterCriticalSection(p_Var1);

+                if (*(int *)(p_Var11 + 0x16bc) == 0) {

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

                       (1 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)

                      ) {

                     WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x15,

                             &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

                   }

                 }

                 else {

-                  iVar10 = *(int *)(p_Var17 + 0xd00);

-                  *(undefined4 *)(p_Var17 + 0xd00) = 1;

-                  if (iVar10 == 0) {

+                  iVar17 = *(int *)(p_Var11 + 0xd00);

+                  *(undefined4 *)(p_Var11 + 0xd00) = 1;

+                  if (iVar17 == 0) {

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

                         (2 < (byte)WPP_GLOBAL_Control[0x69])) &&

                        ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

                       WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x16,

                               &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

                     }

-                    *(uint *)(unaff_RBP + -0x38) = uVar26;

-                    uVar19 = *(undefined8 *)(p_Var17 + 0x10);

-                    *(undefined8 *)(unaff_RBP + -0x34) = *(undefined8 *)(p_Var17 + 8);

-                    *(undefined8 *)(unaff_RBP + -0x2c) = uVar19;

-                    *(uint *)(unaff_RBP + -0x24) = uVar26;

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

-                    *(undefined4 *)(unaff_RBP + -0x1c) = *(undefined4 *)(unaff_RBP + -0x34);

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

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

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

+                    local_70 = 0;

+                    uStack_6c = *(undefined8 *)(p_Var11 + 8);

+                    uVar19 = *(undefined8 *)(p_Var11 + 0x10);

+                    uStack_64 = (undefined4)uVar19;

+                    uStack_60 = (undefined4)((ulonglong)uVar19 >> 0x20);

+                    uStack_5c = 0;

+                    local_58[0] = '\0';

+                    local_58[1] = '\0';

+                    local_58[2] = '\0';

+                    local_58[3] = '\0';

+                    uStack_54 = (undefined4)uStack_6c;

+                    uStack_50 = (undefined2)((ulonglong)uStack_6c >> 0x20);

+                    uStack_4e = (undefined2)((ulonglong)uStack_6c >> 0x30);

+                    uStack_4c = uStack_64;

+                    uStack_48 = (undefined2)((ulonglong)uVar19 >> 0x20);

+                    uStack_46 = (uint6)(ushort)((ulonglong)uVar19 >> 0x30);

                     NetworkingTriageScenarioGetConnectedWiFiAllowedConnectivityAction

-                              (unaff_RBP + -0x20,*(undefined8 *)(p_Var17 + 0x80),p_Var17[0xcfc],

-                               p_Var17[0xcfd],*(undefined4 *)(p_Var17 + 0xd00));

+                              (local_58,*(undefined8 *)(p_Var11 + 0x80),p_Var11[0xcfc],

+                               p_Var11[0xcfd],*(undefined4 *)(p_Var11 + 0xd00));

                   }

                 }

               }

-              else if (*(int *)(p_Var17 + 0x18) == 0x20) {

+              else if (*(int *)(p_Var11 + 0x18) == 0x20) {

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

                     (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0))

                 {

                   WPP_SF_l_guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60));

                 }

               }

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

                        (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0))

               {

                 WPP_SF_lD_guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60));

               }

-LAB_4:

-              if (p_Var20 != (LPCRITICAL_SECTION)0x0) {

-                LeaveCriticalSection(p_Var20);

-              }

-            }

-            else if (iVar10 == 0x1001d) {

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

-              lVar15 = *(longlong *)(unaff_RDI + 0x20);

-              uVar11 = *(uint *)(lVar15 + 4);

-              if (uVar11 == 0) {

-                uVar11 = (uint)*(ushort *)(lVar15 + 8);

-                if (uVar11 == 8) {

-                  if ((*(int *)(lVar15 + 10) != 3) && (1 < *(int *)(lVar18 + 0x16ec) - 3U)) {

+LAB_8:

+              if ((LPCRITICAL_SECTION)(p_Var11 + 0x90) != (LPCRITICAL_SECTION)0x0) {

+                LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x90));

+              }

+            }

+            else if (iVar17 == 0x1001d) {

+              lVar18 = *(longlong *)(param_3 + 0x20);

+              uVar13 = *(uint *)(lVar18 + 4);

+              if (uVar13 == 0) {

+                uVar13 = (uint)*(ushort *)(lVar18 + 8);

+                if (uVar13 == 8) {

+                  if ((*(int *)(lVar18 + 10) != 3) && (1 < *(int *)(local_res20 + 0x16ec) - 3U)) {

                     MicrosoftTelemetryAssertTriggeredNoArgs();

                   }

-                  if ((*(int *)(lVar15 + 0xe) != 3) && (1 < *(int *)(lVar18 + 0x16ec) - 3U)) {

+                  if ((*(int *)(lVar18 + 0xe) != 3) && (1 < *(int *)(p_Var11 + 0x16ec) - 3U)) {

                     MicrosoftTelemetryAssertTriggeredNoArgs();

                   }

-                  if (((WPP_GLOBAL_Control != unaff_R14) && (2 < (byte)WPP_GLOBAL_Control[0x69])) &&

-                     ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

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

+                      (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)

+                     ) {

                     WPP_SF_dD(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xe,

                               &WPP_b8d49e9a5f893e5c54cd733259ac76dd_Traceguids,

-                              *(undefined4 *)(lVar15 + 10),*(undefined4 *)(lVar15 + 0xe));

+                              *(undefined4 *)(lVar18 + 10),*(undefined4 *)(lVar18 + 0xe));

                   }

-                  *(undefined8 *)(lVar18 + 0x16e0) = *(undefined8 *)(lVar15 + 10);

+                  *(undefined8 *)(p_Var11 + 0x16e0) = *(undefined8 *)(lVar18 + 10);

                 }

-                else if (((WPP_GLOBAL_Control != unaff_R14) && (WPP_GLOBAL_Control[0x69] != '\0'))

-                        && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

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

+                         (WPP_GLOBAL_Control[0x69] != '\0')) &&

+                        ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

                   uVar19 = 0xc;

-                  goto LAB_13;

+                  goto LAB_17;

                 }

               }

-              else if (((WPP_GLOBAL_Control != unaff_R14) && (WPP_GLOBAL_Control[0x69] != '\0')) &&

-                      ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

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

+                       (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0))

+              {

                 uVar19 = 0xd;

-LAB_13:

+LAB_17:

                 WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar19,

-                         &WPP_b8d49e9a5f893e5c54cd733259ac76dd_Traceguids,uVar11);

-              }

-            }

-          }

-        }

-      }

-    }

-  }

-LAB_0:

-  if (*(int *)unaff_RDI == 0x10) {

-    if ((*(int *)(unaff_RDI + 4) == 0x15) || (*(int *)(unaff_RDI + 4) == 0x16)) {

-      EnterCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

-      p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-      if (*(longlong *)(p_Var17 + 0x2c8) != 0) {

-        IntfUpdateAPConnectionStatus(p_Var17);

-        p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-      }

-      LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var17 + 0x90));

-    }

-    if (*(int *)unaff_RDI == 0x10) {

-      if ((*(int *)(unaff_RDI + 4) == 4) || (*(int *)(unaff_RDI + 4) - 0xbU < 2)) {

-        EnterCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

-        p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-        if ((*(longlong *)(p_Var17 + 0x2c8) != 0) &&

-           (*(int *)(*(longlong *)(p_Var17 + 0x2c8) + 0x270) == 2)) {

-          IntfUpdateConnectionAttributes(p_Var17,0);

-          p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-        }

-        LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var17 + 0x90));

-      }

-      if (*(int *)unaff_RDI == 0x10) {

-        iVar10 = *(int *)(unaff_RDI + 4);

-        if (((iVar10 == 0x15) || (iVar10 == 0x16)) || (iVar10 == 0x19)) {

-          EnterCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

-          p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-          if ((*(longlong *)(p_Var17 + 0x2c8) != 0) &&

-             ((iVar10 = *(int *)(*(longlong *)

-                                  (*(longlong *)(*(longlong *)(p_Var17 + 0x2c8) + 600) + 0x228) +

-                                0x14), iVar10 == 8 || (iVar10 == 0x20)))) {

-            IntfUpdateConnectionAttributes(p_Var17,0);

-            p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-          }

-          LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var17 + 0x90));

-        }

-        if (*(int *)unaff_RDI == 0x10) {

-          if (*(int *)(unaff_RDI + 4) == 4) {

-            EnterCriticalSection((LPCRITICAL_SECTION)(*(longlong *)(unaff_RBP + 0x58) + 0x90));

-            p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-            lVar18 = *(longlong *)(p_Var17 + 0x2d0);

+                         &WPP_b8d49e9a5f893e5c54cd733259ac76dd_Traceguids,uVar13);

+              }

+            }

+          }

+        }

+      }

+    }

+  }

+LAB_4:

+  if (*(int *)param_3 == 0x10) {

+    if ((*(int *)(param_3 + 4) == 0x15) || (*(int *)(param_3 + 4) == 0x16)) {

+      EnterCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

+      if (*(longlong *)(local_res20 + 0x2c8) != 0) {

+        IntfUpdateAPConnectionStatus(local_res20);

+      }

+      LeaveCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

+    }

+    if (*(int *)param_3 == 0x10) {

+      if ((*(int *)(param_3 + 4) == 4) || (*(int *)(param_3 + 4) - 0xbU < 2)) {

+        EnterCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

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

+           (*(int *)(*(longlong *)(local_res20 + 0x2c8) + 0x270) == 2)) {

+          IntfUpdateConnectionAttributes(local_res20,0);

+        }

+        LeaveCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

+      }

+      if (*(int *)param_3 == 0x10) {

+        iVar17 = *(int *)(param_3 + 4);

+        if (((iVar17 == 0x15) || (iVar17 == 0x16)) || (iVar17 == 0x19)) {

+          EnterCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

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

+             ((iVar17 = *(int *)(*(longlong *)

+                                  (*(longlong *)(*(longlong *)(local_res20 + 0x2c8) + 600) + 0x228)

+                                + 0x14), iVar17 == 8 || (iVar17 == 0x20)))) {

+            IntfUpdateConnectionAttributes(local_res20,0);

+          }

+          LeaveCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

+        }

+        if (*(int *)param_3 == 0x10) {

+          if (*(int *)(param_3 + 4) == 4) {

+            EnterCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

+            lVar18 = *(longlong *)(local_res20 + 0x2d0);

             if ((lVar18 != 0) &&

                ((*(char *)(lVar18 + 0x300) != '\0' || (*(char *)(lVar18 + 0x301) != '\0')))) {

-              IntfUpdateConnectionAttributes(p_Var17,0);

-              p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-            }

-            LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var17 + 0x90));

-          }

-          if ((*(int *)unaff_RDI == 0x10) && (*(int *)(unaff_RDI + 4) == 0x10007)) {

-            WFDDeviceGONegotiationComplete(unaff_R15,*(void **)(unaff_RDI + 0x20));

-          }

-        }

-      }

-    }

-  }

-  p_Var17 = *(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58);

-  if (*(int *)(p_Var17 + 0x18) == 0x10) {

-    if (*(int *)(p_Var17 + 0xca0) == 0x20) {

-      WFDGOProcessEvent(p_Var17,unaff_RDI);

-    }

-    else if (*(int *)(p_Var17 + 0xca0) == 0x40) {

-      WFDClientProcessEvent(*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58),unaff_RDI);

-    }

-  }

-  if (((*(int *)unaff_RDI == 8) && (*(int *)(unaff_RDI + 4) == 0x21)) &&

-     (*(int *)(*(longlong *)(unaff_RBP + 0x58) + 0x18) == 0x10)) {

-    WFDMgrOnGOTornDown((_GUID *)(*(longlong *)(unaff_RBP + 0x58) + 8));

-  }

-  uVar12 = IntfGenerateStateMachineEvent

-                     (*(_WLAN_INTERFACE_CONTEXT **)(unaff_RBP + 0x58),unaff_R12,unaff_RDI);

-  if (g_nlaPluginEnabled == false) goto LAB_14;

-  if (*(int *)unaff_RDI == 0x10) {

-    if (*(int *)(unaff_RDI + 4) != 10) goto LAB_15;

+              IntfUpdateConnectionAttributes(local_res20,0);

+            }

+            LeaveCriticalSection((LPCRITICAL_SECTION)(local_res20 + 0x90));

+          }

+          if ((*(int *)param_3 == 0x10) && (*(int *)(param_3 + 4) == 0x10007)) {

+            WFDDeviceGONegotiationComplete(param_1,*(void **)(param_3 + 0x20));

+          }

+        }

+      }

+    }

+  }

+  if (*(int *)(local_res20 + 0x18) == 0x10) {

+    if (*(int *)(local_res20 + 0xca0) == 0x20) {

+      WFDGOProcessEvent(local_res20,param_3);

+    }

+    else if (*(int *)(local_res20 + 0xca0) == 0x40) {

+      WFDClientProcessEvent(local_res20,param_3);

+    }

+  }

+  if (((*(int *)param_3 == 8) && (*(int *)(param_3 + 4) == 0x21)) &&

+     (*(int *)(local_res20 + 0x18) == 0x10)) {

+    WFDMgrOnGOTornDown((_GUID *)(local_res20 + 8));

+  }

+  uVar12 = IntfGenerateStateMachineEvent(local_res20,param_2,param_3);

+  p_Var11 = local_res20;

+  if (g_nlaPluginEnabled == false) goto LAB_0;

+  if (*(int *)param_3 == 0x10) {

+    if (*(int *)(param_3 + 4) != 10) goto LAB_18;

   }

   else {

-    if (*(int *)unaff_RDI == 4) {

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

-        puVar7 = *(uint **)(unaff_RDI + 0x20);

-        uVar11 = *(uint *)(unaff_RDI + 0x18);

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

+    if (*(int *)param_3 == 4) {

+      if (*(int *)(param_3 + 4) == 1) {

+        puVar8 = *(uint **)(param_3 + 0x20);

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

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

             (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

           WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x120,

                   &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

         }

-        if (lVar18 == 0) {

+        if (p_Var11 == (_WLAN_INTERFACE_CONTEXT *)0x0) {

           MicrosoftTelemetryAssertTriggeredNoArgs();

         }

-        if (puVar7 == (uint *)0x0) {

-          unaff_R13 = (uchar *)0x57;

-        }

-        else if (uVar11 < 0x28) {

-          unaff_R13 = (uchar *)0x7a;

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

+          DVar23 = 0x57;

+        }

+        else if (uVar13 < 0x28) {

+          DVar23 = 0x7a;

         }

         else {

-          uVar11 = *puVar7;

-          uVar22 = uVar26;

-          if (0x47 < puVar7[6]) {

-            uVar22 = puVar7[0xd];

-          }

-          EnterCriticalSection((LPCRITICAL_SECTION)(lVar18 + 0x90));

-          *(uint *)(lVar18 + 0x924) = uVar22;

-          *(uint *)(lVar18 + 0x920) = uVar11;

-          if ((uVar11 < 2) && (pvVar6 = *(LPVOID *)(lVar18 + 0x930), pvVar6 != (LPVOID)0x0)) {

-            pvVar16 = GetProcessHeap();

-            if (pvVar16 != (HANDLE)0x0) {

-              HeapFree(pvVar16,0,pvVar6);

-            }

-            *(uchar **)(lVar18 + 0x930) = unaff_R13;

-            *(uint *)(lVar18 + 0x928) = uVar26;

-          }

-          LeaveCriticalSection((LPCRITICAL_SECTION)(lVar18 + 0x90));

+          uVar13 = *puVar8;

+          if (0x47 < puVar8[6]) {

+            uVar22 = puVar8[0xd];

+          }

+          EnterCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x90));

+          *(uint *)(p_Var11 + 0x924) = uVar22;

+          *(uint *)(p_Var11 + 0x920) = uVar13;

+          if ((uVar13 < 2) && (pvVar7 = *(LPVOID *)(p_Var11 + 0x930), pvVar7 != (LPVOID)0x0)) {

+            pvVar15 = GetProcessHeap();

+            if (pvVar15 != (HANDLE)0x0) {

+              HeapFree(pvVar15,0,pvVar7);

+            }

+            *(undefined8 *)(p_Var11 + 0x930) = 0;

+            *(undefined4 *)(p_Var11 + 0x928) = 0;

+          }

+          LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x90));

         }

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

             (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

           WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x121,

-                   &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,

-                   (ulonglong)unaff_R13 & 0xffffffff);

-        }

-        if ((int)unaff_R13 == 0) {

-LAB_16:

-          uVar13 = NlaWPlg_OnexDataIndicate();

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

+                   &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,DVar23);

+        }

+        if (DVar23 == 0) {

+LAB_19:

+          uVar14 = NlaWPlg_OnexDataIndicate();

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

              ((WPP_GLOBAL_Control[0x69] != '\0' && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

             uVar19 = 0x156;

-LAB_17:

+LAB_20:

             WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar19,

-                     &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar13);

+                     &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar14);

           }

         }

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

                  (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

           uVar19 = 0x154;

-          uVar13 = uVar12;

-          goto LAB_17;

-        }

-      }

-      else if (*(int *)(unaff_RDI + 4) == 0x10002) {

-        pvVar5 = *(void **)(unaff_RDI + 0x20);

-        uVar11 = *(uint *)(unaff_RDI + 0x18);

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

-        uVar23 = (ulonglong)unaff_R13 & 0xffffffff;

+          uVar14 = uVar12;

+          goto LAB_20;

+        }

+      }

+      else if (*(int *)(param_3 + 4) == 0x10002) {

+        pvVar6 = *(void **)(param_3 + 0x20);

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

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

             (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

           WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x122,

                   &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

         }

-        if (lVar18 == 0) {

+        if (p_Var11 == (_WLAN_INTERFACE_CONTEXT *)0x0) {

           MicrosoftTelemetryAssertTriggeredNoArgs();

         }

-        if (pvVar5 == (void *)0x0) {

-          uVar23 = 0x57;

-        }

-        else if (uVar11 == 0) {

-          uVar23 = 0x7a;

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

+          DVar20 = 0x57;

+        }

+        else if (uVar22 == 0) {

+          DVar20 = 0x7a;

         }

         else {

-          EnterCriticalSection((LPCRITICAL_SECTION)(lVar18 + 0x90));

-          pvVar6 = *(LPVOID *)(lVar18 + 0x930);

-          if (pvVar6 != (LPVOID)0x0) {

-            pvVar16 = GetProcessHeap();

-            if (pvVar16 != (HANDLE)0x0) {

-              HeapFree(pvVar16,0,pvVar6);

-            }

-            *(uchar **)(lVar18 + 0x930) = unaff_R13;

-            *(uint *)(lVar18 + 0x928) = uVar26;

-          }

-          _Dst = (void *)AllocWLMem((ulonglong)uVar11);

-          *(void **)(lVar18 + 0x930) = _Dst;

+          EnterCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x90));

+          pvVar7 = *(LPVOID *)(p_Var11 + 0x930);

+          if (pvVar7 != (LPVOID)0x0) {

+            pvVar15 = GetProcessHeap();

+            if (pvVar15 != (HANDLE)0x0) {

+              HeapFree(pvVar15,0,pvVar7);

+            }

+            *(undefined8 *)(p_Var11 + 0x930) = 0;

+            *(undefined4 *)(p_Var11 + 0x928) = 0;

+          }

+          _Dst = (void *)AllocWLMem((ulonglong)uVar22);

+          *(void **)(p_Var11 + 0x930) = _Dst;

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

-            DVar14 = GetLastError();

-            uVar23 = (ulonglong)DVar14;

+            DVar20 = GetLastError();

           }

           else {

-            *(uint *)(lVar18 + 0x928) = uVar11;

-            memcpy(_Dst,pvVar5,(ulonglong)uVar11);

-          }

-          LeaveCriticalSection((LPCRITICAL_SECTION)(lVar18 + 0x90));

+            *(uint *)(p_Var11 + 0x928) = uVar22;

+            memcpy(_Dst,pvVar6,(ulonglong)uVar22);

+            DVar20 = DVar23;

+          }

+          LeaveCriticalSection((LPCRITICAL_SECTION)(p_Var11 + 0x90));

         }

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

             (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

           WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x123,

-                   &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar23);

-        }

-        if ((int)uVar23 == 0) {

-          unaff_R13 = (uchar *)0x1;

+                   &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,DVar20);

+        }

+        if (DVar20 == 0) {

+          DVar23 = 1;

         }

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

-                 (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+                 (WPP_GLOBAL_Control[0x69] != '\0')) &&

+                (DVar23 = 0, (WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

           WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x155,

                    &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar12);

         }

-        if ((int)unaff_R13 != 0) goto LAB_16;

-      }

-    }

-LAB_15:

-    if (*(int *)(unaff_RBP + 0x50) == 0) goto LAB_14;

-  }

-  uVar13 = NlaWPlg_WLanDataIndicate();

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

+        if (DVar23 != 0) goto LAB_19;

+      }

+    }

+LAB_18:

+    if (!bVar24) goto LAB_0;

+  }

+  uVar14 = NlaWPlg_WLanDataIndicate();

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

       (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

     WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x157,

-             &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar13);

-  }

-LAB_14:

-  if (*(longlong *)(unaff_RBP + 0x58) != 0) {

-    HtDereferenceHandleWithTag(g_hHandleTable,*(undefined8 *)(unaff_RBP + 0x40),0,1);

+             &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar14);

+  }

+LAB_0:

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

+    HtDereferenceHandleWithTag(g_hHandleTable,param_1,0,1);

   }

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

       (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

     WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x158,

              &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar12);

   }

   return uVar12;

 }
```

## `RpcWfdSvcLowPrivConnectSession`  (modified)

```diff
--- RpcWfdSvcLowPrivConnectSession
+++ RpcWfdSvcLowPrivConnectSession
@@ -1,10 +1,69 @@
 

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

-

-void RpcWfdSvcLowPrivConnectSession(void)

+ulong RpcWfdSvcLowPrivConnectSession

+                (void *param_1,__uint64 param_2,undefined8 param_3,_WFD_WPS_INFO *param_4)

 

 {

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

-  halt_baddata();

+  int iVar1;

+  ulong uVar2;

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

+  *this;

+  longlong *plVar3;

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

+  local_res8 [8];

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

+  local_18 [16];

+  

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x307,

+            &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+  }

+  this = (tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

+          *)tip2::

+            start<tip2::tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>_>

+                      ();

+  plVar3 = (longlong *)

+           tip2::

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

+           ::operator->(this);

+  *(undefined1 *)(*plVar3 + 0x110) = 6;

+  tip2::

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

+  ::

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

+            (local_res8);

+  wil::

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

+  ::

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

+            (local_18);

+  if ((param_1 == (void *)0x0) || (param_2 == 0)) {

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

+       ((WPP_GLOBAL_Control[0x69] != '\0' && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

+      WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x308,

+               &WPP_791618f6e4f933247a011d60507f9013_Traceguids,param_1);

+    }

+    uVar2 = 0x57;

+  }

+  else {

+    iVar1 = IsPreventConnectBitSet();

+    if (iVar1 == 0) {

+      uVar2 = WFDMgrWFDSvcConnectSession(param_1,param_2,param_4);

+    }

+    else {

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

+          (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x30a,

+                &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+      }

+      uVar2 = 0x964;

+    }

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x30b,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+  }

+  return uVar2;

 }
```

## `RpcScan`  (modified)

```diff
--- RpcScan
+++ RpcScan
@@ -1,23 +1,194 @@
 

-int RpcScan(longlong param_1,undefined2 param_2)

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

+

+ulong RpcScan(WlanRpcClientContext *param_1,_GUID *param_2,_DOT11_SSID *param_3,

+             _WLAN_RAW_DATA *param_4)

 

 {

-  undefined1 uVar1;

-  int unaff_EBP;

-  undefined1 *unaff_RDI;

-  undefined *unaff_R15;

-  bool in_ZF;

+  bool bVar1;

+  ulong uVar2;

+  WlanRpcServerContext *this;

+  undefined8 uVar3;

+  int iVar4;

+  void *pvVar5;

+  undefined1 auStack_c8 [32];

+  _WLAN_INTERFACE_ENTRY **local_a8;

+  undefined8 local_a0;

+  undefined1 local_98 [8];

+  int local_90 [2];

+  _WLAN_INTERFACE_ENTRY *local_88;

+  _WLAN_INTERFACE_ENTRY *local_80 [2];

+  undefined1 *local_70;

+  undefined4 local_68;

+  undefined4 local_64;

+  int *local_60;

+  undefined4 local_58;

+  undefined4 local_54;

+  ulonglong local_50;

   

-  uVar1 = in(param_2);

-  *unaff_RDI = uVar1;

-  if (!in_ZF) {

-    WPP_SF_D(*(undefined8 *)(param_1 + 0x60),unaff_EBP + 0xd);

+  local_50 = __security_cookie ^ (ulonglong)auStack_c8;

+  this = (WlanRpcServerContext *)WPP_GLOBAL_Control;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    this = *(WlanRpcServerContext **)(WPP_GLOBAL_Control + 0x60);

+    WPP_SF_(this,0x65,&WPP_791618f6e4f933247a011d60507f9013_Traceguids);

   }

-  *(undefined4 *)(unaff_RDI + 0x29) = 0;

-  if (((WPP_GLOBAL_Control != unaff_R15) && (3 < (byte)WPP_GLOBAL_Control[0x69])) &&

-     ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xf);

+  bVar1 = wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess

+                    (this,param_1);

+  if (!bVar1) {

+    uVar2 = 5;

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

+      return 5;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+      return 5;

+    }

+    if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+      return 5;

+    }

+    uVar3 = 0x66;

+    goto LAB_0;

   }

-  return unaff_EBP;

+  if ((param_3 != (_DOT11_SSID *)0x0) && (0x20 < *(uint *)param_3)) {

+    uVar2 = 0x57;

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

+      return 0x57;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+      return 0x57;

+    }

+    if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+      return 0x57;

+    }

+    uVar3 = 0x67;

+    goto LAB_0;

+  }

+  local_88 = (_WLAN_INTERFACE_ENTRY *)0x0;

+  local_90[0] = 0;

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

+     ((3 < (byte)WPP_GLOBAL_Control[0x69] && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),10,

+            &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

+  }

+  local_a8 = &local_88;

+  local_a0 = 0;

+  uVar2 = AcmQueryInterface(param_2,0x25,1,local_90);

+  iVar4 = 0;

+  if (uVar2 == 0) {

+    if ((local_90[0] == 4) && (*(int *)local_88 != 0)) {

+      iVar4 = 1;

+    }

+    else {

+      uVar2 = 0x32;

+      iVar4 = 0;

+    }

+  }

+  if (local_88 != (_WLAN_INTERFACE_ENTRY *)0x0) {

+    FreeWLMem();

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb,

+             &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids,iVar4);

+  }

+  if (iVar4 == 0) {

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

+      return uVar2;

+    }

+    if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+      return uVar2;

+    }

+    if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+      return uVar2;

+    }

+    uVar3 = 0x68;

+    goto LAB_0;

+  }

+  if ((DAT_1 & 0x20) != 0) {

+    local_90[0] = *(int *)(param_1 + 0x184);

+    local_64 = 0;

+    local_54 = 0;

+    local_70 = local_98;

+    local_60 = local_90;

+    local_a8 = local_80;

+    local_98[0] = 2;

+    local_68 = 1;

+    local_58 = 4;

+    McGenEventWrite_EventWriteTransfer(&WLANSVC_EVT_GUID_Context,&WlanSvcRpcCall);

+  }

+  pvVar5 = (void *)0x0;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x46,

+            &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

+  }

+  uVar2 = 0;

+  local_88 = (_WLAN_INTERFACE_ENTRY *)0x0;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb0,

+            &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids);

+  }

+  if (param_2 == (_GUID *)0x0) {

+    uVar2 = 0x57;

+LAB_2:

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb2,

+               &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids,uVar2);

+    }

+  }

+  else {

+    EnterCriticalSection((LPCRITICAL_SECTION)&DAT_3);

+    WimGetInterfaceEntry(param_2,0x25,&local_88);

+    if (local_88 == (_WLAN_INTERFACE_ENTRY *)0x0) {

+      uVar2 = 0x490;

+    }

+    else {

+      pvVar5 = *(void **)(local_88 + 0x18);

+    }

+    LeaveCriticalSection((LPCRITICAL_SECTION)&DAT_3);

+    if (uVar2 != 0x490) goto LAB_2;

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

+      if ((1 < (byte)WPP_GLOBAL_Control[0x69]) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF__guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb1,

+                      &WPP_4551eef7f2eb3a3fc91b9ac61e17d605_Traceguids,param_2);

+      }

+      goto LAB_2;

+    }

+  }

+  if (uVar2 == 0) {

+    uVar2 = IntfScan(pvVar5,1,param_3,param_4);

+  }

+  else {

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

+      return uVar2;

+    }

+    if ((WPP_GLOBAL_Control[0x69] != '\0') && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

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

+               &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids,uVar2);

+    }

+  }

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

+    return uVar2;

+  }

+  if ((3 < (byte)WPP_GLOBAL_Control[0x69]) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x48,

+             &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids,uVar2);

+  }

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

+    return uVar2;

+  }

+  if ((byte)WPP_GLOBAL_Control[0x69] < 4) {

+    return uVar2;

+  }

+  if ((WPP_GLOBAL_Control[0x6c] & 1) == 0) {

+    return uVar2;

+  }

+  uVar3 = 0x69;

+LAB_0:

+  WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar3,

+           &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+  return uVar2;

 }
```

## `RpcWfdSvcLowPrivOpenSeekerSession`  (modified)

```diff
--- RpcWfdSvcLowPrivOpenSeekerSession
+++ RpcWFDSvcLowPrivUnpublishService
@@ -1,143 +1,56 @@
 

-ulong RpcWfdSvcLowPrivOpenSeekerSession

-                (_GUID *param_1,void *param_2,undefined4 param_3,ushort *param_4,uchar *param_5,

-                ulong param_6,ulong *param_7,__uint64 *param_8)

+ulong RpcWFDSvcLowPrivUnpublishService(void *param_1,ulong param_2)

 

 {

-  int iVar1;

-  ulong uVar2;

+  ulong uVar1;

   tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

   *this;

-  longlong *plVar3;

-  void **ppvVar4;

-  undefined8 uVar5;

-  WfdTelemSessionHandleInternal *pWVar6;

-  ulong local_78 [2];

-  ushort *local_70;

-  ushort *local_68;

+  longlong *plVar2;

   test_data_control<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

-  local_60 [8];

+  local_res8 [8];

   com_ptr_t<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>,wil::err_returncode_policy>

-  local_58 [8];

-  undefined8 local_50;

-  int aiStack_48 [2];

-  void *local_40;

+  local_res18 [8];

   

-  local_70 = (ushort *)0x0;

-  local_68 = (ushort *)0x0;

-  local_78[0] = 0;

-  local_50 = 0;

-  aiStack_48[0] = 0;

-  aiStack_48[1] = 0;

-  local_40 = (HANDLE)0x0;

-  pWVar6 = (WfdTelemSessionHandleInternal *)0x0;

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

       (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2ef,

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2ec,

             &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

   }

   this = (tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

           *)tip2::

             start<tip2::tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>_>

                       ();

-  plVar3 = (longlong *)

+  plVar2 = (longlong *)

            tip2::

            tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

            ::operator->(this);

-  *(undefined1 *)(*plVar3 + 0x110) = 3;

+  *(undefined1 *)(*plVar2 + 0x110) = 2;

   tip2::

   test_data_control<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

   ::

   ~test_data_control<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

-            (local_60);

+            (local_res8);

   wil::

   com_ptr_t<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>,wil::err_returncode_policy>

   ::

   ~com_ptr_t<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>,wil::err_returncode_policy>

-            (local_58);

-  if (((param_8 == (__uint64 *)0x0) || (param_2 == (void *)0x0)) ||

-     ((param_5 == (uchar *)0x0 || (param_7 == (ulong *)0x0)))) {

+            (local_res18);

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

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

         (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-      WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2f0,

-               &WPP_791618f6e4f933247a011d60507f9013_Traceguids,param_2);

+      WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2ed,

+               &WPP_791618f6e4f933247a011d60507f9013_Traceguids,0);

     }

-    uVar2 = 0x57;

+    uVar1 = 0x57;

   }

   else {

-    iVar1 = IsPreventConnectBitSet();

-    if (iVar1 == 0) {

-      uVar2 = LocalGetClientAppInfo(&local_70,&local_68);

-      if (uVar2 == 0) {

-        uVar2 = LocalGetClientSessionId(local_78);

-        if (uVar2 == 0) {

-          ppvVar4 = &local_40;

-          uVar2 = LocalQueryRpcClientToken(ppvVar4);

-          if (uVar2 == 0) {

-            uVar2 = WfdGetRpcCallerDetails

-                              (ppvVar4,(ulong *)((longlong)&local_50 + 4),aiStack_48,aiStack_48 + 1)

-            ;

-            if (uVar2 == 0) {

-              local_50 = CONCAT44(local_50._4_4_,param_3);

-              pWVar6 = WfdTelemBeginSession(param_2,param_5,4,param_1);

-              uVar2 = WFDMgrWFDSvcOpenSeekerSession

-                                (param_2,param_4,param_5,param_6,local_70,local_68,local_78[0],

-                                 (_WFD_SVC_RPC_CALL_INFO *)&local_50,pWVar6,param_7,param_8);

-              if (uVar2 == 0) goto LAB_0;

-            }

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

-                     (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-              uVar5 = 0x2f6;

-              goto LAB_1;

-            }

-          }

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

-                   (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-            uVar5 = 0x2f5;

-            goto LAB_1;

-          }

-        }

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

-                 (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-          uVar5 = 0x2f4;

-          goto LAB_1;

-        }

-      }

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

-               (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-        uVar5 = 0x2f3;

-LAB_1:

-        WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar5,

-                 &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

-      }

-    }

-    else {

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

-          (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2f2,

-                &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

-      }

-      uVar2 = 0x964;

-      pWVar6 = (WfdTelemSessionHandleInternal *)0x0;

-    }

-  }

-  WfdTelemSessionConnectionComplete(pWVar6,4,uVar2);

-LAB_0:

-  WfdTelemCloseHandle(pWVar6);

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

-    LocalFreeClientAppSid(local_70);

-  }

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

-    LocalFree(local_68);

-  }

-  if (local_40 != (HANDLE)0x0) {

-    CloseHandle(local_40);

+    uVar1 = WFDMgrWFDSvcUnpublishService(param_1,param_2);

   }

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

       (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2f7,

-             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x2ee,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar1);

   }

-  return uVar2;

+  return uVar1;

 }
```

## `RpcInternalRequestFtm`  (modified)

```diff
--- RpcInternalRequestFtm
+++ RpcInternalRequestFtm
@@ -1,33 +1,108 @@
 

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

-

-ulonglong RpcInternalRequestFtm(undefined *param_1,undefined2 param_2)

+void RpcInternalRequestFtm

+               (_RPC_ASYNC_STATE *param_1,WlanRpcClientContext *param_2,_GUID *param_3,uint param_4,

+               _DOT11_FTM_TARGET *param_5,ulong *param_6,uchar **param_7)

 

 {

-  undefined1 uVar1;

-  undefined4 in_EAX;

-  longlong unaff_RBX;

-  undefined1 *unaff_RDI;

-  byte unaff_R12B;

-  undefined *unaff_R13;

-  bool in_ZF;

+  bool bVar1;

+  ulong uVar2;

+  int iVar3;

+  WlanRpcServerContext *pWVar4;

+  undefined8 uVar5;

+  ulong local_res8 [2];

+  int local_38 [2];

+  WlanRpcServerContext *local_30;

   

-  uVar1 = in(param_2);

-  *unaff_RDI = uVar1;

-  if (!in_ZF) {

-    WPP_SF_D(*(undefined8 *)(param_1 + 0x60),0xa6,&WPP_791618f6e4f933247a011d60507f9013_Traceguids,

-             in_EAX);

-    param_1 = WPP_GLOBAL_Control;

+  local_30 = (WlanRpcServerContext *)0x0;

+  local_38[0] = 0;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xe8,

+            &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

   }

-  if (unaff_RBX != 0) {

-    FreeWLMem();

-    param_1 = WPP_GLOBAL_Control;

+  if ((((param_1 == (_RPC_ASYNC_STATE *)0x0) || (param_2 == (WlanRpcClientContext *)0x0)) ||

+      ((param_3 == (_GUID *)0x0 || ((0x167 < param_4 - 1 || (param_6 == (ulong *)0x0)))))) ||

+     (param_7 == (uchar **)0x0)) {

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

+        (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xe9,

+              &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+    }

+    uVar2 = 0x57;

+LAB_0:

+    if (uVar2 == 0) goto LAB_1;

   }

-  if (((param_1 != unaff_R13) && (3 < (byte)param_1[0x69])) && ((param_1[0x6c] & unaff_R12B) != 0))

-  {

-    WPP_SF_D(*(undefined8 *)(param_1 + 0x60),0xa7,&WPP_791618f6e4f933247a011d60507f9013_Traceguids,

-             (ulonglong)(unaff_RDI + 1) & 0xffffffff);

+  else {

+    pWVar4 = (WlanRpcServerContext *)local_38;

+    uVar2 = IsCallerLocationSvc((int *)pWVar4);

+    local_res8[0] = uVar2;

+    if (uVar2 != 0) {

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

+          (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        uVar5 = 0xea;

+        goto LAB_2;

+      }

+      goto LAB_0;

+    }

+    bVar1 = wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess

+                      (pWVar4,param_2);

+    if (bVar1) {

+      uVar2 = ValidatePrivileged();

+      if ((uVar2 == 0) || (local_38[0] != 0)) {

+        iVar3 = AcmIsAPIAllowed(param_3,0x10,1,local_res8);

+        if (iVar3 == 0) {

+          uVar2 = local_res8[0];

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

+              (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+            uVar5 = 0xec;

+LAB_2:

+            WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar5,

+                     &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+          }

+        }

+        else {

+          uVar2 = WimGetInterfaceContextHandle(param_3,1,(ulong *)0x0,&local_30);

+          if (uVar2 == 0) {

+            pWVar4 = local_30;

+            uVar2 = IntfRequestFtm(local_30,param_1,param_4 / 0xc,param_5,param_6,param_7);

+            if (uVar2 == 0) {

+              wlansvc::rpc_server::details::WlanRpcServerContext::NotifyCamWiFiControlUsed

+                        (pWVar4,param_2);

+            }

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

+                     (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+              uVar5 = 0xee;

+              goto LAB_2;

+            }

+          }

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

+                   (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+            uVar5 = 0xed;

+            goto LAB_2;

+          }

+        }

+        goto LAB_0;

+      }

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

+          (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xeb,

+                &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+      }

+    }

+    uVar2 = 5;

   }

-  return (ulonglong)(unaff_RDI + 1) & 0xffffffff;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xef,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+  }

+  RpcAsyncAbortCall(param_1,uVar2);

+LAB_1:

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xf0,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+  }

+  return;

 }
```

## `IntfInitContext`  (modified)

```diff
--- IntfInitContext
+++ IntfInitContext
@@ -1,79 +1,327 @@
 

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

+   guard_dispatch_icall */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+/* unsigned long __cdecl IntfInitContext(void * __ptr64,struct _MSM_CONTEXT * __ptr64,unsigned long

+   * __ptr64,struct _WLAN_INTERFACE_WIFICX_METADATA * __ptr64) */

 

 ulong __cdecl

 IntfInitContext(void *param_1,_MSM_CONTEXT *param_2,ulong *param_3,

                _WLAN_INTERFACE_WIFICX_METADATA *param_4)

 

 {

-  int iVar1;

-  RuntimeConfig *pRVar2;

-  _WLAN_INTERFACE_CONTEXT *unaff_RBX;

-  ulong unaff_ESI;

-  undefined *puVar3;

-  undefined8 unaff_R12;

-  undefined8 unaff_R14;

-  undefined *unaff_R15;

-  _WLAN_INTERFACE_CONTEXT *p_Stack0000000000000028;

-  undefined8 uStack0000000000000030;

-  undefined8 *in_stack_00000078;

+  ulong uVar1;

+  undefined4 extraout_XMM0_Da;

+  undefined1 auStackY_258 [32];

+  uchar *local_1b0;

+  ulong local_1a8 [6];

+  _WLAN_INTERFACE_WIFICX_METADATA *local_190;

+  undefined8 local_120;

+  undefined8 uStack_118;

+  undefined8 local_110;

+  undefined8 uStack_108;

+  undefined4 local_f8 [12];

+  void *local_c8;

+  ulong local_70;

+  void *local_68;

+  ulonglong local_40;

   

-  WLNotifyCompleteTimely();

-  if (*(longlong *)(unaff_RBX + 0x2d0) != 0) {

-    if (*(int *)(unaff_RBX + 0x18) == 0x20) {

-      IpCleanProfileConfigForSecondarySta

-                ((_GUID *)(unaff_RBX + 8),(_GUID *)(unaff_RBX + 0xca8),(ushort *)param_3);

+  local_40 = __security_cookie ^ (ulonglong)auStackY_258;

+  local_120 = 0;

+  uStack_118 = 0;

+  local_110 = 0;

+  uStack_108 = 0;

+  local_1b0 = (uchar *)0x0;

+  local_1a8[0] = 0;

+  local_190 = param_4;

+  local_68 = param_1;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x47,

+            &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

+  }

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

+    MicrosoftTelemetryAssertTriggeredNoArgs();

+  }

+  WimQueryAutoConfigParameter(8,local_1a8,&local_1b0,(_WLAN_OPCODE_VALUE_TYPE *)0x0);

+  if (local_1b0 != (uchar *)0x0) {

+    FreeWLMem();

+    local_1b0 = (uchar *)0x0;

+  }

+  uVar1 = HtReferenceHandleWithTag(g_hHandleTable,param_1,0x564f4944,0);

+  if (uVar1 == 0) {

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

+        (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x49,

+              &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

     }

-    else {

-      IpCleanProfileConfig

-                ((_GUID *)(unaff_RBX + 8),(ushort *)(*(longlong *)(unaff_RBX + 0x2d0) + 0x18));

-    }

-  }

-  if ((((g_bAoAc != (uchar)unaff_R12) &&

-       (iVar1 = (int)unaff_R12, *(int *)(unaff_RBX + 0x16bc) != iVar1)) && (DAT_0 == iVar1))

-     && (((*(int *)(unaff_RBX + 0x18) == 1 &&

-          ((*(longlong *)(unaff_RBX + 0x300) == 0 ||

-           (*(int *)(*(longlong *)(unaff_RBX + 0x300) + 0x104) == iVar1)))) &&

-         (puVar3 = WPP_GLOBAL_Control,

-         pRVar2 = CfgGetConfigurationByGuid

-                            ((_LIST_ENTRY *)(unaff_RBX + 0x2e0),

-                             (_GUID *)(*(longlong *)(unaff_RBX + 0x2d0) + 0x218)),

-         pRVar2 != (RuntimeConfig *)0x0)))) {

-    if (((puVar3 != unaff_R15) && (3 < (byte)puVar3[0x69])) && ((puVar3[0x6c] & 1) != 0)) {

-      WPP_SF_SD(*(undefined8 *)(puVar3 + 0x60),0xf7,&WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids

-                ,*(longlong *)(pRVar2 + 0x18) + 0x18);

-    }

-    CfgUpdateCsConnectionFailed(pRVar2,(_GUID *)(unaff_RBX + 8));

-  }

-  if (*(int *)(*(longlong *)(unaff_RBX + 0x2d0) + 0x290) == 4) {

-    IntfNotifyConnectionFailure(unaff_RBX,unaff_ESI,1);

-    CfgFreeSelection(*(WLAN_CONFIG_SELECTION **)(unaff_RBX + 0x2d0));

-    *(undefined8 *)(unaff_RBX + 0x2d0) = unaff_R12;

-  }

-  else {

-    IntfNotifyConnectionFailure(unaff_RBX,unaff_ESI,0);

-    iVar1 = AcmStopAllConnAttempts(unaff_ESI);

-    if (iVar1 != 0) {

-      if (((WPP_GLOBAL_Control != unaff_R15) && (2 < (byte)WPP_GLOBAL_Control[0x69])) &&

-         ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xf8,

-                &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

-      }

-      if ((DAT_1 & 4) != 0) {

-        McTemplateU0jz_EventWriteTransfer();

-      }

-      CfgFreeSelectionList((_LIST_ENTRY *)(unaff_RBX + 0x338));

-    }

-  }

-  if ((DAT_1 & 8) != 0) {

-    uStack0000000000000030 = *(undefined8 *)(unaff_RBX + 0x80);

-    p_Stack0000000000000028 = unaff_RBX + 8;

-    McTemplateU0qqqjz_EventWriteTransfer

-              (p_Stack0000000000000028,&WlanSvcConnectionFailed,unaff_ESI,0x1ae1);

-  }

-  *in_stack_00000078 = 0x20;

-  in_stack_00000078[1] = unaff_R14;

-  *(undefined1 *)(in_stack_00000078 + 2) = 1;

-  return (ulong)in_stack_00000078;

+    uVar1 = 0x57;

+  }

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

+           (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x48,

+             &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar1);

+  }

+  GetBooleanWiFiMDMPolicy(0);

+  WimIsClientSku();

+  GetBooleanWiFiMDMPolicy(2);

+  if (g_bNotifyWDiag != 0) {

+    memset(local_f8,0,0x90);

+    local_f8[0] = 4;

+    local_c8 = param_1;

+    local_70 = uVar1;

+    WDiagNotifyEvent(extraout_XMM0_Da,local_f8);

+  }

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x61,

+             &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar1);

+  }

+  return uVar1;

 }
```

## `RpcWfdSvcLowPrivCancelSession`  (modified)

```diff
--- RpcWfdSvcLowPrivCancelSession
+++ RpcWfdSvcLowPrivCancelSession
@@ -1,107 +1,54 @@
 

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

-

-ulonglong *

-RpcWfdSvcLowPrivCancelSession

-          (longlong param_1,uint param_2,

-          basic_string<char,std::char_traits<char>,std::allocator<char>_> *param_3,

-          undefined8 param_4)

+undefined8 RpcWfdSvcLowPrivCancelSession(longlong param_1,longlong param_2)

 

 {

-  undefined4 in_EAX;

-  basic_string<char,struct_std::char_traits<char>,class_std::allocator<char>_> *pbVar1;

-  ulonglong *puVar2;

-  char *pcVar3;

-  uint uVar4;

-  longlong unaff_RBX;

-  longlong in_R11;

-  char in_ZF;

-  undefined1 auStack_a8 [32];

-  ulonglong *puStack_88;

-  ulonglong uStack_78;

-  undefined8 uStack_70;

-  longlong lStack_68;

-  undefined8 uStack_60;

-  basic_string<char,std::char_traits<char>,std::allocator<char>_> abStack_58 [16];

-  longlong lStack_48;

-  basic_string<char,std::char_traits<char>,std::allocator<char>_> abStack_38 [32];

-  ulonglong uStack_18;

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

+  *this;

+  longlong *plVar1;

+  undefined8 uVar2;

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

+  local_res8 [8];

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

+  local_res18 [16];

   

-  puVar2 = (ulonglong *)(param_1 + -1);

-  if (puVar2 == (ulonglong *)0x0 || in_ZF != '\0') {

-    *(undefined4 *)(unaff_RBX + -0x28) = in_EAX;

-    *(undefined8 *)(in_R11 + -0x30) = param_4;

-    *(longlong *)(in_R11 + -0x38) = in_R11 + 0x30;

-    *(undefined8 *)(in_R11 + -0x40) = param_4;

-    *(longlong *)(in_R11 + -0x48) = in_R11 + 0x28;

-    *(undefined8 *)(in_R11 + -0x50) = param_4;

-    *(longlong *)(in_R11 + -0x58) = in_R11 + 0x20;

-    puVar2 = (ulonglong *)TraceMessage(puVar2,0x2b,param_3,param_2 & 0xffff);

-    return puVar2;

+  uVar2 = 0;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x30c,

+            &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

   }

-  uStack_18 = __security_cookie ^ (ulonglong)auStack_a8;

-  uStack_70 = 0;

-  lStack_68 = 0;

-  uStack_60 = 0xf;

-  uStack_78 = 0;

-  puStack_88 = puVar2;

-  std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::

-  basic_string<char,std::char_traits<char>,std::allocator<char>_>(abStack_58,"|");

-  for (; param_2 != 0; param_2 = param_2 & ~uVar4) {

-    uVar4 = -param_2 & param_2;

-    if (uVar4 == 1) {

-      pcVar3 = "Hidden";

+  this = (tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

+          *)tip2::

+            start<tip2::tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>_>

+                      ();

+  plVar1 = (longlong *)

+           tip2::

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

+           ::operator->(this);

+  *(undefined1 *)(*plVar1 + 0x110) = 7;

+  tip2::

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

+  ::

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

+            (local_res8);

+  wil::

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

+  ::

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

+            (local_res18);

+  if ((param_1 == 0) || (param_2 == 0)) {

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

+       ((WPP_GLOBAL_Control[0x69] != '\0' && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

+      WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x30d,

+               &WPP_791618f6e4f933247a011d60507f9013_Traceguids,param_1);

     }

-    else if (uVar4 == 2) {

-      pcVar3 = "AdhocJoinOnly";

-    }

-    else if (uVar4 == 4) {

-      pcVar3 = "IgnorePrivacyBit";

-    }

-    else if (uVar4 == 8) {

-      pcVar3 = "EapolPassthrough";

-    }

-    else if (uVar4 == 0x10) {

-      pcVar3 = "DiscoveryPersistProfile";

-    }

-    else if (uVar4 == 0x20) {

-      pcVar3 = "DiscoveryPersistAutoConnect";

-    }

-    else if (uVar4 == 0x40) {

-      pcVar3 = "DiscoveryPersistOverwrite";

-    }

-    else {

-      pcVar3 = "ToStringFailed";

-    }

-    param_3 = abStack_58;

-    pbVar1 = (basic_string<char,struct_std::char_traits<char>,class_std::allocator<char>_> *)

-             std::operator+<char,std::char_traits<char>,std::allocator<char>_>

-                       ((char *)abStack_38,

-                        (basic_string<char,struct_std::char_traits<char>,class_std::allocator<char>_>

-                         *)pcVar3);

-    std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::append

-              ((basic_string<char,std::char_traits<char>,std::allocator<char>_> *)&uStack_78,pbVar1)

-    ;

-    std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::

-    ~basic_string<char,std::char_traits<char>,std::allocator<char>_>(abStack_38);

+    uVar2 = 0x57;

   }

-  if (lStack_68 != 0) {

-    std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::resize

-              ((basic_string<char,std::char_traits<char>,std::allocator<char>_> *)&uStack_78,

-               lStack_68 - lStack_48,(char)param_3);

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x30e,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

   }

-  *puVar2 = uStack_78;

-  *(undefined8 *)(param_1 + 7) = uStack_70;

-  *(longlong *)(param_1 + 0xf) = lStack_68;

-  *(undefined8 *)(param_1 + 0x17) = uStack_60;

-  lStack_68 = 0;

-  uStack_60 = 0xf;

-  uStack_78 = uStack_78 & 0xffffffffffffff00;

-  std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::

-  ~basic_string<char,std::char_traits<char>,std::allocator<char>_>(abStack_58);

-  std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::

-  ~basic_string<char,std::char_traits<char>,std::allocator<char>_>

-            ((basic_string<char,std::char_traits<char>,std::allocator<char>_> *)&uStack_78);

-  return puVar2;

+  return uVar2;

 }
```

## `WDiagProcessACMEvent`  (modified)

```diff
--- WDiagProcessACMEvent
+++ WDiagProcessACMEvent
@@ -1,42 +1,468 @@
+

+/* unsigned long __cdecl WDiagProcessACMEvent(struct _WDIAG_INTERNAL_EVENT * __ptr64) */

 

 ulong __cdecl WDiagProcessACMEvent(_WDIAG_INTERNAL_EVENT *param_1)

 

 {

-  ulong uVar1;

-  undefined8 uStack0000000000000028;

-  undefined1 *puStack0000000000000030;

-  undefined8 uStack0000000000000038;

-  undefined1 *puStack0000000000000050;

-  undefined8 uStack0000000000000058;

-  undefined1 *puStack0000000000000060;

-  undefined8 uStack0000000000000068;

-  undefined1 *puStack0000000000000070;

-  undefined8 uStack0000000000000078;

-  undefined1 *puStack0000000000000080;

-  undefined8 uStack0000000000000088;

-  undefined1 *puStack0000000000000090;

-  undefined8 uStack0000000000000098;

-  undefined1 *puStack00000000000000a0;

-  undefined8 uStack00000000000000a8;

-  undefined8 uStack00000000000000b8;

+  ushort uVar1;

+  WDIAG_ENUM_EVENT_CODE WVar2;

+  undefined4 uVar3;

+  ulong uVar4;

+  int iVar5;

+  ulong uVar6;

+  undefined8 uVar7;

+  _PM_PROFILE *p_Var8;

+  __uint64 _Var9;

+  uint uVar10;

+  ulong uVar11;

+  _DOT11_BSS_TYPE _Var12;

+  ushort *puVar13;

+  ulong uVar14;

+  ushort *puVar15;

+  PasspointFlag PVar16;

+  _PM_PROFILE *in_RDX;

+  longlong lVar17;

+  _GUID *p_Var18;

+  longlong lVar19;

+  ULONG DueTime;

+  char *in_R8;

+  ulonglong uVar20;

+  ULONG Period;

+  _GUID *p_Var22;

+  _GUID *p_Var23;

+  int iVar24;

+  int iVar25;

+  _GUID *p_Var26;

+  undefined8 local_res8;

+  _GUID *local_res10;

+  _WD_CONNECTION_CONTEXT *local_res18;

+  _PM_PROFILE *local_res20;

+  ulong in_stack_ffffffffffffff58;

+  ulong in_stack_ffffffffffffff68;

+  _GUID **pp_Var27;

+  _WD_CONNECTION_CONTEXT *local_58;

+  DOT11_SSID_LIST *local_50;

+  ulonglong uVar21;

   

-  uStack00000000000000b8 = 4;

-  uStack00000000000000a8 = 4;

-  puStack00000000000000a0 = &stack0x00000158;

-  puStack0000000000000090 = &stack0x00000150;

-  uStack0000000000000098 = 4;

-  puStack0000000000000080 = &stack0x00000148;

-  uStack0000000000000088 = 4;

-  puStack0000000000000070 = &stack0x00000140;

-  uStack0000000000000078 = 4;

-  puStack0000000000000060 = &stack0x00000138;

-  uStack0000000000000068 = 4;

-  puStack0000000000000050 = &stack0x00000130;

-  uStack0000000000000058 = 4;

-  puStack0000000000000030 = &stack0x00000120;

-  uStack0000000000000038 = 4;

-  uStack0000000000000028 = 4;

-  uVar1 = TraceMessage();

-  return uVar1;

+  iVar25 = 0;

+  local_res10 = (_GUID *)0x0;

+  LogACMEvent(param_1);

+  uVar10 = local_res8._4_4_;

+  p_Var22 = (_GUID *)(longlong)*(int *)param_1;

+  local_res8 = (_DOT11_AC_PROFILE *)((ulonglong)local_res8._4_4_ << 0x20);

+  p_Var26 = (_GUID *)0x0;

+  switch(*(int *)param_1) {

+  case 0:

+  case 1:

+  case 6:

+  case 7:

+  case 8:

+  case 9:

+  case 10:

+  case 0xb:

+  case 0xc:

+  case 0xd:

+  case 0xe:

+  case 0xf:

+  case 0x10:

+  case 0x11:

+  case 0x12:

+  case 0x13:

+  case 0x14:

+  case 0x15:

+  case 0x17:

+    break;

+  case 2:

+  case 4:

+    p_Var26 = (_GUID *)0x1;

+    break;

+  case 3:

+    local_res8 = (_DOT11_AC_PROFILE *)CONCAT44(uVar10,1);

+  case 5:

+    p_Var26 = (_GUID *)0x3;

+    break;

+  default:

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

+        (WPP_GLOBAL_Control[0xe1] != '\0')) && ((WPP_GLOBAL_Control[0xe4] & 4) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x87,

+               &WPP_fec73b95d5a537674450248f38664378_Traceguids);

+    }

+    return 0x57;

+  case 0x18:

+    p_Var26 = (_GUID *)0x0;

+    if (g_bPeriodicOrDiagnosticPacketStatsEnabled != 0) {

+      WDiagAcquireExLock(&g_WDiag,(_WDIAG_RW_LOCK *)&DAT_0,"WDiagProcessACMEvent",0xbf7);

+      if (DAT_1 != (HANDLE)0x0) {

+        if (*(int *)(param_1 + 0x60) == 0) {

+          Period = 0xffffffff;

+          DueTime = 0xffffffff;

+        }

+        else {

+          Period = 60000;

+          DueTime = 30000;

+        }

+        ChangeTimerQueueTimer((HANDLE)0x0,DAT_1,DueTime,Period);

+      }

+      p_Var22 = (_GUID *)0xc13;

+      in_R8 = "WDiagProcessACMEvent";

+      in_RDX = (_PM_PROFILE *)&DAT_0;

+      WDiagReleaseExLock(&g_WDiag,(_WDIAG_RW_LOCK *)&DAT_0,"WDiagProcessACMEvent",0xc13);

+    }

+  }

+  p_Var18 = (_GUID *)0x0;

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

+    in_R8 = *(char **)(param_1 + 0x30);

+    pp_Var27 = &local_res10;

+    in_RDX = *(_PM_PROFILE **)(param_1 + 0x28);

+    p_Var23 = (_GUID *)(param_1 + 4);

+    uVar11 = WDiagFindAndReferenceInterface

+                       (p_Var23,in_RDX,in_R8,(eINTF_MATCH_METHOD)p_Var26,in_stack_ffffffffffffff58,

+                        (int *)&local_res8,(_WD_INTERFACE_CONTEXT **)pp_Var27);

+    in_stack_ffffffffffffff68 = (ulong)pp_Var27;

+    if (uVar11 != 0) {

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

+        return uVar11;

+      }

+      if (WPP_GLOBAL_Control[0xe1] == '\0') {

+        return uVar11;

+      }

+      if ((WPP_GLOBAL_Control[0xe4] & 4) == 0) {

+        return uVar11;

+      }

+      WPP_SF_ddqq_guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8));

+      return uVar11;

+    }

+    p_Var18 = local_res10;

+    p_Var22 = p_Var26;

+    if (((*(int *)param_1 == 3) && ((_DOT11_BSS_TYPE)local_res8 == 0)) &&

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

+        ((2 < (byte)WPP_GLOBAL_Control[0xe1] && ((WPP_GLOBAL_Control[0xe4] & 4) != 0)))))) {

+      in_stack_ffffffffffffff58 = (ulong)*(undefined8 *)(param_1 + 0x30);

+      WPP_SF__guid_q(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8));

+      p_Var18 = local_res10;

+      p_Var22 = p_Var23;

+    }

+  }

+  uVar11 = 0;

+  WVar2 = *(WDIAG_ENUM_EVENT_CODE *)param_1;

+  iVar24 = iVar25;

+  iVar5 = 0;

+  switch(WVar2) {

+  case 0:

+    in_RDX = (_PM_PROFILE *)(ulonglong)*(uint *)(param_1 + 100);

+    uVar11 = WDiagProcessSCMNotification

+                       (*(ulong *)(param_1 + 0x60),*(uint *)(param_1 + 100),in_R8,p_Var22,

+                        in_stack_ffffffffffffff58);

+    break;

+  case 1:

+    in_RDX = *(_PM_PROFILE **)(param_1 + 0x30);

+    uVar11 = WDiagProcessInternalNotification

+                       ((_WD_INTERFACE_CONTEXT *)p_Var18,in_RDX,*(void **)(param_1 + 0x38),

+                        *(_L2_NOTIFICATION_DATA **)(param_1 + 0x40),*(void **)(param_1 + 0x48),

+                        *(ulong *)(param_1 + 0x60),*(ulong *)(param_1 + 0x88));

+    break;

+  case 2:

+    uVar11 = WDiagProcessAcmStateTransition

+                       ((_WD_INTERFACE_CONTEXT *)p_Var18,in_RDX,

+                        *(_ACE_STATE_MACHINE **)(param_1 + 0x40),*(void **)(param_1 + 0x48),

+                        *(ulong *)(param_1 + 0x60),*(ulong *)(param_1 + 100),

+                        *(__uint64 *)(param_1 + 0x78),*(ulong *)(param_1 + 0x88));

+    break;

+  case 3:

+    uVar3 = *(undefined4 *)(param_1 + 0x60);

+    lVar19 = *(longlong *)(param_1 + 0x40);

+    uVar7 = *(undefined8 *)(param_1 + 0x30);

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x47,

+              &WPP_fec73b95d5a537674450248f38664378_Traceguids);

+    }

+    WDiagAcquireExLock(p_Var18,(_WDIAG_RW_LOCK *)p_Var18[0xd1].Data4,"WDiagProcessAcmAddIfInit",

+                       0x51d);

+    *(undefined8 *)p_Var18[2].Data4 = uVar7;

+    p_Var18[0xfc].Data2 = (short)uVar3;

+    p_Var18[0xfc].Data3 = (short)((uint)uVar3 >> 0x10);

+    uVar20 = 0xffffffffffffffff;

+    do {

+      uVar21 = uVar20;

+      uVar20 = uVar21 + 1;

+    } while (*(short *)(lVar19 + uVar20 * 2) != 0);

+    lVar17 = 0x100;

+    uVar20 = uVar20 & 0xffffffff;

+    if (0x100 < (int)uVar21 + 2U) {

+      uVar20 = 0xff;

+    }

+    puVar15 = &p_Var18[0xdc].Data2;

+    lVar19 = lVar19 - (longlong)puVar15;

+    do {

+      if ((lVar17 == -0x7ffffefe) || (uVar1 = *(ushort *)(lVar19 + (longlong)puVar15), uVar1 == 0))

+      break;

+      *puVar15 = uVar1;

+      puVar15 = puVar15 + 1;

+      lVar17 = lVar17 + -1;

+    } while (lVar17 != 0);

+    puVar13 = puVar15 + -1;

+    if (lVar17 != 0) {

+      puVar13 = puVar15;

+    }

+    *puVar13 = 0;

+    (p_Var18[0xdc].Data4 + uVar20 * 2 + -4)[0] = '\0';

+    (p_Var18[0xdc].Data4 + uVar20 * 2 + -4)[1] = '\0';

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

+        (3 < (byte)WPP_GLOBAL_Control[0xe1])) && ((WPP_GLOBAL_Control[0xe4] & 4) != 0)) {

+      WPP_SF__guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x48,

+                    &WPP_fec73b95d5a537674450248f38664378_Traceguids,p_Var18 + 0xda);

+    }

+    in_RDX = (_PM_PROFILE *)p_Var18[0xd1].Data4;

+    WDiagReleaseExLock(p_Var18,(_WDIAG_RW_LOCK *)in_RDX,"WDiagProcessAcmAddIfInit",0x52c);

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0)) {

+      in_RDX = (_PM_PROFILE *)0x49;

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x49,

+              &WPP_fec73b95d5a537674450248f38664378_Traceguids);

+    }

+    uVar11 = 0;

+    break;

+  case 4:

+    uVar3 = *(undefined4 *)(param_1 + 0x78);

+    p_Var18[0x155].Data2 = (short)uVar3;

+    p_Var18[0x155].Data3 = (short)((uint)uVar3 >> 0x10);

+    p_Var18[0x155].Data4[0] = (uchar)param_1[0x80];

+    *(uint *)(p_Var18[0x155].Data4 + 4) = (uint)(*(int *)(param_1 + 0x70) != 0);

+    in_RDX = *(_PM_PROFILE **)(param_1 + 0x28);

+    uVar11 = WDiagProcessAcmAddIfDone

+                       ((_WD_INTERFACE_CONTEXT *)p_Var18,in_RDX,in_R8,(_LIST_ENTRY *)p_Var22,

+                        *(ulong *)(param_1 + 0x60),*(ulong *)(param_1 + 100),

+                        *(ulong *)(param_1 + 0x68),*(ulong *)(param_1 + 0x6c),

+                        (_GUID *)(param_1 + 0x14),*(ulong *)(param_1 + 0x88));

+    break;

+  case 5:

+    uVar3 = *(undefined4 *)(param_1 + 0x88);

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

+      if ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0) {

+        in_RDX = (_PM_PROFILE *)0x52;

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x52,

+                &WPP_fec73b95d5a537674450248f38664378_Traceguids);

+      }

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

+          (2 < (byte)WPP_GLOBAL_Control[0xe1])) && ((WPP_GLOBAL_Control[0xe4] & 4) != 0)) {

+        in_RDX = (_PM_PROFILE *)0x53;

+        WPP_SF_D_guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x53,

+                       &WPP_fec73b95d5a537674450248f38664378_Traceguids,uVar3,p_Var18 + 0xda);

+      }

+    }

+    uVar11 = WDiagCleanupInterface((_WD_INTERFACE_CONTEXT *)p_Var18);

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) == 0)) break;

+    in_RDX = (_PM_PROFILE *)0x54;

+    goto LAB_2;

+  case 6:

+    uVar11 = WDiagProcessAcmSetHiddenSsidList

+                       ((_WD_INTERFACE_CONTEXT *)p_Var18,in_RDX,

+                        *(_DOT11_MSM_HIDDEN_SSID_LIST **)(param_1 + 0x40),*(ulong *)(param_1 + 0x60)

+                        ,*(ulong *)(param_1 + 0x88));

+    break;

+  case 7:

+    uVar11 = WDiagProcessAcmScanResult

+                       ((_WD_INTERFACE_CONTEXT *)p_Var18,in_RDX,

+                        *(_DOT11_MSM_SCAN_RESULT_LIST **)(param_1 + 0x40),

+                        *(_WLAN_AVAILABLE_NETWORK_LIST_V3 **)(param_1 + 0x48),

+                        *(ulong *)(param_1 + 0x88));

+    break;

+  case 8:

+  case 9:

+    local_res8 = *(_DOT11_AC_PROFILE **)(param_1 + 0x50);

+    local_res10 = *(_GUID **)(param_1 + 0x48);

+    uVar11 = *(ulong *)(param_1 + 0x70);

+    uVar14 = *(ulong *)(param_1 + 0x6c);

+    uVar6 = *(ulong *)(param_1 + 0x68);

+    uVar4 = *(ulong *)(param_1 + 100);

+    in_RDX = *(_PM_PROFILE **)(param_1 + 0x40);

+    local_res18 = (_WD_CONNECTION_CONTEXT *)0x0;

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x7a,

+              &WPP_fec73b95d5a537674450248f38664378_Traceguids);

+    }

+    uVar11 = WDiagProfileMismatch

+                       ((_WD_INTERFACE_CONTEXT *)p_Var18,in_RDX,local_res8,

+                        (DOT11_SSID_LIST *)local_res10,uVar4,uVar6,in_stack_ffffffffffffff68,uVar14,

+                        uVar11,&local_res18);

+    if (uVar11 != 0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) break;

+      if ((WPP_GLOBAL_Control[0xe1] != '\0') && ((WPP_GLOBAL_Control[0xe4] & 4) != 0)) {

+        in_RDX = (_PM_PROFILE *)0x7b;

+        WPP_SF_D_guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x7b,

+                       &WPP_fec73b95d5a537674450248f38664378_Traceguids,uVar11,p_Var18 + 0xda);

+      }

+    }

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) == 0)) break;

+    in_RDX = (_PM_PROFILE *)0x7c;

+    goto LAB_2;

+  case 10:

+  case 0xb:

+    goto switchD_18001ff60_caseD_a;

+  case 0xc:

+    iVar25 = 1;

+switchD_18001ff60_caseD_a:

+    local_res10 = *(_GUID **)(param_1 + 0x50);

+    local_res18 = *(_WD_CONNECTION_CONTEXT **)(param_1 + 0x48);

+    local_res20 = *(_PM_PROFILE **)(param_1 + 0x40);

+    _Var12 = *(_DOT11_BSS_TYPE *)(param_1 + 100);

+    uVar11 = *(ulong *)(param_1 + 0x70);

+    uVar14 = *(ulong *)(param_1 + 0x6c);

+    uVar6 = *(ulong *)(param_1 + 0x68);

+    in_RDX = *(_PM_PROFILE **)(param_1 + 0x38);

+    local_res8 = (_DOT11_AC_PROFILE *)CONCAT44(local_res8._4_4_,_Var12);

+    local_58 = (_WD_CONNECTION_CONTEXT *)0x0;

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x7d,

+              &WPP_fec73b95d5a537674450248f38664378_Traceguids);

+      _Var12 = (_DOT11_BSS_TYPE)local_res8;

+    }

+    uVar11 = WDiagNewConnectionRequest

+                       ((_WD_INTERFACE_CONTEXT *)p_Var18,in_RDX,local_res20,

+                        (DOT11_SSID_LIST *)local_res18,local_res10,_Var12,uVar6,iVar25,uVar14,uVar11

+                        ,&local_58);

+    if (uVar11 != 0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) break;

+      if ((WPP_GLOBAL_Control[0xe1] != '\0') && ((WPP_GLOBAL_Control[0xe4] & 4) != 0)) {

+        in_RDX = (_PM_PROFILE *)0x7e;

+        WPP_SF_D_guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x7e,

+                       &WPP_fec73b95d5a537674450248f38664378_Traceguids,uVar11,p_Var18 + 0xda);

+      }

+    }

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) == 0)) break;

+    in_RDX = (_PM_PROFILE *)0x7f;

+    goto LAB_2;

+  case 0xd:

+    goto switchD_18001ff60_caseD_d;

+  case 0xe:

+    goto switchD_18001ff60_caseD_e;

+  case 0xf:

+  case 0x10:

+  case 0x11:

+  case 0x12:

+    uVar11 = *(ulong *)(param_1 + 0x60);

+    in_RDX = *(_PM_PROFILE **)(param_1 + 0x38);

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x83,

+              &WPP_fec73b95d5a537674450248f38664378_Traceguids);

+    }

+    uVar11 = WDiagACMDisconnect((_WD_INTERFACE_CONTEXT *)p_Var18,in_RDX,uVar11,WVar2);

+    if (uVar11 != 0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) break;

+      if ((WPP_GLOBAL_Control[0xe1] != '\0') && ((WPP_GLOBAL_Control[0xe4] & 4) != 0)) {

+        in_RDX = (_PM_PROFILE *)0x84;

+        WPP_SF_D_guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x84,

+                       &WPP_fec73b95d5a537674450248f38664378_Traceguids,uVar11,p_Var18 + 0xda);

+      }

+    }

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) == 0)) break;

+    in_RDX = (_PM_PROFILE *)0x85;

+    goto LAB_2;

+  case 0x13:

+    uVar11 = WDiagProcessAcmSelectionList

+                       ((_WD_INTERFACE_CONTEXT *)p_Var18,in_RDX,

+                        *(_WLAN_AVAILABLE_NETWORK_LIST_V3 **)(param_1 + 0x40),

+                        *(_LIST_ENTRY **)(param_1 + 0x48),*(ulong *)(param_1 + 0x88));

+    break;

+  case 0x14:

+    in_RDX = *(_PM_PROFILE **)(param_1 + 0x40);

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0)) {

+      in_R8 = &WPP_fec73b95d5a537674450248f38664378_Traceguids;

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x74);

+    }

+    uVar11 = WDiagUpdateConnectionFlagsForProfile

+                       ((_WD_INTERFACE_CONTEXT *)p_Var18,in_RDX,(ulong)in_R8,(ulong)p_Var22);

+    if (uVar11 != 0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) break;

+      if ((WPP_GLOBAL_Control[0xe1] != '\0') && ((WPP_GLOBAL_Control[0xe4] & 4) != 0)) {

+        in_RDX = (_PM_PROFILE *)0x75;

+        WPP_SF_D_guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x75,

+                       &WPP_fec73b95d5a537674450248f38664378_Traceguids,uVar11,p_Var18 + 0xda);

+      }

+    }

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) == 0)) break;

+    in_RDX = (_PM_PROFILE *)0x76;

+    goto LAB_2;

+  case 0x15:

+    p_Var8 = *(_PM_PROFILE **)(param_1 + 0x40);

+    in_RDX = *(_PM_PROFILE **)(param_1 + 0x38);

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x77,

+              &WPP_fec73b95d5a537674450248f38664378_Traceguids);

+    }

+    uVar11 = WDiagProfileNameChanged((_WD_INTERFACE_CONTEXT *)p_Var18,in_RDX,p_Var8);

+    if (uVar11 != 0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) break;

+      if ((WPP_GLOBAL_Control[0xe1] != '\0') && ((WPP_GLOBAL_Control[0xe4] & 4) != 0)) {

+        in_RDX = (_PM_PROFILE *)0x78;

+        WPP_SF_D_guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x78,

+                       &WPP_fec73b95d5a537674450248f38664378_Traceguids,uVar11,p_Var18 + 0xda);

+      }

+    }

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) == 0)) break;

+    in_RDX = (_PM_PROFILE *)0x79;

+    goto LAB_2;

+  case 0x17:

+    iVar5 = 1;

+switchD_18001ff60_caseD_e:

+    iVar25 = iVar5;

+    iVar24 = 1;

+switchD_18001ff60_caseD_d:

+    iVar5 = *(int *)(param_1 + 0x6c);

+    local_res20 = *(_PM_PROFILE **)(param_1 + 0x58);

+    local_58 = *(_WD_CONNECTION_CONTEXT **)(param_1 + 0x48);

+    local_50 = *(DOT11_SSID_LIST **)(param_1 + 0x40);

+    uVar11 = *(ulong *)(param_1 + 0x68);

+    uVar14 = *(ulong *)(param_1 + 100);

+    PVar16 = *(PasspointFlag *)(param_1 + 0x8c);

+    _Var9 = *(__uint64 *)(param_1 + 0x78);

+    uVar6 = *(ulong *)(param_1 + 0x88);

+    in_RDX = *(_PM_PROFILE **)(param_1 + 0x38);

+    local_res8 = (_DOT11_AC_PROFILE *)CONCAT44(local_res8._4_4_,uVar11);

+    local_res10 = (_GUID *)CONCAT44(local_res10._4_4_,uVar14);

+    local_res18 = (_WD_CONNECTION_CONTEXT *)CONCAT44(local_res18._4_4_,PVar16);

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x80,

+              &WPP_fec73b95d5a537674450248f38664378_Traceguids);

+      uVar11 = (_DOT11_BSS_TYPE)local_res8;

+      uVar14 = (ulong)local_res10;

+      PVar16 = (PasspointFlag)local_res18;

+    }

+    uVar11 = WDiagConnectCompletion

+                       ((_WD_INTERFACE_CONTEXT *)p_Var18,in_RDX,local_50,(_PM_PROFILE *)local_58,

+                        (_WLAN_CONNECTION_MODE *)local_res20,PVar16,uVar14,uVar11,uVar6,iVar24,

+                        iVar25,_Var9,iVar5 != 0);

+    if (uVar11 != 0) {

+      if ((undefined **)WPP_GLOBAL_Control == &WPP_GLOBAL_Control) break;

+      if ((WPP_GLOBAL_Control[0xe1] != '\0') && ((WPP_GLOBAL_Control[0xe4] & 4) != 0)) {

+        in_RDX = (_PM_PROFILE *)0x81;

+        WPP_SF_D_guid_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),0x81,

+                       &WPP_fec73b95d5a537674450248f38664378_Traceguids,uVar11,p_Var18 + 0xda);

+      }

+    }

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

+       ((*(uint *)(WPP_GLOBAL_Control + 0xe4) & 0x200) == 0)) break;

+    in_RDX = (_PM_PROFILE *)0x82;

+LAB_2:

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0xd8),in_RDX,

+            &WPP_fec73b95d5a537674450248f38664378_Traceguids);

+  }

+  if (p_Var18 != (_GUID *)0x0) {

+    WDiagDereferenceInterface((_WD_INTERFACE_CONTEXT *)p_Var18,(ulong)in_RDX);

+  }

+  return uVar11;

 }
```

## `WDiagLogConnectDiagnosticEvent`  (modified)

```diff
--- WDiagLogConnectDiagnosticEvent
+++ WDiagLogConnectDiagnosticEvent
@@ -1,205 +1,665 @@
 

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

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

+/* void __cdecl WDiagLogConnectDiagnosticEvent(struct _WD_INTERFACE_CONTEXT * __ptr64,struct

+   _WD_CONNECTION_CONTEXT * __ptr64,struct WDIAG_SQM_RECORD * __ptr64) */

 

 void __cdecl

 WDiagLogConnectDiagnosticEvent

           (_WD_INTERFACE_CONTEXT *param_1,_WD_CONNECTION_CONTEXT *param_2,WDIAG_SQM_RECORD *param_3)

 

 {

-  uint uVar1;

-  undefined4 uVar2;

-  longlong lVar3;

-  longlong lVar4;

-  undefined8 uVar5;

-  char cVar6;

-  int iVar7;

-  char *in_RAX;

-  undefined8 uVar8;

-  undefined4 *unaff_RBP;

-  undefined8 unaff_RSI;

-  undefined4 *unaff_RDI;

-  uint uVar9;

-  uint uVar10;

-  ulonglong unaff_R12;

-  undefined4 unaff_R13D;

-  undefined8 unaff_R14;

-  undefined8 unaff_R15;

-  bool bVar11;

-  undefined1 uVar12;

-  undefined8 in_stack_00000020;

-  undefined4 *puVar13;

-  undefined4 uVar14;

+  _WD_INTERFACE_CONTEXT *p_Var1;

+  _WD_INTERFACE_CONTEXT *p_Var2;

+  undefined1 uVar3;

+  char cVar4;

+  int iVar5;

+  undefined8 uVar6;

+  _WD_CONNECTION_CONTEXT *p_Var7;

+  wchar_t *pwVar8;

+  undefined **ppuVar9;

+  WDIAG_SQM_RECORD *pWVar10;

+  uint uVar11;

+  uint uVar12;

+  ulonglong uVar13;

+  uint uVar14;

+  wchar_t *pwVar15;

+  wchar_t *pwVar16;

+  undefined1 uVar17;

+  undefined1 auStack_af8 [32];

+  _WD_INTERFACE_CONTEXT **local_ad8;

+  _WD_CONNECTION_CONTEXT **local_ad0;

+  wchar_t **local_ac8;

+  _WD_INTERFACE_CONTEXT **local_ac0;

+  _WD_INTERFACE_CONTEXT **local_ab8;

+  wchar_t *local_ab0;

+  undefined8 local_aa8;

+  undefined8 local_aa0;

+  ushort *local_a98;

+  ushort *local_a90;

+  ushort *local_a88;

+  ushort *local_a80;

+  uint *local_a78;

+  ushort **local_a70;

+  ushort **local_a68;

+  WDIAG_SQM_RECORD *local_a60;

+  WDIAG_SQM_RECORD *local_a58;

+  WDIAG_SQM_RECORD *local_a50;

+  undefined4 *local_a48;

+  undefined4 *local_a40;

+  undefined4 *local_a38;

+  undefined4 *local_a30;

+  undefined4 *local_a28;

+  WDIAG_SQM_RECORD **local_a20;

+  WDIAG_SQM_RECORD **local_a18;

+  WDIAG_SQM_RECORD *local_a10;

+  WDIAG_SQM_RECORD *local_a08;

+  WDIAG_SQM_RECORD *local_a00;

+  WDIAG_SQM_RECORD *local_9f8;

+  WDIAG_SQM_RECORD *local_9f0;

+  undefined4 *local_9e8;

+  undefined4 *local_9e0;

+  undefined4 *local_9d8;

+  wchar_t *local_9d0;

+  undefined4 *local_9c8;

+  WDIAG_SQM_RECORD *local_9c0;

+  undefined4 *local_9b8;

+  WDIAG_SQM_RECORD **local_9b0;

+  WDIAG_SQM_RECORD **local_9a8;

+  WDIAG_SQM_RECORD **local_9a0;

+  WDIAG_SQM_RECORD *local_998;

+  undefined4 *local_990;

+  undefined4 *local_988;

+  undefined4 *local_980;

+  undefined4 *local_978;

+  uint *local_970;

+  uint *local_968;

+  undefined4 *local_960;

+  wchar_t **local_958;

+  undefined4 *local_950;

+  WDIAG_SQM_RECORD **local_948;

+  undefined4 *local_940;

+  undefined4 *local_938;

+  undefined4 *local_930;

+  WDIAG_SQM_RECORD **local_928;

+  uint *local_920;

+  uint *local_918;

+  uint *local_910;

+  uint *local_908;

+  uint *local_900;

+  uint *local_8f8;

+  uint *local_8f0;

+  undefined4 *local_8e8;

+  undefined1 *local_8e0;

+  undefined4 *local_8d8;

+  undefined8 *local_8d0;

+  WDIAG_SQM_RECORD *local_8c8;

+  undefined4 *local_8c0;

+  undefined4 *local_8b8;

+  undefined1 local_8a8;

+  WDIAG_SQM_RECORD local_8a7;

+  undefined1 local_8a6 [2];

+  undefined4 local_8a4;

+  uint local_8a0;

+  uint local_89c;

+  uint local_898;

+  uint local_894;

+  uint local_890;

+  uint local_88c;

+  uint local_888;

+  undefined4 local_884;

+  undefined4 local_880;

+  int local_87c;

+  _WD_CONNECTION_CONTEXT *local_878;

+  undefined4 local_870;

+  undefined4 local_86c;

+  undefined4 local_868;

+  uint local_864;

+  uint local_860;

+  undefined4 local_85c;

+  undefined4 local_858;

+  undefined4 local_854;

+  undefined4 local_850;

+  undefined4 local_84c;

+  undefined4 local_848;

+  undefined4 local_844;

+  undefined4 local_840;

+  undefined4 local_83c;

+  undefined4 local_838;

+  undefined4 local_834;

+  undefined4 local_830;

+  undefined4 local_82c;

+  undefined4 local_828;

+  undefined4 local_824;

+  undefined4 local_820;

+  undefined4 local_81c;

+  undefined4 local_818;

+  undefined4 local_814;

+  undefined4 local_810;

+  undefined4 local_80c;

+  undefined4 local_808;

+  undefined4 local_804;

+  uint local_800;

+  undefined4 local_7fc;

+  undefined4 local_7f8;

+  undefined4 local_7f4;

+  undefined4 local_7f0;

+  undefined4 local_7ec;

+  undefined4 local_7e8;

+  undefined4 local_7e4;

+  _WD_INTERFACE_CONTEXT *local_7e0;

+  _WD_INTERFACE_CONTEXT *local_7d8;

+  longlong local_7d0;

+  undefined8 local_7c8;

+  WDIAG_SQM_RECORD *local_7c0;

+  WDIAG_SQM_RECORD *local_7b8;

+  wchar_t *local_7b0;

+  WDIAG_SQM_RECORD *local_7a8;

+  WDIAG_SQM_RECORD *local_7a0;

+  WDIAG_SQM_RECORD *local_798;

+  WDIAG_SQM_RECORD *local_790;

+  wchar_t *local_788;

+  WDIAG_SQM_RECORD *local_780;

+  WDIAG_SQM_RECORD *local_778;

+  WDIAG_SQM_RECORD *local_770;

+  WDIAG_SQM_RECORD *local_768;

+  WDIAG_SQM_RECORD *local_760;

+  ushort *local_758;

+  ushort *local_750;

+  undefined1 *local_748;

+  _WD_INTERFACE_CONTEXT *local_740;

+  _WD_INTERFACE_CONTEXT *local_738;

+  wchar_t *local_730;

+  undefined4 local_728;

+  undefined8 uStack_724;

+  undefined4 uStack_71c;

+  uint uStack_718;

+  undefined4 uStack_714;

+  undefined4 local_708;

+  undefined4 uStack_704;

+  undefined4 uStack_700;

+  undefined4 uStack_6fc;

+  ulonglong local_6f8;

+  ushort local_6e8 [20];

+  ushort local_6c0 [20];

+  undefined1 local_698 [80];

+  ushort local_648 [256];

+  ushort local_448 [256];

+  ushort local_248 [256];

+  ulonglong local_48;

   

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

-  puVar13 = (undefined4 *)

-            CONCAT44((int)((ulonglong)in_stack_00000020 >> 0x20),

-                     (uint)*(byte *)((longlong)unaff_RDI + 0xe33));

-  StringCchPrintfW((ushort *)(unaff_RBP + 0x5a),0x12,(ushort *)L"%02X:%02X:%02X:%02X:%02X:%02X",

-                   (ulonglong)*(byte *)((longlong)unaff_RDI + 0xe32),puVar13);

-  unaff_RBP[-0x16] = unaff_RDI[0x38a];

-  unaff_RBP[-0x17] = unaff_RDI[0x389];

-  unaff_RBP[-0x15] = 0;

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

-  unaff_RBP[-0x1f] = 1;

-  iVar7 = UMgrEnumerateSessionUsers(unaff_RBP + -0x15,unaff_RBP + 0x16);

-  if (iVar7 < 0) {

-LAB_0:

-    if (*(longlong *)(unaff_RBP + 0x16) != 0) goto LAB_1;

+  local_48 = __security_cookie ^ (ulonglong)auStack_af8;

+  local_878 = param_2;

+  local_7d8 = param_1;

+  memset(local_698,0,0x42);

+  pwVar8 = L"Unknown";

+  local_6e8[0x10] = 0;

+  local_6e8[0x11] = 0;

+  local_6c0[0x10] = 0;

+  local_6c0[0x11] = 0;

+  pwVar15 = L"N/A";

+  pwVar16 = L"Unknown";

+  local_6e8[0] = 0;

+  local_6e8[1] = 0;

+  local_6e8[2] = 0;

+  local_6e8[3] = 0;

+  local_6e8[4] = 0;

+  local_6e8[5] = 0;

+  local_6e8[6] = 0;

+  local_6e8[7] = 0;

+  local_6e8[8] = 0;

+  local_6e8[9] = 0;

+  local_6e8[10] = 0;

+  local_6e8[0xb] = 0;

+  local_6e8[0xc] = 0;

+  local_6e8[0xd] = 0;

+  local_6e8[0xe] = 0;

+  local_6e8[0xf] = 0;

+  local_6c0[0] = 0;

+  local_6c0[1] = 0;

+  local_6c0[2] = 0;

+  local_6c0[3] = 0;

+  local_6c0[4] = 0;

+  local_6c0[5] = 0;

+  local_6c0[6] = 0;

+  local_6c0[7] = 0;

+  local_6c0[8] = 0;

+  local_6c0[9] = 0;

+  local_6c0[10] = 0;

+  local_6c0[0xb] = 0;

+  local_6c0[0xc] = 0;

+  local_6c0[0xd] = 0;

+  local_6c0[0xe] = 0;

+  local_6c0[0xf] = 0;

+  memset(local_648,0,0x200);

+  memset(local_248,0,0x200);

+  memset(local_448,0,0x200);

+  uStack_724 = 0;

+  uStack_71c = 0;

+  uStack_718 = 0;

+  if (param_1 == (_WD_INTERFACE_CONTEXT *)0x0) {

+    return;

+  }

+  if (param_2 == (_WD_CONNECTION_CONTEXT *)0x0) {

+    return;

+  }

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

+    return;

+  }

+  uVar13 = 0xffffffffffffffff;

+  if (*(int *)(param_3 + 0xf4c) == 0) {

+    if ((DAT_0 < _DAT_7ffe037c) &&

+       (cVar4 = EtwCheckCoverage(&PTR_s_Wireless_Connection_Success_1802ad708), cVar4 == '\0')) {

+      ppuVar9 = &PTR_s_Wireless_Connection_Success_1802ad708;

+LAB_1:

+      NtSetInformationProcess(0xffffffffffffffff,0x55,ppuVar9);

+    }

+  }

+  else if ((DAT_2 < _DAT_7ffe037c) &&

+          (cVar4 = EtwCheckCoverage(&PTR_s_Wireless_Connection_Unsuccessfu_1802ad6f0), cVar4 == '\0'

+          )) {

+    ppuVar9 = &PTR_s_Wireless_Connection_Unsuccessfu_1802ad6f0;

+    goto LAB_1;

+  }

+  if ((DAT_3 & 1) == 0) {

+    return;

+  }

+  iVar5 = *(int *)(param_3 + 0xf54);

+  if (iVar5 == 0) {

+    pwVar15 = L"None";

+  }

+  else if (iVar5 == 1) {

+    pwVar15 = L"Machine";

+  }

+  else if (iVar5 == 2) {

+    pwVar15 = L"User";

+  }

+  else if (iVar5 == 3) {

+    pwVar15 = L"ExplicitUser";

+  }

+  else if (iVar5 == 4) {

+    pwVar15 = L"Guest";

+  }

+  else if (iVar5 == 5) {

+    pwVar15 = L"Invalid";

+  }

+  iVar5 = *(int *)(param_3 + 0xe78);

+  if (iVar5 < 7) {

+    if (iVar5 == 6) {

+      pwVar8 = L"802.11g";

+    }

+    else if (iVar5 == 0) {

+      pwVar8 = L"any";

+    }

+    else if (iVar5 == 1) {

+      pwVar8 = L"FHSS";

+    }

+    else if (iVar5 == 2) {

+      pwVar8 = L"DSSS";

+    }

+    else if (iVar5 == 3) {

+      pwVar8 = L"IR-base band";

+    }

+    else if (iVar5 == 4) {

+      pwVar8 = L"802.11a";

+    }

+    else if (iVar5 == 5) {

+      pwVar8 = L"802.11b";

+    }

+  }

+  else if (iVar5 == 7) {

+    pwVar8 = L"802.11n";

+  }

+  else if (iVar5 == 8) {

+    pwVar8 = L"802.11ac";

+  }

+  else if (iVar5 == 9) {

+    pwVar8 = L"802.11ad";

+  }

+  else if (iVar5 == 10) {

+    pwVar8 = L"802.11ax";

+  }

+  else if (iVar5 == 0xb) {

+    pwVar8 = L"802.11be";

+  }

+  iVar5 = *(int *)param_3;

+  if (iVar5 < 0x11) {

+    if (iVar5 == 0x10) {

+LAB_4:

+      pwVar16 = L"Low Power Resume";

+    }

+    else if ((iVar5 == 0) || (iVar5 == 1)) {

+      pwVar16 = L"Profile";

+    }

+    else if ((iVar5 == 2) || (iVar5 == 3)) {

+      pwVar16 = L"Manual";

+    }

+    else if (iVar5 == 4) {

+      pwVar16 = L"Automatic";

+    }

+    else if (iVar5 == 5) {

+      pwVar16 = L"WCN";

+    }

   }

   else {

-    if ((unaff_RBP[-0x15] == 0) || (*(longlong *)(unaff_RBP + 0x16) == 0)) {

-      unaff_RBP[-0x1f] = 0;

-      goto LAB_0;

-    }

-LAB_1:

-    UMgrFreeSessionUsers();

-  }

-  uVar1 = unaff_RDI[0x3cf];

-  *(undefined1 *)(unaff_RBP + -0x20) = 0xff;

-  uVar9 = uVar1 & 1;

-  uVar12 = 2;

-  unaff_RBP[-0x1d] = uVar9;

-  bVar11 = (uVar1 & 2) != 0;

-  uVar10 = (uint)bVar11;

-  unaff_RBP[-0x1e] = (uint)bVar11;

-  unaff_RBP[-0x18] = (uint)((uVar1 & 4) != 0);

-  unaff_RBP[-0x19] = (uint)((uVar1 & 8) != 0);

-  unaff_RBP[-0x1a] = (uint)((uVar1 & 0x20) != 0);

-  unaff_RBP[-0x1b] = (uint)((uVar1 & 0x40) != 0);

-  iVar7 = unaff_RDI[0x388];

-  unaff_RBP[-0x1c] = (uint)((uVar1 & 0x80) != 0);

-  if (iVar7 == 0) {

-    uVar12 = unaff_RDI[0x387] != 0;

-  }

-  else if (iVar7 != 1) {

-    if (iVar7 != 2) {

-      MicrosoftTelemetryAssertTriggeredNoArgs();

-      uVar9 = unaff_RBP[-0x1d];

-      uVar12 = 0xff;

-      uVar10 = unaff_RBP[-0x1e];

-      goto LAB_2;

-    }

-    uVar12 = 3;

-  }

-  *(undefined1 *)(unaff_RBP + -0x20) = uVar12;

-LAB_2:

-  if ((5 < DAT_3) && (cVar6 = _tlgKeywordOn(&DAT_3,0x400000000000), cVar6 != '\0'))

-  {

-    lVar3 = *(longlong *)(unaff_RBP + -0x14);

-    *(undefined1 *)((longlong)unaff_RBP + -0x7e) = uVar12;

-    unaff_RBP[-0xf] = uVar10;

-    unaff_RBP[-0xe] = uVar9;

-    unaff_RBP[0x11] = *(undefined4 *)(lVar3 + 0xd1c);

-    unaff_RBP[-0x12] = *(undefined4 *)(lVar3 + 0xd18);

-    *(undefined1 *)((longlong)unaff_RBP + -0x7f) = *(undefined1 *)(unaff_RDI + 0x396);

-    *(undefined8 *)(unaff_RBP + 0x18) = *(undefined8 *)(unaff_RDI + 0x394);

-    unaff_RBP[-0x11] = *(undefined4 *)(lVar3 + 0xd48);

-    unaff_RBP[-0x10] = unaff_RBP[-0x1f];

-    unaff_RBP[-0x1c] = unaff_RBP[-0x1c];

-    unaff_RBP[-0x1b] = unaff_RBP[-0x1b];

-    unaff_RBP[-0x1a] = unaff_RBP[-0x1a];

-    unaff_RBP[-0x19] = unaff_RBP[-0x19];

-    unaff_RBP[-0x18] = unaff_RBP[-0x18];

-    *(undefined4 **)(unaff_RBP + 0x1a) = unaff_RDI + 0x181;

-    unaff_RBP[-0x17] = unaff_RBP[-0x17];

-    unaff_RBP[-0x16] = unaff_RBP[-0x16];

-    unaff_RBP[-0xd] = *(undefined4 *)(lVar3 + 0xd44);

-    *(undefined4 **)(unaff_RBP + 0x1c) = unaff_RDI + 0x205;

-    unaff_RBP[-0xc] = unaff_RDI[0x3d6];

-    unaff_RBP[-0xb] = unaff_RDI[0x3d4];

-    *(undefined2 *)(unaff_RBP + -0x1e) = *(undefined2 *)((longlong)unaff_RDI + 0xf66);

-    *(undefined2 *)(unaff_RBP + -0x1d) = *(undefined2 *)(unaff_RDI + 0x3d9);

-    unaff_RBP[-10] = unaff_RDI[0x39d];

-    unaff_RBP[-9] = unaff_RDI[0x39c];

-    unaff_RBP[-8] = unaff_RDI[0x3d2];

-    unaff_RBP[-7] = unaff_RDI[0x3d7];

-    *(longlong *)(unaff_RBP + 0x20) = (longlong)unaff_RDI + 0xee2;

-    *(longlong *)(unaff_RBP + 0x22) = (longlong)unaff_RDI + 0xec1;

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

-    *(longlong *)(unaff_RBP + 0x26) = (longlong)unaff_RDI + 0xf03;

-    unaff_RBP[-6] = unaff_RDI[0x39f];

-    unaff_RBP[-5] = unaff_RDI[0x3d8];

-    unaff_RBP[-4] = unaff_RDI[0x3cb];

-    unaff_RBP[-3] = unaff_RDI[0x3ca];

-    unaff_RBP[-2] = unaff_RDI[0x399];

-    unaff_RBP[-1] = unaff_RDI[0x398];

-    *unaff_RBP = unaff_RDI[0x39b];

-    unaff_RBP[1] = unaff_RDI[0x39a];

-    *(undefined4 **)(unaff_RBP + 0x2a) = unaff_RDI + 0x285;

-    *(undefined8 *)(unaff_RBP + 0x1e) = unaff_R14;

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

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

-    *(undefined4 **)(unaff_RBP + 0x2e) = unaff_RDI + 0x81;

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

-    *(undefined4 **)(unaff_RBP + 0x32) = unaff_RDI + 1;

-    unaff_RBP[2] = unaff_RDI[0x392];

-    lVar4 = *(longlong *)(unaff_RBP + 0x14);

-    unaff_RBP[3] = unaff_RDI[0x391];

-    unaff_RBP[4] = unaff_RDI[0x38f];

-    unaff_RBP[5] = unaff_RDI[0x390];

-    unaff_RBP[6] = unaff_RDI[0x38e];

-    unaff_RBP[7] = unaff_RDI[0x3d1];

-    unaff_RBP[8] = unaff_RDI[0x3d0];

-    unaff_RBP[9] = unaff_RDI[0x3d3];

-    *(undefined4 **)(unaff_RBP + 0x34) = unaff_RBP + 0x5a;

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

-    unaff_RBP[0xb] = unaff_RDI[0x3cf];

-    unaff_RBP[0xc] = unaff_RDI[0x3ce];

-    unaff_RBP[0xd] = unaff_RDI[0x3cd];

-    unaff_RBP[0xe] = unaff_RDI[0x3cc];

-    unaff_RBP[0xf] = *(undefined4 *)(lVar3 + 0x494);

-    *(undefined4 **)(unaff_RBP + 0x38) = unaff_RBP + 100;

-    unaff_RBP[0x10] = *unaff_RDI;

-    *(longlong *)(unaff_RBP + 0x3a) = lVar4 + 0xdc4;

-    *(longlong *)(unaff_RBP + 0x3c) = lVar4 + 0xda0;

-    unaff_RBP[10] = unaff_R13D;

-    *(undefined8 *)(unaff_RBP + 0x3e) = unaff_R15;

-    unaff_RBP[-0x14] = 3;

-    *(undefined8 *)(unaff_RBP + 0x12) = 0x800;

-    puVar13 = unaff_RBP + 0x12;

+    if (((iVar5 == 0x11) || (iVar5 == 0x12)) || (iVar5 == 0x13)) goto LAB_4;

+    if (((iVar5 == 0x20) || (iVar5 == 0x21)) || (iVar5 == 0x22)) {

+      pwVar16 = L"Roam";

+    }

+  }

+  local_8a4 = 0x21;

+  WlanSsidToWideString(param_2 + 0x470,local_698,&local_8a4);

+  local_ab8._0_4_ = (uint)(byte)param_3[0xe31];

+  local_ac0._0_4_ = (uint)(byte)param_3[0xe30];

+  local_ac8._0_4_ = (uint)(byte)param_3[0xe2f];

+  local_ad0._0_4_ = (uint)(byte)param_3[0xe2e];

+  uVar14 = *(uint *)(param_2 + 0x4a8) >> 2;

+  local_ad8._0_4_ = (uint)(byte)param_3[0xe2d];

+  StringCchPrintfW(local_6e8,0x12,(ushort *)L"%02X:%02X:%02X:%02X:%02X:%02X",

+                   (ulonglong)(byte)param_3[0xe2c]);

+  local_ab8 = (_WD_INTERFACE_CONTEXT **)CONCAT44(local_ab8._4_4_,(uint)(byte)param_3[0xe37]);

+  local_ac0 = (_WD_INTERFACE_CONTEXT **)CONCAT44(local_ac0._4_4_,(uint)(byte)param_3[0xe36]);

+  local_ac8 = (wchar_t **)CONCAT44(local_ac8._4_4_,(uint)(byte)param_3[0xe35]);

+  local_ad0 = (_WD_CONNECTION_CONTEXT **)CONCAT44(local_ad0._4_4_,(uint)(byte)param_3[0xe34]);

+  local_ad8 = (_WD_INTERFACE_CONTEXT **)CONCAT44(local_ad8._4_4_,(uint)(byte)param_3[0xe33]);

+  StringCchPrintfW(local_6c0,0x12,(ushort *)L"%02X:%02X:%02X:%02X:%02X:%02X",

+                   (ulonglong)(byte)param_3[0xe32]);

+  local_880 = *(undefined4 *)(param_3 + 0xe28);

+  local_884 = *(undefined4 *)(param_3 + 0xe24);

+  local_87c = 0;

+  local_7d0 = 0;

+  local_8a4 = 1;

+  iVar5 = UMgrEnumerateSessionUsers(&local_87c,&local_7d0);

+  if (iVar5 < 0) {

+LAB_5:

+    if (local_7d0 == 0) goto LAB_6;

+  }

+  else if ((local_87c == 0) || (local_7d0 == 0)) {

+    local_8a4 = 0;

+    goto LAB_5;

+  }

+  UMgrFreeSessionUsers();

+LAB_6:

+  uVar12 = *(uint *)(param_3 + 0xf3c);

+  local_8a8 = 0xff;

+  local_89c = uVar12 & 1;

+  uVar17 = 2;

+  local_8a0 = (uint)((uVar12 & 2) != 0);

+  local_888 = (uint)((uVar12 & 4) != 0);

+  local_88c = (uint)((uVar12 & 8) != 0);

+  local_890 = (uint)((uVar12 & 0x20) != 0);

+  local_894 = (uint)((uVar12 & 0x40) != 0);

+  iVar5 = *(int *)(param_3 + 0xe20);

+  local_898 = (uint)((uVar12 & 0x80) != 0);

+  if (iVar5 == 0) {

+    uVar17 = *(int *)(param_3 + 0xe1c) != 0;

+    uVar3 = uVar17;

+  }

+  else {

+    uVar3 = uVar17;

+    if (iVar5 != 1) {

+      if (iVar5 == 2) {

+        uVar17 = 3;

+        uVar3 = uVar17;

+      }

+      else {

+        MicrosoftTelemetryAssertTriggeredNoArgs();

+        uVar17 = 0xff;

+        uVar3 = local_8a8;

+      }

+    }

+  }

+  local_8a8 = uVar3;

+  p_Var7 = local_878;

+  if ((5 < DAT_7) &&

+     (uVar12 = local_8a0, uVar11 = local_89c, cVar4 = _tlgKeywordOn(&DAT_7,0x400000000000),

+     p_Var7 = local_878, cVar4 != '\0')) {

+    local_7e4 = *(undefined4 *)(local_878 + 0xd1c);

+    local_870 = *(undefined4 *)(local_878 + 0xd18);

+    local_8a7 = param_3[0xe58];

+    local_7c8 = *(undefined8 *)(param_3 + 0xe50);

+    local_86c = *(undefined4 *)(local_878 + 0xd48);

+    local_868 = local_8a4;

+    local_7c0 = param_3 + 0x604;

+    local_85c = *(undefined4 *)(local_878 + 0xd44);

+    local_7b8 = param_3 + 0x814;

+    local_858 = *(undefined4 *)(param_3 + 0xf58);

+    local_854 = *(undefined4 *)(param_3 + 0xf50);

+    local_8a0 = CONCAT22(local_8a0._2_2_,*(undefined2 *)(param_3 + 0xf66));

+    local_89c = CONCAT22(local_89c._2_2_,*(undefined2 *)(param_3 + 0xf64));

+    local_850 = *(undefined4 *)(param_3 + 0xe74);

+    local_84c = *(undefined4 *)(param_3 + 0xe70);

+    local_848 = *(undefined4 *)(param_3 + 0xf48);

+    local_844 = *(undefined4 *)(param_3 + 0xf5c);

+    local_7a8 = param_3 + 0xee2;

+    local_7a0 = param_3 + 0xec1;

+    local_798 = param_3 + 0xe80;

+    local_790 = param_3 + 0xf03;

+    local_840 = *(undefined4 *)(param_3 + 0xe7c);

+    local_83c = *(undefined4 *)(param_3 + 0xf60);

+    local_838 = *(undefined4 *)(param_3 + 0xf2c);

+    local_834 = *(undefined4 *)(param_3 + 0xf28);

+    local_830 = *(undefined4 *)(param_3 + 0xe64);

+    local_82c = *(undefined4 *)(param_3 + 0xe60);

+    local_828 = *(undefined4 *)(param_3 + 0xe6c);

+    local_824 = *(undefined4 *)(param_3 + 0xe68);

+    local_780 = param_3 + 0xa14;

+    local_778 = param_3 + 0x614;

+    local_770 = param_3 + 0x204;

+    local_768 = param_3 + 0xc1c;

+    local_760 = param_3 + 4;

+    local_820 = *(undefined4 *)(param_3 + 0xe48);

+    local_81c = *(undefined4 *)(param_3 + 0xe44);

+    local_818 = *(undefined4 *)(param_3 + 0xe3c);

+    local_814 = *(undefined4 *)(param_3 + 0xe40);

+    local_810 = *(undefined4 *)(param_3 + 0xe38);

+    local_80c = *(undefined4 *)(param_3 + 0xf44);

+    local_808 = *(undefined4 *)(param_3 + 0xf40);

+    local_804 = *(undefined4 *)(param_3 + 0xf4c);

+    local_758 = local_6c0;

+    local_750 = local_6e8;

+    local_7fc = *(undefined4 *)(param_3 + 0xf3c);

+    local_7f8 = *(undefined4 *)(param_3 + 0xf38);

+    local_7f4 = *(undefined4 *)(param_3 + 0xf34);

+    local_7f0 = *(undefined4 *)(param_3 + 0xf30);

+    local_7ec = *(undefined4 *)(local_878 + 0x494);

+    local_748 = local_698;

+    local_7e8 = *(undefined4 *)param_3;

+    local_740 = local_7d8 + 0xdc4;

+    local_738 = local_7d8 + 0xda0;

+    local_8b8 = &local_7e4;

+    local_8c0 = &local_870;

+    local_8c8 = &local_8a7;

+    local_8d0 = &local_7c8;

+    local_8d8 = &local_86c;

+    local_8e0 = local_8a6;

+    local_8e8 = &local_868;

+    local_8f0 = &local_898;

+    local_8f8 = &local_894;

+    local_900 = &local_890;

+    local_908 = &local_88c;

+    local_910 = &local_888;

+    local_918 = &local_864;

+    local_920 = &local_860;

+    local_928 = &local_7c0;

+    local_930 = &local_884;

+    local_878 = (_WD_CONNECTION_CONTEXT *)CONCAT44(local_878._4_4_,3);

+    local_7e0 = (_WD_INTERFACE_CONTEXT *)0x800;

+    local_938 = &local_880;

+    local_940 = &local_85c;

+    local_948 = &local_7b8;

+    local_950 = &local_858;

+    local_958 = &local_7b0;

+    local_960 = &local_854;

+    local_968 = &local_8a0;

+    local_970 = &local_89c;

+    local_978 = &local_850;

+    local_980 = &local_84c;

+    local_988 = &local_848;

+    local_990 = &local_844;

+    local_998 = (WDIAG_SQM_RECORD *)&local_7a8;

+    local_9a0 = &local_7a0;

+    local_9a8 = &local_798;

+    local_9b0 = &local_790;

+    local_9b8 = &local_840;

+    local_9c0 = (WDIAG_SQM_RECORD *)&local_788;

+    local_9c8 = &local_83c;

+    local_9d0 = (wchar_t *)&local_838;

+    local_9d8 = &local_834;

+    local_9e0 = &local_830;

+    local_9e8 = &local_82c;

+    local_9f8 = (WDIAG_SQM_RECORD *)&local_824;

+    local_a00 = (WDIAG_SQM_RECORD *)&local_780;

+    local_a08 = (WDIAG_SQM_RECORD *)&local_778;

+    local_a10 = (WDIAG_SQM_RECORD *)&local_770;

+    local_a18 = &local_768;

+    local_a20 = &local_760;

+    local_a28 = &local_820;

+    local_a30 = &local_81c;

+    local_a38 = &local_818;

+    local_a40 = &local_814;

+    local_a48 = &local_810;

+    local_a50 = (WDIAG_SQM_RECORD *)&local_80c;

+    local_a58 = (WDIAG_SQM_RECORD *)&local_808;

+    local_a60 = (WDIAG_SQM_RECORD *)&local_804;

+    local_a68 = &local_758;

+    local_a70 = &local_750;

+    local_a78 = &local_800;

+    local_a80 = (ushort *)&local_7fc;

+    local_a88 = (ushort *)&local_7f8;

+    local_a90 = (ushort *)&local_7f4;

+    local_a98 = (ushort *)&local_7f0;

+    local_aa0 = (ushort *)&local_7ec;

+    local_aa8 = &local_748;

+    local_ab0 = (wchar_t *)&local_7e8;

+    local_ab8 = &local_740;

+    local_ac0 = &local_738;

+    local_ac8 = &local_730;

+    local_ad0 = &local_878;

+    local_ad8 = &local_7e0;

+    local_9f0 = (WDIAG_SQM_RECORD *)&local_828;

+    local_8a6[0] = uVar17;

+    local_864 = uVar12;

+    local_860 = uVar11;

+    local_800 = uVar14 & 1;

+    local_7b0 = pwVar15;

+    local_788 = pwVar8;

+    local_730 = pwVar16;

     _tlgWriteTemplate<long___cdecl(_tlgProvider_t_const*___ptr64,void_const*___ptr64,_GUID_const*___ptr64,_GUID_const*___ptr64,unsigned_int,_EVENT_DATA_DESCRIPTOR*___ptr64),&long___cdecl__tlgWriteTransfer_EventWriteTransfer(struct__tlgProvider_t_const*___ptr64,void_const*___ptr64,struct__GUID_const*___ptr64,struct__GUID_const*___ptr64,unsigned_int,struct__EVENT_DATA_DESCRIPTOR*___ptr64),_GUID_const*___ptr64,_GUID_const*___ptr64>

     ::

     Write<_tlgWrapperByVal<8>,_tlgWrapperByVal<4>,_tlgWrapSz<unsigned_short>,_tlgWrapperByRef<16>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapSz<char>,_tlgWrapSz<char>,_tlgWrapSz<char>,_tlgWrapSz<char>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<2>,_tlgWrapperByVal<2>,_tlgWrapperByVal<4>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByRef<16>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<1>,_tlgWrapperByVal<4>,_tlgWrapperByVal<8>,_tlgWrapperByVal<1>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>_>

-              (lVar4,&DAT_4);

-  }

-  StringCchPrintfW((ushort *)(unaff_RBP + 0x78),0x100,(ushort *)L"0x%x = ",

-                   (ulonglong)(uint)unaff_RDI[0x3d3],puVar13);

+              (local_7d8,&DAT_8);

+  }

+  StringCchPrintfW(local_648,0x100,(ushort *)L"0x%x = ",(ulonglong)*(uint *)(param_3 + 0xf4c));

   do {

-    unaff_R12 = unaff_R12 + 1;

-  } while (*(short *)((longlong)(unaff_RBP + 0x78) + unaff_R12 * 2) != 0);

-  ReasonCodeToString(unaff_RBP + 0x78,unaff_RDI[0x3d3],0x100 - (int)unaff_R12,

-                     (longlong)unaff_RBP + (unaff_R12 & 0xffffffff) * 2 + 0x1e0);

-  uVar8 = Dot11AssocStatusToString(unaff_RDI[0x3d0]);

-  StringCchPrintfW((ushort *)(unaff_RBP + 0x178),0x100,(ushort *)L"0x%x ( %ws ))",

-                   (ulonglong)(uint)unaff_RDI[0x3d0],uVar8);

-  uVar8 = Dot11AssocStatusToString(unaff_RDI[0x3d1]);

-  StringCchPrintfW((ushort *)(unaff_RBP + 0xf8),0x100,(ushort *)L"0x%x ( %ws ))",

-                   (ulonglong)(uint)unaff_RDI[0x3d1],uVar8);

-  uVar14 = (undefined4)((ulonglong)uVar8 >> 0x20);

-  lVar3 = *(longlong *)(unaff_RBP + 0x14);

-  unaff_RBP[0x40] = 0;

-  unaff_RBP[0x45] = 0;

-  uVar2 = unaff_RDI[0x3cd];

-  uVar8 = *(undefined8 *)(lVar3 + 0xda0);

-  uVar5 = *(undefined8 *)(lVar3 + 0xda8);

-  *(longlong *)(unaff_RBP + 0x12) = lVar3 + 0xdc4;

-  *(undefined8 *)(unaff_RBP + 0x41) = uVar8;

-  *(undefined8 *)(unaff_RBP + 0x43) = uVar5;

-  unaff_RBP[0x48] = unaff_RBP[0x40];

-  unaff_RBP[0x49] = unaff_RBP[0x41];

-  unaff_RBP[0x4a] = unaff_RBP[0x42];

-  unaff_RBP[0x4b] = unaff_RBP[0x43];

-  *(undefined8 *)(unaff_RBP + 0x4c) = *(undefined8 *)(unaff_RBP + 0x44);

-  Dot11CipherStr(uVar2);

-  Dot11AuthStr(unaff_RDI[0x3cc]);

-  uVar8 = *(undefined8 *)(unaff_RBP + 0x12);

-  NetworkingTriageScenarioGetConnectedWiFiConnectedEvent

-            (unaff_RBP + 0x48,uVar8,*(undefined1 *)(unaff_RBP + -0x20));

-  if ((DAT_5 & 1) != 0) {

+    uVar13 = uVar13 + 1;

+  } while (local_648[uVar13] != 0);

+  ReasonCodeToString(local_648,*(undefined4 *)(param_3 + 0xf4c),0x100 - (int)uVar13,

+                     local_648 + (uVar13 & 0xffffffff));

+  local_ad8 = (_WD_INTERFACE_CONTEXT **)Dot11AssocStatusToString(*(undefined4 *)(param_3 + 0xf40));

+  StringCchPrintfW(local_248,0x100,(ushort *)L"0x%x ( %ws ))",(ulonglong)*(uint *)(param_3 + 0xf40))

+  ;

+  local_ad8 = (_WD_INTERFACE_CONTEXT **)Dot11AssocStatusToString(*(undefined4 *)(param_3 + 0xf44));

+  StringCchPrintfW(local_448,0x100,(ushort *)L"0x%x ( %ws ))",(ulonglong)*(uint *)(param_3 + 0xf44))

+  ;

+  pWVar10 = param_3 + 0xee2;

+  local_728 = 0;

+  uStack_714 = 0;

+  p_Var1 = local_7d8 + 0xda0;

+  uVar6 = *(undefined8 *)p_Var1;

+  local_7e0 = local_7d8 + 0xdc4;

+  uStack_71c = (undefined4)*(undefined8 *)(local_7d8 + 0xda8);

+  uStack_718 = (uint)((ulonglong)*(undefined8 *)(local_7d8 + 0xda8) >> 0x20);

+  uStack_724._0_4_ = (undefined4)uVar6;

+  uStack_724._4_4_ = (undefined4)((ulonglong)uVar6 >> 0x20);

+  local_6f8 = (ulonglong)uStack_718;

+  local_708 = 0;

+  uStack_704 = (undefined4)uStack_724;

+  uStack_700 = uStack_724._4_4_;

+  uStack_6fc = uStack_71c;

+  uStack_724 = uVar6;

+  uVar6 = Dot11CipherStr(*(undefined4 *)(param_3 + 0xf34));

+  local_ac8 = (wchar_t **)Dot11AuthStr(*(undefined4 *)(param_3 + 0xf30));

+  p_Var2 = local_7e0;

+  local_9f8 = param_3 + 0xec1;

+  local_a00 = param_3 + 0xe80;

+  local_a08 = param_3 + 0xf03;

+  local_a10 = (WDIAG_SQM_RECORD *)CONCAT44(local_a10._4_4_,*(undefined4 *)(param_3 + 0xe7c));

+  local_a20 = (WDIAG_SQM_RECORD **)CONCAT44(local_a20._4_4_,*(undefined4 *)(param_3 + 0xf60));

+  local_a50 = (WDIAG_SQM_RECORD *)CONCAT44(local_a50._4_4_,*(undefined4 *)(param_3 + 0xe68));

+  local_a58 = (WDIAG_SQM_RECORD *)CONCAT44(local_a58._4_4_,*(undefined4 *)(param_3 + 0xe48));

+  local_a60 = (WDIAG_SQM_RECORD *)CONCAT44(local_a60._4_4_,*(undefined4 *)(param_3 + 0xe44));

+  local_a80 = local_448;

+  local_a88 = local_248;

+  local_a90 = local_648;

+  local_a98 = local_6c0;

+  local_aa0 = local_6e8;

+  local_aa8 = (undefined1 **)(CONCAT44(local_aa8._4_4_,uVar14) & 0xffffffff00000001);

+  local_ad0 = (_WD_CONNECTION_CONTEXT **)local_698;

+  local_ad8._0_4_ = local_8a4;

+  local_ac0 = (_WD_INTERFACE_CONTEXT **)uVar6;

+  local_ab0 = pwVar15;

+  local_a18 = (WDIAG_SQM_RECORD **)pwVar8;

+  local_9f0 = pWVar10;

+  local_9e0._0_4_ = *(undefined4 *)(param_3 + 0xe74);

+  local_9e8._0_4_ = *(undefined4 *)(param_3 + 0xe70);

+  local_a28._0_4_ = *(undefined4 *)(param_3 + 0xf2c);

+  local_a30._0_4_ = *(undefined4 *)(param_3 + 0xf28);

+  local_a38._0_4_ = *(undefined4 *)(param_3 + 0xe64);

+  local_a40._0_4_ = *(undefined4 *)(param_3 + 0xe60);

+  local_a48._0_4_ = *(undefined4 *)(param_3 + 0xe6c);

+  local_a68._0_4_ = *(undefined4 *)(param_3 + 0xe3c);

+  local_a70._0_4_ = *(undefined4 *)(param_3 + 0xe40);

+  local_a78._0_4_ = *(undefined4 *)(param_3 + 0xe38);

+  local_ab8._0_4_ = *(undefined4 *)(param_3 + 0xf50);

+  NetworkingTriageScenarioGetConnectedWiFiConnectedEvent(&local_708,local_7e0,local_8a8,pwVar16);

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

+    local_998 = param_3 + 0x604;

+    local_9c0 = param_3 + 0x814;

+    local_9a0 = *(WDIAG_SQM_RECORD ***)(param_3 + 0xe50);

+    local_a58 = param_3 + 0x204;

+    local_a60 = param_3 + 4;

+    local_a50 = param_3 + 0x614;

+    local_9a8 = (WDIAG_SQM_RECORD **)CONCAT44(local_9a8._4_4_,*(undefined4 *)(param_3 + 0xe24));

+    local_9b0 = (WDIAG_SQM_RECORD **)CONCAT44(local_9b0._4_4_,*(undefined4 *)(param_3 + 0xe28));

+    local_9b8 = (undefined4 *)CONCAT44(local_9b8._4_4_,*(undefined4 *)(p_Var7 + 0xd44));

+    local_9c8 = (undefined4 *)CONCAT44(local_9c8._4_4_,*(undefined4 *)(param_3 + 0xf58));

+    local_9d8 = (undefined4 *)CONCAT44(local_9d8._4_4_,*(undefined4 *)(param_3 + 0xf50));

+    local_9e0 = (undefined4 *)CONCAT44(local_9e0._4_4_,*(undefined4 *)(param_3 + 0xe74));

+    local_9e8 = (undefined4 *)CONCAT44(local_9e8._4_4_,*(undefined4 *)(param_3 + 0xe70));

+    local_9f0 = (WDIAG_SQM_RECORD *)CONCAT44(local_9f0._4_4_,*(undefined4 *)(param_3 + 0xf48));

+    local_9f8 = param_3 + 0xee2;

+    local_a00 = param_3 + 0xec1;

+    local_a08 = param_3 + 0xe80;

+    local_a10 = param_3 + 0xf03;

+    local_a18 = (WDIAG_SQM_RECORD **)CONCAT44(local_a18._4_4_,*(undefined4 *)(param_3 + 0xe7c));

+    local_a28 = (undefined4 *)CONCAT44(local_a28._4_4_,*(undefined4 *)(param_3 + 0xf2c));

+    local_a30 = (undefined4 *)CONCAT44(local_a30._4_4_,*(undefined4 *)(param_3 + 0xf28));

+    local_a38 = (undefined4 *)CONCAT44(local_a38._4_4_,*(undefined4 *)(param_3 + 0xe60));

+    local_a40 = (undefined4 *)CONCAT44(local_a40._4_4_,*(undefined4 *)(param_3 + 0xe6c));

+    local_a48 = (undefined4 *)CONCAT44(local_a48._4_4_,*(undefined4 *)(param_3 + 0xe68));

+    local_a68 = (ushort **)CONCAT44(local_a68._4_4_,*(undefined4 *)(param_3 + 0xe48));

+    local_a70 = (ushort **)CONCAT44(local_a70._4_4_,*(undefined4 *)(param_3 + 0xe44));

+    local_a78 = (uint *)CONCAT44(local_a78._4_4_,*(undefined4 *)(param_3 + 0xe3c));

+    local_a80 = (ushort *)CONCAT44(local_a80._4_4_,*(undefined4 *)(param_3 + 0xe38));

+    local_a88 = (ushort *)CONCAT44(local_a88._4_4_,*(undefined4 *)(param_3 + 0xf40));

+    local_a90 = (ushort *)CONCAT44(local_a90._4_4_,*(undefined4 *)(param_3 + 0xf4c));

+    local_a98 = local_6e8;

+    local_aa0 = (ushort *)(CONCAT44(local_aa0._4_4_,uVar14) & 0xffffffff00000001);

+    local_aa8 = (undefined1 **)CONCAT44(local_aa8._4_4_,*(undefined4 *)(param_3 + 0xf3c));

+    local_ab0 = (wchar_t *)CONCAT44(local_ab0._4_4_,*(undefined4 *)(param_3 + 0xf38));

+    local_ab8 = (_WD_INTERFACE_CONTEXT **)CONCAT44(local_ab8._4_4_,*(undefined4 *)(param_3 + 0xf34))

+    ;

+    local_ac0 = (_WD_INTERFACE_CONTEXT **)CONCAT44(local_ac0._4_4_,*(undefined4 *)(param_3 + 0xf30))

+    ;

+    local_ac8 = (wchar_t **)CONCAT44(local_ac8._4_4_,*(undefined4 *)(p_Var7 + 0x494));

+    local_ad0 = (_WD_CONNECTION_CONTEXT **)local_698;

+    local_ad8 = (_WD_INTERFACE_CONTEXT **)CONCAT44(local_ad8._4_4_,*(undefined4 *)param_3);

+    local_a20 = (WDIAG_SQM_RECORD **)pwVar8;

+    local_9d0 = pwVar15;

     McTemplateU0jzqzqqqqqtzqqqqqqzzzdddddzdssssqdddztzdqqxy_EventWriteTransfer

-              (unaff_RDI + 0x205,unaff_RDI + 0x185,(undefined8 *)(lVar3 + 0xda0),uVar8,

-               CONCAT44(uVar14,*unaff_RDI));

+              (local_9c0,local_a50,p_Var1,p_Var2);

   }

   return;

 }
```

## `RpcWfdSvcLowPrivOpenAdvertiserSession`  (modified)

```diff
--- RpcWfdSvcLowPrivOpenAdvertiserSession
+++ RpcWFDSvcLowPrivPublishService
@@ -1,80 +1,16 @@
 

-void RpcWfdSvcLowPrivOpenAdvertiserSession

-               (ulonglong param_1,undefined8 param_2,undefined8 *param_3,undefined8 *param_4)

+undefined8

+RpcWFDSvcLowPrivPublishService

+          (ulonglong param_1,undefined8 param_2,undefined8 param_3,longlong param_4)

 

 {

-  undefined8 uVar1;

-  ulonglong in_RAX;

-  undefined8 *puVar2;

-  __uint64 _Var3;

-  void *pvVar4;

-  size_t unaff_RBP;

-  undefined8 *unaff_RSI;

-  undefined8 *unaff_RDI;

-  __uint64 unaff_R13;

-  undefined8 *unaff_R14;

-  ulonglong unaff_R15;

+  uint in_EAX;

   

-  if ((in_RAX < unaff_R15) || ((ulonglong)param_3[3] < param_1)) {

-    if (param_1 - unaff_R15 < unaff_RBP) {

-      if (unaff_R15 <= 0x7fffffffffffffff - unaff_RBP) {

-        _Var3 = std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::

-                _Calculate_growth(unaff_R13,0xf,0x7fffffffffffffff);

-        pvVar4 = std::_Allocate<16,std::_Default_allocate_traits,0>(_Var3 + 1);

-        *unaff_R14 = pvVar4;

-        unaff_R14[2] = unaff_R13;

-        unaff_R14[3] = _Var3;

-        if (0xf < (ulonglong)unaff_RSI[3]) {

-          unaff_RSI = (undefined8 *)*unaff_RSI;

-        }

-        memcpy(pvVar4,unaff_RSI,unaff_RBP);

-        if (0xf < (ulonglong)unaff_RDI[3]) {

-          unaff_RDI = (undefined8 *)*unaff_RDI;

-        }

-        memcpy((void *)((longlong)pvVar4 + unaff_RBP),unaff_RDI,unaff_R15 + 1);

-        return;

-      }

-                    /* WARNING: Subroutine does not return */

-      std::_Xlen_string();

-    }

-    uVar1 = param_4[1];

-    *unaff_R14 = *param_4;

-    unaff_R14[1] = uVar1;

-    uVar1 = param_4[3];

-    unaff_R14[2] = param_4[2];

-    unaff_R14[3] = uVar1;

-    param_4[2] = param_2;

-    *(char *)param_4 = (char)param_2;

-    param_4[3] = 0xf;

-    pvVar4 = (void *)*unaff_R14;

-    memmove((void *)((longlong)pvVar4 + unaff_RBP),pvVar4,unaff_R15 + 1);

-    if (0xf < (ulonglong)unaff_RSI[3]) {

-      unaff_RSI = (undefined8 *)*unaff_RSI;

-    }

+  if (((param_1 != (in_EAX | 0x19fbab)) && (2 < *(byte *)(param_1 + 0x69))) &&

+     ((*(byte *)(param_1 + 0x6c) & 1) != 0)) {

+    WPP_SF_qL(*(undefined8 *)(param_1 + 0x60),0x24c,&WPP_791618f6e4f933247a011d60507f9013_Traceguids

+              ,param_4,*(undefined4 *)(param_4 + 0x180));

   }

-  else {

-    uVar1 = param_3[1];

-    *unaff_R14 = *param_3;

-    unaff_R14[1] = uVar1;

-    uVar1 = param_3[3];

-    unaff_R14[2] = param_3[2];

-    unaff_R14[3] = uVar1;

-    param_3[2] = param_2;

-    param_3[3] = 0xf;

-    *(char *)param_3 = (char)param_2;

-    puVar2 = unaff_R14;

-    if (0xf < (ulonglong)unaff_R14[3]) {

-      puVar2 = (undefined8 *)*unaff_R14;

-    }

-    unaff_RSI = unaff_RDI;

-    if (0xf < (ulonglong)param_4[3]) {

-      unaff_RSI = (undefined8 *)*param_4;

-    }

-    pvVar4 = (void *)((longlong)puVar2 + unaff_RBP);

-    unaff_RBP = unaff_R15 + 1;

-  }

-  memcpy(pvVar4,unaff_RSI,unaff_RBP);

-  unaff_R14[2] = unaff_R13;

-  return;

+  return 0;

 }
```

## `IntfGetNetworkBssList`  (modified)

```diff
--- IntfGetNetworkBssList
+++ AcmIsAPIAllowed
@@ -1,77 +1,53 @@
 

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

-   guard_dispatch_icall */

-/* unsigned long __cdecl IntfGetNetworkBssList(void * __ptr64,struct _DOT11_SSID * __ptr64,enum

-   _DOT11_BSS_TYPE,int,struct _WLAN_BSS_LIST * __ptr64 * __ptr64) */

-

-ulong __cdecl

-IntfGetNetworkBssList

-          (void *param_1,_DOT11_SSID *param_2,_DOT11_BSS_TYPE param_3,int param_4,

-          _WLAN_BSS_LIST **param_5)

+undefined4 AcmIsAPIAllowed(undefined8 param_1,ulonglong param_2,undefined4 param_3,int *param_4)

 

 {

-  _WLAN_BSS_LIST *p_Var1;

-  ulong uVar2;

-  undefined8 uVar3;

-  longlong local_res8;

-  undefined8 in_stack_ffffffffffffffc8;

-  undefined4 uVar4;

-  _WLAN_BSS_LIST *local_28 [2];

+  int *lpMem;

+  int iVar1;

+  HANDLE hHeap;

+  undefined4 uVar2;

+  int local_res10 [2];

+  int *local_res20;

   

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

-  local_res8 = 0;

-  local_28[0] = (_WLAN_BSS_LIST *)0x0;

+  uVar2 = 0;

+  local_res20 = (int *)0x0;

+  iVar1 = 0;

+  local_res10[0] = 0;

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

       (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x8f,

-            &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids);

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),10,

+            &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids);

   }

-  if (param_1 == (void *)0x0) {

+  if (param_4 == (int *)0x0) {

     MicrosoftTelemetryAssertTriggeredNoArgs();

   }

-  if (param_5 == (_WLAN_BSS_LIST **)0x0) {

-    MicrosoftTelemetryAssertTriggeredNoArgs();

-  }

-  uVar2 = HtReferenceHandleWithTag

-                    (g_hHandleTable,param_1,0x494e5446,0,CONCAT44(uVar4,1),&local_res8);

-  if (uVar2 == 0) {

-    if (*(int *)(local_res8 + 0x8d4) != 0) {

-      uVar2 = 0x80342002;

-      goto LAB_0;

+  if ((param_2 & 0x30ff0b) == 0) {

+    iVar1 = AcmQueryInterface(param_1,param_3,1,local_res10,&local_res20,0);

+    if (iVar1 == 0) {

+      if ((local_res10[0] == 4) && (*local_res20 != 0)) {

+        uVar2 = 1;

+      }

+      else {

+        iVar1 = 0x32;

+      }

     }

-    uVar2 = (**(code **)(*(longlong *)(local_res8 + 0x2b8) + 0x68))

-                      (*(undefined8 *)(local_res8 + 0x2c0),param_2,param_3,param_4,local_28);

-    p_Var1 = local_28[0];

-    if (uVar2 == 0) {

-      local_28[0] = (_WLAN_BSS_LIST *)0x0;

-      *param_5 = p_Var1;

-      goto LAB_0;

-    }

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

-        (WPP_GLOBAL_Control[0x69] == '\0')) || ((WPP_GLOBAL_Control[0x6c] & 1) == 0))

-    goto LAB_0;

-    uVar3 = 0x91;

   }

   else {

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

-        (WPP_GLOBAL_Control[0x69] == '\0')) || ((WPP_GLOBAL_Control[0x6c] & 1) == 0))

-    goto LAB_0;

-    uVar3 = 0x90;

+    uVar2 = 1;

   }

-  WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar3,

-           &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar2);

-LAB_0:

-  if (local_res8 != 0) {

-    HtDereferenceHandleWithTag(g_hHandleTable,param_1,0,1);

+  lpMem = local_res20;

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

+    hHeap = GetProcessHeap();

+    if (hHeap != (HANDLE)0x0) {

+      HeapFree(hHeap,0,lpMem);

+    }

   }

-  if (local_28[0] != (_WLAN_BSS_LIST *)0x0) {

-    FreeWLMem(local_28[0]);

-  }

+  *param_4 = iVar1;

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

       (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x92,

-             &WPP_c0e40dac8ab3314d0875ce3db7b5c2e9_Traceguids,uVar2);

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb,

+             &WPP_779833438c573f1c2e370ebbd98c77aa_Traceguids,uVar2);

   }

   return uVar2;

 }
```

## `RpcWfdSvcLowPrivGetProvisioningInfo`  (modified)

```diff
--- RpcWfdSvcLowPrivGetProvisioningInfo
+++ RpcWfdSvcLowPrivGetProvisioningInfo
@@ -1,45 +1,81 @@
 

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

-/* class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl

-   std::_Integral_to_string<char,int>(int) */

-

-basic_string<char,std::char_traits<char>,std::allocator<char>_> *

-RpcWfdSvcLowPrivGetProvisioningInfo

-          (basic_string<char,std::char_traits<char>,std::allocator<char>_> *param_1,int param_2)

+ulong RpcWfdSvcLowPrivGetProvisioningInfo

+                (void *param_1,undefined8 param_2,__uint64 param_3,_DOT11_WPS_CONFIG_METHOD param_4,

+                _DOT11_WPS_CONFIG_METHOD param_5,int param_6,int param_7,uchar param_8,

+                uchar *param_9)

 

 {

-  longlong lVar1;

-  char *pcVar2;

-  undefined8 uVar3;

-  undefined1 auStack_58 [40];

-  basic_string<char,std::char_traits<char>,std::allocator<char>_> *local_30;

-  char acStack_13 [3];

-  ulonglong uStack_10;

+  int iVar1;

+  ulong uVar2;

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

+  *this;

+  longlong *plVar3;

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

+  local_res8 [8];

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

+  local_28 [16];

   

-  uStack_10 = __security_cookie ^ (ulonglong)auStack_58;

-  uVar3 = 0;

-  local_30 = param_1;

-  if (param_2 < 0) {

-    lVar1 = func_0x000180110b40(acStack_13,-param_2);

-    pcVar2 = (char *)(lVar1 + -1);

-    *pcVar2 = '-';

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x301,

+            &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+  }

+  this = (tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

+          *)tip2::

+            start<tip2::tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>_>

+                      ();

+  plVar3 = (longlong *)

+           tip2::

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

+           ::operator->(this);

+  *(undefined1 *)(*plVar3 + 0x110) = 5;

+  tip2::

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

+  ::

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

+            (local_res8);

+  wil::

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

+  ::

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

+            (local_28);

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

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

+        (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_q(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x302,

+               &WPP_791618f6e4f933247a011d60507f9013_Traceguids,0);

+    }

+    uVar2 = 0x57;

   }

   else {

-    pcVar2 = (char *)func_0x000180110b40(acStack_13);

+    iVar1 = IsPreventConnectBitSet();

+    if (iVar1 == 0) {

+      uVar2 = WFDMgrWFDSvcGetProvisioningInfo

+                        (param_1,param_3,param_4,param_5,param_6,param_7,param_8,param_9);

+      if (uVar2 != 0) {

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

+          return uVar2;

+        }

+        if ((WPP_GLOBAL_Control[0x69] != '\0') && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+          WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x305,

+                   &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

+        }

+      }

+    }

+    else {

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

+          (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+        WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x304,

+                &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+      }

+      uVar2 = 0x964;

+    }

   }

-  *(undefined8 *)param_1 = 0;

-  *(undefined8 *)(param_1 + 8) = 0;

-  *(undefined8 *)(param_1 + 0x10) = uVar3;

-  *(undefined8 *)(param_1 + 0x18) = uVar3;

-  if (pcVar2 == acStack_13) {

-    *(undefined8 *)(param_1 + 0x10) = uVar3;

-    *(undefined8 *)(param_1 + 0x18) = 0xf;

-    *param_1 = SUB81(uVar3,0);

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x306,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar2);

   }

-  else {

-    std::basic_string<char,std::char_traits<char>,std::allocator<char>_>::

-    _Construct<1,char*___ptr64>(param_1,pcVar2,(__uint64)(acStack_13 + -(longlong)pcVar2));

-  }

-  return param_1;

+  return uVar2;

 }
```

## `RpcWfdSvcLowPrivGetSessionEndpointPairs`  (modified)

```diff
--- RpcWfdSvcLowPrivGetSessionEndpointPairs
+++ RpcWfdSvcLowPrivGetSessionEndpointPairs
@@ -1,82 +1,67 @@
 

-void RpcWfdSvcLowPrivGetSessionEndpointPairs

-               (_Hash<std::_Uset_traits<DOT11_BAND_CHANNEL_HINT,std::_Uhash_compare<DOT11_BAND_CHANNEL_HINT,wlansvc::ChannelHintHash,wlansvc::ChannelHintEqual>,std::allocator<DOT11_BAND_CHANNEL_HINT>,0>_>

-                *param_1,undefined8 param_2,__uint64 param_3,undefined8 param_4,undefined8 param_5,

-               _List_node<struct_std::pair<struct_std::pair<class_std::basic_string<unsigned_short,struct_std::char_traits<unsigned_short>,class_std::allocator<unsigned_short>_>,void*___ptr64>_const_,class_std::shared_ptr<struct_PM_PCB>_>,void*___ptr64>

-               *param_6,longlong param_7)

+ulong RpcWfdSvcLowPrivGetSessionEndpointPairs

+                (void *param_1,__uint64 param_2,_WFD_SESSION_ENDPOINT_PAIR *param_3,

+                _WFD_SESSION_ENDPOINT_PAIR *param_4)

 

 {

-  byte *pbVar1;

-  code *pcVar2;

-  longlong in_RAX;

-  _List_node<struct_std::pair<struct_std::pair<class_std::basic_string<unsigned_short,struct_std::char_traits<unsigned_short>,class_std::allocator<unsigned_short>_>,void*___ptr64>_const_,class_std::shared_ptr<struct_PM_PCB>_>,void*___ptr64>

-  *p_Var3;

-  __uint64 _Var4;

-  undefined8 *puVar5;

-  _List_node<std::pair<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_const_,std::shared_ptr<PM_PCB>_>,void*___ptr64>

-  *p_Var6;

-  longlong *unaff_RBX;

-  __uint64 unaff_RBP;

-  undefined8 *unaff_RSI;

-  _Hash<std::_Umap_traits<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>,std::shared_ptr<PM_PCB>,std::_Uhash_compare<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>,std::hash<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_>,std::equal_to<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_>_>,std::allocator<std::pair<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_const_,std::shared_ptr<PM_PCB>_>_>,0>_>

-  *unaff_RDI;

-  float fVar7;

-  _Hash<std::_Umap_traits<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>,std::shared_ptr<PM_PCB>,std::_Uhash_compare<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>,std::hash<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_>,std::equal_to<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_>_>,std::allocator<std::pair<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_const_,std::shared_ptr<PM_PCB>_>_>,0>_>

-  *p_StackX_20;

+  ulong uVar1;

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

+  *this;

+  longlong *plVar2;

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

+  local_res8 [8];

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

+  local_28 [16];

   

-  pbVar1 = (byte *)((longlong)unaff_RBX + (longlong)param_1 * 4 + -0x33);

-  *pbVar1 = *pbVar1 | (byte)in_RAX;

-  std::

-  _Hash<std::_Uset_traits<DOT11_BAND_CHANNEL_HINT,std::_Uhash_compare<DOT11_BAND_CHANNEL_HINT,wlansvc::ChannelHintHash,wlansvc::ChannelHintEqual>,std::allocator<DOT11_BAND_CHANNEL_HINT>,0>_>

-  ::_Find_last<DOT11_BAND_CHANNEL_HINT>(param_1,(DOT11_BAND_CHANNEL_HINT *)(in_RAX + -0x28),param_3)

-  ;

-  if (param_7 == 0) {

-    if (*(longlong *)(unaff_RDI + 0x10) == 0x7ffffffffffffff) {

-      std::_Xlength_error("unordered_map/set too long");

-      pcVar2 = (code *)swi(3);

-      (*pcVar2)();

-      return;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x31b,

+            &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

+  }

+  this = (tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>

+          *)tip2::

+            start<tip2::tip_test<tip2::details::merged_data<_tip_ASPDeprecationUsageTest,_tip_ASPDeprecationUsageTest>_>_>

+                      ();

+  plVar2 = (longlong *)

+           tip2::

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

+           ::operator->(this);

+  *(undefined1 *)(*plVar2 + 0x110) = 0xb;

+  tip2::

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

+  ::

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

+            (local_res8);

+  wil::

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

+  ::

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

+            (local_28);

+  if (((param_1 == (void *)0x0) || (param_2 == 0)) ||

+     ((param_3 == (_WFD_SESSION_ENDPOINT_PAIR *)0x0 ||

+      (param_4 == (_WFD_SESSION_ENDPOINT_PAIR *)0x0)))) {

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

+        (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x31c,

+              &WPP_791618f6e4f933247a011d60507f9013_Traceguids);

     }

-    p_StackX_20 = unaff_RDI + 8;

-    p_Var3 = std::_Allocate<16,std::_Default_allocate_traits,0>(0x20);

-    *(undefined8 *)(p_Var3 + 0x10) = *unaff_RSI;

-    *(undefined4 *)(p_Var3 + 0x18) = *(undefined4 *)(unaff_RSI + 1);

-    fVar7 = (float)(*(longlong *)(unaff_RDI + 0x10) + 1U) / (float)*(ulonglong *)(unaff_RDI + 0x38);

-    if (*(float *)unaff_RDI <= fVar7 && fVar7 != *(float *)unaff_RDI) {

-      _Var4 = std::

-              _Hash<std::_Umap_traits<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>,std::shared_ptr<PM_PCB>,std::_Uhash_compare<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>,std::hash<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_>,std::equal_to<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_>_>,std::allocator<std::pair<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_const_,std::shared_ptr<PM_PCB>_>_>,0>_>

-              ::_Desired_grow_bucket_count(unaff_RDI,*(longlong *)(unaff_RDI + 0x10) + 1U);

-      std::

-      _Hash<std::_Uset_traits<DOT11_BAND_CHANNEL_HINT,std::_Uhash_compare<DOT11_BAND_CHANNEL_HINT,wlansvc::ChannelHintHash,wlansvc::ChannelHintEqual>,std::allocator<DOT11_BAND_CHANNEL_HINT>,0>_>

-      ::_Forced_rehash((_Hash<std::_Uset_traits<DOT11_BAND_CHANNEL_HINT,std::_Uhash_compare<DOT11_BAND_CHANNEL_HINT,wlansvc::ChannelHintHash,wlansvc::ChannelHintEqual>,std::allocator<DOT11_BAND_CHANNEL_HINT>,0>_>

-                        *)unaff_RDI,_Var4);

-      puVar5 = (undefined8 *)

-               std::

-               _Hash<std::_Uset_traits<DOT11_BAND_CHANNEL_HINT,std::_Uhash_compare<DOT11_BAND_CHANNEL_HINT,wlansvc::ChannelHintHash,wlansvc::ChannelHintEqual>,std::allocator<DOT11_BAND_CHANNEL_HINT>,0>_>

-               ::_Find_last<DOT11_BAND_CHANNEL_HINT>

-                         ((_Hash<std::_Uset_traits<DOT11_BAND_CHANNEL_HINT,std::_Uhash_compare<DOT11_BAND_CHANNEL_HINT,wlansvc::ChannelHintHash,wlansvc::ChannelHintEqual>,std::allocator<DOT11_BAND_CHANNEL_HINT>,0>_>

-                           *)unaff_RDI,(DOT11_BAND_CHANNEL_HINT *)&param_6,(__uint64)(p_Var3 + 0x10)

-                         );

-      param_6 = (_List_node<struct_std::pair<struct_std::pair<class_std::basic_string<unsigned_short,struct_std::char_traits<unsigned_short>,class_std::allocator<unsigned_short>_>,void*___ptr64>_const_,class_std::shared_ptr<struct_PM_PCB>_>,void*___ptr64>

-                 *)*puVar5;

-      param_7 = puVar5[1];

-    }

-    p_Var6 = std::

-             _Hash<std::_Umap_traits<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>,std::shared_ptr<PM_PCB>,std::_Uhash_compare<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>,std::hash<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_>,std::equal_to<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_>_>,std::allocator<std::pair<std::pair<std::basic_string<unsigned_short,std::char_traits<unsigned_short>,std::allocator<unsigned_short>_>,void*___ptr64>_const_,std::shared_ptr<PM_PCB>_>_>,0>_>

-             ::_Insert_new_node_before(unaff_RDI,unaff_RBP,param_6,p_Var3);

-    *unaff_RBX = (longlong)p_Var6;

-    *(undefined1 *)(unaff_RBX + 1) = 1;

-    std::

-    _Alloc_construct_ptr<std::allocator<std::_Tree_node<WiFiMovement::MacAddressWrapper,void*___ptr64>_>_>

-    ::

-    ~_Alloc_construct_ptr<std::allocator<std::_Tree_node<WiFiMovement::MacAddressWrapper,void*___ptr64>_>_>

-              ((_Alloc_construct_ptr<std::allocator<std::_Tree_node<WiFiMovement::MacAddressWrapper,void*___ptr64>_>_>

-                *)&p_StackX_20);

+    uVar1 = 0x57;

   }

   else {

-    *unaff_RBX = param_7;

-    *(undefined1 *)(unaff_RBX + 1) = 0;

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_qI(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x31d,

+                &WPP_791618f6e4f933247a011d60507f9013_Traceguids,param_1,param_2);

+    }

+    memset(param_3,0,0x100);

+    memset(param_4,0,0x100);

+    uVar1 = WFDMgrWFDSvcGetSessionEndpointPairs(param_1,param_2,param_3,param_4);

   }

-  return;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x31e,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,uVar1);

+  }

+  return uVar1;

 }
```

## `wlansvc::rpc_server::details::WlanRpcClientContext::WlanRpcClientContext`  (modified)

```diff
--- wlansvc::rpc_server::details::WlanRpcClientContext::WlanRpcClientContext
+++ wlansvc::rpc_server::details::WlanRpcClientContext::WlanRpcClientContext
@@ -1,2 +1,145 @@
-Failed to decompile wlansvc.dll - .ProgramDB wlansvc::rpc_server::details::WlanRpcClientContext::WlanRpcClientContext : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

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

+/* public: __cdecl wlansvc::rpc_server::details::WlanRpcClientContext::WlanRpcClientContext(unsigned

+   long,unsigned int,enum WlanRpcClientType,bool,bool,bool) __ptr64 */

+

+WlanRpcClientContext * __thiscall

+wlansvc::rpc_server::details::WlanRpcClientContext::WlanRpcClientContext

+          (WlanRpcClientContext *this,ulong param_1,uint param_2,WlanRpcClientType param_3,

+          bool param_4,bool param_5,bool param_6)

+

+{

+  WlanRpcClientContext *pWVar1;

+  ulong uVar2;

+  void *pvVar3;

+  longlong lVar4;

+  void *unaff_retaddr;

+  

+  InitializeCriticalSectionEx((LPCRITICAL_SECTION)this,0,0);

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

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

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

+  pvVar3 = std::_Allocate<16,std::_Default_allocate_traits,0>(0x20);

+  *(void **)pvVar3 = pvVar3;

+  *(void **)((longlong)pvVar3 + 8) = pvVar3;

+  *(void **)(this + 0x30) = pvVar3;

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

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

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

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

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

+  *(undefined4 *)(this + 0x28) = 0x3f800000;

+  std::

+  _Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry>_>_>_>_>_>

+  ::_Assign_grow((_Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry>_>_>_>_>_>

+                  *)(this + 0x40),0x10,*(undefined8 *)(this + 0x30));

+  *(undefined4 *)(this + 0x68) = 0;

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

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

+  pvVar3 = std::_Allocate<16,std::_Default_allocate_traits,0>(0x20);

+  *(void **)pvVar3 = pvVar3;

+  *(void **)((longlong)pvVar3 + 8) = pvVar3;

+  *(void **)(this + 0x70) = pvVar3;

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

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

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

+  *(undefined8 *)(this + 0x98) = 7;

+  *(undefined8 *)(this + 0xa0) = 8;

+  *(undefined4 *)(this + 0x68) = 0x3f800000;

+  std::

+  _Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry>_>_>_>_>_>

+  ::_Assign_grow((_Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry>_>_>_>_>_>

+                  *)(this + 0x80),0x10,*(undefined8 *)(this + 0x70));

+  *(undefined4 *)(this + 0xa8) = 0;

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

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

+  pvVar3 = std::_Allocate<16,std::_Default_allocate_traits,0>(0x20);

+  *(void **)pvVar3 = pvVar3;

+  *(void **)((longlong)pvVar3 + 8) = pvVar3;

+  *(void **)(this + 0xb0) = pvVar3;

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

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

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

+  *(undefined8 *)(this + 0xd8) = 7;

+  *(undefined8 *)(this + 0xe0) = 8;

+  *(undefined4 *)(this + 0xa8) = 0x3f800000;

+  std::

+  _Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry>_>_>_>_>_>

+  ::_Assign_grow((_Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry>_>_>_>_>_>

+                  *)(this + 0xc0),0x10,*(undefined8 *)(this + 0xb0));

+  *(undefined4 *)(this + 0xe8) = 0;

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

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

+  pvVar3 = std::_Allocate<16,std::_Default_allocate_traits,0>(0x20);

+  *(void **)pvVar3 = pvVar3;

+  *(void **)((longlong)pvVar3 + 8) = pvVar3;

+  *(void **)(this + 0xf0) = pvVar3;

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

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

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

+  *(undefined8 *)(this + 0x118) = 7;

+  *(undefined8 *)(this + 0x120) = 8;

+  *(undefined4 *)(this + 0xe8) = 0x3f800000;

+  std::

+  _Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry>_>_>_>_>_>

+  ::_Assign_grow((_Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry>_>_>_>_>_>

+                  *)(this + 0x100),0x10,*(undefined8 *)(this + 0xf0));

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

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

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

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

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

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

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

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

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

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

+  LOCK();

+  UNLOCK();

+  lVar4 = _s_incrementalClientContextId + 1;

+  _s_incrementalClientContextId = _s_incrementalClientContextId + 1;

+  *(longlong *)(this + 0x178) = lVar4;

+  *(ulong *)(this + 0x180) = param_1;

+  *(uint *)(this + 0x184) = param_2;

+  *(WlanRpcClientType *)(this + 0x188) = param_3;

+  this[0x18c] = (WlanRpcClientContext)param_4;

+  this[0x18d] = (WlanRpcClientContext)param_5;

+  this[0x18e] = (WlanRpcClientContext)param_6;

+  *(undefined2 *)(this + 399) = 0;

+  this[0x191] = (WlanRpcClientContext)0x0;

+  InitializeCriticalSectionEx((LPCRITICAL_SECTION)(this + 0x198),0,0);

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

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

+  std::

+  queue<WlanNotificationDataWrapper,std::deque<WlanNotificationDataWrapper,std::allocator<WlanNotificationDataWrapper>_>_>

+  ::

+  queue<WlanNotificationDataWrapper,std::deque<WlanNotificationDataWrapper,std::allocator<WlanNotificationDataWrapper>_>_>

+            ((queue<WlanNotificationDataWrapper,std::deque<WlanNotificationDataWrapper,std::allocator<WlanNotificationDataWrapper>_>_>

+              *)(this + 0x1d0));

+  *(undefined4 *)(this + 0x1f8) = 0;

+  this[0x1fc] = (WlanRpcClientContext)0x0;

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

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

+  this[0x220] = (WlanRpcClientContext)0x0;

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

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

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

+  this[0x240] = (WlanRpcClientContext)0x0;

+  pWVar1 = this + 0x200;

+  *(WlanRpcClientContext **)(this + 0x208) = pWVar1;

+  *(WlanRpcClientContext **)pWVar1 = pWVar1;

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

+      (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_Ll(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),10);

+  }

+  if (param_4) {

+    uVar2 = WfdInterfaceManagerInitializeClientContext(this);

+    if (uVar2 != 0) {

+                    /* WARNING: Subroutine does not return */

+      wil::details::in1diag3::_Throw_Win32

+                (unaff_retaddr,0x81,"onecoreuap\\net\\wlan\\autocfg\\server\\rpcsrv.cpp",uVar2);

+    }

+  }

+  return this;

+}

+
```

## `wlan::cam::Capability::Capability`  (modified)

```diff
--- wlan::cam::Capability::Capability
+++ wlan::cam::Capability::Capability
@@ -1,2 +1,80 @@
-Failed to decompile wlansvc.dll - .ProgramDB wlan::cam::Capability::Capability : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: __cdecl wlan::cam::Capability::Capability(unsigned short const * __ptr64 const) __ptr64

+    */

+

+Capability * __thiscall wlan::cam::Capability::Capability(Capability *this,ushort *param_1)

+

+{

+  bool bVar1;

+  com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+  *pcVar2;

+  FeatureImpl<struct___WilFeatureTraits_Feature_Bugfix_56634980> *pFVar3;

+  undefined8 uVar4;

+  undefined4 local_res8 [2];

+  com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+  local_res10 [8];

+  

+  local_res8[0] = 0;

+  *(undefined8 *)this = 0;

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

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

+            ::__l2::impl;

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

+                    ((FeatureImpl<__WilFeatureTraits_Feature_Bugfix_56634980> *)

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

+                      ::__l2::impl);

+  if (!bVar1) {

+    pcVar2 = (com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+              *)InitCapabilityAccessStatics((Capability *)pFVar3);

+    uVar4 = *(undefined8 *)pcVar2;

+  }

+  else {

+    pcVar2 = local_res10;

+    uVar4 = 0;

+  }

+  *(undefined8 *)pcVar2 = 0;

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

+  if (!bVar1) {

+    wil::com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+    ::~com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+              ((com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+                *)local_res8);

+  }

+  else {

+    wil::com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+    ::~com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+              (local_res10);

+  }

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

+            ::__l2::impl;

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

+                    ((FeatureImpl<__WilFeatureTraits_Feature_Bugfix_56634980> *)

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

+                      ::__l2::impl);

+  if (!bVar1) {

+    pcVar2 = (com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+              *)InitCapabilityUsageStatics((Capability *)pFVar3);

+    uVar4 = *(undefined8 *)pcVar2;

+  }

+  else {

+    pcVar2 = local_res10;

+    uVar4 = 0;

+  }

+  *(undefined8 *)pcVar2 = 0;

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

+  if (!bVar1) {

+    wil::com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+    ::~com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+              ((com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+                *)local_res8);

+  }

+  else {

+    wil::com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+    ::~com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+              (local_res10);

+  }

+  std::_Mutex_base::_Mutex_base((_Mutex_base *)(this + 0x20),0);

+  *(ushort **)(this + 0x40) = param_1;

+  return this;

+}

+
```

## `wlan::cam::Capability::ProcessHasAccess`  (modified)

```diff
--- wlan::cam::Capability::ProcessHasAccess
+++ wlan::cam::Capability::ProcessHasAccess
@@ -1,2 +1,129 @@
-Failed to decompile wlansvc.dll - .ProgramDB wlan::cam::Capability::ProcessHasAccess : 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: bool __cdecl wlan::cam::Capability::ProcessHasAccess(unsigned int,bool,bool,bool)const

+   __ptr64 */

+

+bool __thiscall

+wlan::cam::Capability::ProcessHasAccess

+          (Capability *this,uint param_1,bool param_2,bool param_3,bool param_4)

+

+{

+  code *pcVar1;

+  longlong *plVar2;

+  bool bVar3;

+  int iVar4;

+  ICapabilityAccessStatics *pIVar5;

+  longlong lVar6;

+  void *unaff_retaddr;

+  undefined1 auStack_a8 [32];

+  undefined4 local_88;

+  longlong **local_80;

+  longlong *local_68;

+  int local_60 [2];

+  HStringReference local_58 [32];

+  ulonglong local_38;

+  

+  local_38 = __security_cookie ^ (ulonglong)auStack_a8;

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

+                    ((FeatureImpl<__WilFeatureTraits_Feature_Bugfix_56634980> *)

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

+                      ::__l2::impl);

+  if (bVar3) {

+    pIVar5 = GetCapabilityAccessStatics(this);

+    if (pIVar5 != (ICapabilityAccessStatics *)0x0) {

+      local_60[0] = 3;

+      pcVar1 = *(code **)(*(longlong *)pIVar5 + 0x38);

+      local_68 = (longlong *)0x0;

+      lVar6 = Microsoft::WRL::Wrappers::HStringReference::

+              HStringReference<unsigned_short_const*___ptr64>(local_58,this + 0x40);

+      local_80 = &local_68;

+      local_88 = 0;

+      iVar4 = (*pcVar1)(pIVar5,0,*(undefined8 *)(lVar6 + 0x18),param_1);

+      if (iVar4 < 0) {

+                    /* WARNING: Subroutine does not return */

+        wil::details::in1diag3::_Throw_Hr

+                  (unaff_retaddr,0x28,"onecoreuap\\net\\wlan\\commoncpp\\src\\camhelpers.cpp",iVar4)

+        ;

+      }

+      if (!param_2) {

+        iVar4 = (**(code **)(*local_68 + 0x48))(local_68,0);

+        if (iVar4 < 0) {

+                    /* WARNING: Subroutine does not return */

+          wil::details::in1diag3::_Throw_Hr

+                    (unaff_retaddr,0x2c,"onecoreuap\\net\\wlan\\commoncpp\\src\\camhelpers.cpp",

+                     iVar4);

+        }

+      }

+      if ((param_3) && (iVar4 = (**(code **)(*local_68 + 0x58))(local_68,1), iVar4 < 0)) {

+                    /* WARNING: Subroutine does not return */

+        wil::details::in1diag3::_Throw_Hr

+                  (unaff_retaddr,0x30,"onecoreuap\\net\\wlan\\commoncpp\\src\\camhelpers.cpp",iVar4)

+        ;

+      }

+      iVar4 = (**(code **)(*local_68 + 0x98))(local_68,local_60);

+      if (iVar4 < 0) {

+                    /* WARNING: Subroutine does not return */

+        wil::details::in1diag3::_Throw_Hr

+                  (unaff_retaddr,0x32,"onecoreuap\\net\\wlan\\commoncpp\\src\\camhelpers.cpp",iVar4)

+        ;

+      }

+      param_4 = local_60[0] == 3;

+      wil::

+      com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>::

+      ~com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+                ((com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+                  *)&local_68);

+    }

+  }

+  else {

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

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

+      local_60[0] = 3;

+      pcVar1 = *(code **)(*plVar2 + 0x38);

+      local_68 = (longlong *)0x0;

+      lVar6 = Microsoft::WRL::Wrappers::HStringReference::

+              HStringReference<unsigned_short_const*___ptr64>(local_58,this + 0x40);

+      local_80 = &local_68;

+      local_88 = 0;

+      iVar4 = (*pcVar1)(plVar2,0,*(undefined8 *)(lVar6 + 0x18),param_1);

+      if (iVar4 < 0) {

+                    /* WARNING: Subroutine does not return */

+        wil::details::in1diag3::_Throw_Hr

+                  (unaff_retaddr,0x3f,"onecoreuap\\net\\wlan\\commoncpp\\src\\camhelpers.cpp",iVar4)

+        ;

+      }

+      if (!param_2) {

+        iVar4 = (**(code **)(*local_68 + 0x48))(local_68,0);

+        if (iVar4 < 0) {

+                    /* WARNING: Subroutine does not return */

+          wil::details::in1diag3::_Throw_Hr

+                    (unaff_retaddr,0x43,"onecoreuap\\net\\wlan\\commoncpp\\src\\camhelpers.cpp",

+                     iVar4);

+        }

+      }

+      if ((param_3) && (iVar4 = (**(code **)(*local_68 + 0x58))(local_68,1), iVar4 < 0)) {

+                    /* WARNING: Subroutine does not return */

+        wil::details::in1diag3::_Throw_Hr

+                  (unaff_retaddr,0x47,"onecoreuap\\net\\wlan\\commoncpp\\src\\camhelpers.cpp",iVar4)

+        ;

+      }

+      iVar4 = (**(code **)(*local_68 + 0x98))(local_68,local_60);

+      if (iVar4 < 0) {

+                    /* WARNING: Subroutine does not return */

+        wil::details::in1diag3::_Throw_Hr

+                  (unaff_retaddr,0x49,"onecoreuap\\net\\wlan\\commoncpp\\src\\camhelpers.cpp",iVar4)

+        ;

+      }

+      param_4 = local_60[0] == 3;

+      wil::

+      com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>::

+      ~com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+                ((com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+                  *)&local_68);

+    }

+  }

+  return param_4;

+}

+
```

## `wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess`  (modified)

```diff
--- wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess
+++ wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess
@@ -1,2 +1,32 @@
-Failed to decompile wlansvc.dll - .ProgramDB wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: bool __cdecl

+   wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess(class

+   wlansvc::rpc_server::details::WlanRpcClientContext const & __ptr64)const __ptr64 */

+

+bool __thiscall

+wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess

+          (WlanRpcServerContext *this,WlanRpcClientContext *param_1)

+

+{

+  bool bVar1;

+  

+  if (param_1[0x18e] == (WlanRpcClientContext)0x0) {

+    bVar1 = wlan::cam::Capability::ProcessHasAccess

+                      ((Capability *)(DAT_0 + 0x108),*(uint *)(param_1 + 0x184),true,

+                       (bool)param_1[399],false);

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_ILl(*(undefined8 *)(WPP_GLOBAL_Control + 0x60));

+    }

+  }

+  else {

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_IL(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xd,*(undefined4 *)(param_1 + 0x184),

+                *(undefined8 *)(param_1 + 0x178),*(undefined4 *)(param_1 + 0x184));

+    }

+    bVar1 = true;

+  }

+  return bVar1;

+}

+
```

## `CWfdDeviceBroker::AepAccessCheck`  (modified)

```diff
--- CWfdDeviceBroker::AepAccessCheck
+++ CWfdDeviceBroker::AepAccessCheck
@@ -1,2 +1,158 @@
-Failed to decompile wlansvc.dll - .ProgramDB CWfdDeviceBroker::AepAccessCheck : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

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

+   guard_dispatch_icall */

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

+/* public: void __cdecl CWfdDeviceBroker::AepAccessCheck(void) __ptr64 */

+

+void __thiscall CWfdDeviceBroker::AepAccessCheck(CWfdDeviceBroker *this)

+

+{

+  undefined4 uVar1;

+  code *pcVar2;

+  longlong *plVar3;

+  ushort *puVar4;

+  undefined8 uVar5;

+  int iVar6;

+  uint uVar7;

+  longlong lVar8;

+  ulong uVar9;

+  CAutoPtr<unsigned_short,DefaultArrayDeleter> *pCVar10;

+  ulonglong uVar11;

+  undefined1 auStackY_a8 [32];

+  CComInitialization local_68 [4];

+  int local_64;

+  longlong *local_60;

+  longlong *local_58;

+  undefined **local_50;

+  ushort *local_48;

+  HStringReference local_40 [24];

+  undefined8 local_28;

+  ulonglong local_20;

+  

+  local_20 = __security_cookie ^ (ulonglong)auStackY_a8;

+  if ((((*(longlong *)this == 0) && (*(longlong *)(this + 8) == 0)) ||

+      (*(longlong *)(this + 0x10) == 0)) || (*(longlong *)(this + 0x18) == 0)) {

+                    /* WARNING: Subroutine does not return */

+    WFDSvc::CWFDSvcException::Throw

+              (-0x7ff8ffa9,"CWfdDeviceBroker::AepAccessCheck",

+               "onecoreuap\\net\\wlan\\autocfg\\wlansvcext\\wfddevicebroker\\src\\wfddevicebroker.cpp"

+               ,0xcc,(ushort *)L"Invalid arguments");

+  }

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

+      (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF__MAC_SDDl(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xe);

+  }

+  if (this[0x28] == (CWfdDeviceBroker)0x0) {

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

+        (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x13,

+              &WPP_c78a48f1e3aa3681843a5f193f9486e3_Traceguids);

+    }

+  }

+  else {

+    local_50 = &CAutoPtr<unsigned_char,DefaultArrayDeleter>::_vftable_;

+    local_48 = (ushort *)0x0;

+    pCVar10 = (CAutoPtr<unsigned_short,DefaultArrayDeleter> *)&local_50;

+    AllocateAndEncodeAepIdString(*(uchar **)(this + 0x10),pCVar10);

+    CComInitialization::CComInitialization(local_68,(ulong)pCVar10);

+    local_58 = (longlong *)0x0;

+    local_60 = (longlong *)0x0;

+    local_64 = 3;

+    local_28 = 0;

+    Microsoft::WRL::Wrappers::HStringReference::CreateReference

+              (local_40,(ushort *)L"Windows.Internal.CapabilityAccess.CapabilityAccess",0x33,0x32);

+    uVar5 = local_28;

+    Microsoft::WRL::ComPtr<ITaskService>::InternalRelease((ComPtr<ITaskService> *)&local_58);

+    iVar6 = RoGetActivationFactory(uVar5,&_GUID_518f3880_4e5c_4524_ab03_cd01336b2178,&local_58);

+    if (iVar6 < 0) {

+                    /* WARNING: Subroutine does not return */

+      WFDSvc::CWFDSvcException::Throw

+                (iVar6,"CWfdDeviceBroker::AepAccessCheck",

+                 "onecoreuap\\net\\wlan\\autocfg\\wlansvcext\\wfddevicebroker\\src\\wfddevicebroker.cpp"

+                 ,0xe6,(ushort *)

+                       L"[WfdDeviceBroker] Failed to create RuntimeClass_Windows_Internal_CapabilityAccess_CapabilityAccess object"

+                );

+    }

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

+        (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xf,

+              &WPP_c78a48f1e3aa3681843a5f193f9486e3_Traceguids);

+    }

+    plVar3 = local_58;

+    pcVar2 = *(code **)(*local_58 + 0x38);

+    Microsoft::WRL::ComPtr<ITaskService>::InternalRelease((ComPtr<ITaskService> *)&local_60);

+    uVar1 = *(undefined4 *)(this + 0x24);

+    lVar8 = Microsoft::WRL::Wrappers::HStringReference::

+            HStringReference<unsigned_short_const*___ptr64>(local_40);

+    uVar9 = 0;

+    iVar6 = (*pcVar2)(plVar3,0,*(undefined8 *)(lVar8 + 0x18),uVar1);

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

+        (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      uVar9 = 0x10;

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

+               &WPP_c78a48f1e3aa3681843a5f193f9486e3_Traceguids,iVar6);

+    }

+    puVar4 = local_48;

+    plVar3 = local_60;

+    if (iVar6 < 0) {

+                    /* WARNING: Subroutine does not return */

+      WFDSvc::CWFDSvcException::Throw

+                (iVar6,"CWfdDeviceBroker::AepAccessCheck",

+                 "onecoreuap\\net\\wlan\\autocfg\\wlansvcext\\wfddevicebroker\\src\\wfddevicebroker.cpp"

+                 ,0xef,(ushort *)L"CreateWithProcessId failed");

+    }

+    pcVar2 = *(code **)(*local_60 + 0x68);

+    local_28 = 0;

+    uVar11 = 0xffffffffffffffff;

+    do {

+      uVar11 = uVar11 + 1;

+    } while (local_48[uVar11] != 0);

+    if (0xffffffff < uVar11) {

+                    /* WARNING: Subroutine does not return */

+      Microsoft::WRL::Details::RaiseException(-0x7ff8fdea,uVar9);

+    }

+    uVar7 = Microsoft::WRL::Wrappers::HStringReference::AddOne((uint)uVar11);

+    Microsoft::WRL::Wrappers::HStringReference::CreateReference(local_40,puVar4,uVar7,(uint)uVar11);

+    iVar6 = (*pcVar2)(plVar3,local_28);

+    if (iVar6 < 0) {

+                    /* WARNING: Subroutine does not return */

+      WFDSvc::CWFDSvcException::Throw

+                (iVar6,"CWfdDeviceBroker::AepAccessCheck",

+                 "onecoreuap\\net\\wlan\\autocfg\\wlansvcext\\wfddevicebroker\\src\\wfddevicebroker.cpp"

+                 ,0xf5,(ushort *)L"[WfdDeviceBroker] ICapabilityAccess::put_TargetObjectId failed");

+    }

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

+        (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x11,

+              &WPP_c78a48f1e3aa3681843a5f193f9486e3_Traceguids);

+    }

+    iVar6 = (**(code **)(*local_60 + 0x98))(local_60,&local_64);

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

+        (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x12,

+               &WPP_c78a48f1e3aa3681843a5f193f9486e3_Traceguids,iVar6);

+    }

+    if (iVar6 < 0) {

+                    /* WARNING: Subroutine does not return */

+      WFDSvc::CWFDSvcException::Throw

+                (iVar6,"CWfdDeviceBroker::AepAccessCheck",

+                 "onecoreuap\\net\\wlan\\autocfg\\wlansvcext\\wfddevicebroker\\src\\wfddevicebroker.cpp"

+                 ,0xfd,(ushort *)L"AccessCheck failed");

+    }

+    if (local_64 != 3) {

+                    /* WARNING: Subroutine does not return */

+      WFDSvc::CWFDSvcException::Throw

+                (-0x7ff8fffb,"CWfdDeviceBroker::AepAccessCheck",

+                 "onecoreuap\\net\\wlan\\autocfg\\wlansvcext\\wfddevicebroker\\src\\wfddevicebroker.cpp"

+                 ,0x103,(ushort *)

+                        L"[WfdDeviceBroker] ICapabilityAccess::AccessCheck returned non \'Allowed\' value"

+                );

+    }

+    Microsoft::WRL::ComPtr<ITaskService>::InternalRelease((ComPtr<ITaskService> *)&local_60);

+    Microsoft::WRL::ComPtr<ITaskService>::InternalRelease((ComPtr<ITaskService> *)&local_58);

+    CoUninitialize();

+    operator_delete__(puVar4);

+  }

+  return;

+}

+
```

## `wlansvc::IntfctxtTelemetry::Init`  (modified)

```diff
--- wlansvc::IntfctxtTelemetry::Init
+++ wlansvc::IntfctxtTelemetry::Init
@@ -1,2 +1,52 @@
-Failed to decompile wlansvc.dll - .ProgramDB wlansvc::IntfctxtTelemetry::Init : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: void __cdecl wlansvc::IntfctxtTelemetry::Init(enum

+   wlansvc::IntfctxtTelemetry::DriverModel) __ptr64 */

+

+void __thiscall wlansvc::IntfctxtTelemetry::Init(IntfctxtTelemetry *this,DriverModel param_1)

+

+{

+  char *pcVar1;

+  undefined4 uStack_18;

+  undefined4 uStack_14;

+  uint uStack_10;

+  

+  uStack_10 = uStack_10 & 0xffffff00;

+  uStack_18 = 0;

+  uStack_14 = 0;

+  if (param_1 == 0) {

+    uStack_18 = 0;

+    uStack_14 = 0;

+  }

+  else if (1 < param_1 - 3) {

+    uStack_18 = 3;

+    uStack_14 = 3;

+  }

+  *(undefined8 *)this = 0;

+  *(undefined8 *)(this + 8) = 1;

+  *(undefined4 *)(this + 0x10) = uStack_18;

+  *(undefined4 *)(this + 0x14) = uStack_14;

+  *(uint *)(this + 0x18) = uStack_10;

+  *(DriverModel *)(this + 0x1c) = param_1;

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

+      (2 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    if (param_1 == 1) {

+      pcVar1 = "NativeWiFi";

+    }

+    else if (param_1 == 2) {

+      pcVar1 = "WDI";

+    }

+    else if (param_1 == 3) {

+      pcVar1 = "WiFiCxKMDF";

+    }

+    else if (param_1 == 4) {

+      pcVar1 = "WiFiCxUMDF";

+    }

+    else {

+      pcVar1 = "Unknown";

+    }

+    WPP_SF_s(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xb,

+             &WPP_b8d49e9a5f893e5c54cd733259ac76dd_Traceguids,pcVar1);

+  }

+  return;

+}

+
```

## `wlan::cam::Capability::~Capability`  (modified)

```diff
--- wlan::cam::Capability::~Capability
+++ wlan::cam::Capability::~Capability
@@ -1,2 +1,18 @@
-Failed to decompile wlansvc.dll - .ProgramDB wlan::cam::Capability::~Capability : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: __cdecl wlan::cam::Capability::~Capability(void) __ptr64 */

+

+void __thiscall wlan::cam::Capability::~Capability(Capability *this)

+

+{

+  _Mtx_destroy_in_situ(this + 0x20);

+  wil::com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>::

+  ~com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+            ((com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+              *)(this + 0x18));

+  wil::com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>::

+  ~com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+            ((com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+              *)(this + 0x10));

+  return;

+}

+
```

## `RpcRegisterNotification`  (modified)

```diff
--- RpcRegisterNotification
+++ wlansvc::rpc_server::details::WlanRpcClientContext::NotifyCamWiFiControlUsed
@@ -1,80 +1,2 @@
-

-ulonglong RpcRegisterNotification(char *param_1)

-

-{

-  byte *pbVar1;

-  byte bVar2;

-  char cVar3;

-  ulong uVar4;

-  char *in_RAX;

-  byte bVar5;

-  undefined4 uVar6;

-  undefined4 unaff_EBX;

-  ulonglong unaff_RBP;

-  _WLAN_INTERFACE_CONTEXT *unaff_RSI;

-  int *unaff_RDI;

-  undefined *in_R10;

-  undefined *unaff_R15;

-  char *unaff_retaddr;

-  

-  *(int *)(unaff_RBP - 0x87bf040) = *(int *)(unaff_RBP - 0x87bf040) + 1;

-  cVar3 = (char)in_RAX;

-  *in_RAX = *in_RAX + cVar3;

-  bVar5 = (byte)param_1;

-  in_RAX[-0x7b] = in_RAX[-0x7b] + bVar5;

-  *unaff_RDI = *unaff_RDI + -1;

-  *in_RAX = *in_RAX + cVar3;

-  *param_1 = *param_1 + (char)((uint)unaff_EBX >> 8);

-  *unaff_retaddr = *unaff_retaddr - bVar5;

-  *in_RAX = *in_RAX + cVar3;

-  pbVar1 = (byte *)(in_RAX + -0x75);

-  bVar2 = *pbVar1;

-  *pbVar1 = *pbVar1 + bVar5;

-  if (CARRY1(bVar2,bVar5) || *pbVar1 == 0) {

-    if (unaff_RSI == (_WLAN_INTERFACE_CONTEXT *)0x0) {

-      MicrosoftTelemetryAssertTriggeredNoArgs();

-      in_R10 = WPP_GLOBAL_Control;

-    }

-    if (*(int *)(unaff_retaddr + 0x40) != 2) {

-      if (*(int *)(unaff_retaddr + 0x40) != 4) goto LAB_0;

-      if (((in_R10 != unaff_R15) && (2 < (byte)in_R10[0x69])) && ((in_R10[0x6c] & 1) != 0)) {

-        param_1 = *(char **)(in_R10 + 0x60);

-        goto code_r0x0001800b1e57;

-      }

-      goto LAB_1;

-    }

-    if (((in_R10 != unaff_R15) && (2 < (byte)in_R10[0x69])) && ((in_R10[0x6c] & 1) != 0)) {

-      WPP_SF_(*(undefined8 *)(in_R10 + 0x60),0xd);

-    }

-    uVar4 = WFDGOStopGO(unaff_RSI);

-    if (((uVar4 != 0) && (WPP_GLOBAL_Control != unaff_R15)) &&

-       ((WPP_GLOBAL_Control[0x69] != '\0' && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)))) {

-      uVar6 = 0xe;

-      goto LAB_2;

-    }

-  }

-  else {

-code_r0x0001800b1e57:

-    WPP_SF_(param_1,0xb);

-LAB_1:

-    uVar4 = WFDClientDisconnect(unaff_RSI);

-    if ((((uVar4 != 0) && (WPP_GLOBAL_Control != unaff_R15)) && (WPP_GLOBAL_Control[0x69] != '\0'))

-       && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

-      uVar6 = 0xc;

-LAB_2:

-      WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),uVar6);

-    }

-  }

-  unaff_RBP = 1;

-  unaff_retaddr[0x28] = '\0';

-  unaff_retaddr[0x29] = '\0';

-  unaff_retaddr[0x2a] = '\0';

-  unaff_retaddr[0x2b] = '\0';

-  in_R10 = WPP_GLOBAL_Control;

-LAB_0:

-  if (((in_R10 != unaff_R15) && (3 < (byte)in_R10[0x69])) && ((in_R10[0x6c] & 1) != 0)) {

-    WPP_SF_D(*(undefined8 *)(in_R10 + 0x60),0xf);

-  }

-  return unaff_RBP & 0xffffffff;

-}

-

+Failed to decompile wlansvc.dll - .ProgramDB wlansvc::rpc_server::details::WlanRpcClientContext::NotifyCamWiFiControlUsed : Error: Decompile error: 
+Marshaling error: Did not see expected closing element
```

## `wlan::cam::Capability::CreateUsageSession`  (modified)

```diff
--- wlan::cam::Capability::CreateUsageSession
+++ wlan::cam::Capability::CreateUsageSession
@@ -1,2 +1,92 @@
-Failed to decompile wlansvc.dll - .ProgramDB wlan::cam::Capability::CreateUsageSession : 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: void __cdecl wlan::cam::Capability::CreateUsageSession(unsigned int)const __ptr64 */

+

+void __thiscall wlan::cam::Capability::CreateUsageSession(Capability *this,uint param_1)

+

+{

+  code *pcVar1;

+  longlong *plVar2;

+  bool bVar3;

+  int iVar4;

+  ICapabilityUsageStatics *pIVar5;

+  longlong lVar6;

+  void *unaff_retaddr;

+  undefined1 auStack_88 [48];

+  longlong *local_58;

+  longlong *local_50;

+  HStringReference local_48 [32];

+  ulonglong local_28;

+  

+  local_28 = __security_cookie ^ (ulonglong)auStack_88;

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

+                    ((FeatureImpl<__WilFeatureTraits_Feature_Bugfix_56634980> *)

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

+                      ::__l2::impl);

+  if (bVar3) {

+    pIVar5 = GetCapabilityUsageStatics(this);

+    if (pIVar5 == (ICapabilityUsageStatics *)0x0) {

+      return;

+    }

+    pcVar1 = *(code **)(*(longlong *)pIVar5 + 0x30);

+    local_50 = (longlong *)0x0;

+    lVar6 = Microsoft::WRL::Wrappers::HStringReference::

+            HStringReference<unsigned_short_const*___ptr64>(local_48,this + 0x40);

+    iVar4 = (*pcVar1)(pIVar5,*(undefined8 *)(lVar6 + 0x18),&local_50);

+    if (iVar4 < 0) {

+                    /* WARNING: Subroutine does not return */

+      wil::details::in1diag3::_Throw_Hr

+                (unaff_retaddr,0x60,"onecoreuap\\net\\wlan\\commoncpp\\src\\camhelpers.cpp",iVar4);

+    }

+    local_58 = (longlong *)0x0;

+    iVar4 = (**(code **)(*local_50 + 0x30))(local_50,param_1,0,&local_58);

+    if (iVar4 < 0) {

+                    /* WARNING: Subroutine does not return */

+      wil::details::in1diag3::_Throw_Hr

+                (unaff_retaddr,99,"onecoreuap\\net\\wlan\\commoncpp\\src\\camhelpers.cpp",iVar4);

+    }

+    (**(code **)(*local_58 + 0x30))();

+    (**(code **)(*local_58 + 0x38))();

+    wil::com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+    ::~com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+              ((com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+                *)&local_58);

+  }

+  else {

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

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

+      return;

+    }

+    pcVar1 = *(code **)(*plVar2 + 0x30);

+    local_50 = (longlong *)0x0;

+    lVar6 = Microsoft::WRL::Wrappers::HStringReference::

+            HStringReference<unsigned_short_const*___ptr64>(local_48,this + 0x40);

+    iVar4 = (*pcVar1)(plVar2,*(undefined8 *)(lVar6 + 0x18),&local_50);

+    if (iVar4 < 0) {

+                    /* WARNING: Subroutine does not return */

+      wil::details::in1diag3::_Throw_Hr

+                (unaff_retaddr,0x73,"onecoreuap\\net\\wlan\\commoncpp\\src\\camhelpers.cpp",iVar4);

+    }

+    local_58 = (longlong *)0x0;

+    iVar4 = (**(code **)(*local_50 + 0x30))(local_50,param_1,0,&local_58);

+    if (iVar4 < 0) {

+                    /* WARNING: Subroutine does not return */

+      wil::details::in1diag3::_Throw_Hr

+                (unaff_retaddr,0x76,"onecoreuap\\net\\wlan\\commoncpp\\src\\camhelpers.cpp",iVar4);

+    }

+    (**(code **)(*local_58 + 0x30))();

+    (**(code **)(*local_58 + 0x38))();

+    wil::com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+    ::~com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+              ((com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+                *)&local_58);

+  }

+  wil::com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>::

+  ~com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+            ((com_ptr_t<Windows::Internal::CapabilityAccess::ICapabilityAccess,wil::err_exception_policy>

+              *)&local_50);

+  return;

+}

+
```

## `wlansvc::rpc_server::details::WlanRpcServerContext::CreateClientContext`  (modified)

```diff
--- wlansvc::rpc_server::details::WlanRpcServerContext::CreateClientContext
+++ wlansvc::rpc_server::details::WlanRpcServerContext::CreateClientContext
@@ -1,2 +1,45 @@
-Failed to decompile wlansvc.dll - .ProgramDB wlansvc::rpc_server::details::WlanRpcServerContext::CreateClientContext : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* private: class std::unique_ptr<class wlansvc::rpc_server::details::WlanRpcClientContext,struct

+   std::default_delete<class wlansvc::rpc_server::details::WlanRpcClientContext> > __cdecl

+   wlansvc::rpc_server::details::WlanRpcServerContext::CreateClientContext(unsigned long,bool,bool)

+   __ptr64 */

+

+ulong * __thiscall

+wlansvc::rpc_server::details::WlanRpcServerContext::CreateClientContext

+          (WlanRpcServerContext *this,ulong param_1,bool param_2,bool param_3)

+

+{

+  WlanRpcClientType WVar1;

+  undefined4 in_register_00000014;

+  undefined7 in_register_00000081;

+  void *unaff_retaddr;

+  uint local_res18 [2];

+  bool local_res20 [8];

+  WlanRpcClientType local_14;

+  WlanRpcClientType local_10 [2];

+  

+  local_res18[0] = (uint)CONCAT71(in_register_00000081,param_2);

+  local_res20[0] = param_3;

+  if (local_res18[0] - 1 < 2) {

+    WVar1 = GetClientProcessID();

+    local_10[0] = WVar1;

+    local_14 = GetWLANClientType();

+    wlan::cam::Capability::ProcessHasAccess

+              ((Capability *)(this + 0xc0),WVar1,false,false,DAT_0 == '\0');

+    std::

+    make_unique<wlansvc::rpc_server::details::WlanRpcClientContext,unsigned_long&___ptr64,unsigned_int&___ptr64,WlanRpcClientType&___ptr64,bool&___ptr64,bool&___ptr64,bool&___ptr64,0>

+              ((ulong *)CONCAT44(in_register_00000014,param_1),local_res18,local_10,

+               (bool *)&local_14,local_res20,(bool *)&stack0x00000028);

+    return (ulong *)CONCAT44(in_register_00000014,param_1);

+  }

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

+      (WPP_GLOBAL_Control[0x69] != '\0')) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+    WPP_SF_D(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0x14,

+             &WPP_791618f6e4f933247a011d60507f9013_Traceguids,

+             CONCAT71(in_register_00000081,param_2) & 0xffffffff);

+  }

+                    /* WARNING: Subroutine does not return */

+  wil::details::in1diag3::_Throw_Win32

+            (unaff_retaddr,0x396,"onecoreuap\\net\\wlan\\autocfg\\server\\rpcsrv.cpp",0x32);

+}

+
```

## `Microsoft::WRL::Wrappers::HStringReference::~HStringReference`  (modified)

```diff
--- Microsoft::WRL::Wrappers::HStringReference::~HStringReference
+++ std::shared_ptr<wfd::DiscoveryOp>::~shared_ptr<wfd::DiscoveryOp>
@@ -1,2 +1,14 @@
-Failed to decompile wlansvc.dll - .ProgramDB Microsoft::WRL::Wrappers::HStringReference::~HStringReference : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: __cdecl std::shared_ptr<class wfd::DiscoveryOp>::~shared_ptr<class

+   wfd::DiscoveryOp>(void) __ptr64 */

+

+void __thiscall

+std::shared_ptr<wfd::DiscoveryOp>::~shared_ptr<wfd::DiscoveryOp>(shared_ptr<wfd::DiscoveryOp> *this)

+

+{

+  if (*(_Ref_count_base **)(this + 8) != (_Ref_count_base *)0x0) {

+    _Ref_count_base::_Decref(*(_Ref_count_base **)(this + 8));

+  }

+  return;

+}

+
```

## `std::unordered_map<unsigned___int64,std::unique_ptr<wfd::DiscoveryOp,std::default_delete<wfd::DiscoveryOp>_>,std::hash<unsigned___int64>,std::equal_to<unsigned___int64>,std::allocator<std::pair<unsigned___int64_const_,std::unique_ptr<wfd::DiscoveryOp,std::default_delete<wfd::DiscoveryOp>_>_>_>_>::unordered_map<unsigned___int64,std::unique_ptr<wfd::DiscoveryOp,std::default_delete<wfd::DiscoveryOp>_>,std::hash<unsigned___int64>,std::equal_to<unsigned___int64>,std::allocator<std::pair<unsigned___int64_const_,std::unique_ptr<wfd::DiscoveryOp,std::default_delete<wfd::DiscoveryOp>_>_>_>_>`  (modified)

```diff
--- std::unordered_map<unsigned___int64,std::unique_ptr<wfd::DiscoveryOp,std::default_delete<wfd::DiscoveryOp>_>,std::hash<unsigned___int64>,std::equal_to<unsigned___int64>,std::allocator<std::pair<unsigned___int64_const_,std::unique_ptr<wfd::DiscoveryOp,std::default_delete<wfd::DiscoveryOp>_>_>_>_>::unordered_map<unsigned___int64,std::unique_ptr<wfd::DiscoveryOp,std::default_delete<wfd::DiscoveryOp>_>,std::hash<unsigned___int64>,std::equal_to<unsigned___int64>,std::allocator<std::pair<unsigned___int64_const_,std::unique_ptr<wfd::DiscoveryOp,std::default_delete<wfd::DiscoveryOp>_>_>_>_>
+++ std::_Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry>_>_>_>_>_>::_Assign_grow
@@ -1,2 +1,53 @@
-Failed to decompile wlansvc.dll - .ProgramDB std::unordered_map<unsigned___int64,std::unique_ptr<wfd::DiscoveryOp,std::default_delete<wfd::DiscoveryOp>_>,std::hash<unsigned___int64>,std::equal_to<unsigned___int64>,std::allocator<std::pair<unsigned___int64_const_,std::unique_ptr<wfd::DiscoveryOp,std::default_delete<wfd::DiscoveryOp>_>_>_>_>::unordered_map<unsigned___int64,std::unique_ptr<wfd::DiscoveryOp,std::default_delete<wfd::DiscoveryOp>_>,std::hash<unsigned___int64>,std::equal_to<unsigned___int64>,std::allocator<std::pair<unsigned___int64_const_,std::unique_ptr<wfd::DiscoveryOp,std::default_delete<wfd::DiscoveryOp>_>_>_>_> : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: void __cdecl std::_Hash_vec<class std::allocator<class

+   std::_List_unchecked_iterator<class std::_List_val<struct std::_List_simple_types<struct

+   std::pair<unsigned __int64 const ,struct

+   wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry> > > > >

+   >::_Assign_grow(unsigned __int64,class std::_List_unchecked_iterator<class std::_List_val<struct

+   std::_List_simple_types<struct std::pair<unsigned __int64 const ,struct

+   wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry> > > >) __ptr64 */

+

+void __thiscall

+std::

+_Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry>_>_>_>_>_>

+::_Assign_grow(_Hash_vec<std::allocator<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,wlansvc::rpc_server::details::WlanRpcServerContext::WlanRpcClientMapEntry>_>_>_>_>_>

+               *this,ulonglong param_1,undefined8 param_3)

+

+{

+  undefined8 *puVar1;

+  __uint64 _Var2;

+  undefined8 *puVar3;

+  longlong lVar4;

+  undefined8 local_res18;

+  

+  local_res18 = param_3;

+  if ((ulonglong)

+      ((longlong)

+       *(_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,std::unique_ptr<wfd::ConnectionOp,std::default_delete<wfd::ConnectionOp>_>_>_>_>_>

+         **)(this + 8) - *(longlong *)this >> 3) < param_1) {

+    _Var2 = _Get_size_of_n<8>(param_1);

+    puVar3 = _Allocate<16,std::_Default_allocate_traits,0>(_Var2);

+    lVar4 = *(longlong *)(this + 0x10) - *(longlong *)this >> 3;

+    if (lVar4 != 0) {

+      _Deallocate<16,0>(*(void **)this,lVar4 << 3);

+    }

+    puVar1 = puVar3 + param_1;

+    *(undefined8 **)this = puVar3;

+    *(undefined8 **)(this + 8) = puVar1;

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

+    for (; puVar3 != puVar1; puVar3 = puVar3 + 1) {

+      *puVar3 = param_3;

+    }

+  }

+  else {

+    fill<std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,std::unique_ptr<wfd::ConnectionOp,std::default_delete<wfd::ConnectionOp>_>_>_>_>_>*___ptr64,std::_List_unchecked_iterator<class_std::_List_val<struct_std::_List_simple_types<struct_std::pair<unsigned___int64_const_,class_std::unique_ptr<class_wfd::ConnectionOp,struct_std::default_delete<class_wfd::ConnectionOp>_>_>_>_>_>_>

+              (*(_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,std::unique_ptr<wfd::ConnectionOp,std::default_delete<wfd::ConnectionOp>_>_>_>_>_>

+                 **)this,

+               *(_List_unchecked_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned___int64_const_,std::unique_ptr<wfd::ConnectionOp,std::default_delete<wfd::ConnectionOp>_>_>_>_>_>

+                 **)(this + 8),

+               (_List_unchecked_iterator<class_std::_List_val<struct_std::_List_simple_types<struct_std::pair<unsigned___int64_const_,class_std::unique_ptr<class_wfd::ConnectionOp,struct_std::default_delete<class_wfd::ConnectionOp>_>_>_>_>_>

+                *)&local_res18);

+  }

+  return;

+}

+
```

## `wlansvc::rpc_server::details::WlanRpcClientContext::HasWiFiControlCapabilityAccess`  (modified)

```diff
--- wlansvc::rpc_server::details::WlanRpcClientContext::HasWiFiControlCapabilityAccess
+++ wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess
@@ -1,2 +1,32 @@
-Failed to decompile wlansvc.dll - .ProgramDB wlansvc::rpc_server::details::WlanRpcClientContext::HasWiFiControlCapabilityAccess : Error: Decompile error: 
-Marshaling error: Did not see expected closing element+

+/* public: bool __cdecl

+   wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess(class

+   wlansvc::rpc_server::details::WlanRpcClientContext const & __ptr64)const __ptr64 */

+

+bool __thiscall

+wlansvc::rpc_server::details::WlanRpcServerContext::HasWiFiControlCapabilityAccess

+          (WlanRpcServerContext *this,WlanRpcClientContext *param_1)

+

+{

+  bool bVar1;

+  

+  if (param_1[0x18e] == (WlanRpcClientContext)0x0) {

+    bVar1 = wlan::cam::Capability::ProcessHasAccess

+                      ((Capability *)(DAT_0 + 0x108),*(uint *)(param_1 + 0x184),true,

+                       (bool)param_1[399],false);

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_ILl(*(undefined8 *)(WPP_GLOBAL_Control + 0x60));

+    }

+  }

+  else {

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

+        (3 < (byte)WPP_GLOBAL_Control[0x69])) && ((WPP_GLOBAL_Control[0x6c] & 1) != 0)) {

+      WPP_SF_IL(*(undefined8 *)(WPP_GLOBAL_Control + 0x60),0xd,*(undefined4 *)(param_1 + 0x184),

+                *(undefined8 *)(param_1 + 0x178),*(undefined4 *)(param_1 + 0x184));

+    }

+    bVar1 = true;

+  }

+  return bVar1;

+}

+
```

## `MOBILENETWORKING.DLL::HtReferenceHandleWithTag`  (modified)

```diff
--- MOBILENETWORKING.DLL::HtReferenceHandleWithTag calling
+++ MOBILENETWORKING.DLL::HtReferenceHandleWithTag calling
@@ -117,0 +118,2 @@
+RpcGetAvailableNetworkList
+RpcGetNetworkBssList
@@ -118,0 +121 @@
+RpcPrivateGetAvailableNetworkList
```

## `MSVCP_WIN.DLL::_Mtx_unlock`  (modified)

```diff
--- MSVCP_WIN.DLL::_Mtx_unlock calling
+++ MSVCP_WIN.DLL::_Mtx_unlock calling
@@ -11,0 +12,2 @@
+wlan::cam::Capability::GetCapabilityAccessStatics
+wlan::cam::Capability::GetCapabilityUsageStatics
```

## `API-MS-WIN-EVENTING-PROVIDER-L1-1-0.DLL::EventWriteTransfer`  (modified)

```diff
--- API-MS-WIN-EVENTING-PROVIDER-L1-1-0.DLL::EventWriteTransfer calling
+++ API-MS-WIN-EVENTING-PROVIDER-L1-1-0.DLL::EventWriteTransfer calling
@@ -12 +11,0 @@
-_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<_tlgWrapperByRef<16>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapperByRef<16>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<char>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<1>,_tlgWrapperByVal<4>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapSz<unsigned_short>,_tlgWrapperByVal<4>,_tlgWrapperByVal<1>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>,_tlgWrapperByVal<4>_>
```

## `API-MS-WIN-CORE-ERRORHANDLING-L1-1-0.DLL::GetLastError`  (modified)

```diff
--- API-MS-WIN-CORE-ERRORHANDLING-L1-1-0.DLL::GetLastError calling
+++ API-MS-WIN-CORE-ERRORHANDLING-L1-1-0.DLL::GetLastError calling
@@ -98,0 +99 @@
+IsCallerSrumSvc
```

## `API-MS-WIN-CORE-HEAP-L1-1-0.DLL::GetProcessHeap`  (modified)

```diff
--- API-MS-WIN-CORE-HEAP-L1-1-0.DLL::GetProcessHeap calling
+++ API-MS-WIN-CORE-HEAP-L1-1-0.DLL::GetProcessHeap calling
@@ -37,0 +38,2 @@
+RpcGetNetworkBssList
+RpcPrivateGetAvailableNetworkList
```

## `MOBILENETWORKING.DLL::VerifyRpcClientAccess`  (modified)

```diff
--- MOBILENETWORKING.DLL::VerifyRpcClientAccess calling
+++ MOBILENETWORKING.DLL::VerifyRpcClientAccess calling
@@ -6,0 +7 @@
+RpcQueryInterface
```

## `API-MS-WIN-CORE-WINRT-L1-1-0.DLL::RoGetActivationFactory`  (modified)

```diff
--- API-MS-WIN-CORE-WINRT-L1-1-0.DLL::RoGetActivationFactory calling
+++ API-MS-WIN-CORE-WINRT-L1-1-0.DLL::RoGetActivationFactory calling
@@ -0,0 +1 @@
+CWfdDeviceBroker::AepAccessCheck
@@ -3 +3,0 @@
-wlan::cam::CreateCapabilityUsageSession
```

## `API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::EnterCriticalSection`  (modified)

```diff
--- API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::EnterCriticalSection calling
+++ API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::EnterCriticalSection calling
@@ -173,0 +174,2 @@
+RpcGetAvailableNetworkList
+RpcGetNetworkBssList
@@ -174,0 +177 @@
+RpcPrivateGetAvailableNetworkList
@@ -175,0 +179 @@
+RpcScan
```

## `API-MS-WIN-SECURITY-BASE-L1-1-0.DLL::CheckTokenMembership`  (modified)

```diff
--- API-MS-WIN-SECURITY-BASE-L1-1-0.DLL::CheckTokenMembership calling
+++ API-MS-WIN-SECURITY-BASE-L1-1-0.DLL::CheckTokenMembership calling
@@ -2,0 +3 @@
+IsCallerSrumSvc
```

## `API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL::WindowsCreateStringReference`  (modified)

```diff
--- API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL::WindowsCreateStringReference calling
+++ API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL::WindowsCreateStringReference calling
@@ -3 +2,0 @@
-wlan::cam::CreateCapabilityUsageSession
```

## `API-MS-WIN-SECURITY-SDDL-L1-1-0.DLL::ConvertStringSidToSidW`  (modified)

```diff
--- API-MS-WIN-SECURITY-SDDL-L1-1-0.DLL::ConvertStringSidToSidW calling
+++ API-MS-WIN-SECURITY-SDDL-L1-1-0.DLL::ConvertStringSidToSidW calling
@@ -2,0 +3 @@
+IsCallerSrumSvc
```

## `MSVCP_WIN.DLL::_Mtx_destroy_in_situ`  (modified)

```diff
--- MSVCP_WIN.DLL::_Mtx_destroy_in_situ calling
+++ MSVCP_WIN.DLL::_Mtx_destroy_in_situ calling
@@ -3,0 +4 @@
+wlan::cam::Capability::~Capability
```

## `API-MS-WIN-CORE-HANDLE-L1-1-0.DLL::CloseHandle`  (modified)

```diff
--- API-MS-WIN-CORE-HANDLE-L1-1-0.DLL::CloseHandle calling
+++ API-MS-WIN-CORE-HANDLE-L1-1-0.DLL::CloseHandle calling
@@ -18,0 +19 @@
+IsCallerSrumSvc
```

## `API-MS-WIN-CORE-HEAP-L2-1-0.DLL::LocalFree`  (modified)

```diff
--- API-MS-WIN-CORE-HEAP-L2-1-0.DLL::LocalFree calling
+++ API-MS-WIN-CORE-HEAP-L2-1-0.DLL::LocalFree calling
@@ -13,0 +14 @@
+IsCallerSrumSvc
```

## `API-MS-WIN-CORE-HEAP-L1-1-0.DLL::HeapFree`  (modified)

```diff
--- API-MS-WIN-CORE-HEAP-L1-1-0.DLL::HeapFree calling
+++ API-MS-WIN-CORE-HEAP-L1-1-0.DLL::HeapFree calling
@@ -22,0 +23,2 @@
+RpcGetNetworkBssList
+RpcPrivateGetAvailableNetworkList
```

## `API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::InitializeCriticalSectionEx`  (modified)

```diff
--- API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::InitializeCriticalSectionEx calling
+++ API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::InitializeCriticalSectionEx calling
@@ -17 +16,0 @@
-wlansvc::rpc_server::details::WlanRpcClientContext::WlanRpcClientContext
```

## `API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::AcquireSRWLockExclusive`  (modified)

```diff
--- API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::AcquireSRWLockExclusive calling
+++ API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::AcquireSRWLockExclusive calling
@@ -40 +39,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_57882157>::GetCachedFeatureEnabledState
@@ -47,2 +46 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_Bugfix_48101189>::GetCachedFeatureEnabledState
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_Bugfix_54236577>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_Bugfix_56634980>::GetCachedFeatureEnabledState
@@ -50 +47,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_Bugfix_57825957>::GetCachedFeatureEnabledState
@@ -56,2 +53 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_PackagedComElevationSupport>::GetCachedFeatureEnabledState
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_Standalone_26_02_NonSec>::GetCachedFeatureEnabledState
+wil::details::FeatureImpl<__WilFeatureTraits_Feature_PackagedComElevationSupport_v2>::GetCachedFeatureEnabledState
@@ -63 +58,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_TestAccPerf>::GetCachedFeatureEnabledState
@@ -65 +59,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_TestLoc1Perf>::GetCachedFeatureEnabledState
@@ -69 +62,0 @@
-wil::details::FeatureImpl<__WilFeatureTraits_Feature_WiFiDirectServices_DeprecationTipTest>::GetCachedFeatureEnabledState
```

## `MOBILENETWORKING.DLL::HtDereferenceHandleWithTag`  (modified)

```diff
--- MOBILENETWORKING.DLL::HtDereferenceHandleWithTag calling
+++ MOBILENETWORKING.DLL::HtDereferenceHandleWithTag calling
@@ -121,0 +122,2 @@
+RpcGetAvailableNetworkList
+RpcGetNetworkBssList
@@ -122,0 +125 @@
+RpcPrivateGetAvailableNetworkList
```

## `API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::LeaveCriticalSection`  (modified)

```diff
--- API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::LeaveCriticalSection calling
+++ API-MS-WIN-CORE-SYNCH-L1-1-0.DLL::LeaveCriticalSection calling
@@ -174,0 +175,2 @@
+RpcGetAvailableNetworkList
+RpcGetNetworkBssList
@@ -175,0 +178 @@
+RpcPrivateGetAvailableNetworkList
@@ -176,0 +180 @@
+RpcScan
```
