Jump to content

DosMonOpen: Difference between revisions

From EDM2
Created page with "==Description== This call gains access to a character device data stream. ==Syntax== <PRE> DosMonOpen (Devname, Handle) </PRE> ==Parameters== ; Devname (PSZ) - input : ..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
This call gains access to a character device data stream.
This call gains access to a character device data stream.
==Syntax==
==Syntax==
<PRE>
  DosMonOpen (Devname, Handle)
  DosMonOpen
 
    (Devname, Handle)
</PRE>


==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
 
*379 - ERROR_MON_INVALID_PARMS
* 0     NO_ERROR  
*380 - ERROR_MON_INVALID_DEVNAME
* 110       ERROR_OPEN_FAILED  
* 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===
<PRE>
EXTRN  DosMonOpen:FAR
INCL_DOSMONITORS    EQU 1


PUSH@  ASCIIZ  Devname      ;Device name string
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.
PUSH@  WORD    Handle        ;Monitor handle (returned)
CALL  DosMonOpen


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


==Related Functions==
===MASM===
*
<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:The OS/2 API Project]]
[[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