1
奇怪的行爲在Python的2.7.10:GetProcAddress的關於Python 3.4
>>> from ctypes import windll
>>> windll.kernel32.GetProcAddress(windll.kernel32.GetModuleHandleA('kernel32'), 'LoadLibraryW')
不返回空的結果。但是Python 3.X中的相同總是返回null。
>>> from ctypes import windll
>>> windll.kernel32.GetProcAddress(windll.kernel32.GetModuleHandleA('kernel32'), 'LoadLibraryA')
0
# and other variants
>>> windll.kernel32.GetProcAddress(windll.kernel32.GetModuleHandleA('kernel32'), 'LoadLibraryW')
0
>>> windll.kernel32.GetProcAddress(windll.kernel32.GetModuleHandleW('kernel32'), 'LoadLibraryA')
0
>>> windll.kernel32.GetProcAddress(windll.kernel32.GetModuleHandleW('kernel32'), 'LoadLibraryW')
0
怎麼了,怎麼解決它(如果可能的話)?
非常感謝您的解釋!它的作品:windll.kernel32.GetProcAddress(windll.kernel32.GetModuleHandleW('kernel32'),b'LoadLibraryW') – kate