DosMonOpen: Difference between revisions
Appearance
m Ak120 moved page OS2 API:CPI:LEGACY:DosMonOpen to DosMonOpen |
No edit summary |
||
Line 1: | Line 1: | ||
This call gains access to a character device data stream. | This call gains access to a character device data stream. | ||
Revision as of 18:58, 15 September 2017
This call gains access to a character device data stream.
Syntax
DosMonOpen (Devname, Handle)
Parameters
- Devname (PSZ) - input
- Address of the device name string.
- Handle (PHMONITOR) - output
- Address of the handle for the monitor. This value must be passed to DosMonReg to communicate with the device, and is passed to DosMonClose to close the connection to the monitor.
Return Code
rc (USHORT) - return
Return code descriptions are:
- 0 - NO_ERROR
- 110 - ERROR_OPEN_FAILED
- 379 - ERROR_MON_INVALID_PARMS
- 380 - ERROR_MON_INVALID_DEVNAME
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.
Only one DosMonOpen call is necessary per device per process. That is, several DosMonReg calls can be made using the same monitor handle to the same device. This allows monitors to be registered using different values for Index from the same process and going to the same device. When the DosMonClose is issued, all of the monitors registered on the handle is closed.
Example Code
C Binding
#define INCL_DOSMONITORS USHORT rc = DosMonOpen(Devname, Handle); PSZ Devname; /* Device name string */ PHMONITOR Handle; /* Monitor handle (returned) * USHORT rc; /* return code */
MASM Binding
EXTRN DosMonOpen:FAR INCL_DOSMONITORS EQU 1 PUSH@ ASCIIZ Devname ;Device name string PUSH@ WORD Handle ;Monitor handle (returned) CALL DosMonOpen Returns WORD