Eryk Sun <eryk...@gmail.com> added the comment:

The SIZE [1] type for a rectangle has nothing to do with SIZE_T [2], the 
integer type that's returned by C sizeof(). SIZE_T isn't defined in wintypes. A 
new issue can be opened to add more of the common data types to wintypes.

Here's an example for defining CreateRemoteThread:

    import ctypes
    from ctypes import wintypes

    kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)

    SIZE_T = ctypes.c_size_t
    LPSECURITY_ATTRIBUTES = ctypes.c_void_p
    LPTHREAD_START_ROUTINE = ctypes.WINFUNCTYPE(wintypes.DWORD, wintypes.LPVOID)

    kernel32.CreateRemoteThread.restype = wintypes.HANDLE
    kernel32.CreateRemoteThread.argtypes = (
      wintypes.HANDLE,        # hProcess
      LPSECURITY_ATTRIBUTES,  # lpThreadAttributes
      SIZE_T,                 # dwStackSize
      LPTHREAD_START_ROUTINE, # lpStartAddress
      wintypes.LPVOID,        # lpParameter
      wintypes.DWORD,         # dwCreationFlags
      wintypes.LPDWORD)       # lpThreadId

---

[1] https://docs.microsoft.com/en-us/windows/win32/api/windef/ns-windef-size
[2] 
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types#SIZE_T

----------
nosy: +eryksun
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43170>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to