[NETCFGX] Resize a helper buffer to accommodate a device instance id.
authorEric Kohl <eric.kohl@reactos.org>
Sun, 16 Jun 2019 22:46:30 +0000 (00:46 +0200)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 16 Jun 2019 22:46:30 +0000 (00:46 +0200)
This prevent NULL pointer exceptions in calls to INetCfgComponent::GetPnpDevNodeId().

dll/win32/netcfgx/netcfg_iface.c
dll/win32/netcfgx/precomp.h

index 81d2c22..2dfbcf4 100644 (file)
@@ -372,7 +372,7 @@ EnumerateNetworkAdapter(NetCfgComponentItem ** pHead)
     SP_DEVINFO_DATA DevInfo;
     HKEY hKey;
     WCHAR szNetCfg[50];
     SP_DEVINFO_DATA DevInfo;
     HKEY hKey;
     WCHAR szNetCfg[50];
-    WCHAR szAdapterNetCfg[50];
+    WCHAR szAdapterNetCfg[MAX_DEVICE_ID_LEN];
     WCHAR szDetail[200] = L"SYSTEM\\CurrentControlSet\\Control\\Class\\";
     WCHAR szName[130] = L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\";
     NetCfgComponentItem * pLast = NULL, *pCurrent;
     WCHAR szDetail[200] = L"SYSTEM\\CurrentControlSet\\Control\\Class\\";
     WCHAR szName[130] = L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\";
     NetCfgComponentItem * pLast = NULL, *pCurrent;
index ed736ae..ceaa12e 100644 (file)
@@ -21,6 +21,7 @@
 #include <netcfgn.h>
 #include <devguid.h>
 #include <commctrl.h>
 #include <netcfgn.h>
 #include <devguid.h>
 #include <commctrl.h>
+#include <cfgmgr32.h>
 
 #include <wine/debug.h>
 
 
 #include <wine/debug.h>