GetCurrentProcess() and GetCurrentProcessId()
来源:互联网 发布:淘宝标题带特价 编辑:程序博客网 时间:2024/06/03 12:55
MSDN:
GetCurrentProcess()
The return value is a pseudo handle to the current process.
Remark
Pseudo handles are not inherited by child processes.
A process can create a "real" handle to itself that is valid in the context of other processes, or thatcan 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 byDuplicateHandle, the duplicate handle must be closed.
HANDLE handle = GetCurrentProcess();
该handle不能被子进程继承使用!
如果要在子进程中获取父进程的handle,可以通过传递ProcessID给子进程,子进程中使用GetCurrentProcessId()来得到
- GetCurrentProcess() and GetCurrentProcessId()
- WinAPI: GetCurrentThread、GetCurrentThreadId、GetCurrentProcess、GetCurrentProcessId
- WinAPI: GetCurrentThread、GetCurrentThreadId、GetCurrentProcess、GetCurrentProcessId
- WinAPI: GetCurrentThread、GetCurrentThreadId、GetCurrentProcess、GetCurrentProcessId
- GetCurrentProcess and GetCurrentThread
- GetCurrentProcessID、OpenProcessToken
- GetCurrentProcess()和DuplicateHandle()
- OpenThread GetCurrentThread GetCurrentProcess
- GetCurrentProcess()与DuplicateHandle()解析
- GetCurrentProcessID、OpenProcessToken、LookupPrivilegeValue、AdjustTokenPrivileges
- GetCurrentProcessID、OpenProcessToken、LookupPrivilegeValue、AdjustTokenPrivileges
- GetCurrentProcessID、OpenProcessToken、LookupPrivilegeValue、Adj...
- GetCurrentProcessID、OpenProcessToken、LookupPrivilegeValue、AdjustTokenPrivileges
- GetCurrentProcessID、OpenProcessToken、LookupPrivilegeValue
- Dns.GetHostName(); Process.GetCurrentProcess().ProcessName;
- [转载]GetCurrentProcessID、OpenProcessToken、LookupPrivilegeValue、AdjustTokenPrivileges
- GetCurrentProcess/Thread(Id)的反汇编
- Process.GetCurrentProcess 方法的VB.NET例子
- 面向对象的基本框架的总结
- 用Python编写干净 可测试 高质量的代码
- 好像叫quickSort
- 按月、按天计算失效日期的代码实现
- 利用Host主机的 虚拟化技术来运行虚拟机(QEMU)
- GetCurrentProcess() and GetCurrentProcessId()
- GRUB4DOS使用大全
- Python nose test framework 介绍
- mvn 多模块
- 动态链接库的使用
- UVA 11174 Stand in a Line 树形dp+计数
- idea 结合maven开发hibernate实例
- 如何调试手机网页
- 【协议模拟】TCP五层协议信息传输模拟