dinput: Use HeapAlloc/Free instead of alloc/free.

This commit is contained in:
Mike McCormack 2006-11-10 15:40:41 +09:00 committed by Alexandre Julliard
parent d9ea955dbf
commit 53baea13a5

View file

@ -1469,17 +1469,17 @@ static HRESULT WINAPI JoystickAImpl_CreateEffect(LPDIRECTINPUTDEVICE8A iface,
#ifndef HAVE_STRUCT_FF_EFFECT_DIRECTION #ifndef HAVE_STRUCT_FF_EFFECT_DIRECTION
TRACE("not available (compiled w/o ff support)\n"); TRACE("not available (compiled w/o ff support)\n");
*ppdef = NULL; *ppdef = NULL;
return DI_OK; return DI_OK;
#else #else
new = malloc(sizeof(EffectListItem)); new = HeapAlloc(GetProcessHeap(), 0, sizeof(EffectListItem));
new->next = This->top_effect; new->next = This->top_effect;
This->top_effect = new; This->top_effect = new;
retval = linuxinput_create_effect(&(This->joyfd), rguid, &(new->ref)); retval = linuxinput_create_effect(&(This->joyfd), rguid, &(new->ref));
if (retval != DI_OK) if (retval != DI_OK)
return retval; return retval;
if (lpeff != NULL) if (lpeff != NULL)
retval = IDirectInputEffect_SetParameters(new->ref, lpeff, 0); retval = IDirectInputEffect_SetParameters(new->ref, lpeff, 0);
if (retval != DI_OK && retval != DI_DOWNLOADSKIPPED) if (retval != DI_OK && retval != DI_DOWNLOADSKIPPED)
@ -1729,12 +1729,12 @@ static HRESULT WINAPI JoystickAImpl_SendForceFeedbackCommand(
/* Stop, unload, release and free all effects */ /* Stop, unload, release and free all effects */
/* This returns the device to its "bare" state */ /* This returns the device to its "bare" state */
while (This->top_effect) { while (This->top_effect) {
EffectListItem* temp = This->top_effect; EffectListItem* temp = This->top_effect;
IDirectInputEffect_Stop(temp->ref); IDirectInputEffect_Stop(temp->ref);
IDirectInputEffect_Unload(temp->ref); IDirectInputEffect_Unload(temp->ref);
IDirectInputEffect_Release(temp->ref); IDirectInputEffect_Release(temp->ref);
This->top_effect = temp->next; This->top_effect = temp->next;
free(temp); HeapFree(GetProcessHeap(), 0, temp);
} }
} else if (dwFlags == DISFFC_PAUSE || dwFlags == DISFFC_CONTINUE) { } else if (dwFlags == DISFFC_PAUSE || dwFlags == DISFFC_CONTINUE) {
FIXME("No support for Pause or Continue in linux\n"); FIXME("No support for Pause or Continue in linux\n");