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
70b25ccf
Commit
70b25ccf
authored
May 26, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
May 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Implement IDirectInputDevice_GetEffectInfo WtoA conversion.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
08d07c4c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
61 deletions
+26
-61
ansi.c
dlls/dinput/ansi.c
+25
-0
device.c
dlls/dinput/device.c
+0
-10
effect_linuxinput.c
dlls/dinput/effect_linuxinput.c
+0
-34
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+1
-17
No files found.
dlls/dinput/ansi.c
View file @
70b25ccf
...
...
@@ -64,6 +64,15 @@ static void dideviceobjectinstance_wtoa( const DIDEVICEOBJECTINSTANCEW *in, DIDE
out
->
wReserved
=
in
->
wReserved
;
}
static
void
dieffectinfo_wtoa
(
const
DIEFFECTINFOW
*
in
,
DIEFFECTINFOA
*
out
)
{
out
->
guid
=
in
->
guid
;
out
->
dwEffType
=
in
->
dwEffType
;
out
->
dwStaticParams
=
in
->
dwStaticParams
;
out
->
dwDynamicParams
=
in
->
dwDynamicParams
;
WideCharToMultiByte
(
CP_ACP
,
0
,
in
->
tszName
,
-
1
,
out
->
tszName
,
sizeof
(
out
->
tszName
),
NULL
,
NULL
);
}
HRESULT
WINAPI
IDirectInputDevice2AImpl_QueryInterface
(
IDirectInputDevice8A
*
iface_a
,
REFIID
iid
,
void
**
out
)
{
IDirectInputDeviceImpl
*
impl
=
impl_from_IDirectInputDevice8A
(
iface_a
);
...
...
@@ -210,6 +219,22 @@ HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect( IDirectInputDevice8A *ifac
return
IDirectInputDevice8_CreateEffect
(
iface_w
,
guid
,
effect
,
out
,
outer
);
}
HRESULT
WINAPI
IDirectInputDevice2AImpl_GetEffectInfo
(
IDirectInputDevice8A
*
iface_a
,
DIEFFECTINFOA
*
info_a
,
REFGUID
guid
)
{
IDirectInputDeviceImpl
*
impl
=
impl_from_IDirectInputDevice8A
(
iface_a
);
IDirectInputDevice8W
*
iface_w
=
IDirectInputDevice8W_from_impl
(
impl
);
DIEFFECTINFOW
info_w
=
{
sizeof
(
info_w
)};
HRESULT
hr
;
if
(
!
info_a
)
return
E_POINTER
;
if
(
info_a
->
dwSize
!=
sizeof
(
DIEFFECTINFOA
))
return
DIERR_INVALIDPARAM
;
hr
=
IDirectInputDevice8_GetEffectInfo
(
iface_w
,
&
info_w
,
guid
);
dieffectinfo_wtoa
(
&
info_w
,
info_a
);
return
hr
;
}
HRESULT
WINAPI
IDirectInputDevice2AImpl_GetForceFeedbackState
(
IDirectInputDevice8A
*
iface_a
,
DWORD
*
state
)
{
IDirectInputDeviceImpl
*
impl
=
impl_from_IDirectInputDevice8A
(
iface_a
);
...
...
dlls/dinput/device.c
View file @
70b25ccf
...
...
@@ -1611,16 +1611,6 @@ HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects(
return
DI_OK
;
}
HRESULT
WINAPI
IDirectInputDevice2AImpl_GetEffectInfo
(
LPDIRECTINPUTDEVICE8A
iface
,
LPDIEFFECTINFOA
lpdei
,
REFGUID
rguid
)
{
IDirectInputDeviceImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
FIXME
(
"(%p)->(%p,%s): stub!
\n
"
,
This
,
lpdei
,
debugstr_guid
(
rguid
));
return
DI_OK
;
}
HRESULT
WINAPI
IDirectInputDevice2WImpl_GetEffectInfo
(
LPDIRECTINPUTDEVICE8W
iface
,
LPDIEFFECTINFOW
lpdei
,
...
...
dlls/dinput/effect_linuxinput.c
View file @
70b25ccf
...
...
@@ -852,40 +852,6 @@ DECLSPEC_HIDDEN HRESULT linuxinput_create_effect(
return
DI_OK
;
}
DECLSPEC_HIDDEN
HRESULT
linuxinput_get_info_A
(
int
fd
,
REFGUID
rguid
,
LPDIEFFECTINFOA
info
)
{
DWORD
type
=
typeFromGUID
(
rguid
);
TRACE
(
"(%d, %s, %p) type=%d
\n
"
,
fd
,
_dump_dinput_GUID
(
rguid
),
info
,
type
);
if
(
!
info
)
return
E_POINTER
;
if
(
info
->
dwSize
!=
sizeof
(
DIEFFECTINFOA
))
return
DIERR_INVALIDPARAM
;
info
->
guid
=
*
rguid
;
info
->
dwEffType
=
type
;
/* the event device API does not support querying for all these things
* therefore we assume that we have support for them
* that's not as dangerous as it sounds, since drivers are allowed to
* ignore parameters they claim to support anyway */
info
->
dwEffType
|=
DIEFT_DEADBAND
|
DIEFT_FFATTACK
|
DIEFT_FFFADE
|
DIEFT_POSNEGCOEFFICIENTS
|
DIEFT_POSNEGSATURATION
|
DIEFT_SATURATION
|
DIEFT_STARTDELAY
;
/* again, assume we have support for everything */
info
->
dwStaticParams
=
DIEP_ALLPARAMS
;
info
->
dwDynamicParams
=
info
->
dwStaticParams
;
/* yes, this is windows behavior (print the GUID_Name for name) */
strcpy
(
info
->
tszName
,
_dump_dinput_GUID
(
rguid
));
return
DI_OK
;
}
DECLSPEC_HIDDEN
HRESULT
linuxinput_get_info_W
(
int
fd
,
REFGUID
rguid
,
...
...
dlls/dinput/joystick_linuxinput.c
View file @
70b25ccf
...
...
@@ -86,7 +86,6 @@ struct wine_input_absinfo {
/* implemented in effect_linuxinput.c */
HRESULT
linuxinput_create_effect
(
int
*
fd
,
REFGUID
rguid
,
struct
list
*
parent_list_entry
,
LPDIRECTINPUTEFFECT
*
peff
);
HRESULT
linuxinput_get_info_A
(
int
fd
,
REFGUID
rguid
,
LPDIEFFECTINFOA
info
);
HRESULT
linuxinput_get_info_W
(
int
fd
,
REFGUID
rguid
,
LPDIEFFECTINFOW
info
);
static
HRESULT
WINAPI
JoystickWImpl_SendForceFeedbackCommand
(
LPDIRECTINPUTDEVICE8W
iface
,
DWORD
dwFlags
);
...
...
@@ -1251,21 +1250,6 @@ static HRESULT WINAPI JoystickWImpl_EnumEffects(LPDIRECTINPUTDEVICE8W iface,
/*******************************************************************************
* GetEffectInfo - Get information about a particular effect
*/
static
HRESULT
WINAPI
JoystickAImpl_GetEffectInfo
(
LPDIRECTINPUTDEVICE8A
iface
,
LPDIEFFECTINFOA
pdei
,
REFGUID
guid
)
{
JoystickImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
TRACE
(
"(this=%p,%p,%s)
\n
"
,
This
,
pdei
,
_dump_dinput_GUID
(
guid
));
#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION
return
linuxinput_get_info_A
(
This
->
joyfd
,
guid
,
pdei
);
#else
return
DI_OK
;
#endif
}
static
HRESULT
WINAPI
JoystickWImpl_GetEffectInfo
(
LPDIRECTINPUTDEVICE8W
iface
,
LPDIEFFECTINFOW
pdei
,
REFGUID
guid
)
...
...
@@ -1445,7 +1429,7 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
IDirectInputDevice2AImpl_Initialize
,
IDirectInputDevice2AImpl_CreateEffect
,
JoystickAImpl_EnumEffects
,
Joystick
AImpl_GetEffectInfo
,
IDirectInputDevice2
AImpl_GetEffectInfo
,
IDirectInputDevice2AImpl_GetForceFeedbackState
,
IDirectInputDevice2AImpl_SendForceFeedbackCommand
,
IDirectInputDevice2AImpl_EnumCreatedEffectObjects
,
...
...
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