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
20b55e87
Commit
20b55e87
authored
Oct 07, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Allocate buffers for the effect control and update reports.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
099d6494
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
joystick_hid.c
dlls/dinput/joystick_hid.c
+14
-0
No files found.
dlls/dinput/joystick_hid.c
View file @
20b55e87
...
...
@@ -147,6 +147,9 @@ struct hid_joystick_effect
struct
list
entry
;
struct
hid_joystick
*
joystick
;
char
*
effect_control_buf
;
char
*
effect_update_buf
;
};
static
inline
struct
hid_joystick_effect
*
impl_from_IDirectInputEffect
(
IDirectInputEffect
*
iface
)
...
...
@@ -2048,6 +2051,8 @@ static ULONG WINAPI hid_joystick_effect_Release( IDirectInputEffect *iface )
list_remove
(
&
impl
->
entry
);
LeaveCriticalSection
(
&
impl
->
joystick
->
base
.
crit
);
hid_joystick_private_decref
(
impl
->
joystick
);
HeapFree
(
GetProcessHeap
(),
0
,
impl
->
effect_update_buf
);
HeapFree
(
GetProcessHeap
(),
0
,
impl
->
effect_control_buf
);
HeapFree
(
GetProcessHeap
(),
0
,
impl
);
}
return
ref
;
...
...
@@ -2140,6 +2145,7 @@ static IDirectInputEffectVtbl hid_joystick_effect_vtbl =
static
HRESULT
hid_joystick_effect_create
(
struct
hid_joystick
*
joystick
,
IDirectInputEffect
**
out
)
{
struct
hid_joystick_effect
*
impl
;
ULONG
report_len
;
if
(
!
(
impl
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
impl
)
)))
return
DIERR_OUTOFMEMORY
;
...
...
@@ -2152,6 +2158,14 @@ static HRESULT hid_joystick_effect_create( struct hid_joystick *joystick, IDirec
list_add_tail
(
&
joystick
->
effect_list
,
&
impl
->
entry
);
LeaveCriticalSection
(
&
joystick
->
base
.
crit
);
report_len
=
joystick
->
caps
.
OutputReportByteLength
;
if
(
!
(
impl
->
effect_control_buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
report_len
)))
goto
failed
;
if
(
!
(
impl
->
effect_update_buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
report_len
)))
goto
failed
;
*
out
=
&
impl
->
IDirectInputEffect_iface
;
return
DI_OK
;
failed:
IDirectInputEffect_Release
(
&
impl
->
IDirectInputEffect_iface
);
return
DIERR_OUTOFMEMORY
;
}
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