DosMonRead
From EDM2
This call waits for and moves a data record from the input buffer of a registered character device monitor and places it in a private data area where the monitor can freely access it.
Syntax
DosMonRead (BufferI, WaitFlag, DataBuffer, Bytecnt)
Parameters
- BufferI (PBYTE) - input
- Address of the monitor input buffer.
- WaitFlag (UCHAR) - input
- Valid values are:
- 0 - The monitor thread that issues DosMonRead wishes to block until a data record is available in its input buffer.
- 1 - The monitor thread that issues DosMonRead does not wish to block when its input buffer is empty.
- DataBuffer (PBYTE) - input
- Address of the buffer in the calling process address space that the data from the monitor's input buffer is read into. The length of DataBuffer must be the entry value of Bytecnt.
- Bytecnt (PUSHORT) - input/output
- Address of the length of DataBuffer, on entry to DosMonRead. On the return from DosMonRead, Bytecnt specifies the number of bytes of data moved.
Return Code
- rc (USHORT) - return
- Return code descriptions are:
- 0 - NO_ERROR
- 379 - ERROR_MON_INVALID_PARMS
- 382 - ERROR_MON_BUFFER_TOO_SMALL
- 383 - ERROR_MON_BUFFER_EMPTY
Remarks
For a detailed description of this call see the chapter "Character Device Monitors" in the IBM Operating System/2 Version 1.2 I/O Subsystems And Device Support Volume 1.
Bindings
C
#define INCL_DOSMONITORS USHORT rc = DosMonRead(BufferI, WaitFlag, DataBuffer, Bytecnt); PBYTE BufferI; /* Monitor input buffer */ UCHAR WaitFlag; /* Block/Run indicator */ PBYTE DataBuffer; /* Buffer into which records are read */ PUSHORT Bytecnt; /* Input/output parm-#bytes (returned) */ USHORT rc; /* return code */
MASM
EXTRN DosMonRead:FAR INCL_DOSMONITORS EQU 1 PUSH@ OTHER BufferI ;Monitor input buffer PUSH WORD WaitFlag ;Block/Run indicator PUSH@ OTHER DataBuffer ;Buffer into which records are read PUSH@ WORD Bytecnt ;Input/output parm-#bytes (returned) CALL DosMonRead Returns WORD