DosTransactNmPipe: Difference between revisions
Appearance
m Ak120 moved page OS2 API:CPI:LEGACY:DosTransactNmPipe to DosTransactNmPipe |
mNo edit summary |
||
Line 1: | Line 1: | ||
This call performs a write followed by a read on a duplex message pipe. | |||
This call performs a write followed by a read on a duplex message pipe. | |||
==Syntax== | ==Syntax== | ||
DosTransactNmPipe (Handle, InBuffer, InBufferLen, OutBuffer, OutBufferLen, BytesOut) | |||
DosTransactNmPipe | |||
==Parameters== | ==Parameters== | ||
; | ;Handle (HPIPE) - input : Named pipe handle returned by DosMakeNmPipe or DosOpen. | ||
;InBuffer (PBYTE) - input : Address of the buffer to write to the pipe. | |||
; | ;InBufferLen (USHORT) - input : Number of bytes to be written. | ||
;OutBuffer (PBYTE) - 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 number of bytes read. | |||
; | |||
; | |||
; | |||
==Return Code== | ==Return Code== | ||
rc (USHORT) - return | rc (USHORT) - return | ||
Return code descriptions are: | Return code descriptions are: | ||
* 0 NO_ERROR | * 0 NO_ERROR | ||
* 11 ERROR_BAD_FORMAT | * 11 ERROR_BAD_FORMAT | ||
Line 76: | Line 64: | ||
* | * | ||
[[Category: | [[Category:Dos]] |
Revision as of 01:11, 27 February 2017
This call performs a write followed by a read on a duplex message pipe.
Syntax
DosTransactNmPipe (Handle, InBuffer, InBufferLen, OutBuffer, OutBufferLen, BytesOut)
Parameters
- Handle (HPIPE) - input
- Named pipe handle returned by DosMakeNmPipe or DosOpen.
- InBuffer (PBYTE) - input
- Address of the buffer to write to the pipe.
- InBufferLen (USHORT) - input
- Number of bytes to be written.
- OutBuffer (PBYTE) - 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 number of bytes read.
Return Code
rc (USHORT) - return
Return code descriptions are:
- 0 NO_ERROR
- 11 ERROR_BAD_FORMAT
- 230 ERROR_BAD_PIPE
- 231 ERROR_PIPE_BUSY
- 233 ERROR_PIPE_NOT_CONNECTED
- 234 ERROR_MORE_DATA
Remarks
DosTransactNmPipe is intended for use only on duplex message pipes. If this call is issued and the pipe is not a duplex message pipe, ERROR_BAD_FORMAT is returned.
This call enables you to implement transaction-oriented dialogs. DosTransactNmPipe writes the entire InBuffer to the pipe and then reads a response from the pipe into the OutBuffer. The current state of blocking/non-blocking has no effect. DosTransactNmPipe does not return until a message has been read into the OutBuffer. If the OutBuffer is too small to contain the response message, ERROR_MORE_DATA is returned, as described for DosRead.
Example Code
C Binding
#define INCL_DOSNMPIPES USHORT rc = DosTransactNmPipe(Handle, InBuffer, InBufferLen, OutBuffer, OutBufferLen, BytesOut); HPIPE Handle; /* Pipe handle */ PBYTE InBuffer; /* Write buffer */ USHORT InBufferLen; /* Write buffer length */ PBYTE OutBuffer; /* Read buffer (returned) */ USHORT OutBufferLen; /* Read buffer length */ PUSHORT BytesOut; /* Bytes read (returned) */ USHORT rc; /* return code */
MASM Binding
EXTRN DosTransactNmPipe:FAR INCL_DOSNMPIPES EQU 1 PUSH WORD Handle ;Pipe handle PUSH@ OTHER InBuffer ;Write buffer PUSH WORD InBufferLen ;Write buffer length PUSH@ OTHER OutBuffer ;Read buffer (returned) PUSH WORD OutBufferLen ;Read buffer length PUSH@ WORD BytesOut ;Bytes read (returned) CALL DosTransactNmPipe Returns WORD