OpenCBM
|
Common functions für initialization the WDM and NT4 driver. More...
Go to the source code of this file.
Functions | |
VOID | cbm_init_registry (IN PUNICODE_STRING RegistryPath, IN PDEVICE_EXTENSION Pdx) |
Initialize from registry. More... | |
VOID | cbm_initialize_cable_deferred (IN PDEVICE_EXTENSION Pdx) |
Initialize the cable. More... | |
NTSTATUS | DriverCommonInit (IN PDRIVER_OBJECT Driverobject, IN PUNICODE_STRING RegistryPath) |
Perform driver initialization, common to WDM and NT4 driver. More... | |
VOID | DriverCommonUninit (VOID) |
Undo what DriverCommonInit() has done. More... | |
NTSTATUS | AddDeviceCommonInit (IN PDEVICE_OBJECT Fdo, IN PUNICODE_STRING DeviceName, IN PCWSTR ParallelPortName) |
Initialize device object, common to WDM and NT4 driver. More... | |
NTSTATUS AddDeviceCommonInit | ( | IN PDEVICE_OBJECT | Fdo, |
IN PUNICODE_STRING | DeviceName, | ||
IN PCWSTR | ParallelPortName | ||
) |
Initialize device object, common to WDM and NT4 driver.
This function initializes the device object, as done in AddDevice() of a WDM driver, or in DriverEntry() for an NT4 driver.
Fdo | Pointer to a DEVICE_OBJECT structure. This is the device object for the target device, previously created by the driver. |
DeviceName | Pointer to the name of the device. |
ParallelPortName | Pointer to the name of the parallel port driver which this device will use. |
This function performs the following steps:
1. Initialize the Pdx
2. Initialize the Queue inside of the Pdx
3. Initialize the operating mode of the Fdo (Buffered, Direct, Neither)
4. Get the information from the parallel port
5. Start the Worker Thread
6. Log either success or failure
Definition at line 402 of file libcommon/init.c.
References cbm_initialize_cable_deferred(), cbm_start_thread(), cbm_startio(), CbmGetNumberProcessors(), DBG_ERROR, DBG_PREFIX, FUNC_ENTER, LogErrorOnly, LogErrorString, ParPortInit(), and QueueInit().
Referenced by AddDevice().
VOID cbm_init_registry | ( | IN PUNICODE_STRING | RegistryPath, |
IN PDEVICE_EXTENSION | Pdx | ||
) |
Initialize from registry.
This function initializes some driver settings from the appropriate registry keys.
RegistryPath | Pointer to a UNICODE_STRING containing the name of the registry path from which to get the information. If this is NULL, this function uses the same registry path that was given the last time this function was called. |
Pdx | Pointer to the device extension of the device to be updated. |
The RegistryPath parameter can be NULL, but this is only allowed on a second or subsequent call.
Pdx can be NULL, too. If it is NULL, no device-specific data is read at all.
If RegistryPath is not NULL, some memory is allocated. This has to be freed by calling DriverCommonUninit().
Definition at line 55 of file libcommon/init.c.
References cbm_registry_close(), cbm_registry_open_for_read(), cbm_registry_read_ulong(), cbmiec_global_init(), cbmiec_set_cabletype(), DBG_ASSERT, DbgFlags, FUNC_ENTER, FUNC_LEAVE, and MTAG_SERVKEY.
Referenced by AddDevice(), cbm_execute_devicecontrol(), cbm_lock_parport(), and DriverCommonInit().
VOID cbm_initialize_cable_deferred | ( | IN PDEVICE_EXTENSION | Pdx | ) |
Initialize the cable.
This function initializes the cable. For this, it makes sure the initialization is started asynchronously.
Pdx | Pointer to the DEVICE_EXTENSION (unused). |
Definition at line 174 of file libcommon/init.c.
References FUNC_ENTER, and FUNC_LEAVE.
Referenced by AddDeviceCommonInit().
NTSTATUS DriverCommonInit | ( | IN PDRIVER_OBJECT | Driverobject, |
IN PUNICODE_STRING | RegistryPath | ||
) |
Perform driver initialization, common to WDM and NT4 driver.
This function is called from the DriverEntry() of either the WDM or the NT4 driver.
Driverobject | Pointer to the DRIVER_OBJECT structure given to DriverEntry(). |
RegistryPath | Pointer to a UNICODE_STRING containing the name of the registry path from which to get the information. |
Definition at line 315 of file libcommon/init.c.
References cbm_cleanup(), cbm_createopenclose(), cbm_devicecontrol(), cbm_init_registry(), cbm_readwrite(), DriverUnload(), FUNC_ENTER, and PERF_INIT.
Referenced by DriverEntry().
VOID DriverCommonUninit | ( | VOID | ) |
Undo what DriverCommonInit() has done.
This function is called from the DriverUnload() of either the WDM or the NT4 driver.
This function frees memory allocated by cbm_init_registry().
Definition at line 349 of file libcommon/init.c.
References DBGDO, FUNC_ENTER, FUNC_LEAVE, and PERF_SAVE.
Referenced by DriverUnload().