简体   繁体   English

无法在Vista下重新创建命名管道

[英]Cannot recreate named pipe under vista

In my application i have the app and a service that does stuff for the app. 在我的应用程序中,我有该应用程序和为该应用程序做事的服务。 They communicate via a named pipe. 它们通过命名管道进行通信。 Now i can start the app and it starts the service and connects and this works well. 现在,我可以启动该应用程序,它可以启动服务并连接,并且效果很好。

When the application downloads an update, it restarts it self (to unload in use modules) killing the service and then starts the service again to install the update. 当应用程序下载更新时,它将自行重启(以卸载使用中的模块),从而终止该服务,然后再次启动该服务以安装更新。 This is working fine on Windows XP and 7 however Vista keeps returning Access denied when trying to recreate the pipe. 在Windows XP和7上,此方法运行良好,但是在尝试重新创建管道时,Vista会继续返回拒绝访问。

I create the pipe with the flag FILE_FLAG_FIRST_PIPE_INSTANCE as to only have one pipe. 我创建带有标志FILE_FLAG_FIRST_PIPE_INSTANCE的管道,因为只有一个管道。 I restart the app using CreateProcess and the new instance waits for the old instance to stop. 我使用CreateProcess重新启动应用程序,新实例等待旧实例停止。

If i completely kill the application and restart it, it can install the update and the start up normally. 如果我完全杀死了该应用程序并重新启动它,它可以安装更新并正常启动。

This is driving me insane, any ideas? 这让我发疯了,有什么想法吗?

What kind of security attributes are you passing in to the CreateFile call that opens the handle to the pipe? 您要传递给打开管道句柄的CreateFile调用什么样的安全属性? Are you allowing handles to be inherited when you call CreateProcess ? 调用CreateProcess时是否允许继承句柄?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM