summaryrefslogtreecommitdiff
path: root/libusb/os/poll_windows.h
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-03-12 12:59:04 +0000
committerPete Batard <pbatard@gmail.com>2010-03-12 12:59:04 +0000
commit8c1de7a64d44cf8176836a514ba332cde10484a4 (patch)
tree79522ed99363044baefecff72de2c503c39c3eb1 /libusb/os/poll_windows.h
parent2b47cdb7c8b20fbab0abbaa9ef66d7725af2b94d (diff)
downloadlibusb-8c1de7a64d44cf8176836a514ba332cde10484a4.tar.gz
remove buggy "completed_synchronously" flag (Graeme Gill)r205
setting this flag in windows_usb.c could be missed by poll use the overlapped.Internal status instead
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..5de9867 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 ((NTSTATUS)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;