在启动时从Windows服务创建进程(Windows Server 2003上的错误87) [英] Creating a process from a windows service on startup (error 87 on windows server 2003)

查看:197
本文介绍了在启动时从Windows服务创建进程(Windows Server 2003上的错误87)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个服务,当它使用CreateProcessAsUser检测到登录时,会在用户会话中生成一个进程.最初,我曾在XP中对其进行过测试,但没有任何问题.现在,我正在Server 2003上进行尝试,以便可以同时登录多个用户.当用户登录所有其他功能(重复的令牌,创建环境块等)时,但实际过程无法启动,并且出现错误87,这对我无济于事.
当我调试并附加时逐步执行该过程,它可以正常工作并产生该过程.我添加了一个循环,经过大约1200次尝试,它终于可以工作了,并且过程开始了.
我还需要添加其他步骤吗?还是存在竞争条件,而我一直坚持这样做?

谢谢

使用VS 2005和.NET 2.0

I've created a service that spawns a process in a user session when it detects logon using CreateProcessAsUser.  Originally I had been testing it in XP and didn't have any issues.  Now I'm trying it on Server 2003 so I can have multiple users logged on at the same time.  When the user logs on all of the other functions (duplicate token, create environment block, etc) work but the actual process does not start and it gives me an error 87 which is extremely unhelpful.
When I am debugging and attach to the process to step through it, it works correctly and spawns the process.  I added a loop and after ~1200 attempts it finally works and the process starts.
Are there any other steps I have to add or is there a race condition and I'm stuck doing it this way?  Any insight into what is going on would be very helpful.

Thanks

using VS 2005 and .NET 2.0

推荐答案

你好

感谢您的帖子.我建议将您的问题发布到Windows Server TechCenter之一中. Windows Server论坛>一般位于此处:

Thank you for the post.  I would suggest posting your question in one of the Windows Server TechCenter > Windows Server Forums > General located here:

http://social.technet.microsoft.com/Forums/en-US/winservergen /threads

希望这对您有所帮助.

祝你有美好的一天!


这篇关于在启动时从Windows服务创建进程(Windows Server 2003上的错误87)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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