21 WCHAR DeviceNameBuffer[32];
25 DPRINT(
"AddDeviceInternal()\n");
32 L"\\Device\\ParallelPort%lu",
46 DPRINT1(
"IoCreateDevice() failed (Status 0x%08lx)\n",
Status);
59 DeviceExtension->
Pdo =
Pdo;
66 DPRINT1(
"IoAttachDeviceToDeviceStackSafe() failed (Status 0x%08lx)\n",
Status);
83 Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
116 DPRINT(
"FdoStartDevice ()\n");
125 DPRINT1(
"No allocated resources sent to driver\n");
131 DPRINT1(
"Wrong number of allocated resources sent to driver\n");
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))
140 DPRINT1(
"Revision mismatch: %u.%u != 1.1 or %u.%u != 1.1\n",
143 ResourceListTranslated->List[0].PartialResourceList.Version,
144 ResourceListTranslated->List[0].PartialResourceList.Revision);
155 switch (PartialDescriptor->
Type)
158 DPRINT(
"Port: BaseAddress 0x%lx Length %lu\n",
159 PartialDescriptor->
u.
Port.Start.u.LowPart,
160 PartialDescriptor->
u.
Port.Length);
164 if (PartialDescriptor->
u.
Port.Length < 3)
172 DPRINT(
"Interrupt: Level %lu Vector %lu\n",
173 PartialDescriptorTranslated->
u.
Interrupt.Level,
174 PartialDescriptorTranslated->
u.
Interrupt.Vector);
194 DPRINT(
"New LPT port: Base 0x%lx\n",
222 WCHAR DeviceNameBuffer[32];
223 WCHAR LinkNameBuffer[32];
224 WCHAR LptPortBuffer[32];
233 DPRINT(
"FdoCreateRawParallelPdo()\n");
239 L"\\Device\\Parallel%lu",
253 DPRINT1(
"IoCreateDevice() failed with status 0x%08x\n",
Status);
276 swprintf(LinkNameBuffer,
L"\\DosDevices\\LPT%lu", PdoDeviceExtension->
LptPort);
282 DPRINT1(
"IoCreateSymbolicLink() failed with status 0x%08x\n",
Status);
292 L"\\Registry\\Machine\\HARDWARE\\DeviceMap\\PARALLEL PORTS");
319 Pdo->Flags &= ~DO_DEVICE_INITIALIZING;
326 ASSERT(PdoDeviceExtension);
351 DPRINT(
"FdoQueryBusRelations()\n");
367 if (DeviceRelations ==
NULL)
374 DeviceRelations->
Count = 1;
428 DPRINT(
"Open parallel port %lu: successful\n", DeviceExtension->
PortNumber);
433 Irp->IoStatus.Information = 0;
452 Irp->IoStatus.Information = 0;
467 Irp->IoStatus.Information = 0;
482 Irp->IoStatus.Information = 0;
496 Irp->IoStatus.Information = 0;
547 DPRINT(
"IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
561 Stack->Parameters.StartDevice.AllocatedResources,
562 Stack->Parameters.StartDevice.AllocatedResourcesTranslated);
568 switch (
Stack->Parameters.QueryDeviceRelations.Type)
571 DPRINT(
"IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
578 DPRINT(
"IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
582 DPRINT(
"IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
583 Stack->Parameters.QueryDeviceRelations.Type);
589 DPRINT(
"IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
617 return PoCallDriver(LowerDevice,
Irp);
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define FILE_DIRECTORY_FILE
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 FILE_DEVICE_SECURE_OPEN
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
_In_ PIO_STACK_LOCATION IrpSp
#define ExAllocatePoolWithTag(hernya, size, tag)
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
#define CmResourceTypePort
#define CmResourceTypeInterrupt
DRIVER_DISPATCH ForwardIrpAndForget
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
PCONFIGURATION_INFORMATION NTAPI IoGetConfigurationInformation(VOID)
Returns a pointer to the I/O manager's global configuration information structure.
#define InitializeObjectAttributes(p, n, a, r, s)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define REG_OPTION_VOLATILE
#define UNREFERENCED_PARAMETER(P)
#define IoSkipCurrentIrpStackLocation(Irp)
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)
NTSTATUS NTAPI IoAttachDeviceToDeviceStackSafe(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice, IN OUT PDEVICE_OBJECT *AttachedToDeviceObject)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
#define IoCompleteRequest
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI IoCreateSymbolicLink(IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
#define STATUS_NOT_SUPPORTED
#define STATUS_REVISION_MISMATCH
NTSTATUS NTAPI FdoRead(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI FdoClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
static NTSTATUS FdoCreateRawParallelPdo(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI FdoPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI FdoCreate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI FdoPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI AddDeviceInternal(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT Pdo, IN PULONG pLptPortNumber OPTIONAL, OUT PDEVICE_OBJECT *pFdo OPTIONAL)
NTSTATUS NTAPI FdoWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI FdoCleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
DRIVER_ADD_DEVICE AddDevice
#define FILE_DEVICE_PARALLEL_PORT
#define FILE_DEVICE_CONTROLLER
PULONG MinorVersion OPTIONAL
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@393 Port
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@394 Interrupt
PDEVICE_OBJECT Objects[1]
PDEVICE_OBJECT LowerDevice
PDEVICE_OBJECT AttachedRawPdo
COMMON_DEVICE_EXTENSION Common
COMMON_DEVICE_EXTENSION Common
PDEVICE_OBJECT AttachedFdo
#define RtlZeroMemory(Destination, Length)
#define STATUS_NOT_A_DIRECTORY
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_In_ UCHAR _In_ UCHAR MinorFunction
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_Must_inspect_result_ _In_ WDFDEVICE Fdo
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
#define DO_BUS_ENUMERATED_DEVICE
#define IRP_MN_START_DEVICE
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_DEVICE_RELATIONS
struct _DEVICE_RELATIONS DEVICE_RELATIONS
#define ObReferenceObject