ReactOS  0.4.14-dev-1007-g90d795b
parport.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: Parallel Port Function Driver
4  * PURPOSE: Parport driver loading/unloading
5  */
6 
7 #include "parport.h"
8 
9 static DRIVER_UNLOAD DriverUnload;
15 DRIVER_INITIALIZE DriverEntry;
16 
17 
18 /* FUNCTIONS ****************************************************************/
19 
20 static
21 VOID
22 NTAPI
24 {
25  DPRINT("Parport DriverUnload\n");
26 }
27 
28 
29 static
31 NTAPI
33  IN PIRP Irp)
34 {
36  return FdoCreate(DeviceObject, Irp);
37  else
38  return PdoCreate(DeviceObject, Irp);
39 }
40 
41 
42 static
44 NTAPI
46  IN PIRP Irp)
47 {
49  return FdoClose(DeviceObject, Irp);
50  else
51  return PdoClose(DeviceObject, Irp);
52 }
53 
54 
55 static
57 NTAPI
59  IN PIRP Irp)
60 {
62  return FdoCleanup(DeviceObject, Irp);
63  else
64  return PdoCleanup(DeviceObject, Irp);
65 }
66 
67 
68 static
70 NTAPI
72  IN PIRP Irp)
73 {
75  return FdoRead(DeviceObject, Irp);
76  else
77  return PdoRead(DeviceObject, Irp);
78 }
79 
80 
81 static
83 NTAPI
85  IN PIRP Irp)
86 {
88  return FdoWrite(DeviceObject, Irp);
89  else
90  return PdoWrite(DeviceObject, Irp);
91 }
92 
93 
94 static
96 NTAPI
98  IN PIRP Irp)
99 {
100  if (((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Common.IsFDO)
101  return FdoPnp(DeviceObject, Irp);
102  else
103  return PdoPnp(DeviceObject, Irp);
104 }
105 
106 
107 static
108 NTSTATUS
109 NTAPI
111  IN PIRP Irp)
112 {
113  if (((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Common.IsFDO)
114  return FdoPower(DeviceObject, Irp);
115  else
116  return PdoPower(DeviceObject, Irp);
117 }
118 
119 
120 NTSTATUS
121 NTAPI
123  IN PUNICODE_STRING RegPath)
124 {
125  ULONG i;
126 
127  DPRINT("Parport DriverEntry\n");
128 
131 
132  for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++)
134 
140 // DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DispatchDeviceControl;
141 // DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = DispatchQueryInformation;
144 
145  return STATUS_SUCCESS;
146 }
static DRIVER_DISPATCH DispatchCleanup
Definition: parport.c:12
#define IN
Definition: typedefs.h:39
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
static DRIVER_UNLOAD DriverUnload
Definition: parport.c:9
NTSTATUS NTAPI PdoWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: pdo.c:95
static DRIVER_DISPATCH DispatchPnp
Definition: parport.c:13
_In_ PIRP Irp
Definition: csq.h:116
NTSTATUS NTAPI FdoPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:505
DRIVER_ADD_DEVICE AddDevice
Definition: parport.h:72
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
DRIVER_DISPATCH ForwardIrpAndForget
Definition: i8042prt.h:341
#define IRP_MJ_MAXIMUM_FUNCTION
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI PdoClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: pdo.c:47
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
PDRIVER_EXTENSION DriverExtension
Definition: iotypes.h:2174
static NTSTATUS NTAPI DispatchRead(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: parport.c:71
PVOID DeviceExtension
Definition: env_spec_w32.h:418
static DRIVER_DISPATCH DispatchPower
Definition: parport.c:14
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS NTAPI PdoCleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: pdo.c:67
NTSTATUS NTAPI PdoCreate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: pdo.c:14
#define IRP_MJ_POWER
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
PDRIVER_UNLOAD DriverUnload
Definition: iotypes.h:2180
DRIVER_DISPATCH(nfs41_FsdDispatch)
static DRIVER_DISPATCH DispatchClose
Definition: parport.c:11
NTSTATUS NTAPI FdoClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:442
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
PDRIVER_ADD_DEVICE AddDevice
Definition: iotypes.h:2112
DRIVER_INITIALIZE DriverEntry
Definition: parport.c:15
static NTSTATUS NTAPI DispatchWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: parport.c:84
NTSTATUS NTAPI PdoRead(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: pdo.c:81
#define IRP_MJ_READ
Definition: rdpdr.c:46
NTSTATUS NTAPI FdoCreate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:409
#define IRP_MJ_CLEANUP
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2181
NTSTATUS NTAPI FdoRead(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:477
unsigned int ULONG
Definition: retypes.h:1
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
NTSTATUS NTAPI FdoWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:491
NTSTATUS NTAPI PdoPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: pdo.c:175
static DRIVER_DISPATCH DispatchCreate
Definition: parport.c:10
return STATUS_SUCCESS
Definition: btrfs.c:2938
NTSTATUS NTAPI FdoCleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:462
NTSTATUS NTAPI FdoPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:600
NTSTATUS NTAPI PdoPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: pdo.c:161