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
4310b5ac
Commit
4310b5ac
authored
Oct 04, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Implement HID joystick IDirectInputDevice8_EnumCreatedEffectObjects.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f0c93375
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
joystick_hid.c
dlls/dinput/joystick_hid.c
+18
-1
hid.c
dlls/dinput8/tests/hid.c
+0
-5
No files found.
dlls/dinput/joystick_hid.c
View file @
4310b5ac
...
...
@@ -112,6 +112,7 @@ struct hid_joystick
BYTE
device_state_report_id
;
BYTE
device_state
[
DEVICE_STATE_MAX_SIZE
];
struct
list
effect_list
;
struct
pid_control_report
pid_device_control
;
};
...
...
@@ -126,6 +127,7 @@ struct hid_joystick_effect
IDirectInputEffect
IDirectInputEffect_iface
;
LONG
ref
;
struct
list
entry
;
struct
hid_joystick
*
joystick
;
};
...
...
@@ -1014,11 +1016,18 @@ static HRESULT WINAPI hid_joystick_EnumCreatedEffectObjects( IDirectInputDevice8
LPDIENUMCREATEDEFFECTOBJECTSCALLBACK
callback
,
void
*
context
,
DWORD
flags
)
{
struct
hid_joystick
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
struct
hid_joystick_effect
*
effect
,
*
next
;
FIXME
(
"iface %p, callback %p, context %p, flags %#x stub!
\n
"
,
iface
,
callback
,
context
,
flags
);
if
(
!
callback
)
return
DIERR_INVALIDPARAM
;
if
(
flags
)
return
DIERR_INVALIDPARAM
;
return
DIERR_UNSUPPORTED
;
LIST_FOR_EACH_ENTRY_SAFE
(
effect
,
next
,
&
impl
->
effect_list
,
struct
hid_joystick_effect
,
entry
)
if
(
callback
(
&
effect
->
IDirectInputEffect_iface
,
context
)
!=
DIENUM_CONTINUE
)
break
;
return
DI_OK
;
}
static
HRESULT
WINAPI
hid_joystick_Poll
(
IDirectInputDevice8W
*
iface
)
...
...
@@ -1707,6 +1716,7 @@ static HRESULT hid_joystick_create_device( IDirectInputImpl *dinput, const GUID
impl
->
dev_caps
.
dwSize
=
sizeof
(
impl
->
dev_caps
);
impl
->
dev_caps
.
dwFlags
=
DIDC_ATTACHED
|
DIDC_EMULATED
;
impl
->
dev_caps
.
dwDevType
=
instance
.
dwDevType
;
list_init
(
&
impl
->
effect_list
);
preparsed
=
(
struct
hid_preparsed_data
*
)
impl
->
preparsed
;
...
...
@@ -1813,6 +1823,9 @@ static ULONG WINAPI hid_joystick_effect_Release( IDirectInputEffect *iface )
TRACE
(
"iface %p, ref %u.
\n
"
,
iface
,
ref
);
if
(
!
ref
)
{
EnterCriticalSection
(
&
impl
->
joystick
->
base
.
crit
);
list_remove
(
&
impl
->
entry
);
LeaveCriticalSection
(
&
impl
->
joystick
->
base
.
crit
);
hid_joystick_private_decref
(
impl
->
joystick
);
HeapFree
(
GetProcessHeap
(),
0
,
impl
);
}
...
...
@@ -1914,6 +1927,10 @@ static HRESULT hid_joystick_effect_create( struct hid_joystick *joystick, IDirec
impl
->
joystick
=
joystick
;
hid_joystick_private_incref
(
joystick
);
EnterCriticalSection
(
&
joystick
->
base
.
crit
);
list_add_tail
(
&
joystick
->
effect_list
,
&
impl
->
entry
);
LeaveCriticalSection
(
&
joystick
->
base
.
crit
);
*
out
=
&
impl
->
IDirectInputEffect_iface
;
return
DI_OK
;
}
dlls/dinput8/tests/hid.c
View file @
4310b5ac
...
...
@@ -4708,10 +4708,8 @@ static void test_simple_joystick(void)
hr
=
IDirectInputDevice8_EnumCreatedEffectObjects
(
device
,
NULL
,
effect
,
0
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_EnumCreatedEffectObjects returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_EnumCreatedEffectObjects
(
device
,
check_no_created_effect_objects
,
effect
,
0xdeadbeef
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_EnumCreatedEffectObjects returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_EnumCreatedEffectObjects
(
device
,
check_no_created_effect_objects
,
(
void
*
)
0xdeadbeef
,
0
);
todo_wine
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_EnumCreatedEffectObjects returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_Escape
(
device
,
NULL
);
...
...
@@ -5112,13 +5110,10 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file )
if
(
hr
!=
DI_OK
)
return
;
hr
=
IDirectInputDevice8_EnumCreatedEffectObjects
(
device
,
check_no_created_effect_objects
,
effect
,
0xdeadbeef
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_EnumCreatedEffectObjects returned %#x
\n
"
,
hr
);
check_params
.
expect_effect
=
effect
;
hr
=
IDirectInputDevice8_EnumCreatedEffectObjects
(
device
,
check_created_effect_objects
,
&
check_params
,
0
);
todo_wine
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_EnumCreatedEffectObjects returned %#x
\n
"
,
hr
);
todo_wine
ok
(
check_params
.
count
==
1
,
"got count %u, expected 1
\n
"
,
check_params
.
count
);
ref
=
IDirectInputEffect_Release
(
effect
);
...
...
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