Jump to content

DevHelp Register: Difference between revisions

From EDM2
Created page with "This service adds a monitor to the chain of monitors for a class of device. ==Syntax== ===C=== <PRE> USHORT APIENTRY DevHelp_Register(USHORT MonitorHandle, ..."
 
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
This service adds a monitor to the chain of monitors for a class of device.  
{{DISPLAYTITLE:DevHelp_Register}}
This service adds a monitor to the chain of monitors for a class of device.


==Syntax==
==Syntax==
Line 69: Line 70:


The physical device driver must identify the monitor chain with the monitor handle returned from a previous MonitorCreate call. The physical device driver can determine the Process ID of the requesting monitor task from the Local InfoSeg. See GetDOSVar.
The physical device driver must identify the monitor chain with the monitor handle returned from a previous MonitorCreate call. The physical device driver can determine the Process ID of the requesting monitor task from the Local InfoSeg. See GetDOSVar.


==Example Code==
==Example Code==
Line 85: Line 84:
                                 USHORT  ChainFlag);
                                 USHORT  ChainFlag);
</PRE>
</PRE>
==Related Functions==


[[Category:DevHlps]]
[[Category:DevHlps]]

Revision as of 13:31, 2 January 2020

This service adds a monitor to the chain of monitors for a class of device.

Syntax

C

USHORT APIENTRY DevHelp_Register(USHORT  MonitorHandle,
                                 USHORT  MonitorPID,
                                 PBYTE   InputBuffer,
                                 NPBYTE  OutputBuffer,
                                 USHORT  ChainFlag);

Assembler

LES   SI,input_buffer          ; Address of input buffer
MOV   DI,output_buffer_offset  ; Offset of output buffer
MOV   CX,monitor_PID           ; Process ID of monitor task
MOV   AX,monitor_handle        ; Handle for chain returned from previous
                                    MonitorCreate call
MOV   DH,placement_flag        ; High or Low place in chain
MOV   DL,DevHlp_Register

CALL  [Device_Help]

Parameters

C

MonitorHandle (USHORT)
input - from MonCreate
MonitorPID (USHORT)
input - Process Id retrieved by way of GetDosvar
InputBuffer (PBYTE)
input - Far pointer to Mon in buffer
OutputBuffer (NPBYTE)
input - Near pointer to Mon out buffer
ChainFlag (USHORT)
input - Chain placement (high or low in chain)

Assembler

LES   SI,input_buffer          ; Address of input buffer
MOV   DI,output_buffer_offset  ; Offset of output buffer
MOV   CX,monitor_PID           ; Process ID of monitor task
MOV   AX,monitor_handle        ; Handle for chain returned from previous
                                    MonitorCreate call
MOV   DH,placement_flag        ; High or Low place in chain

Return Code

C

Success indicator: 0

Possible errors:

              ERROR_MON_INVALID_HANDLE (381)
              ERROR_NOT_ENOUGH_MEMORY  (8)
              ERROR_MON_INVALID_PARMS  (379)

Assembler

   'C' Clear if successful.

   'C' Set if error.
       AX = Error code.
            Possible errors:
               ERROR_MON_INVALID_HANDLE    (381)
               ERROR_INVALID_PARAMETER     (87)
               ERROR_NOT_ENOUGH_MEMORY     (8)

Remarks

This function can be called only at task time in the OS/2 mode. If this function is called in a DOS session context, an invalid parameter error is returned to the physical device driver.

A monitor chain must have previously been created with MonitorCreate. A single process can register more than one monitor (with different input and output buffers) with the same monitor chain. The first WORD of each of the input and output buffers must contain the length in bytes (length WORD inclusive) of the buffers. The length of the input and output buffers of the monitor must be greater than the length of the monitor chain buffer of the physical device driver plus 20 bytes. The input buffer, output buffer offset, and placement flag are supplied to the physical device driver by the monitor application that is requesting monitor registration (that is, calling DosMonReg).

The physical device driver must identify the monitor chain with the monitor handle returned from a previous MonitorCreate call. The physical device driver can determine the Process ID of the requesting monitor task from the Local InfoSeg. See GetDOSVar.

Example Code

C

#include  "dhcalls.h"
#define   CHAIN_AT_TOP    0
#define   CHAIN_AT_BOTTOM 1

USHORT APIENTRY DevHelp_Register(USHORT  MonitorHandle,
                                 USHORT  MonitorPID,
                                 PBYTE   InputBuffer,
                                 NPBYTE  OutputBuffer,
                                 USHORT  ChainFlag);