diff --git a/ctypes_generation/generate.py b/ctypes_generation/generate.py index 3786fba..50f3e42 100644 --- a/ctypes_generation/generate.py +++ b/ctypes_generation/generate.py @@ -22,7 +22,7 @@ TYPE_EQUIVALENCE = [ ('BYTE', 'c_ubyte'), ('PWSTR', 'LPWSTR'), ('PCWSTR', 'LPWSTR'), - ('SIZE_T', 'c_ulong'), + ('SIZE_T', 'c_size_t'), ('PSIZE_T', 'POINTER(SIZE_T)'), ('PVOID', 'c_void_p'), ('PPS_POST_PROCESS_INIT_ROUTINE', 'PVOID'), diff --git a/windows/alpc.py b/windows/alpc.py index 4987cd3..f090b7b 100644 --- a/windows/alpc.py +++ b/windows/alpc.py @@ -57,8 +57,10 @@ class MessageAttribute(gn.ALPC_MESSAGE_ATTRIBUTES): res = gn.DWORD() try: windows.winproxy.AlpcInitializeMessageAttribute(flags, None, 0, res) - except windows.generated_def.ntstatus.NtStatusException: + except windows.generated_def.ntstatus.NtStatusException as e: + # Buffer too small: osef return res.value + return res.value class AlpcPORT(object): diff --git a/windows/generated_def/winstructs.py b/windows/generated_def/winstructs.py index 1fc8114..059f5fe 100644 --- a/windows/generated_def/winstructs.py +++ b/windows/generated_def/winstructs.py @@ -7,7 +7,7 @@ from windef import * BYTE = c_ubyte PWSTR = LPWSTR PCWSTR = LPWSTR -SIZE_T = c_ulong +SIZE_T = c_size_t PSIZE_T = POINTER(SIZE_T) PVOID = c_void_p PPS_POST_PROCESS_INIT_ROUTINE = PVOID