Microsoft KB Archive/247251

{|
 * width="100%"|

DOC: CONFIGMG_Register_Device_Driver Flag Values

 * }

Q247251

-

The information in this article applies to:


 * Microsoft Windows 98 Driver Development Kit (DDK)

-

SUMMARY
The Windows 98 DDK doesn't document certain necessary flag values that Plug and Play drivers should use when they call the CONFIGMG_Register_Device_Driver function. On receipt of a PNP_NEW_DEVNODE message, Plug and Play drivers call the CONFIGMG_Register_Device_Driver function to register a configuration handler for a device node (devnode).

The fourth or final parameter that is passed to the CONFIGMG_Register_Device_Driver function contains the flags that Configuration Manager uses to determine the capabilities of the driver. New flag values were added for Microsoft Windows 98 to support added features and functionality.

MORE INFORMATION
Following is an amended documentation for the CONFIGMG_Register_Device_Driver function, which includes descriptions for the CM_REGISTER_DEVICE_DRIVER_SYNCHRONOUS, CM_REGISTER_DEVICE_DRIVER_ASYNCHRONOUS, and CM_REGISTER_DEVICE_DRIVER_ACPI_APM flags, all of which were added for Windows 98.

CONFIGMG_Register_Device_Driver
Registers a configuration handler for a device node.

CONFIGRET CONFIGMG_Register_Device_Driver( DEVNODE dnDevNode, CMCONFIGHANDLER Handler, ULONG ulRefData, ULONG ulFlags);

Parameters
dnDevNode

Handle of a device node. This handle may have been obtained by a call to the CONFIGMG_Locate_DevNode or CONFIGMG_Create_DevNode function. This handle is also passed in EBX on receipt of a PNP_NEW_DEVNODE directed system control message.

Handler

Device driver entry point. This routine handles all device driver configuration functions (for example, CONFIG_START and CONFIG_STOP). This parameter can be NULL if the device driver does not need to monitor configuration events.

ulRefData

Data that will be passed back to the Handler.

ulFlags

Must include either CM_REGISTER_DEVICE_DRIVER_STATIC or a combination of CM_REGISTER_DEVICE_DRIVER_DISABLEABLE and/or CM_REGISTER_DEVICE_DRIVER_REMOVABLE.

Include either CM_REGISTER_DEVICE_DRIVER_SYNCHRONOUS if the handler must be called synchronously, or CM_REGISTER_DEVICE_DRIVER_ASYNCHRONOUS if the handler can be called by Configuration Manager at a later time. Using CM_REGISTER_DEVICE_DRIVER_ASYNCHRONOUS can result in faster system start-up times because it may reduce the number of synchronous application-time callbacks required.

Specify CM_REGISTER_DEVICE_DRIVER_ACPI_APM in order to register the driver as power-management compliant. When Windows 98 runs a Suspend/Resume sequence, drivers that register with the CM_REGISTER_DEVICE_DRIVER_ACPI_APM flag will receive the appropriate CONFIG_APM_QUERY_Dx, CONFIG_APM_SET_Dx, and CONFIG_APM_RESUME_Dx messages, as listed in the Configmg.h file. Drivers that do not specify CM_REGISTER_DEVICE_DRIVER_ACPI_APM will be unloaded at Suspend time, and reloaded upon Resume.

Return Values
Returns CR_SUCCESS if the function is successful. Otherwise, the return value can be CR_INVALID_DEVNODE, CR_INVALID_FLAG, or CR_NOT_SYSTEM_VM.