diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-10-14 06:37:50 +0000 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-10-14 06:51:22 +0000 |
commit | 470bdf3e26e433032fe7986f379cad797cdd94cd (patch) | |
tree | 73ae00e01e47eebbb8776a26c4e1aeb43e3c7517 /setupapihost/host_win7.h | |
parent | api: adapter: handle cases explicitly in dev query callback (diff) | |
download | wintun-470bdf3e26e433032fe7986f379cad797cdd94cd.tar.xz wintun-470bdf3e26e433032fe7986f379cad797cdd94cd.zip |
api: use proper instance id bounds
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'setupapihost/host_win7.h')
-rw-r--r-- | setupapihost/host_win7.h | 4 |
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) |