- EnterCriticalSection(&mutex);
- packet.len = len;
- packet.priority = 0;
- route(myself, &packet);
- LeaveCriticalSection(&mutex);
+ device_read_packet.len = len;
+ device_read_packet.priority = 0;
+ route(myself, &device_read_packet);
+ }
+}
+
+static void device_handle_read(void *data, int flags) {
+ ResetEvent(device_read_overlapped.hEvent);
+
+ DWORD len;
+ if (!GetOverlappedResult(device_handle, &device_read_overlapped, &len, FALSE)) {
+ logger(DEBUG_ALWAYS, LOG_ERR, "Error getting read result from %s %s: %s", device_info,
+ device, strerror(errno));
+ return;