Jump to content

DosMonRead: Difference between revisions

From EDM2
Created page with "==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 monit..."
 
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
==Description==
==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.
==Syntax==
==Syntax==
<PRE>
  DosMonRead (BufferI, WaitFlag, DataBuffer, Bytecnt)
  DosMonRead
 
    (BufferI, WaitFlag, DataBuffer, Bytecnt)  
</PRE>


==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.
 
::1 - The monitor thread that issues DosMonRead does not wish to block when its input buffer is empty.
'''Value        Definition'''
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.
; 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:
Return code descriptions are:
* 0 - NO_ERROR
* 379 - ERROR_MON_INVALID_PARMS
* 382 - ERROR_MON_BUFFER_TOO_SMALL
* 383 - ERROR_MON_BUFFER_EMPTY


* 0          NO_ERROR
* 379        ERROR_MON_INVALID_PARMS
* 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==
==Example Code==
=== C Binding===
=== C Binding===
Line 60: Line 54:
</PRE>
</PRE>


==Related Functions==
[[Category:Dos]]
*
 
[[Category:The OS/2 API Project]]

Revision as of 16:15, 2 November 2016

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.

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.

Example Code

C Binding

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

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