summaryrefslogtreecommitdiff
path: root/lib/python2.7/ctypes/test/test_errcheck.py
blob: a4913f920ddc28dde77ad546e9ccd198937bc465 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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")