return DeviceIoControl(HidDeviceObject, IOCTL_HID_FLUSH_QUEUE,
NULL, 0,
NULL, 0,
- &RetLen, NULL);
+ &RetLen, NULL) != 0;
}
return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_FEATURE,
NULL, 0,
ReportBuffer, ReportBufferLength,
- &RetLen, NULL);
+ &RetLen, NULL) != 0;
}
return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_INPUT_REPORT,
NULL, 0,
ReportBuffer, ReportBufferLength,
- &RetLen, NULL);
+ &RetLen, NULL) != 0;
}
return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_MANUFACTURER_STRING,
NULL, 0,
Buffer, BufferLength,
- &RetLen, NULL);
+ &RetLen, NULL) != 0;
}
return DeviceIoControl(HidDeviceObject, IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS,
NULL, 0,
NumberBuffers, sizeof(ULONG),
- &RetLen, NULL);
+ &RetLen, NULL) != 0;
}
return DeviceIoControl(HidDeviceObject, IOCTL_GET_PHYSICAL_DESCRIPTOR,
NULL, 0,
Buffer, BufferLength,
- &RetLen, NULL);
+ &RetLen, NULL) != 0;
}
{
HID_COLLECTION_INFORMATION hci;
DWORD RetLen;
- BOOL Ret;
+ BOOLEAN Ret;
if(PreparsedData == NULL)
{
Ret = DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_COLLECTION_DESCRIPTOR,
NULL, 0,
*PreparsedData, hci.DescriptorSize,
- &RetLen, NULL);
+ &RetLen, NULL) != 0;
if(!Ret)
{
return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_PRODUCT_STRING,
NULL, 0,
Buffer, BufferLength,
- &RetLen, NULL);
+ &RetLen, NULL) != 0;
}
return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_SERIALNUMBER_STRING,
NULL, 0,
Buffer, BufferLength,
- &RetLen, NULL);
+ &RetLen, NULL) != 0;
}
return DeviceIoControl(HidDeviceObject, IOCTL_HID_SET_FEATURE,
ReportBuffer, ReportBufferLength,
NULL, 0,
- &RetLen, NULL);
+ &RetLen, NULL) != 0;
}
return DeviceIoControl(HidDeviceObject, IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS,
&NumberBuffers, sizeof(ULONG),
NULL, 0,
- &RetLen, NULL);
+ &RetLen, NULL) != 0;
}
return DeviceIoControl(HidDeviceObject, IOCTL_HID_SET_OUTPUT_REPORT,
ReportBuffer, ReportBufferLength,
NULL, 0,
- &RetLen, NULL);
+ &RetLen, NULL) != 0;
}
+/*
+ * HidD_GetIndexedString EXPORTED
+ *
+ * @implemented
+ */
+HIDAPI
+BOOLEAN WINAPI
+HidD_GetIndexedString(IN HANDLE HidDeviceObject,
+ IN ULONG StringIndex,
+ OUT PVOID Buffer,
+ IN ULONG BufferLength)
+{
+ DWORD RetLen;
+ return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_INDEXED_STRING,
+ &StringIndex, sizeof(ULONG),
+ Buffer, BufferLength,
+ &RetLen, NULL) != 0;
+}
+
+/*
+ * HidD_GetMsGenreDescriptor EXPORTED
+ *
+ * @implemented
+ */
+HIDAPI
+BOOLEAN WINAPI
+HidD_GetMsGenreDescriptor(IN HANDLE HidDeviceObject,
+ OUT PVOID Buffer,
+ IN ULONG BufferLength)
+{
+ DWORD RetLen;
+ return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_MS_GENRE_DESCRIPTOR,
+ 0, 0,
+ Buffer, BufferLength,
+ &RetLen, NULL) != 0;
+}
+
+/*
+ * HidD_GetConfiguration EXPORTED
+ *
+ * @implemented
+ */
+HIDAPI
+BOOLEAN WINAPI
+HidD_GetConfiguration(IN HANDLE HidDeviceObject,
+ OUT PHIDD_CONFIGURATION Configuration,
+ IN ULONG ConfigurationLength)
+{
+
+ // magic cookie
+ Configuration->cookie = (PVOID)HidD_GetConfiguration;
+
+ return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_DRIVER_CONFIG,
+ 0, 0,
+ &Configuration->size, ConfigurationLength - sizeof(ULONG),
+ (PULONG)&Configuration->cookie, NULL) != 0;
+}
+
+/*
+ * HidD_SetConfiguration EXPORTED
+ *
+ * @implemented
+ */
+HIDAPI
+BOOLEAN WINAPI
+HidD_SetConfiguration(IN HANDLE HidDeviceObject,
+ IN PHIDD_CONFIGURATION Configuration,
+ IN ULONG ConfigurationLength)
+{
+ BOOLEAN Ret = FALSE;
+
+ if (Configuration->cookie == (PVOID)HidD_GetConfiguration)
+ {
+ Ret = DeviceIoControl(HidDeviceObject, IOCTL_HID_SET_DRIVER_CONFIG,
+ 0, 0,
+ (PVOID)&Configuration->size, ConfigurationLength - sizeof(ULONG),
+ (PULONG)&Configuration->cookie, NULL) != 0;
+ }
+ else
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ }
+
+ return Ret;
+}
+
+/*
+ * HidP_GetUsagesEx EXPORTED
+ *
+ * @implemented
+ */
+HIDAPI
+NTSTATUS WINAPI
+HidP_GetUsagesEx(IN HIDP_REPORT_TYPE ReportType,
+ IN USHORT LinkCollection,
+ OUT PUSAGE_AND_PAGE ButtonList,
+ IN OUT ULONG *UsageLength,
+ IN PHIDP_PREPARSED_DATA PreparsedData,
+ IN PCHAR Report,
+ IN ULONG ReportLength)
+{
+ return HidP_GetUsages(ReportType, ButtonList->UsagePage, LinkCollection, &ButtonList->Usage, UsageLength, PreparsedData, Report, ReportLength);
+}
+
+
/* EOF */