# CVE-2026-118739 — dhcpcsvc.dll patch diff

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

## `DllMain`  (modified)

```diff
--- DllMain
+++ DllMain
@@ -1,81 +1,89 @@
 

-/* WARNING: Instruction at (ram,0x0001800040f4) overlaps instruction at (ram,0x0001800040f1)

-    */

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

 

 undefined4 DllMain(HMODULE param_1,int param_2)

 

 {

-  undefined1 uVar1;

-  char cVar2;

-  uint uVar3;

-  BOOL BVar4;

-  char *in_RAX;

-  undefined8 *puVar5;

-  undefined8 *unaff_RBP;

-  undefined1 *unaff_RDI;

-  bool in_CF;

-  bool in_ZF;

-  undefined7 unaff_retaddr;

-  undefined1 uStack_11;

-  undefined8 uStack_10;

-  undefined7 uStack_8;

-  undefined1 uStack_1;

+  uint uVar1;

+  BOOL BVar2;

+  undefined1 local_res10 [16];

+  ULONGLONG local_res20;

   

-  uVar1 = in((short)param_2);

-  *unaff_RDI = uVar1;

-  puVar5 = (undefined8 *)&stack0xfffffffffffffff8;

-  uStack_8 = SUB87(unaff_RBP,0);

-  uStack_1 = (undefined1)((ulonglong)unaff_RBP >> 0x38);

-  cVar2 = '\a';

-  do {

-    unaff_RBP = unaff_RBP + -1;

-    puVar5 = puVar5 + -1;

-    *puVar5 = *unaff_RBP;

-    cVar2 = cVar2 + -1;

-  } while ('\0' < cVar2);

-  if (in_CF || in_ZF) {

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

-  }

-  else {

-    uVar3 = Feature_341032248__private_IsEnabledDeviceUsageNoInline();

-    g_fVelocityDhcpv4ClassIdLenOverflowFix = (uint)(uVar3 != 0);

-    uVar3 = Feature_3211771192__private_IsEnabledDeviceUsageNoInline();

-    g_fVelocityDhcpv4LeaseIpAddressOverflow = (uint)(uVar3 != 0);

+  if (param_2 == 1) {

+    InitializeCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalListCritSect);

+    InitializeCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalRecvFromCritSect);

+    InitializeCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalZeroAddressCritSect);

+    InitializeCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalApiCritSect);

+    InitializeCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalNicListCritSect);

+    InitializeCriticalSection((LPCRITICAL_SECTION)&DhcpHandleErrorQCritSect);

+    InitializeCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalNotificationListCritSect);

+    Feature_CLAT_DHCP_Option108__private_IsEnabledDeviceUsageNoInline();

+    Feature_CLAT_Preview2_Dhcp108Default__private_IsEnabledDeviceUsageNoInline();

+    uVar1 = Feature_Servicing_Dhcpv4InformNegativeCacheResetTimersOnWakeFix__private_IsEnabledDeviceUsageNoInline

+                      ();

+    g_fVelocityDhcpv4InformNegativeCacheFix = (uint)(uVar1 != 0);

+    Feature_58976313__private_IsEnabledDeviceUsageNoInline();

+    Feature_CLAT_Preview2_DhcpIPxlatPolicyMgr__private_IsEnabledDeviceUsageNoInline();

+    Feature_CLAT_Preview2_DhcpOption108RenewFix__private_IsEnabledDeviceUsageNoInline();

+    Feature_61277108__private_IsEnabledDeviceUsageNoInline();

+    Feature_2263349562__private_IsEnabledDeviceUsageNoInline();

+    uVar1 = Feature_341032248__private_IsEnabledDeviceUsageNoInline();

+    g_fVelocityDhcpv4ClassIdLenOverflowFix = (uint)(uVar1 != 0);

+    uVar1 = Feature_3211771192__private_IsEnabledDeviceUsageNoInline();

+    g_fVelocityDhcpv4LeaseIpAddressOverflow = (uint)(uVar1 != 0);

     Feature_849856826__private_IsEnabledDeviceUsageNoInline();

     Feature_59101910__private_IsEnabledDeviceUsageNoInline();

     Feature_60512953__private_IsEnabledDeviceUsageNoInline();

     Feature_61186233__private_IsEnabledDeviceUsageNoInline();

-    uVar3 = Feature_61561226__private_IsEnabledDeviceUsageNoInline();

-    uStack_1 = 0;

-    unaff_retaddr = 0;

-    uStack_11 = 1;

-    g_fVelocityDhcpRpcAuthnSvcUpdate = (uint)(uVar3 != 0);

-    uVar3 = Feature_ModernWpp__private_IsEnabledDeviceUsageNoInline();

-    in_RAX = (char *)(ulonglong)uVar3;

+    uVar1 = Feature_61561226__private_IsEnabledDeviceUsageNoInline();

+    local_res20 = 0;

+    local_res10[0] = 1;

+    g_fVelocityDhcpRpcAuthnSvcUpdate = (uint)(uVar1 != 0);

+    uVar1 = Feature_ModernWpp__private_IsEnabledDeviceUsageNoInline();

+    if (uVar1 != 0) {

+      InitializeCriticalSection((LPCRITICAL_SECTION)&FastWppCallbackLock);

+      _g_rgFastWppLevelEnabledFlags = 0;

+      DAT_0 = 0;

+      DAT_1 = 0;

+      DAT_2 = 0;

+      _DAT_3 = 0;

+      uRam0000000180020768 = 0;

+      FastWppInitState = 1;

+      EventRegister((LPCGUID)&FastWppControlGuid,FastWppCallback,(PVOID)0x0,&local_res20);

+      EventSetInformation(local_res20,4,0);

+      EventSetInformation(local_res20,3,local_res10);

+      FastWppRegHandle = local_res20;

+      EnterCriticalSection((LPCRITICAL_SECTION)&FastWppCallbackLock);

+      FastWppInitState = 2;

+      LeaveCriticalSection((LPCRITICAL_SECTION)&FastWppCallbackLock);

+    }

+    BVar2 = DisableThreadLibraryCalls(param_1);

+    if (BVar2 == 0) {

+      return 0;

+    }

   }

-  if ((int)in_RAX != 0) {

-    InitializeCriticalSection((LPCRITICAL_SECTION)&FastWppCallbackLock);

-    _g_rgFastWppLevelEnabledFlags = 0;

-    DAT_0 = 0;

-    DAT_1 = 0;

-    DAT_2 = 0;

-    _DAT_3 = 0;

-    uRam0000000180020768 = 0;

-    FastWppInitState = 1;

-    EventRegister((LPCGUID)&FastWppControlGuid,(PENABLECALLBACK)0x1800042f0,(PVOID)0x0,

-                  (PREGHANDLE)&uStack_1);

-    EventSetInformation(CONCAT71(unaff_retaddr,uStack_1),4,0);

-    EventSetInformation(CONCAT71(unaff_retaddr,uStack_1),3,&uStack_11);

-    FastWppRegHandle = CONCAT71(unaff_retaddr,uStack_1);

-    EnterCriticalSection((LPCRITICAL_SECTION)&FastWppCallbackLock);

-    FastWppInitState = 2;

-    LeaveCriticalSection((LPCRITICAL_SECTION)&FastWppCallbackLock);

-  }

-  BVar4 = DisableThreadLibraryCalls((HMODULE)(unaff_RDI + 1));

-  if (BVar4 == 0) {

-    return 0;

+  else if (param_2 == 0) {

+    uVar1 = Feature_ModernWpp__private_IsEnabledDeviceUsageNoInline();

+    if (uVar1 != 0) {

+      EventUnregister(FastWppRegHandle);

+      FastWppRegHandle = 0;

+      _g_rgFastWppLevelEnabledFlags = 0;

+      DAT_0 = 0;

+      DAT_1 = 0;

+      DAT_2 = 0;

+      _DAT_3 = 0;

+      uRam0000000180020768 = 0;

+      DeleteCriticalSection((LPCRITICAL_SECTION)&FastWppCallbackLock);

+      FastWppInitState = 0;

+    }

+    DeleteCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalListCritSect);

+    DeleteCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalRecvFromCritSect);

+    DeleteCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalZeroAddressCritSect);

+    DeleteCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalApiCritSect);

+    DeleteCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalNicListCritSect);

+    DeleteCriticalSection((LPCRITICAL_SECTION)&DhcpHandleErrorQCritSect);

+    DeleteCriticalSection((LPCRITICAL_SECTION)&DhcpGlobalNotificationListCritSect);

   }

   return 1;

 }
```

## `STRING_HANDLE_bind_helper`  (modified)

```diff
--- STRING_HANDLE_bind_helper
+++ STRING_HANDLE_bind_helper
@@ -1,31 +1,39 @@
 

 RPC_BINDING_HANDLE STRING_HANDLE_bind_helper(short *param_1)

 

 {

-  uint uVar1;

-  RPC_BINDING_HANDLE in_RAX;

-  longlong lVar2;

-  ulonglong uVar3;

-  undefined4 *puVar4;

+  RPC_STATUS RVar1;

+  ulong AuthnSvc;

+  RPC_WSTR local_res8;

+  RPC_BINDING_HANDLE local_res10;

+  RPC_BINDING_HANDLE local_res18;

   

-                    /* 0x1990  16  DhcpFreeCachedParamsData */

-  lVar2 = *(longlong *)(param_1 + 4);

-  if (lVar2 != 0) {

-    uVar1 = *(uint *)param_1;

-    in_RAX = (RPC_BINDING_HANDLE)(ulonglong)uVar1;

-    if (uVar1 != 0) {

-      uVar3 = (ulonglong)uVar1;

-      puVar4 = (undefined4 *)(lVar2 + 0x18);

-      lVar2 = lVar2 + 0x10;

-      do {

-        in_RAX = (RPC_BINDING_HANDLE)func_0x000180001a00(lVar2);

-        lVar2 = lVar2 + 0x20;

-        *puVar4 = 0;

-        puVar4 = puVar4 + 8;

-        uVar3 = uVar3 - 1;

-      } while (uVar3 != 0);

+  local_res8 = (RPC_WSTR)0x0;

+  local_res10 = (RPC_BINDING_HANDLE)0x0;

+  if (((param_1 == (short *)0x0) || (*param_1 == 0)) &&

+     (RVar1 = RpcStringBindingComposeW

+                        ((RPC_WSTR)0x0,(RPC_WSTR)L"ncalrpc",(RPC_WSTR)0x0,(RPC_WSTR)L"dhcpcsvc",

+                         (RPC_WSTR)L"Security=Impersonation Dynamic False",&local_res8), RVar1 == 0)

+     ) {

+    RVar1 = RpcBindingFromStringBindingW(local_res8,&local_res10);

+    RpcStringFreeW(&local_res8);

+    if (RVar1 == 0) {

+      RVar1 = RpcBindingSetOption(local_res10,0xb,1);

+      if (RVar1 == 0) {

+        AuthnSvc = 0x14;

+        if (g_fVelocityDhcpRpcAuthnSvcUpdate == 0) {

+          AuthnSvc = 10;

+        }

+        RVar1 = RpcBindingSetAuthInfoW

+                          (local_res10,(RPC_WSTR)0x0,6,AuthnSvc,(RPC_AUTH_IDENTITY_HANDLE)0x0,0);

+        if (RVar1 == 0) {

+          return local_res10;

+        }

+      }

+      local_res18 = local_res10;

+      RpcBindingFree(&local_res18);

     }

   }

-  return in_RAX;

+  return (RPC_BINDING_HANDLE)0x0;

 }
```
