From 765b3fc896c38feebd5c5b9ddc63a613fe533054 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 20 Jan 2009 13:21:53 +0000 Subject: added actual node to tundevice (currently only for windows) --- src/win32/tunDevice.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/win32/tunDevice.cpp') diff --git a/src/win32/tunDevice.cpp b/src/win32/tunDevice.cpp index 70aa4a4..82e31cb 100644 --- a/src/win32/tunDevice.cpp +++ b/src/win32/tunDevice.cpp @@ -40,6 +40,8 @@ #include #include +#define REG_STRING_LENGTH 1024 + TunDevice::TunDevice(std::string dev_name, std::string dev_type, std::string ifcfg_lp, std::string ifcfg_rnmp) : conf_(dev_name, dev_type, ifcfg_lp, ifcfg_rnmp, 1400) { handle_ = INVALID_HANDLE_VALUE; @@ -56,8 +58,8 @@ TunDevice::TunDevice(std::string dev_name, std::string dev_type, std::string ifc bool found = false; DWORD len; - char adapterid[1024]; - char adaptername[1024]; + char adapterid[REG_STRING_LENGTH]; + char adaptername[REG_STRING_LENGTH]; for(int i=0; ; ++i) { len = sizeof(adapterid); if(RegEnumKeyEx(key, i, adapterid, &len, 0, 0, 0, NULL)) @@ -98,7 +100,8 @@ TunDevice::TunDevice(std::string dev_name, std::string dev_type, std::string ifc } conf_.type_ = TYPE_TAP; - actual_name_ = adapterid; + actual_node_ = adapterid; + actual_name_ = adaptername; int status = true; if(!DeviceIoControl(handle_, TAP_IOCTL_SET_MEDIA_STATUS, &status, sizeof(status), &status, sizeof(status), &len, NULL)) { -- cgit v1.2.3