win32: add methods to cancel read/write operation, use in close, fixes #51
diff --git a/serial/win32.py b/serial/win32.py
index 43caae1..cef5568 100644
--- a/serial/win32.py
+++ b/serial/win32.py
@@ -179,6 +179,10 @@
WaitForSingleObject.restype = DWORD
WaitForSingleObject.argtypes = [HANDLE, DWORD]
+CancelIoEx = _stdcall_libraries['kernel32'].CancelIoEx
+CancelIoEx.restype = BOOL
+CancelIoEx.argtypes = [HANDLE, LPOVERLAPPED]
+
ONESTOPBIT = 0 # Variable c_int
TWOSTOPBITS = 2 # Variable c_int
ONE5STOPBITS = 1