enthought / pywin32-ctypes

A (partial) reimplementation of pywin32 in pure python
Other
18 stars 9 forks source link

Fix issue 21 #30

Closed itziakos closed 9 years ago

itziakos commented 9 years ago

This PR fixes #21

The problem was that the callback functions receive the resource type and resource name as a pointer to wchar. But the value of the pointer passes the IS_INTRESOURCE check that it is interprated as an integer index inastead of a string (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms648041%28v=vs.85%29.aspx)

The solutiuon is to claim the input types are LPVOID and wrap the user provided callback in order to convert them into python frieadly types. This results in similar output with the origin win32api library.

The error was not visible before because the python.exedoes not have resource types defined by name. I have use alternative files that should exist on all windows platforms.

itziakos commented 9 years ago

@cournape do you have time for review?

cournape commented 9 years ago

LGTM