diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c index 1be6f313853..68dcc6a7e75 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 55415223dda..3ad592d4b44 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 c11edc78079..afdee1e2bec 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 439c8adb41a..756a682318e 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 a332e24620f..71d91f14f5b 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 */