Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222#ifndef _HIDCLASS_PCH_#define _HIDCLASS_PCH_
#define _HIDPI_NO_FUNCTION_MACROS_#include <wdm.h>#include <hidpddi.h>#include <stdio.h>#include <hidport.h>
#define HIDCLASS_TAG 'CdiH'
typedef struct{ PDRIVER_OBJECT DriverObject; ULONG DeviceExtensionSize; BOOLEAN DevicesArePolled; PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION + 1]; PDRIVER_ADD_DEVICE AddDevice; PDRIVER_UNLOAD DriverUnload; KSPIN_LOCK Lock;
} HIDCLASS_DRIVER_EXTENSION, *PHIDCLASS_DRIVER_EXTENSION;
typedef struct{ // // hid device extension // HID_DEVICE_EXTENSION HidDeviceExtension;
// // if it is a pdo // BOOLEAN IsFDO;
// // driver extension // PHIDCLASS_DRIVER_EXTENSION DriverExtension;
// // device description // HIDP_DEVICE_DESC DeviceDescription;
// // hid attributes // HID_DEVICE_ATTRIBUTES Attributes;
} HIDCLASS_COMMON_DEVICE_EXTENSION, *PHIDCLASS_COMMON_DEVICE_EXTENSION;
typedef struct{ // // parts shared by fdo and pdo // HIDCLASS_COMMON_DEVICE_EXTENSION Common;
// // device capabilities // DEVICE_CAPABILITIES Capabilities;
// // hid descriptor // HID_DESCRIPTOR HidDescriptor;
// // report descriptor // PUCHAR ReportDescriptor;
// // device relations // PDEVICE_RELATIONS DeviceRelations;
} HIDCLASS_FDO_EXTENSION, *PHIDCLASS_FDO_EXTENSION;
typedef struct{ // // parts shared by fdo and pdo // HIDCLASS_COMMON_DEVICE_EXTENSION Common;
// // device capabilities // DEVICE_CAPABILITIES Capabilities;
// // collection index // ULONG CollectionNumber;
// // device interface // UNICODE_STRING DeviceInterface;
// // FDO device object // PDEVICE_OBJECT FDODeviceObject;
// // fdo device extension // PHIDCLASS_FDO_EXTENSION FDODeviceExtension;
} HIDCLASS_PDO_DEVICE_EXTENSION, *PHIDCLASS_PDO_DEVICE_EXTENSION;
typedef struct __HIDCLASS_FILEOP_CONTEXT__{ // // device extension // PHIDCLASS_PDO_DEVICE_EXTENSION DeviceExtension;
// // spin lock // KSPIN_LOCK Lock;
// // read irp pending list // LIST_ENTRY ReadPendingIrpListHead;
// // completed irp list // LIST_ENTRY IrpCompletedListHead;
// // stop in progress indicator // BOOLEAN StopInProgress;
// // read complete event // KEVENT IrpReadComplete;
} HIDCLASS_FILEOP_CONTEXT, *PHIDCLASS_FILEOP_CONTEXT;
typedef struct{ // // original request // PIRP OriginalIrp;
// // file op // PHIDCLASS_FILEOP_CONTEXT FileOp;
// // buffer for reading report // PVOID InputReportBuffer;
// // buffer length // ULONG InputReportBufferLength;
// // work item // PIO_WORKITEM CompletionWorkItem;
} HIDCLASS_IRP_CONTEXT, *PHIDCLASS_IRP_CONTEXT;
/* fdo.c */NTSTATUSHidClassFDO_PnP( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
NTSTATUSHidClassFDO_DispatchRequest( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
NTSTATUSHidClassFDO_DispatchRequestSynchronous( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
/* pdo.c */NTSTATUSHidClassPDO_CreatePDO( IN PDEVICE_OBJECT DeviceObject, OUT PDEVICE_RELATIONS *OutDeviceRelations);
NTSTATUSHidClassPDO_PnP( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp);
PHIDP_COLLECTION_DESCHidClassPDO_GetCollectionDescription( PHIDP_DEVICE_DESC DeviceDescription, ULONG CollectionNumber);
PHIDP_REPORT_IDSHidClassPDO_GetReportDescription( PHIDP_DEVICE_DESC DeviceDescription, ULONG CollectionNumber);
PHIDP_REPORT_IDSHidClassPDO_GetReportDescriptionByReportID( PHIDP_DEVICE_DESC DeviceDescription, UCHAR ReportID);
#endif /* _HIDCLASS_PCH_ */