• Advertisement
Sign in to follow this  

SymInitialize returns "INVALID HANDLE"

This topic is 2652 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!
I'm trying to get symbols of a process using "SymGetSymFromAddr64"
but before that, when i try to initialize the whole thing with "SymInitialize(m_processHandle, NULL, TRUE)" I get error code 6 (invalid handle)

which is pretty strange because just before that I get this handle from "CreateProcessA" and I even double-checked that the handle refers to my process
with "GetProcessId"...
does anybody know what could be the problem?
thanks :)

Share this post


Link to post
Share on other sites
Advertisement
Shot in the dark: are you calling SymInitialize on your handle more than once?

Share this post


Link to post
Share on other sites
Quote:
Original post by the_edd
Shot in the dark: are you calling SymInitialize on your handle more than once?


no...

Share this post


Link to post
Share on other sites
Since loading symbols for a given process is an usual thing for a debugger to do, I assume that you're writing some kind of a debugger.

Quoting from the docs:

Quote:

If the application is a debugger, use the process handle for the process being debugged. Do not use the handle returned by GetCurrentProcess when debugging another process, because calling functions like SymLoadModuleEx can have unexpected results.


Does your project follow this guideline?

Share this post


Link to post
Share on other sites
Quote:
Original post by Nik02
Since loading symbols for a given process is an usual thing for a debugger to do, I assume that you're writing some kind of a debugger.

Quoting from the docs:

Quote:

If the application is a debugger, use the process handle for the process being debugged. Do not use the handle returned by GetCurrentProcess when debugging another process, because calling functions like SymLoadModuleEx can have unexpected results.


Does your project follow this guideline?


yes :(

Share this post


Link to post
Share on other sites
Is the target process separate from the process in which you call SymInitialize, though? If it is, have you checked that you have debug privileges to the target?

Share this post


Link to post
Share on other sites
yes, it is a different process and I do have debug privileges (I get them in a LIB component I made, if it makes a difference).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement