import _ctypes
print _ctypes.__name__
print _ctypes.__file__
#print str(_ctypes.__dict__)
print _ctypes.__dict__["dlopen"]
#print _ctypes.cdll
#print _ctypes.cdll.libm

h = _ctypes.dlopen("libdl.dll")
print type(h)
dlsym_addr = _ctypes.dlsym(h, "4") # returns the address of the thing specified by ordinal rather than a symbol; have to be looking at some of the SDK files to determine the ordinal/symbol correspondence; in this case we are looking up dlsym itself, with dlsym
print dlsym_addr
print type(dlsym_addr)
print _ctypes.call_function(dlsym_addr, (h, "4")) # this actually appears to work
_ctypes.dlclose(h)

