I am currently trying to port some code from a 32 bit windows XP computer to a 64 bit windows 10 computer. I need in my python code to import home developed C dlls as follow :
from ctypes import *
[...]
self.inter_test_dll = windll.LoadLibrary("my.dll")
self.w = QtWidgets.QWidget()
self.wid = self.w.winId()
self.wid.setsize(64)
print(self.wid)
self.inter_test_dll.dll_load_window(int(self.wid), 'test')
self.inter_test_dll.dll_connect(2, self.callback)
[...]
The program crashes as soon as the dll is loaded with a cryptic
Windows Error 1114
Which means a dll crashed on initialization. I have tried my dll on my personal machine (64 bits Windows 7), no issue, it all works fine. I have tried that dll on the same 64 bits Windows 10 machine from within a C program, LoadLibrary("my.dll") also fails but LoadLibraryEx("my.dll",NULL, DONT_RESOLVE_DLL_REFERENCE ) does work.
When I run a dependency walker on my dll, it seems to miss some 2 to 4 depth level dll, but it weirdly doesn't seem to affect its working when called properly from within the C program.
So my question is, is there a way to instantiate my dll within Python without an in-depth check of its dependencies ? If not, is there a way to modify my windows behavior, in order to skip that check by default ?
Thanks a lot !
ctypes.WinDLL("my.dll")
with a debugger attached. This will tell you which DLL's init routine is failing. – Eryk SunDLL_PROCESS_ATTACH
, and one of them is failing. Unfortunately the loader no longer says which failed in a message box, and there's no event in the system log telling you which fails, so you have to use a debugger with loader snaps. – Eryk Sun