winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2018
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
804 discussions
Start a n
N
ew thread
Józef Kucia : wined3d: Dump sample counts for cube maps (Coverity).
by Alexandre Julliard
22 Feb '18
22 Feb '18
Module: wine Branch: master Commit: 62c7a351ec57af0af830d6dea7957bb4e83ef31a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=62c7a351ec57af0af830d6de…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Feb 20 23:59:44 2018 +0100 wined3d: Dump sample counts for cube maps (Coverity). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index fc97205..5f621b0 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -282,6 +282,10 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(face, level, GL_TEXTURE_INTERNAL_FORMAT, &fmt); gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(face, level, GL_TEXTURE_WIDTH, &width); gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(face, level, GL_TEXTURE_HEIGHT, &height); + if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) + gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(face, level, GL_TEXTURE_SAMPLES, &samples); + else + samples = 1; tex_target = GL_TEXTURE_CUBE_MAP; tex_type_str = "cube";
1
0
0
0
Hans Leidekker : include: Fix the definition of CREDUI_MAX_DOMAIN_TARGET_LENGTH.
by Alexandre Julliard
22 Feb '18
22 Feb '18
Module: wine Branch: master Commit: 71ba1feb35fd1f12fe8362e68f9e63672a190fe7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=71ba1feb35fd1f12fe8362e6…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Feb 21 15:22:09 2018 +0100 include: Fix the definition of CREDUI_MAX_DOMAIN_TARGET_LENGTH. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/wincred.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wincred.h b/include/wincred.h index 74fc16f..86934b8 100644 --- a/include/wincred.h +++ b/include/wincred.h @@ -189,7 +189,7 @@ typedef struct _BINARY_BLOB_CREDENTIAL_INFO #define CREDUI_MAX_MESSAGE_LENGTH 32767 #define CREDUI_MAX_CAPTION_LENGTH 128 #define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH -#define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_LENGTH +#define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_NAME_LENGTH #define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH #define CREDUI_MAX_PASSWORD_LENGTH (CRED_MAX_CREDENTIAL_BLOB_SIZE / 2)
1
0
0
0
Jacek Caban : mshtml: Added IDOMMouseEvent:: toElement property implementation.
by Alexandre Julliard
22 Feb '18
22 Feb '18
Module: wine Branch: master Commit: c0d248f2a5c167d228c4024feea2ec713abc42ed URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c0d248f2a5c167d228c4024f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Feb 21 15:19:56 2018 +0100 mshtml: Added IDOMMouseEvent::toElement property implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlevent.c | 33 ++++++++++++++++++++++++++++----- dlls/mshtml/tests/events.js | 1 + 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 6c75475..e9a4731 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -138,6 +138,10 @@ typedef struct { #define EVENT_HASDEFAULTHANDLERS 0x0020 #define EVENT_FIXME 0x0040 +/* mouse event flags for fromElement and toElement implementation */ +#define EVENT_MOUSE_TO_RELATED 0x0100 +#define EVENT_MOUSE_FROM_RELATED 0x0200 + static const event_info_t event_info[] = { {abortW, EVENT_TYPE_EVENT, DISPID_EVMETH_ONABORT, EVENT_BIND_TO_BODY}, @@ -186,11 +190,11 @@ static const event_info_t event_info[] = { {mousedownW, EVENT_TYPE_MOUSE, DISPID_EVMETH_ONMOUSEDOWN, EVENT_DEFAULTLISTENER | EVENT_BUBBLES | EVENT_CANCELABLE}, {mousemoveW, EVENT_TYPE_MOUSE, DISPID_EVMETH_ONMOUSEMOVE, - EVENT_DEFAULTLISTENER | EVENT_BUBBLES | EVENT_CANCELABLE}, + EVENT_DEFAULTLISTENER | EVENT_BUBBLES | EVENT_CANCELABLE | EVENT_MOUSE_FROM_RELATED}, {mouseoutW, EVENT_TYPE_MOUSE, DISPID_EVMETH_ONMOUSEOUT, - EVENT_DEFAULTLISTENER | EVENT_BUBBLES | EVENT_CANCELABLE}, + EVENT_DEFAULTLISTENER | EVENT_BUBBLES | EVENT_CANCELABLE | EVENT_MOUSE_TO_RELATED}, {mouseoverW, EVENT_TYPE_MOUSE, DISPID_EVMETH_ONMOUSEOVER, - EVENT_DEFAULTLISTENER | EVENT_BUBBLES | EVENT_CANCELABLE}, + EVENT_DEFAULTLISTENER | EVENT_BUBBLES | EVENT_CANCELABLE | EVENT_MOUSE_FROM_RELATED}, {mouseupW, EVENT_TYPE_MOUSE, DISPID_EVMETH_ONMOUSEUP, EVENT_DEFAULTLISTENER | EVENT_BUBBLES | EVENT_CANCELABLE}, {mousewheelW, EVENT_TYPE_MOUSE, DISPID_EVMETH_ONMOUSEWHEEL, @@ -1583,8 +1587,27 @@ static HRESULT WINAPI DOMMouseEvent_get_fromElement(IDOMMouseEvent *iface, IHTML static HRESULT WINAPI DOMMouseEvent_get_toElement(IDOMMouseEvent *iface, IHTMLElement **p) { DOMEvent *This = impl_from_IDOMMouseEvent(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + IEventTarget *related_target = NULL; + + TRACE("(%p)->(%p)\n", This, p); + + if(This->event_id != EVENTID_LAST) { + HRESULT hres = S_OK; + if(event_info[This->event_id].flags & EVENT_MOUSE_TO_RELATED) + hres = IDOMMouseEvent_get_relatedTarget(&This->IDOMMouseEvent_iface, &related_target); + else if(event_info[This->event_id].flags & EVENT_MOUSE_FROM_RELATED) + hres = IDOMEvent_get_target(&This->IDOMEvent_iface, &related_target); + if(FAILED(hres)) + return hres; + } + + if(!related_target) { + *p = NULL; + return S_OK; + } + + IEventTarget_QueryInterface(related_target, &IID_IHTMLElement, (void**)p); + return S_OK; } static HRESULT WINAPI DOMMouseEvent_get_x(IDOMMouseEvent *iface, LONG *p) diff --git a/dlls/mshtml/tests/events.js b/dlls/mshtml/tests/events.js index 677e8e7..a15ee51 100644 --- a/dlls/mshtml/tests/events.js +++ b/dlls/mshtml/tests/events.js @@ -632,6 +632,7 @@ function test_mouse_event() { ok(e.pageY === 0, "pageY = " + e.pageY); ok(e.which === 1, "which = " + e.which); ok(e.relatedTarget === null, "relatedTarget = " + e.relatedTarget); + ok(e.toElement === null, "toElement = " + e.toElement); e.initMouseEvent("test", true, true, window, 1, 2, 3, 4, 5, false, false, false, false, 1, document); ok(e.type === "test", "type = " + e.type);
1
0
0
0
Aric Stewart : winebus.sys: Support adding and removing SDL devices.
by Alexandre Julliard
22 Feb '18
22 Feb '18
Module: wine Branch: master Commit: 752de1b56607b84c712e79ab34c507a3e8d96c4b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=752de1b56607b84c712e79ab…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Wed Feb 21 06:55:50 2018 -0600 winebus.sys: Support adding and removing SDL devices. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_sdl.c | 290 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 289 insertions(+), 1 deletion(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 8486a0f..05443f5 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -19,10 +19,17 @@ */ #include "config.h" +#include "wine/port.h" #include <errno.h> #include <fcntl.h> #include <stdarg.h> #include <stdlib.h> +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif +#ifdef HAVE_SDL2_SDL_H +# include <SDL2/SDL.h> +#endif #define NONAMELESSUNION @@ -33,7 +40,17 @@ #include "winnls.h" #include "winternl.h" #include "ddk/wdm.h" +#include "ddk/hidtypes.h" +#include "wine/library.h" #include "wine/debug.h" +#include "wine/unicode.h" +#include "hidusage.h" + +#ifdef WORDS_BIGENDIAN +# define LE_WORD(x) RtlUshortByteSwap(x) +#else +# define LE_WORD(x) (x) +#endif #include "bus.h" @@ -41,9 +58,280 @@ WINE_DEFAULT_DEBUG_CHANNEL(plugplay); #ifdef SONAME_LIBSDL2 +WINE_DECLARE_DEBUG_CHANNEL(hid_report); + +static DRIVER_OBJECT *sdl_driver_obj = NULL; + +static const WCHAR sdl_busidW[] = {'S','D','L','J','O','Y',0}; + +#include "initguid.h" +DEFINE_GUID(GUID_DEVCLASS_SDL, 0x463d60b5,0x802b,0x4bb2,0x8f,0xdb,0x7d,0xa9,0xb9,0x96,0x04,0xd8); + +static void *sdl_handle = NULL; + +#ifdef SONAME_LIBSDL2 +#define MAKE_FUNCPTR(f) static typeof(f) * p##f = NULL +MAKE_FUNCPTR(SDL_GetError); +MAKE_FUNCPTR(SDL_Init); +MAKE_FUNCPTR(SDL_JoystickEventState); +MAKE_FUNCPTR(SDL_JoystickGetGUID); +MAKE_FUNCPTR(SDL_JoystickGetGUIDString); +MAKE_FUNCPTR(SDL_JoystickInstanceID); +MAKE_FUNCPTR(SDL_JoystickName); +MAKE_FUNCPTR(SDL_JoystickNumAxes); +MAKE_FUNCPTR(SDL_JoystickOpen); +MAKE_FUNCPTR(SDL_WaitEvent); +#endif +static Uint16 (*pSDL_JoystickGetProduct)(SDL_Joystick * joystick); +static Uint16 (*pSDL_JoystickGetProductVersion)(SDL_Joystick * joystick); +static Uint16 (*pSDL_JoystickGetVendor)(SDL_Joystick * joystick); + +struct platform_private +{ + SDL_Joystick *sdl_joystick; + SDL_JoystickID id; +}; + +static inline struct platform_private *impl_from_DEVICE_OBJECT(DEVICE_OBJECT *device) +{ + return (struct platform_private *)get_platform_private(device); +} + +static int compare_platform_device(DEVICE_OBJECT *device, void *platform_dev) +{ + SDL_JoystickID id1 = impl_from_DEVICE_OBJECT(device)->id; + SDL_JoystickID id2 = PtrToUlong(platform_dev); + return (id1 != id2); +} + +static NTSTATUS get_reportdescriptor(DEVICE_OBJECT *device, BYTE *buffer, DWORD length, DWORD *out_length) +{ + return STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buffer, DWORD length) +{ + struct platform_private *ext = impl_from_DEVICE_OBJECT(device); + const char* str = NULL; + + switch (index) + { + case HID_STRING_ID_IPRODUCT: + str = pSDL_JoystickName(ext->sdl_joystick); + break; + case HID_STRING_ID_IMANUFACTURER: + str = "SDL"; + break; + case HID_STRING_ID_ISERIALNUMBER: + str = "000000"; + break; + default: + ERR("Unhandled string index %i\n", index); + } + + if (str && str[0]) + MultiByteToWideChar(CP_ACP, 0, str, -1, buffer, length); + else + buffer[0] = 0; + + return STATUS_SUCCESS; +} + +static NTSTATUS begin_report_processing(DEVICE_OBJECT *device) +{ + return STATUS_SUCCESS; +} + +static NTSTATUS set_output_report(DEVICE_OBJECT *device, UCHAR id, BYTE *report, DWORD length, ULONG_PTR *written) +{ + *written = 0; + return STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS get_feature_report(DEVICE_OBJECT *device, UCHAR id, BYTE *report, DWORD length, ULONG_PTR *read) +{ + *read = 0; + return STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS set_feature_report(DEVICE_OBJECT *device, UCHAR id, BYTE *report, DWORD length, ULONG_PTR *written) +{ + *written = 0; + return STATUS_NOT_IMPLEMENTED; +} + +static const platform_vtbl sdl_vtbl = +{ + compare_platform_device, + get_reportdescriptor, + get_string, + begin_report_processing, + set_output_report, + get_feature_report, + set_feature_report, +}; + +static void try_remove_device(SDL_JoystickID index) +{ + DEVICE_OBJECT *device = NULL; + + device = bus_find_hid_device(&sdl_vtbl, ULongToPtr(index)); + if (!device) return; + + IoInvalidateDeviceRelations(device, RemovalRelations); + + bus_remove_hid_device(device); +} + +static void try_add_device(SDL_JoystickID index) +{ + DWORD vid = 0, pid = 0, version = 0; + DEVICE_OBJECT *device = NULL; + WCHAR serial[34] = {0}; + char guid_str[34]; + BOOL is_xbox_gamepad; + int button_count, axis_count; + + SDL_Joystick* joystick; + SDL_JoystickID id; + SDL_JoystickGUID guid; + + if ((joystick = pSDL_JoystickOpen(index)) == NULL) + { + WARN("Unable to open sdl device %i: %s\n", index, pSDL_GetError()); + return; + } + + id = index; + if (pSDL_JoystickGetProductVersion != NULL) { + vid = pSDL_JoystickGetVendor(joystick); + pid = pSDL_JoystickGetProduct(joystick); + version = pSDL_JoystickGetProductVersion(joystick); + } + else + { + vid = 0x01; + pid = pSDL_JoystickInstanceID(joystick) + 1; + version = 0; + } + + guid = pSDL_JoystickGetGUID(joystick); + pSDL_JoystickGetGUIDString(guid, guid_str, sizeof(guid_str)); + MultiByteToWideChar(CP_ACP, 0, guid_str, -1, serial, sizeof(guid_str)); + + TRACE("Found sdl device %i (vid %04x, pid %04x, version %u, serial %s)\n", + index, vid, pid, version, debugstr_w(serial)); + + axis_count = pSDL_JoystickNumAxes(joystick); + button_count = pSDL_JoystickNumAxes(joystick); + is_xbox_gamepad = (axis_count == 6 && button_count >= 14); + + device = bus_create_hid_device(sdl_driver_obj, sdl_busidW, vid, pid, version, 0, serial, is_xbox_gamepad, &GUID_DEVCLASS_SDL, &sdl_vtbl, sizeof(struct platform_private)); + + if (device) + { + struct platform_private *private = impl_from_DEVICE_OBJECT(device); + private->sdl_joystick = joystick; + private->id = id; + IoInvalidateDeviceRelations(device, BusRelations); + } + else + { + WARN("Ignoring device %i\n", index); + } +} + +static void process_device_event(SDL_Event *event) +{ + TRACE_(hid_report)("Received action %x\n", event->type); + + if (event->type == SDL_JOYDEVICEADDED) + try_add_device(((SDL_JoyDeviceEvent*)event)->which); + else if (event->type == SDL_JOYDEVICEREMOVED) + try_remove_device(((SDL_JoyDeviceEvent*)event)->which); +} + +static DWORD CALLBACK deviceloop_thread(void *args) +{ + HANDLE init_done = args; + SDL_Event event; + + if (pSDL_Init(SDL_INIT_JOYSTICK) < 0) + { + ERR("Can't Init SDL\n"); + return STATUS_UNSUCCESSFUL; + } + + pSDL_JoystickEventState(SDL_ENABLE); + + SetEvent(init_done); + + while (1) + while (pSDL_WaitEvent(&event) != 0) + process_device_event(&event); + + TRACE("Device thread exiting\n"); + return 0; +} + NTSTATUS WINAPI sdl_driver_init(DRIVER_OBJECT *driver, UNICODE_STRING *registry_path) { - FIXME("STUB: (%p, %s)\n", driver, debugstr_w(registry_path->Buffer)); + HANDLE events[2]; + DWORD result; + + TRACE("(%p, %s)\n", driver, debugstr_w(registry_path->Buffer)); + if (sdl_handle == NULL) + { + sdl_handle = wine_dlopen(SONAME_LIBSDL2, RTLD_NOW, NULL, 0); + if (!sdl_handle) { + WARN("could not load %s\n", SONAME_LIBSDL2); + sdl_driver_obj = NULL; + return STATUS_UNSUCCESSFUL; + } +#define LOAD_FUNCPTR(f) if((p##f = wine_dlsym(sdl_handle, #f, NULL, 0)) == NULL){WARN("Can't find symbol %s\n", #f); goto sym_not_found;} + LOAD_FUNCPTR(SDL_GetError); + LOAD_FUNCPTR(SDL_Init); + LOAD_FUNCPTR(SDL_JoystickEventState); + LOAD_FUNCPTR(SDL_JoystickGetGUID); + LOAD_FUNCPTR(SDL_JoystickGetGUIDString); + LOAD_FUNCPTR(SDL_JoystickInstanceID); + LOAD_FUNCPTR(SDL_JoystickName); + LOAD_FUNCPTR(SDL_JoystickNumAxes); + LOAD_FUNCPTR(SDL_JoystickOpen); + LOAD_FUNCPTR(SDL_WaitEvent); +#undef LOAD_FUNCPTR + pSDL_JoystickGetProduct = wine_dlsym(sdl_handle, "SDL_JoystickGetProduct", NULL, 0); + pSDL_JoystickGetProductVersion = wine_dlsym(sdl_handle, "SDL_JoystickGetProductVersion", NULL, 0); + pSDL_JoystickGetVendor = wine_dlsym(sdl_handle, "SDL_JoystickGetVendor", NULL, 0); + } + + sdl_driver_obj = driver; + driver->MajorFunction[IRP_MJ_PNP] = common_pnp_dispatch; + driver->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = hid_internal_dispatch; + + if (!(events[0] = CreateEventW(NULL, TRUE, FALSE, NULL))) + goto error; + if (!(events[1] = CreateThread(NULL, 0, deviceloop_thread, events[0], 0, NULL))) + { + CloseHandle(events[0]); + goto error; + } + + result = WaitForMultipleObjects(2, events, FALSE, INFINITE); + CloseHandle(events[0]); + CloseHandle(events[1]); + if (result == WAIT_OBJECT_0) + { + TRACE("Initialization successful\n"); + return STATUS_SUCCESS; + } + +error: + sdl_driver_obj = NULL; + return STATUS_UNSUCCESSFUL; +sym_not_found: + wine_dlclose(sdl_handle, NULL, 0); + sdl_handle = NULL; return STATUS_UNSUCCESSFUL; }
1
0
0
0
Nikolay Sivov : comctl32/tooltips: Fix structure size check for TTM_ADDTOOLW.
by Alexandre Julliard
22 Feb '18
22 Feb '18
Module: wine Branch: master Commit: c586b759a97eb62f399689bbc5572811b12eb78f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c586b759a97eb62f399689bb…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Feb 21 16:18:54 2018 +0300 comctl32/tooltips: Fix structure size check for TTM_ADDTOOLW. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/tooltips.c | 80 ++++++++++++++++++++++++++++++++++++++++-- dlls/comctl32/tooltips.c | 2 +- 2 files changed, 79 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c index 207536c..c260e3d 100644 --- a/dlls/comctl32/tests/tooltips.c +++ b/dlls/comctl32/tests/tooltips.c @@ -44,7 +44,6 @@ static void test_create_tooltip(BOOL is_v6) ok(hwnd != NULL, "failed to create tooltip wnd\n"); style = GetWindowLongA(hwnd, GWL_STYLE); - trace("style = %08x\n", style); exp_style = 0x7fffffff | WS_POPUP; exp_style &= ~(WS_CHILD | WS_MAXIMIZE | WS_BORDER | WS_DLGFRAME); ok(style == exp_style || broken(style == (exp_style | WS_BORDER)), /* nt4 */ @@ -448,7 +447,7 @@ todo_wine NULL, NULL, NULL, 0); ok(hwnd != NULL, "failed to create tooltip wnd\n"); - toolinfoW.cbSize = sizeof(TTTOOLINFOW); + toolinfoW.cbSize = TTTOOLINFOW_V2_SIZE + 1; toolinfoW.hwnd = NULL; toolinfoW.hinst = GetModuleHandleA(NULL); toolinfoW.uFlags = 0; @@ -457,6 +456,9 @@ todo_wine toolinfoW.lParam = 0xdeadbeef; GetClientRect(hwnd, &toolinfoW.rect); r = SendMessageW(hwnd, TTM_ADDTOOLW, 0, (LPARAM)&toolinfoW); + /* Wine currently checks for V3 structure size, which matches what V6 control does. + Older implementation was never updated to support lpReserved field. */ +todo_wine ok(!r, "Adding the tool to the tooltip succeeded!\n"); if (0) /* crashes on NT4 */ @@ -1060,6 +1062,78 @@ static void test_margin(void) DestroyWindow(hwnd); } +static void test_TTM_ADDTOOL(BOOL is_v6) +{ + static const WCHAR testW[] = {'T','e','s','t',0}; + TTTOOLINFOW tiW; + TTTOOLINFOA ti; + int ret, size; + HWND hwnd, parent; + UINT max_size; + + parent = CreateWindowExA(0, "Static", NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, 0); + ok(parent != NULL, "failed to create parent wnd\n"); + + hwnd = CreateWindowExA(WS_EX_TOPMOST, TOOLTIPS_CLASSA, NULL, TTS_NOPREFIX | TTS_ALWAYSTIP, + 0, 0, 100, 100, NULL, NULL, GetModuleHandleA(NULL), 0); + ok(hwnd != NULL, "Failed to create tooltip window.\n"); + + for (size = 0; size <= TTTOOLINFOW_V3_SIZE + 1; size++) + { + ti.cbSize = size; + ti.hwnd = NULL; + ti.hinst = GetModuleHandleA(NULL); + ti.uFlags = 0; + ti.uId = 0x1234abce; + ti.lpszText = (LPSTR)"Test"; + ti.lParam = 0xdeadbeef; + GetClientRect(hwnd, &ti.rect); + + ret = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&ti); + ok(ret, "Failed to add a tool, size %d.\n", size); + + ret = SendMessageA(hwnd, TTM_GETTOOLCOUNT, 0, 0); + ok(ret == 1, "Unexpected tool count %d, size %d.\n", ret, size); + + ret = SendMessageA(hwnd, TTM_DELTOOLA, 0, (LPARAM)&ti); + ok(!ret, "Unexpected ret value %d.\n", ret); + + ret = SendMessageA(hwnd, TTM_GETTOOLCOUNT, 0, 0); + ok(ret == 0, "Unexpected tool count %d, size %d.\n", ret, size); + } + + /* W variant checks cbSize. */ + max_size = is_v6 ? TTTOOLINFOW_V3_SIZE : TTTOOLINFOW_V2_SIZE; + for (size = 0; size <= max_size + 1; size++) + { + tiW.cbSize = size; + tiW.hwnd = NULL; + tiW.hinst = GetModuleHandleA(NULL); + tiW.uFlags = 0; + tiW.uId = 0x1234abce; + tiW.lpszText = (LPWSTR)testW; + tiW.lParam = 0xdeadbeef; + GetClientRect(hwnd, &tiW.rect); + + ret = SendMessageA(hwnd, TTM_ADDTOOLW, 0, (LPARAM)&tiW); + todo_wine_if(!is_v6 && size > max_size) + ok(size <= max_size ? ret : !ret, "%d: Unexpected ret value %d, size %d, max size %d.\n", is_v6, ret, size, max_size); + if (ret) + { + ret = SendMessageA(hwnd, TTM_GETTOOLCOUNT, 0, 0); + ok(ret == 1, "Unexpected tool count %d.\n", ret); + + ret = SendMessageA(hwnd, TTM_DELTOOLA, 0, (LPARAM)&tiW); + ok(!ret, "Unexpected ret value %d.\n", ret); + + ret = SendMessageA(hwnd, TTM_GETTOOLCOUNT, 0, 0); + ok(ret == 0, "Unexpected tool count %d.\n", ret); + } + } + + DestroyWindow(hwnd); +} + START_TEST(tooltips) { ULONG_PTR ctx_cookie; @@ -1078,6 +1152,7 @@ START_TEST(tooltips) test_track(); test_setinfo(FALSE); test_margin(); + test_TTM_ADDTOOL(FALSE); if (!load_v6_module(&ctx_cookie, &hCtx)) return; @@ -1088,6 +1163,7 @@ START_TEST(tooltips) test_track(); test_setinfo(TRUE); test_margin(); + test_TTM_ADDTOOL(TRUE); unload_v6_module(ctx_cookie, hCtx); } diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c index 1c8cb66..12f2d4b 100644 --- a/dlls/comctl32/tooltips.c +++ b/dlls/comctl32/tooltips.c @@ -1059,7 +1059,7 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW) TRACE("add tool (%p) %p %ld%s\n", infoPtr->hwndSelf, ti->hwnd, ti->uId, (ti->uFlags & TTF_IDISHWND) ? " TTF_IDISHWND" : ""); - if (ti->cbSize >= TTTOOLINFOW_V2_SIZE && !ti->lpszText && isW) + if (ti->cbSize > TTTOOLINFOW_V3_SIZE && isW) return FALSE; if (infoPtr->uNumTools == 0) {
1
0
0
0
Nikolay Sivov : comctl32/tests: Run some tooltips tests on version 6 too.
by Alexandre Julliard
22 Feb '18
22 Feb '18
Module: wine Branch: master Commit: 73b70aff6cca9587eab620c598df88163342f3c7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=73b70aff6cca9587eab620c5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Feb 21 16:18:53 2018 +0300 comctl32/tests: Run some tooltips tests on version 6 too. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/tooltips.c | 48 ++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c index 7e82604..207536c 100644 --- a/dlls/comctl32/tests/tooltips.c +++ b/dlls/comctl32/tests/tooltips.c @@ -24,9 +24,11 @@ #include "wine/test.h" +#include "v6util.h" + #define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got) -static void test_create_tooltip(void) +static void test_create_tooltip(BOOL is_v6) { HWND parent, hwnd; DWORD style, exp_style; @@ -56,9 +58,12 @@ static void test_create_tooltip(void) ok(hwnd != NULL, "failed to create tooltip wnd\n"); style = GetWindowLongA(hwnd, GWL_STYLE); - trace("style = %08x\n", style); - ok(style == (WS_POPUP | WS_CLIPSIBLINGS | WS_BORDER), - "wrong style %08x\n", style); + exp_style = WS_POPUP | WS_CLIPSIBLINGS; + if (!is_v6) + exp_style |= WS_BORDER; +todo_wine_if(is_v6) + ok(style == exp_style || broken(style == (exp_style | WS_BORDER)) /* XP */, + "Unexpected window style %#x.\n", style); DestroyWindow(hwnd); @@ -273,9 +278,10 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP return DefWindowProcA(hwnd, message, wParam, lParam); } -static BOOL register_parent_wnd_class(void) +static void register_parent_wnd_class(void) { WNDCLASSA cls; + BOOL ret; cls.style = 0; cls.lpfnWndProc = parent_wnd_proc; @@ -287,14 +293,12 @@ static BOOL register_parent_wnd_class(void) cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "Tooltips test parent class"; - return RegisterClassA(&cls); + ret = RegisterClassA(&cls); + ok(ret, "Failed to register test parent class.\n"); } static HWND create_parent_window(void) { - if (!register_parent_wnd_class()) - return NULL; - return CreateWindowExA(0, "Tooltips test parent class", "Tooltips test parent window", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | @@ -884,7 +888,7 @@ static LRESULT CALLBACK info_wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM return 0; } -static void test_setinfo(void) +static void test_setinfo(BOOL is_v6) { WNDCLASSA wc; LRESULT lResult; @@ -976,7 +980,8 @@ static void test_setinfo(void) toolInfo2.uId = 0x1234ABCD; lResult = SendMessageA(hwndTip, TTM_GETTOOLINFOA, 0, (LPARAM)&toolInfo2); ok(lResult, "GetToolInfo failed\n"); - ok(toolInfo2.uFlags & TTF_SUBCLASS, "uFlags does not have subclass\n"); + ok(toolInfo2.uFlags & TTF_SUBCLASS || broken(is_v6 && !(toolInfo2.uFlags & TTF_SUBCLASS)) /* XP */, + "uFlags does not have subclass\n"); wndProc = (WNDPROC)GetWindowLongPtrA(parent, GWLP_WNDPROC); ok (wndProc != info_wnd_proc, "Window Proc is wrong\n"); @@ -1057,15 +1062,32 @@ static void test_margin(void) START_TEST(tooltips) { + ULONG_PTR ctx_cookie; + HANDLE hCtx; + LoadLibraryA("comctl32.dll"); - test_create_tooltip(); + register_parent_wnd_class(); + + test_create_tooltip(FALSE); test_customdraw(); test_gettext(); test_ttm_gettoolinfo(); test_longtextA(); test_longtextW(); test_track(); - test_setinfo(); + test_setinfo(FALSE); test_margin(); + + if (!load_v6_module(&ctx_cookie, &hCtx)) + return; + + test_create_tooltip(TRUE); + test_customdraw(); + test_longtextW(); + test_track(); + test_setinfo(TRUE); + test_margin(); + + unload_v6_module(ctx_cookie, hCtx); }
1
0
0
0
Józef Kucia : d3d10core/tests: Fix memory leaks in test_generate_mips().
by Alexandre Julliard
22 Feb '18
22 Feb '18
Module: wine Branch: master Commit: 175011d2dbfa24cd38a4e0770579497de778edd2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=175011d2dbfa24cd38a4e077…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Feb 20 23:59:41 2018 +0100 d3d10core/tests: Fix memory leaks in test_generate_mips(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10core/tests/device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 6b8773a..2a8169a 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -14590,6 +14590,8 @@ static void test_generate_mips(void) if (is_warp_device(device)) { win_skip("Creating the next texture crashes WARP on some testbot boxes.\n"); + HeapFree(GetProcessHeap(), 0, zero_data); + HeapFree(GetProcessHeap(), 0, data); ID3D10SamplerState_Release(sampler_state); ID3D10PixelShader_Release(ps_3d); ID3D10PixelShader_Release(ps); @@ -14687,6 +14689,7 @@ static void test_generate_mips(void) ID3D10Resource_Release(resource); + HeapFree(GetProcessHeap(), 0, zero_data); HeapFree(GetProcessHeap(), 0, data); ID3D10SamplerState_Release(sampler_state);
1
0
0
0
Aric Stewart : winebus.sys: Map SDL game controllers if requested.
by Alexandre Julliard
22 Feb '18
22 Feb '18
Module: wine Branch: master Commit: 2505d67cbcbae0763cef99e1e399dc1a1b74b519 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2505d67cbcbae0763cef99e1…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Wed Feb 21 06:57:05 2018 -0600 winebus.sys: Map SDL game controllers if requested. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_sdl.c | 267 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 251 insertions(+), 16 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=2505d67cbcbae0763cef…
1
0
0
0
Aric Stewart : winebus.sys: Implement SDL Haptic for controller vibration.
by Alexandre Julliard
22 Feb '18
22 Feb '18
Module: wine Branch: master Commit: 249db7e49e29dd5995a47e3cb5d2875a288bc63d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=249db7e49e29dd5995a47e3c…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Wed Feb 21 06:57:18 2018 -0600 winebus.sys: Implement SDL Haptic for controller vibration. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winebus.sys/bus_sdl.c | 134 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 131 insertions(+), 3 deletions(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index ea60d67..3a98fa7 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -110,6 +110,18 @@ MAKE_FUNCPTR(SDL_GameControllerGetAxis); MAKE_FUNCPTR(SDL_GameControllerName); MAKE_FUNCPTR(SDL_GameControllerOpen); MAKE_FUNCPTR(SDL_GameControllerEventState); +MAKE_FUNCPTR(SDL_HapticClose); +MAKE_FUNCPTR(SDL_HapticDestroyEffect); +MAKE_FUNCPTR(SDL_HapticNewEffect); +MAKE_FUNCPTR(SDL_HapticOpenFromJoystick); +MAKE_FUNCPTR(SDL_HapticQuery); +MAKE_FUNCPTR(SDL_HapticRumbleInit); +MAKE_FUNCPTR(SDL_HapticRumblePlay); +MAKE_FUNCPTR(SDL_HapticRumbleSupported); +MAKE_FUNCPTR(SDL_HapticRunEffect); +MAKE_FUNCPTR(SDL_HapticStopAll); +MAKE_FUNCPTR(SDL_JoystickIsHaptic); +MAKE_FUNCPTR(SDL_memset); #endif static Uint16 (*pSDL_JoystickGetProduct)(SDL_Joystick * joystick); static Uint16 (*pSDL_JoystickGetProductVersion)(SDL_Joystick * joystick); @@ -130,6 +142,9 @@ struct platform_private int buffer_length; BYTE *report_buffer; + + SDL_Haptic *sdl_haptic; + int haptic_effect_id; }; static inline struct platform_private *impl_from_DEVICE_OBJECT(DEVICE_OBJECT *device) @@ -193,6 +208,28 @@ static const BYTE CONTROLLER_TRIGGERS [] = { 0x81, 0x02, /* INPUT (Data,Var,Abs) */ }; +static const BYTE HAPTIC_RUMBLE[] = { + 0x06, 0x00, 0xff, /* USAGE PAGE (vendor-defined) */ + 0x09, 0x01, /* USAGE (1) */ + 0x85, 0x00, /* REPORT_ID (0) */ + /* padding */ + 0x95, 0x02, /* REPORT_COUNT (2) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x91, 0x02, /* OUTPUT (Data,Var,Abs) */ + /* actuators */ + 0x15, 0x00, /* LOGICAL MINIMUM (0) */ + 0x25, 0xff, /* LOGICAL MAXIMUM (255) */ + 0x35, 0x00, /* PHYSICAL MINIMUM (0) */ + 0x45, 0xff, /* PHYSICAL MAXIMUM (255) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x95, 0x02, /* REPORT_COUNT (2) */ + 0x91, 0x02, /* OUTPUT (Data,Var,Abs) */ + /* padding */ + 0x95, 0x02, /* REPORT_COUNT (3) */ + 0x75, 0x08, /* REPORT_SIZE (8) */ + 0x91, 0x02, /* OUTPUT (Data,Var,Abs) */ +}; + static BYTE *add_axis_block(BYTE *report_ptr, BYTE count, BYTE page, const BYTE *usages, BOOL absolute) { int i; @@ -257,6 +294,40 @@ static void set_hat_value(struct platform_private *ext, int index, int value) } } +static int test_haptic(struct platform_private *ext) +{ + int rc = 0; + if (pSDL_JoystickIsHaptic(ext->sdl_joystick)) + { + ext->sdl_haptic = pSDL_HapticOpenFromJoystick(ext->sdl_joystick); + if (ext->sdl_haptic && + ((pSDL_HapticQuery(ext->sdl_haptic) & SDL_HAPTIC_LEFTRIGHT) != 0 || + pSDL_HapticRumbleSupported(ext->sdl_haptic))) + { + pSDL_HapticStopAll(ext->sdl_haptic); + pSDL_HapticRumbleInit(ext->sdl_haptic); + rc = sizeof(HAPTIC_RUMBLE); + ext->haptic_effect_id = -1; + } + else + { + pSDL_HapticClose(ext->sdl_haptic); + ext->sdl_haptic = NULL; + } + } + return rc; +} + +static int build_haptic(struct platform_private *ext, BYTE *report_ptr) +{ + if (ext->sdl_haptic) + { + memcpy(report_ptr, HAPTIC_RUMBLE, sizeof(HAPTIC_RUMBLE)); + return (sizeof(HAPTIC_RUMBLE)); + } + return 0; +} + static BOOL build_report_descriptor(struct platform_private *ext) { BYTE *report_ptr; @@ -338,6 +409,8 @@ static BOOL build_report_descriptor(struct platform_private *ext) report_size++; } + descript_size += test_haptic(ext); + TRACE("Report Descriptor will be %i bytes\n", descript_size); TRACE("Report will be %i bytes\n", report_size); @@ -377,6 +450,7 @@ static BOOL build_report_descriptor(struct platform_private *ext) if (hat_count) report_ptr = add_hatswitch(report_ptr, hat_count); + report_ptr += build_haptic(ext, report_ptr); memcpy(report_ptr, REPORT_TAIL, sizeof(REPORT_TAIL)); ext->report_descriptor_size = descript_size; @@ -407,6 +481,7 @@ static BOOL build_mapped_report_descriptor(struct platform_private *ext) descript_size += sizeof(CONTROLLER_BUTTONS); descript_size += sizeof(CONTROLLER_AXIS); descript_size += sizeof(CONTROLLER_TRIGGERS); + descript_size += test_haptic(ext); ext->axis_start = 2; ext->buffer_length = 14; @@ -432,6 +507,7 @@ static BOOL build_mapped_report_descriptor(struct platform_private *ext) report_ptr += sizeof(CONTROLLER_AXIS); memcpy(report_ptr, CONTROLLER_TRIGGERS, sizeof(CONTROLLER_TRIGGERS)); report_ptr += sizeof(CONTROLLER_TRIGGERS); + report_ptr += build_haptic(ext, report_ptr); memcpy(report_ptr, REPORT_TAIL, sizeof(REPORT_TAIL)); ext->report_descriptor_size = descript_size; @@ -509,8 +585,48 @@ static NTSTATUS begin_report_processing(DEVICE_OBJECT *device) static NTSTATUS set_output_report(DEVICE_OBJECT *device, UCHAR id, BYTE *report, DWORD length, ULONG_PTR *written) { - *written = 0; - return STATUS_NOT_IMPLEMENTED; + struct platform_private *ext = impl_from_DEVICE_OBJECT(device); + + if (ext->sdl_haptic && id == 0) + { + WORD left = report[2] * 128; + WORD right = report[3] * 128; + + if (ext->haptic_effect_id >= 0) + { + pSDL_HapticDestroyEffect(ext->sdl_haptic, ext->haptic_effect_id); + ext->haptic_effect_id = -1; + } + pSDL_HapticStopAll(ext->sdl_haptic); + if (left != 0 || right != 0) + { + SDL_HapticEffect effect; + + pSDL_memset( &effect, 0, sizeof(SDL_HapticEffect) ); + effect.type = SDL_HAPTIC_LEFTRIGHT; + effect.leftright.length = -1; + effect.leftright.large_magnitude = left; + effect.leftright.small_magnitude = right; + + ext->haptic_effect_id = pSDL_HapticNewEffect(ext->sdl_haptic, &effect); + if (ext->haptic_effect_id >= 0) + { + pSDL_HapticRunEffect(ext->sdl_haptic, ext->haptic_effect_id, 1); + } + else + { + float i = (float)((left + right)/2.0) / 32767.0; + pSDL_HapticRumblePlay(ext->sdl_haptic, i, -1); + } + } + *written = length; + return STATUS_SUCCESS; + } + else + { + *written = 0; + return STATUS_NOT_IMPLEMENTED; + } } static NTSTATUS get_feature_report(DEVICE_OBJECT *device, UCHAR id, BYTE *report, DWORD length, ULONG_PTR *read) @@ -790,7 +906,7 @@ static DWORD CALLBACK deviceloop_thread(void *args) HANDLE init_done = args; SDL_Event event; - if (pSDL_Init(SDL_INIT_GAMECONTROLLER) < 0) + if (pSDL_Init(SDL_INIT_GAMECONTROLLER|SDL_INIT_HAPTIC) < 0) { ERR("Can't Init SDL\n"); return STATUS_UNSUCCESSFUL; @@ -847,6 +963,18 @@ NTSTATUS WINAPI sdl_driver_init(DRIVER_OBJECT *driver, UNICODE_STRING *registry_ LOAD_FUNCPTR(SDL_GameControllerName); LOAD_FUNCPTR(SDL_GameControllerOpen); LOAD_FUNCPTR(SDL_GameControllerEventState); + LOAD_FUNCPTR(SDL_HapticClose); + LOAD_FUNCPTR(SDL_HapticDestroyEffect); + LOAD_FUNCPTR(SDL_HapticNewEffect); + LOAD_FUNCPTR(SDL_HapticOpenFromJoystick); + LOAD_FUNCPTR(SDL_HapticQuery); + LOAD_FUNCPTR(SDL_HapticRumbleInit); + LOAD_FUNCPTR(SDL_HapticRumblePlay); + LOAD_FUNCPTR(SDL_HapticRumbleSupported); + LOAD_FUNCPTR(SDL_HapticRunEffect); + LOAD_FUNCPTR(SDL_HapticStopAll); + LOAD_FUNCPTR(SDL_JoystickIsHaptic); + LOAD_FUNCPTR(SDL_memset); #undef LOAD_FUNCPTR pSDL_JoystickGetProduct = wine_dlsym(sdl_handle, "SDL_JoystickGetProduct", NULL, 0); pSDL_JoystickGetProductVersion = wine_dlsym(sdl_handle, "SDL_JoystickGetProductVersion", NULL, 0);
1
0
0
0
Jacek Caban : mshtml: Added IDOMMouseEvent:: fromElement property implementation.
by Alexandre Julliard
22 Feb '18
22 Feb '18
Module: wine Branch: master Commit: beb0b78a5a332902d6a8ab18f1a98152f3dcd2ac URL:
https://source.winehq.org/git/wine.git/?a=commit;h=beb0b78a5a332902d6a8ab18…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Feb 21 15:20:04 2018 +0100 mshtml: Added IDOMMouseEvent::fromElement property implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlevent.c | 23 +++++++++++++++++++++-- dlls/mshtml/tests/events.js | 1 + 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index e9a4731..0011baa 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -1580,8 +1580,27 @@ static HRESULT WINAPI DOMMouseEvent_get_buttons(IDOMMouseEvent *iface, USHORT *p static HRESULT WINAPI DOMMouseEvent_get_fromElement(IDOMMouseEvent *iface, IHTMLElement **p) { DOMEvent *This = impl_from_IDOMMouseEvent(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + IEventTarget *related_target = NULL; + + TRACE("(%p)->(%p)\n", This, p); + + if(This->event_id != EVENTID_LAST) { + HRESULT hres = S_OK; + if(event_info[This->event_id].flags & EVENT_MOUSE_FROM_RELATED) + hres = IDOMMouseEvent_get_relatedTarget(&This->IDOMMouseEvent_iface, &related_target); + else if(event_info[This->event_id].flags & EVENT_MOUSE_TO_RELATED) + hres = IDOMEvent_get_target(&This->IDOMEvent_iface, &related_target); + if(FAILED(hres)) + return hres; + } + + if(!related_target) { + *p = NULL; + return S_OK; + } + + IEventTarget_QueryInterface(related_target, &IID_IHTMLElement, (void**)p); + return S_OK; } static HRESULT WINAPI DOMMouseEvent_get_toElement(IDOMMouseEvent *iface, IHTMLElement **p) diff --git a/dlls/mshtml/tests/events.js b/dlls/mshtml/tests/events.js index a15ee51..7db440a 100644 --- a/dlls/mshtml/tests/events.js +++ b/dlls/mshtml/tests/events.js @@ -633,6 +633,7 @@ function test_mouse_event() { ok(e.which === 1, "which = " + e.which); ok(e.relatedTarget === null, "relatedTarget = " + e.relatedTarget); ok(e.toElement === null, "toElement = " + e.toElement); + ok(e.fromElement === null, "fromElement = " + e.fromElement); e.initMouseEvent("test", true, true, window, 1, 2, 3, 4, 5, false, false, false, false, 1, document); ok(e.type === "test", "type = " + e.type);
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
81
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Results per page:
10
25
50
100
200