Jump to content

DosCallNmPipe: Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
==Description==
This call performs a "procedure call" transaction using a message pipe.
This call performs a "procedure call" transaction using a message pipe.  


==Syntax==
==Syntax==
<PRE>
  DosCallNmPipe (FileName, InBuffer, InBufferLen,
  DosCallNmPipe
                OutBuffer, OutBufferLen, BytesOut, TimeOut)


    (FileName, InBuffer, InBufferLen, OutBuffer, OutBufferLen, BytesOut, TimeOut)
</PRE>
==Parameters==
==Parameters==
; FileName (PSZ) - input : Address of the ASCIIZ name of the pipe to be opened. Pipes are named \PIPE\FileName.  
;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.
; 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.
; InBufferLen (USHORT) - input : Number of bytes to be written.  
;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).
; OutBuffer (PBYTE) - input/output : Address of the buffer for returned data.  
;TimeOut (ULONG) - input : Maximum time to wait for pipe availability.
 
; 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==
==Return Code==
  rc (USHORT) - return
  rc (USHORT) - return
Return code descriptions are:
Return code descriptions are:
* 0          NO_ERROR  
* 0          NO_ERROR  
* 2          ERROR_FILE_NOT_FOUND  
* 2          ERROR_FILE_NOT_FOUND  
Line 35: Line 24:
* 233        ERROR_PIPE_NOT_CONNECTED  
* 233        ERROR_PIPE_NOT_CONNECTED  
* 234        ERROR_MORE_DATA
* 234        ERROR_MORE_DATA


==Remarks==
==Remarks==
Line 80: Line 68:
*  
*  


 
[[Category:Dos]]
[[Category:The OS/2 API Project]]

Revision as of 01:15, 27 February 2017

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.

Example Code

C Binding

#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 Binding

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

Related Functions