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
0fe8da86
Commit
0fe8da86
authored
Mar 22, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Allow action formats with no matching actions.
parent
b1a95b96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
13 deletions
+5
-13
device.c
dlls/dinput/device.c
+5
-9
joystick8.c
dlls/dinput/tests/joystick8.c
+0
-4
No files found.
dlls/dinput/device.c
View file @
0fe8da86
...
...
@@ -1964,8 +1964,8 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
};
WCHAR
username_buf
[
MAX_PATH
];
DWORD
username_len
=
MAX_PATH
;
int
i
,
index
,
num_actions
=
0
;
unsigned
int
offset
=
0
;
int
i
,
index
;
HRESULT
hr
;
FIXME
(
"iface %p, format %p, username %s, flags %#lx stub!
\n
"
,
iface
,
format
,
...
...
@@ -1973,14 +1973,7 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
if
(
!
format
)
return
DIERR_INVALIDPARAM
;
/* Count the actions */
for
(
i
=
0
;
i
<
format
->
dwNumActions
;
i
++
)
if
(
IsEqualGUID
(
&
impl
->
guid
,
&
format
->
rgoAction
[
i
].
guidInstance
))
num_actions
++
;
if
(
num_actions
==
0
)
return
DI_NOEFFECT
;
if
(
!
(
data_format
.
rgodf
=
malloc
(
sizeof
(
DIOBJECTDATAFORMAT
)
*
num_actions
)))
return
DIERR_OUTOFMEMORY
;
if
(
!
(
data_format
.
rgodf
=
malloc
(
sizeof
(
DIOBJECTDATAFORMAT
)
*
format
->
dwNumActions
)))
return
DIERR_OUTOFMEMORY
;
data_format
.
dwDataSize
=
format
->
dwDataSize
;
for
(
i
=
0
;
i
<
format
->
dwNumActions
;
i
++
,
offset
+=
sizeof
(
ULONG
))
...
...
@@ -2026,6 +2019,9 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
LeaveCriticalSection
(
&
impl
->
crit
);
free
(
data_format
.
rgodf
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
!
data_format
.
dwNumObjs
)
return
DI_NOEFFECT
;
return
hr
;
}
...
...
dlls/dinput/tests/joystick8.c
View file @
0fe8da86
...
...
@@ -824,9 +824,7 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
memset
(
prop_username
.
wsz
,
0
,
sizeof
(
prop_username
.
wsz
)
);
hr
=
IDirectInputDevice_GetProperty
(
device
,
DIPROP_USERNAME
,
&
prop_username
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
!
wcscmp
(
prop_username
.
wsz
,
username
),
"got username %s
\n
"
,
debugstr_w
(
prop_username
.
wsz
)
);
hr
=
IDirectInputDevice8_SetActionMap
(
device
,
&
voice_action_format
,
NULL
,
DIDSAM_DEFAULT
);
...
...
@@ -837,9 +835,7 @@ static void test_action_map( IDirectInputDevice8W *device, HANDLE file, HANDLE e
memset
(
prop_username
.
wsz
,
0
,
sizeof
(
prop_username
.
wsz
)
);
hr
=
IDirectInputDevice_GetProperty
(
device
,
DIPROP_USERNAME
,
&
prop_username
.
diph
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetProperty returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
!
wcscmp
(
prop_username
.
wsz
,
username
),
"got username %s
\n
"
,
debugstr_w
(
prop_username
.
wsz
)
);
...
...
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