DosCallNmPipe
From EDM2
This call performs a "procedure call" transaction using a message pipe.
Syntax
DosCallNmPipe (FileName, InBuffer, InBufferLen, OutBuffer, OutBufferLen, BytesOut, TimeOut)
Parameters
- FileName (PSZ) - input
- Address of the ASCIIZ name of the pipe to be opened. Pipes are named \PIPE\FileName.
- InBuffer (PBYTE) - input
- Address of the buffer to write to the pipe.
- InBufferLen (USHORT) - input
- Number of bytes to be written.
- OutBuffer (PBYTE) - input/output
- Address of the buffer for returned data.
- OutBufferLen (USHORT) - input
- Maximum size (number of bytes) of returned data.
- BytesOut (PUSHORT) - output
- Address of the variable where the system returns the number of bytes actually read (returned).
- TimeOut (ULONG) - input
- Maximum time to wait for pipe availability.
Return Code
- rc (USHORT) - return
- Return code descriptions are:
- 0 NO_ERROR
- 2 ERROR_FILE_NOT_FOUND
- 11 ERROR_BAD_FORMAT
- 230 ERROR_BAD_PIPE
- 231 ERROR_PIPE_BUSY
- 233 ERROR_PIPE_NOT_CONNECTED
- 234 ERROR_MORE_DATA
Remarks
This call is intended for use only on duplex message pipes. If this call is issued for a pipe that is not a duplex message pipe, ERROR_BAD_FORMAT is returned.
This call has the combined effect on a named pipe of DosOpen, DosTransactNmPipe, and DosClose. It provides an efficient means of implementing local and remote procedure-call (RPC) interfaces between processes.
Bindings
C
#define INCL_DOSNMPIPES USHORT rc = DosCallNmPipe(FileName, InBuffer, InBufferLen, OutBuffer, OutBufferLen, BytesOut, TimeOut); PSZ FileName; /* Pipe name */ PBYTE InBuffer; /* Write buffer address */ USHORT InBufferLen; /* Write buffer length */ PBYTE OutBuffer; /* Read buffer address */ USHORT OutBufferLen; /* Read buffer length * PUSHORT BytesOut; /* Bytes read (returned) */ ULONG TimeOut; /* Maximum wait time */ USHORT rc; /* return code */
MASM
EXTRN DosCallNmPipe:FAR INCL_DOSNMPIPES EQU 1 PUSH@ ASCIIZ FileName ;Pipe name PUSH@ OTHER InBuffer ;Write buffer PUSH WORD InBufferLen ;Write buffer length PUSH@ OTHER OutBuffer ;Read buffer PUSH WORD OutBufferLen ;Read buffer length PUSH@ WORD BytesOut ;Bytes read (returned) PUSH DWORD TimeOut ;Maximum wait time CALL DosCallNmPipe Returns WORD