DevHelp AttachDD

From EDM2
Jump to: navigation, search

This service returns the address of the inter-device-driver communication (IDC) entry point to a specified device.

Syntax

C

USHORT APIENTRY DevHelp_AttachDD (NPSZ DDName, NPBYTE DDTable)

Assembler

MOV   BX,OFFSET DS:ddname      ; Name of other device driver
MOV   DI,OFFSET DS:dd@         ; Data area to hold address
MOV   DL,DevHlp_AttachDD

CALL  [Device_Help]

Parameters

C

DDName(NPSZ) - input 
Name of the device driver
DDTable(NPBYTE) - output 
Data area to hold address

Assembler

MOV   BX,OFFSET DS:ddname      ; Name of other device driver
MOV   DI,OFFSET DS:dd@         ; Data area to hold address
MOV   DL,DevHlp_AttachDD

CALL  [Device_Help]

Return Code

C

Success Indicator: 0 - The data area is filled in.

Possible errors: This function does not return specific error code. The carry flag if set indicates either Device Driver Not Found or No IDC Entry Point.

Assembler

   'C' Clear if no error.
       The data area is filled in.

   'C' Set if error.
       AX = Error code.
            Possible errors:
               This function does not return specific error code.
               The carry flag if set indicates either Device Driver
               Not Found or No IDC Entry Point.

Remarks

The ddname field contains the ASCII name of the target device driver. If the target device driver is a character device driver, the ddname must match the name in the target device driver's device header.

The dd@ field must be 12 bytes in length. It has the following layout:

Description Length
Reserved WORD
Reserved WORD
Reserved WORD
Protect Mode Offset of IDC Entry Point WORD
Protect Mode CS Selector of IDC Entry Point WORD
Protect Mode DS of IDC Device Driver WORD

The IDC entry point contains a ring 0 selector. Loadable physical device drivers (physical device drivers loaded with DEVICE= statement) initialize at ring 3, and cannot call an IDC entry point from their INIT routine. Base device drivers initialize at ring 0 and can call an IDC entry point from their INIT routine. Any physical device driver can call an IDC entry point when called with the 1Fh strategy command.

Before the physical device driver calls the IDC entry point, the device driver must verify that the entry point it received is nonzero for the CPU mode that calls the IDC entry point. When calling the IDC entry point of the target device driver, the caller must set the DS register for the target device driver. Other registers used in the calling convention must be defined by the target device driver.

The IDC entry point of the target device driver must follow the Far Call/Return model.

Note
See Physical Device Driver Load Module Layout for more information.