Windows4 --跨进程使用句柄及内存
Windows1.跨进程使用句柄先创建两个MFC的进程分别为A,B
A:
B:
使用方式
(1)继承方式
父进程打开的句柄继承给子进程使用
父进程的句柄是否继承给子进程使用
判断句柄是否可以被继承(安全属性) 第一个为进程句柄 第二个为线程句柄
若安全属性为true 那么当createprocess为true时句柄会传给子进程 为FALSE时句柄不会传给子进程
但若安全属性为false时 无论createprocess为true还是false都不会传给子进程
A:
12345678910111213141516171819202122232425262728293031ZeroMemory(&si, sizeof(si));si.cb = sizeof(si);ZeroMemory(&pi, sizeof(pi));SECURITY_ATTRIBUTES sa = {};sa.nLength = sizeof(sa);sa.bInheritHandle = TRUE;//进程允许被继承// Start the child process. ...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment