- if(handle == INVALID_HANDLE_VALUE) {
- logger(LOG_ERR, _("Could not open Windows tap device for reading!"));
+ device_handle = CreateFile(tapname, GENERIC_READ, FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM, 0);
+
+ if(device_handle == INVALID_HANDLE_VALUE) {
+ logger(LOG_ERR, _("Could not open Windows tap device for reading: %s"), winerror(GetLastError()));