--- /dev/null
+/*++\r
+\r
+Copyright (c) 1996 Microsoft Corporation\r
+\r
+Module Name:\r
+\r
+ HIDSDI.H\r
+\r
+Abstract:\r
+\r
+ This module contains the PUBLIC definitions for the\r
+ code that implements the HID dll.\r
+\r
+Environment:\r
+\r
+ Kernel & user mode\r
+\r
+--*/\r
+\r
+\r
+#ifndef _HIDSDI_H\r
+#define _HIDSDI_H\r
+\r
+#include <pshpack4.h>\r
+\r
+//#include "wtypes.h"\r
+\r
+//#include <windef.h>\r
+//#include <win32.h>\r
+//#include <basetyps.h>\r
+\r
+typedef LONG NTSTATUS;\r
+#include "hidusage.h"\r
+#include "hidpi.h"\r
+\r
+typedef struct _HIDD_CONFIGURATION {\r
+ PVOID cookie;\r
+ ULONG size;\r
+ ULONG RingBufferSize;\r
+} HIDD_CONFIGURATION, *PHIDD_CONFIGURATION;\r
+\r
+typedef struct _HIDD_ATTRIBUTES {\r
+ ULONG Size; // = sizeof (struct _HIDD_ATTRIBUTES)\r
+\r
+ //\r
+ // Vendor ids of this hid device\r
+ //\r
+ USHORT VendorID;\r
+ USHORT ProductID;\r
+ USHORT VersionNumber;\r
+\r
+ //\r
+ // Additional fields will be added to the end of this structure.\r
+ //\r
+} HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES;\r
+\r
+\r
+BOOLEAN __stdcall\r
+HidD_GetAttributes (\r
+ IN HANDLE HidDeviceObject,\r
+ OUT PHIDD_ATTRIBUTES Attributes\r
+ );\r
+/*++\r
+Routine Description:\r
+ Fill in the given HIDD_ATTRIBUTES structure with the attributes of the\r
+ given hid device.\r
+\r
+--*/\r
+\r
+\r
+void __stdcall\r
+HidD_GetHidGuid (\r
+ OUT LPGUID HidGuid\r
+ );\r
+\r
+BOOLEAN __stdcall\r
+HidD_GetPreparsedData (\r
+ IN HANDLE HidDeviceObject,\r
+ OUT PHIDP_PREPARSED_DATA * PreparsedData\r
+ );\r
+/*++\r
+Routine Description:\r
+ Given a handle to a valid Hid Class Device Object, retrieve the preparsed\r
+ data for the device. This routine will allocate the appropriately \r
+ sized buffer to hold this preparsed data. It is up to client to call\r
+ HidP_FreePreparsedData to free the memory allocated to this structure when\r
+ it is no longer needed.\r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device that the client obtains using \r
+ a call to CreateFile on a valid Hid device string name.\r
+ The string name can be obtained using standard PnP calls.\r
+\r
+ PreparsedData An opaque data structure used by other functions in this \r
+ library to retrieve information about a given device.\r
+\r
+Return Value:\r
+ TRUE if successful.\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+BOOLEAN __stdcall\r
+HidD_FreePreparsedData (\r
+ IN PHIDP_PREPARSED_DATA PreparsedData\r
+ );\r
+\r
+BOOLEAN __stdcall\r
+HidD_FlushQueue (\r
+ IN HANDLE HidDeviceObject\r
+ );\r
+/*++\r
+Routine Description:\r
+ Flush the input queue for the given HID device.\r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device that the client obtains using \r
+ a call to CreateFile on a valid Hid device string name.\r
+ The string name can be obtained using standard PnP calls.\r
+\r
+Return Value:\r
+ TRUE if successful\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+BOOLEAN __stdcall\r
+HidD_GetConfiguration (\r
+ IN HANDLE HidDeviceObject,\r
+ OUT PHIDD_CONFIGURATION Configuration,\r
+ IN ULONG ConfigurationLength\r
+ );\r
+/*++\r
+Routine Description:\r
+ Get the configuration information for this Hid device\r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device Object.\r
+\r
+ Configuration A configuration structure. HidD_GetConfiguration MUST\r
+ be called before the configuration can be modified and\r
+ set using HidD_SetConfiguration\r
+\r
+ ConfigurationLength That is ``sizeof (HIDD_CONFIGURATION)''. Using this\r
+ parameter, we can later increase the length of the \r
+ configuration array and not break older apps.\r
+\r
+Return Value:\r
+ TRUE if successful\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+BOOLEAN __stdcall\r
+HidD_SetConfiguration (\r
+ IN HANDLE HidDeviceObject,\r
+ IN PHIDD_CONFIGURATION Configuration,\r
+ IN ULONG ConfigurationLength\r
+ );\r
+/*++\r
+Routine Description:\r
+ Set the configuration information for this Hid device...\r
+ \r
+ NOTE: HidD_GetConfiguration must be called to retrieve the current \r
+ configuration information before this information can be modified \r
+ and set.\r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device Object.\r
+ \r
+ Configuration A configuration structure. HidD_GetConfiguration MUST\r
+ be called before the configuration can be modified and\r
+ set using HidD_SetConfiguration\r
+ \r
+ ConfigurationLength That is ``sizeof (HIDD_CONFIGURATION)''. Using this\r
+ parameter, we can later increase the length of the \r
+ configuration array and not break older apps.\r
+\r
+Return Value:\r
+ TRUE if successful\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+BOOLEAN __stdcall\r
+HidD_GetFeature (\r
+ IN HANDLE HidDeviceObject,\r
+ OUT PVOID ReportBuffer,\r
+ IN ULONG ReportBufferLength\r
+ );\r
+/*++\r
+Routine Description:\r
+ Retrieve a feature report from a HID device.\r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device Object.\r
+ \r
+ ReportBuffer The buffer that the feature report should be placed \r
+ into. The first byte of the buffer should be set to\r
+ the report ID of the desired report\r
+ \r
+ ReportBufferLength The size (in bytes) of ReportBuffer. This value \r
+ should be greater than or equal to the \r
+ FeatureReportByteLength field as specified in the \r
+ HIDP_CAPS structure for the device\r
+Return Value:\r
+ TRUE if successful\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+BOOLEAN __stdcall\r
+HidD_SetFeature (\r
+ IN HANDLE HidDeviceObject,\r
+ IN PVOID ReportBuffer,\r
+ IN ULONG ReportBufferLength\r
+ );\r
+/*++\r
+Routine Description:\r
+ Send a feature report to a HID device.\r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device Object.\r
+ \r
+ ReportBuffer The buffer of the feature report to send to the device\r
+ \r
+ ReportBufferLength The size (in bytes) of ReportBuffer. This value \r
+ should be greater than or equal to the \r
+ FeatureReportByteLength field as specified in the \r
+ HIDP_CAPS structure for the device\r
+Return Value:\r
+ TRUE if successful\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+BOOLEAN __stdcall\r
+HidD_GetNumInputBuffers (\r
+ IN HANDLE HidDeviceObject,\r
+ OUT PULONG NumberBuffers\r
+ );\r
+/*++\r
+Routine Description:\r
+ This function returns the number of input buffers used by the specified\r
+ file handle to the Hid device. Each file object has a number of buffers\r
+ associated with it to queue reports read from the device but which have\r
+ not yet been read by the user-mode app with a handle to that device.\r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device Object.\r
+ \r
+ NumberBuffers Number of buffers currently being used for this file\r
+ handle to the Hid device\r
+\r
+Return Value:\r
+ TRUE if successful\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+BOOLEAN __stdcall\r
+HidD_SetNumInputBuffers (\r
+ IN HANDLE HidDeviceObject,\r
+ OUT ULONG NumberBuffers\r
+ );\r
+/*++\r
+\r
+Routine Description:\r
+ This function sets the number of input buffers used by the specified\r
+ file handle to the Hid device. Each file object has a number of buffers\r
+ associated with it to queue reports read from the device but which have\r
+ not yet been read by the user-mode app with a handle to that device.\r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device Object.\r
+ \r
+ NumberBuffers New number of buffers to use for this file handle to\r
+ the Hid device\r
+\r
+Return Value:\r
+ TRUE if successful\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+BOOLEAN __stdcall\r
+HidD_GetPhysicalDescriptor (\r
+ IN HANDLE HidDeviceObject,\r
+ OUT PVOID Buffer,\r
+ IN ULONG BufferLength\r
+ );\r
+/*++\r
+Routine Description:\r
+ This function retrieves the raw physical descriptor for the specified\r
+ Hid device. \r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device Object.\r
+ \r
+ Buffer Buffer which on return will contain the physical\r
+ descriptor if one exists for the specified device\r
+ handle\r
+\r
+ BufferLength Length of buffer (in bytes)\r
+\r
+\r
+Return Value:\r
+ TRUE if successful\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+BOOLEAN __stdcall\r
+HidD_GetManufacturerString (\r
+ IN HANDLE HidDeviceObject,\r
+ OUT PVOID Buffer,\r
+ IN ULONG BufferLength\r
+ );\r
+/*++\r
+Routine Description:\r
+ This function retrieves the manufacturer string from the specified \r
+ Hid device. \r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device Object.\r
+ \r
+ Buffer Buffer which on return will contain the manufacturer\r
+ string returned from the device. This string is a \r
+ wide-character string\r
+\r
+ BufferLength Length of Buffer (in bytes)\r
+\r
+\r
+Return Value:\r
+ TRUE if successful\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+BOOLEAN __stdcall\r
+HidD_GetProductString (\r
+ IN HANDLE HidDeviceObject,\r
+ OUT PVOID Buffer,\r
+ IN ULONG BufferLength\r
+ );\r
+/*++\r
+Routine Description:\r
+ This function retrieves the product string from the specified \r
+ Hid device. \r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device Object.\r
+ \r
+ Buffer Buffer which on return will contain the product\r
+ string returned from the device. This string is a \r
+ wide-character string\r
+\r
+ BufferLength Length of Buffer (in bytes)\r
+\r
+\r
+Return Value:\r
+ TRUE if successful\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+BOOLEAN __stdcall\r
+HidD_GetIndexedString (\r
+ IN HANDLE HidDeviceObject,\r
+ IN ULONG StringIndex,\r
+ OUT PVOID Buffer,\r
+ IN ULONG BufferLength\r
+ );\r
+/*++\r
+Routine Description:\r
+ This function retrieves a string from the specified Hid device that is\r
+ specified with a certain string index.\r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device Object.\r
+ \r
+ StringIndex Index of the string to retrieve\r
+\r
+ Buffer Buffer which on return will contain the product\r
+ string returned from the device. This string is a \r
+ wide-character string\r
+\r
+ BufferLength Length of Buffer (in bytes)\r
+\r
+Return Value:\r
+ TRUE if successful\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+BOOLEAN __stdcall\r
+HidD_GetSerialNumberString (\r
+ IN HANDLE HidDeviceObject,\r
+ OUT PVOID Buffer,\r
+ IN ULONG BufferLength\r
+ );\r
+/*++\r
+Routine Description:\r
+ This function retrieves the serial number string from the specified \r
+ Hid device. \r
+\r
+Arguments:\r
+ HidDeviceObject A handle to a Hid Device Object.\r
+ \r
+ Buffer Buffer which on return will contain the serial number\r
+ string returned from the device. This string is a \r
+ wide-character string\r
+\r
+ BufferLength Length of Buffer (in bytes)\r
+\r
+Return Value:\r
+ TRUE if successful\r
+ FALSE otherwise -- Use GetLastError() to get extended error information\r
+--*/\r
+\r
+\r
+#include <poppack.h>\r
+\r
+#endif\r