Windows 10:命名管道的CreateFile()始终返回ERROR_PIPE_BUSY [英] Windows 10: CreateFile() for a named pipe returns ERROR_PIPE_BUSY always
问题描述
我正在使用的旧版应用程序 在Windows 7上可以成功运行多年,但在某些情况下在Windows 10上则无法运行.
I'm working on a legacy application which has been working successfully for years on Windows 7, but fails in some cases on Windows 10.
一种这样的情况是使用命名管道.尝试使用CreateFile()访问命名管道的客户端应用程序始终返回错误ERROR_PIPE_BUSY,并且由于我们尝试间歇性地执行WaitNamedPipe()而进入无限循环,类似于https://msdn.microsoft.com/en -us/library/windows/desktop/aa365592(v = vs.85).aspx
One such case is use of named pipes. A client application trying to access a named pipe using CreateFile() always returns the error ERROR_PIPE_BUSY, and goes into an infinite loop since we try to do WaitNamedPipe() intermittently, similar to https://msdn.microsoft.com/en-us/library/windows/desktop/aa365592(v=vs.85).aspx
我检查了代码,发现CloseHandle()正在正确调用.为何在Windows 10上该操作始终失败的任何线索?
I've checked the code, and found that CloseHandle() is being called correctly. Any clues why this should fail consistently on Windows 10?
TIA.
推荐答案
我忘了提到涉及的2个进程作为服务运行.就管道使用而言,一个是父进程即服务器,而它创建的从属进程是客户端.不确定是否有任何后果.
I forgot to mention that the 2 processes involved run as services. One is a parent process which is the server, and a slave process that it creates is the client in terms of pipe usage. Not sure if this is of any consequence though.
此致
JY.
这篇关于Windows 10:命名管道的CreateFile()始终返回ERROR_PIPE_BUSY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!