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
4ce7ae4a
Commit
4ce7ae4a
authored
Oct 06, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Fill the HID joystick object instance exponent and dimension.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
489c62f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
42 deletions
+10
-42
joystick_hid.c
dlls/dinput/joystick_hid.c
+10
-0
hid.c
dlls/dinput8/tests/hid.c
+0
-42
No files found.
dlls/dinput/joystick_hid.c
View file @
4ce7ae4a
...
...
@@ -348,6 +348,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header,
instance
.
guidType
=
*
object_usage_to_guid
(
instance
.
wUsagePage
,
instance
.
wUsage
);
instance
.
wReportId
=
caps
->
report_id
;
instance
.
wCollectionNumber
=
caps
->
link_collection
;
instance
.
dwDimension
=
caps
->
units
;
instance
.
wExponent
=
caps
->
units_exp
;
check_pid_effect_axis_caps
(
impl
,
&
instance
);
ret
=
enum_object
(
impl
,
&
filter
,
flags
,
callback
,
caps
,
&
instance
,
data
);
if
(
ret
!=
DIENUM_CONTINUE
)
return
ret
;
...
...
@@ -384,6 +386,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header,
instance
.
guidType
=
*
object_usage_to_guid
(
instance
.
wUsagePage
,
instance
.
wUsage
);
instance
.
wReportId
=
caps
->
report_id
;
instance
.
wCollectionNumber
=
caps
->
link_collection
;
instance
.
dwDimension
=
caps
->
units
;
instance
.
wExponent
=
caps
->
units_exp
;
ret
=
enum_object
(
impl
,
&
filter
,
flags
,
callback
,
caps
,
&
instance
,
data
);
if
(
ret
!=
DIENUM_CONTINUE
)
return
ret
;
button_ofs
++
;
...
...
@@ -417,6 +421,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header,
instance
.
guidType
=
GUID_Unknown
;
instance
.
wReportId
=
nary
->
report_id
;
instance
.
wCollectionNumber
=
nary
->
link_collection
;
instance
.
dwDimension
=
caps
->
units
;
instance
.
wExponent
=
caps
->
units_exp
;
ret
=
enum_object
(
impl
,
&
filter
,
flags
,
callback
,
nary
,
&
instance
,
data
);
if
(
ret
!=
DIENUM_CONTINUE
)
return
ret
;
button_ofs
++
;
...
...
@@ -434,6 +440,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header,
instance
.
guidType
=
GUID_Unknown
;
instance
.
wReportId
=
caps
->
report_id
;
instance
.
wCollectionNumber
=
caps
->
link_collection
;
instance
.
dwDimension
=
caps
->
units
;
instance
.
wExponent
=
caps
->
units_exp
;
ret
=
enum_object
(
impl
,
&
filter
,
flags
,
callback
,
caps
,
&
instance
,
data
);
if
(
ret
!=
DIENUM_CONTINUE
)
return
ret
;
...
...
@@ -458,6 +466,8 @@ static BOOL enum_objects( struct hid_joystick *impl, const DIPROPHEADER *header,
instance
.
guidType
=
*
object_usage_to_guid
(
instance
.
wUsagePage
,
instance
.
wUsage
);
instance
.
wReportId
=
0
;
instance
.
wCollectionNumber
=
node
->
parent
;
instance
.
dwDimension
=
0
;
instance
.
wExponent
=
0
;
ret
=
enum_object
(
impl
,
&
filter
,
flags
,
callback
,
NULL
,
&
instance
,
data
);
if
(
ret
!=
DIENUM_CONTINUE
)
return
ret
;
}
...
...
dlls/dinput8/tests/hid.c
View file @
4ce7ae4a
...
...
@@ -3292,18 +3292,11 @@ static BOOL CALLBACK find_test_device( const DIDEVICEINSTANCEW *devinst, void *c
return
DIENUM_CONTINUE
;
}
struct
check_objects_todos
{
BOOL
dimension
;
BOOL
exponent
;
};
struct
check_objects_params
{
UINT
index
;
UINT
expect_count
;
const
DIDEVICEOBJECTINSTANCEW
*
expect_objs
;
const
struct
check_objects_todos
*
todo_objs
;
};
static
BOOL
CALLBACK
check_objects
(
const
DIDEVICEOBJECTINSTANCEW
*
obj
,
void
*
args
)
...
...
@@ -3311,7 +3304,6 @@ static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *ar
static
const
DIDEVICEOBJECTINSTANCEW
unexpected_obj
=
{
0
};
struct
check_objects_params
*
params
=
args
;
const
DIDEVICEOBJECTINSTANCEW
*
exp
=
params
->
expect_objs
+
params
->
index
;
const
struct
check_objects_todos
*
todo
=
params
->
todo_objs
+
params
->
index
;
winetest_push_context
(
"obj[%d]"
,
params
->
index
);
...
...
@@ -3330,9 +3322,7 @@ static BOOL CALLBACK check_objects( const DIDEVICEOBJECTINSTANCEW *obj, void *ar
check_member
(
*
obj
,
*
exp
,
"%u"
,
wDesignatorIndex
);
check_member
(
*
obj
,
*
exp
,
"%#04x"
,
wUsagePage
);
check_member
(
*
obj
,
*
exp
,
"%#04x"
,
wUsage
);
todo_wine_if
(
todo
->
dimension
)
check_member
(
*
obj
,
*
exp
,
"%#04x"
,
dwDimension
);
todo_wine_if
(
todo
->
exponent
)
check_member
(
*
obj
,
*
exp
,
"%#04x"
,
wExponent
);
check_member
(
*
obj
,
*
exp
,
"%u"
,
wReportId
);
...
...
@@ -3652,14 +3642,12 @@ static void test_simple_joystick(void)
.
wUsage
=
HID_USAGE_GENERIC_JOYSTICK
,
},
};
const
struct
check_objects_todos
objects_todos
[
ARRAY_SIZE
(
expect_objects
)]
=
{};
const
DIEFFECTINFOW
expect_effects
[]
=
{};
struct
check_objects_params
check_objects_params
=
{
.
expect_count
=
ARRAY_SIZE
(
expect_objects
),
.
expect_objs
=
expect_objects
,
.
todo_objs
=
objects_todos
,
};
struct
check_effects_params
check_effects_params
=
{
...
...
@@ -6386,35 +6374,6 @@ static void test_force_feedback_joystick( void )
.
wUsage
=
PID_USAGE_SET_ENVELOPE_REPORT
,
},
};
const
struct
check_objects_todos
objects_todos
[
ARRAY_SIZE
(
expect_objects
)]
=
{
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{.
dimension
=
TRUE
,
.
exponent
=
TRUE
},
{.
dimension
=
TRUE
,
.
exponent
=
TRUE
},
{},
{},
{},
{},
{.
dimension
=
TRUE
,
.
exponent
=
TRUE
},
{.
dimension
=
TRUE
,
.
exponent
=
TRUE
},
};
const
DIEFFECTINFOW
expect_effects
[]
=
{
{
...
...
@@ -6443,7 +6402,6 @@ static void test_force_feedback_joystick( void )
{
.
expect_count
=
ARRAY_SIZE
(
expect_objects
),
.
expect_objs
=
expect_objects
,
.
todo_objs
=
objects_todos
,
};
struct
check_effects_params
check_effects_params
=
{
...
...
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