Jump to content

DosMonOpen: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:


==Parameters==
==Parameters==
; Devname (PSZ) - input : Address of the device name string.  
;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.
;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==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
 
*0 - NO_ERROR
Return code descriptions are:
*110 - ERROR_OPEN_FAILED
* 0 - NO_ERROR
*379 - ERROR_MON_INVALID_PARMS
* 110 - ERROR_OPEN_FAILED
*380 - ERROR_MON_INVALID_DEVNAME
* 379 - ERROR_MON_INVALID_PARMS
* 380 - ERROR_MON_INVALID_DEVNAME


==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''.
 
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===
<PRE>
#define INCL_DOSMONITORS
 
USHORT  rc = DosMonOpen(Devname, Handle);
 
PSZ              Devname;      /* Device name string */
PHMONITOR        Handle;        /* Monitor handle (returned) *
 
USHORT          rc;            /* return code */
</PRE>


===MASM Binding===
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.
<PRE>
EXTRN  DosMonOpen:FAR
INCL_DOSMONITORS    EQU 1


PUSH@ ASCIIZ Devname      ;Device name string
==Bindings==
PUSH@ WORD    Handle        ;Monitor handle (returned)
===C===
CALL  DosMonOpen
<code>
  #define INCL_DOSMONITORS
USHORT    rc = DosMonOpen(Devname, Handle);
  PSZ        Devname;       /* Device name string */
  PHMONITOR  Handle;       /* Monitor handle (returned) */
USHORT    rc;            /* return code */
</code>


Returns WORD
===MASM===
</PRE>
<code>
EXTRN  DosMonOpen:FAR
INCL_DOSMONITORS    EQU 1
PUSH@  ASCIIZ  Devname    ;Device name string
PUSH@  WORD    Handle    ;Monitor handle (returned)
CALL  DosMonOpen
Returns WORD
</code>


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

Latest revision as of 04:54, 26 January 2020

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.

Bindings

C

#define INCL_DOSMONITORS

USHORT     rc = DosMonOpen(Devname, Handle);
PSZ        Devname;       /* Device name string */
PHMONITOR  Handle;        /* Monitor handle (returned) */

USHORT     rc;            /* return code */

MASM

EXTRN  DosMonOpen:FAR
INCL_DOSMONITORS    EQU 1

PUSH@  ASCIIZ  Devname    ;Device name string
PUSH@  WORD    Handle     ;Monitor handle (returned)
CALL   DosMonOpen

Returns WORD