none
Named pipes in windows Remote desktop services RRS feed

  • Question

  • Hi,
    I have a project that uses named pipes to connect a desktop application to an outlook add-in so that the application can send emails, contacts and calendar reminders to outlook and outlook can send email attachments and content to the application.

    This has worked well for years but now I have a requirement to do this in Remote Desktop services, which as you may know means that it runs an instance of the desktop application and the outlook add-in for each logged in windows user simultaneously on the same windows server.

    The problem is that my named pipe configuration and the end points were never setup for simultaneous use by multiple server/client pairs running at the same time. Once the first person to use that application has started, any subsequent attempts to connect are locked out saying the socket is already in use.
    Each server and client started for each user needs to only see traffic meant for that pair so do I need to create a new service and client for each windows user dynamically and if so how would I do that? 

    Any ideas would be gratefully received, thanks.


    • Edited by Trevonski Saturday, April 6, 2019 10:18 PM
    Saturday, April 6, 2019 10:12 PM

Answers

  • Tricky.  For most kernel objects, you can use a \\GLOBAL or \\LOCAL prefix to indicate whether the object applies to all sessions or just the current session, but named pipes live in a separate space that is always global.

    You could, I suppose, use WTSQuerySessionInformation to get your session ID and append that to the named pipe's name to make it unique.  That might not be a bad solution.


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Monday, April 8, 2019 6:26 AM

All replies

  • Tricky.  For most kernel objects, you can use a \\GLOBAL or \\LOCAL prefix to indicate whether the object applies to all sessions or just the current session, but named pipes live in a separate space that is always global.

    You could, I suppose, use WTSQuerySessionInformation to get your session ID and append that to the named pipe's name to make it unique.  That might not be a bad solution.


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Monday, April 8, 2019 6:26 AM
  • Thanks for this, I did have the idea of just appending the a modified current username but this is a similar track.
    I will try it out.

    Cheers

    Friday, April 19, 2019 9:11 PM