/Lib/ctypes/test/test_errcheck.py
http://unladen-swallow.googlecode.com/ · Python · 19 lines · 2 code · 6 blank · 11 comment · 0 complexity · a02b9acbf9cf3ce22acc19d19dc6f8e1 MD5 · raw file
- import sys
- from ctypes import *
- ##class HMODULE(Structure):
- ## _fields_ = [("value", c_void_p)]
- ## def __repr__(self):
- ## return "<HMODULE %s>" % self.value
- ##windll.kernel32.GetModuleHandleA.restype = HMODULE
- ##print windll.kernel32.GetModuleHandleA("python23.dll")
- ##print hex(sys.dllhandle)
- ##def nonzero(handle):
- ## return (GetLastError(), handle)
- ##windll.kernel32.GetModuleHandleA.errcheck = nonzero
- ##print windll.kernel32.GetModuleHandleA("spam")