The device driver commands are an interface used by a stream handler to communicate with a physical device driver. This interface uses the inter-device driver communication (IDC) mechanism provided by OS/2 AttachDD DevHelp. The stream handler must attach to the device driver using AttachDD DevHelp to receive the DDCMD entry point address of the device driver. This must be done prior to issuing any DDCMDs. Some device drivers also might require that a DosOpen call be used to open the device driver before it can be used through the AttachDD entry point.
The DDCMDs are provided through a single entry point, DDCMDEntryPoint, which accepts a parameter structure on input.
typedef ULONG (FAR*PSHDFN) (PVOID pParmIn); typedef ULONG (FAR*PDDCMDFN) (PVOID pParmIn);
For the Ring 3 DLL interface, all pointers are 0:32 linear; for Ring 0 stream handlers all pointers are 16:16 far pointers to enable the 16-bit device driver model to be used. The following list contains the message numbers for all DDCMDs. It should be used in the ulFunction field, of the parameter structure passed on the call, to indicate which function is being requested by the stream handler.
┌────────┬──────────────────────────┬──────────────────────────┐ │Message │Message │Description │ │Number │ │ │ ├────────┼──────────────────────────┼──────────────────────────┤ │4L │DDCMD_CONTROL │Performs a device-specific│ │ │ │command. │ ├────────┼──────────────────────────┼──────────────────────────┤ │6L │DDCMD_DEREG_STREAM │Removes a stream instance │ │ │ │from a device driver. │ ├────────┼──────────────────────────┼──────────────────────────┤ │1L │DDCMD_READ │Performs a read from the │ │ │ │device into a buffer. │ ├────────┼──────────────────────────┼──────────────────────────┤ │5L │DDCMD_REG_STREAM │Registers a stream │ │ │ │instance with a device │ │ │ │driver. │ ├────────┼──────────────────────────┼──────────────────────────┤ │0L │DDCMD_SETUP │Performs a device-specific│ │ │ │stream instance setup. │ ├────────┼──────────────────────────┼──────────────────────────┤ │3L │DDCMD_STATUS │Requests status from the │ │ │ │device. │ ├────────┼──────────────────────────┼──────────────────────────┤ │2L │DDCMD_WRITE │Performs a write from a │ │ │ │buffer to the device. │ └────────┴──────────────────────────┴──────────────────────────┘