Process Handle
-
I´m having problems getting the my process handle, using GetCurrentProcess() I always get 0xfffffff... back. I need to get my own process handle to pass on to a watchdog process to monitor, has anyone any idea how to get to grips with this problem ? ps, I´m using ATL/WTL and API NO MFC
-
I´m having problems getting the my process handle, using GetCurrentProcess() I always get 0xfffffff... back. I need to get my own process handle to pass on to a watchdog process to monitor, has anyone any idea how to get to grips with this problem ? ps, I´m using ATL/WTL and API NO MFC
-
The return value is a pseudo handle , to get the real handle use GetCurrentProcess() with DuplicateHandle() or call to OpenProcess() :rose:
Thanks, I used the following code HANDLE hHandle; DuplicateHandle(GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(), &hHandle, PROCESS_ALL_ACCESS | STANDARD_RIGHTS_REQUIRED |THREAD_ALL_ACCESS, FALSE,NULL); CloseHandle(hHandle); That worked...
-
I´m having problems getting the my process handle, using GetCurrentProcess() I always get 0xfffffff... back. I need to get my own process handle to pass on to a watchdog process to monitor, has anyone any idea how to get to grips with this problem ? ps, I´m using ATL/WTL and API NO MFC
The 0xff thing is correct as in the doc however u may want to use the PID instead i.e. GetCurrentProcessId() Until the process terminates, the process identifier uniquely identifies the process throughout the system
-
The 0xff thing is correct as in the doc however u may want to use the PID instead i.e. GetCurrentProcessId() Until the process terminates, the process identifier uniquely identifies the process throughout the system
That´s true, but as far as I Know (read) you can not terminate or kill a process with the PricossID, just with the Process handle. But any way, I ´ve solved that problem, know I have to change the Token on NT/XP/2000 system to Terminate/Kill the process, and Shutdown or reboot, and the MSDN is not very helpfull at all :( :confused: