使用CreateProcessAsUser从特定会话中的运行进程打开新进程 [英] Using CreateProcessAsUser to open a new process from the running process in specific session

查看:571
本文介绍了使用CreateProcessAsUser从特定会话中的运行进程打开新进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个名为"abc.exe"的exe文件作为服务运行,我正在调用新的exe"xyz.exe"通过使用CreateProcessAsUser API,我使用WTSQueryUserToken传递我想要打开的会话的sessionid"xyz.exe"
并使用DuplicateTokenEx复制令牌然后将该令牌传递给CreateProcessAsUser,它工作正常,但如果我运行"abc.exe"作为一个应用程序然后调用"xyz.exe"并将任何会话ID传递给WTSQueryUserToken然后"xyz.exe"
在该会话中打开,其中"abc.exe"正在运行,任何人都可以帮我解决这个问题。

I have one exe named as "abc.exe" that is running as a service and from that I am calling new exe "xyz.exe" by using CreateProcessAsUser API and I am using WTSQueryUserToken to pass the sessionid of the session in which I want to open "xyz.exe" and use DuplicateTokenEx to duplicate the token and then pass that token to CreateProcessAsUser, it is working fine , but If I run "abc.exe" as an application then call "xyz.exe" and passing any session id to WTSQueryUserToken then "xyz.exe" is opening in that session in which "abc.exe" is running ,Can anybody help me out to solve this problem.


提前致谢。

Thanks in advance.

推荐答案

我正在使用CreateWindowEx API使用C ++创建窗口窗口正常但我想打开一个窗口,因为新进程有一些名称"abc.exe"。 ,有一个名为CreateProcessAsUser的API,但我没有得到如何在这个上下文中使用这个API
。任何人都可以帮我解决这个问题。

I am using CreateWindowEx API using C++ to create window window is opening fine but I want to open a window as new process that has some name "abc.exe" , there is an API called CreateProcessAsUser but I am not getting how to use this API in this context.Can anyone help me out to solve this problem.

提前致谢。


这篇关于使用CreateProcessAsUser从特定会话中的运行进程打开新进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆