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
40e90924
Commit
40e90924
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_GetEffectGuid.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cbd9fe25
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
7 deletions
+29
-7
joystick_hid.c
dlls/dinput/joystick_hid.c
+29
-4
hid.c
dlls/dinput8/tests/hid.c
+0
-3
No files found.
dlls/dinput/joystick_hid.c
View file @
40e90924
...
...
@@ -199,6 +199,26 @@ static inline USAGE effect_guid_to_usage( const GUID *guid )
return
0
;
}
static
inline
const
GUID
*
effect_usage_to_guid
(
USAGE
usage
)
{
switch
(
usage
)
{
case
PID_USAGE_ET_CUSTOM_FORCE_DATA
:
return
&
GUID_CustomForce
;
case
PID_USAGE_ET_CONSTANT_FORCE
:
return
&
GUID_ConstantForce
;
case
PID_USAGE_ET_RAMP
:
return
&
GUID_RampForce
;
case
PID_USAGE_ET_SQUARE
:
return
&
GUID_Square
;
case
PID_USAGE_ET_SINE
:
return
&
GUID_Sine
;
case
PID_USAGE_ET_TRIANGLE
:
return
&
GUID_Triangle
;
case
PID_USAGE_ET_SAWTOOTH_UP
:
return
&
GUID_SawtoothUp
;
case
PID_USAGE_ET_SAWTOOTH_DOWN
:
return
&
GUID_SawtoothDown
;
case
PID_USAGE_ET_SPRING
:
return
&
GUID_Spring
;
case
PID_USAGE_ET_DAMPER
:
return
&
GUID_Damper
;
case
PID_USAGE_ET_INERTIA
:
return
&
GUID_Inertia
;
case
PID_USAGE_ET_FRICTION
:
return
&
GUID_Friction
;
}
return
&
GUID_Unknown
;
}
static
const
WCHAR
*
effect_guid_to_string
(
const
GUID
*
guid
)
{
static
const
WCHAR
guid_customforce_w
[]
=
{
'G'
,
'U'
,
'I'
,
'D'
,
'_'
,
'C'
,
'u'
,
's'
,
't'
,
'o'
,
'm'
,
'F'
,
'o'
,
'r'
,
'c'
,
'e'
,
0
};
...
...
@@ -2064,9 +2084,8 @@ static HRESULT WINAPI hid_joystick_effect_Initialize( IDirectInputEffect *iface,
{
struct
hid_joystick_effect
*
impl
=
impl_from_IDirectInputEffect
(
iface
);
struct
hid_joystick
*
joystick
=
impl
->
joystick
;
ULONG
report_len
=
joystick
->
caps
.
OutputReportByteLength
;
ULONG
count
,
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
)
);
...
...
@@ -2090,8 +2109,14 @@ static HRESULT WINAPI hid_joystick_effect_Initialize( IDirectInputEffect *iface,
static
HRESULT
WINAPI
hid_joystick_effect_GetEffectGuid
(
IDirectInputEffect
*
iface
,
GUID
*
guid
)
{
FIXME
(
"iface %p, guid %p stub!
\n
"
,
iface
,
guid
);
return
DIERR_UNSUPPORTED
;
struct
hid_joystick_effect
*
impl
=
impl_from_IDirectInputEffect
(
iface
);
TRACE
(
"iface %p, guid %p.
\n
"
,
iface
,
guid
);
if
(
!
guid
)
return
E_POINTER
;
*
guid
=
*
effect_usage_to_guid
(
impl
->
type
);
return
DI_OK
;
}
static
HRESULT
WINAPI
hid_joystick_effect_GetParameters
(
IDirectInputEffect
*
iface
,
DIEFFECT
*
params
,
DWORD
flags
)
...
...
dlls/dinput8/tests/hid.c
View file @
40e90924
...
...
@@ -5190,12 +5190,9 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file )
ok
(
hr
==
DI_OK
,
"Initialize returned %#x
\n
"
,
hr
);
hr
=
IDirectInputEffect_GetEffectGuid
(
effect
,
NULL
);
todo_wine
ok
(
hr
==
E_POINTER
,
"GetEffectGuid returned %#x
\n
"
,
hr
);
hr
=
IDirectInputEffect_GetEffectGuid
(
effect
,
&
guid
);
todo_wine
ok
(
hr
==
DI_OK
,
"GetEffectGuid returned %#x
\n
"
,
hr
);
todo_wine
ok
(
IsEqualGUID
(
&
guid
,
&
GUID_Square
),
"got guid %s, expected %s
\n
"
,
debugstr_guid
(
&
guid
),
debugstr_guid
(
&
GUID_Square
)
);
...
...
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