40 WCHAR CharDeviceName[64];
45 ULONG DeviceExtensionSize;
94 DPRINT1(
"[HIDCLASS] failed to attach to device stack\n");
106 NewDeviceObject->
Flags &= ~DO_DEVICE_INITIALIZING;
147 if (CommonDeviceExtension->
IsFDO)
194 Context->DeviceExtension = PDODeviceExtension;
236 if (CommonDeviceExtension->
IsFDO)
273 IsRequestPending =
TRUE;
286 if (IsRequestPending)
291 DPRINT1(
"[HIDCLASS] Waiting for read irp completion...\n");
370 DPRINT(
"HidClass_ReadCompleteIrp Status %lx\n",
Irp->IoStatus.Status);
371 DPRINT(
"HidClass_ReadCompleteIrp Length %lu\n",
Irp->IoStatus.Information);
372 DPRINT(
"HidClass_ReadCompleteIrp Irp %p\n",
Irp);
380 if (
Irp->IoStatus.Information)
398 ASSERT(CollectionDescription);
405 ASSERT(ReportDescription);
407 if (CollectionDescription && ReportDescription)
471 DPRINT1(
"[HIDCLASS] LastPendingTransfer Signalling\n");
480 DPRINT1(
"[HIDCLASS] LastPendingTransfer Signalling\n");
609 ASSERT(CollectionDescription);
616 ASSERT(ReportDescription);
628 DPRINT1(
"[HIDCLASS] Stop In Progress\n");
674 *OutIrpContext = IrpContext;
729 DPRINT1(
"[HIDCLASS] Stop In Progress\n");
842 SubIrp->UserBuffer = &XferPacket;
875 if (CommonDeviceExtension->
IsFDO)
880 DPRINT1(
"[HIDCLASS] DeviceControl Irp for FDO arrived\n");
918 CollectionInformation =
Irp->AssociatedIrp.SystemBuffer;
919 ASSERT(CollectionInformation);
926 ASSERT(CollectionDescription);
952 ASSERT(CollectionDescription);
1029 SubIrp->UserBuffer = &XferPacket;
1083 SubIrp->UserBuffer = &XferPacket;
1127 if (CommonDeviceExtension->
IsFDO)
1157 if (CommonDeviceExtension->
IsFDO)
1275 DriverExtension->DeviceExtensionSize = MinidriverRegistration->DeviceExtensionSize;
1276 DriverExtension->DevicesArePolled = MinidriverRegistration->DevicesArePolled;
1277 DriverExtension->AddDevice = MinidriverRegistration->DriverObject->DriverExtension->AddDevice;
1278 DriverExtension->DriverUnload = MinidriverRegistration->DriverObject->DriverUnload;
1282 MinidriverRegistration->DriverObject->MajorFunction,
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define InterlockedIncrement
PDEVICE_OBJECT PhysicalDeviceObject
#define NT_SUCCESS(StatCode)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeReleaseSpinLock(sl, irql)
#define KeSetEvent(pEvt, foo, foo2)
#define KeAcquireSpinLock(sl, irql)
#define KeGetCurrentIrql()
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
#define KeInitializeSpinLock(sl)
NTSTATUS HidClassFDO_DispatchRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS HidClassFDO_PnP(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
PHIDP_REPORT_IDS HidClassPDO_GetReportDescriptionByReportID(PHIDP_DEVICE_DESC DeviceDescription, UCHAR ReportID)
NTSTATUS HidClassPDO_PnP(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
PHIDP_REPORT_IDS HidClassPDO_GetReportDescription(PHIDP_DEVICE_DESC DeviceDescription, ULONG CollectionNumber)
PHIDP_COLLECTION_DESC HidClassPDO_GetCollectionDescription(PHIDP_DEVICE_DESC DeviceDescription, ULONG CollectionNumber)
NTSTATUS NTAPI HidClassDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI HidRegisterMinidriver(IN PHID_MINIDRIVER_REGISTRATION MinidriverRegistration)
NTSTATUS NTAPI HidClass_Power(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI HidClass_DeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI HidClass_PnP(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI HidClass_Read(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI HidClassAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
NTSTATUS NTAPI DllInitialize(IN PUNICODE_STRING RegistryPath)
PIRP HidClass_GetIrp(IN PHIDCLASS_FILEOP_CONTEXT Context)
NTSTATUS HidClass_BuildIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP RequestIrp, IN PHIDCLASS_FILEOP_CONTEXT Context, IN ULONG DeviceIoControlCode, IN ULONG BufferLength, OUT PIRP *OutIrp, OUT PHIDCLASS_IRP_CONTEXT *OutIrpContext)
NTSTATUS NTAPI HidClass_Write(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI HidClass_ReadCompleteIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Ctx)
static ULONG HidClassDeviceNumber
NTSTATUS NTAPI HidClass_Create(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI HidClass_InternalDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
static LPWSTR ClientIdentificationAddress
VOID NTAPI HidClassDriverUnload(IN PDRIVER_OBJECT DriverObject)
NTSTATUS NTAPI HidClass_Close(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI HidClass_DispatchDefault(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define IOCTL_HID_GET_COLLECTION_DESCRIPTOR
struct _HID_COLLECTION_INFORMATION HID_COLLECTION_INFORMATION
#define IOCTL_HID_SET_FEATURE
#define IOCTL_HID_GET_FEATURE
#define IOCTL_HID_GET_COLLECTION_INFORMATION
#define IOCTL_HID_READ_REPORT
#define IOCTL_HID_WRITE_REPORT
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
#define ExFreePoolWithTag(_P, _T)
static OUT PIO_STATUS_BLOCK IoStatusBlock
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define IoSkipCurrentIrpStackLocation(Irp)
#define IoCopyCurrentIrpStackLocationToNext(Irp)
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
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)
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
#define IoCompleteRequest
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
VOID NTAPI IoReuseIrp(IN OUT PIRP Irp, IN NTSTATUS Status)
PIRP NTAPI IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, IN PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN InternalDeviceIoControl, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
VOID NTAPI IoFreeIrp(IN PIRP Irp)
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
#define STATUS_INVALID_BUFFER_SIZE
#define STATUS_DEVICE_REMOVED
#define STATUS_DEVICE_CONFIGURATION_ERROR
#define STATUS_NOT_IMPLEMENTED
#define STATUS_INVALID_PARAMETER_1
#define STATUS_REVISION_MISMATCH
PPCI_DRIVER_EXTENSION DriverExtension
#define FILE_DEVICE_UNKNOWN
#define IRP_MJ_DEVICE_CONTROL
#define STATUS_MORE_PROCESSING_REQUIRED
base of all file and directory entries
HIDP_DEVICE_DESC DeviceDescription
PHIDCLASS_DRIVER_EXTENSION DriverExtension
HID_DEVICE_ATTRIBUTES Attributes
HID_DEVICE_EXTENSION HidDeviceExtension
HIDCLASS_COMMON_DEVICE_EXTENSION Common
PHIDCLASS_FILEOP_CONTEXT FileOp
ULONG InputReportBufferLength
HIDCLASS_COMMON_DEVICE_EXTENSION Common
PHIDP_PREPARSED_DATA PreparsedData
USHORT PreparsedDataLength
PDEVICE_OBJECT PhysicalDeviceObject
PVOID MiniDeviceExtension
PDEVICE_OBJECT NextDeviceObject
struct _IO_STACK_LOCATION::@3984::@3989 Write
PDEVICE_OBJECT DeviceObject
struct _IO_STACK_LOCATION::@3984::@3985 Create
struct _IO_STACK_LOCATION::@1575::@1576 DeviceIoControl
union _IO_STACK_LOCATION::@1575 Parameters
struct _IO_STACK_LOCATION::@3984::@3988 Read
LIST_ENTRY ReadPendingIrpListHead
LIST_ENTRY IrpCompletedListHead
PHIDCLASS_PDO_DEVICE_EXTENSION DeviceExtension
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
DRIVER_DISPATCH * PDRIVER_DISPATCH
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define IRP_MJ_MAXIMUM_FUNCTION
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)