-
September 21st, 2009, 04:14 PM
#1
INVALID_HANDLE on DuplicateHandle of current Process
Hello:
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();
HANDLE _handle2;
bool x = DuplicateHandle(_handle,_handle,_handle,
&_handle2,
GENERIC_WRITE|GENERIC_READ,
TRUE,DUPLICATE_SAME_ACCESS);
if(!x)
{
cout << "Last Error: " << GetLastError() << endl;
}
I think the error might be around the _handle,_handle_handle, but I'm still stuck, any ideas?
Greetings
Alejandro
-
September 21st, 2009, 06:18 PM
#2
Re: INVALID_HANDLE on DuplicateHandle of current Process
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|