Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d62e2268
Commit
d62e2268
authored
Mar 27, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Rewrite IDirectInput8_EnumDevicesBySemantics.
Simplifying and fixing it.
parent
cb987646
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
118 deletions
+90
-118
device.c
dlls/dinput/device.c
+3
-3
device_private.h
dlls/dinput/device_private.h
+2
-0
dinput.c
dlls/dinput/dinput.c
+84
-114
joystick8.c
dlls/dinput/tests/joystick8.c
+1
-1
No files found.
dlls/dinput/device.c
View file @
d62e2268
...
...
@@ -1785,7 +1785,7 @@ static HRESULT WINAPI dinput_device_WriteEffectToFile( IDirectInputDevice8W *ifa
return
DI_OK
;
}
static
BOOL
object_matches_semantic
(
const
DIDEVICEINSTANCEW
*
instance
,
const
DIOBJECTDATAFORMAT
*
object
,
BOOL
device_
object_matches_semantic
(
const
DIDEVICEINSTANCEW
*
instance
,
const
DIOBJECTDATAFORMAT
*
object
,
DWORD
semantic
,
BOOL
exact
)
{
DWORD
value
=
semantic
&
0xff
,
axis
=
(
semantic
>>
15
)
&
3
,
type
;
...
...
@@ -1885,7 +1885,7 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface,
for
(
object
=
impl
->
device_format
.
rgodf
;
object
<
object_end
;
object
++
)
{
if
(
mapped
[
object
-
impl
->
device_format
.
rgodf
])
continue
;
if
(
!
object_matches_semantic
(
&
impl
->
instance
,
object
,
action
->
dwSemantic
,
TRUE
))
continue
;
if
(
!
device_
object_matches_semantic
(
&
impl
->
instance
,
object
,
action
->
dwSemantic
,
TRUE
))
continue
;
if
((
action
->
dwFlags
&
DIA_FORCEFEEDBACK
)
&&
!
(
object
->
dwType
&
DIDFT_FFACTUATOR
))
continue
;
action
->
dwObjID
=
object
->
dwType
;
action
->
guidInstance
=
impl
->
guid
;
...
...
@@ -1904,7 +1904,7 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface,
for
(
object
=
impl
->
device_format
.
rgodf
;
object
<
object_end
;
object
++
)
{
if
(
mapped
[
object
-
impl
->
device_format
.
rgodf
])
continue
;
if
(
!
object_matches_semantic
(
&
impl
->
instance
,
object
,
action
->
dwSemantic
,
FALSE
))
continue
;
if
(
!
device_
object_matches_semantic
(
&
impl
->
instance
,
object
,
action
->
dwSemantic
,
FALSE
))
continue
;
if
((
action
->
dwFlags
&
DIA_FORCEFEEDBACK
)
&&
!
(
object
->
dwType
&
DIDFT_FFACTUATOR
))
continue
;
action
->
dwObjID
=
object
->
dwType
;
action
->
guidInstance
=
impl
->
guid
;
...
...
dlls/dinput/device_private.h
View file @
d62e2268
...
...
@@ -128,6 +128,8 @@ extern void dinput_device_internal_release( struct dinput_device *device );
extern
HRESULT
dinput_device_init_device_format
(
IDirectInputDevice8W
*
iface
);
extern
int
dinput_device_object_index_from_id
(
IDirectInputDevice8W
*
iface
,
DWORD
id
);
extern
BOOL
device_object_matches_semantic
(
const
DIDEVICEINSTANCEW
*
instance
,
const
DIOBJECTDATAFORMAT
*
object
,
DWORD
semantic
,
BOOL
exact
);
extern
BOOL
get_app_key
(
HKEY
*
,
HKEY
*
)
DECLSPEC_HIDDEN
;
extern
DWORD
get_config_key
(
HKEY
,
HKEY
,
const
WCHAR
*
,
WCHAR
*
,
DWORD
)
DECLSPEC_HIDDEN
;
...
...
dlls/dinput/dinput.c
View file @
d62e2268
This diff is collapsed.
Click to expand it.
dlls/dinput/tests/joystick8.c
View file @
d62e2268
...
...
@@ -445,7 +445,7 @@ static BOOL CALLBACK enum_devices_by_semantic( const DIDEVICEINSTANCEW *instance
if
(
remaining
==
2
)
{
expect_instance
=
&
expect_joystick
;
todo_wine
ok
(
flags
==
(
context
?
3
:
0
),
"got flags %#lx
\n
"
,
flags
);
ok
(
flags
==
(
context
?
3
:
0
),
"got flags %#lx
\n
"
,
flags
);
}
else
if
(
remaining
==
1
)
{
...
...
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