Application failed to initialize using Detours [modified]
-
I think this is solved. The problem probably was that functions need to be exported when using Detours version 2.1 that did not need to be exported using version 1.5. I was getting the following error message: "The application failed to initialize properly (0xc000007b). Click on OK to terminate the application." Error 0x7B is "The filename, directory name, or volume label syntax is incorrect.". I don't know if this is a problem with Detours[^] or if it is a problem with VC 2005 or something else new that I am not familiar with. I will first clarify assuming you are familiar with Detours. If I use a command line such as:
withdll.exe -d:slept.dll sleepold.exe
then Detours works. If I use my own DLL instead, then I get the error, even if the DLL is very, very simple. Note that the command line I show here is simplified with the paths eliminated, but I am using a script that validates that the files exist. For those not familiar with Detours, the withdll.exe sample program uses Detours which uses CreateProcess to create a suspended process (executes sleepold.exe), then injects the DLL into the process. When Detours is installed, the sample programs and Detours itself need to be compiled, so I have the makefile and such for the builds. It is the Detours function that does the CreateProcess that is getting the error. I have tried to compare my VC 2005 project settings to the options used to make slept.dll and I can't find anything significantly different. My VC is: Microsoft Visual C++ 2005 77626-009-0000007-41476 -- modified at 19:47 Monday 26th June, 2006