Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b33bece8
Commit
b33bece8
authored
Oct 01, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Stub hid_joystick force feedback methods.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f264ba76
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
16 deletions
+78
-16
joystick_hid.c
dlls/dinput/joystick_hid.c
+77
-6
hid.c
dlls/dinput8/tests/hid.c
+1
-10
No files found.
dlls/dinput/joystick_hid.c
View file @
b33bece8
...
@@ -780,6 +780,77 @@ static HRESULT WINAPI hid_joystick_GetDeviceInfo( IDirectInputDevice8W *iface, D
...
@@ -780,6 +780,77 @@ static HRESULT WINAPI hid_joystick_GetDeviceInfo( IDirectInputDevice8W *iface, D
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
hid_joystick_CreateEffect
(
IDirectInputDevice8W
*
iface
,
const
GUID
*
guid
,
const
DIEFFECT
*
params
,
IDirectInputEffect
**
out
,
IUnknown
*
outer
)
{
FIXME
(
"iface %p, guid %s, params %p, out %p, outer %p stub!
\n
"
,
iface
,
debugstr_guid
(
guid
),
params
,
out
,
outer
);
if
(
!
out
)
return
E_POINTER
;
return
DIERR_UNSUPPORTED
;
}
static
HRESULT
WINAPI
hid_joystick_EnumEffects
(
IDirectInputDevice8W
*
iface
,
LPDIENUMEFFECTSCALLBACKW
callback
,
void
*
context
,
DWORD
type
)
{
FIXME
(
"iface %p, callback %p, context %p, type %#x stub!
\n
"
,
iface
,
callback
,
context
,
type
);
if
(
!
callback
)
return
DIERR_INVALIDPARAM
;
return
DI_OK
;
}
static
HRESULT
WINAPI
hid_joystick_GetEffectInfo
(
IDirectInputDevice8W
*
iface
,
DIEFFECTINFOW
*
info
,
const
GUID
*
guid
)
{
FIXME
(
"iface %p, info %p, guid %s stub!
\n
"
,
iface
,
info
,
debugstr_guid
(
guid
)
);
if
(
!
info
)
return
E_POINTER
;
if
(
info
->
dwSize
!=
sizeof
(
DIEFFECTINFOW
))
return
DIERR_INVALIDPARAM
;
return
DIERR_DEVICENOTREG
;
}
static
HRESULT
WINAPI
hid_joystick_GetForceFeedbackState
(
IDirectInputDevice8W
*
iface
,
DWORD
*
out
)
{
FIXME
(
"iface %p, out %p stub!
\n
"
,
iface
,
out
);
if
(
!
out
)
return
E_POINTER
;
return
DIERR_UNSUPPORTED
;
}
static
HRESULT
WINAPI
hid_joystick_SendForceFeedbackCommand
(
IDirectInputDevice8W
*
iface
,
DWORD
command
)
{
FIXME
(
"iface %p, command %x stub!
\n
"
,
iface
,
command
);
switch
(
command
)
{
case
DISFFC_RESET
:
case
DISFFC_STOPALL
:
case
DISFFC_PAUSE
:
case
DISFFC_CONTINUE
:
case
DISFFC_SETACTUATORSON
:
case
DISFFC_SETACTUATORSOFF
:
return
DIERR_UNSUPPORTED
;
}
return
DIERR_INVALIDPARAM
;
}
static
HRESULT
WINAPI
hid_joystick_EnumCreatedEffectObjects
(
IDirectInputDevice8W
*
iface
,
LPDIENUMCREATEDEFFECTOBJECTSCALLBACK
callback
,
void
*
context
,
DWORD
flags
)
{
FIXME
(
"iface %p, callback %p, context %p, flags %#x stub!
\n
"
,
iface
,
callback
,
context
,
flags
);
if
(
!
callback
)
return
DIERR_INVALIDPARAM
;
return
DIERR_UNSUPPORTED
;
}
static
HRESULT
WINAPI
hid_joystick_Poll
(
IDirectInputDevice8W
*
iface
)
static
HRESULT
WINAPI
hid_joystick_Poll
(
IDirectInputDevice8W
*
iface
)
{
{
struct
hid_joystick
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
struct
hid_joystick
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
...
@@ -837,12 +908,12 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl =
...
@@ -837,12 +908,12 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl =
IDirectInputDevice2WImpl_RunControlPanel
,
IDirectInputDevice2WImpl_RunControlPanel
,
IDirectInputDevice2WImpl_Initialize
,
IDirectInputDevice2WImpl_Initialize
,
/*** IDirectInputDevice2 methods ***/
/*** IDirectInputDevice2 methods ***/
IDirectInputDevice2WImpl
_CreateEffect
,
hid_joystick
_CreateEffect
,
IDirectInputDevice2WImpl
_EnumEffects
,
hid_joystick
_EnumEffects
,
IDirectInputDevice2WImpl
_GetEffectInfo
,
hid_joystick
_GetEffectInfo
,
IDirectInputDevice2WImpl
_GetForceFeedbackState
,
hid_joystick
_GetForceFeedbackState
,
IDirectInputDevice2WImpl
_SendForceFeedbackCommand
,
hid_joystick
_SendForceFeedbackCommand
,
IDirectInputDevice2WImpl
_EnumCreatedEffectObjects
,
hid_joystick
_EnumCreatedEffectObjects
,
IDirectInputDevice2WImpl_Escape
,
IDirectInputDevice2WImpl_Escape
,
hid_joystick_Poll
,
hid_joystick_Poll
,
IDirectInputDevice2WImpl_SendDeviceData
,
IDirectInputDevice2WImpl_SendDeviceData
,
...
...
dlls/dinput8/tests/hid.c
View file @
b33bece8
...
@@ -4038,7 +4038,6 @@ static void test_simple_joystick(void)
...
@@ -4038,7 +4038,6 @@ static void test_simple_joystick(void)
check_member
(
objinst
,
expect_objects
[
5
],
"%u"
,
wReportId
);
check_member
(
objinst
,
expect_objects
[
5
],
"%u"
,
wReportId
);
hr
=
IDirectInputDevice8_EnumEffects
(
device
,
NULL
,
NULL
,
DIEFT_ALL
);
hr
=
IDirectInputDevice8_EnumEffects
(
device
,
NULL
,
NULL
,
DIEFT_ALL
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_EnumEffects returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_EnumEffects returned %#x
\n
"
,
hr
);
res
=
0
;
res
=
0
;
hr
=
IDirectInputDevice8_EnumEffects
(
device
,
check_effect_count
,
&
res
,
0xfe
);
hr
=
IDirectInputDevice8_EnumEffects
(
device
,
check_effect_count
,
&
res
,
0xfe
);
...
@@ -4054,18 +4053,14 @@ static void test_simple_joystick(void)
...
@@ -4054,18 +4053,14 @@ static void test_simple_joystick(void)
check_effects_params
.
expect_count
-
check_effects_params
.
index
);
check_effects_params
.
expect_count
-
check_effects_params
.
index
);
hr
=
IDirectInputDevice8_GetEffectInfo
(
device
,
NULL
,
&
GUID_Sine
);
hr
=
IDirectInputDevice8_GetEffectInfo
(
device
,
NULL
,
&
GUID_Sine
);
todo_wine
ok
(
hr
==
E_POINTER
,
"IDirectInputDevice8_GetEffectInfo returned %#x
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"IDirectInputDevice8_GetEffectInfo returned %#x
\n
"
,
hr
);
effectinfo
.
dwSize
=
sizeof
(
DIEFFECTINFOW
)
+
1
;
effectinfo
.
dwSize
=
sizeof
(
DIEFFECTINFOW
)
+
1
;
hr
=
IDirectInputDevice8_GetEffectInfo
(
device
,
&
effectinfo
,
&
GUID_Sine
);
hr
=
IDirectInputDevice8_GetEffectInfo
(
device
,
&
effectinfo
,
&
GUID_Sine
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_GetEffectInfo returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_GetEffectInfo returned %#x
\n
"
,
hr
);
effectinfo
.
dwSize
=
sizeof
(
DIEFFECTINFOW
);
effectinfo
.
dwSize
=
sizeof
(
DIEFFECTINFOW
);
hr
=
IDirectInputDevice8_GetEffectInfo
(
device
,
&
effectinfo
,
&
GUID_NULL
);
hr
=
IDirectInputDevice8_GetEffectInfo
(
device
,
&
effectinfo
,
&
GUID_NULL
);
todo_wine
ok
(
hr
==
DIERR_DEVICENOTREG
,
"IDirectInputDevice8_GetEffectInfo returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_DEVICENOTREG
,
"IDirectInputDevice8_GetEffectInfo returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_GetEffectInfo
(
device
,
&
effectinfo
,
&
GUID_Sine
);
hr
=
IDirectInputDevice8_GetEffectInfo
(
device
,
&
effectinfo
,
&
GUID_Sine
);
todo_wine
ok
(
hr
==
DIERR_DEVICENOTREG
,
"IDirectInputDevice8_GetEffectInfo returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_DEVICENOTREG
,
"IDirectInputDevice8_GetEffectInfo returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SetDataFormat
(
device
,
NULL
);
hr
=
IDirectInputDevice8_SetDataFormat
(
device
,
NULL
);
...
@@ -4645,18 +4640,14 @@ static void test_simple_joystick(void)
...
@@ -4645,18 +4640,14 @@ static void test_simple_joystick(void)
winetest_pop_context
();
winetest_pop_context
();
hr
=
IDirectInputDevice8_GetForceFeedbackState
(
device
,
NULL
);
hr
=
IDirectInputDevice8_GetForceFeedbackState
(
device
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"IDirectInputDevice8_GetForceFeedbackState returned %#x
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"IDirectInputDevice8_GetForceFeedbackState returned %#x
\n
"
,
hr
);
res
=
0xdeadbeef
;
res
=
0xdeadbeef
;
hr
=
IDirectInputDevice8_GetForceFeedbackState
(
device
,
&
res
);
hr
=
IDirectInputDevice8_GetForceFeedbackState
(
device
,
&
res
);
todo_wine
ok
(
hr
==
DIERR_UNSUPPORTED
,
"IDirectInputDevice8_GetForceFeedbackState returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_UNSUPPORTED
,
"IDirectInputDevice8_GetForceFeedbackState returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SendForceFeedbackCommand
(
device
,
0xdeadbeef
);
hr
=
IDirectInputDevice8_SendForceFeedbackCommand
(
device
,
0xdeadbeef
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_SendForceFeedbackCommand returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_SendForceFeedbackCommand returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SendForceFeedbackCommand
(
device
,
DISFFC_RESET
);
hr
=
IDirectInputDevice8_SendForceFeedbackCommand
(
device
,
DISFFC_RESET
);
todo_wine
ok
(
hr
==
DIERR_UNSUPPORTED
,
"IDirectInputDevice8_SendForceFeedbackCommand returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_UNSUPPORTED
,
"IDirectInputDevice8_SendForceFeedbackCommand returned %#x
\n
"
,
hr
);
objdata
[
0
].
dwOfs
=
0xd
;
objdata
[
0
].
dwOfs
=
0xd
;
...
@@ -5713,6 +5704,7 @@ static void test_force_feedback_joystick( void )
...
@@ -5713,6 +5704,7 @@ static void test_force_feedback_joystick( void )
effectinfo
.
dwSize
=
sizeof
(
DIEFFECTINFOW
);
effectinfo
.
dwSize
=
sizeof
(
DIEFFECTINFOW
);
hr
=
IDirectInputDevice8_GetEffectInfo
(
device
,
&
effectinfo
,
&
GUID_Sine
);
hr
=
IDirectInputDevice8_GetEffectInfo
(
device
,
&
effectinfo
,
&
GUID_Sine
);
todo_wine
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_GetEffectInfo returned %#x
\n
"
,
hr
);
ok
(
hr
==
DI_OK
,
"IDirectInputDevice8_GetEffectInfo returned %#x
\n
"
,
hr
);
todo_wine
todo_wine
check_member_guid
(
effectinfo
,
expect_effects
[
0
],
guid
);
check_member_guid
(
effectinfo
,
expect_effects
[
0
],
guid
);
...
@@ -5802,7 +5794,6 @@ static void test_force_feedback_joystick( void )
...
@@ -5802,7 +5794,6 @@ static void test_force_feedback_joystick( void )
ok
(
hr
==
0x80040301
,
"IDirectInputDevice8_GetForceFeedbackState returned %#x
\n
"
,
hr
);
ok
(
hr
==
0x80040301
,
"IDirectInputDevice8_GetForceFeedbackState returned %#x
\n
"
,
hr
);
hr
=
IDirectInputDevice8_SendForceFeedbackCommand
(
device
,
0xdeadbeef
);
hr
=
IDirectInputDevice8_SendForceFeedbackCommand
(
device
,
0xdeadbeef
);
todo_wine
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_SendForceFeedbackCommand returned %#x
\n
"
,
hr
);
ok
(
hr
==
DIERR_INVALIDPARAM
,
"IDirectInputDevice8_SendForceFeedbackCommand returned %#x
\n
"
,
hr
);
set_hid_expect
(
file
,
&
expect_dc_reset
,
sizeof
(
expect_dc_reset
)
);
set_hid_expect
(
file
,
&
expect_dc_reset
,
sizeof
(
expect_dc_reset
)
);
...
...
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