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
June 2022
----- 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
791 discussions
Start a n
N
ew thread
Piotr Caban : server: Don't reset socket error in poll_socket.
by Alexandre Julliard
13 Jun '22
13 Jun '22
Module: wine Branch: master Commit: 73648f901cc64e061d4b9d316719c952e3a52ce8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=73648f901cc64e061d4b9d31…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Jun 10 17:07:25 2022 +0200 server: Don't reset socket error in poll_socket. Otherwise socket error may be cleared in poll_socket causing ioctl SO_ERROR calls to return no error. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51433
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> --- server/sock.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/server/sock.c b/server/sock.c index 8a0f3198c4e..439801a8cfa 100644 --- a/server/sock.c +++ b/server/sock.c @@ -631,13 +631,27 @@ static void sock_wake_up( struct sock *sock ) } } -static inline int sock_error( struct fd *fd ) +static inline int sock_error( struct sock *sock ) { - unsigned int optval = 0; - socklen_t optlen = sizeof(optval); + int error = 0; + socklen_t len = sizeof(error); - getsockopt( get_unix_fd(fd), SOL_SOCKET, SO_ERROR, (void *) &optval, &optlen); - return optval; + getsockopt( get_unix_fd(sock->fd), SOL_SOCKET, SO_ERROR, (void *)&error, &len); + if (sock->state == SOCK_CONNECTING) + { + if (error) + sock->errors[AFD_POLL_BIT_CONNECT_ERR] = error; + else + error = sock->errors[AFD_POLL_BIT_CONNECT_ERR]; + } + else if (sock->state == SOCK_LISTENING) + { + if (error) + sock->errors[AFD_POLL_BIT_ACCEPT] = error; + else + error = sock->errors[AFD_POLL_BIT_ACCEPT]; + } + return error; } static void free_accept_req( void *private ) @@ -1120,9 +1134,9 @@ static void sock_poll_event( struct fd *fd, int event ) case SOCK_CONNECTING: if (event & (POLLERR|POLLHUP)) { + error = sock_error( sock ); sock->state = SOCK_UNCONNECTED; event &= ~POLLOUT; - error = sock_error( fd ); } else if (event & POLLOUT) { @@ -1133,7 +1147,7 @@ static void sock_poll_event( struct fd *fd, int event ) case SOCK_LISTENING: if (event & (POLLERR|POLLHUP)) - error = sock_error( fd ); + error = sock_error( sock ); break; case SOCK_CONNECTED: @@ -3125,7 +3139,7 @@ static void poll_socket( struct sock *poll_sock, struct async *async, int exclus { signaled = TRUE; req->sockets[i].flags = flags; - req->sockets[i].status = sock_get_ntstatus( sock_error( sock->fd ) ); + req->sockets[i].status = sock_get_ntstatus( sock_error( sock ) ); } /* FIXME: do other error conditions deserve a similar treatment? */
1
0
0
0
Piotr Caban : server: Always return Win32 error code from IOCTL_AFD_GET_SO_ERROR.
by Alexandre Julliard
13 Jun '22
13 Jun '22
Module: wine Branch: master Commit: 9d1085c8d39daaa02a0d30ac4a7af2860ff9fe3d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9d1085c8d39daaa02a0d30ac…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Jun 10 17:05:37 2022 +0200 server: Always return Win32 error code from IOCTL_AFD_GET_SO_ERROR. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> --- server/sock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/sock.c b/server/sock.c index 77a88a7fcf7..8a0f3198c4e 100644 --- a/server/sock.c +++ b/server/sock.c @@ -2804,12 +2804,13 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) { if (sock->errors[i]) { - error = sock_get_error( sock->errors[i] ); + error = sock->errors[i]; break; } } } + error = sock_get_error( error ); set_reply_data( &error, sizeof(error) ); return; }
1
0
0
0
Jinoh Kang : riched20: Draw OLE objects with IViewObject implementation.
by Alexandre Julliard
13 Jun '22
13 Jun '22
Module: wine Branch: master Commit: ecc607c6da96a5c2e8988f3021e98b442fe24c12 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ecc607c6da96a5c2e8988f30…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Fri Apr 1 01:25:24 2022 +0900 riched20: Draw OLE objects with IViewObject implementation. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52752
Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com> --- dlls/riched20/richole.c | 29 +++++++++++++++++++++++++++++ dlls/riched20/tests/richole.c | 2 -- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c index 936f1c928b3..3d88b8a65b0 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c @@ -5733,6 +5733,7 @@ void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize) void draw_ole( ME_Context *c, int x, int y, ME_Run *run, BOOL selected ) { IDataObject* ido; + IViewObject* ivo; FORMATETC fmt; STGMEDIUM stgm; DIBSECTION dibsect; @@ -5745,6 +5746,34 @@ void draw_ole( ME_Context *c, int x, int y, ME_Run *run, BOOL selected ) assert(run->nFlags & MERF_GRAPHICS); assert(run->reobj); + + if (SUCCEEDED(IOleObject_QueryInterface(run->reobj->obj.poleobj, &IID_IViewObject, (void**)&ivo))) + { + HRESULT hr; + RECTL bounds; + + convert_sizel(c, &run->reobj->obj.sizel, &sz); + if (c->editor->nZoomNumerator != 0) + { + sz.cx = MulDiv(sz.cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator); + sz.cy = MulDiv(sz.cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator); + } + + bounds.left = x; + bounds.top = y - sz.cy; + bounds.right = x + sz.cx; + bounds.bottom = y; + + hr = IViewObject_Draw(ivo, DVASPECT_CONTENT, -1, 0, 0, 0, c->hDC, &bounds, NULL, NULL, 0); + if (FAILED(hr)) + { + WARN("failed to draw object: %#08lx\n", hr); + } + + IViewObject_Release(ivo); + return; + } + if (IOleObject_QueryInterface(run->reobj->obj.poleobj, &IID_IDataObject, (void**)&ido) != S_OK) { FIXME("Couldn't get interface\n"); diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index db9d123815e..6a361bc3fa4 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c @@ -4193,7 +4193,6 @@ static void subtest_InsertObject(struct reolecb_obj *callback) UpdateWindow(hwnd); testobj->line = __LINE__; flush_dispatch_messages(); - todo_wine ok(testobj->draw_count != 0, "expected draw_count to be nonzero, got %d\n", testobj->draw_count); SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)""); @@ -4225,7 +4224,6 @@ static void subtest_InsertObject(struct reolecb_obj *callback) UpdateWindow(hwnd); testobj->line = __LINE__; flush_dispatch_messages(); - todo_wine ok(testobj->draw_count != 0, "expected draw_count to be nonzero, got %d\n", testobj->draw_count); SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"");
1
0
0
0
Jinoh Kang : riched20: Fetch extent from object if REOBJECT::sizel is unset.
by Alexandre Julliard
13 Jun '22
13 Jun '22
Module: wine Branch: master Commit: 164897e6c94d3eee4798f82a730472a5a847f9b2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=164897e6c94d3eee4798f82a…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Sat Jun 11 19:46:40 2022 +0900 riched20: Fetch extent from object if REOBJECT::sizel is unset. Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com> --- dlls/riched20/caret.c | 13 +++++++++++++ dlls/riched20/tests/richole.c | 2 -- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c index 09ec0ffc735..c9fd327e87e 100644 --- a/dlls/riched20/caret.c +++ b/dlls/riched20/caret.c @@ -464,6 +464,7 @@ HRESULT editor_insert_oleobj(ME_TextEditor *editor, const REOBJECT *reo) ME_Cursor *cursor, cursor_from_ofs; ME_Style *style; HRESULT hr; + SIZEL extent; if (editor->lpOleCallback) { @@ -472,6 +473,17 @@ HRESULT editor_insert_oleobj(ME_TextEditor *editor, const REOBJECT *reo) return hr; } + extent = reo->sizel; + if (!extent.cx && !extent.cy && reo->poleobj) + { + hr = IOleObject_GetExtent( reo->poleobj, DVASPECT_CONTENT, &extent ); + if (FAILED(hr)) + { + extent.cx = 0; + extent.cy = 0; + } + } + if (reo->cp == REO_CP_SELECTION) cursor = editor->pCursors; else @@ -487,6 +499,7 @@ HRESULT editor_insert_oleobj(ME_TextEditor *editor, const REOBJECT *reo) run = run_insert( editor, cursor, style, &space, 1, MERF_GRAPHICS ); run->reobj = create_re_object( reo, run ); + run->reobj->obj.sizel = extent; prev = run; while ((prev = run_prev_all_paras( prev ))) diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c index bb7ee869e0d..db9d123815e 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c @@ -4217,9 +4217,7 @@ static void subtest_InsertObject(struct reolecb_obj *callback) reobj.cbStruct = sizeof(reobj); hr = IRichEditOle_GetObject(reole, 0, &reobj, REO_GETOBJ_NO_INTERFACES); ok(hr == S_OK, "IRichEditOle_GetObject got hr %#lx.\n", hr); - todo_wine ok(reobj.sizel.cx == 800, "expected reobj.sizel.cx to be %ld, got %ld\n", 800L, reobj.sizel.cx); - todo_wine ok(reobj.sizel.cy == 400, "expected reobj.sizel.cy to be %ld, got %ld\n", 400L, reobj.sizel.cy); IOleClientSite_Release(clientsite);
1
0
0
0
Jinoh Kang : riched20/tests: Add tests for drawing embedded OLE objects.
by Alexandre Julliard
13 Jun '22
13 Jun '22
Module: wine Branch: master Commit: a7d29d1625f7e02df4fbf59ef4e4a999d39edde0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a7d29d1625f7e02df4fbf59e…
Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Sat Jun 11 04:47:08 2022 +0900 riched20/tests: Add tests for drawing embedded OLE objects. Signed-off-by: Jinoh Kang <jinoh.kang.kr(a)gmail.com> --- dlls/riched20/tests/richole.c | 474 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 471 insertions(+), 3 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=a7d29d1625f7e02df4fb…
1
0
0
0
Rémi Bernon : winebus.sys: Implement SOCD neutral cleaning for hatswitches.
by Alexandre Julliard
13 Jun '22
13 Jun '22
Module: wine Branch: master Commit: e2936702a47247f806478f16d4631516ca2c3e9f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e2936702a47247f806478f16…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri May 20 21:05:36 2022 +0200 winebus.sys: Implement SOCD neutral cleaning for hatswitches. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52841
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/winebus.sys/bus_sdl.c | 27 +++++++++++++++------------ dlls/winebus.sys/hid.c | 11 +++++++++++ dlls/winebus.sys/unix_private.h | 1 + 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 7dc47cdd518..5d810d25205 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -382,6 +382,8 @@ static NTSTATUS build_controller_report_descriptor(struct unix_device *iface) static const USAGE trigger_axis_usages[] = {HID_USAGE_GENERIC_Z, HID_USAGE_GENERIC_RZ}; struct sdl_device *impl = impl_from_unix_device(iface); ULONG i, button_count = SDL_CONTROLLER_BUTTON_MAX - 1; + BOOL state; + C_ASSERT(SDL_CONTROLLER_AXIS_MAX == 6); if (!hid_device_begin_report_descriptor(iface, &device_usage)) @@ -420,14 +422,15 @@ static NTSTATUS build_controller_report_descriptor(struct unix_device *iface) /* Initialize axis in the report */ for (i = SDL_CONTROLLER_AXIS_LEFTX; i < SDL_CONTROLLER_AXIS_MAX; i++) hid_device_set_abs_axis(iface, i, pSDL_GameControllerGetAxis(impl->sdl_controller, i)); - if (pSDL_GameControllerGetButton(impl->sdl_controller, SDL_CONTROLLER_BUTTON_DPAD_UP)) - hid_device_set_hatswitch_y(iface, 0, -1); - if (pSDL_GameControllerGetButton(impl->sdl_controller, SDL_CONTROLLER_BUTTON_DPAD_DOWN)) - hid_device_set_hatswitch_y(iface, 0, +1); - if (pSDL_GameControllerGetButton(impl->sdl_controller, SDL_CONTROLLER_BUTTON_DPAD_LEFT)) - hid_device_set_hatswitch_x(iface, 0, -1); - if (pSDL_GameControllerGetButton(impl->sdl_controller, SDL_CONTROLLER_BUTTON_DPAD_RIGHT)) - hid_device_set_hatswitch_x(iface, 0, +1); + + state = pSDL_GameControllerGetButton(impl->sdl_controller, SDL_CONTROLLER_BUTTON_DPAD_UP); + hid_device_move_hatswitch(iface, 0, 0, state ? -1 : +1); + state = pSDL_GameControllerGetButton(impl->sdl_controller, SDL_CONTROLLER_BUTTON_DPAD_DOWN); + hid_device_move_hatswitch(iface, 0, 0, state ? +1 : -1); + state = pSDL_GameControllerGetButton(impl->sdl_controller, SDL_CONTROLLER_BUTTON_DPAD_LEFT); + hid_device_move_hatswitch(iface, 0, state ? -1 : +1, 0); + state = pSDL_GameControllerGetButton(impl->sdl_controller, SDL_CONTROLLER_BUTTON_DPAD_RIGHT); + hid_device_move_hatswitch(iface, 0, state ? +1 : -1, 0); return STATUS_SUCCESS; } @@ -873,16 +876,16 @@ static BOOL set_report_from_controller_event(struct sdl_device *impl, SDL_Event switch ((button = ie->button)) { case SDL_CONTROLLER_BUTTON_DPAD_UP: - hid_device_set_hatswitch_y(iface, 0, ie->state ? -1 : 0); + hid_device_move_hatswitch(iface, 0, 0, ie->state ? -1 : +1); break; case SDL_CONTROLLER_BUTTON_DPAD_DOWN: - hid_device_set_hatswitch_y(iface, 0, ie->state ? +1 : 0); + hid_device_move_hatswitch(iface, 0, 0, ie->state ? +1 : -1); break; case SDL_CONTROLLER_BUTTON_DPAD_LEFT: - hid_device_set_hatswitch_x(iface, 0, ie->state ? -1 : 0); + hid_device_move_hatswitch(iface, 0, ie->state ? -1 : +1, 0); break; case SDL_CONTROLLER_BUTTON_DPAD_RIGHT: - hid_device_set_hatswitch_x(iface, 0, ie->state ? +1 : 0); + hid_device_move_hatswitch(iface, 0, ie->state ? +1 : -1, 0); break; case SDL_CONTROLLER_BUTTON_LEFTSHOULDER: button = 4; break; case SDL_CONTROLLER_BUTTON_RIGHTSHOULDER: button = 5; break; diff --git a/dlls/winebus.sys/hid.c b/dlls/winebus.sys/hid.c index 8ed8c752893..c5543e081ae 100644 --- a/dlls/winebus.sys/hid.c +++ b/dlls/winebus.sys/hid.c @@ -1453,6 +1453,17 @@ BOOL hid_device_set_hatswitch_y(struct unix_device *iface, ULONG index, LONG new return TRUE; } +BOOL hid_device_move_hatswitch(struct unix_device *iface, ULONG index, LONG x, LONG y) +{ + struct hid_device_state *state = &iface->hid_device_state; + ULONG offset = state->hatswitch_start + index; + LONG old_x, old_y; + if (index > state->hatswitch_count) return FALSE; + hatswitch_decompose(state->report_buf[offset], &old_x, &old_y); + hatswitch_compose(old_x + x, old_y + y, &state->report_buf[offset]); + return TRUE; +} + BOOL hid_device_sync_report(struct unix_device *iface) { BOOL dropped; diff --git a/dlls/winebus.sys/unix_private.h b/dlls/winebus.sys/unix_private.h index f94a243d887..85eab6ccf5d 100644 --- a/dlls/winebus.sys/unix_private.h +++ b/dlls/winebus.sys/unix_private.h @@ -257,6 +257,7 @@ extern BOOL hid_device_set_rel_axis(struct unix_device *iface, ULONG index, LONG extern BOOL hid_device_set_button(struct unix_device *iface, ULONG index, BOOL is_set) DECLSPEC_HIDDEN; extern BOOL hid_device_set_hatswitch_x(struct unix_device *iface, ULONG index, LONG new_x) DECLSPEC_HIDDEN; extern BOOL hid_device_set_hatswitch_y(struct unix_device *iface, ULONG index, LONG new_y) DECLSPEC_HIDDEN; +extern BOOL hid_device_move_hatswitch(struct unix_device *iface, ULONG index, LONG x, LONG y) DECLSPEC_HIDDEN; extern BOOL hid_device_sync_report(struct unix_device *iface) DECLSPEC_HIDDEN; extern void hid_device_drop_report(struct unix_device *iface) DECLSPEC_HIDDEN;
1
0
0
0
Rémi Bernon : ntdll: Remove heap pointer from SUBHEAP structure.
by Alexandre Julliard
13 Jun '22
13 Jun '22
Module: wine Branch: master Commit: 4ca954ad0b2b098372e952f4208aff99a934841c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4ca954ad0b2b098372e952f4…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 13 17:47:48 2022 +0200 ntdll: Remove heap pointer from SUBHEAP structure. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/ntdll/heap.c | 69 +++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 38 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=4ca954ad0b2b098372e9…
1
0
0
0
Rémi Bernon : ntdll: Use block_size and data_size in subheap structure.
by Alexandre Julliard
13 Jun '22
13 Jun '22
Module: wine Branch: master Commit: a6fcf059a7ce5cde7b81fdae9873d856cbfe72b0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a6fcf059a7ce5cde7b81fdae…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 13 16:52:46 2022 +0200 ntdll: Use block_size and data_size in subheap structure. Respectively describing allocated size vs commit size, relative to the first subheap block, instead of size / commitSize. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/ntdll/heap.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 7e64eea4602..acaf3e53bc5 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -162,10 +162,10 @@ static const SIZE_T free_list_sizes[] = typedef struct DECLSPEC_ALIGN(ALIGNMENT) tagSUBHEAP { SIZE_T __pad[sizeof(SIZE_T) / sizeof(DWORD)]; - SIZE_T size; /* Size of the whole sub-heap */ - SIZE_T commitSize; /* Committed size of the sub-heap */ - struct list entry; /* Entry in sub-heap list */ - struct heap *heap; /* Main heap structure */ + SIZE_T block_size; + SIZE_T data_size; + struct list entry; + struct heap *heap; struct block block; } SUBHEAP; @@ -269,19 +269,25 @@ static inline void *subheap_base( const SUBHEAP *subheap ) return ROUND_ADDR( subheap, COMMIT_MASK ); } -static inline SIZE_T subheap_size( const SUBHEAP *subheap ) +static inline SIZE_T subheap_overhead( const SUBHEAP *subheap ) { - return subheap->size; + return (char *)&subheap->block - (char *)subheap_base( subheap ); } -static inline SIZE_T subheap_overhead( const SUBHEAP *subheap ) +static inline SIZE_T subheap_size( const SUBHEAP *subheap ) { - return (char *)&subheap->block - (char *)subheap_base( subheap ); + return subheap->block_size + subheap_overhead( subheap ); } static inline const void *subheap_commit_end( const SUBHEAP *subheap ) { - return (char *)subheap_base( subheap ) + subheap->commitSize; + return (char *)(subheap + 1) + subheap->data_size; +} + +static void subheap_set_bounds( SUBHEAP *subheap, char *commit_end, char *end ) +{ + subheap->block_size = end - (char *)&subheap->block; + subheap->data_size = commit_end - (char *)(subheap + 1); } static inline void *first_block( const SUBHEAP *subheap ) @@ -304,8 +310,7 @@ static inline struct block *next_block( const SUBHEAP *subheap, const struct blo static inline BOOL check_subheap( const SUBHEAP *subheap ) { - const char *base = ROUND_ADDR( subheap, COMMIT_MASK ); - return contains( base, subheap->size, &subheap->block, base + subheap->commitSize - (char *)&subheap->block ); + return contains( &subheap->block, subheap->block_size, subheap + 1, subheap->data_size ); } static BOOL heap_validate( const struct heap *heap ); @@ -642,7 +647,7 @@ static inline BOOL subheap_commit( SUBHEAP *subheap, const struct block *block, return FALSE; } - subheap->commitSize = (char *)commit_end - (char *)subheap_base( subheap ); + subheap->data_size = (char *)commit_end - (char *)(subheap + 1); return TRUE; } @@ -666,7 +671,7 @@ static inline BOOL subheap_decommit( SUBHEAP *subheap, const void *commit_end ) return FALSE; } - subheap->commitSize = (char *)commit_end - (char *)subheap_base( subheap ); + subheap->data_size = (char *)commit_end - (char *)(subheap + 1); return TRUE; } @@ -928,8 +933,7 @@ static SUBHEAP *HEAP_CreateSubHeap( struct heap *heap, LPVOID address, DWORD fla subheap = address; subheap->heap = heap; - subheap->size = totalSize; - subheap->commitSize = commitSize; + subheap_set_bounds( subheap, (char *)address + commitSize, (char *)address + totalSize ); list_add_head( &heap->subheap_list, &subheap->entry ); } else @@ -949,8 +953,7 @@ static SUBHEAP *HEAP_CreateSubHeap( struct heap *heap, LPVOID address, DWORD fla subheap = &heap->subheap; subheap->heap = heap; - subheap->size = totalSize; - subheap->commitSize = commitSize; + subheap_set_bounds( subheap, (char *)address + commitSize, (char *)address + totalSize ); list_add_head( &heap->subheap_list, &subheap->entry ); /* Build the free lists */
1
0
0
0
Rémi Bernon : ntdll: Rename HEAP_GetPtr to unsafe_heap_from_handle.
by Alexandre Julliard
13 Jun '22
13 Jun '22
Module: wine Branch: master Commit: 2ef69e449287c2b4e50a22e3bb45398efc596f25 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2ef69e449287c2b4e50a22e3…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 13 17:36:56 2022 +0200 ntdll: Rename HEAP_GetPtr to unsafe_heap_from_handle. And related heap variables to handle and heapPtr to heap. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/ntdll/heap.c | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index d68d8577532..7e64eea4602 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -574,13 +574,7 @@ static const char *debugstr_heap_entry( struct rtl_heap_entry *entry ) entry->Region.dwUnCommittedSize, entry->Region.lpFirstBlock, entry->Region.lpLastBlock ); } -/*********************************************************************** - * HEAP_GetPtr - * RETURNS - * Pointer to the heap - * NULL: Failure - */ -static struct heap *HEAP_GetPtr( HANDLE handle ) +static struct heap *unsafe_heap_from_handle( HANDLE handle ) { struct heap *heap = handle; BOOL valid = TRUE; @@ -1298,7 +1292,7 @@ static DWORD heap_flags_from_global_flag( DWORD flag ) */ static void heap_set_debug_flags( HANDLE handle ) { - struct heap *heap = HEAP_GetPtr( handle ); + struct heap *heap = unsafe_heap_from_handle( handle ); ULONG global_flags = RtlGetNtGlobalFlags(); DWORD flags, force_flags; @@ -1421,16 +1415,17 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c */ HANDLE WINAPI RtlDestroyHeap( HANDLE handle ) { - struct heap *heap = HEAP_GetPtr( handle ); SUBHEAP *subheap, *next; ARENA_LARGE *arena, *arena_next; struct block **pending, **tmp; + struct heap *heap; SIZE_T size; void *addr; TRACE( "handle %p\n", handle ); - if (!heap && handle && (((struct heap *)handle)->flags & HEAP_VALIDATE_PARAMS) && + if (!(heap = unsafe_heap_from_handle( handle )) && handle && + (((struct heap *)handle)->flags & HEAP_VALIDATE_PARAMS) && NtCurrentTeb()->Peb->BeingDebugged) { DbgPrint( "Attempt to destroy an invalid heap\n" ); @@ -1447,7 +1442,7 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE handle ) RtlFreeHeap( handle, 0, pending ); } - if (heap == process_heap) return heap; /* cannot delete the main process heap */ + if (heap == process_heap) return handle; /* cannot delete the main process heap */ /* remove it from the per-process list */ RtlEnterCriticalSection( &process_heap->cs ); @@ -1536,7 +1531,7 @@ void *WINAPI DECLSPEC_HOTPATCH RtlAllocateHeap( HANDLE handle, ULONG flags, SIZE void *ptr = NULL; NTSTATUS status; - if (!(heap = HEAP_GetPtr( handle ))) + if (!(heap = unsafe_heap_from_handle( handle ))) status = STATUS_INVALID_HANDLE; else { @@ -1577,7 +1572,7 @@ BOOLEAN WINAPI DECLSPEC_HOTPATCH RtlFreeHeap( HANDLE handle, ULONG flags, void * valgrind_notify_free( ptr ); - if (!(heap = HEAP_GetPtr( handle ))) + if (!(heap = unsafe_heap_from_handle( handle ))) status = STATUS_INVALID_PARAMETER; else { @@ -1661,7 +1656,7 @@ void *WINAPI RtlReAllocateHeap( HANDLE handle, ULONG flags, void *ptr, SIZE_T si if (!ptr) return NULL; - if (!(heap = HEAP_GetPtr( handle ))) + if (!(heap = unsafe_heap_from_handle( handle ))) status = STATUS_INVALID_HANDLE; else { @@ -1713,7 +1708,7 @@ ULONG WINAPI RtlCompactHeap( HANDLE handle, ULONG flags ) */ BOOLEAN WINAPI RtlLockHeap( HANDLE handle ) { - struct heap *heap = HEAP_GetPtr( handle ); + struct heap *heap = unsafe_heap_from_handle( handle ); if (!heap) return FALSE; heap_lock( heap, 0 ); return TRUE; @@ -1734,7 +1729,7 @@ BOOLEAN WINAPI RtlLockHeap( HANDLE handle ) */ BOOLEAN WINAPI RtlUnlockHeap( HANDLE handle ) { - struct heap *heap = HEAP_GetPtr( handle ); + struct heap *heap = unsafe_heap_from_handle( handle ); if (!heap) return FALSE; heap_unlock( heap, 0 ); return TRUE; @@ -1766,7 +1761,7 @@ SIZE_T WINAPI RtlSizeHeap( HANDLE handle, ULONG flags, const void *ptr ) struct heap *heap; NTSTATUS status; - if (!(heap = HEAP_GetPtr( handle ))) + if (!(heap = unsafe_heap_from_handle( handle ))) status = STATUS_INVALID_PARAMETER; else { @@ -1790,7 +1785,7 @@ BOOLEAN WINAPI RtlValidateHeap( HANDLE handle, ULONG flags, const void *ptr ) SUBHEAP *subheap; BOOLEAN ret; - if (!(heap = HEAP_GetPtr( handle ))) + if (!(heap = unsafe_heap_from_handle( handle ))) ret = FALSE; else { @@ -1914,7 +1909,7 @@ NTSTATUS WINAPI RtlWalkHeap( HANDLE handle, void *entry_ptr ) if (!entry) return STATUS_INVALID_PARAMETER; - if (!(heap = HEAP_GetPtr( handle ))) + if (!(heap = unsafe_heap_from_handle( handle ))) status = STATUS_INVALID_HANDLE; else { @@ -2008,7 +2003,7 @@ BOOLEAN WINAPI RtlGetUserInfoHeap( HANDLE handle, ULONG flags, void *ptr, void * *user_value = 0; *user_flags = 0; - if (!(heap = HEAP_GetPtr( handle ))) return TRUE; + if (!(heap = unsafe_heap_from_handle( handle ))) return TRUE; heap_lock( heap, flags ); if ((block = unsafe_block_from_ptr( heap, ptr, &subheap )) && !subheap) @@ -2038,7 +2033,7 @@ BOOLEAN WINAPI RtlSetUserValueHeap( HANDLE handle, ULONG flags, void *ptr, void TRACE( "handle %p, flags %#x, ptr %p, user_value %p.\n", handle, flags, ptr, user_value ); - if (!(heap = HEAP_GetPtr( handle ))) return TRUE; + if (!(heap = unsafe_heap_from_handle( handle ))) return TRUE; heap_lock( heap, flags ); if (!(block = unsafe_block_from_ptr( heap, ptr, &subheap ))) ret = FALSE;
1
0
0
0
Rémi Bernon : ntdll: Consistently name heap handles and pointers.
by Alexandre Julliard
13 Jun '22
13 Jun '22
Module: wine Branch: master Commit: fef774f9530aafc18f1c8c64cadf5ca0f60bc00f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fef774f9530aafc18f1c8c64…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 13 17:16:07 2022 +0200 ntdll: Consistently name heap handles and pointers. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/ntdll/heap.c | 213 +++++++++++++++++++++++++++--------------------------- 1 file changed, 107 insertions(+), 106 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=fef774f9530aafc18f1c…
1
0
0
0
← Newer
1
...
42
43
44
45
46
47
48
...
80
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
Results per page:
10
25
50
100
200