Hello Lucas,
for the future please stop adding the LPJUNK for COM interfaces, e.g.
LPDIRECTINPUTDEVICE8W, use IDirectInputDevice8W* instead.
In addition to the normal issues with the LPJUNK it hides the fact that
this are interfaces making it hard to review that the COM rules aren't
violated. It also complicates my COM cleanup script to the point that
I've started to automatically replace PJUNK and LPJUNK with IJunk*.
thanks
bye
michael
Lucas Fialho Zawacki wrote:
> ---
> dlls/dinput/joystick.c | 60 +++++++++++++++++++++++++++++++++++++
> dlls/dinput/joystick_linux.c | 8 ++--
> dlls/dinput/joystick_linuxinput.c | 8 ++--
> dlls/dinput/joystick_osx.c | 8 ++--
> dlls/dinput/joystick_private.h | 6 ++++
> 5 files changed, 78 insertions(+), 12 deletions(-)
>
> diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
> index 1be6f31..68dcc6a 100644
> --- a/dlls/dinput/joystick.c
> +++ b/dlls/dinput/joystick.c
> @@ -426,6 +426,66 @@ HRESULT WINAPI JoystickAGenericImpl_GetDeviceState(LPDIRECTINPUTDEVICE8A iface,
> return JoystickWGenericImpl_GetDeviceState(IDirectInputDevice8W_from_impl(This), len, ptr);
> }
>
> +
> +HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
> + LPDIACTIONFORMATW lpdiaf,
> + LPCWSTR lpszUserName,
> + DWORD dwFlags)
> +{
> + FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
> +
> + return DI_NOEFFECT;
> +}
> +
> +HRESULT WINAPI JoystickAGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
> + LPDIACTIONFORMATA lpdiaf,
> + LPCSTR lpszUserName,
> + DWORD dwFlags)
> +{
> + JoystickGenericImpl *This = impl_from_IDirectInputDevice8A(iface);
> + DIACTIONFORMATW diafW;
> + HRESULT hr;
> +
> + diafW.rgoAction = HeapAlloc(GetProcessHeap(), 0, sizeof(DIACTIONW)*lpdiaf->dwNumActions);
> + _copy_diactionformatAtoW(&diafW, lpdiaf);
> +
> + hr = JoystickWGenericImpl_BuildActionMap(&This->base.IDirectInputDevice8W_iface, &diafW, NULL, dwFlags);
> +
> + _copy_diactionformatWtoA(lpdiaf, &diafW);
> + HeapFree(GetProcessHeap(), 0, diafW.rgoAction);
> +
> + return hr;
> +}
> +
> +HRESULT WINAPI JoystickWGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
> + LPDIACTIONFORMATW lpdiaf,
> + LPCWSTR lpszUserName,
> + DWORD dwFlags)
> +{
> + FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
> +
> + return DI_NOEFFECT;
> +}
> +
> +HRESULT WINAPI JoystickAGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
> + LPDIACTIONFORMATA lpdiaf,
> + LPCSTR lpszUserName,
> + DWORD dwFlags)
> +{
> + JoystickGenericImpl *This = impl_from_IDirectInputDevice8A(iface);
> + DIACTIONFORMATW diafW;
> + HRESULT hr;
> +
> + diafW.rgoAction = HeapAlloc(GetProcessHeap(), 0, sizeof(DIACTIONW)*lpdiaf->dwNumActions);
> + _copy_diactionformatAtoW(&diafW, lpdiaf);
> +
> + hr = JoystickWGenericImpl_SetActionMap(&This->base.IDirectInputDevice8W_iface, &diafW, NULL, dwFlags);
> +
> + HeapFree(GetProcessHeap(), 0, diafW.rgoAction);
> +
> + return hr;
> +}
> +
> /*
> * This maps the read value (from the input event) to a value in the
> * 'wanted' range.
> diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
> index 5541522..3ad592d 100644
> --- a/dlls/dinput/joystick_linux.c
> +++ b/dlls/dinput/joystick_linux.c
> @@ -682,8 +682,8 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
> IDirectInputDevice2AImpl_SendDeviceData,
> IDirectInputDevice7AImpl_EnumEffectsInFile,
> IDirectInputDevice7AImpl_WriteEffectToFile,
> - IDirectInputDevice8AImpl_BuildActionMap,
> - IDirectInputDevice8AImpl_SetActionMap,
> + JoystickAGenericImpl_BuildActionMap,
> + JoystickAGenericImpl_SetActionMap,
> IDirectInputDevice8AImpl_GetImageInfo
> };
>
> @@ -718,8 +718,8 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
> IDirectInputDevice2WImpl_SendDeviceData,
> IDirectInputDevice7WImpl_EnumEffectsInFile,
> IDirectInputDevice7WImpl_WriteEffectToFile,
> - IDirectInputDevice8WImpl_BuildActionMap,
> - IDirectInputDevice8WImpl_SetActionMap,
> + JoystickWGenericImpl_BuildActionMap,
> + JoystickWGenericImpl_SetActionMap,
> IDirectInputDevice8WImpl_GetImageInfo
> };
>
> diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
> index c11edc7..afdee1e 100644
> --- a/dlls/dinput/joystick_linuxinput.c
> +++ b/dlls/dinput/joystick_linuxinput.c
> @@ -1417,8 +1417,8 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
> IDirectInputDevice2AImpl_SendDeviceData,
> IDirectInputDevice7AImpl_EnumEffectsInFile,
> IDirectInputDevice7AImpl_WriteEffectToFile,
> - IDirectInputDevice8AImpl_BuildActionMap,
> - IDirectInputDevice8AImpl_SetActionMap,
> + JoystickAGenericImpl_BuildActionMap,
> + JoystickAGenericImpl_SetActionMap,
> IDirectInputDevice8AImpl_GetImageInfo
> };
>
> @@ -1453,8 +1453,8 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
> IDirectInputDevice2WImpl_SendDeviceData,
> IDirectInputDevice7WImpl_EnumEffectsInFile,
> IDirectInputDevice7WImpl_WriteEffectToFile,
> - IDirectInputDevice8WImpl_BuildActionMap,
> - IDirectInputDevice8WImpl_SetActionMap,
> + JoystickWGenericImpl_BuildActionMap,
> + JoystickWGenericImpl_SetActionMap,
> IDirectInputDevice8WImpl_GetImageInfo
> };
>
> diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c
> index 439c8ad..756a682 100644
> --- a/dlls/dinput/joystick_osx.c
> +++ b/dlls/dinput/joystick_osx.c
> @@ -972,8 +972,8 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
> IDirectInputDevice2AImpl_SendDeviceData,
> IDirectInputDevice7AImpl_EnumEffectsInFile,
> IDirectInputDevice7AImpl_WriteEffectToFile,
> - IDirectInputDevice8AImpl_BuildActionMap,
> - IDirectInputDevice8AImpl_SetActionMap,
> + JoystickAGenericImpl_BuildActionMap,
> + JoystickAGenericImpl_SetActionMap,
> IDirectInputDevice8AImpl_GetImageInfo
> };
>
> @@ -1008,8 +1008,8 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
> IDirectInputDevice2WImpl_SendDeviceData,
> IDirectInputDevice7WImpl_EnumEffectsInFile,
> IDirectInputDevice7WImpl_WriteEffectToFile,
> - IDirectInputDevice8WImpl_BuildActionMap,
> - IDirectInputDevice8WImpl_SetActionMap,
> + JoystickWGenericImpl_BuildActionMap,
> + JoystickWGenericImpl_SetActionMap,
> IDirectInputDevice8WImpl_GetImageInfo
> };
>
> diff --git a/dlls/dinput/joystick_private.h b/dlls/dinput/joystick_private.h
> index a332e24..71d91f1 100644
> --- a/dlls/dinput/joystick_private.h
> +++ b/dlls/dinput/joystick_private.h
> @@ -86,4 +86,10 @@ HRESULT WINAPI JoystickWGenericImpl_Poll(LPDIRECTINPUTDEVICE8W iface) DECLSPEC_H
> HRESULT WINAPI JoystickAGenericImpl_GetDeviceState(LPDIRECTINPUTDEVICE8A iface, DWORD len, LPVOID ptr) DECLSPEC_HIDDEN;
> HRESULT WINAPI JoystickWGenericImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W iface, DWORD len, LPVOID ptr) DECLSPEC_HIDDEN;
>
> +HRESULT WINAPI JoystickAGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface, LPDIACTIONFORMATA lpdiaf, LPCSTR lpszUserName, DWORD dwFlags) DECLSPEC_HIDDEN;
> +HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) DECLSPEC_HIDDEN;
> +
> +HRESULT WINAPI JoystickAGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface, LPDIACTIONFORMATA lpdiaf, LPCSTR lpszUserName, DWORD dwFlags) DECLSPEC_HIDDEN;
> +HRESULT WINAPI JoystickWGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) DECLSPEC_HIDDEN;
> +
> #endif /* __WINE_DLLS_DINPUT_JOYSTICK_PRIVATE_H */