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
782ad8f7
Commit
782ad8f7
authored
Mar 24, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Check device type in BuildActionMap for specific semantics.
parent
18b5f795
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
device.c
dlls/dinput/device.c
+13
-4
No files found.
dlls/dinput/device.c
View file @
782ad8f7
...
...
@@ -1785,7 +1785,8 @@ static HRESULT WINAPI dinput_device_WriteEffectToFile( IDirectInputDevice8W *ifa
return
DI_OK
;
}
static
BOOL
object_matches_semantic
(
const
DIOBJECTDATAFORMAT
*
object
,
DWORD
semantic
,
BOOL
exact
)
static
BOOL
object_matches_semantic
(
const
DIDEVICEINSTANCEW
*
instance
,
const
DIOBJECTDATAFORMAT
*
object
,
DWORD
semantic
,
BOOL
exact
)
{
DWORD
value
=
semantic
&
0xff
,
axis
=
(
semantic
>>
15
)
&
3
,
type
;
...
...
@@ -1799,7 +1800,15 @@ static BOOL object_matches_semantic( const DIOBJECTDATAFORMAT *object, DWORD sem
}
if
(
!
(
DIDFT_GETTYPE
(
object
->
dwType
)
&
type
))
return
FALSE
;
if
((
semantic
&
0xf0000000
)
==
0x80000000
)
return
object
->
dwOfs
==
value
;
if
((
semantic
&
0xf0000000
)
==
0x80000000
)
{
switch
(
semantic
&
0x0f000000
)
{
case
0x01000000
:
return
(
instance
->
dwDevType
&
0xf
)
==
DIDEVTYPE_KEYBOARD
&&
object
->
dwOfs
==
value
;
case
0x02000000
:
return
(
instance
->
dwDevType
&
0xf
)
==
DIDEVTYPE_MOUSE
&&
object
->
dwOfs
==
value
;
default:
return
FALSE
;
}
}
if
(
axis
&&
(
axis
-
1
)
!=
DIDFT_GETINSTANCE
(
object
->
dwType
))
return
FALSE
;
return
!
exact
||
!
value
||
value
==
DIDFT_GETINSTANCE
(
object
->
dwType
)
+
1
;
}
...
...
@@ -1872,7 +1881,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
(
object
,
action
->
dwSemantic
,
TRUE
))
continue
;
if
(
!
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
;
...
...
@@ -1891,7 +1900,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
(
object
,
action
->
dwSemantic
,
FALSE
))
continue
;
if
(
!
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
;
...
...
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