Exemplo n.º 1
0
 def dlopenU(name, mode=-1):
     # mode is unused on windows, but a consistant signature
     res = rwin32.LoadLibraryW(name)
     if not res:
         err = rwin32.GetLastError_saved()
         ustr, lgt = rwin32.FormatErrorW(err)
         raise DLOpenError(ustr)
     return res
Exemplo 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))
    assert hdll
    faddr = rwin32.GetProcAddress(hdll, 'sum')
    assert faddr
    assert rwin32.FreeLibrary(hdll)
Exemplo n.º 3
0
 def dlopenU(name, mode=-1):
     # mode is unused on windows, but a consistant signature
     res = rwin32.LoadLibraryW(name)
     if not res:
         err = rwin32.GetLastError_saved()
         ustr = rwin32.FormatErrorW(err)
         # DLOpenError unicode msg breaks translation of cpyext create_extension_module
         raise DLOpenError(ustr.encode('utf-8'))
     return res
Exemplo n.º 4
0
def test_loadlibrary_unicode():
    import shutil
    test0u = unicode(udir.join(u'load\u03betest.dll'))
    shutil.copyfile(test0, test0u)
    hdll = rwin32.LoadLibraryW(test0u)
    assert hdll