September 21st, 2009 04:14 PM
INVALID_HANDLE on DuplicateHandle of current Process
I've googled about this and I'm still struggling, I need a Handle of the actual process, not the pseudo Handle returned by GetCurrentThread(), but the actual one.
I've learned that I need to get the pseudo handle, and then use the DuplicateHandle to get the real one. So I did this but unfortunately I keep getting the error 16 - INVALID_HANDLE:
HANDLE _handle = GetCurrentThread();
bool x = DuplicateHandle(_handle,_handle,_handle,
cout << "Last Error: " << GetLastError() << endl;
I think the error might be around the _handle,_handle_handle, but I'm still stuck, any ideas?
Tags for this Thread
Click Here to Expand Forum to Full Width