[PATCH 2/5] dinput: Support SendForceFeedbackCommand for OSX joysticks

Charles Davis cdavis5x at gmail.com
Tue May 21 15:52:55 CDT 2013


On May 21, 2013, at 1:34 PM, Andrew Eikum wrote:

> ---
> dlls/dinput/joystick_osx.c | 34 ++++++++++++++++++++++++++++++++--
> 1 file changed, 32 insertions(+), 2 deletions(-)
> 
> diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c
> index 94398e7..8fb675d 100644
> --- a/dlls/dinput/joystick_osx.c
> +++ b/dlls/dinput/joystick_osx.c
> @@ -1135,6 +1135,36 @@ static HRESULT WINAPI JoystickAImpl_CreateEffect(IDirectInputDevice8A *iface,
>             type, params, out, outer);
> }
> 
> +static HRESULT WINAPI JoystickWImpl_SendForceFeedbackCommand(IDirectInputDevice8W *iface,
> +        DWORD flags)
> +{
> +    JoystickImpl *This = impl_from_IDirectInputDevice8W(iface);
> +    HRESULT hr;
> +
> +    TRACE("%p 0x%x\n", This, flags);
> +
> +    if(!This->ff)
> +        return DI_NOEFFECT;
> +
> +    hr = FFDeviceSendForceFeedbackCommand(This->ff, flags);
> +    if(FAILED(hr)){
> +        WARN("FFDeviceSendForceFeedbackCommand failed: %08x\n", hr);
> +        return hr;
You can't return the straight HRESULT from ForceFeedback here. That's because the codes in the FACILITY_NULL range on Mac get their values from the 16-bit COM runtime (cf. <CoreFoundation/CFPlugInCOM.h>). You must turn them into their corresponding Win32 codes.

Chip




More information about the wine-devel mailing list