Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not access the kernel32 GetModuleHandleW() function #37

Open
jfongattw opened this issue Jul 28, 2019 · 1 comment
Open

Can not access the kernel32 GetModuleHandleW() function #37

jfongattw opened this issue Jul 28, 2019 · 1 comment

Comments

@jfongattw
Copy link

My environment is: Windows Vista, Python 3.4 and pyclibrary-0.1.4

D:\Works\Python\pyclibrary-0.1.4>py
Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

from pyclibrary import CParser, CLibrary
p = CParser(cache=r'd:\Works\Python\pyclibrary-master\pyclibrary\headers\WinDefs.cache', check_cache_validity=False)
lib0 = CLibrary(r'c:\Windows\System32\Kernel32.dll', p, convention='windll')
lib0['functions']['GetModuleHandleW']
Type((Type(('HMODULE', 'stdcall'), type_quals=(('',), None)), (('lpModuleName', Type(('LPCWSTR',), type_quals=(('__',),)), None),)))
ret = lib0.GetModuleHandleW('user32.dll')
Traceback (most recent call last):
File "", line 1, in
File "D:\Works\Python\pyclibrary-0.1.4\pyclibrary\c_library.py", line 230, in getattr
obj = self(k, n)
File "D:\Works\Python\pyclibrary-0.1.4\pyclibrary\c_library.py", line 210, in call
self.objs[typ][name] = self.make_obj(typ, name)
File "D:\Works\Python\pyclibrary-0.1.4\pyclibrary\c_library.py", line 272, in make_obj
return self._get_function(n)
File "D:\Works\Python\pyclibrary-0.1.4\pyclibrary\c_library.py", line 338, in _get_function
func_name, self.lock_calls)
File "D:\Works\Python\pyclibrary-0.1.4\pyclibrary\c_library.py", line 413, in init
self.sig[1] = [s for s in sig[1] if s[1] != ('void',)]
IndexError: tuple index out of range

Best Regards,
Jach Fong

@MatthieuDartiailh
Copy link
Owner

Thanks for the report. I don't have access to a windows box currently. I will try to investigate when I do, hopefully before the end of August. Do not hesitate to ping me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants