OpenCBM
Functions
libcommon/openclose.c File Reference

Functions for opening and closing the driver. More...

#include <wdm.h>
#include "cbm_driver.h"
#include "iec.h"

Go to the source code of this file.

Functions

NTSTATUS cbm_createopenclose (IN PDEVICE_OBJECT Fdo, IN PIRP Irp)
 Services IRPs containing the IRP_MJ_CREATE or IRP_MJ_CLOSE I/O function code. More...
 
NTSTATUS cbm_execute_createopen (IN PDEVICE_EXTENSION Pdx, IN PIRP Irp)
 Execute IRPs containing the IRP_MJ_CREATEOPEN I/O function code. More...
 
NTSTATUS cbm_execute_close (IN PDEVICE_EXTENSION Pdx, IN PIRP Irp)
 Execute IRPs containing the IRP_MJ_CLOSE I/O function code. More...
 

Detailed Description

Functions for opening and closing the driver.



Author
Spiro Trikaliotis

Definition in file libcommon/openclose.c.

Function Documentation

NTSTATUS cbm_createopenclose ( IN PDEVICE_OBJECT  Fdo,
IN PIRP  Irp 
)

Services IRPs containing the IRP_MJ_CREATE or IRP_MJ_CLOSE I/O function code.

Services IRPs containing the IRP_MJ_CREATE or IRP_MJ_CLOSE I/O function code.

Parameters
FdoPointer to a DEVICE_OBJECT structure. This is the device object for the target device, previously created by the driver's AddDevice routine.
IrpPointer to an IRP structure that describes the requested I/O operation.
Returns
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it returns one of the error status values.

The driver's DriverEntry routine has stored this routine's address in DriverObject->MajorFunction[IRP_MJ_CREATE] and DriverObject->MajorFunction[IRP_MJ_CLOSE].

Generally, all Dispatch routines execute in an arbitrary thread context at IRQL PASSIVE_LEVEL, but there are exceptions.

Definition at line 47 of file libcommon/openclose.c.

References DBG_ERROR, DBG_IRPPATH_COMPLETE, DBG_IRPPATH_PROCESS, DBG_PREFIX, FUNC_ENTER, PERF_EVENT_CLOSE_QUEUE, PERF_EVENT_OPEN_QUEUE, QueueCompleteIrp(), and QueueStartPacket().

Referenced by DriverCommonInit().

NTSTATUS cbm_execute_close ( IN PDEVICE_EXTENSION  Pdx,
IN PIRP  Irp 
)

Execute IRPs containing the IRP_MJ_CLOSE I/O function code.

Executes IRPs containing the IRP_MJ_CLOSE I/O function code.

Parameters
PdxPointer to a DEVICE_EXTENSION structure.
IrpPointer to an IRP structure that describes the requested I/O operation.
Returns
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it returns one of the error status values.

Definition at line 180 of file libcommon/openclose.c.

References cbm_unlock_parport(), cbmiec_release_bus(), DBG_ASSERT, DBG_IRPPATH_COMPLETE, DBG_IRPPATH_PROCESS, FUNC_ENTER, PERF_EVENT_CLOSE_EXECUTE, and QueueCompleteIrp().

Referenced by cbm_startio().

NTSTATUS cbm_execute_createopen ( IN PDEVICE_EXTENSION  Pdx,
IN PIRP  Irp 
)

Execute IRPs containing the IRP_MJ_CREATEOPEN I/O function code.

Executes IRPs containing the IRP_MJ_CREATEOPEN I/O function code.

Parameters
PdxPointer to a DEVICE_EXTENSION structure.
IrpPointer to an IRP structure that describes the requested I/O operation.
Returns
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it returns one of the error status values.

Definition at line 117 of file libcommon/openclose.c.

References cbm_lock_parport(), cbm_unlock_parport(), cbmiec_is_cable_state_wrong(), cbmiec_reset(), DBG_ASSERT, DBG_IRPPATH_COMPLETE, DBG_IRPPATH_EXECUTE, DBG_PREFIX, DBG_PRINT, FUNC_ENTER, PERF_EVENT_OPEN_EXECUTE, and QueueCompleteIrp().

Referenced by cbm_startio().