Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1040161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:11:22+00:00 2026-05-16T15:11:22+00:00

I have a windows service which is creating a Named Pipe in it’s service

  • 0

I have a windows service which is creating a Named Pipe in it’s service main Function. The code snippet is below:

void WINAPI ServiceMain(DWORD argc, LPTSTR *argv)
{
  DWORD status;
  DWORD specificError;
  m_ServiceStatus.dwServiceType = SERVICE_WIN32;
  m_ServiceStatus.dwCurrentState = SERVICE_START_PENDING;
  m_ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
  m_ServiceStatus.dwWin32ExitCode = 0;
  m_ServiceStatus.dwServiceSpecificExitCode = 0;
  m_ServiceStatus.dwCheckPoint = 0;
  m_ServiceStatus.dwWaitHint = 0;

  m_ServiceStatusHandle = RegisterServiceCtrlHandler("myService", 
                                            ServiceCtrlHandler); 
  if (m_ServiceStatusHandle == (SERVICE_STATUS_HANDLE)0)
  {
    return;
  }
  m_ServiceStatus.dwCurrentState = SERVICE_RUNNING;
  m_ServiceStatus.dwCheckPoint = 0;
  m_ServiceStatus.dwWaitHint = 0;
  if (!SetServiceStatus (m_ServiceStatusHandle, &m_ServiceStatus))
  {
  }

    CraeteNamedPipe();

     return;
}

The CraeteNamedPipe function creates a named pipe \\.\pipe\1stPipe.

I am able to successfully install and run my service on my XP machine.
Now how can I access the namedpipe \\.\pipe\1stPipe by using another program.

Any Code snippet or sample article will be helpfull.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:11:23+00:00Added an answer on May 16, 2026 at 3:11 pm

    I hope you not only use CreateNamedPipe but also ConnectNamedPipe. It is also very important to set Security and Access Rights to the pipe (see lpSecurityAttributes parameter of the CreateNamedPipe) to be able to communicate with the pipe created by another user (typical situation if you create pipe inside of a windows service and use outside of the service).

    To connect to the pipe from the client side one can use either CreateFile or CallNamedPipe depend on the type mode (see also Can you explain in more detail what's the difference between PIPE_READMODE_MESSAGE/PIPE_READMODE_BYTE?).

    In the message-type pipe one uses typically CallNamedPipe or TransactNamedPipe (see http://msdn.microsoft.com/en-us/library/aa365789.aspx as an example). In the byte-type pipe one uses standard read/write file operation with respect of ReadFile and WriteFile.

    Different example of using pipes you can find here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a new windows service which works fine using barebone code (just
I'm creating a Wix installer for a windows service which needs to have provided,
I have a Windows Service which is basically accessing a mailbox and reading the
I have a windows service which fetches data from various datasources and build a
I have two windows application, one is a windows service which create EventWaitHandle and
I have a Windows Service application which uses a Threading.Timer and a TimerCallback to
I have a windows service application which works using remoting. It is used to
I have implemented a small Windows Service which runs every 9 minutes and writes
I have a Windows Service written in Delphi which runs a number of programs.
I have been made a windows service.in which i have been added project installer.in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.