summaryrefslogtreecommitdiff
path: root/libusb/os/poll_windows.h
diff options
context:
space:
mode:
Diffstat (limited to 'libusb/os/poll_windows.h')
-rw-r--r--libusb/os/poll_windows.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/libusb/os/poll_windows.h b/libusb/os/poll_windows.h
index 0da805b..97259e9 100644
--- a/libusb/os/poll_windows.h
+++ b/libusb/os/poll_windows.h
@@ -39,6 +39,13 @@
#endif
#endif
+// Handle synchronous completion through the overlapped structure
+#if !defined(STATUS_REPARSE) // reuse the REPARSE status code
+#define STATUS_REPARSE ((LONG)0x00000104L)
+#endif
+#define STATUS_COMPLETED_SYNCHRONOUSLY STATUS_REPARSE
+#define HasOverlappedIoCompletedSync(lpOverlapped) (((DWORD)(lpOverlapped)->Internal) == STATUS_COMPLETED_SYNCHRONOUSLY)
+
enum windows_version {
WINDOWS_UNSUPPORTED,
WINDOWS_XP,
@@ -77,7 +84,6 @@ struct winfd {
HANDLE handle; // what we need to attach overlapped to the I/O op, so we can poll it
OVERLAPPED* overlapped; // what will report our I/O status
enum rw_type rw; // I/O transfer direction: read *XOR* write (NOT BOTH)
- BOOLEAN completed_synchronously;// flag for async transfers that completed during request
};
extern const struct winfd INVALID_WINFD;