def test_windll(self): if os.name != 'nt': skip('Run only on windows') from pypy.rlib.libffi import WinDLL dll = WinDLL('Kernel32.dll') sleep = dll.getpointer('Sleep',[types.uint], types.void) chain = ArgChain() chain.arg(10) sleep.call(chain, lltype.Void, is_struct=False)
def test_windll(self): if os.name != 'nt': skip('Run only on windows') from pypy.rlib.libffi import WinDLL dll = WinDLL('Kernel32.dll') sleep = dll.getpointer('Sleep', [types.uint], types.void) chain = ArgChain() chain.arg(10) sleep.call(chain, lltype.Void, is_struct=False)
def test_by_ordinal2(self): """ int __stdcall BBB_second_ordinal_function() { return 24; } """ from pypy.rlib.libffi import WinDLL dll = WinDLL(self.libfoo_name) f_by_name = dll.getpointer('BBB_second_ordinal_function' ,[], types.uint) f_by_ordinal = dll.getpointer_by_ordinal(2 ,[], types.uint) print dir(f_by_name) assert f_by_name.funcsym == f_by_ordinal.funcsym chain = ArgChain() assert 24 == f_by_ordinal.call(chain, lltype.Signed, is_struct=False)