#include <ntddk.h>
#include <ndk/haltypes.h>
#include <ntddpar.h>
#include <stdio.h>
#include "hardware.h"
Go to the source code of this file.
|
| 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
} |
| |
|
| 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) |
| |
| 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) |
| |
◆ PARPORT_TAG
◆ COMMON_DEVICE_EXTENSION
◆ FDO_DEVICE_EXTENSION
◆ PCOMMON_DEVICE_EXTENSION
◆ PDO_DEVICE_EXTENSION
◆ PFDO_DEVICE_EXTENSION
◆ PPDO_DEVICE_EXTENSION
◆ 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 18 of file parport.h.
◆ FdoCleanup()
Definition at line 465 of file fdo.c.
467{
469
470 Irp->IoStatus.Information = 0;
473
475}
#define IoCompleteRequest
Referenced by DispatchCleanup().
◆ FdoClose()
Definition at line 445 of file fdo.c.
447{
449
451
454
455 Irp->IoStatus.Information = 0;
458
460}
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
_In_ PDEVICE_OBJECT DeviceObject
Referenced by DispatchClose().
◆ FdoCreate()
Definition at line 412 of file fdo.c.
414{
418
420
423
425 {
428 goto done;
429 }
430
431 DPRINT(
"Open parallel port %lu: successful\n", DeviceExtension->
PortNumber);
433
434done:
436 Irp->IoStatus.Information = 0;
438
440}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define FILE_DIRECTORY_FILE
#define STATUS_NOT_A_DIRECTORY
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Referenced by DispatchCreate().
◆ FdoPnp()
Definition at line 508 of file fdo.c.
510{
516
518
521
523 {
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
550 DPRINT(
"IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
551
552
555
557
559 {
562 {
564 Stack->Parameters.StartDevice.AllocatedResources,
565 Stack->Parameters.StartDevice.AllocatedResourcesTranslated);
566 }
567 }
568 break;
569
571 switch (
Stack->Parameters.QueryDeviceRelations.Type)
572 {
574 DPRINT(
"IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
579
581 DPRINT(
"IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
583
584 default:
585 DPRINT(
"IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
586 Stack->Parameters.QueryDeviceRelations.Type);
588 }
589 break;
590
592 DPRINT(
"IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
594
595 default:
598 }
599
603
605}
static NTSTATUS FdoStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
static NTSTATUS FdoQueryBusRelations(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, PIO_STACK_LOCATION IrpSp)
#define NT_SUCCESS(StatCode)
DRIVER_DISPATCH ForwardIrpAndForget
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define STATUS_UNSUCCESSFUL
_In_ UCHAR _In_ UCHAR MinorFunction
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
#define IRP_MN_START_DEVICE
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_DEVICE_RELATIONS
Referenced by DispatchPnp().
◆ FdoPower()
Definition at line 610 of file fdo.c.
612{
614
616
620 return PoCallDriver(LowerDevice,
Irp);
621}
#define IoSkipCurrentIrpStackLocation(Irp)
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Referenced by DispatchPower().
◆ FdoRead()
Definition at line 480 of file fdo.c.
482{
484
485 Irp->IoStatus.Information = 0;
489}
#define STATUS_NOT_SUPPORTED
Referenced by DispatchRead().
◆ FdoWrite()
◆ GetUserBuffer()
Definition at line 33 of file misc.c.
34{
36
38 return Irp->MdlAddress;
39 else
40 return Irp->AssociatedIrp.SystemBuffer;
41}
Referenced by PdoWrite().
◆ PdoCleanup()
◆ PdoClose()
Definition at line 49 of file pdo.c.
51{
53
55
58
59 Irp->IoStatus.Information = 0;
62
64}
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
Referenced by DispatchClose().
◆ PdoCreate()
Definition at line 16 of file pdo.c.
18{
22
24
27
29 {
32 goto done;
33 }
34
35 DPRINT(
"Open LPT%lu: successful\n", DeviceExtension->
LptPort);
37
38done:
40 Irp->IoStatus.Information = 0;
42
44}
Referenced by DispatchCreate().
◆ PdoPnp()
◆ PdoPower()
Definition at line 177 of file pdo.c.
179{
182
184
186
188 {
192 break;
193 }
194
199}
#define IRP_MN_QUERY_POWER
Referenced by DispatchPower().
◆ PdoRead()
◆ PdoWrite()
Definition at line 97 of file pdo.c.
99{
107
109
112
114
118
120 {
121 ulCount = 0;
122
123 do
124 {
127 ulCount++;
128 }
130
131 if (ulCount == 500000)
132 {
134
135 Irp->IoStatus.Information = 0;
138
140 }
141
142
144
146
148
150
152 }
153
154 Irp->IoStatus.Information = 0;
158}
PVOID GetUserBuffer(IN PIRP Irp)
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
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
#define KeStallExecutionProcessor(MicroSeconds)
#define READ_PORT_UCHAR(p)
#define WRITE_PORT_UCHAR(p, d)
struct _IO_STACK_LOCATION::@4278::@4283 Write
union _IO_STACK_LOCATION::@1694 Parameters
PDEVICE_OBJECT AttachedFdo
Referenced by DispatchWrite().
◆ AddDevice
| DRIVER_ADD_DEVICE AddDevice |
◆ ForwardIrpAndForget