Jump to content

DevHelp RegisterDeviceClass: Difference between revisions

From EDM2
Created page with "At initialization, the driver calls the DevHlp_RegisterDeviceClass to register its direct call command handler entry point with the kernel. ==Syntax== ===C=== <PRE> USHORT ..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
{{DISPLAYTITLE:DevHelp_RegisterDeviceClass}}
At initialization, the driver calls the DevHlp_RegisterDeviceClass to register its direct call command handler entry point with the kernel.  
At initialization, the driver calls the DevHlp_RegisterDeviceClass to register its direct call command handler entry point with the kernel.  


Line 42: Line 43:


==Return Code==
==Return Code==
===C===
===Assembler===
===Assembler===
<PRE>
<PRE>
Line 54: Line 52:
                 if table is full
                 if table is full
</PRE>
</PRE>
==Remarks==
==Example Code==
===C===
<PRE>
</PRE>
==Related Functions==


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

Latest revision as of 13:33, 2 January 2020

At initialization, the driver calls the DevHlp_RegisterDeviceClass to register its direct call command handler entry point with the kernel.

Syntax

C

 USHORT APIENTRY DevHlp_RegisterDeviceClass( NPSZ    DeviceString,
                                             PFN     DriverEP,
                                             USHORT DeviceFlags,
                                             USHORT  DeviceClass,
                                             PUSHORT DeviceHandle);

Assembler

LDS  SI, ADD_Name            ; DS:SI = Ptr device driver to ASCIIZ name
                             ;         maximum of 16 chars
MOV  AX,SEGMENT ADD_Function ; AX:BX = Ptr to driver's DirectCall
LEA  BX,ADD_Function         ;         Command Handler
MOV  DI,Device_Flags         ; Must be 0 for adapter device drivers
MOV  CX,Device_Class         ; Must be 1 for adapter device drivers
MOV  DL,DevHlp_RegisterADD
CALL [Device_Help]

Parameters

C

DeviceString(NPSZ)
ASCIIZ device driver name ( maximum 16 characters)
DriverEP (PFN)
Pointer to driver's direct call command handler.
DeviceFlags(USHORT)
DeviceClass specific flags (must be 0 for adapter device drivers)
DeviceClass(USHORT)
DeviceClass table number (must be 1 for adapter device drivers)
DeviceHandle(PUSHORT)
Returned Device Handle to the device driver

Assembler

LDS  SI, ADD_Name            ; DS:SI = Ptr device driver to ASCIIZ name
                             ;         maximum of 16 chars
MOV  AX,SEGMENT ADD_Function ; AX:BX = Ptr to driver's DirectCall
LEA  BX,ADD_Function         ;         Command Handler
MOV  DI,Device_Flags         ; Must be 0 for adapter device drivers
MOV  CX,Device_Class         ; Must be 1 for adapter device drivers

Return Code

Assembler

'C' Cleared if successful
AX = ADDHandle
'C' Set if error
AX = ERROR_NOT_ENOUGH_MEMORY
                 if CX out of range
                 if table is full