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);
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");
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);
#define DO_DEVICE_INITIALIZING
#define STATUS_REVISION_MISMATCH
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
static NTSTATUS FdoQueryBusRelations(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, PIO_STACK_LOCATION IrpSp)
return STATUS_NOT_SUPPORTED
#define STATUS_INSUFFICIENT_RESOURCES
NTSTATUS NTAPI ForwardIrpAndForget(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define OBJ_CASE_INSENSITIVE
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
PCONFIGURATION_INFORMATION NTAPI IoGetConfigurationInformation(VOID)
NTSTATUS NTAPI FdoPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define UNREFERENCED_PARAMETER(P)
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
static NTSTATUS FdoCreateRawParallelPdo(IN PDEVICE_OBJECT DeviceObject)
#define FILE_DIRECTORY_FILE
PDEVICE_OBJECT Objects[1]
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
IN PVOID IN PVOID IN USHORT IN USHORT Size
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@381::@383 Port
#define OBJ_KERNEL_HANDLE
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
#define CmResourceTypePort
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
#define STATUS_NOT_A_DIRECTORY
PDEVICE_OBJECT AttachedRawPdo
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
#define FILE_DEVICE_CONTROLLER
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_ UCHAR _In_ UCHAR MinorFunction
#define DO_BUS_ENUMERATED_DEVICE
#define IoCompleteRequest
COMMON_DEVICE_EXTENSION Common
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
NTSTATUS NTAPI AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT Pdo)
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
PDEVICE_OBJECT AttachedFdo
NTSTATUS NTAPI IoCreateSymbolicLink(IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
NTSTATUS NTAPI IoAttachDeviceToDeviceStackSafe(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice, IN OUT PDEVICE_OBJECT *AttachedToDeviceObject)
#define NT_SUCCESS(StatCode)
#define IRP_MN_START_DEVICE
#define FILE_DEVICE_PARALLEL_PORT
#define STATUS_UNSUCCESSFUL
#define ExAllocatePoolWithTag(hernya, size, tag)
_Must_inspect_result_ _In_ WDFDEVICE Fdo
NTSTATUS NTAPI FdoStartDevice(IN PDEVICE_OBJECT DeviceObject, IN PCM_RESOURCE_LIST ResourceList, IN PCM_RESOURCE_LIST ResourceListTranslated)
int _cdecl swprintf(const WCHAR *,...)
COMMON_DEVICE_EXTENSION Common
NTSTATUS NTAPI FdoClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
struct _DEVICE_RELATIONS DEVICE_RELATIONS
VOID NTAPI PoStartNextPowerIrp(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
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IoSkipCurrentIrpStackLocation(Irp)
#define CmResourceTypeInterrupt
NTSTATUS NTAPI AddDeviceInternal(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT Pdo, IN PULONG pLptPortNumber OPTIONAL, OUT PDEVICE_OBJECT *pFdo OPTIONAL)
NTSTATUS NTAPI FdoCreate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@381::@384 Interrupt
#define ObReferenceObject
NTSTATUS NTAPI FdoRead(IN PDEVICE_OBJECT DeviceObject, IN PIRP 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)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
#define InitializeObjectAttributes(p, n, a, r, s)
#define FILE_DEVICE_SECURE_OPEN
NTSTATUS NTAPI FdoWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
PDEVICE_OBJECT LowerDevice
#define REG_OPTION_VOLATILE
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@381 u
NTSTATUS NTAPI FdoCleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI FdoPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
_In_ PIO_STACK_LOCATION IrpSp
PULONG MinorVersion OPTIONAL