SourceForge has been redesigned. Learn more.
Close

#22 Windows 98 Support fix

closed-accepted
None
5
2011-08-05
2010-07-28
CBWhiz
No

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]
CreateEvent=CreateEventA
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.

Discussion

  • Chris Liechti

    Chris Liechti - 2011-08-05

    Hm.. I do not have plans to support Win98 anymore as MS itself has killed support years ago.

    Anyways, this was easy to do with a exception handler for AttributeError.

    committed, will be in V2.6

     
  • Chris Liechti

    Chris Liechti - 2011-08-05
    • assigned_to: nobody --> cliechti
    • status: open --> closed-accepted
     

Log in to post a comment.