From 6f46f0e0e1f0dd01f0e7bdaa700b11d2c54d0794 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 30 Jul 2015 11:57:48 -0700 Subject: Because Windows. --- osdep/WindowsEthernetTap.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'osdep') diff --git a/osdep/WindowsEthernetTap.cpp b/osdep/WindowsEthernetTap.cpp index d8ba1f98..426dd3cb 100644 --- a/osdep/WindowsEthernetTap.cpp +++ b/osdep/WindowsEthernetTap.cpp @@ -871,15 +871,19 @@ void WindowsEthernetTap::threadMain() try { while (_run) { + // Because Windows + setPersistentTapDeviceState(_deviceInstanceId.c_str(),false); + Sleep(500); + setPersistentTapDeviceState(_deviceInstanceId.c_str(),true); + Sleep(500); + setPersistentTapDeviceState(_deviceInstanceId.c_str(),false); + Sleep(500); setPersistentTapDeviceState(_deviceInstanceId.c_str(),true); Sleep(500); _tap = CreateFileA(tapPath,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_SYSTEM|FILE_FLAG_OVERLAPPED,NULL); if (_tap == INVALID_HANDLE_VALUE) { - setPersistentTapDeviceState(_deviceInstanceId.c_str(),false); - Sleep(500); - setPersistentTapDeviceState(_deviceInstanceId.c_str(),true); - Sleep(500); + Sleep(1000); continue; } -- cgit v1.2.3