Windows 98 Support is broken in the latest release. This broke when pyserial switched to using ctypes for com interaction.
The below code, when placed at the end of win32.py, fixes it:
from ctypes.wintypes import LPCSTR
CreateEventA = _stdcall_libraries['kernel32'].CreateEventA
CreateEventA.restype = HANDLE
CreateEventA.argtypes = [LPSECURITY_ATTRIBUTES, BOOL, BOOL, LPCSTR]
CreateFileA = _stdcall_libraries['kernel32'].CreateFileA
CreateFileA.restype = HANDLE
CreateFileA.argtypes = [LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE]
CreateFile = CreateFileA
Note that this unconditionally prefers the ascii version. You should do an OS check and surround this block with a test for Windows 98.
Log in to post a comment.