arguments to calldll.call_foreign_function() ?

Jon Nicoll jkn at nicorp.f9.co.uk
Wed Jun 20 11:56:09 EDT 2001


Hi there
    I want to experiment with using calldll to access a win32
function: QueryPerformanceCounter(), which has a prototype

BOOL QueryPerformanceCounter(
   LARGE_INTEGER  *lpPerformanceCount 	// address of current counter
value
   );

I've got as far as this:

:: testcalldll.py
import calldll

# get the handle of a module
m = calldll.load_library('kernel32')

# get the address of my function
f = calldll.get_proc_address(m, 'QueryPerformanceCounter')

# try to call the function
# print calldll.call_foreign_function(f, '', 'l', ())
:: end

but I can't work out the right parameters for the last line - the
call_foreign_function(). Help, please?

    Thanks
    Jon Nicoll



More information about the Python-list mailing list