OpenCBM
|
Load and unload the driver. More...
Go to the source code of this file.
Functions | |
NTSTATUS | AddDevice (IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PdoUNUSED, IN PCWSTR ParallelPortName) |
create functional device object (FDO) for enumerated device More... | |
VOID | DriverUnload (IN PDRIVER_OBJECT DriverObject) |
Unload routine of the driver. More... | |
NTSTATUS | DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) |
Start routine of the driver. More... | |
NTSTATUS AddDevice | ( | IN PDRIVER_OBJECT | DriverObject, |
IN PDEVICE_OBJECT | PdoUNUSED, | ||
IN PCWSTR | ParallelPortName | ||
) |
create functional device object (FDO) for enumerated device
AddDevice is responsible for creating functional device objects (FDO) or filter device objects (filter DO) for devices enumerated by the Plug and Play (PnP) Manager.
DriverObject | Pointer to a DRIVER_OBJECT structure. This is the driver's driver object. |
PdoUNUSED | Pointer to a DEVICE_OBJECT structure representing a physical device object (PDO) created by a lower-level driver. |
ParallelPortName | Pointer to the name of the parallel port to attach to |
A driver's AddDevice routine executes in a system thread context at IRQL PASSIVE_LEVEL.
As long as we are an NT4 style device driver, AddDevice is not automatically called by the system as we don't have an INF file. Thus, it is called from our DriverEntry by ourself.
Definition at line 53 of file wdm/LoadUnload.c.
References AddDeviceCommonInit(), cbm_init_registry(), DBG_ERROR, DBG_PREFIX, DebugNtStatus(), FUNC_ENTER, LogErrorString, and MTAG_DEVNAME.
Referenced by DriverEntry().
NTSTATUS DriverEntry | ( | IN PDRIVER_OBJECT | DriverObject, |
IN PUNICODE_STRING | RegistryPath | ||
) |
Start routine of the driver.
DriverEntry is the first routine called after a driver is loaded, and it is responsible for initializing the driver.
DriverObject | Caller-supplied pointer to a DRIVER_OBJECT structure. This is the driver's driver object. |
RegistryPath | Pointer to a counted Unicode string specifying the path to the driver's registry key. |
The DriverObject parameter supplies the DriverEntry routine with a pointer to the driver's driver object, which is allocated by the I/O Manager. The DriverEntry routine must fill in the driver object with entry points for the driver's standard routines.
Definition at line 295 of file wdm/LoadUnload.c.
References AddDevice(), DBG_PREFIX, DBG_PRINT, DBG_SUCCESS, DbgAllocateMemoryBuffer(), DriverCommonInit(), FUNC_ENTER, ParPortEnumerate(), ParPortEnumerateClose(), and ParPortEnumerateOpen().
VOID DriverUnload | ( | IN PDRIVER_OBJECT | DriverObject | ) |
Unload routine of the driver.
DriverUnload performs any operations that are necessary before the system unloads the driver.
DriverObject | Caller-supplied pointer to a DRIVER_OBJECT structure. This is the driver's driver object. |
A driver's Unload routine executes in a system thread context at IRQL PASSIVE_LEVEL. The driver's DriverEntry routine must store the Unload routine's address in DriverObject->DriverUnload. (If no routine is supplied, this pointer must be NULL.)
Definition at line 202 of file wdm/LoadUnload.c.
References cbm_stop_thread(), cbm_unlock_parport(), DBG_ASSERT, DbgFreeMemoryBuffer(), DriverCommonUninit(), FUNC_ENTER, FUNC_LEAVE, and ParPortDeinit().
Referenced by DriverCommonInit().