From 77457cbff14546a6b6173a46c0486767dab60847 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 7 Aug 2014 19:08:41 -0700 Subject: Windows compile fixes, compiler warning fix, unfreed memory fix in main.c (though it would not have mattered since program exits immediately after). --- osnet/WindowsEthernetTap.cpp | 4 ++-- osnet/WindowsEthernetTapFactory.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'osnet') diff --git a/osnet/WindowsEthernetTap.cpp b/osnet/WindowsEthernetTap.cpp index 16fc72d6..8326597a 100644 --- a/osnet/WindowsEthernetTap.cpp +++ b/osnet/WindowsEthernetTap.cpp @@ -188,11 +188,11 @@ WindowsEthernetTap::WindowsEthernetTap( PROCESS_INFORMATION processInfo; memset(&startupInfo,0,sizeof(STARTUPINFOA)); memset(&processInfo,0,sizeof(PROCESS_INFORMATION)); - if (!CreateProcessA(NULL,(LPSTR)(std::string("\"") + _pathToHelpers + WindowsEthernetTapFactory::WINENV.devcon + "\" install \"" + _pathToHelpers + _winEnv.tapDriver + "\" zttap200").c_str(),NULL,NULL,FALSE,0,NULL,NULL,&startupInfo,&processInfo)) { + if (!CreateProcessA(NULL,(LPSTR)(std::string("\"") + _pathToHelpers + WindowsEthernetTapFactory::WINENV.devcon + "\" install \"" + _pathToHelpers + WindowsEthernetTapFactory::WINENV.tapDriver + "\" zttap200").c_str(),NULL,NULL,FALSE,0,NULL,NULL,&startupInfo,&processInfo)) { RegCloseKey(nwAdapters); if (devconLog != INVALID_HANDLE_VALUE) CloseHandle(devconLog); - throw std::runtime_error(std::string("unable to find or execute devcon at ") + _winEnv.devcon); + throw std::runtime_error(std::string("unable to find or execute devcon at ") + WindowsEthernetTapFactory::WINENV.devcon); } WaitForSingleObject(processInfo.hProcess,INFINITE); CloseHandle(processInfo.hProcess); diff --git a/osnet/WindowsEthernetTapFactory.cpp b/osnet/WindowsEthernetTapFactory.cpp index 6564e186..74703077 100644 --- a/osnet/WindowsEthernetTapFactory.cpp +++ b/osnet/WindowsEthernetTapFactory.cpp @@ -43,6 +43,7 @@ WindowsEthernetTapFactory::Env::Env() tapDriver = ((is64Bit == TRUE) ? "\\tap-windows\\x64\\zttap200.inf" : "\\tap-windows\\x86\\zttap200.inf"); #endif } +const WindowsEthernetTapFactory::Env WindowsEthernetTapFactory::WINENV; WindowsEthernetTapFactory::WindowsEthernetTapFactory(const char *pathToHelpers) : _pathToHelpers(pathToHelpers) -- cgit v1.2.3