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
7c4e91f6
Commit
7c4e91f6
authored
Oct 21, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Move CreateEffect generic implementation to device.c.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4ddd257f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
48 deletions
+37
-48
device.c
dlls/dinput/device.c
+29
-12
device_private.h
dlls/dinput/device_private.h
+1
-0
joystick_hid.c
dlls/dinput/joystick_hid.c
+5
-36
keyboard.c
dlls/dinput/keyboard.c
+1
-0
mouse.c
dlls/dinput/mouse.c
+1
-0
No files found.
dlls/dinput/device.c
View file @
7c4e91f6
...
...
@@ -1645,20 +1645,37 @@ HRESULT WINAPI IDirectInputDevice2WImpl_Initialize(LPDIRECTINPUTDEVICE8W iface,
return
DI_OK
;
}
/******************************************************************************
* IDirectInputDevice2A
*/
HRESULT
WINAPI
IDirectInputDevice2WImpl_CreateEffect
(
LPDIRECTINPUTDEVICE8W
iface
,
REFGUID
rguid
,
LPCDIEFFECT
lpeff
,
LPDIRECTINPUTEFFECT
*
ppdef
,
LPUNKNOWN
pUnkOuter
)
HRESULT
WINAPI
IDirectInputDevice2WImpl_CreateEffect
(
IDirectInputDevice8W
*
iface
,
const
GUID
*
guid
,
const
DIEFFECT
*
params
,
IDirectInputEffect
**
out
,
IUnknown
*
outer
)
{
IDirectInputDeviceImpl
*
This
=
impl_from_IDirectInputDevice8W
(
iface
);
FIXME
(
"(%p)->(%s,%p,%p,%p): stub!
\n
"
,
This
,
debugstr_guid
(
rguid
),
lpeff
,
ppdef
,
pUnkOuter
)
;
if
(
!
ppdef
)
return
E_POINTER
;
IDirectInputDeviceImpl
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
DWORD
flags
=
DIEP_ALLPARAMS
;
HRESULT
hr
;
FIXME
(
"not available in the generic implementation
\n
"
);
*
ppdef
=
NULL
;
return
DIERR_UNSUPPORTED
;
TRACE
(
"iface %p, guid %s, params %p, out %p, outer %p
\n
"
,
iface
,
debugstr_guid
(
guid
),
params
,
out
,
outer
);
if
(
!
out
)
return
E_POINTER
;
*
out
=
NULL
;
if
(
!
(
impl
->
caps
.
dwFlags
&
DIDC_FORCEFEEDBACK
))
return
DIERR_UNSUPPORTED
;
if
(
!
impl
->
vtbl
->
create_effect
)
return
DIERR_UNSUPPORTED
;
if
(
FAILED
(
hr
=
impl
->
vtbl
->
create_effect
(
iface
,
out
)))
return
hr
;
hr
=
IDirectInputEffect_Initialize
(
*
out
,
DINPUT_instance
,
impl
->
dinput
->
dwVersion
,
guid
);
if
(
FAILED
(
hr
))
goto
failed
;
if
(
!
params
)
return
DI_OK
;
if
(
!
impl
->
acquired
||
!
(
impl
->
dwCoopLevel
&
DISCL_EXCLUSIVE
))
flags
|=
DIEP_NODOWNLOAD
;
hr
=
IDirectInputEffect_SetParameters
(
*
out
,
params
,
flags
);
if
(
FAILED
(
hr
))
goto
failed
;
return
hr
;
failed:
IDirectInputEffect_Release
(
*
out
);
*
out
=
NULL
;
return
hr
;
}
HRESULT
WINAPI
IDirectInputDevice2WImpl_EnumEffects
(
IDirectInputDevice8W
*
iface
,
LPDIENUMEFFECTSCALLBACKW
callback
,
...
...
dlls/dinput/device_private.h
View file @
7c4e91f6
...
...
@@ -69,6 +69,7 @@ struct dinput_device_vtbl
HRESULT
(
*
set_property
)(
IDirectInputDevice8W
*
iface
,
DWORD
property
,
const
DIPROPHEADER
*
header
,
const
DIDEVICEOBJECTINSTANCEW
*
instance
);
HRESULT
(
*
get_effect_info
)(
IDirectInputDevice8W
*
iface
,
DIEFFECTINFOW
*
info
,
const
GUID
*
guid
);
HRESULT
(
*
create_effect
)(
IDirectInputDevice8W
*
iface
,
IDirectInputEffect
**
out
);
};
#define DEVICE_STATE_MAX_SIZE 1024
...
...
dlls/dinput/joystick_hid.c
View file @
7c4e91f6
...
...
@@ -803,40 +803,7 @@ static HRESULT hid_joystick_internal_unacquire( IDirectInputDevice8W *iface )
return
DI_OK
;
}
static
HRESULT
hid_joystick_effect_create
(
struct
hid_joystick
*
joystick
,
IDirectInputEffect
**
out
);
static
HRESULT
WINAPI
hid_joystick_CreateEffect
(
IDirectInputDevice8W
*
iface
,
const
GUID
*
guid
,
const
DIEFFECT
*
params
,
IDirectInputEffect
**
out
,
IUnknown
*
outer
)
{
struct
hid_joystick
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
DWORD
flags
=
DIEP_ALLPARAMS
;
HRESULT
hr
;
TRACE
(
"iface %p, guid %s, params %p, out %p, outer %p
\n
"
,
iface
,
debugstr_guid
(
guid
),
params
,
out
,
outer
);
if
(
!
out
)
return
E_POINTER
;
*
out
=
NULL
;
if
(
!
(
impl
->
base
.
caps
.
dwFlags
&
DIDC_FORCEFEEDBACK
))
return
DIERR_UNSUPPORTED
;
if
(
FAILED
(
hr
=
hid_joystick_effect_create
(
impl
,
out
)))
return
hr
;
hr
=
IDirectInputEffect_Initialize
(
*
out
,
DINPUT_instance
,
impl
->
base
.
dinput
->
dwVersion
,
guid
);
if
(
FAILED
(
hr
))
goto
failed
;
if
(
!
params
)
return
DI_OK
;
if
(
!
impl
->
base
.
acquired
||
!
(
impl
->
base
.
dwCoopLevel
&
DISCL_EXCLUSIVE
))
flags
|=
DIEP_NODOWNLOAD
;
hr
=
IDirectInputEffect_SetParameters
(
*
out
,
params
,
flags
);
if
(
FAILED
(
hr
))
goto
failed
;
return
hr
;
failed:
IDirectInputEffect_Release
(
*
out
);
*
out
=
NULL
;
return
hr
;
}
static
HRESULT
hid_joystick_internal_create_effect
(
IDirectInputDevice8W
*
iface
,
IDirectInputEffect
**
out
);
static
HRESULT
hid_joystick_internal_get_effect_info
(
IDirectInputDevice8W
*
iface
,
DIEFFECTINFOW
*
info
,
const
GUID
*
guid
)
...
...
@@ -1068,7 +1035,7 @@ static const IDirectInputDevice8WVtbl hid_joystick_vtbl =
IDirectInputDevice2WImpl_RunControlPanel
,
IDirectInputDevice2WImpl_Initialize
,
/*** IDirectInputDevice2 methods ***/
hid_joystick
_CreateEffect
,
IDirectInputDevice2WImpl
_CreateEffect
,
IDirectInputDevice2WImpl_EnumEffects
,
IDirectInputDevice2WImpl_GetEffectInfo
,
IDirectInputDevice2WImpl_GetForceFeedbackState
,
...
...
@@ -1312,6 +1279,7 @@ static const struct dinput_device_vtbl hid_joystick_internal_vtbl =
hid_joystick_internal_get_property
,
hid_joystick_internal_set_property
,
hid_joystick_internal_get_effect_info
,
hid_joystick_internal_create_effect
,
};
static
DWORD
device_type_for_version
(
DWORD
type
,
DWORD
version
)
...
...
@@ -2826,8 +2794,9 @@ static IDirectInputEffectVtbl hid_joystick_effect_vtbl =
hid_joystick_effect_Escape
,
};
static
HRESULT
hid_joystick_
effect_create
(
struct
hid_joystick
*
joystick
,
IDirectInputEffect
**
out
)
static
HRESULT
hid_joystick_
internal_create_effect
(
IDirectInputDevice8W
*
iface
,
IDirectInputEffect
**
out
)
{
struct
hid_joystick
*
joystick
=
impl_from_IDirectInputDevice8W
(
iface
);
struct
hid_joystick_effect
*
impl
;
ULONG
report_len
;
...
...
dlls/dinput/keyboard.c
View file @
7c4e91f6
...
...
@@ -339,6 +339,7 @@ static const struct dinput_device_vtbl keyboard_internal_vtbl =
keyboard_internal_get_property
,
keyboard_internal_set_property
,
NULL
,
NULL
,
};
static
const
IDirectInputDevice8WVtbl
SysKeyboardWvt
=
...
...
dlls/dinput/mouse.c
View file @
7c4e91f6
...
...
@@ -652,6 +652,7 @@ static const struct dinput_device_vtbl mouse_internal_vtbl =
mouse_internal_get_property
,
mouse_internal_set_property
,
NULL
,
NULL
,
};
static
const
IDirectInputDevice8WVtbl
SysMouseWvt
=
...
...
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