Ejemplo n.º 1
0
def test_loadlibraryA():
    # test0 can be loaded alone, but test1 requires the modified search path
    hdll = rwin32.LoadLibrary(test0)
    assert hdll
    faddr = rwin32.GetProcAddress(hdll, 'internal_sum')
    assert faddr
    assert rwin32.FreeLibrary(hdll)

    hdll = rwin32.LoadLibrary(test1)
    assert not hdll

    assert os.path.exists(test1)

    hdll = rwin32.LoadLibraryExA(test1)
    assert hdll
    faddr = rwin32.GetProcAddress(hdll, 'sum')
    assert faddr
    assert rwin32.FreeLibrary(hdll)
Ejemplo n.º 2
0
def test_loadlibraryW():
    # test0 can be loaded alone, but test1 requires the modified search path
    hdll = rwin32.LoadLibraryW(unicode(test0))
    assert hdll
    faddr = rwin32.GetProcAddress(hdll, 'internal_sum')
    assert faddr
    assert rwin32.FreeLibrary(hdll)

    hdll = rwin32.LoadLibraryW(unicode(test1))
    assert not hdll

    assert os.path.exists(unicode(test1))

    hdll = rwin32.LoadLibraryExW(unicode(test1),
                                 rwin32.LOAD_WITH_ALTERED_SEARCH_PATH)
    assert hdll
    faddr = rwin32.GetProcAddress(hdll, 'sum')
    assert faddr
    assert rwin32.FreeLibrary(hdll)
Ejemplo n.º 3
0
 def dlclose(handle):
     res = rwin32.FreeLibrary(handle)
     if res:
         return 0  # success
     else:
         return -1  # error
Ejemplo n.º 4
0
 def dlclose(handle):
     res = rwin32.FreeLibrary(handle)
     if res:
         return -1
     else:
         return 0