This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Albert.Zeyer, ajaksu2, eryksun, georg.brandl, ghazel, loewis, ssb22
Date 2015-08-21.14:00:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1440165606.08.0.574810285286.issue1384175@psf.upfronthosting.co.za>
In-reply-to
Content
I forgot to set errcheck:

    import ctypes

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

    def errcheck_bool(result, func, args):
        if not result:
            raise ctypes.WinError(ctypes.get_last_error())
        return args

    userenv.CreateEnvironmentBlock.argtypes = (ctypes.POINTER(ctypes.c_void_p),
                                               ctypes.c_void_p,
                                               ctypes.c_int)
    userenv.DestroyEnvironmentBlock.argtypes = (ctypes.c_void_p,)

    userenv.CreateEnvironmentBlock.errcheck = errcheck_bool
    userenv.DestroyEnvironmentBlock.errcheck = errcheck_bool

    # ...
History
Date User Action Args
2015-08-21 14:00:06eryksunsetrecipients: + eryksun, loewis, georg.brandl, ghazel, ajaksu2, ssb22, Albert.Zeyer
2015-08-21 14:00:06eryksunsetmessageid: <1440165606.08.0.574810285286.issue1384175@psf.upfronthosting.co.za>
2015-08-21 14:00:06eryksunlinkissue1384175 messages
2015-08-21 14:00:06eryksuncreate