summaryrefslogtreecommitdiff
path: root/osdep/WindowsEthernetTap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/WindowsEthernetTap.cpp')
-rw-r--r--osdep/WindowsEthernetTap.cpp12
1 files changed, 8 insertions, 4 deletions
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;
}