CreateProcessAsUser 与 CreateProcess 之间的 区别 谢谢
msdn上的描述:
The CreateProcessAsUser function creates a new process and its primary thread. The new process then runs the specified executable file. The CreateProcessAsUser function is similar to the CreateProcess function, except that the new process runs in the security context of the user represented by the hToken parameter. By default, the new process is noninteractive, that is, it runs on a desktop that is not visible and cannot receive user input. Also, by default, the new process inherits the environment of the calling process, rather than the environment associated with the specified user.
我翻译:CreateProcessAsUser 创建一个进程以及该进程的主线程。该新进程执行一个指定的可执行文件。CreateProcessAsUser与CreateProcess类似。
不同之处:CreateProcessAsUser启动的进程运行在安全的user上下文中。默认情况下,该新进程是不交互的,因为它运行在一个不可见也不接受用户输入的桌面上
,还有该新进程继承调用该进程的进程的环境,而不是和指定用户相联系的环境。
几个问题我不明白:
1,什么是安全的上下文?
2,什么是环境?
3,看什么样的书才能理解这些概念。
实际中遇到的问题描:SKype在一个本地登录帐户里只能运行一个实例,我需要运行多个实例,那么就需要以其他帐户的身份运行skype
我调用的是CreateProcessAsUser()这个函数 可一直没有成功
谢谢