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
cbd9fe25
Commit
cbd9fe25
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: Implement HID joystick IDirectInputEffect_Initialize.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
20b55e87
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
joystick_hid.c
dlls/dinput/joystick_hid.c
+24
-1
hid.c
dlls/dinput8/tests/hid.c
+0
-7
No files found.
dlls/dinput/joystick_hid.c
View file @
cbd9fe25
...
...
@@ -144,6 +144,7 @@ struct hid_joystick_effect
{
IDirectInputEffect
IDirectInputEffect_iface
;
LONG
ref
;
USAGE
type
;
struct
list
entry
;
struct
hid_joystick
*
joystick
;
...
...
@@ -2061,7 +2062,29 @@ static ULONG WINAPI hid_joystick_effect_Release( IDirectInputEffect *iface )
static
HRESULT
WINAPI
hid_joystick_effect_Initialize
(
IDirectInputEffect
*
iface
,
HINSTANCE
inst
,
DWORD
version
,
REFGUID
guid
)
{
FIXME
(
"iface %p, inst %p, version %u, guid %s stub!
\n
"
,
iface
,
inst
,
version
,
debugstr_guid
(
guid
)
);
struct
hid_joystick_effect
*
impl
=
impl_from_IDirectInputEffect
(
iface
);
struct
hid_joystick
*
joystick
=
impl
->
joystick
;
ULONG
report_len
=
joystick
->
caps
.
OutputReportByteLength
;
NTSTATUS
status
;
ULONG
count
;
USAGE
type
;
TRACE
(
"iface %p, inst %p, version %u, guid %s
\n
"
,
iface
,
inst
,
version
,
debugstr_guid
(
guid
)
);
if
(
!
inst
)
return
DIERR_INVALIDPARAM
;
if
(
!
guid
)
return
E_POINTER
;
if
(
!
(
type
=
effect_guid_to_usage
(
guid
)))
return
DIERR_DEVICENOTREG
;
status
=
HidP_InitializeReportForID
(
HidP_Output
,
joystick
->
pid_effect_update
.
id
,
joystick
->
preparsed
,
impl
->
effect_update_buf
,
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
return
DIERR_DEVICENOTREG
;
count
=
1
;
status
=
HidP_SetUsages
(
HidP_Output
,
HID_USAGE_PAGE_PID
,
joystick
->
pid_effect_update
.
type_coll
,
&
type
,
&
count
,
joystick
->
preparsed
,
impl
->
effect_update_buf
,
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
return
DIERR_DEVICENOTREG
;
impl
->
type
=
type
;
return
DI_OK
;
}
...
...
dlls/dinput8/tests/hid.c
View file @
cbd9fe25
...
...
@@ -5159,13 +5159,9 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file )
hr
=
IDirectInputDevice8_CreateEffect
(
device
,
&
GUID_Sine
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"CreateEffect returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_CreateEffect
(
device
,
NULL
,
NULL
,
&
effect
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"CreateEffect returned %#x
\n
"
,
hr
);
if
(
hr
==
DI_OK
)
IDirectInputEffect_Release
(
effect
);
hr
=
IDirectInputDevice8_CreateEffect
(
device
,
&
GUID_NULL
,
NULL
,
&
effect
,
NULL
);
todo_wine
ok
(
hr
==
DIERR_DEVICENOTREG
,
"CreateEffect returned %#x
\n
"
,
hr
);
if
(
hr
==
DI_OK
)
IDirectInputEffect_Release
(
effect
);
hr
=
IDirectInputDevice8_CreateEffect
(
device
,
&
GUID_Sine
,
NULL
,
&
effect
,
NULL
);
ok
(
hr
==
DI_OK
,
"CreateEffect returned %#x
\n
"
,
hr
);
...
...
@@ -5179,17 +5175,14 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file )
ok
(
check_params
.
count
==
1
,
"got count %u, expected 1
\n
"
,
check_params
.
count
);
hr
=
IDirectInputEffect_Initialize
(
effect
,
NULL
,
DIRECTINPUT_VERSION
,
&
GUID_Sine
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"Initialize returned %#x
\n
"
,
hr
);
hr
=
IDirectInputEffect_Initialize
(
effect
,
instance
,
0
,
&
GUID_Sine
);
todo_wine
ok
(
hr
==
DIERR_NOTINITIALIZED
,
"Initialize returned %#x
\n
"
,
hr
);
hr
=
IDirectInputEffect_Initialize
(
effect
,
instance
,
DIRECTINPUT_VERSION
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"Initialize returned %#x
\n
"
,
hr
);
hr
=
IDirectInputEffect_Initialize
(
effect
,
instance
,
DIRECTINPUT_VERSION
,
&
GUID_NULL
);
todo_wine
ok
(
hr
==
DIERR_DEVICENOTREG
,
"Initialize returned %#x
\n
"
,
hr
);
hr
=
IDirectInputEffect_Initialize
(
effect
,
instance
,
DIRECTINPUT_VERSION
,
&
GUID_Sine
);
ok
(
hr
==
DI_OK
,
"Initialize returned %#x
\n
"
,
hr
);
...
...
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