ReactOS  0.4.13-dev-259-g5ca9c9c
parport.h File Reference
#include <ntddk.h>
#include <ndk/haltypes.h>
#include <ntddpar.h>
#include <stdio.h>
#include "hardware.h"
#include <debug.h>
Include dependency graph for parport.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _COMMON_DEVICE_EXTENSION
 
struct  _FDO_DEVICE_EXTENSION
 
struct  _PDO_DEVICE_EXTENSION
 

Macros

#define PARPORT_TAG   'trpP'
 

Typedefs

typedef struct _COMMON_DEVICE_EXTENSION COMMON_DEVICE_EXTENSION
 
typedef struct _COMMON_DEVICE_EXTENSIONPCOMMON_DEVICE_EXTENSION
 
typedef struct _FDO_DEVICE_EXTENSION FDO_DEVICE_EXTENSION
 
typedef struct _FDO_DEVICE_EXTENSIONPFDO_DEVICE_EXTENSION
 
typedef struct _PDO_DEVICE_EXTENSION PDO_DEVICE_EXTENSION
 
typedef struct _PDO_DEVICE_EXTENSIONPPDO_DEVICE_EXTENSION
 

Enumerations

enum  DEVICE_STATE {
  dsStopped, dsStarted, dsPaused, dsRemoved,
  dsSurpriseRemoved, NotStarted = 0, Started, StopPending,
  Stopped, RemovePending, SurpriseRemovePending, Deleted,
  dsStopped, dsStarted, dsPaused, dsRemoved,
  dsSurpriseRemoved, dsStopped, dsStarted, dsPaused,
  dsRemoved, dsSurpriseRemoved
}
 

Functions

NTSTATUS NTAPI FdoCreate (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI FdoClose (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI FdoCleanup (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI FdoRead (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI FdoWrite (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI FdoPnp (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI FdoPower (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS ForwardIrpAndWait (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
PVOID GetUserBuffer (IN PIRP Irp)
 
NTSTATUS NTAPI PdoCreate (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI PdoClose (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI PdoCleanup (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI PdoRead (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI PdoWrite (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI PdoPnp (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI PdoPower (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 

Variables

DRIVER_ADD_DEVICE AddDevice
 
DRIVER_DISPATCH ForwardIrpAndForget
 

Macro Definition Documentation

◆ PARPORT_TAG

#define PARPORT_TAG   'trpP'

Definition at line 68 of file parport.h.

Typedef Documentation

◆ COMMON_DEVICE_EXTENSION

◆ FDO_DEVICE_EXTENSION

◆ PCOMMON_DEVICE_EXTENSION

◆ PDO_DEVICE_EXTENSION

◆ PFDO_DEVICE_EXTENSION

◆ PPDO_DEVICE_EXTENSION

Enumeration Type Documentation

◆ DEVICE_STATE

Enumerator
dsStopped 
dsStarted 
dsPaused 
dsRemoved 
dsSurpriseRemoved 
NotStarted 
Started 
StopPending 
Stopped 
RemovePending 
SurpriseRemovePending 
Deleted 
dsStopped 
dsStarted 
dsPaused 
dsRemoved 
dsSurpriseRemoved 
dsStopped 
dsStarted 
dsPaused 
dsRemoved 
dsSurpriseRemoved 

Definition at line 21 of file parport.h.

22 {
23  dsStopped,
24  dsStarted,
25  dsPaused,
26  dsRemoved,
28 } DEVICE_STATE;
DEVICE_STATE
Definition: parport.h:21

Function Documentation

◆ FdoCleanup()

NTSTATUS NTAPI FdoCleanup ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 462 of file fdo.c.

464 {
465  DPRINT("FdoCleanup()\n");
466 
467  Irp->IoStatus.Information = 0;
468  Irp->IoStatus.Status = STATUS_SUCCESS;
470 
471  return STATUS_SUCCESS;
472 }
_In_ PIRP Irp
Definition: csq.h:116
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
#define IO_NO_INCREMENT
Definition: iotypes.h:565
return STATUS_SUCCESS
Definition: btrfs.c:2745

Referenced by DispatchCleanup().

◆ FdoClose()

NTSTATUS NTAPI FdoClose ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 442 of file fdo.c.

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 }
_In_ PIRP Irp
Definition: csq.h:116
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define IO_NO_INCREMENT
Definition: iotypes.h:565
return STATUS_SUCCESS
Definition: btrfs.c:2745

Referenced by DispatchClose().

◆ FdoCreate()

NTSTATUS NTAPI FdoCreate ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 409 of file fdo.c.

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 }
_In_ PIRP Irp
Definition: csq.h:116
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
LONG NTSTATUS
Definition: precomp.h:26
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
#define STATUS_NOT_A_DIRECTORY
Definition: udferr_usr.h:169
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
if(!(yy_init))
Definition: macro.lex.yy.c:714
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define DPRINT1
Definition: precomp.h:8
#define IO_NO_INCREMENT
Definition: iotypes.h:565
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2771
return STATUS_SUCCESS
Definition: btrfs.c:2745
HRESULT Create([out]ITransactionReceiver **ppReceiver)

Referenced by DispatchCreate().

◆ FdoPnp()

NTSTATUS NTAPI FdoPnp ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 505 of file fdo.c.

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 }
static NTSTATUS FdoQueryBusRelations(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, PIO_STACK_LOCATION IrpSp)
Definition: fdo.c:337
NTSTATUS NTAPI ForwardIrpAndWait(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:32
_In_ PIRP Irp
Definition: csq.h:116
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
LONG NTSTATUS
Definition: precomp.h:26
uint32_t ULONG_PTR
Definition: typedefs.h:63
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IRP_MN_START_DEVICE
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
NTSTATUS NTAPI FdoStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PCM_RESOURCE_LIST ResourceList, IN PCM_RESOURCE_LIST ResourceListTranslated)
Definition: fdo.c:104
NTSTATUS NTAPI ForwardIrpAndForget(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: fdo.c:66
_In_ UCHAR MinorFunction
Definition: pofuncs.h:42
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define IRP_MN_QUERY_DEVICE_RELATIONS
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:565
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2771
Iosb Information
Definition: create.c:4377

Referenced by DispatchPnp().

◆ FdoPower()

NTSTATUS NTAPI FdoPower ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 600 of file fdo.c.

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 }
NTSTATUS NTAPI PoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: power.c:485
_In_ PIRP Irp
Definition: csq.h:116
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
PVOID DeviceExtension
Definition: env_spec_w32.h:418
void DPRINT(...)
Definition: polytest.cpp:61
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:626
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421

Referenced by DispatchPower().

◆ FdoRead()

NTSTATUS NTAPI FdoRead ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 477 of file fdo.c.

479 {
480  DPRINT("FdoRead()\n");
481 
482  Irp->IoStatus.Information = 0;
483  Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
485  return STATUS_NOT_SUPPORTED;
486 }
_In_ PIRP Irp
Definition: csq.h:116
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
#define IO_NO_INCREMENT
Definition: iotypes.h:565

Referenced by DispatchRead().

◆ FdoWrite()

NTSTATUS NTAPI FdoWrite ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 491 of file fdo.c.

493 {
494  DPRINT("FdoWrite()\n");
495 
496  Irp->IoStatus.Information = 0;
497  Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
499  return STATUS_NOT_SUPPORTED;
500 }
_In_ PIRP Irp
Definition: csq.h:116
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
#define IO_NO_INCREMENT
Definition: iotypes.h:565

Referenced by DispatchWrite().

◆ ForwardIrpAndWait()

NTSTATUS ForwardIrpAndWait ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 32 of file fdo.c.

35 {
36  KEVENT Event;
39  ASSERT(LowerDevice);
40 
43 
45 
46  Status = IoCallDriver(LowerDevice, Irp);
47  if (Status == STATUS_PENDING)
48  {
50  if (NT_SUCCESS(Status))
51  Status = Irp->IoStatus.Status;
52  }
53 
54  return Status;
55 }
#define TRUE
Definition: types.h:120
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:515
FORCEINLINE VOID IoCopyCurrentIrpStackLocationToNext(_Inout_ PIRP Irp)
Definition: iofuncs.h:2820
_In_ PVOID _In_ ULONG Event
Definition: iotypes.h:434
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static IO_COMPLETION_ROUTINE ForwardIrpAndWaitCompletion
Definition: fdo.c:17
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218

◆ GetUserBuffer()

PVOID GetUserBuffer ( IN PIRP  Irp)

Definition at line 76 of file misc.c.

77 {
78  ASSERT(Irp);
79 
80  if (Irp->MdlAddress)
81  return Irp->MdlAddress;
82  else
83  return Irp->AssociatedIrp.SystemBuffer;
84 }
_In_ PIRP Irp
Definition: csq.h:116
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

Referenced by PdoWrite().

◆ PdoCleanup()

NTSTATUS NTAPI PdoCleanup ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 67 of file pdo.c.

69 {
70  DPRINT("PdoCleanup()\n");
71 
72  Irp->IoStatus.Information = 0;
73  Irp->IoStatus.Status = STATUS_SUCCESS;
75  return STATUS_SUCCESS;
76 }
_In_ PIRP Irp
Definition: csq.h:116
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
#define IO_NO_INCREMENT
Definition: iotypes.h:565
return STATUS_SUCCESS
Definition: btrfs.c:2745

Referenced by DispatchCleanup().

◆ PdoClose()

NTSTATUS NTAPI PdoClose ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 47 of file pdo.c.

49 {
50  PPDO_DEVICE_EXTENSION pDeviceExtension;
51 
52  DPRINT("PdoClose()\n");
53 
55  pDeviceExtension->OpenCount--;
56 
57  Irp->IoStatus.Information = 0;
58  Irp->IoStatus.Status = STATUS_SUCCESS;
60 
61  return STATUS_SUCCESS;
62 }
_In_ PIRP Irp
Definition: csq.h:116
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define IO_NO_INCREMENT
Definition: iotypes.h:565
return STATUS_SUCCESS
Definition: btrfs.c:2745

Referenced by DispatchClose().

◆ PdoCreate()

NTSTATUS NTAPI PdoCreate ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 14 of file pdo.c.

16 {
17  PPDO_DEVICE_EXTENSION DeviceExtension;
18  PIO_STACK_LOCATION Stack;
20 
21  DPRINT("PdoCreate()\n");
22 
25 
26  if (Stack->Parameters.Create.Options & FILE_DIRECTORY_FILE)
27  {
28  DPRINT1("Not a directory\n");
30  goto done;
31  }
32 
33  DPRINT("Open LPT%lu: successful\n", DeviceExtension->LptPort);
34  DeviceExtension->OpenCount++;
35 
36 done:
37  Irp->IoStatus.Status = Status;
38  Irp->IoStatus.Information = 0;
40 
41  return Status;
42 }
_In_ PIRP Irp
Definition: csq.h:116
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
LONG NTSTATUS
Definition: precomp.h:26
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
#define STATUS_NOT_A_DIRECTORY
Definition: udferr_usr.h:169
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
if(!(yy_init))
Definition: macro.lex.yy.c:714
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define DPRINT1
Definition: precomp.h:8
#define IO_NO_INCREMENT
Definition: iotypes.h:565
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2771
return STATUS_SUCCESS
Definition: btrfs.c:2745
HRESULT Create([out]ITransactionReceiver **ppReceiver)

Referenced by DispatchCreate().

◆ PdoPnp()

NTSTATUS NTAPI PdoPnp ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 161 of file pdo.c.

163 {
165  DPRINT("PdoPnp()\n");
166 
167  Status = Irp->IoStatus.Status;
169  return Status;
170 }
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
Status
Definition: gdiplustypes.h:24
#define IO_NO_INCREMENT
Definition: iotypes.h:565

Referenced by DispatchPnp().

◆ PdoPower()

NTSTATUS NTAPI PdoPower ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 175 of file pdo.c.

177 {
179  PIO_STACK_LOCATION IoStack;
180 
181  DPRINT("PdoPower()\n");
182 
184 
185  switch (IoStack->MinorFunction)
186  {
187  case IRP_MN_SET_POWER:
188  case IRP_MN_QUERY_POWER:
189  Irp->IoStatus.Status = STATUS_SUCCESS;
190  break;
191  }
192 
193  Status = Irp->IoStatus.Status;
196  return Status;
197 }
#define IRP_MN_QUERY_POWER
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
#define IRP_MN_SET_POWER
Status
Definition: gdiplustypes.h:24
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:626
#define IO_NO_INCREMENT
Definition: iotypes.h:565
return STATUS_SUCCESS
Definition: btrfs.c:2745

Referenced by DispatchPower().

◆ PdoRead()

NTSTATUS NTAPI PdoRead ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 81 of file pdo.c.

83 {
84  DPRINT("PdoRead()\n");
85 
86  Irp->IoStatus.Information = 0;
87  Irp->IoStatus.Status = STATUS_SUCCESS;
89  return STATUS_SUCCESS;
90 }
_In_ PIRP Irp
Definition: csq.h:116
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
#define IO_NO_INCREMENT
Definition: iotypes.h:565
return STATUS_SUCCESS
Definition: btrfs.c:2745

Referenced by DispatchRead().

◆ PdoWrite()

NTSTATUS NTAPI PdoWrite ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 95 of file pdo.c.

97 {
98  PPDO_DEVICE_EXTENSION PdoDeviceExtension;
99  PFDO_DEVICE_EXTENSION FdoDeviceExtension;
100  PIO_STACK_LOCATION IoStack;
101  PUCHAR Buffer;
102  ULONG i;
104  ULONG ulCount;
105 
106  DPRINT("PdoWrite()\n");
107 
108  PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
109  FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)PdoDeviceExtension->AttachedFdo->DeviceExtension;
110 
112 
114  DPRINT("Length: %lu\n", IoStack->Parameters.Write.Length);
115  DPRINT("Buffer: %p\n", Buffer);
116 
117  for (i = 0; i < IoStack->Parameters.Write.Length; i++)
118  {
119  ulCount = 0;
120 
121  do
122  {
124  PortStatus = READ_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress + 1));
125  ulCount++;
126  }
127  while (ulCount < 500000 && !(PortStatus & LP_PBUSY));
128 
129  if (ulCount == 500000)
130  {
131  DPRINT("Timed out\n");
132 
133  Irp->IoStatus.Information = 0;
134  Irp->IoStatus.Status = STATUS_TIMEOUT;
136 
137  return STATUS_TIMEOUT;
138  }
139 
140  /* Write character */
141  WRITE_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress), Buffer[i]);
142 
144 
145  WRITE_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress + 2), (LP_PSELECP | LP_PINITP | LP_PSTROBE));
146 
148 
149  WRITE_PORT_UCHAR(UlongToPtr(FdoDeviceExtension->BaseAddress + 2), (LP_PSELECP | LP_PINITP));
150  }
151 
152  Irp->IoStatus.Information = 0;
153  Irp->IoStatus.Status = STATUS_SUCCESS;
155  return STATUS_SUCCESS;
156 }
_In_ PIRP Irp
Definition: csq.h:116
unsigned char * PUCHAR
Definition: retypes.h:3
UCHAR NTAPI READ_PORT_UCHAR(PUCHAR Address)
Definition: mach.c:535
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
#define STATUS_TIMEOUT
Definition: ntstatus.h:81
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 LP_PINITP
Definition: parallel.h:119
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
#define LP_PSELECP
Definition: parallel.h:118
Definition: bufpool.h:45
#define UlongToPtr(u)
Definition: config.h:106
PVOID GetUserBuffer(IN PIRP Irp)
Definition: misc.c:76
#define LP_PSTROBE
Definition: parallel.h:121
PDEVICE_OBJECT AttachedFdo
Definition: parport.h:59
unsigned char UCHAR
Definition: xmlstorage.h:181
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
Definition: hubbusif.h:40
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define LP_PBUSY
Definition: parallel.h:106
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:565
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:539
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2771
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2745
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:99

Referenced by DispatchWrite().

Variable Documentation

◆ AddDevice

DRIVER_ADD_DEVICE AddDevice

Definition at line 72 of file parport.h.

Referenced by add_volume_device(), and DriverEntry().

◆ ForwardIrpAndForget

DRIVER_DISPATCH ForwardIrpAndForget

Definition at line 116 of file parport.h.