How to debug a 64-bit dll registration process done with regsvr32.exe?

I have

Runtime Error 216 with ADDRESS

when registering a 64-bit dll built using Delphi XE2 (I have update 3).

from the command line I'm doing (note: the system32 folder contains a 64-bit exe!)

c:\windows\system32\regsvr32.exe My64bitdll.dll 

and after the "dll successfully installed message" I have a runtime error.

I would like to debug the registration process, somehow using Run / Parameters / host.

Can someone post the correct procedure? In some other issues, such as this one , a bug is mentioned, but now fixed, I have a delphi build older than this.

Update: Any comments on the RunTime error are also welcome.

+4
source share
2 answers
  • Download the DLL project.
  • Change the startup options ( Run | Options ) to specify the host application as regsvr32. Note that you may need to use the C: \ Windows \ sysnative path to defeat the 32-bit file redirector.
  • Include the path to the DLL as command line arguments.
  • It is possible to enable Debug DCU if an error occurs in the Delphi COM self-registration code.

enter image description here

Then debug the DLL, like any other DLL.

Runtime Error 216 - Access Violation.

+5
source

1) this runtime error may simply be the output of the program. For example, you are debugging the internals of DllMain, you can easily go past the exit point and try to track the completed DLL, which will be through RE. The process exit does not look like a return from a subprogram, but rather like a call to a special function of the system API. But the debugger does not understand this and continues to track the dead project now.

2) I see no reason to use RegSvr32.exe or TRegSvr.exe for debugging. All RegSvr32 is a call to a predefined function from a DLL. Are you debugging your DLL or RegSvr32?

2.1) If the latter - I heard that there are RegSvr32 sources, and probably there are debugging symbols, but some Microsoft debuggers to be used.

2.2) If the former, now there should be a difference in how to call these functions, and you only need to debug these functions. Just take any code from File not found when registering a DLL with TFileRun and regsvr32 and use it as a host.

+1
source

All Articles