aboutsummaryrefslogtreecommitdiffstats
path: root/setupapihost/host_win7.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-10-14 06:37:50 +0000
committerJason A. Donenfeld <Jason@zx2c4.com>2021-10-14 06:51:22 +0000
commit470bdf3e26e433032fe7986f379cad797cdd94cd (patch)
tree73ae00e01e47eebbb8776a26c4e1aeb43e3c7517 /setupapihost/host_win7.h
parentapi: adapter: handle cases explicitly in dev query callback (diff)
downloadwintun-470bdf3e26e433032fe7986f379cad797cdd94cd.tar.xz
wintun-470bdf3e26e433032fe7986f379cad797cdd94cd.zip
api: use proper instance id bounds
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--setupapihost/host_win7.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/setupapihost/host_win7.h b/setupapihost/host_win7.h
index 4e65bff..2640c26 100644
--- a/setupapihost/host_win7.h
+++ b/setupapihost/host_win7.h
@@ -4,8 +4,8 @@
*/
#include <devguid.h>
+#include <cfgmgr32.h>
-#define MAX_INSTANCE_ID MAX_PATH /* TODO: Is MAX_PATH always enough? */
#define WINTUN_HWID L"Wintun"
VOID __stdcall CreateInstanceWin7(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow)
@@ -13,7 +13,7 @@ VOID __stdcall CreateInstanceWin7(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine,
#pragma EXPORT
DWORD LastError = ERROR_SUCCESS;
- WCHAR InstanceId[MAX_INSTANCE_ID] = { 0 };
+ WCHAR InstanceId[MAX_DEVICE_ID_LEN] = { 0 };
HDEVINFO DevInfo = SetupDiCreateDeviceInfoListExW(&GUID_DEVCLASS_NET, NULL, NULL, NULL);
if (DevInfo == INVALID_HANDLE_VALUE)