Sign in to follow this  
Idov

SymInitialize returns "INVALID HANDLE"

Recommended Posts

Idov    210
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
Nik02    4348
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
Idov    210
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
Nik02    4348
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this