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
cb987646
Commit
cb987646
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: Implement DIDBAM_PRESERVE BuildActionMap flag.
parent
782ad8f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
device.c
dlls/dinput/device.c
+4
-0
joystick8.c
dlls/dinput/tests/joystick8.c
+6
-8
No files found.
dlls/dinput/device.c
View file @
cb987646
...
...
@@ -1847,6 +1847,8 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface,
for
(
action
=
format
->
rgoAction
;
action
<
action_end
;
action
++
)
{
if
(
!
action
->
dwSemantic
)
return
DIERR_INVALIDPARAM
;
if
(
flags
==
DIDBAM_PRESERVE
&&
!
IsEqualCLSID
(
&
action
->
guidInstance
,
&
GUID_NULL
)
&&
!
IsEqualCLSID
(
&
action
->
guidInstance
,
&
impl
->
guid
))
continue
;
if
(
action
->
dwFlags
&
DIA_APPMAPPED
)
action
->
dwHow
=
DIAH_APPREQUESTED
;
else
action
->
dwHow
=
0
;
}
...
...
@@ -1864,6 +1866,8 @@ static HRESULT WINAPI dinput_device_BuildActionMap( IDirectInputDevice8W *iface,
for
(
action
=
format
->
rgoAction
;
action
<
action_end
;
action
++
)
{
if
(
action
->
dwHow
==
DIAH_APPREQUESTED
||
action
->
dwHow
==
DIAH_USERCONFIG
)
continue
;
if
(
flags
==
DIDBAM_PRESERVE
&&
!
IsEqualCLSID
(
&
action
->
guidInstance
,
&
GUID_NULL
)
&&
!
IsEqualCLSID
(
&
action
->
guidInstance
,
&
impl
->
guid
))
continue
;
if
(
action
->
dwFlags
&
DIA_APPNOMAP
)
continue
;
action
->
guidInstance
=
GUID_NULL
;
action
->
dwHow
=
0
;
...
...
dlls/dinput/tests/joystick8.c
View file @
cb987646
...
...
@@ -209,8 +209,8 @@ static BOOL CALLBACK check_no_created_effect_objects( IDirectInputEffect *effect
return
DIENUM_CONTINUE
;
}
#define check_diactionw( a, b ) check_diactionw_( __LINE__, a, b
, FALSE
)
static
void
check_diactionw_
(
int
line
,
const
DIACTIONW
*
actual
,
const
DIACTIONW
*
expected
,
BOOL
todo
)
#define check_diactionw( a, b ) check_diactionw_( __LINE__, a, b )
static
void
check_diactionw_
(
int
line
,
const
DIACTIONW
*
actual
,
const
DIACTIONW
*
expected
)
{
check_member_
(
__FILE__
,
line
,
*
actual
,
*
expected
,
"%#Ix"
,
uAppData
);
check_member_
(
__FILE__
,
line
,
*
actual
,
*
expected
,
"%#lx"
,
dwSemantic
);
...
...
@@ -219,15 +219,13 @@ static void check_diactionw_( int line, const DIACTIONW *actual, const DIACTIONW
check_member_wstr_
(
__FILE__
,
line
,
*
actual
,
*
expected
,
lptszActionName
);
else
check_member_
(
__FILE__
,
line
,
*
actual
,
*
expected
,
"%p"
,
lptszActionName
);
todo_wine_if
(
todo
)
check_member_guid_
(
__FILE__
,
line
,
*
actual
,
*
expected
,
guidInstance
);
check_member_
(
__FILE__
,
line
,
*
actual
,
*
expected
,
"%#lx"
,
dwObjID
);
todo_wine_if
(
todo
)
check_member_
(
__FILE__
,
line
,
*
actual
,
*
expected
,
"%#lx"
,
dwHow
);
}
#define check_diactionformatw( a, b ) check_diactionformatw_( __LINE__, a, b
, FALSE
)
static
void
check_diactionformatw_
(
int
line
,
const
DIACTIONFORMATW
*
actual
,
const
DIACTIONFORMATW
*
expected
,
BOOL
todo
)
#define check_diactionformatw( a, b ) check_diactionformatw_( __LINE__, a, b )
static
void
check_diactionformatw_
(
int
line
,
const
DIACTIONFORMATW
*
actual
,
const
DIACTIONFORMATW
*
expected
)
{
DWORD
i
;
check_member_
(
__FILE__
,
line
,
*
actual
,
*
expected
,
"%#lx"
,
dwSize
);
...
...
@@ -237,7 +235,7 @@ static void check_diactionformatw_( int line, const DIACTIONFORMATW *actual, con
for
(
i
=
0
;
i
<
min
(
actual
->
dwNumActions
,
expected
->
dwNumActions
);
++
i
)
{
winetest_push_context
(
"action[%lu]"
,
i
);
check_diactionw_
(
line
,
actual
->
rgoAction
+
i
,
expected
->
rgoAction
+
i
,
todo
&&
i
>=
2
);
check_diactionw_
(
line
,
actual
->
rgoAction
+
i
,
expected
->
rgoAction
+
i
);
winetest_pop_context
();
if
(
expected
->
dwActionSize
!=
sizeof
(
DIACTIONW
))
break
;
if
(
actual
->
dwActionSize
!=
sizeof
(
DIACTIONW
))
break
;
...
...
@@ -1377,7 +1375,7 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
ok
(
hr
==
DI_OK
,
"BuildActionMap returned %#lx
\n
"
,
hr
);
hr
=
IDirectInputDevice8_BuildActionMap
(
device
,
&
action_format
,
L"username"
,
DIDBAM_PRESERVE
);
ok
(
hr
==
DI_OK
,
"BuildActionMap returned %#lx
\n
"
,
hr
);
check_diactionformatw
_
(
__LINE__
,
&
action_format
,
&
expect_action_format_4
,
TRUE
);
check_diactionformatw
(
&
action_format
,
&
expect_action_format_4
);
IDirectInputDevice8_Release
(
keyboard
);
IDirectInputDevice8_Release
(
mouse
);
...
...
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