hid: Implement HidD_GetAttributes.

This commit is contained in:
Aric Stewart 2015-06-30 07:40:27 -05:00 committed by Alexandre Julliard
parent eac15cae71
commit 674080da91
3 changed files with 28 additions and 2 deletions

View File

@ -1,6 +1,6 @@
@ stub HidD_FlushQueue @ stub HidD_FlushQueue
@ stdcall HidD_FreePreparsedData(ptr) @ stdcall HidD_FreePreparsedData(ptr)
@ stub HidD_GetAttributes @ stdcall HidD_GetAttributes(long ptr)
@ stub HidD_GetConfiguration @ stub HidD_GetConfiguration
@ stdcall HidD_GetFeature(long ptr long) @ stdcall HidD_GetFeature(long ptr long)
@ stdcall HidD_GetHidGuid(ptr) @ stdcall HidD_GetHidGuid(ptr)

View File

@ -34,7 +34,7 @@
#include "hidusage.h" #include "hidusage.h"
#include "ddk/hidclass.h" #include "ddk/hidclass.h"
#include "ddk/hidpi.h" #include "ddk/hidsdi.h"
WINE_DEFAULT_DEBUG_CHANNEL(hid); WINE_DEFAULT_DEBUG_CHANNEL(hid);
@ -45,6 +45,24 @@ BOOLEAN WINAPI HidD_FreePreparsedData(PHIDP_PREPARSED_DATA PreparsedData)
return TRUE; return TRUE;
} }
BOOLEAN WINAPI HidD_GetAttributes(HANDLE HidDeviceObject, PHIDD_ATTRIBUTES Attr)
{
HID_COLLECTION_INFORMATION info;
BOOLEAN ret;
TRACE("(%p %p)\n", HidDeviceObject, Attr);
ret = DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_COLLECTION_INFORMATION, NULL, 0, &info, sizeof(HID_COLLECTION_INFORMATION), NULL, NULL);
if (ret)
{
Attr->VendorID = info.VendorID;
Attr->ProductID = info.ProductID;
Attr->VersionNumber = info.VersionNumber;
}
return ret;
}
BOOLEAN WINAPI HidD_GetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength) BOOLEAN WINAPI HidD_GetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength)
{ {
TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength); TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength);

View File

@ -27,6 +27,13 @@
typedef LONG NTSTATUS; typedef LONG NTSTATUS;
#endif #endif
typedef struct _HIDD_ATTRIBUTES {
ULONG Size;
USHORT VendorID;
USHORT ProductID;
USHORT VersionNumber;
} HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES;
BOOLEAN WINAPI HidD_GetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength); BOOLEAN WINAPI HidD_GetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength);
void WINAPI HidD_GetHidGuid(LPGUID guid); void WINAPI HidD_GetHidGuid(LPGUID guid);
BOOLEAN WINAPI HidD_GetInputReport(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength); BOOLEAN WINAPI HidD_GetInputReport(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength);
@ -35,5 +42,6 @@ BOOLEAN WINAPI HidD_GetProductString(HANDLE HidDeviceObject, PVOID Buffer, ULONG
BOOLEAN WINAPI HidD_SetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength); BOOLEAN WINAPI HidD_SetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength);
BOOLEAN WINAPI HidD_GetPreparsedData( HANDLE HidDeviceObject, PHIDP_PREPARSED_DATA *PreparsedData); BOOLEAN WINAPI HidD_GetPreparsedData( HANDLE HidDeviceObject, PHIDP_PREPARSED_DATA *PreparsedData);
BOOLEAN WINAPI HidD_FreePreparsedData(PHIDP_PREPARSED_DATA PreparsedData); BOOLEAN WINAPI HidD_FreePreparsedData(PHIDP_PREPARSED_DATA PreparsedData);
BOOLEAN WINAPI HidD_GetAttributes(HANDLE HidDeviceObject, PHIDD_ATTRIBUTES Attr);
#endif /* __WINE_HIDSDI_H */ #endif /* __WINE_HIDSDI_H */