From 0f328d9d2853ca723ff3205f39bb22207d21a932 Mon Sep 17 00:00:00 2001 From: Etienne Dechamps Date: Sun, 15 Mar 2015 18:18:04 +0000 Subject: [PATCH] Log TAP-Windows driver version on startup. This is generally useful. We've seen issues that are specific to some version of these drivers (especially the newer 9.0.0.21 version), so it's relevant to log it, especially since that means it will be copy-pasted by people posting their logs asking for help. --- src/mingw/device.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mingw/device.c b/src/mingw/device.c index 19719a7..253b95d 100644 --- a/src/mingw/device.c +++ b/src/mingw/device.c @@ -175,6 +175,17 @@ static bool setup_device(void) { return false; } + /* Get version information from tap device */ + + { + ULONG info[3] = {0}; + DWORD len; + if(!DeviceIoControl(device_handle, TAP_IOCTL_GET_VERSION, &info, sizeof info, &info, sizeof info, &len, NULL)) + logger(DEBUG_ALWAYS, LOG_WARNING, "Could not get version information from Windows tap device %s (%s): %s", device, iface, winerror(GetLastError())); + else + logger(DEBUG_ALWAYS, LOG_INFO, "TAP-Windows driver version: %lu.%lu%s", info[0], info[1], info[2] ? " (DEBUG)" : ""); + } + /* Get MAC address from tap device */ if(!DeviceIoControl(device_handle, TAP_IOCTL_GET_MAC, mymac.x, sizeof mymac.x, mymac.x, sizeof mymac.x, &len, 0)) { -- 2.25.1