ReactOS  0.4.13-dev-698-g77671f0
fdo.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  * FILE: drivers/parallel/parport/fdo.c
5  * PURPOSE: FDO functions
6  */
7 
8 #include "parport.h"
9 
10 /* FUNCTIONS ****************************************************************/
11 
13 NTAPI
16  IN PULONG pLptPortNumber OPTIONAL,
18 {
19  PFDO_DEVICE_EXTENSION DeviceExtension = NULL;
20  PDEVICE_OBJECT Fdo = NULL;
21  WCHAR DeviceNameBuffer[32];
24 
25  DPRINT("AddDeviceInternal()\n");
26 
28  ASSERT(Pdo);
29 
30  /* Create new device object */
31  swprintf(DeviceNameBuffer,
32  L"\\Device\\ParallelPort%lu",
33  IoGetConfigurationInformation()->ParallelCount);
35  DeviceNameBuffer);
36 
38  sizeof(FDO_DEVICE_EXTENSION),
39  &DeviceName,
42  FALSE,
43  &Fdo);
44  if (!NT_SUCCESS(Status))
45  {
46  DPRINT1("IoCreateDevice() failed (Status 0x%08lx)\n", Status);
47  Fdo = NULL;
48  goto done;
49  }
50 
51  DeviceExtension = (PFDO_DEVICE_EXTENSION)Fdo->DeviceExtension;
52  RtlZeroMemory(DeviceExtension,
53  sizeof(FDO_DEVICE_EXTENSION));
54 
55  DeviceExtension->Common.IsFDO = TRUE;
56  DeviceExtension->Common.PnpState = dsStopped;
57 
59  DeviceExtension->Pdo = Pdo;
60 
62  Pdo,
63  &DeviceExtension->LowerDevice);
64  if (!NT_SUCCESS(Status))
65  {
66  DPRINT1("IoAttachDeviceToDeviceStackSafe() failed (Status 0x%08lx)\n", Status);
67  goto done;
68  }
69 
70  if (DeviceExtension->LowerDevice->Flags & DO_POWER_PAGABLE)
71  Fdo->Flags |= DO_POWER_PAGABLE;
72 
73  if (DeviceExtension->LowerDevice->Flags & DO_BUFFERED_IO)
74  Fdo->Flags |= DO_BUFFERED_IO;
75 
76  if (DeviceExtension->LowerDevice->Flags & DO_DIRECT_IO)
77  Fdo->Flags |= DO_DIRECT_IO;
78 
79  /* Choose default strategy */
80  if ((Fdo->Flags & (DO_BUFFERED_IO | DO_DIRECT_IO)) == 0)
81  Fdo->Flags |= DO_BUFFERED_IO;
82 
84 
85  if (pFdo)
86  {
87  *pFdo = Fdo;
88  }
89 
90  return STATUS_SUCCESS;
91 
92 done:
93  if (Fdo)
94  {
95  IoDeleteDevice(Fdo);
96  }
97 
98  return Status;
99 }
100 
101 
102 NTSTATUS
103 NTAPI
106  IN PCM_RESOURCE_LIST ResourceListTranslated)
107 {
108  PFDO_DEVICE_EXTENSION DeviceExtension;
109  ULONG i;
110 // ULONG Vector = 0;
111 // KIRQL Dirql = 0;
112 // KAFFINITY Affinity = 0;
113 // KINTERRUPT_MODE InterruptMode = Latched;
114 // BOOLEAN ShareInterrupt = TRUE;
115 
116  DPRINT("FdoStartDevice ()\n");
117 
119 
120  ASSERT(DeviceExtension);
121  ASSERT(DeviceExtension->Common.IsFDO == TRUE);
122 
123  if (!ResourceList)
124  {
125  DPRINT1("No allocated resources sent to driver\n");
127  }
128 
129  if (ResourceList->Count != 1)
130  {
131  DPRINT1("Wrong number of allocated resources sent to driver\n");
133  }
134 
135  if ((ResourceList->List[0].PartialResourceList.Version != 1) ||
136  (ResourceList->List[0].PartialResourceList.Revision != 1) ||
137  (ResourceListTranslated->List[0].PartialResourceList.Version != 1) ||
138  (ResourceListTranslated->List[0].PartialResourceList.Revision != 1))
139  {
140  DPRINT1("Revision mismatch: %u.%u != 1.1 or %u.%u != 1.1\n",
141  ResourceList->List[0].PartialResourceList.Version,
142  ResourceList->List[0].PartialResourceList.Revision,
143  ResourceListTranslated->List[0].PartialResourceList.Version,
144  ResourceListTranslated->List[0].PartialResourceList.Revision);
146  }
147 
148  DeviceExtension->BaseAddress = 0;
149 
150  for (i = 0; i < ResourceList->List[0].PartialResourceList.Count; i++)
151  {
152  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[i];
153  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptorTranslated = &ResourceListTranslated->List[0].PartialResourceList.PartialDescriptors[i];
154 
155  switch (PartialDescriptor->Type)
156  {
157  case CmResourceTypePort:
158  DPRINT("Port: BaseAddress 0x%lx Length %lu\n",
159  PartialDescriptor->u.Port.Start.u.LowPart,
160  PartialDescriptor->u.Port.Length);
161 
162  if (DeviceExtension->BaseAddress == 0)
163  {
164  if (PartialDescriptor->u.Port.Length < 4)
166 
167  DeviceExtension->BaseAddress = PartialDescriptor->u.Port.Start.u.LowPart;
168  }
169  break;
170 
172  DPRINT("Interrupt: Level %lu Vector %lu\n",
173  PartialDescriptorTranslated->u.Interrupt.Level,
174  PartialDescriptorTranslated->u.Interrupt.Vector);
175 
176 // Dirql = (KIRQL)PartialDescriptorTranslated->u.Interrupt.Level;
177 // Vector = PartialDescriptorTranslated->u.Interrupt.Vector;
178 // Affinity = PartialDescriptorTranslated->u.Interrupt.Affinity;
179 
180 // if (PartialDescriptorTranslated->Flags & CM_RESOURCE_INTERRUPT_LATCHED)
181 // InterruptMode = Latched;
182 // else
183 // InterruptMode = LevelSensitive;
184 
185 // ShareInterrupt = (PartialDescriptorTranslated->ShareDisposition == CmResourceShareShared);
186  break;
187 
188  default:
189  DPRINT1("Other resource: \n");
190  break;
191  }
192  }
193 
194  DPRINT("New LPT port: Base 0x%lx\n",
195  DeviceExtension->BaseAddress);
196 
197  if (!DeviceExtension->BaseAddress)
199 
200 #if 0
201  if (!Dirql)
203 #endif
204 
205  DeviceExtension->Common.PnpState = dsStarted;
206 
207 
208  /* We don't really care if the call succeeded or not... */
209 
210  return STATUS_SUCCESS;
211 }
212 
213 
214 static
215 NTSTATUS
218 {
219  PFDO_DEVICE_EXTENSION FdoDeviceExtension;
220  PPDO_DEVICE_EXTENSION PdoDeviceExtension = NULL;
222  WCHAR DeviceNameBuffer[32];
223  WCHAR LinkNameBuffer[32];
224  WCHAR LptPortBuffer[32];
226  UNICODE_STRING LinkName;
227  UNICODE_STRING LptPort;
232 
233  DPRINT("FdoCreateRawParallelPdo()\n");
234 
235  FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
236 
237  /* Create new device object */
238  swprintf(DeviceNameBuffer,
239  L"\\Device\\Parallel%lu",
240  FdoDeviceExtension->PortNumber);
242  DeviceNameBuffer);
243 
244  Status = IoCreateDevice(DeviceObject->DriverObject,
245  sizeof(PDO_DEVICE_EXTENSION),
246  &DeviceName,
248  0,
249  FALSE,
250  &Pdo);
251  if (!NT_SUCCESS(Status))
252  {
253  DPRINT1("IoCreateDevice() failed with status 0x%08x\n", Status);
254  goto done;
255  }
256 
259 
260  PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)Pdo->DeviceExtension;
261  RtlZeroMemory(PdoDeviceExtension, sizeof(PDO_DEVICE_EXTENSION));
262 
263  PdoDeviceExtension->Common.IsFDO = FALSE;
264  PdoDeviceExtension->Common.PnpState = dsStopped;
265 
267 
268  FdoDeviceExtension->AttachedRawPdo = Pdo;
269  PdoDeviceExtension->AttachedFdo = DeviceObject;
270 
271  PdoDeviceExtension->PortNumber = FdoDeviceExtension->PortNumber;
272  PdoDeviceExtension->LptPort = PdoDeviceExtension->PortNumber + 1;
273 
274 
275  /* Create link \DosDevices\LPTX -> \Device\ParallelY */
276  swprintf(LinkNameBuffer, L"\\DosDevices\\LPT%lu", PdoDeviceExtension->LptPort);
277  RtlInitUnicodeString(&LinkName, LinkNameBuffer);
278  Status = IoCreateSymbolicLink(&LinkName,
279  &DeviceName);
280  if (!NT_SUCCESS(Status))
281  {
282  DPRINT1("IoCreateSymbolicLink() failed with status 0x%08x\n", Status);
283  goto done;
284  }
285 
286  swprintf(LptPortBuffer, L"LPT%lu", PdoDeviceExtension->LptPort);
287  RtlInitUnicodeString(&LptPort, LptPortBuffer);
288 
289  /* Write an entry value under HKLM\HARDWARE\DeviceMap\PARALLEL PORTS. */
290  /* This step is not mandatory, so do not exit in case of error. */
292  L"\\Registry\\Machine\\HARDWARE\\DeviceMap\\PARALLEL PORTS");
294  &KeyName,
296  NULL,
297  NULL);
298 
299  Status = ZwCreateKey(&KeyHandle,
302  0,
303  NULL,
305  NULL);
306  if (NT_SUCCESS(Status))
307  {
308  /* Key = \Device\Parallelx, Value = LPTx */
309  ZwSetValueKey(KeyHandle,
310  &DeviceName,
311  0,
312  REG_SZ,
313  LptPortBuffer,
314  LptPort.Length + sizeof(WCHAR));
316  }
317 
320 
321 done:
322  if (!NT_SUCCESS(Status))
323  {
324  if (Pdo)
325  {
326  ASSERT(PdoDeviceExtension);
328  }
329  }
330 
331  return Status;
332 }
333 
334 
335 static
336 NTSTATUS
339  IN PIRP Irp,
341 {
342  PFDO_DEVICE_EXTENSION DeviceExtension;
343  PDEVICE_RELATIONS DeviceRelations;
344  ULONG Size;
345  ULONG i;
346  ULONG PdoCount = 0;
348 
350 
351  DPRINT("FdoQueryBusRelations()\n");
352 
354  ASSERT(DeviceExtension->Common.IsFDO);
355 
356  /* TODO: Enumerate parallel devices and create their PDOs */
357 
359  if (!NT_SUCCESS(Status))
360  return Status;
361 
362  PdoCount++;
363 
364  /* Allocate a buffer for the device relations */
365  Size = sizeof(DEVICE_RELATIONS) + sizeof(PDEVICE_OBJECT) * (PdoCount - 1);
366  DeviceRelations = ExAllocatePoolWithTag(PagedPool, Size, PARPORT_TAG);
367  if (DeviceRelations == NULL)
369 
370  /* Fill the buffer */
371  i = 0;
372  ObReferenceObject(DeviceExtension->AttachedRawPdo);
373  DeviceRelations->Objects[i] = DeviceExtension->AttachedRawPdo;
374  DeviceRelations->Count = 1;
375 
376  Irp->IoStatus.Information = (ULONG_PTR)DeviceRelations;
377 
378  DPRINT("Done\n");
379 
380  return STATUS_SUCCESS;
381 }
382 
383 
384 /* PUBLIC FUNCTIONS *********************************************************/
385 
386 NTSTATUS
387 NTAPI
390 {
391  DPRINT("AddDevice(%p %p)\n", DriverObject, Pdo);
392 
393  /* Serial.sys is a legacy driver. AddDevice is called once
394  * with a NULL Pdo just after the driver initialization.
395  * Detect this case and return success.
396  */
397  if (Pdo == NULL)
398  return STATUS_SUCCESS;
399 
400  /* We have here a PDO not null. It represents a real serial
401  * port. So call the internal AddDevice function.
402  */
404 }
405 
406 
407 NTSTATUS
408 NTAPI
410  IN PIRP Irp)
411 {
412  PFDO_DEVICE_EXTENSION DeviceExtension;
413  PIO_STACK_LOCATION Stack;
415 
416  DPRINT("FdoCreate()\n");
417 
420 
421  if (Stack->Parameters.Create.Options & FILE_DIRECTORY_FILE)
422  {
423  DPRINT1("Not a directory\n");
425  goto done;
426  }
427 
428  DPRINT("Open parallel port %lu: successful\n", DeviceExtension->PortNumber);
429  DeviceExtension->OpenCount++;
430 
431 done:
432  Irp->IoStatus.Status = Status;
433  Irp->IoStatus.Information = 0;
435 
436  return Status;
437 }
438 
439 
440 NTSTATUS
441 NTAPI
443  IN PIRP Irp)
444 {
445  PFDO_DEVICE_EXTENSION pDeviceExtension;
446 
447  DPRINT("FdoClose()\n");
448 
450  pDeviceExtension->OpenCount--;
451 
452  Irp->IoStatus.Information = 0;
453  Irp->IoStatus.Status = STATUS_SUCCESS;
455 
456  return STATUS_SUCCESS;
457 }
458 
459 
460 NTSTATUS
461 NTAPI
463  IN PIRP Irp)
464 {
465  DPRINT("FdoCleanup()\n");
466 
467  Irp->IoStatus.Information = 0;
468  Irp->IoStatus.Status = STATUS_SUCCESS;
470 
471  return STATUS_SUCCESS;
472 }
473 
474 
475 NTSTATUS
476 NTAPI
478  IN PIRP Irp)
479 {
480  DPRINT("FdoRead()\n");
481 
482  Irp->IoStatus.Information = 0;
483  Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
485  return STATUS_NOT_SUPPORTED;
486 }
487 
488 
489 NTSTATUS
490 NTAPI
492  IN PIRP Irp)
493 {
494  DPRINT("FdoWrite()\n");
495 
496  Irp->IoStatus.Information = 0;
497  Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
499  return STATUS_NOT_SUPPORTED;
500 }
501 
502 
503 NTSTATUS
504 NTAPI
506  IN PIRP Irp)
507 {
509  PIO_STACK_LOCATION Stack;
512 
513  DPRINT("FdoPnp()\n");
514 
516  MinorFunction = Stack->MinorFunction;
517 
518  switch (MinorFunction)
519  {
520  /* FIXME: do all these minor functions
521  IRP_MN_QUERY_REMOVE_DEVICE 0x1
522  IRP_MN_REMOVE_DEVICE 0x2
523  {
524  TRACE_(SERIAL, "IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n");
525  IoAcquireRemoveLock
526  IoReleaseRemoveLockAndWait
527  pass request to DeviceExtension-LowerDriver
528  disable interface
529  IoDeleteDevice(Fdo) and/or IoDetachDevice
530  break;
531  }
532  IRP_MN_CANCEL_REMOVE_DEVICE 0x3
533  IRP_MN_STOP_DEVICE 0x4
534  IRP_MN_QUERY_STOP_DEVICE 0x5
535  IRP_MN_CANCEL_STOP_DEVICE 0x6
536  IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations (optional) 0x7
537  IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations (optional) 0x7
538  IRP_MN_QUERY_INTERFACE (optional) 0x8
539  IRP_MN_QUERY_CAPABILITIES (optional) 0x9
540  IRP_MN_FILTER_RESOURCE_REQUIREMENTS (optional) 0xd
541  IRP_MN_QUERY_PNP_DEVICE_STATE (optional) 0x14
542  IRP_MN_DEVICE_USAGE_NOTIFICATION (required or optional) 0x16
543  IRP_MN_SURPRISE_REMOVAL 0x17
544  */
545  case IRP_MN_START_DEVICE: /* 0x0 */
546  DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
547 
549 
550  /* Call lower driver */
552  if (NT_SUCCESS(Status))
553  {
555  Stack->Parameters.StartDevice.AllocatedResources,
556  Stack->Parameters.StartDevice.AllocatedResourcesTranslated);
557  }
558  break;
559 
560  case IRP_MN_QUERY_DEVICE_RELATIONS: /* (optional) 0x7 */
561  switch (Stack->Parameters.QueryDeviceRelations.Type)
562  {
563  case BusRelations:
564  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
566  Irp->IoStatus.Status = Status;
568  return Status;
569 
570  case RemovalRelations:
571  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
573 
574  default:
575  DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
576  Stack->Parameters.QueryDeviceRelations.Type);
578  }
579  break;
580 
581  case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* (optional) 0xd */
582  DPRINT("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
584 
585  default:
586  DPRINT("Unknown minor function 0x%x\n", MinorFunction);
588  }
589 
590  Irp->IoStatus.Information = Information;
591  Irp->IoStatus.Status = Status;
593 
594  return Status;
595 }
596 
597 
598 NTSTATUS
599 NTAPI
601  IN PIRP Irp)
602 {
603  PDEVICE_OBJECT LowerDevice;
604 
605  DPRINT("FdoPower()\n");
606 
607  LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
610  return PoCallDriver(LowerDevice, Irp);
611 }
612 
613 /* EOF */
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
#define STATUS_REVISION_MISMATCH
Definition: ntstatus.h:311
#define DO_POWER_PAGABLE
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
static NTSTATUS FdoQueryBusRelations(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, PIO_STACK_LOCATION IrpSp)
Definition: fdo.c:337
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING KeyName
Definition: ndis.h:4711
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PDEVICE_OBJECT Pdo
Definition: classpnp.h:301
NTSTATUS NTAPI ForwardIrpAndWait(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:32
#define KEY_SET_VALUE
Definition: nt_native.h:1017
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@369::@371 Port
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4711
NTSTATUS NTAPI PoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: power.c:485
PCONFIGURATION_INFORMATION NTAPI IoGetConfigurationInformation(VOID)
Definition: iorsrce.c:830
_In_ PIRP Irp
Definition: csq.h:116
NTSTATUS NTAPI FdoPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:505
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
static NTSTATUS FdoCreateRawParallelPdo(IN PDEVICE_OBJECT DeviceObject)
Definition: fdo.c:216
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
PDEVICE_OBJECT Objects[1]
Definition: iotypes.h:2054
LONG NTSTATUS
Definition: precomp.h:26
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@369 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@369::@372 Interrupt
WCHAR DeviceName[]
Definition: adapter.cpp:21
const MUI_LANGUAGE_RESOURCE ResourceList[]
Definition: muilanguages.h:414
#define CmResourceTypePort
Definition: hwresource.cpp:123
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
uint32_t ULONG_PTR
Definition: typedefs.h:63
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
#define STATUS_NOT_A_DIRECTORY
Definition: udferr_usr.h:169
PDEVICE_OBJECT AttachedRawPdo
Definition: parport.h:43
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FILE_DEVICE_CONTROLLER
Definition: winioctl.h:109
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
#define DO_BUS_ENUMERATED_DEVICE
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
#define IoCompleteRequest
Definition: irp.c:1240
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:55
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS NTAPI AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT Pdo)
Definition: fdo.c:388
PDEVICE_OBJECT AttachedFdo
Definition: parport.h:59
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
NTSTATUS NTAPI IoAttachDeviceToDeviceStackSafe(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice, IN OUT PDEVICE_OBJECT *AttachedToDeviceObject)
Definition: device.c:980
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define DO_BUFFERED_IO
Definition: env_spec_w32.h:394
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define IRP_MN_START_DEVICE
#define FILE_DEVICE_PARALLEL_PORT
Definition: winioctl.h:127
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
NTSTATUS NTAPI FdoStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PCM_RESOURCE_LIST ResourceList, IN PCM_RESOURCE_LIST ResourceListTranslated)
Definition: fdo.c:104
static const WCHAR L[]
Definition: oid.c:1250
NTSTATUS NTAPI ForwardIrpAndForget(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:66
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
_In_ UCHAR MinorFunction
Definition: pofuncs.h:42
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:80
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI FdoClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:442
#define PARPORT_TAG
Definition: parport.h:68
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1250
struct _DEVICE_RELATIONS DEVICE_RELATIONS
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:626
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4157
unsigned int * PULONG
Definition: retypes.h:1
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
NTSTATUS NTAPI AddDeviceInternal(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT Pdo, IN PULONG pLptPortNumber OPTIONAL, OUT PDEVICE_OBJECT *pFdo OPTIONAL)
Definition: fdo.c:14
#define DPRINT1
Definition: precomp.h:8
NTSTATUS NTAPI FdoCreate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:409
#define OUT
Definition: typedefs.h:39
#define ObReferenceObject
Definition: obfuncs.h:204
PDEVICE_OBJECT Pdo
Definition: i8042prt.h:128
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
NTSTATUS NTAPI FdoRead(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:477
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:565
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ULONG_PTR
Definition: config.h:101
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
NTSTATUS NTAPI FdoWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:491
PDEVICE_OBJECT LowerDevice
Definition: i8042prt.h:130
#define REG_OPTION_VOLATILE
Definition: nt_native.h:1060
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2771
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
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
HRESULT Create([out]ITransactionReceiver **ppReceiver)
Iosb Information
Definition: create.c:4377
#define REG_SZ
Definition: layer.c:22
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68