#include <ntddk.h>
#include <ndk/haltypes.h>
#include <ntddpar.h>
#include <stdio.h>
#include "hardware.h"
#include <debug.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 21 of file parport.h.
◆ FdoCleanup()
Definition at line 462 of file fdo.c.
464{
466
467 Irp->IoStatus.Information = 0;
470
472}
#define IoCompleteRequest
Referenced by DispatchCleanup().
◆ FdoClose()
Definition at line 442 of file fdo.c.
444{
446
448
451
452 Irp->IoStatus.Information = 0;
455
457}
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
_In_ PDEVICE_OBJECT DeviceObject
Referenced by DispatchClose().
◆ FdoCreate()
Definition at line 409 of file fdo.c.
411{
415
417
420
422 {
425 goto done;
426 }
427
428 DPRINT(
"Open parallel port %lu: successful\n", DeviceExtension->
PortNumber);
430
431done:
433 Irp->IoStatus.Information = 0;
435
437}
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 505 of file fdo.c.
507{
513
515
518
520 {
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
547 DPRINT(
"IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
548
549
552
554
556 {
559 {
561 Stack->Parameters.StartDevice.AllocatedResources,
562 Stack->Parameters.StartDevice.AllocatedResourcesTranslated);
563 }
564 }
565 break;
566
568 switch (
Stack->Parameters.QueryDeviceRelations.Type)
569 {
571 DPRINT(
"IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
576
578 DPRINT(
"IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
580
581 default:
582 DPRINT(
"IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
583 Stack->Parameters.QueryDeviceRelations.Type);
585 }
586 break;
587
589 DPRINT(
"IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
591
592 default:
595 }
596
600
602}
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 607 of file fdo.c.
609{
611
613
617 return PoCallDriver(LowerDevice,
Irp);
618}
#define IoSkipCurrentIrpStackLocation(Irp)
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Referenced by DispatchPower().
◆ FdoRead()
Definition at line 477 of file fdo.c.
479{
481
482 Irp->IoStatus.Information = 0;
486}
#define STATUS_NOT_SUPPORTED
Referenced by DispatchRead().
◆ FdoWrite()
◆ GetUserBuffer()
Definition at line 32 of file misc.c.
33{
35
37 return Irp->MdlAddress;
38 else
39 return Irp->AssociatedIrp.SystemBuffer;
40}
Referenced by PdoWrite().
◆ PdoCleanup()
◆ PdoClose()
Definition at line 47 of file pdo.c.
49{
51
53
56
57 Irp->IoStatus.Information = 0;
60
62}
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
Referenced by DispatchClose().
◆ PdoCreate()
Definition at line 14 of file pdo.c.
16{
20
22
25
27 {
30 goto done;
31 }
32
33 DPRINT(
"Open LPT%lu: successful\n", DeviceExtension->
LptPort);
35
36done:
38 Irp->IoStatus.Information = 0;
40
42}
Referenced by DispatchCreate().
◆ PdoPnp()
◆ PdoPower()
Definition at line 175 of file pdo.c.
177{
180
182
184
186 {
190 break;
191 }
192
197}
#define IRP_MN_QUERY_POWER
Referenced by DispatchPower().
◆ PdoRead()
◆ PdoWrite()
Definition at line 95 of file pdo.c.
97{
105
107
110
112
116
118 {
119 ulCount = 0;
120
121 do
122 {
125 ulCount++;
126 }
128
129 if (ulCount == 500000)
130 {
132
133 Irp->IoStatus.Information = 0;
136
138 }
139
140
142
144
146
148
150 }
151
152 Irp->IoStatus.Information = 0;
156}
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::@3974::@3979 Write
union _IO_STACK_LOCATION::@1575 Parameters
PDEVICE_OBJECT AttachedFdo
Referenced by DispatchWrite().
◆ AddDevice
DRIVER_ADD_DEVICE AddDevice |
◆ ForwardIrpAndForget