> The guys at http://forums.devx.com/showthread.php?t=15316 tell that > own PHANDLE equals to "-1" within application but it shouldn't be passed > to other apps for reference. > >
More details at: http://msdn.microsoft.com/en-us/library/windows/desktop/ms683179(v=vs.85).aspx A process can create a "real" handle to itself that is valid in the context of other processes, or that can be inherited by other processes, by specifying the pseudo handle as the source handle in a call to the DuplicateHandle function. A process can also use the OpenProcess function to open a real handle to itself. The pseudo handle need not be closed when it is no longer needed. Calling the CloseHandle function with a pseudo handle has no effect. If the pseudo handle is duplicated by DuplicateHandle, the duplicate handle must be closed. Smth like : //----------------- try handle1:= OpenProcess(SYNCHRONIZE,False,GetPid); [..] finally CloseHandle(handle1); end; //----------------- ? "DuplicateHandle" seems less acceptable since assumes 2 running processes to communicate. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ mseide-msegui-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

