Jump to content

DosMonRead: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
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.
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.


Line 6: Line 5:


==Parameters==
==Parameters==
;BufferI (PBYTE) - input : Address of the monitor input buffer.
;BufferI (PBYTE) - input: Address of the monitor input buffer.
;WaitFlag (UCHAR) - input : Valid values are:
;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.
::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.
::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.
;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.
;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==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
 
*0 - NO_ERROR
Return code descriptions are:
*379 - ERROR_MON_INVALID_PARMS
* 0 - NO_ERROR
*382 - ERROR_MON_BUFFER_TOO_SMALL
* 379 - ERROR_MON_INVALID_PARMS
*383 - ERROR_MON_BUFFER_EMPTY
* 382 - ERROR_MON_BUFFER_TOO_SMALL
* 383 - ERROR_MON_BUFFER_EMPTY


==Remarks==
==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.  
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''.
 
==Example Code==
=== C Binding===
<PRE>
#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 */
</PRE>
 
===MASM Binding===
<PRE>
EXTRN  DosMonRead:FAR
INCL_DOSMONITORS    EQU 1


PUSH@ OTHER   BufferI      ;Monitor input buffer
==Bindings==
PUSH   WORD    WaitFlag      ;Block/Run indicator
===C===
PUSH@ OTHER   DataBuffer    ;Buffer into which records are read
<code>
PUSH@ WORD    Bytecnt      ;Input/output parm-#bytes (returned)
  #define INCL_DOSMONITORS
CALL  DosMonRead
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 */
</code>


Returns WORD
===MASM===
</PRE>
<code>
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
</code>


[[Category:Dos]]
[[Category:Dos16]]

Latest revision as of 04:55, 26 January 2020

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