X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Fmingw%2Fdevice.c;h=190621b746128a4fc7d623aa449d5b2f57bcd96a;hp=46ad9eb71f82eb419b5bdd92cd9d91a6a4fedbdf;hb=d917c8cb6b69475d568ccbe82389b9f2b3eb5e80;hpb=58f4b845b9a7d83739af77337f2ce263d8df7838 diff --git a/src/mingw/device.c b/src/mingw/device.c index 46ad9eb7..190621b7 100644 --- a/src/mingw/device.c +++ b/src/mingw/device.c @@ -118,7 +118,7 @@ static bool setup_device(void) { snprintf(regpath, sizeof regpath, "%s\\%s\\Connection", NETWORK_CONNECTIONS_KEY, adapterid); - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, regpath, 0, KEY_READ, &key2)) + if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, regpath, 0, KEY_READ, &key2)) continue; len = sizeof adaptername; @@ -172,7 +172,7 @@ static bool setup_device(void) { snprintf(tapname, sizeof tapname, USERMODEDEVICEDIR "%s" TAPSUFFIX, device); device_handle = CreateFile(tapname, GENERIC_WRITE | GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, 0); } - + if(device_handle == INVALID_HANDLE_VALUE) { logger(DEBUG_ALWAYS, LOG_ERR, "%s (%s) is not a usable Windows tap device: %s", device, iface, winerror(GetLastError())); return false;