I have a small program I've written to demonstrate setting an exception filter. Problem is, in the call to SymGetSymFromAddr(), the HANDLE I pass to it must be bad, as this function fails, and then a call to GetLastError() returns '6', Invalid Handle. If I print out the handle beforehand, it is usually 88 (as in int).
Here is the primary code (I can submit more if required). These functions are called in the exception filter that gets called on an exception.
DWORD Id = GetCurrentProcessId();
HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, TRUE, Id );
Then, I pass this hProcess to another function that contains
SymGetSymFromAddr( hProcess, ... )
This function calls as stated above.
Is the method I'm using to get my process handle invalid, or what?