please dont rip this site Prev Next

CallNamedPipe info  Overview  Group

The CallNamedPipe function connects to a message-type pipe (and waits if an instance of the pipe is not available), writes to and reads from the pipe, and then closes the pipe.

BOOL CallNamedPipe(

    LPCTSTR lpNamedPipeName,

// pointer to pipe name

    LPVOID lpInBuffer,

// pointer to write buffer

    DWORD nInBufferSize,

// size, in bytes, of write buffer

    LPVOID lpOutBuffer,

// pointer to read buffer

    DWORD nOutBufferSize,

// size, in bytes, of read buffer

    LPDWORD lpBytesRead,

// pointer to number of bytes read

    DWORD nTimeOut 

// time-out time, in milliseconds



Pointer to a null-terminated string specifying the pipe name.
Pointer to the buffer containing the data written to the pipe.
Specifies the size, in bytes, of the write buffer.
Pointer to the buffer that receives the data read from the pipe.
Specifies the size, in bytes, of the read buffer.
Pointer to a 32-bit variable that receives the number of bytes read from the pipe.
Specifies the number of milliseconds to wait for the named pipe to be available. In addition to numeric values, the following special values can be specified:




Does not wait for the named pipe. If the named pipe is not available, the function returns an error.


Waits indefinitely.


Uses the default time-out specified in a call to the CreateNamedPipe function.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.


Calling CallNamedPipe is equivalent to calling the CreateFile (or WaitNamedPipe, if CreateFile cannot open the pipe immediately), TransactNamedPipe, and CloseHandle functions. CreateFile is called with an access flag of GENERIC_READ | GENERIC_WRITE, an inherit handle flag of FALSE, and a share mode of zero (indicating no sharing of this pipe instance).

If the message written to the pipe by the server process is longer than nOutBufferSize, CallNamedPipe returns FALSE, and GetLastError returns ERROR_MORE_DATA. The remainder of the message is discarded, because CallNamedPipe closes the handle to the pipe before returning.

CallNamedPipe fails if the pipe is a byte-type pipe.

See Also

CloseHandle, CreateFile, CreateNamedPipe, TransactNamedPipe, WaitNamedPipe 


file: /Techref/os/win/api/win32/func/src/f03_24.htm, 5KB, , updated: 2000/4/7 12:19, local time: 2022/5/26 01:39,

 ©2022 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF=""> CallNamedPipe</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2022 contributors:
o List host: MIT, Site host, Top posters @20220526
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.

Welcome to!