none
Named Pipes between WinXP and WinXP64

    Question

  • I have code working for namedpipes communication between two WinXP SP2 boxes.  However when I copy the server code to a WinXP64 Pro SP2 box, I get an "Access Denied" error when executing the CreateFile function.  I have compiled the server code in both Win32 and XP64, returns the same error.

     

    Everything is indentical as I can get it between the two boxes.  I am seeking any ideas to rectify this issue.  I have explored Null Session Shares for Win2k based servers to no avail.

     

    Best Regards,

    William

     

    Edit:  I tested using the WinXP box as the server and the WinXP64 box as the client and the connection works fine.  Seems to be an issue with the WinXP64 box?

    Friday, July 13, 2007 3:44 PM

Answers

  • Okay, well I finally got it working.  What seems to be happening is on the WinXP64 box the namedpipes come in the network on the Guest account.

    I added my pipe name to the Registry Key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters\NullSessionPipes

    However, that did not fix the issue.

     

    By giving the Guest account Adminstrator rights the namedpipes works.  I am sure there is a more eloquent solution to keep the rights in check, but the system this is implemented on will be physically secure.

     

    Regards,

    William.

    Friday, July 13, 2007 8:38 PM

All replies

  • What error code does GetLastError return. That may give you a clue as to what is going on.
    Friday, July 13, 2007 4:57 PM
  • The error occurs on the Client side, WinXP32:

    CreateFile is returning an Invalid_Handle_Value:

    OutputPipeHandle = CreateFile (

                                              OutputPipeName, // pipe name

                                              GENERIC_WRITE, // write access only

                                              0, // exclusive access between server and client

                                               NULL, // child process cannot inherit handle

                                              OPEN_EXISTING, // the pipe must exist

                                             FILE_ATTRIBUTE_NORMAL | // default attributes

                                            FILE_FLAG_OVERLAPPED, // asynchronous writes

                                            NULL); // n/a -- related to template files

    if (OutputPipeHandle == INVALID_HANDLE_VALUE)

            cout << GetLastError();

     

    GetLastError is returning a 5: ERROR_ACCESS_DENIED

    Now Access Denied for pipes can be attributed to having the pipe defined differently on the client and the server.  However the same *exact* code works fine on 2 - WinXP32 boxes, only breaks with the server being a WinXP64 box.

     

    Best regards,

    William.

    Friday, July 13, 2007 5:40 PM
  • This to me says security. Check your security on the pipe in Win64 since it is probably not allowing you to have remote access by default.
    Friday, July 13, 2007 7:26 PM
  • Okay, well I finally got it working.  What seems to be happening is on the WinXP64 box the namedpipes come in the network on the Guest account.

    I added my pipe name to the Registry Key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters\NullSessionPipes

    However, that did not fix the issue.

     

    By giving the Guest account Adminstrator rights the namedpipes works.  I am sure there is a more eloquent solution to keep the rights in check, but the system this is implemented on will be physically secure.

     

    Regards,

    William.

    Friday, July 13, 2007 8:38 PM
  • Yes, that is a very dangerous solution. As I said, this is security settings.

    Is your named pipe created on the XP64 machine as guest or is the XP machine trying to connect as guest?

    You are going to have to change the security settings in the security descriptor part of the function to get this to work.

    Friday, July 13, 2007 11:57 PM
  • Both the client and the server boxes are logged into the same user "immc".
    Monday, July 16, 2007 12:42 PM