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
63637f24
Commit
63637f24
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: Return error from SetActionMap if SetDataFormat fails.
parent
c6a922c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
21 deletions
+27
-21
device.c
dlls/dinput/device.c
+27
-21
No files found.
dlls/dinput/device.c
View file @
63637f24
...
@@ -2013,14 +2013,13 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
...
@@ -2013,14 +2013,13 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
int
i
,
index
,
action
=
0
,
num_actions
=
0
;
int
i
,
index
,
action
=
0
,
num_actions
=
0
;
unsigned
int
offset
=
0
;
unsigned
int
offset
=
0
;
ActionMap
*
action_map
;
ActionMap
*
action_map
;
HRESULT
hr
;
FIXME
(
"iface %p, format %p, username %s, flags %#lx stub!
\n
"
,
iface
,
format
,
FIXME
(
"iface %p, format %p, username %s, flags %#lx stub!
\n
"
,
iface
,
format
,
debugstr_w
(
username
),
flags
);
debugstr_w
(
username
),
flags
);
if
(
!
format
)
return
DIERR_INVALIDPARAM
;
if
(
!
format
)
return
DIERR_INVALIDPARAM
;
if
(
impl
->
status
==
STATUS_ACQUIRED
)
return
DIERR_ACQUIRED
;
/* Count the actions */
/* Count the actions */
for
(
i
=
0
;
i
<
format
->
dwNumActions
;
i
++
)
for
(
i
=
0
;
i
<
format
->
dwNumActions
;
i
++
)
if
(
IsEqualGUID
(
&
impl
->
guid
,
&
format
->
rgoAction
[
i
].
guidInstance
))
if
(
IsEqualGUID
(
&
impl
->
guid
,
&
format
->
rgoAction
[
i
].
guidInstance
))
...
@@ -2046,33 +2045,40 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
...
@@ -2046,33 +2045,40 @@ static HRESULT WINAPI dinput_device_SetActionMap( IDirectInputDevice8W *iface, D
data_format
.
dwNumObjs
++
;
data_format
.
dwNumObjs
++
;
}
}
IDirectInputDevice8_SetDataFormat
(
iface
,
&
data_forma
t
);
EnterCriticalSection
(
&
impl
->
cri
t
);
impl
->
action_map
=
action_map
;
if
(
FAILED
(
hr
=
IDirectInputDevice8_SetDataFormat
(
iface
,
&
data_format
)))
impl
->
num_actions
=
num_actions
;
WARN
(
"Failed to set data format from action map, hr %#lx
\n
"
,
hr
);
else
{
impl
->
action_map
=
action_map
;
impl
->
num_actions
=
num_actions
;
free
(
data_format
.
rgodf
);
if
(
format
->
lAxisMin
!=
format
->
lAxisMax
)
{
prop_range
.
lMin
=
format
->
lAxisMin
;
prop_range
.
lMax
=
format
->
lAxisMax
;
IDirectInputDevice8_SetProperty
(
iface
,
DIPROP_RANGE
,
&
prop_range
.
diph
);
}
if
(
format
->
lAxisMin
!=
format
->
lAxisMax
)
prop_buffer
.
dwData
=
format
->
dwBufferSize
;
{
IDirectInputDevice8_SetProperty
(
iface
,
DIPROP_BUFFERSIZE
,
&
prop_buffer
.
diph
);
prop_range
.
lMin
=
format
->
lAxisMin
;
prop_range
.
lMax
=
format
->
lAxisMax
;
IDirectInputDevice8_SetProperty
(
iface
,
DIPROP_RANGE
,
&
prop_range
.
diph
);
}
prop_buffer
.
dwData
=
format
->
dwBufferSize
;
if
(
username
==
NULL
)
GetUserNameW
(
username_buf
,
&
username_len
)
;
IDirectInputDevice8_SetProperty
(
iface
,
DIPROP_BUFFERSIZE
,
&
prop_buffer
.
diph
);
else
lstrcpynW
(
username_buf
,
username
,
MAX_PATH
);
if
(
username
==
NULL
)
GetUserNameW
(
username_buf
,
&
username_len
);
if
(
flags
&
DIDSAM_NOUSER
)
prop_username
.
wsz
[
0
]
=
'\0'
;
else
lstrcpynW
(
username_buf
,
username
,
MAX_PATH
);
else
lstrcpynW
(
prop_username
.
wsz
,
username_buf
,
ARRAY_SIZE
(
prop_username
.
wsz
)
);
dinput_device_set_username
(
impl
,
&
prop_username
);
if
(
flags
&
DIDSAM_NOUSER
)
prop_username
.
wsz
[
0
]
=
'\0'
;
save_mapping_settings
(
iface
,
format
,
username_buf
);
else
lstrcpynW
(
prop_username
.
wsz
,
username_buf
,
ARRAY_SIZE
(
prop_username
.
wsz
)
);
}
dinput_device_set_username
(
impl
,
&
prop_username
);
save_mapping_settings
(
iface
,
format
,
username_buf
);
LeaveCriticalSection
(
&
impl
->
crit
);
return
DI_OK
;
if
(
FAILED
(
hr
))
free
(
action_map
);
free
(
data_format
.
rgodf
);
return
hr
;
}
}
static
HRESULT
WINAPI
dinput_device_GetImageInfo
(
IDirectInputDevice8W
*
iface
,
DIDEVICEIMAGEINFOHEADERW
*
header
)
static
HRESULT
WINAPI
dinput_device_GetImageInfo
(
IDirectInputDevice8W
*
iface
,
DIDEVICEIMAGEINFOHEADERW
*
header
)
...
...
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