Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
DosMonRead (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_DOSMONITORS
USHORT DosMonRead(pbInBuffer, fWait, pbDataBuf, pcbDataBuf)
PBYTE pbInBuffer; /* pointer to buffer for monitor input */
USHORT fWait; /* wait/no-wait flag */
PBYTE pbDataBuf; /* pointer to buffer for data records */
PUSHORT pcbDataBuf; /* pointer to variable with size of buffer */
The DosMonRead function reads data records from the device associated with
the specified monitor and copies the records to a buffer.
Parameter Description
────────────────────────────────────────────────────────────────────────────
pbInBuffer Points to the buffer for monitor input. This handle must have
been registered previously by using the DosMonReg function.
fWait Specifies whether the function should wait for input. If this
parameter is DCWW_WAIT, the function waits until input is ready.
If this parameter is DCWW_NOWAIT, no input is ready, and the
function returns immediately.
pbDataBuf Points to the buffer that receives the data records.
pcbDataBuf Points to a variable. When this function is called, the variable
specifies the size (in bytes) of the buffer that receives the
data records. When the function returns, this variable contains
the number of bytes copied from the data record to the buffer.
Return Value
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
ERROR_MON_BUFFER_EMPTY
ERROR_MON_BUFFER_TOO_SMALL
ERROR_MON_INVALID_PARMS
Comments
Device monitors must respond rapidly to avoid delaying input and output
(I/O). (This rapid response is especially important for keyboard monitors.)
A monitor process should be written so that any threads that read and write
the monitor data run at a high priority. These threads should never perform
operations that might delay them, such as waiting for I/O or a semaphore.
The monitor process can have other threads running at normal priority to
handle such operations.
See Also
DosMonClose, DosMonOpen, DosMonReg, DosMonWrite
♦