Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4ee3edf9
Commit
4ee3edf9
authored
Apr 26, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
May 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/tests: Enforce HID report descriptor buffer size.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b8a54fb1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
11 deletions
+32
-11
driver_bus.c
dlls/dinput/tests/driver_bus.c
+1
-1
driver_hid.h
dlls/dinput/tests/driver_hid.h
+3
-1
force_feedback.c
dlls/dinput/tests/force_feedback.c
+7
-4
hid.c
dlls/dinput/tests/hid.c
+4
-0
hotplug.c
dlls/dinput/tests/hotplug.c
+1
-0
joystick8.c
dlls/dinput/tests/joystick8.c
+16
-5
No files found.
dlls/dinput/tests/driver_bus.c
View file @
4ee3edf9
...
...
@@ -458,7 +458,7 @@ struct phys_device
BOOL
use_report_id
;
DWORD
report_descriptor_len
;
char
report_descriptor_buf
[
1024
];
char
report_descriptor_buf
[
MAX_HID_DESCRIPTOR_LEN
];
HIDP_CAPS
caps
;
HID_DEVICE_ATTRIBUTES
attributes
;
...
...
dlls/dinput/tests/driver_hid.h
View file @
4ee3edf9
...
...
@@ -62,13 +62,15 @@ struct hid_expect
};
/* create/remove device */
#define MAX_HID_DESCRIPTOR_LEN 2048
struct
hid_device_desc
{
BOOL
is_polled
;
BOOL
use_report_id
;
DWORD
report_descriptor_len
;
char
report_descriptor_buf
[
1024
];
char
report_descriptor_buf
[
MAX_HID_DESCRIPTOR_LEN
];
HIDP_CAPS
caps
;
HID_DEVICE_ATTRIBUTES
attributes
;
...
...
dlls/dinput/tests/force_feedback.c
View file @
4ee3edf9
...
...
@@ -1672,7 +1672,8 @@ static void test_condition_effect( IDirectInputDevice8W *device, HANDLE file, DW
static
BOOL
test_force_feedback_joystick
(
DWORD
version
)
{
#include "psh_hid_macros.h"
const
unsigned
char
report_descriptor
[]
=
{
const
unsigned
char
report_descriptor
[]
=
{
USAGE_PAGE
(
1
,
HID_USAGE_PAGE_GENERIC
),
USAGE
(
1
,
HID_USAGE_GENERIC_JOYSTICK
),
COLLECTION
(
1
,
Application
),
...
...
@@ -2005,7 +2006,7 @@ static BOOL test_force_feedback_joystick( DWORD version )
END_COLLECTION
,
END_COLLECTION
,
};
#undef REPORT_ID_OR_USAGE_PAGE
C_ASSERT
(
sizeof
(
report_descriptor
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
struct
hid_device_desc
desc
=
...
...
@@ -3460,6 +3461,7 @@ static void test_device_managed_effect(void)
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
report_descriptor
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
struct
hid_device_desc
desc
=
...
...
@@ -4576,7 +4578,8 @@ struct bool_async_handler default_bool_async_handler = {{&bool_async_handler_vtb
static
void
test_windows_gaming_input
(
void
)
{
#include "psh_hid_macros.h"
const
unsigned
char
report_desc
[]
=
{
const
unsigned
char
report_desc
[]
=
{
USAGE_PAGE
(
1
,
HID_USAGE_PAGE_GENERIC
),
USAGE
(
1
,
HID_USAGE_GENERIC_JOYSTICK
),
COLLECTION
(
1
,
Application
),
...
...
@@ -4997,7 +5000,7 @@ static void test_windows_gaming_input(void)
END_COLLECTION
,
END_COLLECTION
,
};
#undef REPORT_ID_OR_USAGE_PAGE
C_ASSERT
(
sizeof
(
report_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
struct
hid_device_desc
desc
=
...
...
dlls/dinput/tests/hid.c
View file @
4ee3edf9
...
...
@@ -2854,6 +2854,7 @@ static void test_hid_driver( DWORD report_id, DWORD polled )
END_COLLECTION
,
};
#undef REPORT_ID_OR_USAGE_PAGE
C_ASSERT
(
sizeof
(
report_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
const
HIDP_CAPS
caps
=
...
...
@@ -3062,6 +3063,7 @@ static void test_hidp_kdr(void)
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
report_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
struct
hid_device_desc
desc
=
...
...
@@ -3571,6 +3573,7 @@ DWORD WINAPI dinput_test_device_thread( void *stop_event )
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
gamepad_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
static
const
HID_DEVICE_ATTRIBUTES
attributes
=
{
...
...
@@ -3615,6 +3618,7 @@ static void test_bus_driver(void)
INPUT
(
1
,
Data
|
Var
|
Abs
),
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
report_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
static
const
HID_DEVICE_ATTRIBUTES
attributes
=
...
...
dlls/dinput/tests/hotplug.c
View file @
4ee3edf9
...
...
@@ -133,6 +133,7 @@ static BOOL test_input_lost( DWORD version )
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
report_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
struct
hid_device_desc
desc
=
...
...
dlls/dinput/tests/joystick8.c
View file @
4ee3edf9
...
...
@@ -396,7 +396,7 @@ static void test_simple_joystick( DWORD version )
END_COLLECTION
,
END_COLLECTION
,
};
#undef REPORT_ID_OR_USAGE_PAGE
C_ASSERT
(
sizeof
(
report_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
struct
hid_device_desc
desc
=
...
...
@@ -2110,6 +2110,7 @@ static BOOL test_device_types( DWORD version )
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
unknown_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
static
const
unsigned
char
limited_desc
[]
=
{
USAGE_PAGE
(
1
,
HID_USAGE_PAGE_GENERIC
),
...
...
@@ -2140,6 +2141,7 @@ static BOOL test_device_types( DWORD version )
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
limited_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
static
const
unsigned
char
gamepad_desc
[]
=
{
USAGE_PAGE
(
1
,
HID_USAGE_PAGE_GENERIC
),
...
...
@@ -2170,6 +2172,7 @@ static BOOL test_device_types( DWORD version )
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
gamepad_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
static
const
unsigned
char
joystick_desc
[]
=
{
USAGE_PAGE
(
1
,
HID_USAGE_PAGE_GENERIC
),
...
...
@@ -2210,6 +2213,7 @@ static BOOL test_device_types( DWORD version )
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
joystick_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
static
const
unsigned
char
wheel_steering_only_desc
[]
=
{
USAGE_PAGE
(
1
,
HID_USAGE_PAGE_GENERIC
),
...
...
@@ -2248,6 +2252,7 @@ static BOOL test_device_types( DWORD version )
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
wheel_steering_only_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
static
const
unsigned
char
wheel_dualpedals_desc
[]
=
{
USAGE_PAGE
(
1
,
HID_USAGE_PAGE_GENERIC
),
...
...
@@ -2289,6 +2294,7 @@ static BOOL test_device_types( DWORD version )
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
wheel_dualpedals_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
static
const
unsigned
char
wheel_threepedals_desc
[]
=
{
USAGE_PAGE
(
1
,
HID_USAGE_PAGE_GENERIC
),
...
...
@@ -2331,6 +2337,7 @@ static BOOL test_device_types( DWORD version )
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
wheel_threepedals_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
static
struct
device_desc
device_desc
[]
=
...
...
@@ -2690,7 +2697,7 @@ static void test_many_axes_joystick(void)
END_COLLECTION
,
END_COLLECTION
,
};
#undef REPORT_ID_OR_USAGE_PAGE
C_ASSERT
(
sizeof
(
report_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
struct
hid_device_desc
desc
=
...
...
@@ -3221,7 +3228,7 @@ static void test_driving_wheel_axes(void)
END_COLLECTION
,
END_COLLECTION
,
};
#undef REPORT_ID_OR_USAGE_PAGE
C_ASSERT
(
sizeof
(
report_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
struct
hid_device_desc
desc
=
...
...
@@ -3415,7 +3422,8 @@ done:
static
BOOL
test_winmm_joystick
(
void
)
{
#include "psh_hid_macros.h"
const
unsigned
char
report_desc
[]
=
{
const
unsigned
char
report_desc
[]
=
{
USAGE_PAGE
(
1
,
HID_USAGE_PAGE_GENERIC
),
USAGE
(
1
,
HID_USAGE_GENERIC_JOYSTICK
),
COLLECTION
(
1
,
Application
),
...
...
@@ -3461,6 +3469,7 @@ static BOOL test_winmm_joystick(void)
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
report_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
struct
hid_device_desc
desc
=
...
...
@@ -3864,7 +3873,8 @@ static struct controller_handler controller_added = {{&controller_handler_vtbl}}
static
void
test_windows_gaming_input
(
void
)
{
#include "psh_hid_macros.h"
const
unsigned
char
report_desc
[]
=
{
const
unsigned
char
report_desc
[]
=
{
USAGE_PAGE
(
1
,
HID_USAGE_PAGE_GENERIC
),
USAGE
(
1
,
HID_USAGE_GENERIC_GAMEPAD
),
COLLECTION
(
1
,
Application
),
...
...
@@ -3906,6 +3916,7 @@ static void test_windows_gaming_input(void)
END_COLLECTION
,
END_COLLECTION
,
};
C_ASSERT
(
sizeof
(
report_desc
)
<
MAX_HID_DESCRIPTOR_LEN
);
#include "pop_hid_macros.h"
struct
hid_device_desc
desc
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment