ReactOS  0.4.15-dev-506-ga3ec01c
hidport.h File Reference
#include <hidclass.h>
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for hidport.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _HID_MINIDRIVER_REGISTRATION
 
struct  _HID_DEVICE_EXTENSION
 
struct  _HID_DEVICE_ATTRIBUTES
 
struct  _HID_DESCRIPTOR
 
struct  _HID_DESCRIPTOR::_HID_DESCRIPTOR_DESC_LIST
 
struct  _HID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFO
 

Macros

#define HID_HID_DESCRIPTOR_TYPE   0x21
 
#define HID_REPORT_DESCRIPTOR_TYPE   0x22
 
#define HID_PHYSICAL_DESCRIPTOR_TYPE   0x23
 
#define IOCTL_HID_GET_DEVICE_DESCRIPTOR   HID_CTL_CODE(0)
 
#define IOCTL_HID_GET_REPORT_DESCRIPTOR   HID_CTL_CODE(1)
 
#define IOCTL_HID_READ_REPORT   HID_CTL_CODE(2)
 
#define IOCTL_HID_WRITE_REPORT   HID_CTL_CODE(3)
 
#define IOCTL_HID_GET_STRING   HID_CTL_CODE(4)
 
#define IOCTL_HID_ACTIVATE_DEVICE   HID_CTL_CODE(7)
 
#define IOCTL_HID_DEACTIVATE_DEVICE   HID_CTL_CODE(8)
 
#define IOCTL_HID_GET_DEVICE_ATTRIBUTES   HID_CTL_CODE(9)
 
#define IOCTL_HID_SEND_IDLE_NOTIFICATION_REQUEST   HID_CTL_CODE(10)
 
#define HID_HID_DESCRIPTOR_TYPE   0x21
 
#define HID_REPORT_DESCRIPTOR_TYPE   0x22
 
#define HID_PHYSICAL_DESCRIPTOR_TYPE   0x23
 
#define HID_STRING_ID_IMANUFACTURER   14
 
#define HID_STRING_ID_IPRODUCT   15
 
#define HID_STRING_ID_ISERIALNUMBER   16
 

Typedefs

typedef struct _HID_MINIDRIVER_REGISTRATION HID_MINIDRIVER_REGISTRATION
 
typedef struct _HID_MINIDRIVER_REGISTRATIONPHID_MINIDRIVER_REGISTRATION
 
typedef struct _HID_DEVICE_EXTENSION HID_DEVICE_EXTENSION
 
typedef struct _HID_DEVICE_EXTENSIONPHID_DEVICE_EXTENSION
 
typedef struct _HID_DEVICE_ATTRIBUTES HID_DEVICE_ATTRIBUTES
 
typedef struct _HID_DEVICE_ATTRIBUTESPHID_DEVICE_ATTRIBUTES
 
typedef struct _HID_DESCRIPTOR HID_DESCRIPTOR
 
typedef struct _HID_DESCRIPTORPHID_DESCRIPTOR
 
typedef VOID(NTAPIHID_SEND_IDLE_CALLBACK) (IN PVOID Context)
 
typedef struct _HID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFO HID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFO
 
typedef struct _HID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFOPHID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFO
 

Functions

NTSTATUS NTAPI HidRegisterMinidriver (IN PHID_MINIDRIVER_REGISTRATION MinidriverRegistration)
 
NTSTATUS HidNotifyPresence (IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN IsPresent)
 

Macro Definition Documentation

◆ HID_HID_DESCRIPTOR_TYPE [1/2]

#define HID_HID_DESCRIPTOR_TYPE   0x21

Definition at line 94 of file hidport.h.

◆ HID_HID_DESCRIPTOR_TYPE [2/2]

#define HID_HID_DESCRIPTOR_TYPE   0x21

Definition at line 94 of file hidport.h.

◆ HID_PHYSICAL_DESCRIPTOR_TYPE [1/2]

#define HID_PHYSICAL_DESCRIPTOR_TYPE   0x23

Definition at line 96 of file hidport.h.

◆ HID_PHYSICAL_DESCRIPTOR_TYPE [2/2]

#define HID_PHYSICAL_DESCRIPTOR_TYPE   0x23

Definition at line 96 of file hidport.h.

◆ HID_REPORT_DESCRIPTOR_TYPE [1/2]

#define HID_REPORT_DESCRIPTOR_TYPE   0x22

Definition at line 95 of file hidport.h.

◆ HID_REPORT_DESCRIPTOR_TYPE [2/2]

#define HID_REPORT_DESCRIPTOR_TYPE   0x22

Definition at line 95 of file hidport.h.

◆ HID_STRING_ID_IMANUFACTURER

#define HID_STRING_ID_IMANUFACTURER   14

Definition at line 98 of file hidport.h.

◆ HID_STRING_ID_IPRODUCT

#define HID_STRING_ID_IPRODUCT   15

Definition at line 99 of file hidport.h.

◆ HID_STRING_ID_ISERIALNUMBER

#define HID_STRING_ID_ISERIALNUMBER   16

Definition at line 100 of file hidport.h.

◆ IOCTL_HID_ACTIVATE_DEVICE

#define IOCTL_HID_ACTIVATE_DEVICE   HID_CTL_CODE(7)

Definition at line 89 of file hidport.h.

◆ IOCTL_HID_DEACTIVATE_DEVICE

#define IOCTL_HID_DEACTIVATE_DEVICE   HID_CTL_CODE(8)

Definition at line 90 of file hidport.h.

◆ IOCTL_HID_GET_DEVICE_ATTRIBUTES

#define IOCTL_HID_GET_DEVICE_ATTRIBUTES   HID_CTL_CODE(9)

Definition at line 91 of file hidport.h.

◆ IOCTL_HID_GET_DEVICE_DESCRIPTOR

#define IOCTL_HID_GET_DEVICE_DESCRIPTOR   HID_CTL_CODE(0)

Definition at line 84 of file hidport.h.

◆ IOCTL_HID_GET_REPORT_DESCRIPTOR

#define IOCTL_HID_GET_REPORT_DESCRIPTOR   HID_CTL_CODE(1)

Definition at line 85 of file hidport.h.

◆ IOCTL_HID_GET_STRING

#define IOCTL_HID_GET_STRING   HID_CTL_CODE(4)

Definition at line 88 of file hidport.h.

◆ IOCTL_HID_READ_REPORT

#define IOCTL_HID_READ_REPORT   HID_CTL_CODE(2)

Definition at line 86 of file hidport.h.

◆ IOCTL_HID_SEND_IDLE_NOTIFICATION_REQUEST

#define IOCTL_HID_SEND_IDLE_NOTIFICATION_REQUEST   HID_CTL_CODE(10)

Definition at line 92 of file hidport.h.

◆ IOCTL_HID_WRITE_REPORT

#define IOCTL_HID_WRITE_REPORT   HID_CTL_CODE(3)

Definition at line 87 of file hidport.h.

Typedef Documentation

◆ HID_DESCRIPTOR

◆ HID_DEVICE_ATTRIBUTES

◆ HID_DEVICE_EXTENSION

◆ HID_MINIDRIVER_REGISTRATION

◆ HID_SEND_IDLE_CALLBACK

typedef VOID(NTAPI * HID_SEND_IDLE_CALLBACK) (IN PVOID Context)

Definition at line 58 of file hidport.h.

◆ HID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFO

◆ PHID_DESCRIPTOR

◆ PHID_DEVICE_ATTRIBUTES

◆ PHID_DEVICE_EXTENSION

◆ PHID_MINIDRIVER_REGISTRATION

◆ PHID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFO

Function Documentation

◆ HidNotifyPresence()

NTSTATUS HidNotifyPresence ( IN PDEVICE_OBJECT  DeviceObject,
IN BOOLEAN  IsPresent 
)

◆ HidRegisterMinidriver()

NTSTATUS NTAPI HidRegisterMinidriver ( IN PHID_MINIDRIVER_REGISTRATION  MinidriverRegistration)

Definition at line 1244 of file hidclass.c.

1246 {
1247  NTSTATUS Status;
1249 
1250  /* check if the version matches */
1251  if (MinidriverRegistration->Revision > HID_REVISION)
1252  {
1253  /* revision mismatch */
1254  ASSERT(FALSE);
1255  return STATUS_REVISION_MISMATCH;
1256  }
1257 
1258  /* now allocate the driver object extension */
1259  Status = IoAllocateDriverObjectExtension(MinidriverRegistration->DriverObject,
1261  sizeof(HIDCLASS_DRIVER_EXTENSION),
1262  (PVOID *)&DriverExtension);
1263  if (!NT_SUCCESS(Status))
1264  {
1265  /* failed to allocate driver extension */
1266  ASSERT(FALSE);
1267  return Status;
1268  }
1269 
1270  /* zero driver extension */
1272 
1273  /* init driver extension */
1274  DriverExtension->DriverObject = MinidriverRegistration->DriverObject;
1275  DriverExtension->DeviceExtensionSize = MinidriverRegistration->DeviceExtensionSize;
1276  DriverExtension->DevicesArePolled = MinidriverRegistration->DevicesArePolled;
1277  DriverExtension->AddDevice = MinidriverRegistration->DriverObject->DriverExtension->AddDevice;
1278  DriverExtension->DriverUnload = MinidriverRegistration->DriverObject->DriverUnload;
1279 
1280  /* copy driver dispatch routines */
1281  RtlCopyMemory(DriverExtension->MajorFunction,
1282  MinidriverRegistration->DriverObject->MajorFunction,
1283  sizeof(PDRIVER_DISPATCH) * (IRP_MJ_MAXIMUM_FUNCTION + 1));
1284 
1285  /* initialize lock */
1287 
1288  /* now replace dispatch routines */
1289  DriverExtension->DriverObject->DriverExtension->AddDevice = HidClassAddDevice;
1290  DriverExtension->DriverObject->DriverUnload = HidClassDriverUnload;
1291  DriverExtension->DriverObject->MajorFunction[IRP_MJ_CREATE] = HidClassDispatch;
1292  DriverExtension->DriverObject->MajorFunction[IRP_MJ_CLOSE] = HidClassDispatch;
1293  DriverExtension->DriverObject->MajorFunction[IRP_MJ_READ] = HidClassDispatch;
1294  DriverExtension->DriverObject->MajorFunction[IRP_MJ_WRITE] = HidClassDispatch;
1295  DriverExtension->DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = HidClassDispatch;
1296  DriverExtension->DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = HidClassDispatch;
1297  DriverExtension->DriverObject->MajorFunction[IRP_MJ_POWER] = HidClassDispatch;
1298  DriverExtension->DriverObject->MajorFunction[IRP_MJ_PNP] = HidClassDispatch;
1299 
1300  /* done */
1301  return STATUS_SUCCESS;
1302 }
#define STATUS_REVISION_MISMATCH
Definition: ntstatus.h:311
static LPWSTR ClientIdentificationAddress
Definition: hidclass.c:16
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
NTSTATUS NTAPI HidClassAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
Definition: hidclass.c:36
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
Definition: driver.c:1779
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
#define IRP_MJ_MAXIMUM_FUNCTION
LONG NTSTATUS
Definition: precomp.h:26
#define HID_REVISION
Definition: hidclass.h:32
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define IRP_MJ_POWER
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:41
Status
Definition: gdiplustypes.h:24
DRIVER_DISPATCH * PDRIVER_DISPATCH
Definition: iotypes.h:2156
NTSTATUS NTAPI HidClassDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: hidclass.c:1204
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
return STATUS_SUCCESS
Definition: btrfs.c:3014
VOID NTAPI HidClassDriverUnload(IN PDRIVER_OBJECT DriverObject)
Definition: hidclass.c:126
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52

Referenced by DriverEntry().