HDRVR OpenDriver(lpDriverName, lpSectionName, lParam) | |||||
LPCSTR lpDriverName; | /* address of driver name | */ | |||
LPCSTR lpSectionName; | /* address of .INI file section name | */ | |||
LPARAM lParam; | /* address of driver-specific information | */ |
The OpenDriver function performs necessary initialization operations such as setting members in installable-driver structures to their default values.
lpDriverName
Points to a null-terminated string that specifies the name of an installable driver.
lpSectionName
Points to a null-terminated string that specifies the name of a section in the SYSTEM.INI file.
lParam
Specifies driver-specific information.
The return value is a handle of the installable driver, if the function is successful. Otherwise it is NULL.
The string to which lpDriverName points must be identical to the name of the installable driver as it appears in the SYSTEM.INI file.
If the name of the installable driver appears in the [driver] section of the SYSTEM.INI file, the string pointed to by lpSectionName should be NULL. Otherwise this string should specify the name of the section in SYSTEM.INI that contains the driver name.
When an application opens a driver for the first time, Windows calls the DriverProc function with the DRV_LOAD, DRV_ENABLE, and DRV_OPEN messages. When subsequent instances of the driver are opened, only DRV_OPEN is sent.
The value specified in the lParam parameter is passed to the lParam2 parameter of the DriverProc function.