Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

nt4/LoadUnload.c File Reference

Load and unload the driver. More...

#include <ntddk.h>
#include "cbm_driver.h"
#include <cbmioctl.h>

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
VOID DriverUnload (IN PDRIVER_OBJECT DriverObject)
 Unload routine of the driver.
NTSTATUS DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 Start routine of the driver.


Detailed Description

Load and unload the driver.

**************************************************************

Author:
Spiro Trikaliotis
Version:
Id
LoadUnload.c,v 1.31 2006/03/10 18:26:52 trikalio Exp


Definition in file nt4/LoadUnload.c.


Function Documentation

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.

Parameters:
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.
Todo:
Parameter is currently unused

Will be removed for WDM

Parameters:
ParallelPortName Pointer to the name of the parallel port to attach to
Returns:
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it returns one of the error status values.
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.

Todo:
Remove this

Definition at line 56 of file nt4/LoadUnload.c.

References AddDeviceCommonInit(), CBMDEVICENAME, 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.

Parameters:
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.
Returns:
If the routine succeeds, it must return STATUS_SUCCESS. Otherwise, it must return one of the error status values defined in ntstatus.h.
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 272 of file nt4/LoadUnload.c.

References AddDevice(), DBG_PREFIX, DBG_PRINT, DBG_SUCCESS, 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.

Parameters:
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 179 of file nt4/LoadUnload.c.

References cbm_stop_thread(), cbm_unlock_parport(), DBG_ASSERT, DriverCommonUninit(), FUNC_ENTER, FUNC_LEAVE, and ParPortDeinit().


Generated on Sun Apr 30 18:46:11 2006 for opencbm by  doxygen 1.4.2