I'm writing a native dll that is due to run with rundll32.exe (that is obligated by our clients). I've using VS's debugging properties to define:
Command: c:\windows\system32\rundll32.exe
Command Argument: $(TargetPath) , ENTRY_POINT
where ENTRY_POINT is an exported function of my dll, that obey the rundll32.exe interface.
This setup calls my function , but won't load any symbols and thus won't trigger any break point. I've learned that my function was called only after placing a call to MessageBox at its entrance.
when I use my own container application (just an exe calling Loadlibrary , GetProcAddress and the ENTRY_POINT function itself) all break points are triggered, and a step-by-step debugging is possible as usual.
what can cause that behavior?
In short: All problems arose due to debugging a
32Bitdll in a64Bitenvironment.As can be seen from original question, and side issues mentioned in comments, I had few problems here:
The reason is as mention the dll being
32Bitwhile debugger is64Bit. The path torundll32.exeinterpernted as the64Bitversion. That normally causesWOW64to launch a sub-process of the32Bitversion - hereby different process thus debugger not present.Thanks all.