eryksun added the comment: 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 # ... ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1384175> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com