-#pragma once
+#ifndef _HIDCLASS_PCH_
+#define _HIDCLASS_PCH_
#define _HIDPI_NO_FUNCTION_MACROS_
-#include <ntddk.h>
-#include <initguid.h>
-#include <hidport.h>
+#include <wdm.h>
#include <hidpddi.h>
#include <stdio.h>
-#include <wdmguid.h>
-#include <debug.h>
+#include <hidport.h>
+
+#define HIDCLASS_TAG 'CdiH'
typedef struct
{
PDRIVER_UNLOAD DriverUnload;
KSPIN_LOCK Lock;
-}HIDCLASS_DRIVER_EXTENSION, *PHIDCLASS_DRIVER_EXTENSION;
+} HIDCLASS_DRIVER_EXTENSION, *PHIDCLASS_DRIVER_EXTENSION;
typedef struct
{
//
HID_DEVICE_ATTRIBUTES Attributes;
-
-}HIDCLASS_COMMON_DEVICE_EXTENSION, *PHIDCLASS_COMMON_DEVICE_EXTENSION;
+} HIDCLASS_COMMON_DEVICE_EXTENSION, *PHIDCLASS_COMMON_DEVICE_EXTENSION;
typedef struct
{
//
// device relations
//
- DEVICE_RELATIONS DeviceRelations;
+ PDEVICE_RELATIONS DeviceRelations;
-}HIDCLASS_FDO_EXTENSION, *PHIDCLASS_FDO_EXTENSION;
+} HIDCLASS_FDO_EXTENSION, *PHIDCLASS_FDO_EXTENSION;
typedef struct
{
//
// collection index
//
- ULONG CollectionIndex;
+ ULONG CollectionNumber;
//
- // device interface
+ // device interface
//
UNICODE_STRING DeviceInterface;
-}HIDCLASS_PDO_DEVICE_EXTENSION, *PHIDCLASS_PDO_DEVICE_EXTENSION;
+
+ //
+ // 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__
{
//
LIST_ENTRY IrpCompletedListHead;
-}HIDCLASS_FILEOP_CONTEXT, *PHIDCLASS_FILEOP_CONTEXT;
+ //
+ // stop in progress indicator
+ //
+ BOOLEAN StopInProgress;
+
+ //
+ // read complete event
+ //
+ KEVENT IrpReadComplete;
+
+} HIDCLASS_FILEOP_CONTEXT, *PHIDCLASS_FILEOP_CONTEXT;
typedef struct
{
//
PIO_WORKITEM CompletionWorkItem;
-}HIDCLASS_IRP_CONTEXT, *PHIDCLASS_IRP_CONTEXT;
+} HIDCLASS_IRP_CONTEXT, *PHIDCLASS_IRP_CONTEXT;
/* fdo.c */
NTSTATUS
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
+NTSTATUS
+HidClassFDO_DispatchRequest(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp);
+
NTSTATUS
HidClassFDO_DispatchRequestSynchronous(
IN PDEVICE_OBJECT DeviceObject,
/* pdo.c */
NTSTATUS
HidClassPDO_CreatePDO(
- IN PDEVICE_OBJECT DeviceObject);
+ IN PDEVICE_OBJECT DeviceObject,
+ OUT PDEVICE_RELATIONS *OutDeviceRelations);
NTSTATUS
HidClassPDO_PnP(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
+PHIDP_COLLECTION_DESC
+HidClassPDO_GetCollectionDescription(
+ PHIDP_DEVICE_DESC DeviceDescription,
+ ULONG CollectionNumber);
+
+PHIDP_REPORT_IDS
+HidClassPDO_GetReportDescription(
+ PHIDP_DEVICE_DESC DeviceDescription,
+ ULONG CollectionNumber);
-/* eof */
+#endif /* _HIDCLASS_PCH_ */