X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fmingw%2Fdevice.c;h=d13b824afd5b21f9432a47a356739ea4de1182fc;hb=cc3c69c892b0dad9a6ece0a0f4ccd429a22fcbff;hp=46ad9eb71f82eb419b5bdd92cd9d91a6a4fedbdf;hpb=8ac096b5bf9da1b3961a3ac4a03d083629222a63;p=tinc diff --git a/src/mingw/device.c b/src/mingw/device.c index 46ad9eb7..d13b824a 100644 --- a/src/mingw/device.c +++ b/src/mingw/device.c @@ -1,7 +1,7 @@ /* device.c -- Interaction with Windows tap driver in a MinGW environment Copyright (C) 2002-2005 Ivo Timmermans, - 2002-2011 Guus Sliepen + 2002-2013 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ #include "conf.h" #include "device.h" #include "logger.h" +#include "names.h" #include "net.h" #include "route.h" #include "utils.h" @@ -118,7 +119,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 +173,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;