Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
v2: Resending the first two patches, to remove some leftover code from PATCH 2, other patches should still apply cleanly on top.
Supersedes: 216557-216558
dlls/dinput/joystick_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 2ef01ac6ace..d2aa352b6e2 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1195,7 +1195,7 @@ static HRESULT WINAPI hid_joystick_EnumCreatedEffectObjects( IDirectInputDevice8 struct hid_joystick *impl = impl_from_IDirectInputDevice8W( iface ); struct hid_joystick_effect *effect, *next;
- FIXME( "iface %p, callback %p, context %p, flags %#x stub!\n", iface, callback, context, flags ); + TRACE( "iface %p, callback %p, context %p, flags %#x.\n", iface, callback, context, flags );
if (!callback) return DIERR_INVALIDPARAM; if (flags) return DIERR_INVALIDPARAM;
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/joystick_hid.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index d2aa352b6e2..c3d202bd9bd 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -147,6 +147,9 @@ struct hid_joystick_effect
struct list entry; struct hid_joystick *joystick; + + char *effect_control_buf; + char *effect_update_buf; };
static inline struct hid_joystick_effect *impl_from_IDirectInputEffect( IDirectInputEffect *iface ) @@ -2048,6 +2051,8 @@ static ULONG WINAPI hid_joystick_effect_Release( IDirectInputEffect *iface ) list_remove( &impl->entry ); LeaveCriticalSection( &impl->joystick->base.crit ); hid_joystick_private_decref( impl->joystick ); + HeapFree( GetProcessHeap(), 0, impl->effect_update_buf ); + HeapFree( GetProcessHeap(), 0, impl->effect_control_buf ); HeapFree( GetProcessHeap(), 0, impl ); } return ref; @@ -2140,6 +2145,7 @@ static IDirectInputEffectVtbl hid_joystick_effect_vtbl = static HRESULT hid_joystick_effect_create( struct hid_joystick *joystick, IDirectInputEffect **out ) { struct hid_joystick_effect *impl; + ULONG report_len;
if (!(impl = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*impl) ))) return DIERR_OUTOFMEMORY; @@ -2152,6 +2158,14 @@ static HRESULT hid_joystick_effect_create( struct hid_joystick *joystick, IDirec list_add_tail( &joystick->effect_list, &impl->entry ); LeaveCriticalSection( &joystick->base.crit );
+ report_len = joystick->caps.OutputReportByteLength; + if (!(impl->effect_control_buf = HeapAlloc( GetProcessHeap(), 0, report_len ))) goto failed; + if (!(impl->effect_update_buf = HeapAlloc( GetProcessHeap(), 0, report_len ))) goto failed; + *out = &impl->IDirectInputEffect_iface; return DI_OK; + +failed: + IDirectInputEffect_Release( &impl->IDirectInputEffect_iface ); + return DIERR_OUTOFMEMORY; }