[HIDCLASS] Implement IOCTL_HID_GET_FEATURE/IOCTL_HID_SET_FEATURE
[reactos.git] / drivers / hid / hidclass / precomp.h
index 401cd30..d3b0be8 100644 (file)
@@ -1,14 +1,13 @@
-#pragma once
+#ifndef _HIDCLASS_PCH_
+#define _HIDCLASS_PCH_
 
 #define _HIDPI_NO_FUNCTION_MACROS_
-#define NDEBUG
-#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
 {
@@ -20,7 +19,7 @@ typedef struct
     PDRIVER_UNLOAD DriverUnload;
     KSPIN_LOCK Lock;
 
-}HIDCLASS_DRIVER_EXTENSION, *PHIDCLASS_DRIVER_EXTENSION;
+} HIDCLASS_DRIVER_EXTENSION, *PHIDCLASS_DRIVER_EXTENSION;
 
 typedef struct
 {
@@ -49,7 +48,7 @@ typedef struct
     //
     HID_DEVICE_ATTRIBUTES Attributes;
 
-}HIDCLASS_COMMON_DEVICE_EXTENSION, *PHIDCLASS_COMMON_DEVICE_EXTENSION;
+} HIDCLASS_COMMON_DEVICE_EXTENSION, *PHIDCLASS_COMMON_DEVICE_EXTENSION;
 
 typedef struct
 {
@@ -76,9 +75,9 @@ typedef struct
     //
     // device relations
     //
-    DEVICE_RELATIONS DeviceRelations;
+    PDEVICE_RELATIONS DeviceRelations;
 
-}HIDCLASS_FDO_EXTENSION, *PHIDCLASS_FDO_EXTENSION;
+} HIDCLASS_FDO_EXTENSION, *PHIDCLASS_FDO_EXTENSION;
 
 typedef struct
 {
@@ -95,10 +94,10 @@ typedef struct
     //
     // collection index
     //
-    ULONG CollectionIndex;
+    ULONG CollectionNumber;
 
     //
-    // device interface 
+    // device interface
     //
     UNICODE_STRING DeviceInterface;
 
@@ -107,7 +106,12 @@ typedef struct
     //
     PDEVICE_OBJECT FDODeviceObject;
 
-}HIDCLASS_PDO_DEVICE_EXTENSION, *PHIDCLASS_PDO_DEVICE_EXTENSION;
+    //
+    // fdo device extension
+    //
+    PHIDCLASS_FDO_EXTENSION FDODeviceExtension;
+
+} HIDCLASS_PDO_DEVICE_EXTENSION, *PHIDCLASS_PDO_DEVICE_EXTENSION;
 
 typedef struct __HIDCLASS_FILEOP_CONTEXT__
 {
@@ -131,7 +135,17 @@ 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
 {
@@ -160,7 +174,7 @@ typedef struct
     //
     PIO_WORKITEM CompletionWorkItem;
 
-}HIDCLASS_IRP_CONTEXT, *PHIDCLASS_IRP_CONTEXT;
+} HIDCLASS_IRP_CONTEXT, *PHIDCLASS_IRP_CONTEXT;
 
 /* fdo.c */
 NTSTATUS
@@ -168,6 +182,11 @@ HidClassFDO_PnP(
     IN PDEVICE_OBJECT DeviceObject,
     IN PIRP Irp);
 
+NTSTATUS
+HidClassFDO_DispatchRequest(
+    IN PDEVICE_OBJECT DeviceObject,
+    IN PIRP Irp);
+
 NTSTATUS
 HidClassFDO_DispatchRequestSynchronous(
     IN PDEVICE_OBJECT DeviceObject,
@@ -176,12 +195,27 @@ HidClassFDO_DispatchRequestSynchronous(
 /* 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);
+
+PHIDP_REPORT_IDS
+HidClassPDO_GetReportDescriptionByReportID(
+    PHIDP_DEVICE_DESC DeviceDescription,
+    UCHAR ReportID);
 
-/* eof */
+#endif /* _HIDCLASS_PCH_ */