I want to launch a process in suspended state. Is there any way to do this by using only standard tools coming with Windows XP? Is there any lightweight third party tools?
Problem I'm trying to solve:
I have a application which I want to debug it by using Visual Studio 2005. I have debug build with necessary *.pdb files and I have all sources referenced from these *.pdb files. I don't want to create an empty solution which will run that application for me, so I'm trying to attach to this process after it's launched from other place. Some part of code I want to debug is executed at the beginning of process start-up, so I want to run it in suspended mode, attach a debugger and then resume it.
I'm not exactly sure what you're trying to do from your question, but maybe using the ntsd debugger which comes with XP will help you do what you want (by default, ntsd will load the process and stop at the first instruction).
From the updated information in your question, I'd suggest downloading the Debugging Tools for Windows package from Microsoft and debugging the startup stuff in WinDbg -the are some things that Visual Studio is better at, but there are also some things that WinDbg is better at than Visual Studio (WinDBg is a very powerful debugger).
Or you can simply load the program in the Visual Studio debugger (without a solution) from the command line:
devenv /debugexe yourprog.exe <arguments>
I've been asking myself this same question for a while now and just now found this pretty neat little tool that will do exactly what you (and I) want. You can get just the binary, or the source too.
http://www.codeproject.com/Articles/230005/Launch-a-process-suspended
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With