… | |
… | |
172 | FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, 0); |
172 | FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, 0); |
173 | } |
173 | } |
174 | |
174 | |
175 | if (device_handle == INVALID_HANDLE_VALUE) |
175 | if (device_handle == INVALID_HANDLE_VALUE) |
176 | { |
176 | { |
177 | slog (L_ERR, _("%s (%s) is not a usable Windows tap device: %s"), |
177 | slog (L_ERR, _("%s is not a usable Windows tap device: %s"), |
178 | device, iface, wstrerror (GetLastError ())); |
178 | adaptername, wstrerror (GetLastError ())); |
179 | exit (1); |
179 | exit (1); |
180 | } |
180 | } |
181 | |
181 | |
182 | fd = cygwin_attach_handle_to_fd (tapname, -1, device_handle, 1, GENERIC_WRITE | GENERIC_READ); |
182 | fd = cygwin_attach_handle_to_fd (tapname, -1, device_handle, 1, GENERIC_WRITE | GENERIC_READ); |
183 | |
183 | |
… | |
… | |
185 | |
185 | |
186 | if (!DeviceIoControl |
186 | if (!DeviceIoControl |
187 | (device_handle, TAP_IOCTL_GET_MAC, &mac, sizeof (mac), &mac, sizeof (mac), &len, 0)) |
187 | (device_handle, TAP_IOCTL_GET_MAC, &mac, sizeof (mac), &mac, sizeof (mac), &len, 0)) |
188 | { |
188 | { |
189 | slog (L_ERR, |
189 | slog (L_ERR, |
190 | _("Could not get MAC address from Windows tap device %s (%s): %s"), |
190 | _("Could not get MAC address from Windows tap device %s: %s"), |
191 | device, iface, wstrerror (GetLastError ())); |
191 | adaptername, wstrerror (GetLastError ())); |
192 | exit (1); |
192 | exit (1); |
193 | } |
193 | } |
194 | } |
194 | } |
195 | |
195 | |
196 | tap_device::~tap_device () |
196 | tap_device::~tap_device () |