IDebugControl :: WaitForEvent runs once and then returns E_HANDLE
I am trying to make a small tool that uses the "Debugger API" , but I have very limited success.
I can get IDebugClient and IDebugControl instances, and from there I can connect to an already running user process. Then I enter the main loop where I call WaitForEvent , OutputStackTrace , SetExecutionStatus ( DEBUG_STATUS_GO
) and repeat. Basically it will be a very crude sample-based profiler.
Ok so far ..
My loop runs for one full iteration, I can see the stack trace is displayed and then the target process goes back to working state.
The problem is that on my second iteration, the call WaitForEvent
returns E_HANDLE
("Invalid handle"). I don't see in the documentation why this error should be returned. Does anyone know why this might be happening?
source to share
The problem was that I was compiling, linking and working with the old version of the SDK. Now when I have updated my SDK to the latest version (I assume this is the version referenced by the online docs) I get behavior that is at least consistent with the docs.
I still have problems, but this is no longer a problem.
source to share