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

ioctl.c File Reference

Perform an IOCTL. More...

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

Go to the source code of this file.

Defines

#define INPUTVALUE(_ttt_)   ((_ttt_ *) Irp->AssociatedIrp.SystemBuffer)
#define OUTPUTVALUE(_ttt_)   ((_ttt_ *) Irp->AssociatedIrp.SystemBuffer)

Functions

NTSTATUS cbm_devicecontrol (IN PDEVICE_OBJECT Fdo, IN PIRP Irp)
 Services IOCTLs.
NTSTATUS cbm_execute_devicecontrol (IN PDEVICE_EXTENSION Pdx, IN PIRP Irp)
 Executes IOCTLs.


Detailed Description

Perform an IOCTL.

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

Author:
Spiro Trikaliotis
Version:
Id
ioctl.c,v 1.35 2006/03/26 14:19:41 trikalio Exp


Definition in file ioctl.c.


Define Documentation

#define INPUTVALUE _ttt_   )     ((_ttt_ *) Irp->AssociatedIrp.SystemBuffer)
 

This translates the inputbuffer in the corresponding value to be used for giving as parameter

Definition at line 315 of file ioctl.c.

Referenced by cbm_execute_devicecontrol().

#define OUTPUTVALUE _ttt_   )     ((_ttt_ *) Irp->AssociatedIrp.SystemBuffer)
 

This translates the outputbuffer in the corresponding value to be used for giving as parameter

Definition at line 320 of file ioctl.c.

Referenced by cbm_execute_devicecontrol().


Function Documentation

NTSTATUS cbm_devicecontrol IN PDEVICE_OBJECT  Fdo,
IN PIRP  Irp
 

Services IOCTLs.

Services IRPs containing the IRP_MJ_DEVICE_CONTROL I/O function code.

Parameters:
Fdo Pointer to a DEVICE_OBJECT structure. This is the device object for the target device, previously created by the driver's AddDevice routine.
Irp Pointer to an IRP structure that describes the requested I/O operation.
Returns:
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it return one of the error status values:
STATUS_SUCCESS - Success.
STATUS_PENDING - Request pending.
STATUS_BUFFER_TOO_SMALL - Buffer too small.
STATUS_INVALID_PARAMETER - Invalid io control request.
The driver's DriverEntry routine stored this routine's address in DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL].

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

Definition at line 115 of file ioctl.c.

References CBMCTRL_CLEAR_EOI, CBMCTRL_CLOSE, CBMCTRL_GET_EOI, CBMCTRL_I_INSTALL, CBMCTRL_IEC_POLL, CBMCTRL_IEC_RELEASE, CBMCTRL_IEC_SET, CBMCTRL_IEC_SETRELEASE, CBMCTRL_IEC_WAIT, CBMCTRL_LISTEN, CBMCTRL_OPEN, CBMCTRL_PARBURST_READ, CBMCTRL_PARBURST_READ_TRACK, CBMCTRL_PARBURST_WRITE, CBMCTRL_PARBURST_WRITE_TRACK, CBMCTRL_PARPORT_LOCK, CBMCTRL_PARPORT_UNLOCK, CBMCTRL_PP_READ, CBMCTRL_PP_WRITE, CBMCTRL_RESET, CBMCTRL_TALK, CBMCTRL_UNLISTEN, CBMCTRL_UNTALK, CBMCTRL_UPDATE, DBG_ERROR, DBG_IRPPATH_PROCESS, DBG_PREFIX, FUNC_ENTER, PERF_EVENT_IOCTL_QUEUE, QueueCompleteIrp(), and QueueStartPacket().

Referenced by DriverCommonInit().

NTSTATUS cbm_execute_devicecontrol IN PDEVICE_EXTENSION  Pdx,
IN PIRP  Irp
 

Executes IOCTLs.

Executes IRPs containing the IRP_MJ_DEVICE_CONTROL I/O function code.

Parameters:
Pdx Pointer to the DEVICE_EXTENSION structure.
Irp Pointer to an IRP structure that describes the requested I/O operation.
Returns:
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it return one of the error status values:
STATUS_SUCCESS - Success.
STATUS_BUFFER_TOO_SMALL - Buffer too small.
This function does not perform any validity checks on the input and output buffer! This should already been done in cbm_devicecontrol.

Definition at line 342 of file ioctl.c.

References cbm_init_registry(), cbm_install(), cbm_lock(), cbm_unlock(), CBMCTRL_CLEAR_EOI, CBMCTRL_CLOSE, CBMCTRL_GET_EOI, CBMCTRL_I_INSTALL, CBMCTRL_IEC_POLL, CBMCTRL_IEC_RELEASE, CBMCTRL_IEC_SET, CBMCTRL_IEC_SETRELEASE, CBMCTRL_IEC_WAIT, CBMCTRL_LISTEN, CBMCTRL_OPEN, CBMCTRL_PARBURST_READ, CBMCTRL_PARBURST_READ_TRACK, CBMCTRL_PARBURST_WRITE, CBMCTRL_PARBURST_WRITE_TRACK, CBMCTRL_PARPORT_LOCK, CBMCTRL_PARPORT_UNLOCK, CBMCTRL_PP_READ, CBMCTRL_PP_WRITE, CBMCTRL_RESET, CBMCTRL_TALK, CBMCTRL_UNLISTEN, CBMCTRL_UNTALK, CBMCTRL_UPDATE, cbmiec_clear_eoi(), cbmiec_close(), cbmiec_get_eoi(), cbmiec_iec_poll(), cbmiec_iec_release(), cbmiec_iec_set(), cbmiec_iec_setrelease(), cbmiec_iec_wait(), cbmiec_listen(), cbmiec_open(), cbmiec_pp_read(), cbmiec_pp_write(), cbmiec_reset(), cbmiec_talk(), cbmiec_unlisten(), cbmiec_untalk(), DBG_ASSERT, DBG_ERROR, DBG_IRPPATH_COMPLETE, DBG_IRPPATH_EXECUTE, DBG_PREFIX, FUNC_ENTER, INPUTVALUE, OUTPUTVALUE, PERF_EVENT_IOCTL_EXECUTE, and QueueCompleteIrp().

Referenced by cbm_startio().


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