pipe failure problem between Win7 & XP
Hello everyone,
I have run into a very peculiar problem while trying to run a client/server app on a small wireless LAN using Windows named pipes.
When the server is the Win7 box and the client is the XP box the app runs perfectly. When, however, the server is the XP box and the client is the Win7 box, the Win7 machine cannot successfully call CreateFile and open the pipe. The message back from the OS is "invalid file handle". Moreover, the XP server reports that it is able to create the pipe so the problem seems to be something about named pipes itself when it runs on an XP machine connected to a Win7 client.
I have turned off windows firewalls on the XP box and the problem persists. Both machines can share files and printers without any problem.
I would be happy to post the code for the app, but it seemed to me that the code itself is not the source of the problem since the code runs...something else is.
Any thoughts would be welcome.
Regards,
Mark Allyn
Yes, I had read the MSDN pages on Named Pipe
Hello Itsme86,
As it turns out, I had read the MSDN page you noted. I noticed the same thing you did, but I have not tried to use waitnamedpipe() AFTER the createfile() call, and perhaps it does make a difference depending upon which OS is used.
The model that I followed when I wrote my stuff was a code snippet written by Johnson Hart (3rd edition of "Windows System Programming", pages 324-325) in which he calls waitnamedpipe() BEFORE the call to CreateFile(). The Hart snippet was written before Win7 (and maybe even before XP!).
It's an easy experiment to conduct, however, and I will try it out. I will be doing the experiment you suggested concerning using the same executable on the XP as I'm using on the Win7 machine.
Regards,
Mark
Update on failed experiments
Hello Itsme (and others)
I tried two experiments discussed previously.
1. I ran identical server executable (compiled and linked on the same Win7 machine) on the XP box, and it too failed to provide usable pipe.
2. I rewrote the server code to conform to the MSDN (library aa365443) doc and this failed to provide a usable pipe to the client, although it did create an instance of a message oriented pipe.
The client reports a system error 5 ("Access denied") when it tries to access the pipe via CreateFile command.
What is going on here?
Mark