@@ -106,6 +106,7 @@ extern "C" {
106
106
typedef BOOLEAN (__stdcall * HidD_GetPreparsedData_ )(HANDLE handle , PHIDP_PREPARSED_DATA * preparsed_data );
107
107
typedef BOOLEAN (__stdcall * HidD_FreePreparsedData_ )(PHIDP_PREPARSED_DATA preparsed_data );
108
108
typedef NTSTATUS (__stdcall * HidP_GetCaps_ )(PHIDP_PREPARSED_DATA preparsed_data , HIDP_CAPS * caps );
109
+ typedef BOOLEAN (__stdcall * HidD_SetNumInputBuffers_ )(HANDLE handle , ULONG number_buffers );
109
110
110
111
static HidD_GetAttributes_ HidD_GetAttributes ;
111
112
static HidD_GetSerialNumberString_ HidD_GetSerialNumberString ;
@@ -117,6 +118,7 @@ extern "C" {
117
118
static HidD_GetPreparsedData_ HidD_GetPreparsedData ;
118
119
static HidD_FreePreparsedData_ HidD_FreePreparsedData ;
119
120
static HidP_GetCaps_ HidP_GetCaps ;
121
+ static HidD_SetNumInputBuffers_ HidD_SetNumInputBuffers ;
120
122
121
123
static HMODULE lib_handle = NULL ;
122
124
static BOOLEAN initialized = FALSE;
@@ -206,6 +208,7 @@ static int lookup_functions()
206
208
RESOLVE (HidD_GetPreparsedData );
207
209
RESOLVE (HidD_FreePreparsedData );
208
210
RESOLVE (HidP_GetCaps );
211
+ RESOLVE (HidD_SetNumInputBuffers );
209
212
#undef RESOLVE
210
213
}
211
214
else
@@ -567,6 +570,13 @@ HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path)
567
570
goto err ;
568
571
}
569
572
573
+ /* Set the Input Report buffer size to 64 reports. */
574
+ res = HidD_SetNumInputBuffers (dev -> device_handle , 64 );
575
+ if (!res ) {
576
+ register_error (dev , "HidD_SetNumInputBuffers" );
577
+ goto err ;
578
+ }
579
+
570
580
/* Get the Input Report length for the device. */
571
581
res = HidD_GetPreparsedData (dev -> device_handle , & pp_data );
572
582
if (!res ) {
0 commit comments