[issue9055] test_issue_8959_b fails when run from a service

Amaury Forgeot d'Arc report at bugs.python.org
Tue Jun 22 17:42:00 CEST 2010


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

To test windows callbacks, I suggest to use EnumResourceTypes() instead, which is more likely to work in any condition:

def test():
    from ctypes.wintypes import BOOL, HMODULE, LONG, LPARAM
    import ctypes
    EnumResourceTypes = ctypes.windll.kernel32.EnumResourceTypesA
    EnumResTypeProc = ctypes.WINFUNCTYPE(
        BOOL, HMODULE, LONG, LPARAM)

    resource_types = []
    def callback(hModule, typeid, lParam):
        resource_types.append(typeid)
        return True # keep enumerating

    hModule = None   # Main executable
    RT_MANIFEST = 24 # from winuser.h
    EnumResourceTypes(hModule, EnumResTypeProc(callback), None)

    assert RT_MANIFEST in resource_types

----------
nosy: +amaury.forgeotdarc

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9055>
_______________________________________


More information about the Python-bugs-list mailing list