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
May
April
March
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
October 2022
----- 2025 -----
May 2025
April 2025
March 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
1 participants
537 discussions
Start a n
N
ew thread
Alexandre Julliard : Wine release 7.20
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: website Branch: master Commit: 5a0e56fb65d0f77cff62e8b7c7efe69780a08df4 URL:
https://gitlab.winehq.org/winehq/winehq/-/commit/5a0e56fb65d0f77cff62e8b7c7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 31 22:50:21 2022 +0100 Wine release 7.20 Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- news/en/2022103101.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/news/en/2022103101.xml b/news/en/2022103101.xml new file mode 100644 index 00000000..bab9aa9f --- /dev/null +++ b/news/en/2022103101.xml @@ -0,0 +1,17 @@ +<news> +<date>October 31, 2022</date> +<title>Wine 7.20 Released</title> +<body> +<p> The Wine development release 7.20 is now available.</p> +<p> <a href="{$root}/announce/7.20">What's new</a> in this release: +<ul> + <li>Mono engine updated to version 7.4.0.</li> + <li>Font linking improvements.</li> + <li>A number of fixes for exception unwinding.</li> + <li>Support for dumping EMF spool files in WineDump.</li> + <li>Various bug fixes.</li> +</ul> +</p> +<p>The source is <a href="//dl.winehq.org/wine/source/7.x/wine-7.20.tar.xz">available now</a>. +Binary packages are in the process of being built, and will appear soon at their respective <a href="{$root}/download">download locations</a>. +</p></body></news>
1
0
0
0
Tag wine-7.20 : Alexandre Julliard : Release 7.20
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: refs/tags/wine-7.20 Tag: 9c818ff48c1ff5f9fa3dbc8a75b2dc7a8961de84 URL:
https://gitlab.winehq.org/wine/wine/-/tags/9c818ff48c1ff5f9fa3dbc8a75b2dc7a…
Tagger: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 31 22:47:59 2022 +0100 Release 7.20
1
0
0
0
Alexandre Julliard : Release 7.20.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: e43cb422502d5883a0fcde3dadcb8e6ef25632de URL:
https://gitlab.winehq.org/wine/wine/-/commit/e43cb422502d5883a0fcde3dadcb8e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 31 22:47:59 2022 +0100 Release 7.20. --- ANNOUNCE | 770 +++++++++++++++++++++++++++++++++----------------------------- AUTHORS | 3 + VERSION | 2 +- configure | 18 +- 4 files changed, 421 insertions(+), 372 deletions(-)
1
0
0
0
Nikolay Sivov : mf/samplegrabber: Send MEStreamSinkScrubSampleComplete event.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 9706a70bdaf16203e250f9cc2254e6fb0c830848 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9706a70bdaf16203e250f9cc2254e6…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Oct 31 21:48:06 2022 +0300 mf/samplegrabber: Send MEStreamSinkScrubSampleComplete event. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/mf/samplegrabber.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c index 84b8d71d6be..e41e74d35ac 100644 --- a/dlls/mf/samplegrabber.c +++ b/dlls/mf/samplegrabber.c @@ -83,6 +83,7 @@ struct sample_grabber IUnknown *cancel_key; UINT32 ignore_clock; UINT64 sample_time_offset; + float rate; enum sink_state state; CRITICAL_SECTION cs; }; @@ -1138,7 +1139,13 @@ static HRESULT sample_grabber_set_state(struct sample_grabber *grabber, enum sin } do_callback = state != grabber->state || state != SINK_STATE_PAUSED; if (do_callback) + { + if (grabber->rate == 0.0f && state == SINK_STATE_RUNNING) + IMFStreamSink_QueueEvent(&grabber->IMFStreamSink_iface, MEStreamSinkScrubSampleComplete, + &GUID_NULL, S_OK, NULL); + IMFStreamSink_QueueEvent(&grabber->IMFStreamSink_iface, events[state], &GUID_NULL, S_OK, NULL); + } grabber->state = state; } } @@ -1212,7 +1219,10 @@ static HRESULT WINAPI sample_grabber_clock_sink_OnClockSetRate(IMFClockStateSink if (grabber->is_shut_down) hr = MF_E_SHUTDOWN; else + { IMFStreamSink_QueueEvent(&grabber->IMFStreamSink_iface, MEStreamSinkRateChanged, &GUID_NULL, S_OK, NULL); + grabber->rate = rate; + } LeaveCriticalSection(&grabber->cs); @@ -1433,6 +1443,7 @@ static HRESULT sample_grabber_create_object(IMFAttributes *attributes, void *use object->IMFMediaTypeHandler_iface.lpVtbl = &sample_grabber_stream_type_handler_vtbl; object->timer_callback.lpVtbl = &sample_grabber_stream_timer_callback_vtbl; object->refcount = 1; + object->rate = 1.0f; if (FAILED(IMFSampleGrabberSinkCallback_QueryInterface(context->callback, &IID_IMFSampleGrabberSinkCallback2, (void **)&object->callback2))) {
1
0
0
0
Nikolay Sivov : mf/samplegrabber: Send MEStreamSinkRateChanged event.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: ec7d032b16505e8d66a690675bf53560c91dcd4a URL:
https://gitlab.winehq.org/wine/wine/-/commit/ec7d032b16505e8d66a690675bf535…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Oct 31 21:20:40 2022 +0300 mf/samplegrabber: Send MEStreamSinkRateChanged event. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/mf/samplegrabber.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c index 2d9f8109aca..84b8d71d6be 100644 --- a/dlls/mf/samplegrabber.c +++ b/dlls/mf/samplegrabber.c @@ -1203,10 +1203,23 @@ static HRESULT WINAPI sample_grabber_clock_sink_OnClockRestart(IMFClockStateSink static HRESULT WINAPI sample_grabber_clock_sink_OnClockSetRate(IMFClockStateSink *iface, MFTIME systime, float rate) { struct sample_grabber *grabber = impl_from_IMFClockStateSink(iface); + HRESULT hr = S_OK; TRACE("%p, %s, %f.\n", iface, debugstr_time(systime), rate); - return IMFSampleGrabberSinkCallback_OnClockSetRate(sample_grabber_get_callback(grabber), systime, rate); + EnterCriticalSection(&grabber->cs); + + if (grabber->is_shut_down) + hr = MF_E_SHUTDOWN; + else + IMFStreamSink_QueueEvent(&grabber->IMFStreamSink_iface, MEStreamSinkRateChanged, &GUID_NULL, S_OK, NULL); + + LeaveCriticalSection(&grabber->cs); + + if (SUCCEEDED(hr)) + hr = IMFSampleGrabberSinkCallback_OnClockSetRate(sample_grabber_get_callback(grabber), systime, rate); + + return hr; } static HRESULT WINAPI sample_grabber_events_QueryInterface(IMFMediaEventGenerator *iface, REFIID riid, void **obj)
1
0
0
0
Piotr Caban : winemac.drv: Fix registry path size in create_original_display_mode_descriptor.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 223ac6704435a09423030f4865b1a92a87e6ea49 URL:
https://gitlab.winehq.org/wine/wine/-/commit/223ac6704435a09423030f4865b1a9…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Oct 31 19:47:16 2022 +0100 winemac.drv: Fix registry path size in create_original_display_mode_descriptor. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53081
--- dlls/winemac.drv/display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index e8d26dfd241..e5dbadde332 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -308,7 +308,7 @@ static struct display_mode_descriptor* create_original_display_mode_descriptor(C snprintf(display_key, sizeof(display_key), display_key_format, CGDisplayUnitNumber(displayID)); /* @@ Wine registry key: HKLM\Software\Wine\Mac Driver\Initial Display Mode\Display 0xnnnnnnnn */ - if (!(hkey = reg_open_key(NULL, nameW, asciiz_to_unicode(nameW, display_key)))) + if (!(hkey = reg_open_key(NULL, nameW, asciiz_to_unicode(nameW, display_key) - sizeof(WCHAR)))) return NULL; desc = malloc(sizeof(*desc));
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement document.referrer.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: a3d08482ad01538dced169951842bb7b0b842559 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a3d08482ad01538dced169951842bb…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Mon Oct 31 18:27:37 2022 +0200 mshtml: Implement document.referrer. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmldoc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index e7722f9c602..dd7d9f44d48 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1040,11 +1040,14 @@ static HRESULT WINAPI HTMLDocument_get_vlinkColor(IHTMLDocument2 *iface, VARIANT static HRESULT WINAPI HTMLDocument_get_referrer(IHTMLDocument2 *iface, BSTR *p) { HTMLDocumentNode *This = impl_from_IHTMLDocument2(iface); + nsAString nsstr; + nsresult nsres; - FIXME("(%p)->(%p)\n", This, p); + TRACE("(%p)->(%p)\n", This, p); - *p = NULL; - return S_OK; + nsAString_InitDepend(&nsstr, NULL); + nsres = nsIDOMHTMLDocument_GetReferrer(This->nsdoc, &nsstr); + return return_nsstr(nsres, &nsstr, p); } static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLocation **p)
1
0
0
0
Gabriel Ivăncescu : mshtml: Implement document.mimeType.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: c25dfb79651acc0f2f72a5d5fc3d23da86421aff URL:
https://gitlab.winehq.org/wine/wine/-/commit/c25dfb79651acc0f2f72a5d5fc3d23…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Mon Oct 31 18:27:37 2022 +0200 mshtml: Implement document.mimeType. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmldoc.c | 23 ++++++++- dlls/mshtml/main.c | 103 ++++++++++++++++++++++++++++++++++++++ dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/tests/Makefile.in | 2 +- dlls/mshtml/tests/documentmode.js | 1 + dlls/mshtml/tests/htmldoc.c | 100 ++++++++++++++++++++++++++++++++++++ dlls/mshtml/tests/script.c | 98 ++++++++++++++++++++++++++++++++++++ 7 files changed, 325 insertions(+), 3 deletions(-)
1
0
0
0
Gabriel Ivăncescu : mshtml: Get rid of a EVENTID_LAST special case.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 8dd8664a51b131245bab7d3fa22b5842c2078dce URL:
https://gitlab.winehq.org/wine/wine/-/commit/8dd8664a51b131245bab7d3fa22b58…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Mon Oct 31 18:27:37 2022 +0200 mshtml: Get rid of a EVENTID_LAST special case. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmlevent.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 7deb51ad1e9..59a8d50d40e 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -3674,8 +3674,6 @@ HRESULT ensure_doc_nsevent_handler(HTMLDocumentNode *doc, nsIDOMNode *nsnode, ev doc->event_vector[eid] = TRUE; eid = EVENTID_BLUR; break; - case EVENTID_LAST: - return S_OK; default: break; }
1
0
0
0
Gabriel Ivăncescu : mshtml: Allow null or undefined func in addEventListener.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: de2192bbece698184fb5111392f9ec2603825b37 URL:
https://gitlab.winehq.org/wine/wine/-/commit/de2192bbece698184fb5111392f9ec…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Mon Oct 31 18:27:37 2022 +0200 mshtml: Allow null or undefined func in addEventListener. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmlevent.c | 3 +++ dlls/mshtml/tests/events.c | 2 ++ dlls/mshtml/tests/events.js | 15 +++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index ebedff82564..7deb51ad1e9 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -4105,6 +4105,9 @@ static HRESULT WINAPI EventTarget_addEventListener(IEventTarget *iface, BSTR typ TRACE("(%p)->(%s %p %x)\n", This, debugstr_w(type), function, capture); + if(!function) + return S_OK; + container = get_listener_container(This, type, TRUE); if(!container) return E_OUTOFMEMORY; diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c index 1819bc6bdd9..b53851d61bf 100644 --- a/dlls/mshtml/tests/events.c +++ b/dlls/mshtml/tests/events.c @@ -1898,6 +1898,7 @@ static void test_onclick(IHTMLDocument2 *doc) VariantClear(&v); if(document_mode >= 9) { + add_event_listener((IUnknown*)div, L"click", NULL, VARIANT_FALSE); add_event_listener((IUnknown*)div, L"click", (IDispatch*)&div_onclick_capture_obj, VARIANT_TRUE); add_event_listener((IUnknown*)div, L"click", (IDispatch*)&div_onclick_bubble_obj, VARIANT_FALSE); } @@ -2052,6 +2053,7 @@ static void test_onclick(IHTMLDocument2 *doc) doc_detach_event(doc, L"onclick", (IDispatch*)&doc_onclick_attached_obj); if(document_mode >= 9) { + remove_event_listener((IUnknown*)div, L"click", NULL, VARIANT_FALSE); remove_event_listener((IUnknown*)div, L"click", (IDispatch*)&div_onclick_capture_obj, VARIANT_TRUE); remove_event_listener((IUnknown*)div, L"click", (IDispatch*)&div_onclick_bubble_obj, VARIANT_FALSE); } diff --git a/dlls/mshtml/tests/events.js b/dlls/mshtml/tests/events.js index 997e583ad20..156330e984b 100644 --- a/dlls/mshtml/tests/events.js +++ b/dlls/mshtml/tests/events.js @@ -198,6 +198,21 @@ sync_test("add_remove_listener", function() { calls = ""; div.click(); ok(calls === "", "calls = " + calls); + + /* test undefined function argument */ + div.addEventListener("click", undefined, false); + + calls = ""; + div.click(); + ok(calls === "", "calls = " + calls); + + div.addEventListener("click", listener, false); + div.removeEventListener("click", undefined); + + calls = ""; + div.click(); + ok(calls === "listener,", "calls = " + calls); + div.removeEventListener("click", listener); }); sync_test("event_phase", function() {
1
0
0
0
Gabriel Ivăncescu : mshtml: Allow null or undefined listeners in attachEvent/detachEvent.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: a3dbd5067b4cad48e63b68d17d1598284e05d376 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a3dbd5067b4cad48e63b68d17d1598…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Mon Oct 31 18:27:37 2022 +0200 mshtml: Allow null or undefined listeners in attachEvent/detachEvent. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/dispex.c | 11 ++++++- dlls/mshtml/htmlevent.c | 5 +++ dlls/mshtml/tests/script.c | 77 +++++++++++++++++++++++++++++++++++++++------- 3 files changed, 81 insertions(+), 12 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index ebb1a675d91..d8aaf819f58 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -1072,7 +1072,8 @@ HRESULT change_type(VARIANT *dst, VARIANT *src, VARTYPE vt, IServiceProvider *ca if(SUCCEEDED(hres)) { hres = IVariantChangeType_ChangeType(change_type, dst, src, LOCALE_NEUTRAL, vt); IVariantChangeType_Release(change_type); - return hres; + if(SUCCEEDED(hres)) + return S_OK; } } @@ -1084,6 +1085,14 @@ HRESULT change_type(VARIANT *dst, VARIANT *src, VARTYPE vt, IServiceProvider *ca return S_OK; } break; + case VT_UNKNOWN: + case VT_DISPATCH: + if(V_VT(src) == VT_EMPTY || V_VT(src) == VT_NULL) { + V_VT(dst) = vt; + V_DISPATCH(dst) = NULL; + return S_OK; + } + break; } return VariantChangeType(dst, src, 0, vt); diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 581d949a447..ebedff82564 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -3870,6 +3870,11 @@ HRESULT attach_event(EventTarget *event_target, BSTR name, IDispatch *disp, VARI event_listener_t *listener; eventid_t eid; + if(!disp) { + *res = VARIANT_FALSE; + return S_OK; + } + eid = attr_to_eid(name); if(eid == EVENTID_LAST) { WARN("Unknown event\n"); diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c index 14e3a148239..6762cd985d0 100644 --- a/dlls/mshtml/tests/script.c +++ b/dlls/mshtml/tests/script.c @@ -135,7 +135,8 @@ DEFINE_EXPECT(external_success); DEFINE_EXPECT(QS_VariantConversion); DEFINE_EXPECT(QS_IActiveScriptSite); DEFINE_EXPECT(QS_GetCaller); -DEFINE_EXPECT(ChangeType); +DEFINE_EXPECT(ChangeType_bstr); +DEFINE_EXPECT(ChangeType_dispatch); DEFINE_EXPECT(GetTypeInfo); #define TESTSCRIPT_CLSID "{178fc163-f585-4e24-9c13-4bb7faf80746}" @@ -364,18 +365,29 @@ static ULONG WINAPI VariantChangeType_Release(IVariantChangeType *iface) static HRESULT WINAPI VariantChangeType_ChangeType(IVariantChangeType *iface, VARIANT *dst, VARIANT *src, LCID lcid, VARTYPE vt) { - CHECK_EXPECT(ChangeType); - ok(dst != NULL, "dst = NULL\n"); ok(V_VT(dst) == VT_EMPTY, "V_VT(dst) = %d\n", V_VT(dst)); ok(src != NULL, "src = NULL\n"); - ok(V_VT(src) == VT_I4, "V_VT(src) = %d\n", V_VT(src)); - ok(V_I4(src) == 0xf0f0f0, "V_I4(src) = %lx\n", V_I4(src)); ok(lcid == LOCALE_NEUTRAL, "lcid = %ld\n", lcid); - ok(vt == VT_BSTR, "vt = %d\n", vt); - V_VT(dst) = VT_BSTR; - V_BSTR(dst) = SysAllocString(L"red"); + switch(vt) { + case VT_BSTR: + CHECK_EXPECT(ChangeType_bstr); + ok(V_VT(src) == VT_I4, "V_VT(src) = %d\n", V_VT(src)); + ok(V_I4(src) == 0xf0f0f0, "V_I4(src) = %lx\n", V_I4(src)); + V_VT(dst) = VT_BSTR; + V_BSTR(dst) = SysAllocString(L"red"); + break; + case VT_DISPATCH: + CHECK_EXPECT(ChangeType_dispatch); + ok(V_VT(src) == VT_NULL, "V_VT(src) = %d\n", V_VT(src)); + /* native jscript returns E_NOTIMPL, use a "valid" error to test that it doesn't matter */ + return E_OUTOFMEMORY; + default: + ok(0, "unexpected vt %d\n", vt); + return E_NOTIMPL; + } + return S_OK; } @@ -2292,10 +2304,13 @@ static void test_global_id(void) static void test_arg_conv(IHTMLWindow2 *window) { + DISPPARAMS dp = { 0 }; IHTMLDocument2 *doc; IDispatchEx *dispex; IHTMLElement *elem; - VARIANT v; + VARIANT v, args[2]; + DISPID id; + BSTR bstr; HRESULT hres; hres = IHTMLWindow2_get_document(window, &doc); @@ -2310,20 +2325,60 @@ static void test_arg_conv(IHTMLWindow2 *window) ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); SET_EXPECT(QS_VariantConversion); - SET_EXPECT(ChangeType); + SET_EXPECT(ChangeType_bstr); V_VT(&v) = VT_I4; V_I4(&v) = 0xf0f0f0; hres = dispex_propput(dispex, DISPID_IHTMLBODYELEMENT_BACKGROUND, 0, &v, &caller_sp); ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); CHECK_CALLED(QS_VariantConversion); - CHECK_CALLED(ChangeType); + CHECK_CALLED(ChangeType_bstr); V_VT(&v) = VT_EMPTY; hres = dispex_propget(dispex, DISPID_IHTMLBODYELEMENT_BGCOLOR, &v, &caller_sp); ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&v) == VT_BSTR, "V_VT(var)=%d\n", V_VT(&v)); ok(!V_BSTR(&v), "V_BSTR(&var) = %s\n", wine_dbgstr_w(V_BSTR(&v))); + IDispatchEx_Release(dispex); + + hres = IHTMLWindow2_QueryInterface(window, &IID_IDispatchEx, (void**)&dispex); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); + + SET_EXPECT(GetScriptDispatch); + bstr = SysAllocString(L"attachEvent"); + hres = IDispatchEx_GetDispID(dispex, bstr, fdexNameCaseSensitive, &id); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres); + CHECK_CALLED(GetScriptDispatch); + SysFreeString(bstr); + + SET_EXPECT(QS_VariantConversion); + SET_EXPECT(ChangeType_dispatch); + dp.cArgs = 2; + dp.rgvarg = args; + V_VT(&args[1]) = VT_BSTR; + V_BSTR(&args[1]) = SysAllocString(L"onload"); + V_VT(&args[0]) = VT_NULL; + hres = IDispatchEx_InvokeEx(dispex, id, LOCALE_NEUTRAL, DISPATCH_METHOD, &dp, &v, NULL, &caller_sp); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); + ok(V_VT(&v) == VT_BOOL, "V_VT(var) = %d\n", V_VT(&v)); + ok(V_BOOL(&v) == VARIANT_FALSE, "V_BOOL(var) = %d\n", V_BOOL(&v)); + CHECK_CALLED(QS_VariantConversion); + CHECK_CALLED(ChangeType_dispatch); + + SET_EXPECT(GetScriptDispatch); + bstr = SysAllocString(L"detachEvent"); + hres = IDispatchEx_GetDispID(dispex, bstr, fdexNameCaseSensitive, &id); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres); + CHECK_CALLED(GetScriptDispatch); + SysFreeString(bstr); + + SET_EXPECT(QS_VariantConversion); + SET_EXPECT(ChangeType_dispatch); + hres = IDispatchEx_InvokeEx(dispex, id, LOCALE_NEUTRAL, DISPATCH_METHOD, &dp, NULL, NULL, &caller_sp); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); + CHECK_CALLED(QS_VariantConversion); + CHECK_CALLED(ChangeType_dispatch); + SysFreeString(V_BSTR(&args[1])); IDispatchEx_Release(dispex); }
1
0
0
0
Gabriel Ivăncescu : jscript: Implement VariantChangeType for VT_DISPATCH and VT_UNKNOWN.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: d984fb14a52881697f997fd8e5462388427be861 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d984fb14a52881697f997fd8e54623…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Mon Oct 31 18:27:36 2022 +0200 jscript: Implement VariantChangeType for VT_DISPATCH and VT_UNKNOWN. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/jscript/jsutils.c | 10 ++++++++++ dlls/jscript/tests/caller.c | 24 +++++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c index 96e42625dc6..166fdc696b9 100644 --- a/dlls/jscript/jsutils.c +++ b/dlls/jscript/jsutils.c @@ -955,6 +955,16 @@ HRESULT variant_change_type(script_ctx_t *ctx, VARIANT *dst, VARIANT *src, VARTY case VT_NULL: hres = V_VT(src) == VT_NULL ? S_OK : E_NOTIMPL; break; + case VT_UNKNOWN: + case VT_DISPATCH: + if(V_VT(src) != vt) + hres = E_NOTIMPL; + else { + IUnknown_AddRef(V_UNKNOWN(src)); + V_UNKNOWN(dst) = V_UNKNOWN(src); + hres = S_OK; + } + break; default: FIXME("vt %d not implemented\n", vt); hres = E_NOTIMPL; diff --git a/dlls/jscript/tests/caller.c b/dlls/jscript/tests/caller.c index 0da8c9abb08..836f5a820a1 100644 --- a/dlls/jscript/tests/caller.c +++ b/dlls/jscript/tests/caller.c @@ -97,14 +97,14 @@ static void _call_change_type(unsigned line, IVariantChangeType *change_type, VA HRESULT hres; VariantInit(dst); - if(V_VT(src) == VT_DISPATCH && vt != VT_BOOL) { + if(V_VT(src) != vt && vt != VT_BOOL && (V_VT(src) == VT_DISPATCH || V_VT(src) == VT_UNKNOWN)) { SET_EXPECT(OnEnterScript); SET_EXPECT(OnLeaveScript); } hres = IVariantChangeType_ChangeType(change_type, dst, src, 0, vt); ok_(__FILE__,line)(hres == S_OK, "ChangeType(%d) failed: %08lx\n", vt, hres); ok_(__FILE__,line)(V_VT(dst) == vt, "V_VT(dst) = %d\n", V_VT(dst)); - if(V_VT(src) == VT_DISPATCH && vt != VT_BOOL) { + if(V_VT(src) != vt && vt != VT_BOOL && (V_VT(src) == VT_DISPATCH || V_VT(src) == VT_UNKNOWN)) { CHECK_CALLED(OnEnterScript); CHECK_CALLED(OnLeaveScript); } @@ -118,7 +118,7 @@ static void _change_type_fail(unsigned line, IVariantChangeType *change_type, VA V_VT(&v) = VT_EMPTY; hres = IVariantChangeType_ChangeType(change_type, &v, src, 0, vt); - ok_(__FILE__,line)(hres == exhres, "ChangeType failed: %08lx, expected %08lx\n", hres, exhres); + ok_(__FILE__,line)(hres == exhres, "ChangeType failed: %08lx, expected %08lx [%d]\n", hres, exhres, V_VT(src)); } static void test_change_type(IVariantChangeType *change_type, VARIANT *src, const conv_results_t *ex) @@ -158,6 +158,20 @@ static void test_change_type(IVariantChangeType *change_type, VARIANT *src, cons call_change_type(change_type, &v, src, VT_I2); ok(V_I2(&v) == (INT16)ex->int_result, "V_I2(v) = %d, expected %d\n", V_I2(&v), ex->int_result); + + if(V_VT(src) != VT_UNKNOWN) + change_type_fail(change_type, src, VT_UNKNOWN, E_NOTIMPL); + else { + call_change_type(change_type, &v, src, VT_UNKNOWN); + ok(V_UNKNOWN(&v) == V_UNKNOWN(src), "V_UNKNOWN(v) != V_UNKNOWN(src)\n"); + } + + if(V_VT(src) != VT_DISPATCH) + change_type_fail(change_type, src, VT_DISPATCH, E_NOTIMPL); + else { + call_change_type(change_type, &v, src, VT_DISPATCH); + ok(V_DISPATCH(&v) == V_DISPATCH(src), "V_DISPATCH(v) != V_DISPATCH(src)\n"); + } } static void test_change_types(IVariantChangeType *change_type, IDispatch *obj_disp) @@ -200,6 +214,10 @@ static void test_change_types(IVariantChangeType *change_type, IDispatch *obj_di V_VT(&v) = VT_NULL; test_change_type(change_type, &v, &null_results); + V_VT(&v) = VT_UNKNOWN; + V_UNKNOWN(&v) = (IUnknown*)obj_disp; + test_change_type(change_type, &v, &obj_results); + V_VT(&v) = VT_DISPATCH; V_DISPATCH(&v) = obj_disp; test_change_type(change_type, &v, &obj_results);
1
0
0
0
Jacek Caban : makedep: Always use -mno-cygwin for extra test modules.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 4920d08e5f5f7cd3156f5dade59c1099f01fc346 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4920d08e5f5f7cd3156f5dade59c10…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Oct 31 20:45:03 2022 +0100 makedep: Always use -mno-cygwin for extra test modules. --- tools/makedep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 82cd37934b5..ac2b7a19ff3 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -3065,14 +3065,15 @@ static void output_source_in( struct makefile *make, struct incl_file *source, c static void output_source_spec( struct makefile *make, struct incl_file *source, const char *obj ) { struct strarray imports = get_expanded_file_local_var( make, obj, "IMPORTS" ); - struct strarray dll_flags = get_expanded_file_local_var( make, obj, "EXTRADLLFLAGS" ); + struct strarray dll_flags = empty_strarray; struct strarray all_libs = empty_strarray, dep_libs = empty_strarray; struct strarray default_imports = empty_strarray; const char *dll_name, *obj_name, *res_name, *output_file, *debug_file; unsigned int arch = make->is_cross ? 1 : 0; if (!imports.count) imports = make->imports; - if (!dll_flags.count) dll_flags = make->extradllflags; + strarray_addall( &dll_flags, make->extradllflags ); + strarray_addall( &dll_flags, get_expanded_file_local_var( make, obj, "EXTRADLLFLAGS" )); if (!strarray_exists( &dll_flags, "-nodefaultlibs" )) default_imports = get_default_imports( make, imports ); strarray_addall( &all_libs, add_import_libs( make, &dep_libs, imports, IMPORT_TYPE_DIRECT, arch ) );
1
0
0
0
Paul Gofman : ws2_32/tests: Also test bind to any together with loopback in a different order.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: f307d472706d56ea4cfdeb98daaac39239b7d814 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f307d472706d56ea4cfdeb98daaac3…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Oct 26 13:28:00 2022 -0500 ws2_32/tests: Also test bind to any together with loopback in a different order. --- dlls/ws2_32/tests/sock.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 943ee8539ea..5460bc621d3 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -2123,7 +2123,7 @@ static void test_so_reuseaddr(void) closesocket(s3); closesocket(s4); - /* Test binding and listening on any addr together with loopback. */ + /* Test binding and listening on any addr together with loopback, any addr first. */ s1 = socket(tests[i].domain, SOCK_STREAM, 0); ok(s1 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); @@ -2157,6 +2157,41 @@ static void test_so_reuseaddr(void) closesocket(s3); closesocket(s4); + /* Test binding and listening on any addr together with loopback, loopback addr first. */ + + s1 = socket(tests[i].domain, SOCK_STREAM, 0); + ok(s1 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + rc = bind(s1, tests[i].addr_loopback, tests[i].addrlen); + ok(!rc, "got error %d.\n", WSAGetLastError()); + + rc = listen(s1, 1); + ok(!rc, "got error %d.\n", WSAGetLastError()); + + s2 = socket(tests[i].domain, SOCK_STREAM, 0); + ok(s2 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + rc = bind(s2, tests[i].addr_any, tests[i].addrlen); + todo_wine ok(!rc, "got rc %d, error %d.\n", rc, WSAGetLastError()); + + rc = listen(s2, 1); + todo_wine ok(!rc, "got error %d.\n", WSAGetLastError()); + + s3 = socket(tests[i].domain, SOCK_STREAM, 0); + ok(s3 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + rc = connect(s3, tests[i].addr_loopback, tests[i].addrlen); + ok(!rc, "got error %d.\n", WSAGetLastError()); + size = tests[i].addrlen; + s4 = accept(s1, &saddr, &size); + + ok(s4 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + closesocket(s1); + closesocket(s2); + closesocket(s3); + closesocket(s4); + /* Test binding to INADDR_ANY on two sockets. */ s1 = socket(tests[i].domain, SOCK_STREAM, 0); ok(s1 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError());
1
0
0
0
Paul Gofman : server: Set Unix SO_REUSEADDR on all the TCP sockets.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: ef7de1fc1f011bede33c0fa1d08d5feebba6adf7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ef7de1fc1f011bede33c0fa1d08d5f…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 18 16:00:20 2022 -0500 server: Set Unix SO_REUSEADDR on all the TCP sockets. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50955
--- dlls/httpapi/tests/httpapi.c | 6 +- server/sock.c | 211 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 197 insertions(+), 20 deletions(-)
1
0
0
0
Paul Gofman : server: Track SO_REUSEADDR value.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 382ec78db305cc9ed77efa3aa85fb7fc8d74e543 URL:
https://gitlab.winehq.org/wine/wine/-/commit/382ec78db305cc9ed77efa3aa85fb7…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Sat Oct 15 10:47:52 2022 -0500 server: Track SO_REUSEADDR value. --- server/sock.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/server/sock.c b/server/sock.c index 87a536bb363..7c5f0185fd5 100644 --- a/server/sock.c +++ b/server/sock.c @@ -233,6 +233,7 @@ struct sock unsigned int nonblocking : 1; /* is the socket nonblocking? */ unsigned int bound : 1; /* is the socket bound? */ unsigned int reset : 1; /* did we get a TCP reset? */ + unsigned int reuseaddr : 1; /* winsock SO_REUSEADDR option value */ }; static void sock_dump( struct object *obj, int verbose ); @@ -1545,6 +1546,7 @@ static struct sock *create_socket(void) sock->nonblocking = 0; sock->bound = 0; sock->reset = 0; + sock->reuseaddr = 0; sock->rcvbuf = 0; sock->sndbuf = 0; sock->rcvtimeo = 0; @@ -2720,14 +2722,8 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) if (bind( unix_fd, &bind_addr.addr, unix_len ) < 0) { - if (errno == EADDRINUSE) - { - int reuse; - socklen_t len = sizeof(reuse); - - if (!getsockopt( unix_fd, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse, &len ) && reuse) - errno = EACCES; - } + if (errno == EADDRINUSE && sock->reuseaddr) + errno = EACCES; set_error( sock_get_ntstatus( errno ) ); return; @@ -2925,6 +2921,8 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) #endif if (ret) set_error( sock_get_ntstatus( errno ) ); + else + sock->reuseaddr = !!reuse; return; } @@ -3018,7 +3016,6 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) case IOCTL_AFD_WINE_GET_SO_REUSEADDR: { int reuse; - socklen_t len = sizeof(reuse); if (!get_reply_max_size()) { @@ -3026,10 +3023,8 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) return; } - if (!getsockopt( unix_fd, SOL_SOCKET, SO_REUSEADDR, &reuse, &len )) - set_reply_data( &reuse, min( sizeof(reuse), get_reply_max_size() )); - else - set_error( sock_get_ntstatus( errno ) ); + reuse = sock->reuseaddr; + set_reply_data( &reuse, min( sizeof(reuse), get_reply_max_size() )); return; }
1
0
0
0
Paul Gofman : ntdll: Move SO_REUSEADDR handling to server.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 039f8b16f6492f3e7e29e7c881a22e319497c276 URL:
https://gitlab.winehq.org/wine/wine/-/commit/039f8b16f6492f3e7e29e7c881a22e…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Sat Oct 15 10:29:58 2022 -0500 ntdll: Move SO_REUSEADDR handling to server. --- dlls/ntdll/unix/socket.c | 21 --------------------- server/sock.c | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/dlls/ntdll/unix/socket.c b/dlls/ntdll/unix/socket.c index b502d3a03cb..7dbf03365bb 100644 --- a/dlls/ntdll/unix/socket.c +++ b/dlls/ntdll/unix/socket.c @@ -1977,27 +1977,6 @@ NTSTATUS sock_ioctl( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc case IOCTL_AFD_WINE_SET_SO_OOBINLINE: return do_setsockopt( handle, io, SOL_SOCKET, SO_OOBINLINE, in_buffer, in_size ); - case IOCTL_AFD_WINE_GET_SO_REUSEADDR: - return do_getsockopt( handle, io, SOL_SOCKET, SO_REUSEADDR, out_buffer, out_size ); - - /* BSD socket SO_REUSEADDR is not 100% compatible to winsock semantics; - * however, using it the BSD way fixes bug 8513 and seems to be what - * most programmers assume, anyway */ - case IOCTL_AFD_WINE_SET_SO_REUSEADDR: - { - int ret; - - if ((status = server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL ))) - return status; - - ret = setsockopt( fd, SOL_SOCKET, SO_REUSEADDR, in_buffer, in_size ); -#ifdef __APPLE__ - if (!ret) ret = setsockopt( fd, SOL_SOCKET, SO_REUSEPORT, in_buffer, in_size ); -#endif - status = ret ? sock_errno_to_status( errno ) : STATUS_SUCCESS; - break; - } - case IOCTL_AFD_WINE_SET_IP_ADD_MEMBERSHIP: return do_setsockopt( handle, io, IPPROTO_IP, IP_ADD_MEMBERSHIP, in_buffer, in_size ); diff --git a/server/sock.c b/server/sock.c index 4e57d6774a6..87a536bb363 100644 --- a/server/sock.c +++ b/server/sock.c @@ -2905,6 +2905,29 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) return; } + /* BSD socket SO_REUSEADDR is not 100% compatible to winsock semantics; + * however, using it the BSD way fixes bug 8513 and seems to be what + * most programmers assume, anyway */ + case IOCTL_AFD_WINE_SET_SO_REUSEADDR: + { + int reuse, ret; + + if (get_req_data_size() < sizeof(reuse)) + { + set_error( STATUS_BUFFER_TOO_SMALL ); + return; + } + + reuse = *(int *)get_req_data(); + ret = setsockopt( unix_fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse) ); +#ifdef __APPLE__ + if (!ret) ret = setsockopt( unix_fd, SOL_SOCKET, SO_REUSEPORT, &reuse, sizeof(reuse) ); +#endif + if (ret) + set_error( sock_get_ntstatus( errno ) ); + return; + } + case IOCTL_AFD_WINE_GET_SO_SNDBUF: { int sndbuf = sock->sndbuf; @@ -2992,6 +3015,24 @@ static void sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ) return; } + case IOCTL_AFD_WINE_GET_SO_REUSEADDR: + { + int reuse; + socklen_t len = sizeof(reuse); + + if (!get_reply_max_size()) + { + set_error( STATUS_BUFFER_TOO_SMALL ); + return; + } + + if (!getsockopt( unix_fd, SOL_SOCKET, SO_REUSEADDR, &reuse, &len )) + set_reply_data( &reuse, min( sizeof(reuse), get_reply_max_size() )); + else + set_error( sock_get_ntstatus( errno ) ); + return; + } + case IOCTL_AFD_POLL: { if (get_reply_max_size() < get_req_data_size())
1
0
0
0
Paul Gofman : ws2_32/tests: Also test TCP6 in test_so_reuseaddr().
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: c6da691926c418697ab982a284228772837a4be2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c6da691926c418697ab982a2842287…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 18 20:27:22 2022 -0500 ws2_32/tests: Also test TCP6 in test_so_reuseaddr(). --- dlls/ws2_32/tests/sock.c | 219 ++++++++++++++++++++++++++--------------------- 1 file changed, 122 insertions(+), 97 deletions(-)
1
0
0
0
Paul Gofman : ws2_32/tests: Add tests for reusing address without SO_REUSEADDR.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: bb04c95380e8584ddd2064a4391f087297bec617 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bb04c95380e8584ddd2064a4391f08…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 18 15:45:02 2022 -0500 ws2_32/tests: Add tests for reusing address without SO_REUSEADDR. --- dlls/ws2_32/tests/sock.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 879e4f7ddf7..cc74e2ab971 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -2088,12 +2088,68 @@ static void test_so_reuseaddr(void) /* The connection is delivered to the first socket. */ size = sizeof(saddr); s4 = accept(s1, (struct sockaddr*)&saddr, &size); + saddr.sin_port = htons(SERVERPORT + 1); ok(s4 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + closesocket(s1); closesocket(s2); closesocket(s3); closesocket(s4); + + /* Test binding and listening on any addr together with loopback. */ + s1 = socket(AF_INET, SOCK_STREAM, 0); + ok(s1 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + saddr.sin_addr.s_addr = htonl(INADDR_ANY); + rc = bind(s1, (struct sockaddr *)&saddr, sizeof(saddr)); + ok(!rc, "got error %d.\n", WSAGetLastError()); + + rc = listen(s1, 1); + ok(!rc, "got error %d.\n", WSAGetLastError()); + + s2 = socket(AF_INET, SOCK_STREAM, 0); + ok(s2 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + saddr.sin_addr.s_addr = inet_addr("127.0.0.1"); + rc = bind(s2, (struct sockaddr *)&saddr, sizeof(saddr)); + todo_wine ok(!rc, "got error %d.\n", WSAGetLastError()); + + rc = listen(s2, 1); + todo_wine ok(!rc, "got error %d.\n", WSAGetLastError()); + + s3 = socket(AF_INET, SOCK_STREAM, 0); + ok(s3 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + rc = connect(s3, (struct sockaddr *)&saddr, sizeof(saddr)); + ok(!rc, "got error %d.\n", WSAGetLastError()); + + size = sizeof(saddr); + s4 = accept(s2, (struct sockaddr *)&saddr, &size); + saddr.sin_port = htons(SERVERPORT + 1); + todo_wine ok(s4 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + closesocket(s1); + closesocket(s2); + closesocket(s3); + closesocket(s4); + + /* Test binding to INADDR_ANY on two sockets. */ + s1 = socket(AF_INET, SOCK_STREAM, 0); + ok(s1 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + saddr.sin_addr.s_addr = htonl(INADDR_ANY); + rc = bind(s1, (struct sockaddr *)&saddr, sizeof(saddr)); + ok(!rc, "got error %d.\n", WSAGetLastError()); + + s2 = socket(AF_INET, SOCK_STREAM, 0); + ok(s2 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + rc = bind(s2, (struct sockaddr*)&saddr, sizeof(saddr)); + ok(rc == SOCKET_ERROR && WSAGetLastError() == WSAEADDRINUSE, "got rc %d, error %d.\n", rc, WSAGetLastError()); + + closesocket(s1); + closesocket(s2); } #define IP_PKTINFO_LEN (sizeof(WSACMSGHDR) + WSA_CMSG_ALIGN(sizeof(struct in_pktinfo)))
1
0
0
0
Paul Gofman : ws2_32/tests: Make test_so_reuseaddr() more conclusive.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 3be1b83921bf50df69288e21ca3aafaa87868615 URL:
https://gitlab.winehq.org/wine/wine/-/commit/3be1b83921bf50df69288e21ca3aaf…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Oct 18 15:13:36 2022 -0500 ws2_32/tests: Make test_so_reuseaddr() more conclusive. --- dlls/ws2_32/tests/sock.c | 102 +++++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 47 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index adf16012951..879e4f7ddf7 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -2016,76 +2016,84 @@ static void test_set_getsockopt(void) static void test_so_reuseaddr(void) { struct sockaddr_in saddr; - SOCKET s1,s2; - unsigned int rc,reuse; + unsigned int rc, reuse; + SOCKET s1, s2, s3, s4; int size; - DWORD err; saddr.sin_family = AF_INET; saddr.sin_port = htons(SERVERPORT+1); saddr.sin_addr.s_addr = inet_addr("127.0.0.1"); + /* Test with SO_REUSEADDR on second socket only. */ + s1=socket(AF_INET, SOCK_STREAM, 0); + ok(s1 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + rc = bind(s1, (struct sockaddr*)&saddr, sizeof(saddr)); + ok(!rc, "got error %d.\n", WSAGetLastError()); + + s2 = socket(AF_INET, SOCK_STREAM, 0); + ok(s2 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + reuse = 1; + rc = setsockopt(s2, SOL_SOCKET, SO_REUSEADDR, (char*)&reuse, sizeof(reuse)); + ok(!rc, "got error %d.\n", WSAGetLastError()); + + rc = bind(s2, (struct sockaddr*)&saddr, sizeof(saddr)); + ok(rc == SOCKET_ERROR, "got rc %d.\n", rc); + ok(WSAGetLastError() == WSAEACCES, "got error %d.\n", WSAGetLastError()); + + closesocket(s1); + closesocket(s2); + + /* Test with SO_REUSEADDR on both sockets. */ s1=socket(AF_INET, SOCK_STREAM, 0); - ok(s1!=INVALID_SOCKET, "socket() failed error: %d\n", WSAGetLastError()); + ok(s1 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + + reuse = 1; + rc = setsockopt(s1, SOL_SOCKET, SO_REUSEADDR, (char*)&reuse, sizeof(reuse)); + ok(!rc, "got error %d.\n", WSAGetLastError()); + rc = bind(s1, (struct sockaddr*)&saddr, sizeof(saddr)); - ok(rc!=SOCKET_ERROR, "bind(s1) failed error: %d\n", WSAGetLastError()); + ok(!rc, "got error %d.\n", WSAGetLastError()); - s2=socket(AF_INET, SOCK_STREAM, 0); - ok(s2!=INVALID_SOCKET, "socket() failed error: %d\n", WSAGetLastError()); + s2 = socket(AF_INET, SOCK_STREAM, 0); + ok(s2 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); reuse=0x1234; size=sizeof(reuse); - rc=getsockopt(s2, SOL_SOCKET, SO_REUSEADDR, (char*)&reuse, &size ); - ok(rc==0 && reuse==0,"wrong result in getsockopt(SO_REUSEADDR): rc=%d reuse=%d\n",rc,reuse); + rc=getsockopt(s2, SOL_SOCKET, SO_REUSEADDR, (char*)&reuse, &size); + ok(!rc && !reuse,"got rc %d, reuse %d.\n", rc, reuse); rc = bind(s2, (struct sockaddr*)&saddr, sizeof(saddr)); - ok(rc==SOCKET_ERROR, "bind() succeeded\n"); + ok(rc == SOCKET_ERROR, "got rc %d, error %d.\n", rc, WSAGetLastError()); reuse = 1; rc = setsockopt(s2, SOL_SOCKET, SO_REUSEADDR, (char*)&reuse, sizeof(reuse)); - ok(rc==0, "setsockopt() failed error: %d\n", WSAGetLastError()); + ok(!rc, "got error %d.\n", WSAGetLastError()); - /* On Win2k3 and above, all SO_REUSEADDR seems to do is to allow binding to - * a port immediately after closing another socket on that port, so - * basically following the BSD socket semantics here. */ rc = bind(s2, (struct sockaddr*)&saddr, sizeof(saddr)); - if(rc==0) - { - int s3=socket(AF_INET, SOCK_STREAM, 0), s4; - - /* If we could bind again in the same port this is Windows version <= XP. - * Lets test if we can really connect to one of them. */ - set_blocking(s1, FALSE); - set_blocking(s2, FALSE); - rc = listen(s1, 1); - ok(!rc, "listen() failed with error: %d\n", WSAGetLastError()); - rc = listen(s2, 1); - ok(!rc, "listen() failed with error: %d\n", WSAGetLastError()); - rc = connect(s3, (struct sockaddr*)&saddr, sizeof(saddr)); - ok(!rc, "connecting to accepting socket failed %d\n", WSAGetLastError()); - - /* the delivery of the connection is random so we need to try on both sockets */ - size = sizeof(saddr); - s4 = accept(s1, (struct sockaddr*)&saddr, &size); - if(s4 == INVALID_SOCKET) - s4 = accept(s2, (struct sockaddr*)&saddr, &size); - ok(s4 != INVALID_SOCKET, "none of the listening sockets could get the connection\n"); + ok(!rc, "got error %d.\n", WSAGetLastError()); - closesocket(s1); - closesocket(s3); - closesocket(s4); - } - else - { - err = WSAGetLastError(); - ok(err==WSAEACCES, "expected 10013, got %ld\n", err); + s3 = socket(AF_INET, SOCK_STREAM, 0); + ok(s3 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); - closesocket(s1); - rc = bind(s2, (struct sockaddr*)&saddr, sizeof(saddr)); - ok(rc==0, "bind() failed error: %d\n", WSAGetLastError()); - } + /* Test if we can really connect to one of them. */ + rc = listen(s1, 1); + ok(!rc, "got error %d.\n", WSAGetLastError()); + rc = listen(s2, 1); + todo_wine ok(!rc, "got error %d.\n", WSAGetLastError()); + rc = connect(s3, (struct sockaddr*)&saddr, sizeof(saddr)); + ok(!rc, "got error %d.\n", WSAGetLastError()); + + /* The connection is delivered to the first socket. */ + size = sizeof(saddr); + s4 = accept(s1, (struct sockaddr*)&saddr, &size); + ok(s4 != INVALID_SOCKET, "got error %d.\n", WSAGetLastError()); + closesocket(s1); closesocket(s2); + closesocket(s3); + closesocket(s4); } #define IP_PKTINFO_LEN (sizeof(WSACMSGHDR) + WSA_CMSG_ALIGN(sizeof(struct in_pktinfo)))
1
0
0
0
Bartosz Kosiorek : msvcrt: Add _mbctokata_l implementation.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: dbb01a74e0eb65f9b5902adeb433b5d4774c7208 URL:
https://gitlab.winehq.org/wine/wine/-/commit/dbb01a74e0eb65f9b5902adeb433b5…
Author: Bartosz Kosiorek <gang65(a)poczta.onet.pl> Date: Thu Oct 27 21:17:01 2022 +0200 msvcrt: Add _mbctokata_l implementation. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/mbcs.c | 15 ++++++++++++--- dlls/msvcrt/msvcrt.spec | 2 +- dlls/ucrtbase/ucrtbase.spec | 4 ++-- 8 files changed, 20 insertions(+), 11 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index d32bed81d18..4be6144ca7e 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1086,7 +1086,7 @@ @ cdecl _mbctohira(long) @ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) -@ stub _mbctokata_l +@ cdecl _mbctokata_l(long ptr) @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index d3c6760ee75..aee92ec232f 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1443,7 +1443,7 @@ @ cdecl _mbctohira(long) @ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) -@ stub _mbctokata_l +@ cdecl _mbctokata_l(long ptr) @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index b54edaf48d4..6c0d560b67f 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1454,7 +1454,7 @@ @ cdecl _mbctohira(long) @ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) -@ stub _mbctokata_l +@ cdecl _mbctokata_l(long ptr) @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 5c11c5d871c..f3981ed3dea 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -758,7 +758,7 @@ @ cdecl _mbctohira(long) @ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) -@ stub _mbctokata_l +@ cdecl _mbctokata_l(long ptr) @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 9c25f566a96..3e581b911e2 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -736,7 +736,7 @@ @ cdecl _mbctohira(long) @ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) -@ stub _mbctokata_l +@ cdecl _mbctokata_l(long ptr) @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index b0f8696efc4..16c5c378be7 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -2970,17 +2970,26 @@ unsigned int CDECL _mbctohira(unsigned int c) } /********************************************************************* - * _mbctokata (MSVCRT.@) + * _mbctokata_l (MSVCRT.@) * * Converts a sjis hiragana character to katakana. */ -unsigned int CDECL _mbctokata(unsigned int c) +unsigned int CDECL _mbctokata_l(unsigned int c, _locale_t locale) { - if(_ismbchira(c)) + if(_ismbchira_l(c, locale)) return (c - 0x829f) + 0x8340 + (c >= 0x82de ? 1 : 0); return c; } + +/********************************************************************* + * _mbctokata (MSVCRT.@) + */ +unsigned int CDECL _mbctokata(unsigned int c) +{ + return _mbctokata_l(c, NULL); +} + /********************************************************************* * _ismbcl0_l (MSVCRT.@) */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 4674082fc8c..8c6a3b9a910 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -703,7 +703,7 @@ @ cdecl _mbctohira(long) @ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) -# stub _mbctokata_l(long ptr) +@ cdecl _mbctokata_l(long ptr) @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index ea017cbffcd..c7bff96ee26 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -601,7 +601,7 @@ @ cdecl _mbctohira(long) @ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) -@ stub _mbctokata_l +@ cdecl _mbctokata_l(long ptr) @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) @@ -1171,7 +1171,7 @@ @ cdecl _o__mbctohira(long) _mbctohira @ cdecl _o__mbctohira_l(long ptr) _mbctohira_l @ cdecl _o__mbctokata(long) _mbctokata -@ stub _o__mbctokata_l +@ cdecl _o__mbctokata_l(long ptr) _mbctokata_l @ cdecl _o__mbctolower(long) _mbctolower @ cdecl _o__mbctolower_l(long ptr) _mbctolower_l @ cdecl _o__mbctombb(long) _mbctombb
1
0
0
0
Bartosz Kosiorek : msvcrt: Add _mbctohira_l implementation.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 6f9695c459bbd6672a3f487ac85534a5965dee7c URL:
https://gitlab.winehq.org/wine/wine/-/commit/6f9695c459bbd6672a3f487ac85534…
Author: Bartosz Kosiorek <gang65(a)poczta.onet.pl> Date: Thu Oct 27 21:13:03 2022 +0200 msvcrt: Add _mbctohira_l implementation. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/mbcs.c | 14 +++++++++++--- dlls/msvcrt/msvcrt.spec | 2 +- dlls/ucrtbase/ucrtbase.spec | 4 ++-- 8 files changed, 19 insertions(+), 11 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index ae73fdb0835..d32bed81d18 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1084,7 +1084,7 @@ @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) -@ stub _mbctohira_l +@ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) @ stub _mbctokata_l @ cdecl _mbctolower(long) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 180986405c8..d3c6760ee75 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1441,7 +1441,7 @@ @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) -@ stub _mbctohira_l +@ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) @ stub _mbctokata_l @ cdecl _mbctolower(long) diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 751f7701046..b54edaf48d4 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1452,7 +1452,7 @@ @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) -@ stub _mbctohira_l +@ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) @ stub _mbctokata_l @ cdecl _mbctolower(long) diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index d84b4faf265..5c11c5d871c 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -756,7 +756,7 @@ @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) -@ stub _mbctohira_l +@ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) @ stub _mbctokata_l @ cdecl _mbctolower(long) diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 27593fbcaef..9c25f566a96 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -734,7 +734,7 @@ @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) -@ stub _mbctohira_l +@ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) @ stub _mbctokata_l @ cdecl _mbctolower(long) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index 23cf07cdbe3..b0f8696efc4 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -2950,17 +2950,25 @@ int CDECL mbsrtowcs_s(size_t *ret, wchar_t *wcstr, size_t len, } /********************************************************************* - * _mbctohira (MSVCRT.@) + * _mbctohira_l (MSVCRT.@) * * Converts a sjis katakana character to hiragana. */ -unsigned int CDECL _mbctohira(unsigned int c) +unsigned int CDECL _mbctohira_l(unsigned int c, _locale_t locale) { - if(_ismbckata(c) && c <= 0x8393) + if(_ismbckata_l(c, locale) && c <= 0x8393) return (c - 0x8340 - (c >= 0x837f ? 1 : 0)) + 0x829f; return c; } +/********************************************************************* + * _mbctohira (MSVCRT.@) + */ +unsigned int CDECL _mbctohira(unsigned int c) +{ + return _mbctohira_l(c, NULL); +} + /********************************************************************* * _mbctokata (MSVCRT.@) * diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 274f69f2be9..4674082fc8c 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -701,7 +701,7 @@ @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) -# stub _mbctohira_l(long ptr) +@ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) # stub _mbctokata_l(long ptr) @ cdecl _mbctolower(long) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 29e0dc9a6e4..ea017cbffcd 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -599,7 +599,7 @@ @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) -@ stub _mbctohira_l +@ cdecl _mbctohira_l(long ptr) @ cdecl _mbctokata(long) @ stub _mbctokata_l @ cdecl _mbctolower(long) @@ -1169,7 +1169,7 @@ @ cdecl _o__mbclen(ptr) _mbclen @ cdecl _o__mbclen_l(ptr ptr) _mbclen_l @ cdecl _o__mbctohira(long) _mbctohira -@ stub _o__mbctohira_l +@ cdecl _o__mbctohira_l(long ptr) _mbctohira_l @ cdecl _o__mbctokata(long) _mbctokata @ stub _o__mbctokata_l @ cdecl _o__mbctolower(long) _mbctolower
1
0
0
0
Bartosz Kosiorek : msvcrt: Add _mbctombb_l implementation.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 5d71a6125302b1e8d9b023bec505662f4cd85487 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5d71a6125302b1e8d9b023bec50566…
Author: Bartosz Kosiorek <gang65(a)poczta.onet.pl> Date: Thu Oct 27 17:30:05 2022 +0200 msvcrt: Add _mbctombb_l implementation. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/mbcs.c | 20 +++++++++++++++++--- dlls/msvcrt/msvcrt.spec | 2 +- dlls/ucrtbase/ucrtbase.spec | 4 ++-- 8 files changed, 25 insertions(+), 11 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index fe5a97dace3..ae73fdb0835 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1090,7 +1090,7 @@ @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) -@ stub _mbctombb_l +@ cdecl _mbctombb_l(long ptr) @ cdecl _mbctoupper(long) @ cdecl _mbctoupper_l(long ptr) @ extern _mbctype MSVCRT_mbctype diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 401161fb0f9..180986405c8 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1447,7 +1447,7 @@ @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) -@ stub _mbctombb_l +@ cdecl _mbctombb_l(long ptr) @ cdecl _mbctoupper(long) @ cdecl _mbctoupper_l(long ptr) @ extern _mbctype MSVCRT_mbctype diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 191dcc49407..751f7701046 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1458,7 +1458,7 @@ @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) -@ stub _mbctombb_l +@ cdecl _mbctombb_l(long ptr) @ cdecl _mbctoupper(long) @ cdecl _mbctoupper_l(long ptr) @ extern _mbctype MSVCRT_mbctype diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 05312dcf158..d84b4faf265 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -762,7 +762,7 @@ @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) -@ stub _mbctombb_l +@ cdecl _mbctombb_l(long ptr) @ cdecl _mbctoupper(long) @ cdecl _mbctoupper_l(long ptr) @ extern _mbctype MSVCRT_mbctype diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 92e55266ba5..27593fbcaef 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -740,7 +740,7 @@ @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) -@ stub _mbctombb_l +@ cdecl _mbctombb_l(long ptr) @ cdecl _mbctoupper(long) @ cdecl _mbctoupper_l(long ptr) @ extern _mbctype MSVCRT_mbctype diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index ed1e47770f0..23cf07cdbe3 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -528,13 +528,19 @@ unsigned int CDECL _mbctoupper(unsigned int c) } /********************************************************************* - * _mbctombb (MSVCRT.@) + * _mbctombb_l (MSVCRT.@) */ -unsigned int CDECL _mbctombb(unsigned int c) +unsigned int CDECL _mbctombb_l(unsigned int c, _locale_t locale) { + pthreadmbcinfo mbcinfo; unsigned int value; - if(get_mbcinfo()->mbcodepage == 932) + if(locale) + mbcinfo = locale->mbcinfo; + else + mbcinfo = get_mbcinfo(); + + if(mbcinfo->mbcodepage == 932) { if(c >= 0x829f && c <= 0x82f1) /* Hiragana */ return mbctombb_932_kana[c - 0x829f]; @@ -555,6 +561,14 @@ unsigned int CDECL _mbctombb(unsigned int c) return c; } +/********************************************************************* + * _mbctombb (MSVCRT.@) + */ +unsigned int CDECL _mbctombb(unsigned int c) +{ + return _mbctombb_l(c, NULL); +} + /********************************************************************* * _mbcjistojms_l(MSVCRT.@) * diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index d37e51ef84f..274f69f2be9 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -707,7 +707,7 @@ @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) -# stub _mbctombb_l(long ptr) +@ cdecl _mbctombb_l(long ptr) @ cdecl _mbctoupper(long) @ cdecl _mbctoupper_l(long ptr) @ extern _mbctype MSVCRT_mbctype diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 77d6fea014a..29e0dc9a6e4 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -605,7 +605,7 @@ @ cdecl _mbctolower(long) @ cdecl _mbctolower_l(long ptr) @ cdecl _mbctombb(long) -@ stub _mbctombb_l +@ cdecl _mbctombb_l(long ptr) @ cdecl _mbctoupper(long) @ cdecl _mbctoupper_l(long ptr) @ stub _mblen_l @@ -1175,7 +1175,7 @@ @ cdecl _o__mbctolower(long) _mbctolower @ cdecl _o__mbctolower_l(long ptr) _mbctolower_l @ cdecl _o__mbctombb(long) _mbctombb -@ stub _o__mbctombb_l +@ cdecl _o__mbctombb_l(long ptr) _mbctombb_l @ cdecl _o__mbctoupper(long) _mbctoupper @ cdecl _o__mbctoupper_l(long ptr) _mbctoupper_l @ stub _o__mblen_l
1
0
0
0
Bartosz Kosiorek : msvcrt: Add _mbcjmstojis_l implementation.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 7984319248f717b032c28caa3c3538c91a1c0d21 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7984319248f717b032c28caa3c3538…
Author: Bartosz Kosiorek <gang65(a)poczta.onet.pl> Date: Thu Oct 27 17:30:00 2022 +0200 msvcrt: Add _mbcjmstojis_l implementation. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/mbcs.c | 23 +++++++++++++++++++---- dlls/msvcrt/msvcrt.spec | 2 +- dlls/ucrtbase/ucrtbase.spec | 4 ++-- include/msvcrt/mbstring.h | 1 + 9 files changed, 28 insertions(+), 12 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index b8539d8161c..fe5a97dace3 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1080,7 +1080,7 @@ @ cdecl _mbcjistojms(long) @ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) -@ stub _mbcjmstojis_l +@ cdecl _mbcjmstojis_l(long ptr) @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index f2c8f79bc0e..401161fb0f9 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1437,7 +1437,7 @@ @ cdecl _mbcjistojms(long) @ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) -@ stub _mbcjmstojis_l +@ cdecl _mbcjmstojis_l(long ptr) @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 80d1345d2c8..191dcc49407 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1448,7 +1448,7 @@ @ cdecl _mbcjistojms(long) @ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) -@ stub _mbcjmstojis_l +@ cdecl _mbcjmstojis_l(long ptr) @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 04141960357..05312dcf158 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -752,7 +752,7 @@ @ cdecl _mbcjistojms(long) @ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) -@ stub _mbcjmstojis_l +@ cdecl _mbcjmstojis_l(long ptr) @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 2e486c85a6d..92e55266ba5 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -730,7 +730,7 @@ @ cdecl _mbcjistojms(long) @ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) -@ stub _mbcjmstojis_l +@ cdecl _mbcjmstojis_l(long ptr) @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index 58e3772e5b7..ed1e47770f0 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -607,17 +607,24 @@ unsigned int CDECL _mbcjistojms(unsigned int c) } /********************************************************************* - * _mbcjmstojis(MSVCRT.@) + * _mbcjmstojis_l(MSVCRT.@) * * Converts a sjis character to jis. */ -unsigned int CDECL _mbcjmstojis(unsigned int c) +unsigned int CDECL _mbcjmstojis_l(unsigned int c, _locale_t locale) { + pthreadmbcinfo mbcinfo; + + if(locale) + mbcinfo = locale->mbcinfo; + else + mbcinfo = get_mbcinfo(); + /* Conversion takes place only when codepage is 932. In all other cases, c is returned unchanged */ - if(get_mbcinfo()->mbcodepage == 932) + if(mbcinfo->mbcodepage == 932) { - if(_ismbclegal(c) && HIBYTE(c) < 0xf0) + if(_ismbclegal_l(c, locale) && HIBYTE(c) < 0xf0) { if(HIBYTE(c) >= 0xe0) c -= 0x4000; @@ -639,6 +646,14 @@ unsigned int CDECL _mbcjmstojis(unsigned int c) return c; } +/********************************************************************* + * _mbcjmstojis(MSVCRT.@) + */ +unsigned int CDECL _mbcjmstojis(unsigned int c) +{ + return _mbcjmstojis_l(c, NULL); +} + /********************************************************************* * _mbsdec(MSVCRT.@) */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 94f23df0871..d37e51ef84f 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -697,7 +697,7 @@ @ cdecl _mbcjistojms (long) @ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) -# stub _mbcjmstojis_l(long ptr) +@ cdecl _mbcjmstojis_l(long ptr) @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 819240a5015..77d6fea014a 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -595,7 +595,7 @@ @ cdecl _mbcjistojms(long) @ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) -@ stub _mbcjmstojis_l +@ cdecl _mbcjmstojis_l(long ptr) @ cdecl _mbclen(ptr) @ cdecl _mbclen_l(ptr ptr) @ cdecl _mbctohira(long) @@ -1165,7 +1165,7 @@ @ cdecl _o__mbcjistojms(long) _mbcjistojms @ cdecl _o__mbcjistojms_l(long ptr) _mbcjistojms_l @ cdecl _o__mbcjmstojis(long) _mbcjmstojis -@ stub _o__mbcjmstojis_l +@ cdecl _o__mbcjmstojis_l(long ptr) _mbcjmstojis_l @ cdecl _o__mbclen(ptr) _mbclen @ cdecl _o__mbclen_l(ptr ptr) _mbclen_l @ cdecl _o__mbctohira(long) _mbctohira diff --git a/include/msvcrt/mbstring.h b/include/msvcrt/mbstring.h index 1de3307326f..28a0e41f10d 100644 --- a/include/msvcrt/mbstring.h +++ b/include/msvcrt/mbstring.h @@ -43,6 +43,7 @@ _ACRTIMP int __cdecl _ismbcl0(unsigned int); _ACRTIMP int __cdecl _ismbcl1(unsigned int); _ACRTIMP int __cdecl _ismbcl2(unsigned int); _ACRTIMP int __cdecl _ismbclegal(unsigned int); +_ACRTIMP int __cdecl _ismbclegal_l(unsigned int, _locale_t); _ACRTIMP int __cdecl _ismbclower(unsigned int); _ACRTIMP int __cdecl _ismbcprint(unsigned int); _ACRTIMP int __cdecl _ismbcpunct(unsigned int);
1
0
0
0
Bartosz Kosiorek : msvcrt: Add _mbcjistojms_l implementation.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 70db739c3d899b828a16d0a63280465eba68d26c URL:
https://gitlab.winehq.org/wine/wine/-/commit/70db739c3d899b828a16d0a6328046…
Author: Bartosz Kosiorek <gang65(a)poczta.onet.pl> Date: Thu Oct 27 17:29:58 2022 +0200 msvcrt: Add _mbcjistojms_l implementation. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/mbcs.c | 21 ++++++++++++++++++--- dlls/msvcrt/msvcrt.spec | 2 +- dlls/ucrtbase/ucrtbase.spec | 4 ++-- 8 files changed, 26 insertions(+), 11 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index f8d88e44f63..b8539d8161c 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1078,7 +1078,7 @@ @ cdecl _mbccpy_s(ptr long ptr ptr) @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr) @ cdecl _mbcjistojms(long) -@ stub _mbcjistojms_l +@ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) @ stub _mbcjmstojis_l @ cdecl _mbclen(ptr) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index e7ebd746619..f2c8f79bc0e 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1435,7 +1435,7 @@ @ cdecl _mbccpy_s(ptr long ptr ptr) @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr) @ cdecl _mbcjistojms(long) -@ stub _mbcjistojms_l +@ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) @ stub _mbcjmstojis_l @ cdecl _mbclen(ptr) diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 721f4ec44d9..80d1345d2c8 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1446,7 +1446,7 @@ @ cdecl _mbccpy_s(ptr long ptr ptr) @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr) @ cdecl _mbcjistojms(long) -@ stub _mbcjistojms_l +@ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) @ stub _mbcjmstojis_l @ cdecl _mbclen(ptr) diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index b20b680ddb8..04141960357 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -750,7 +750,7 @@ @ cdecl _mbccpy_s(ptr long ptr ptr) @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr) @ cdecl _mbcjistojms(long) -@ stub _mbcjistojms_l +@ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) @ stub _mbcjmstojis_l @ cdecl _mbclen(ptr) diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index cd83242f574..2e486c85a6d 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -728,7 +728,7 @@ @ cdecl _mbccpy_s(ptr long ptr ptr) @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr) @ cdecl _mbcjistojms(long) -@ stub _mbcjistojms_l +@ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) @ stub _mbcjmstojis_l @ cdecl _mbclen(ptr) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index 2b318511e06..58e3772e5b7 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -556,17 +556,24 @@ unsigned int CDECL _mbctombb(unsigned int c) } /********************************************************************* - * _mbcjistojms(MSVCRT.@) + * _mbcjistojms_l(MSVCRT.@) * * Converts a jis character to sjis. * Based on description from *
http://www.slayers.ne.jp/~oouchi/code/jistosjis.html
*/ -unsigned int CDECL _mbcjistojms(unsigned int c) +unsigned int CDECL _mbcjistojms_l(unsigned int c, _locale_t locale) { + pthreadmbcinfo mbcinfo; + + if(locale) + mbcinfo = locale->mbcinfo; + else + mbcinfo = get_mbcinfo(); + /* Conversion takes place only when codepage is 932. In all other cases, c is returned unchanged */ - if(get_mbcinfo()->mbcodepage == 932) + if(mbcinfo->mbcodepage == 932) { if(HIBYTE(c) >= 0x21 && HIBYTE(c) <= 0x7e && LOBYTE(c) >= 0x21 && LOBYTE(c) <= 0x7e) @@ -591,6 +598,14 @@ unsigned int CDECL _mbcjistojms(unsigned int c) return c; } +/********************************************************************* + * _mbcjistojms(MSVCRT.@) + */ +unsigned int CDECL _mbcjistojms(unsigned int c) +{ + return _mbcjistojms_l(c, NULL); +} + /********************************************************************* * _mbcjmstojis(MSVCRT.@) * diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index ecd614dd528..94f23df0871 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -695,7 +695,7 @@ @ cdecl _mbccpy_s(ptr long ptr ptr) @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr) @ cdecl _mbcjistojms (long) -# stub _mbcjistojms_l(long ptr) +@ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) # stub _mbcjmstojis_l(long ptr) @ cdecl _mbclen(ptr) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index fe30ed63d3d..819240a5015 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -593,7 +593,7 @@ @ cdecl _mbccpy_s(ptr long ptr ptr) @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr) @ cdecl _mbcjistojms(long) -@ stub _mbcjistojms_l +@ cdecl _mbcjistojms_l(long ptr) @ cdecl _mbcjmstojis(long) @ stub _mbcjmstojis_l @ cdecl _mbclen(ptr) @@ -1163,7 +1163,7 @@ @ cdecl _o__mbccpy_s(ptr long ptr ptr) _mbccpy_s @ cdecl _o__mbccpy_s_l(ptr long ptr ptr ptr) _mbccpy_s_l @ cdecl _o__mbcjistojms(long) _mbcjistojms -@ stub _o__mbcjistojms_l +@ cdecl _o__mbcjistojms_l(long ptr) _mbcjistojms_l @ cdecl _o__mbcjmstojis(long) _mbcjmstojis @ stub _o__mbcjmstojis_l @ cdecl _o__mbclen(ptr) _mbclen
1
0
0
0
Bartosz Kosiorek : ucrtbase: Export more _o_* functions.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 35ae78c52dbdd3d2c2f60ebc265b25fae8f4677f URL:
https://gitlab.winehq.org/wine/wine/-/commit/35ae78c52dbdd3d2c2f60ebc265b25…
Author: Bartosz Kosiorek <gang65(a)poczta.onet.pl> Date: Thu Oct 27 17:29:57 2022 +0200 ucrtbase: Export more _o_* functions. --- dlls/ucrtbase/ucrtbase.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 9e0cbe7a89f..fe30ed63d3d 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -1155,7 +1155,7 @@ @ cdecl _o__makepath_s(ptr long str str str str) _makepath_s @ cdecl _o__malloc_base(long) _malloc_base @ cdecl _o__mbbtombc(long) _mbbtombc -@ stub _o__mbbtombc_l +@ cdecl _o__mbbtombc_l(long ptr) _mbbtombc_l @ cdecl _o__mbbtype(long long) _mbbtype @ cdecl _o__mbbtype_l(long long ptr) _mbbtype_l @ cdecl _o__mbccpy(ptr ptr) _mbccpy @@ -1173,11 +1173,11 @@ @ cdecl _o__mbctokata(long) _mbctokata @ stub _o__mbctokata_l @ cdecl _o__mbctolower(long) _mbctolower -@ stub _o__mbctolower_l +@ cdecl _o__mbctolower_l(long ptr) _mbctolower_l @ cdecl _o__mbctombb(long) _mbctombb @ stub _o__mbctombb_l @ cdecl _o__mbctoupper(long) _mbctoupper -@ stub _o__mbctoupper_l +@ cdecl _o__mbctoupper_l(long ptr) _mbctoupper_l @ stub _o__mblen_l @ cdecl _o__mbsbtype(str long) _mbsbtype @ stub _o__mbsbtype_l @@ -1206,7 +1206,7 @@ @ cdecl _o__mbslwr(str) _mbslwr @ stub _o__mbslwr_l @ cdecl _o__mbslwr_s(str long) _mbslwr_s -@ stub _o__mbslwr_s_l +@ cdecl _o__mbslwr_s_l(str long ptr) _mbslwr_s_l @ cdecl _o__mbsnbcat(str str long) _mbsnbcat @ stub _o__mbsnbcat_l @ cdecl _o__mbsnbcat_s(str long ptr long) _mbsnbcat_s @@ -1286,7 +1286,7 @@ @ cdecl _o__mbsupr(str) _mbsupr @ stub _o__mbsupr_l @ cdecl _o__mbsupr_s(str long) _mbsupr_s -@ stub _o__mbsupr_s_l +@ cdecl _o__mbsupr_s_l(str long ptr) _mbsupr_s_l @ cdecl _o__mbtowc_l(ptr str long ptr) _mbtowc_l @ cdecl _o__memicmp(str str long) _memicmp @ cdecl _o__memicmp_l(str str long ptr) _memicmp_l
1
0
0
0
Bartosz Kosiorek : msvcrt: Add _mbbtombc_l implementation.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 64cfe7068f9e63cbfb55bf8a8739756b902aa546 URL:
https://gitlab.winehq.org/wine/wine/-/commit/64cfe7068f9e63cbfb55bf8a873975…
Author: Bartosz Kosiorek <gang65(a)poczta.onet.pl> Date: Thu Oct 27 17:29:56 2022 +0200 msvcrt: Add _mbbtombc_l implementation. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/mbcs.c | 21 ++++++++++++++++++--- dlls/msvcrt/msvcrt.spec | 2 +- dlls/ucrtbase/ucrtbase.spec | 2 +- 8 files changed, 25 insertions(+), 10 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 34e8a98b146..f8d88e44f63 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1069,7 +1069,7 @@ @ cdecl _makepath_s(ptr long str str str str) @ cdecl _malloc_crt(long) malloc @ cdecl _mbbtombc(long) -@ stub _mbbtombc_l +@ cdecl _mbbtombc_l(long ptr) @ cdecl _mbbtype(long long) @ cdecl _mbbtype_l(long long ptr) # extern _mbcasemap diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 738adcb5ced..e7ebd746619 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1426,7 +1426,7 @@ @ cdecl _makepath_s(ptr long str str str str) @ cdecl _malloc_crt(long) malloc @ cdecl _mbbtombc(long) -@ stub _mbbtombc_l +@ cdecl _mbbtombc_l(long ptr) @ cdecl _mbbtype(long long) @ cdecl _mbbtype_l(long long ptr) # extern _mbcasemap diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 8aa35a0243b..721f4ec44d9 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1437,7 +1437,7 @@ @ cdecl _makepath_s(ptr long str str str str) @ cdecl _malloc_crt(long) malloc @ cdecl _mbbtombc(long) -@ stub _mbbtombc_l +@ cdecl _mbbtombc_l(long ptr) @ cdecl _mbbtype(long long) @ cdecl _mbbtype_l(long long ptr) # extern _mbcasemap diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 962a7bd5c63..b20b680ddb8 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -741,7 +741,7 @@ @ cdecl _makepath_s(ptr long str str str str) @ cdecl _malloc_crt(long) malloc @ cdecl _mbbtombc(long) -@ stub _mbbtombc_l +@ cdecl _mbbtombc_l(long ptr) @ cdecl _mbbtype(long long) @ cdecl _mbbtype_l(long long ptr) # extern _mbcasemap diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 52bd096d5d4..cd83242f574 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -719,7 +719,7 @@ @ cdecl _makepath_s(ptr long str str str str) @ cdecl _malloc_crt(long) malloc @ cdecl _mbbtombc(long) -@ stub _mbbtombc_l +@ cdecl _mbbtombc_l(long ptr) @ cdecl _mbbtype(long long) @ cdecl _mbbtype_l(long long ptr) # extern _mbcasemap diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index c1c92859522..2b318511e06 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -1512,11 +1512,18 @@ unsigned char* CDECL _mbstok(unsigned char *str, const unsigned char *delim) } /********************************************************************* - * _mbbtombc(MSVCRT.@) + * _mbbtombc_l(MSVCRT.@) */ -unsigned int CDECL _mbbtombc(unsigned int c) +unsigned int CDECL _mbbtombc_l(unsigned int c, _locale_t locale) { - if(get_mbcinfo()->mbcodepage == 932) + pthreadmbcinfo mbcinfo; + + if(locale) + mbcinfo = locale->mbcinfo; + else + mbcinfo = get_mbcinfo(); + + if(mbcinfo->mbcodepage == 932) { if(c >= 0x20 && c <= 0x7e) { if((c >= 0x41 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a) || (c >= 0x30 && c <= 0x39)) @@ -1534,6 +1541,14 @@ unsigned int CDECL _mbbtombc(unsigned int c) return c; /* not Japanese or no MB char */ } +/********************************************************************* + * _mbbtombc(MSVCRT.@) + */ +unsigned int CDECL _mbbtombc(unsigned int c) +{ + return _mbbtombc_l(c, NULL); +} + /********************************************************************* * _ismbbkana_l(MSVCRT.@) */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 6be1aa1006b..ecd614dd528 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -687,7 +687,7 @@ @ cdecl _makepath_s(ptr long str str str str) # stub _malloc_dbg(long long str long) @ cdecl _mbbtombc(long) -# stub _mbbtombc_l(long ptr) +@ cdecl _mbbtombc_l(long ptr) @ cdecl _mbbtype(long long) # extern _mbcasemap @ cdecl _mbccpy(ptr ptr) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 75ef6446635..9e0cbe7a89f 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -584,7 +584,7 @@ @ cdecl _makepath_s(ptr long str str str str) @ cdecl _malloc_base(long) @ cdecl _mbbtombc(long) -@ stub _mbbtombc_l +@ cdecl _mbbtombc_l(long ptr) @ cdecl _mbbtype(long long) @ cdecl _mbbtype_l(long long ptr) @ stub _mbcasemap
1
0
0
0
Bartosz Kosiorek : msvcrt: Add _ismbckata_l implementation.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 837da12929e34a226408ffaa26668ac1e342fc44 URL:
https://gitlab.winehq.org/wine/wine/-/commit/837da12929e34a226408ffaa26668a…
Author: Bartosz Kosiorek <gang65(a)poczta.onet.pl> Date: Thu Oct 27 17:29:53 2022 +0200 msvcrt: Add _ismbckata_l implementation. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/mbcs.c | 20 +++++++++++++++++--- dlls/msvcrt/msvcrt.spec | 2 +- dlls/ucrtbase/ucrtbase.spec | 4 ++-- 8 files changed, 25 insertions(+), 11 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index a4aff0cf408..34e8a98b146 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -985,7 +985,7 @@ @ cdecl _ismbchira(long) @ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) -@ stub _ismbckata_l +@ cdecl _ismbckata_l(long ptr) @ cdecl _ismbcl0(long) @ cdecl _ismbcl0_l(long ptr) @ cdecl _ismbcl1(long) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 00d8104af2c..738adcb5ced 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1331,7 +1331,7 @@ @ cdecl _ismbchira(long) @ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) -@ stub _ismbckata_l +@ cdecl _ismbckata_l(long ptr) @ cdecl _ismbcl0(long) @ cdecl _ismbcl0_l(long ptr) @ cdecl _ismbcl1(long) diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 5ac9c2bec2b..8aa35a0243b 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1337,7 +1337,7 @@ @ cdecl _ismbchira(long) @ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) -@ stub _ismbckata_l +@ cdecl _ismbckata_l(long ptr) @ cdecl _ismbcl0(long) @ cdecl _ismbcl0_l(long ptr) @ cdecl _ismbcl1(long) diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 1677b431da7..962a7bd5c63 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -657,7 +657,7 @@ @ cdecl _ismbchira(long) @ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) -@ stub _ismbckata_l +@ cdecl _ismbckata_l(long ptr) @ cdecl _ismbcl0(long) @ cdecl _ismbcl0_l(long ptr) @ cdecl _ismbcl1(long) diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index d760d57f490..52bd096d5d4 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -635,7 +635,7 @@ @ cdecl _ismbchira(long) @ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) -@ stub _ismbckata_l +@ cdecl _ismbckata_l(long ptr) @ cdecl _ismbcl0(long) @ cdecl _ismbcl0_l(long ptr) @ cdecl _ismbcl1(long) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index 969a2c56aaf..c1c92859522 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -1758,11 +1758,18 @@ int CDECL _ismbchira(unsigned int c) } /********************************************************************* - * _ismbckata(MSVCRT.@) + * _ismbckata_l(MSVCRT.@) */ -int CDECL _ismbckata(unsigned int c) +int CDECL _ismbckata_l(unsigned int c, _locale_t locale) { - if(get_mbcinfo()->mbcodepage == 932) + pthreadmbcinfo mbcinfo; + + if(locale) + mbcinfo = locale->mbcinfo; + else + mbcinfo = get_mbcinfo(); + + if(mbcinfo->mbcodepage == 932) { /* Japanese/Katakana, CP 932 */ return (c >= 0x8340 && c <= 0x8396 && c != 0x837f); @@ -1770,6 +1777,13 @@ int CDECL _ismbckata(unsigned int c) return 0; } +/********************************************************************* + * _ismbckata(MSVCRT.@) + */ +int CDECL _ismbckata(unsigned int c) +{ + return _ismbckata_l(c, NULL); +} /********************************************************************* * _ismbblead_l(MSVCRT.@) diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 4d59cad4f26..6be1aa1006b 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -606,7 +606,7 @@ @ cdecl _ismbchira(long) @ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) -# stub _ismbckata_l(long ptr) +@ cdecl _ismbckata_l(long ptr) @ cdecl _ismbcl0(long) @ cdecl _ismbcl0_l(long ptr) @ cdecl _ismbcl1(long) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 14729c68eda..75ef6446635 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -477,7 +477,7 @@ @ cdecl _ismbchira(long) @ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) -@ stub _ismbckata_l +@ cdecl _ismbckata_l(long ptr) @ cdecl _ismbcl0(long) @ cdecl _ismbcl0_l(long ptr) @ cdecl _ismbcl1(long) @@ -1076,7 +1076,7 @@ @ cdecl _o__ismbchira(long) _ismbchira @ cdecl _o__ismbchira_l(long ptr) _ismbchira_l @ cdecl _o__ismbckata(long) _ismbckata -@ stub _o__ismbckata_l +@ cdecl _o__ismbckata_l(long ptr) _ismbckata_l @ cdecl _o__ismbcl0(long) _ismbcl0 @ cdecl _o__ismbcl0_l(long ptr) _ismbcl0_l @ cdecl _o__ismbcl1(long) _ismbcl1
1
0
0
0
Bartosz Kosiorek : msvcrt: Add _ismbchira_l implementation.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 2f1e5453872dd6a2ff65fff7171d13e2c6ff9145 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2f1e5453872dd6a2ff65fff7171d13…
Author: Bartosz Kosiorek <gang65(a)poczta.onet.pl> Date: Thu Oct 27 17:29:50 2022 +0200 msvcrt: Add _ismbchira_l implementation. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/mbcs.c | 21 ++++++++++++++++++--- dlls/msvcrt/msvcrt.spec | 2 +- dlls/ucrtbase/ucrtbase.spec | 4 ++-- 8 files changed, 26 insertions(+), 11 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index e56913feaeb..a4aff0cf408 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -983,7 +983,7 @@ @ cdecl _ismbcgraph(long) @ cdecl _ismbcgraph_l(long ptr) @ cdecl _ismbchira(long) -@ stub _ismbchira_l +@ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) @ stub _ismbckata_l @ cdecl _ismbcl0(long) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index f64c6cf30b5..00d8104af2c 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1329,7 +1329,7 @@ @ cdecl _ismbcgraph(long) @ cdecl _ismbcgraph_l(long ptr) @ cdecl _ismbchira(long) -@ stub _ismbchira_l +@ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) @ stub _ismbckata_l @ cdecl _ismbcl0(long) diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 8e6a169a187..5ac9c2bec2b 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -1335,7 +1335,7 @@ @ cdecl _ismbcgraph(long) @ cdecl _ismbcgraph_l(long ptr) @ cdecl _ismbchira(long) -@ stub _ismbchira_l +@ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) @ stub _ismbckata_l @ cdecl _ismbcl0(long) diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 4bef365a7c8..1677b431da7 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -655,7 +655,7 @@ @ cdecl _ismbcgraph(long) @ cdecl _ismbcgraph_l(long ptr) @ cdecl _ismbchira(long) -@ stub _ismbchira_l +@ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) @ stub _ismbckata_l @ cdecl _ismbcl0(long) diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 19f9335f545..d760d57f490 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -633,7 +633,7 @@ @ cdecl _ismbcgraph(long) @ cdecl _ismbcgraph_l(long ptr) @ cdecl _ismbchira(long) -@ stub _ismbchira_l +@ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) @ stub _ismbckata_l @ cdecl _ismbcl0(long) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index e8194a690ad..969a2c56aaf 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -1730,11 +1730,18 @@ int CDECL _ismbcpunct(unsigned int ch) } /********************************************************************* - * _ismbchira(MSVCRT.@) + * _ismbchira_l(MSVCRT.@) */ -int CDECL _ismbchira(unsigned int c) +int CDECL _ismbchira_l(unsigned int c, _locale_t locale) { - if(get_mbcinfo()->mbcodepage == 932) + pthreadmbcinfo mbcinfo; + + if(locale) + mbcinfo = locale->mbcinfo; + else + mbcinfo = get_mbcinfo(); + + if(mbcinfo->mbcodepage == 932) { /* Japanese/Hiragana, CP 932 */ return (c >= 0x829f && c <= 0x82f1); @@ -1742,6 +1749,14 @@ int CDECL _ismbchira(unsigned int c) return 0; } +/********************************************************************* + * _ismbchira(MSVCRT.@) + */ +int CDECL _ismbchira(unsigned int c) +{ + return _ismbchira_l(c, NULL); +} + /********************************************************************* * _ismbckata(MSVCRT.@) */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 5ed054df51f..4d59cad4f26 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -604,7 +604,7 @@ @ cdecl _ismbcgraph(long) @ cdecl _ismbcgraph_l(long ptr) @ cdecl _ismbchira(long) -# stub _ismbchira_l(long ptr) +@ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) # stub _ismbckata_l(long ptr) @ cdecl _ismbcl0(long) diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index e40a4ccaea5..14729c68eda 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -475,7 +475,7 @@ @ cdecl _ismbcgraph(long) @ cdecl _ismbcgraph_l(long ptr) @ cdecl _ismbchira(long) -@ stub _ismbchira_l +@ cdecl _ismbchira_l(long ptr) @ cdecl _ismbckata(long) @ stub _ismbckata_l @ cdecl _ismbcl0(long) @@ -1074,7 +1074,7 @@ @ cdecl _o__ismbcgraph(long) _ismbcgraph @ cdecl _o__ismbcgraph_l(long ptr) _ismbcgraph_l @ cdecl _o__ismbchira(long) _ismbchira -@ stub _o__ismbchira_l +@ cdecl _o__ismbchira_l(long ptr) _ismbchira_l @ cdecl _o__ismbckata(long) _ismbckata @ stub _o__ismbckata_l @ cdecl _o__ismbcl0(long) _ismbcl0
1
0
0
0
Nikolay Sivov : win32u: Move NtUserDragDetect() to window.c.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 9da3b23643e848b5073602a7f6e1b27b783f0a1f URL:
https://gitlab.winehq.org/wine/wine/-/commit/9da3b23643e848b5073602a7f6e1b2…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Oct 31 12:00:13 2022 +0300 win32u: Move NtUserDragDetect() to window.c. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/win32u/input.c | 45 --------------------------------------------- dlls/win32u/window.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index f3b724e7010..5ba7d151f57 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1394,51 +1394,6 @@ BOOL WINAPI NtUserTrackMouseEvent( TRACKMOUSEEVENT *info ) return TRUE; } -/******************************************************************* - * NtUserDragDetect (win32u.@) - */ -BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y ) -{ - WORD width, height; - RECT rect; - MSG msg; - - TRACE( "%p (%d,%d)\n", hwnd, x, y ); - - if (!(NtUserGetKeyState( VK_LBUTTON ) & 0x8000)) return FALSE; - - width = get_system_metrics( SM_CXDRAG ); - height = get_system_metrics( SM_CYDRAG ); - SetRect( &rect, x - width, y - height, x + width, y + height ); - - NtUserSetCapture( hwnd ); - - for (;;) - { - while (NtUserPeekMessage( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE )) - { - if (msg.message == WM_LBUTTONUP) - { - release_capture(); - return FALSE; - } - if (msg.message == WM_MOUSEMOVE) - { - POINT tmp; - tmp.x = (short)LOWORD( msg.lParam ); - tmp.y = (short)HIWORD( msg.lParam ); - if (!PtInRect( &rect, tmp )) - { - release_capture(); - return TRUE; - } - } - } - NtUserMsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, QS_ALLINPUT, 0 ); - } - return FALSE; -} - /********************************************************************** * set_capture_window */ diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 1672c4b02a0..27d4f63272d 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5540,6 +5540,51 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) } } +/******************************************************************* + * NtUserDragDetect (win32u.@) + */ +BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y ) +{ + WORD width, height; + RECT rect; + MSG msg; + + TRACE( "%p (%d,%d)\n", hwnd, x, y ); + + if (!(NtUserGetKeyState( VK_LBUTTON ) & 0x8000)) return FALSE; + + width = get_system_metrics( SM_CXDRAG ); + height = get_system_metrics( SM_CYDRAG ); + SetRect( &rect, x - width, y - height, x + width, y + height ); + + NtUserSetCapture( hwnd ); + + for (;;) + { + while (NtUserPeekMessage( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE )) + { + if (msg.message == WM_LBUTTONUP) + { + release_capture(); + return FALSE; + } + if (msg.message == WM_MOUSEMOVE) + { + POINT tmp; + tmp.x = (short)LOWORD( msg.lParam ); + tmp.y = (short)HIWORD( msg.lParam ); + if (!PtInRect( &rect, tmp )) + { + release_capture(); + return TRUE; + } + } + } + NtUserMsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, QS_ALLINPUT, 0 ); + } + return FALSE; +} + /******************************************************************* * NtUserDragObject (win32u.@) */
1
0
0
0
Nikolay Sivov : user32: Add DragObject() stub.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 645326214f0ef263e0fd8cf4758b67f74977fbf3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/645326214f0ef263e0fd8cf4758b67…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Oct 30 22:00:23 2022 +0300 user32: Add DragObject() stub. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53768
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/user32/user32.spec | 2 +- dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/window.c | 10 ++++++++++ dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 11 +++++++++++ include/ntuser.h | 1 + 7 files changed, 26 insertions(+), 2 deletions(-) diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 1bf3ebdc90d..4f15b4c06e5 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -182,7 +182,7 @@ @ stdcall DlgDirSelectExA(long ptr long long) @ stdcall DlgDirSelectExW(long ptr long long) @ stdcall DragDetect(long int64) -@ stub DragObject +@ stdcall DragObject(long long long long long) NtUserDragObject @ stdcall DrawAnimatedRects(long long ptr ptr) @ stdcall DrawCaption(long long ptr long) @ stdcall DrawCaptionTempA(long long ptr long long str long) diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index ec21f7f5984..ec6cd859ff6 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -141,6 +141,7 @@ static void * const syscalls[] = NtUserDispatchMessage, NtUserDisplayConfigGetDeviceInfo, NtUserDragDetect, + NtUserDragObject, NtUserDrawIconEx, NtUserEmptyClipboard, NtUserEnableMenuItem, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 8a3344257ed..3771dafcf76 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -846,7 +846,7 @@ @ stub NtUserDoSoundDisconnect @ stub NtUserDownlevelTouchpad @ stdcall -syscall NtUserDragDetect(long long long) -@ stub NtUserDragObject +@ stdcall -syscall NtUserDragObject(long long long long long) @ stub NtUserDrawAnimatedRects @ stub NtUserDrawCaption @ stdcall NtUserDrawCaptionTemp(long long ptr long long wstr long) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 5b87dcdf465..1672c4b02a0 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5539,3 +5539,13 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) return 0; } } + +/******************************************************************* + * NtUserDragObject (win32u.@) + */ +DWORD WINAPI NtUserDragObject( HWND parent, HWND hwnd, UINT fmt, ULONG_PTR data, HCURSOR cursor ) +{ + FIXME( "%p, %p, %u, %#lx, %p stub!\n", parent, hwnd, fmt, data, cursor ); + + return 0; +} diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 683e7978653..e9b63f365dd 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -127,6 +127,7 @@ SYSCALL_ENTRY( NtUserDispatchMessage ) \ SYSCALL_ENTRY( NtUserDisplayConfigGetDeviceInfo ) \ SYSCALL_ENTRY( NtUserDragDetect ) \ + SYSCALL_ENTRY( NtUserDragObject ) \ SYSCALL_ENTRY( NtUserDrawIconEx ) \ SYSCALL_ENTRY( NtUserEmptyClipboard ) \ SYSCALL_ENTRY( NtUserEnableMenuItem ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 8d15c84ac30..e1454347ecf 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -1558,6 +1558,17 @@ NTSTATUS WINAPI wow64_NtUserDragDetect( UINT *args ) return NtUserDragDetect( hwnd, x, y ); } +NTSTATUS WINAPI wow64_NtUserDragObject( UINT *args ) +{ + HWND parent = get_handle( &args ); + HWND hwnd = get_handle( &args ); + UINT fmt = get_ulong( &args ); + ULONG_PTR data = get_ulong( &args ); + HCURSOR hcursor = get_handle( &args ); + + return NtUserDragObject( parent, hwnd, fmt, data, hcursor ); +} + NTSTATUS WINAPI wow64_NtUserDrawIconEx( UINT *args ) { HDC hdc = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 1ec4898dcd1..7759f2b3174 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -679,6 +679,7 @@ BOOL WINAPI NtUserDisableThreadIme( DWORD thread_id ); LRESULT WINAPI NtUserDispatchMessage( const MSG *msg ); NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEADER *packet ); BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y ); +DWORD WINAPI NtUserDragObject( HWND parent, HWND hwnd, UINT fmt, ULONG_PTR data, HCURSOR cursor ); BOOL WINAPI NtUserDrawCaptionTemp( HWND hwnd, HDC hdc, const RECT *rect, HFONT font, HICON icon, const WCHAR *str, UINT flags ); BOOL WINAPI NtUserDrawIconEx( HDC hdc, INT x0, INT y0, HICON icon, INT width,
1
0
0
0
Alexandre Julliard : makedep: Remove arch directories on distclean.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: abee72f32dbca311764aeafd7ad1b76efcad28a5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/abee72f32dbca311764aeafd7ad1b7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 31 12:30:07 2022 +0100 makedep: Remove arch directories on distclean. --- tools/makedep.c | 59 ++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 21ea7fa9820..82cd37934b5 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -436,19 +436,19 @@ static void output_filenames( struct strarray array ) /******************************************************************* * output_rm_filenames */ -static void output_rm_filenames( struct strarray array ) +static void output_rm_filenames( struct strarray array, const char *command ) { static const unsigned int max_cmdline = 30000; /* to be on the safe side */ unsigned int i, len; if (!array.count) return; - output( "\trm -f" ); + output( "\t%s", command ); for (i = len = 0; i < array.count; i++) { if (len > max_cmdline) { output( "\n" ); - output( "\trm -f" ); + output( "\t%s", command ); len = 0; } output_filename( array.str[i] ); @@ -2600,6 +2600,30 @@ static int cmp_string_length( const char **a, const char **b ) return strcmp( *a, *b ); } +/******************************************************************* + * get_removable_dirs + * + * Retrieve a list of directories to try to remove after deleting the files. + */ +static struct strarray get_removable_dirs( struct strarray files ) +{ + struct strarray dirs = empty_strarray; + unsigned int i; + + for (i = 0; i < files.count; i++) + { + char *dir = xstrdup( files.str[i] ); + while (strchr( dir, '/' )) + { + *strrchr( dir, '/' ) = 0; + strarray_add_uniq( &dirs, xstrdup(dir) ); + } + } + strarray_qsort( &dirs, cmp_string_length ); + return dirs; +} + + /******************************************************************* * output_uninstall_rules */ @@ -2608,25 +2632,16 @@ static void output_uninstall_rules( struct makefile *make ) static const char *dirs_order[] = { "$(includedir)", "$(mandir)", "$(fontdir)", "$(nlsdir)", "$(datadir)", "$(dlldir)" }; - struct strarray uninstall_dirs = empty_strarray; + struct strarray uninstall_dirs; unsigned int i, j; if (!make->uninstall_files.count) return; output( "uninstall::\n" ); - output_rm_filenames( make->uninstall_files ); + output_rm_filenames( make->uninstall_files, "rm -f" ); strarray_add_uniq( &make->phony_targets, "uninstall" ); if (!subdirs.count) return; - for (i = 0; i < make->uninstall_files.count; i++) - { - char *dir = xstrdup( make->uninstall_files.str[i] ); - while (strchr( dir, '/' )) - { - *strrchr( dir, '/' ) = 0; - strarray_add_uniq( &uninstall_dirs, xstrdup(dir) ); - } - } - strarray_qsort( &uninstall_dirs, cmp_string_length ); + uninstall_dirs = get_removable_dirs( make->uninstall_files ); output( "\t-rmdir" ); for (i = 0; i < ARRAY_SIZE(dirs_order); i++) { @@ -3664,6 +3679,7 @@ static void output_subdirs( struct makefile *make ) struct strarray clean_files = empty_strarray; struct strarray testclean_files = empty_strarray; struct strarray distclean_files = empty_strarray; + struct strarray distclean_dirs = empty_strarray; struct strarray dependencies = empty_strarray; struct strarray install_deps[NB_INSTALL_RULES] = { empty_strarray }; struct strarray tooldeps_deps = empty_strarray; @@ -3675,12 +3691,16 @@ static void output_subdirs( struct makefile *make ) for (arch = 0; arch < archs.count; arch++) strarray_addall( &all_targets, make->all_targets[arch] ); for (i = 0; i < subdirs.count; i++) { + struct strarray subclean = empty_strarray; + strarray_addall( &subclean, get_removable_dirs( submakes[i]->clean_files )); + strarray_addall( &subclean, get_removable_dirs( submakes[i]->distclean_files )); strarray_add( &makefile_deps, src_dir_path( submakes[i], "Makefile.in" )); strarray_addall_uniq( &make->phony_targets, submakes[i]->phony_targets ); strarray_addall_uniq( &make->uninstall_files, submakes[i]->uninstall_files ); strarray_addall_uniq( &dependencies, submakes[i]->dependencies ); strarray_addall_path( &clean_files, submakes[i]->obj_dir, submakes[i]->clean_files ); strarray_addall_path( &distclean_files, submakes[i]->obj_dir, submakes[i]->distclean_files ); + strarray_addall_path( &distclean_dirs, submakes[i]->obj_dir, subclean ); strarray_addall_path( &make->maintainerclean_files, submakes[i]->obj_dir, submakes[i]->maintainerclean_files ); strarray_addall_path( &testclean_files, submakes[i]->obj_dir, submakes[i]->ok_files ); strarray_addall_path( &make->pot_files, submakes[i]->obj_dir, submakes[i]->pot_files ); @@ -3740,13 +3760,14 @@ static void output_subdirs( struct makefile *make ) if (get_expanded_make_variable( make, "GETTEXTPO_LIBS" )) output_po_files( make ); output( "clean::\n"); - output_rm_filenames( clean_files ); + output_rm_filenames( clean_files, "rm -f" ); output( "testclean::\n"); - output_rm_filenames( testclean_files ); + output_rm_filenames( testclean_files, "rm -f" ); output( "distclean::\n"); - output_rm_filenames( distclean_files ); + output_rm_filenames( distclean_files, "rm -f" ); + output_rm_filenames( distclean_dirs, "-rmdir 2>/dev/null" ); output( "maintainer-clean::\n"); - output_rm_filenames( make->maintainerclean_files ); + output_rm_filenames( make->maintainerclean_files, "rm -f" ); strarray_add_uniq( &make->phony_targets, "distclean" ); strarray_add_uniq( &make->phony_targets, "testclean" ); strarray_add_uniq( &make->phony_targets, "maintainer-clean" );
1
0
0
0
Alexandre Julliard : configure: Remove no longer needed check for dlltool.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 37910bebfd33bcf7ab4803663c570bccf9f3ee1a URL:
https://gitlab.winehq.org/wine/wine/-/commit/37910bebfd33bcf7ab4803663c570b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 31 12:28:41 2022 +0100 configure: Remove no longer needed check for dlltool. --- configure | 104 -------------------------------------------------------- configure.ac | 1 - tools/makedep.c | 2 -- 3 files changed, 107 deletions(-) diff --git a/configure b/configure index 0a2e5964f64..a5a4debb40f 100755 --- a/configure +++ b/configure @@ -761,7 +761,6 @@ COREFOUNDATION_LIBS ac_ct_OBJC OBJCFLAGS OBJC -DLLTOOL WINELOADER_PROGRAMS CONFIGURE_TARGETS DISABLED_SUBDIRS @@ -9461,108 +9460,6 @@ libwine_soversion=`expr $libwine_version : '\([0-9]*\)\..*'` case $host_os in cygwin*|mingw32*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_DLLTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -printf "%s\n" "$DLLTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_DLLTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -printf "%s\n" "$ac_ct_DLLTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - LIBEXT="dll" EXTRACFLAGS="-D__WINE_PE_BUILD" case $host_cpu in @@ -23244,7 +23141,6 @@ SUBDIRS = $SUBDIRS DISABLED_SUBDIRS = $DISABLED_SUBDIRS CONFIGURE_TARGETS = $CONFIGURE_TARGETS WINELOADER_PROGRAMS = $WINELOADER_PROGRAMS -DLLTOOL = $DLLTOOL OBJC = $OBJC OBJCFLAGS = $OBJCFLAGS ac_ct_OBJC = $ac_ct_OBJC diff --git a/configure.ac b/configure.ac index e11f3cfdb63..10c773908be 100644 --- a/configure.ac +++ b/configure.ac @@ -667,7 +667,6 @@ libwine_soversion=`expr $libwine_version : '\([[0-9]]*\)\..*'` case $host_os in cygwin*|mingw32*) - AC_CHECK_TOOL(DLLTOOL,dlltool,false) LIBEXT="dll" EXTRACFLAGS="-D__WINE_PE_BUILD" dnl Disable stdcall fixups to catch prototype mismatches diff --git a/tools/makedep.c b/tools/makedep.c index 86a6493a33f..21ea7fa9820 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -157,7 +157,6 @@ static const char *ar; static const char *ranlib; static const char *rsvg; static const char *icotool; -static const char *dlltool; static const char *msgfmt; static const char *ln_s; static const char *sed_cmd; @@ -4480,7 +4479,6 @@ int main( int argc, char *argv[] ) ranlib = get_expanded_make_variable( top_makefile, "RANLIB" ); rsvg = get_expanded_make_variable( top_makefile, "RSVG" ); icotool = get_expanded_make_variable( top_makefile, "ICOTOOL" ); - dlltool = get_expanded_make_variable( top_makefile, "DLLTOOL" ); msgfmt = get_expanded_make_variable( top_makefile, "MSGFMT" ); sed_cmd = get_expanded_make_variable( top_makefile, "SED_CMD" ); ln_s = get_expanded_make_variable( top_makefile, "LN_S" );
1
0
0
0
Akihiro Sagawa : shell32: Returns a number of copied bytes in DropQueryFileA.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: f88fecf80ffaad9e12c92326c3c9b72e5d6898b3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f88fecf80ffaad9e12c92326c3c9b7…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Oct 30 16:28:48 2022 +0900 shell32: Returns a number of copied bytes in DropQueryFileA. --- dlls/shell32/shellole.c | 4 ++-- dlls/shell32/tests/shellole.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index 45ff2a5410c..29d973bf165 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -583,10 +583,10 @@ UINT WINAPI DragQueryFileA(HDROP hDrop, UINT lFile, LPSTR lpszFile, UINT lLength } filename = malloc(i); if (!filename) goto error; - WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, i, NULL, NULL); + i = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, i, NULL, NULL); - i = strlen(filename); lstrcpynA(lpszFile, filename, lLength); + i = min(i, lLength) - 1; end: free(filenameW); free(filename); diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 6d9d348dc6e..4864d35ea9a 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -796,7 +796,7 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA memset(filename, 0xaa, sizeof(filename)); num = DragQueryFileA(hDrop, 0, filename, 2); - todo_wine ok(num == 1, "expected 1, got %u\n", num); + ok(num == 1, "expected 1, got %u\n", num); ok(filename[0] == expected_filename[0], "expected '%c', got '%c'\n", expected_filename[0], filename[0]); ok(filename[1] == '\0', "expected nul, got %#x\n", (BYTE)filename[1]);
1
0
0
0
Akihiro Sagawa : shell32: Returns a number of copied characters in DropQueryFileW.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 205f952db1cf2f508cb5defc4d365dec410c6a8c URL:
https://gitlab.winehq.org/wine/wine/-/commit/205f952db1cf2f508cb5defc4d365d…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Oct 30 16:21:50 2022 +0900 shell32: Returns a number of copied characters in DropQueryFileW. --- dlls/shell32/shellole.c | 3 ++- dlls/shell32/tests/shellole.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index 4f9d0db7ff6..45ff2a5410c 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -652,8 +652,9 @@ UINT WINAPI DragQueryFileW( } i = lstrlenW(filename); - if ( !lpszwFile) goto end; /* needed buffer size */ + if (!lpszwFile || !lLength) goto end; /* needed buffer size */ lstrcpynW(lpszwFile, filename, lLength); + i = min(i, lLength - 1); end: GlobalUnlock(hDrop); free(buffer); diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index ca156ebda62..6d9d348dc6e 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -819,7 +819,7 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA memset(filenameW, 0xaa, sizeof(filenameW)); num = DragQueryFileW(hDrop, 0, filenameW, 2); - todo_wine ok(num == 1, "expected 1, got %u\n", num); + ok(num == 1, "expected 1, got %u\n", num); ok(filenameW[0] == expected_filenameW[0], "expected '%lc', got '%lc'\n", expected_filenameW[0], filenameW[0]); ok(filenameW[1] == L'\0', "expected nul, got %#x\n", (WCHAR)filenameW[1]);
1
0
0
0
Akihiro Sagawa : shell32: Reimplement DragQueryFileA to rely on its Unicode version.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 9f61e1e593f69dee98921f172ca1e8880442d73c URL:
https://gitlab.winehq.org/wine/wine/-/commit/9f61e1e593f69dee98921f172ca1e8…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Oct 30 15:41:08 2022 +0900 shell32: Reimplement DragQueryFileA to rely on its Unicode version. Now, it returns a correct buffer size especially for a DBCS file name. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53738
--- dlls/shell32/shellole.c | 72 +++++++++++++++++-------------------------- dlls/shell32/tests/shellole.c | 3 -- 2 files changed, 28 insertions(+), 47 deletions(-) diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index 0ee5c95402b..4f9d0db7ff6 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -560,56 +560,40 @@ BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p) * DragQueryFileA [SHELL32.@] * DragQueryFile [SHELL32.@] */ -UINT WINAPI DragQueryFileA( - HDROP hDrop, - UINT lFile, - LPSTR lpszFile, - UINT lLength) +UINT WINAPI DragQueryFileA(HDROP hDrop, UINT lFile, LPSTR lpszFile, UINT lLength) { - LPSTR lpDrop; - UINT i = 0; - DROPFILES *lpDropFileStruct = GlobalLock(hDrop); - - TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszFile,lLength); + LPWSTR filenameW = NULL; + LPSTR filename = NULL; + UINT i; - if(!lpDropFileStruct) goto end; + TRACE("(%p, %x, %p, %u)\n", hDrop, lFile, lpszFile, lLength); - lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles; - - if(lpDropFileStruct->fWide) { - LPWSTR lpszFileW = NULL; - - if(lpszFile && lFile != 0xFFFFFFFF) { - lpszFileW = malloc(lLength * sizeof(WCHAR)); - if(lpszFileW == NULL) { - goto end; - } - } - i = DragQueryFileW(hDrop, lFile, lpszFileW, lLength); + i = DragQueryFileW(hDrop, lFile, NULL, 0); + if (!i || lFile == 0xFFFFFFFF) goto end; + filenameW = malloc((i + 1) * sizeof(WCHAR)); + if (!filenameW) goto error; + if (!DragQueryFileW(hDrop, lFile, filenameW, i + 1)) goto error; - if(lpszFileW) { - WideCharToMultiByte(CP_ACP, 0, lpszFileW, -1, lpszFile, lLength, 0, NULL); - free(lpszFileW); - } - goto end; - } - - while (i++ < lFile) - { - while (*lpDrop++); /* skip filename */ - if (!*lpDrop) - { - i = (lFile == 0xFFFFFFFF) ? i : 0; - goto end; - } - } + i = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, NULL, 0, NULL, NULL); + if (!lpszFile || !lLength) + { + /* minus a trailing null */ + i--; + goto end; + } + filename = malloc(i); + if (!filename) goto error; + WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, i, NULL, NULL); - i = strlen(lpDrop); - if (!lpszFile ) goto end; /* needed buffer size */ - lstrcpynA (lpszFile, lpDrop, lLength); + i = strlen(filename); + lstrcpynA(lpszFile, filename, lLength); end: - GlobalUnlock(hDrop); - return i; + free(filenameW); + free(filename); + return i; +error: + i = 0; + goto end; } /************************************************************************* diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 7d1204d1c1f..ca156ebda62 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -783,16 +783,13 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA len = strlen(expected_filename); num = DragQueryFileA(hDrop, 0, NULL, 0); - todo_wine_if(expected_filename[0] == 'd' && (flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); num = DragQueryFileA(hDrop, 0, filename, 0); - todo_wine_if(expected_filename[0] == 'd' && (flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); ok(!strcmp(filename, "dummy"), "got %s\n", filename); num = DragQueryFileA(hDrop, 0, filename, sizeof(filename)); - todo_wine_if(expected_filename[0] == 'd' && (flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); ok(!strcmp(filename, expected_filename), "expected %s, got %s\n", expected_filename, filename);
1
0
0
0
Akihiro Sagawa : shell32: Merge ANSI part of DROPFILES handler into DragQueryFileW.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 3389ba479b9c2d8ac2b76d8a1e0862bb0d070f8b URL:
https://gitlab.winehq.org/wine/wine/-/commit/3389ba479b9c2d8ac2b76d8a1e0862…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sat Oct 29 17:49:15 2022 +0900 shell32: Merge ANSI part of DROPFILES handler into DragQueryFileW. --- dlls/shell32/shellole.c | 66 ++++++++++++++++++++++++------------------- dlls/shell32/tests/shellole.c | 3 -- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index 055244b1e67..0ee5c95402b 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -621,50 +621,58 @@ UINT WINAPI DragQueryFileW( LPWSTR lpszwFile, UINT lLength) { - LPWSTR lpwDrop; + LPWSTR buffer = NULL; + LPCWSTR filename; UINT i = 0; - DROPFILES *lpDropFileStruct = GlobalLock(hDrop); + const DROPFILES *lpDropFileStruct = GlobalLock(hDrop); TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength); if(!lpDropFileStruct) goto end; - lpwDrop = (LPWSTR) ((LPSTR)lpDropFileStruct + lpDropFileStruct->pFiles); - - if(lpDropFileStruct->fWide == FALSE) { - LPSTR lpszFileA = NULL; - - if(lpszwFile && lFile != 0xFFFFFFFF) { - lpszFileA = malloc(lLength); - if(lpszFileA == NULL) { + if(lpDropFileStruct->fWide) + { + LPCWSTR p = (LPCWSTR) ((LPCSTR)lpDropFileStruct + lpDropFileStruct->pFiles); + while (i++ < lFile) + { + while (*p++); /* skip filename */ + if (!*p) + { + i = (lFile == 0xFFFFFFFF) ? i : 0; goto end; } } - i = DragQueryFileA(hDrop, lFile, lpszFileA, lLength); - - if(lpszFileA) { - MultiByteToWideChar(CP_ACP, 0, lpszFileA, -1, lpszwFile, lLength); - free(lpszFileA); + filename = p; + } + else + { + LPCSTR p = (LPCSTR)lpDropFileStruct + lpDropFileStruct->pFiles; + while (i++ < lFile) + { + while (*p++); /* skip filename */ + if (!*p) + { + i = (lFile == 0xFFFFFFFF) ? i : 0; + goto end; + } } - goto end; + i = MultiByteToWideChar(CP_ACP, 0, p, -1, NULL, 0); + buffer = malloc(i * sizeof(WCHAR)); + if (!buffer) + { + i = 0; + goto end; + } + MultiByteToWideChar(CP_ACP, 0, p, -1, buffer, i); + filename = buffer; } - i = 0; - while (i++ < lFile) - { - while (*lpwDrop++); /* skip filename */ - if (!*lpwDrop) - { - i = (lFile == 0xFFFFFFFF) ? i : 0; - goto end; - } - } - - i = lstrlenW(lpwDrop); + i = lstrlenW(filename); if ( !lpszwFile) goto end; /* needed buffer size */ - lstrcpynW (lpszwFile, lpwDrop, lLength); + lstrcpynW(lpszwFile, filename, lLength); end: GlobalUnlock(hDrop); + free(buffer); return i; } diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 0b1146ba8bb..7d1204d1c1f 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -809,16 +809,13 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA len = wcslen(expected_filenameW); num = DragQueryFileW(hDrop, 0, NULL, 0); - todo_wine_if(expected_filename[0] == 'd' && !(flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); num = DragQueryFileW(hDrop, 0, filenameW, 0); - todo_wine_if(expected_filename[0] == 'd' && !(flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); ok(!wcscmp(filenameW, L"dummy"), "got %s\n", wine_dbgstr_w(filenameW)); num = DragQueryFileW(hDrop, 0, filenameW, ARRAY_SIZE(filename)); - todo_wine_if(expected_filename[0] == 'd' && !(flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); ok(!wcscmp(filenameW, expected_filenameW), "expected %s, got %s\n", wine_dbgstr_w(expected_filenameW), wine_dbgstr_w(filenameW));
1
0
0
0
Akihiro Sagawa : shell32/tests: Add more DragQueryFile tests.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 2176e83060678e4734cbe0f78de2e023bf832e34 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2176e83060678e4734cbe0f78de2e0…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sat Oct 29 21:24:16 2022 +0900 shell32/tests: Add more DragQueryFile tests. --- dlls/shell32/tests/shellole.c | 64 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 1129b603201..0b1146ba8bb 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -746,6 +746,8 @@ static void test_SHCreateQueryCancelAutoPlayMoniker(void) } #define WM_EXPECTED_VALUE WM_APP +#define DROP_NC_AREA 1 +#define DROP_WIDE_FILENAME 2 struct DragParam { HWND hwnd; HANDLE ready; @@ -753,24 +755,25 @@ struct DragParam { static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { - static BOOL expected; + static DWORD flags; static char expected_filename[MAX_PATH]; switch (msg) { case WM_EXPECTED_VALUE: { lstrcpynA(expected_filename, (const char*)wparam, sizeof(expected_filename)); - expected = lparam; + flags = lparam; break; } case WM_DROPFILES: { HDROP hDrop = (HDROP)wparam; char filename[MAX_PATH] = "dummy"; + WCHAR filenameW[MAX_PATH] = L"dummy", expected_filenameW[MAX_PATH]; POINT pt; BOOL r; UINT num, len; - winetest_push_context("%s", wine_dbgstr_a(expected_filename)); + winetest_push_context("%s(%lu)", wine_dbgstr_a(expected_filename), flags); num = DragQueryFileA(hDrop, 0xffffffff, NULL, 0); ok(num == 1, "expected 1, got %u\n", num); @@ -780,16 +783,16 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA len = strlen(expected_filename); num = DragQueryFileA(hDrop, 0, NULL, 0); - todo_wine_if(expected_filename[0] == 'd') + todo_wine_if(expected_filename[0] == 'd' && (flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); num = DragQueryFileA(hDrop, 0, filename, 0); - todo_wine_if(expected_filename[0] == 'd') + todo_wine_if(expected_filename[0] == 'd' && (flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); ok(!strcmp(filename, "dummy"), "got %s\n", filename); num = DragQueryFileA(hDrop, 0, filename, sizeof(filename)); - todo_wine_if(expected_filename[0] == 'd') + todo_wine_if(expected_filename[0] == 'd' && (flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); ok(!strcmp(filename, expected_filename), "expected %s, got %s\n", expected_filename, filename); @@ -801,8 +804,34 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA expected_filename[0], filename[0]); ok(filename[1] == '\0', "expected nul, got %#x\n", (BYTE)filename[1]); + MultiByteToWideChar(CP_ACP, 0, expected_filename, -1, + expected_filenameW, ARRAY_SIZE(expected_filenameW)); + + len = wcslen(expected_filenameW); + num = DragQueryFileW(hDrop, 0, NULL, 0); + todo_wine_if(expected_filename[0] == 'd' && !(flags & DROP_WIDE_FILENAME)) + ok(num == len, "expected %u, got %u\n", len, num); + + num = DragQueryFileW(hDrop, 0, filenameW, 0); + todo_wine_if(expected_filename[0] == 'd' && !(flags & DROP_WIDE_FILENAME)) + ok(num == len, "expected %u, got %u\n", len, num); + ok(!wcscmp(filenameW, L"dummy"), "got %s\n", wine_dbgstr_w(filenameW)); + + num = DragQueryFileW(hDrop, 0, filenameW, ARRAY_SIZE(filename)); + todo_wine_if(expected_filename[0] == 'd' && !(flags & DROP_WIDE_FILENAME)) + ok(num == len, "expected %u, got %u\n", len, num); + ok(!wcscmp(filenameW, expected_filenameW), "expected %s, got %s\n", + wine_dbgstr_w(expected_filenameW), wine_dbgstr_w(filenameW)); + + memset(filenameW, 0xaa, sizeof(filenameW)); + num = DragQueryFileW(hDrop, 0, filenameW, 2); + todo_wine ok(num == 1, "expected 1, got %u\n", num); + ok(filenameW[0] == expected_filenameW[0], "expected '%lc', got '%lc'\n", + expected_filenameW[0], filenameW[0]); + ok(filenameW[1] == L'\0', "expected nul, got %#x\n", (WCHAR)filenameW[1]); + r = DragQueryPoint(hDrop, &pt); - ok(r == expected, "expected %d, got %d\n", expected, r); + ok(r == !(flags & DROP_NC_AREA), "expected %d, got %d\n", !(flags & DROP_NC_AREA), r); ok(pt.x == 10, "expected 10, got %ld\n", pt.x); ok(pt.y == 20, "expected 20, got %ld\n", pt.y); DragFinish(hDrop); @@ -909,7 +938,24 @@ static void test_DragQueryFile(BOOL non_client_flag) GlobalUnlock(hDrop); r = PostMessageA(param.hwnd, WM_EXPECTED_VALUE, - (WPARAM)testcase[i].filename, !non_client_flag); + (WPARAM)testcase[i].filename, DROP_WIDE_FILENAME | (non_client_flag ? DROP_NC_AREA : 0)); + ok(r, "got %d\n", r); + + r = PostMessageA(param.hwnd, WM_DROPFILES, (WPARAM)hDrop, 0); + ok(r, "got %d\n", r); + + hDrop = GlobalAlloc(GHND, sizeof(DROPFILES) + strlen(testcase[i].filename) + 2); + pDrop = GlobalLock(hDrop); + pDrop->pt.x = 10; + pDrop->pt.y = 20; + pDrop->fNC = non_client_flag; + pDrop->pFiles = sizeof(DROPFILES); + strcpy((char *)(pDrop + 1), testcase[i].filename); + pDrop->fWide = FALSE; + GlobalUnlock(hDrop); + + r = PostMessageA(param.hwnd, WM_EXPECTED_VALUE, + (WPARAM)testcase[i].filename, non_client_flag ? DROP_NC_AREA : 0); ok(r, "got %d\n", r); r = PostMessageA(param.hwnd, WM_DROPFILES, (WPARAM)hDrop, 0); @@ -928,6 +974,8 @@ static void test_DragQueryFile(BOOL non_client_flag) CloseHandle(hThread); } #undef WM_EXPECTED_VALUE +#undef DROP_NC_AREA +#undef DROP_WIDE_FILENAME static void test_SHCreateSessionKey(void) {
1
0
0
0
Akihiro Sagawa : shell32/tests: Add DBCS file name tests for DragQueryFile.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 3ef081593c0d8e7d140eb446e3270ffeb5cf3daf URL:
https://gitlab.winehq.org/wine/wine/-/commit/3ef081593c0d8e7d140eb446e3270f…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Tue Oct 25 21:33:07 2022 +0900 shell32/tests: Add DBCS file name tests for DragQueryFile. --- dlls/shell32/tests/shellole.c | 92 ++++++++++++++++++++++++++++++++----------- 1 file changed, 70 insertions(+), 22 deletions(-) diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 5f0c2ea1bca..1129b603201 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -746,7 +746,6 @@ static void test_SHCreateQueryCancelAutoPlayMoniker(void) } #define WM_EXPECTED_VALUE WM_APP -#define DROPTEST_FILENAME "c:\\wintest.bin" struct DragParam { HWND hwnd; HANDLE ready; @@ -755,10 +754,12 @@ struct DragParam { static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { static BOOL expected; + static char expected_filename[MAX_PATH]; switch (msg) { case WM_EXPECTED_VALUE: { + lstrcpynA(expected_filename, (const char*)wparam, sizeof(expected_filename)); expected = lparam; break; } @@ -768,19 +769,44 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA char filename[MAX_PATH] = "dummy"; POINT pt; BOOL r; - UINT num; + UINT num, len; + winetest_push_context("%s", wine_dbgstr_a(expected_filename)); + num = DragQueryFileA(hDrop, 0xffffffff, NULL, 0); ok(num == 1, "expected 1, got %u\n", num); + num = DragQueryFileA(hDrop, 0xffffffff, (char*)0xdeadbeef, 0xffffffff); ok(num == 1, "expected 1, got %u\n", num); + + len = strlen(expected_filename); + num = DragQueryFileA(hDrop, 0, NULL, 0); + todo_wine_if(expected_filename[0] == 'd') + ok(num == len, "expected %u, got %u\n", len, num); + + num = DragQueryFileA(hDrop, 0, filename, 0); + todo_wine_if(expected_filename[0] == 'd') + ok(num == len, "expected %u, got %u\n", len, num); + ok(!strcmp(filename, "dummy"), "got %s\n", filename); + num = DragQueryFileA(hDrop, 0, filename, sizeof(filename)); - ok(num == strlen(DROPTEST_FILENAME), "got %u\n", num); - ok(!strcmp(filename, DROPTEST_FILENAME), "got %s\n", filename); + todo_wine_if(expected_filename[0] == 'd') + ok(num == len, "expected %u, got %u\n", len, num); + ok(!strcmp(filename, expected_filename), "expected %s, got %s\n", + expected_filename, filename); + + memset(filename, 0xaa, sizeof(filename)); + num = DragQueryFileA(hDrop, 0, filename, 2); + todo_wine ok(num == 1, "expected 1, got %u\n", num); + ok(filename[0] == expected_filename[0], "expected '%c', got '%c'\n", + expected_filename[0], filename[0]); + ok(filename[1] == '\0', "expected nul, got %#x\n", (BYTE)filename[1]); + r = DragQueryPoint(hDrop, &pt); ok(r == expected, "expected %d, got %d\n", expected, r); ok(pt.x == 10, "expected 10, got %ld\n", pt.x); ok(pt.y == 20, "expected 20, got %ld\n", pt.y); DragFinish(hDrop); + winetest_pop_context(); return 0; } } @@ -841,8 +867,15 @@ static void test_DragQueryFile(BOOL non_client_flag) DWORD rc; HGLOBAL hDrop; DROPFILES *pDrop; - int ret; + int ret, i; BOOL r; + static const struct { + UINT codepage; + const char* filename; + } testcase[] = { + { 0, "c:\\wintest.bin" }, + { 932, "d:\\\x89\xb9\x8a\x79_02.CHY" }, + }; param.ready = CreateEventA(NULL, FALSE, FALSE, NULL); ok(param.ready != NULL, "can't create event\n"); @@ -851,23 +884,39 @@ static void test_DragQueryFile(BOOL non_client_flag) rc = WaitForSingleObject(param.ready, 5000); ok(rc == WAIT_OBJECT_0, "got %lu\n", rc); - hDrop = GlobalAlloc(GHND, sizeof(DROPFILES) + (strlen(DROPTEST_FILENAME) + 2) * sizeof(WCHAR)); - pDrop = GlobalLock(hDrop); - pDrop->pt.x = 10; - pDrop->pt.y = 20; - pDrop->fNC = non_client_flag; - pDrop->pFiles = sizeof(DROPFILES); - ret = MultiByteToWideChar(CP_ACP, 0, DROPTEST_FILENAME, -1, - (LPWSTR)(pDrop + 1), strlen(DROPTEST_FILENAME) + 1); - ok(ret > 0, "got %d\n", ret); - pDrop->fWide = TRUE; - GlobalUnlock(hDrop); - - r = PostMessageA(param.hwnd, WM_EXPECTED_VALUE, 0, !non_client_flag); - ok(r, "got %d\n", r); + for (i = 0; i < ARRAY_SIZE(testcase); i++) + { + winetest_push_context("%d", i); + if (testcase[i].codepage && testcase[i].codepage != GetACP()) + { + skip("need codepage %u for this test\n", testcase[i].codepage); + winetest_pop_context(); + continue; + } - r = PostMessageA(param.hwnd, WM_DROPFILES, (WPARAM)hDrop, 0); - ok(r, "got %d\n", r); + ret = MultiByteToWideChar(CP_ACP, 0, testcase[i].filename, -1, NULL, 0); + ok(ret > 0, "got %d\n", ret); + hDrop = GlobalAlloc(GHND, sizeof(DROPFILES) + (ret + 1) * sizeof(WCHAR)); + pDrop = GlobalLock(hDrop); + pDrop->pt.x = 10; + pDrop->pt.y = 20; + pDrop->fNC = non_client_flag; + pDrop->pFiles = sizeof(DROPFILES); + ret = MultiByteToWideChar(CP_ACP, 0, testcase[i].filename, -1, + (LPWSTR)(pDrop + 1), ret); + ok(ret > 0, "got %d\n", ret); + pDrop->fWide = TRUE; + GlobalUnlock(hDrop); + + r = PostMessageA(param.hwnd, WM_EXPECTED_VALUE, + (WPARAM)testcase[i].filename, !non_client_flag); + ok(r, "got %d\n", r); + + r = PostMessageA(param.hwnd, WM_DROPFILES, (WPARAM)hDrop, 0); + ok(r, "got %d\n", r); + + winetest_pop_context(); + } r = PostMessageA(param.hwnd, WM_QUIT, 0, 0); ok(r, "got %d\n", r); @@ -879,7 +928,6 @@ static void test_DragQueryFile(BOOL non_client_flag) CloseHandle(hThread); } #undef WM_EXPECTED_VALUE -#undef DROPTEST_FILENAME static void test_SHCreateSessionKey(void) {
1
0
0
0
Nikolay Sivov : kernelbase: Add QueryVirtualMemoryInformation().
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 9cd5bc0d86d53c2db32c8025df99a487dad94850 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9cd5bc0d86d53c2db32c8025df99a4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jun 28 18:13:54 2022 +0300 kernelbase: Add QueryVirtualMemoryInformation(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/kernelbase/kernelbase.spec | 2 +- dlls/kernelbase/memory.c | 17 ++++++++++++++++ include/Makefile.in | 1 + include/memoryapi.h | 45 +++++++++++++++++++++++++++++++++++++++++ include/winbase.h | 1 + 5 files changed, 65 insertions(+), 1 deletion(-) diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index cbce448d3e9..c51dbd6bc73 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1250,7 +1250,7 @@ @ stdcall QueryThreadpoolStackInformation(ptr ptr) @ stdcall QueryUnbiasedInterruptTime(ptr) ntdll.RtlQueryUnbiasedInterruptTime # @ stub QueryUnbiasedInterruptTimePrecise -# @ stub QueryVirtualMemoryInformation +@ stdcall QueryVirtualMemoryInformation(long ptr long ptr long ptr) @ stdcall QueryWorkingSet(long ptr long) @ stdcall QueryWorkingSetEx(long ptr long) @ stdcall QueueUserAPC(ptr long long) diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c index 412d80f5cfd..19b1d0a3a1a 100644 --- a/dlls/kernelbase/memory.c +++ b/dlls/kernelbase/memory.c @@ -1411,6 +1411,23 @@ LPVOID WINAPI DECLSPEC_HOTPATCH VirtualAllocExNuma( HANDLE process, void *addr, } +/*********************************************************************** + * QueryVirtualMemoryInformation (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH QueryVirtualMemoryInformation( HANDLE process, const void *addr, + WIN32_MEMORY_INFORMATION_CLASS info_class, void *info, SIZE_T size, SIZE_T *ret_size) +{ + switch (info_class) + { + case MemoryRegionInfo: + return set_ntstatus( NtQueryVirtualMemory( process, addr, MemoryRegionInformation, info, size, ret_size )); + default: + FIXME("Unsupported info class %u.\n", info_class); + return FALSE; + } +} + + /*********************************************************************** * CPU functions ***********************************************************************/ diff --git a/include/Makefile.in b/include/Makefile.in index 1c04f9a298b..28ac4b3f2dc 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -416,6 +416,7 @@ SOURCES = \ mediaerr.h \ mediaobj.idl \ medparam.idl \ + memoryapi.h \ metahost.idl \ mfapi.h \ mfd3d12.idl \ diff --git a/include/memoryapi.h b/include/memoryapi.h new file mode 100644 index 00000000000..8743e67927c --- /dev/null +++ b/include/memoryapi.h @@ -0,0 +1,45 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +typedef enum WIN32_MEMORY_INFORMATION_CLASS +{ + MemoryRegionInfo +} WIN32_MEMORY_INFORMATION_CLASS; + +typedef struct WIN32_MEMORY_REGION_INFORMATION +{ + PVOID AllocationBase; + ULONG AllocationProtect; + union + { + ULONG Flags; + struct + { + ULONG Private : 1; + ULONG MappedDataFile : 1; + ULONG MappedImage : 1; + ULONG MappedPageFile : 1; + ULONG MappedPhysical : 1; + ULONG DirectMapped : 1; + ULONG Reserved : 26; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + SIZE_T RegionSize; + SIZE_T CommitSize; +} WIN32_MEMORY_REGION_INFORMATION; + +BOOL WINAPI QueryVirtualMemoryInformation(HANDLE process,const void *addr, + WIN32_MEMORY_INFORMATION_CLASS info_class, void *info, SIZE_T size, SIZE_T *ret_size); diff --git a/include/winbase.h b/include/winbase.h index 58f21a1361a..7c0d8afd36c 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -43,6 +43,7 @@ extern "C" { #include <processthreadsapi.h> #include <synchapi.h> #include <threadpoolapiset.h> +#include <memoryapi.h> /* Windows Exit Procedure flag values */ #define WEP_FREE_DLL 0
1
0
0
0
Nikolay Sivov : ntdll: Partially implement MemoryRegionInformation query.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: fc5cb9b577a66eab38ea61290bdac60ec36f80ec URL:
https://gitlab.winehq.org/wine/wine/-/commit/fc5cb9b577a66eab38ea61290bdac6…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jun 28 17:13:47 2022 +0300 ntdll: Partially implement MemoryRegionInformation query. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/ntdll/tests/virtual.c | 97 ++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/virtual.c | 115 ++++++++++++++++++++++++++++++--------------- dlls/wow64/struct32.h | 11 +++++ dlls/wow64/virtual.c | 23 +++++++++ include/winternl.h | 24 ++++++++++ 5 files changed, 233 insertions(+), 37 deletions(-)
1
0
0
0
Brendan Shanks : server: Only require THREAD_SET_LIMITED_INFORMATION access to set thread description.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 0d21e1cbcf705bb2cba3d59571bb8b730ba2feac URL:
https://gitlab.winehq.org/wine/wine/-/commit/0d21e1cbcf705bb2cba3d59571bb8b…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Tue Feb 15 12:09:25 2022 -0800 server: Only require THREAD_SET_LIMITED_INFORMATION access to set thread description. --- dlls/kernel32/tests/thread.c | 2 -- server/thread.c | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c index 0274cb6e266..25e5a0dc1da 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -2538,13 +2538,11 @@ static void test_thread_description(void) thread = OpenThread(THREAD_SET_LIMITED_INFORMATION, FALSE, GetCurrentThreadId()); hr = pSetThreadDescription(thread, desc); - todo_wine ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#lx.\n", hr); ptr = NULL; hr = pGetThreadDescription(GetCurrentThread(), &ptr); ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#lx.\n", hr); - todo_wine ok(!lstrcmpW(ptr, desc), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); LocalFree(ptr); diff --git a/server/thread.c b/server/thread.c index f49fbf40b78..c0fb0eef637 100644 --- a/server/thread.c +++ b/server/thread.c @@ -1534,8 +1534,10 @@ DECL_HANDLER(get_thread_times) DECL_HANDLER(set_thread_info) { struct thread *thread; + unsigned int access = (req->mask == SET_THREAD_INFO_DESCRIPTION) ? THREAD_SET_LIMITED_INFORMATION + : THREAD_SET_INFORMATION; - if ((thread = get_thread_from_handle( req->handle, THREAD_SET_INFORMATION ))) + if ((thread = get_thread_from_handle( req->handle, access ))) { set_thread_info( thread, req ); release_object( thread );
1
0
0
0
Paul Gofman : win32u: Implement NtUserDisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME).
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 21c373560fa8a8095fc0635844102fe73efc3b51 URL:
https://gitlab.winehq.org/wine/wine/-/commit/21c373560fa8a8095fc0635844102f…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Oct 24 17:43:28 2022 -0500 win32u: Implement NtUserDisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME). --- dlls/user32/tests/Makefile.in | 2 +- dlls/user32/tests/monitor.c | 63 ++++++++++++++++++++++++++++++++++++++++--- dlls/win32u/sysparams.c | 27 +++++++++++++++++-- 3 files changed, 86 insertions(+), 6 deletions(-) diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in index 344a3b66d2b..33c7f13f12d 100644 --- a/dlls/user32/tests/Makefile.in +++ b/dlls/user32/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = user32.dll -IMPORTS = user32 gdi32 advapi32 hid imm32 +IMPORTS = user32 gdi32 advapi32 hid imm32 setupapi C_SRCS = \ broadcast.c \ diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index 4b774037508..1dff85b9621 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -23,6 +23,8 @@ #include "ntstatus.h" #define WIN32_NO_STATUS +#include "initguid.h" + #include "wine/test.h" #include "winbase.h" #include "wingdi.h" @@ -30,9 +32,14 @@ #include "winreg.h" #include "winternl.h" #include "ddk/d3dkmthk.h" +#include "setupapi.h" +#include "ntddvdeo.h" #include "wine/heap.h" #include <stdio.h> +DEFINE_DEVPROPKEY(DEVPROPKEY_MONITOR_GPU_LUID, 0xca085853, 0x16ce, 0x48aa, 0xb1, 0x14, 0xde, 0x9c, 0x72, 0x33, 0x42, 0x23, 1); +DEFINE_DEVPROPKEY(DEVPROPKEY_MONITOR_OUTPUT_ID, 0xca085853, 0x16ce, 0x48aa, 0xb1, 0x14, 0xde, 0x9c, 0x72, 0x33, 0x42, 0x23, 2); + static LONG (WINAPI *pGetDisplayConfigBufferSizes)(UINT32,UINT32*,UINT32*); static BOOL (WINAPI *pGetDpiForMonitorInternal)(HMONITOR,UINT,UINT*,UINT*); static LONG (WINAPI *pQueryDisplayConfig)(UINT32,UINT32*,DISPLAYCONFIG_PATH_INFO*,UINT32*, @@ -1624,6 +1631,58 @@ static void test_EnumDisplayMonitors(void) ok(ret, "CloseWindowStation failed, error %#lx.\n", GetLastError()); } +static void check_device_path(const WCHAR *device_path, const LUID *adapter_id, DWORD id) +{ + BYTE iface_detail_buffer[sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_W) + 256 * sizeof(WCHAR)]; + SP_DEVINFO_DATA device_data = {sizeof(device_data)}; + SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)}; + SP_DEVICE_INTERFACE_DETAIL_DATA_W *iface_data; + BOOL ret, found = FALSE; + DEVPROPTYPE type; + DWORD output_id; + unsigned int i; + HDEVINFO set; + LUID luid; + + iface_data = (SP_DEVICE_INTERFACE_DETAIL_DATA_W *)iface_detail_buffer; + iface_data->cbSize = sizeof(*iface_data); + + set = SetupDiGetClassDevsW(&GUID_DEVINTERFACE_MONITOR, NULL, NULL, DIGCF_DEVICEINTERFACE | DIGCF_PRESENT); + ok(set != INVALID_HANDLE_VALUE, "Got error %lu.\n", GetLastError()); + + i = 0; + while (SetupDiEnumDeviceInterfaces(set, NULL, &GUID_DEVINTERFACE_MONITOR, i, &iface)) + { + ret = SetupDiGetDeviceInterfaceDetailW(set, &iface, iface_data, + sizeof(iface_detail_buffer), NULL, &device_data); + ok(ret, "Got unexpected ret %d, GetLastError() %lu.\n", ret, GetLastError()); + + ret = SetupDiGetDevicePropertyW(set, &device_data, &DEVPROPKEY_MONITOR_GPU_LUID, &type, + (BYTE *)&luid, sizeof(luid), NULL, 0); + ok(ret || broken(GetLastError() == ERROR_NOT_FOUND) /* before Win10 1809 */, + "Got error %lu.\n", GetLastError()); + if (!ret) + { + win_skip("DEVPROPKEY_MONITOR_GPU_LUID is not found, skipping device path check.\n"); + SetupDiDestroyDeviceInfoList(set); + return; + } + ret = SetupDiGetDevicePropertyW(set, &device_data, &DEVPROPKEY_MONITOR_OUTPUT_ID, + &type, (BYTE *)&output_id, sizeof(output_id), NULL, 0); + ok(ret, "Got error %lu.\n", GetLastError()); + + if (output_id == id && RtlEqualLuid(&luid, adapter_id) && !wcsicmp(device_path, iface_data->DevicePath)) + { + found = TRUE; + break; + } + ++i; + } + ok(found, "device_path %s not found, luid %04lx:%04lx.\n", debugstr_w(device_path), adapter_id->HighPart, + adapter_id->LowPart); + SetupDiDestroyDeviceInfoList(set); +} + static void test_QueryDisplayConfig_result(UINT32 flags, UINT32 paths, const DISPLAYCONFIG_PATH_INFO *pi, UINT32 modes, const DISPLAYCONFIG_MODE_INFO *mi) { @@ -1654,7 +1713,6 @@ static void test_QueryDisplayConfig_result(UINT32 flags, ret = pDisplayConfigGetDeviceInfo(&source_name.header); ok(ret == ERROR_GEN_FAILURE, "Expected GEN_FAILURE, got %ld\n", ret); - todo_wine { target_name.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME; target_name.header.size = sizeof(target_name); target_name.header.adapterId = pi[i].targetInfo.adapterId; @@ -1662,8 +1720,7 @@ static void test_QueryDisplayConfig_result(UINT32 flags, target_name.monitorDevicePath[0] = '\0'; ret = pDisplayConfigGetDeviceInfo(&target_name.header); ok(!ret, "Expected 0, got %ld\n", ret); - ok(target_name.monitorDevicePath[0] != '\0', "Expected monitor device path, got empty string\n"); - } + check_device_path(target_name.monitorDevicePath, &target_name.header.adapterId, target_name.header.id); todo_wine { preferred_mode.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_PREFERRED_MODE; diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index d490b54a3f4..da1b3bbcd2e 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -5546,13 +5546,36 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD case DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME: { DISPLAYCONFIG_TARGET_DEVICE_NAME *target_name = (DISPLAYCONFIG_TARGET_DEVICE_NAME *)packet; + char buffer[ARRAY_SIZE(target_name->monitorFriendlyDeviceName)]; + struct monitor *monitor; - FIXME( "DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME stub.\n" ); + TRACE( "DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME.\n" ); if (packet->size < sizeof(*target_name)) return STATUS_INVALID_PARAMETER; - return STATUS_NOT_SUPPORTED; + if (!lock_display_devices()) return STATUS_UNSUCCESSFUL; + + memset( &target_name->flags, 0, sizeof(*target_name) - offsetof(DISPLAYCONFIG_TARGET_DEVICE_NAME, flags) ); + + LIST_FOR_EACH_ENTRY(monitor, &monitors, struct monitor, entry) + { + if (target_name->header.id != monitor->output_id) continue; + if (memcmp( &target_name->header.adapterId, &monitor->adapter->gpu_luid, + sizeof(monitor->adapter->gpu_luid) )) + continue; + + target_name->outputTechnology = DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL; + /* FIXME: get real monitor name. */ + snprintf( buffer, ARRAY_SIZE(buffer), "Display%u", monitor->output_id + 1 ); + asciiz_to_unicode( target_name->monitorFriendlyDeviceName, buffer ); + lstrcpyW( target_name->monitorDevicePath, monitor->dev.interface_name ); + ret = STATUS_SUCCESS; + break; + } + + unlock_display_devices(); + return ret; } case DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_PREFERRED_MODE: {
1
0
0
0
Paul Gofman : win32u: Store output id in monitors cache.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: b2787fb15c7f8428c034c27ce38337c6013f0e7e URL:
https://gitlab.winehq.org/wine/wine/-/commit/b2787fb15c7f8428c034c27ce38337…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Oct 24 18:58:44 2022 -0500 win32u: Store output id in monitors cache. --- dlls/win32u/sysparams.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 6555e3ef653..d490b54a3f4 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -226,6 +226,7 @@ struct monitor HANDLE handle; unsigned int id; unsigned int flags; + unsigned int output_id; RECT rc_monitor; RECT rc_work; BOOL is_clone; @@ -714,6 +715,17 @@ static BOOL read_monitor_settings( struct adapter *adapter, DWORD index, struct } monitor->dev.state_flags = *(const DWORD *)value->Data; + /* Output ID */ + size = query_reg_subkey_value( hkey, devpropkey_monitor_output_idW, + sizeof(devpropkey_monitor_output_idW), + value, sizeof(buffer) ); + if (size != sizeof(monitor->output_id)) + { + NtClose( hkey ); + return FALSE; + } + monitor->output_id = *(const unsigned int *)value->Data; + /* rc_monitor, WINE_DEVPROPKEY_MONITOR_RCMONITOR */ size = query_reg_subkey_value( hkey, wine_devpropkey_monitor_rcmonitorW, sizeof(wine_devpropkey_monitor_rcmonitorW),
1
0
0
0
Paul Gofman : win32u: Move NtUserDisplayConfigGetDeviceInfo implementation from user32.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 162101bcb34f22ade7b2851d40b503ead7943e3b URL:
https://gitlab.winehq.org/wine/wine/-/commit/162101bcb34f22ade7b2851d40b503…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Oct 24 17:27:16 2022 -0500 win32u: Move NtUserDisplayConfigGetDeviceInfo implementation from user32. --- dlls/user32/sysparams.c | 107 +-------------------------------------------- dlls/win32u/syscall.c | 1 + dlls/win32u/sysparams.c | 85 +++++++++++++++++++++++++++++++++++ dlls/win32u/tests/win32u.c | 20 +++++++++ dlls/win32u/win32u.spec | 2 +- dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 7 +++ include/ntuser.h | 1 + 8 files changed, 117 insertions(+), 107 deletions(-)
1
0
0
0
Paul Gofman : win32u: Store GPU luid in adapters cache.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 62f66c3da51492478049f259d452a49f909b72e3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/62f66c3da51492478049f259d452a4…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Oct 24 17:04:05 2022 -0500 win32u: Store GPU luid in adapters cache. --- dlls/win32u/sysparams.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index b09c55b3d66..59f8ed0411e 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -211,6 +211,7 @@ struct adapter LONG refcount; struct list entry; struct display_device dev; + LUID gpu_luid; unsigned int id; const WCHAR *config_key; unsigned int mode_count; @@ -565,6 +566,17 @@ static int mode_compare(const void *p1, const void *p2) return 0; } +static unsigned int query_reg_subkey_value( HKEY hkey, const WCHAR *name, unsigned int name_size, + KEY_VALUE_PARTIAL_INFORMATION *value, unsigned int size ) +{ + HKEY subkey; + + if (!(subkey = reg_open_key( hkey, name, name_size ))) return 0; + size = query_reg_value( subkey, NULL, value, size ); + NtClose( subkey ); + return size; +} + static BOOL read_display_adapter_settings( unsigned int index, struct adapter *info ) { char buffer[4096]; @@ -637,6 +649,14 @@ static BOOL read_display_adapter_settings( unsigned int index, struct adapter *i if (!(hkey = reg_open_key( enum_key, value_str, value->DataLength - sizeof(WCHAR) ))) return FALSE; + size = query_reg_subkey_value( hkey, devpropkey_gpu_luidW, sizeof(devpropkey_gpu_luidW), value, sizeof(buffer) ); + if (size != sizeof(info->gpu_luid)) + { + NtClose( hkey ); + return FALSE; + } + memcpy( &info->gpu_luid, value->Data, sizeof(info->gpu_luid) ); + size = query_reg_value( hkey, hardware_idW, value, sizeof(buffer) ); NtClose( hkey ); if (!size || (value->Type != REG_SZ && value->Type != REG_MULTI_SZ)) @@ -646,17 +666,6 @@ static BOOL read_display_adapter_settings( unsigned int index, struct adapter *i return TRUE; } -static unsigned int query_reg_subkey_value( HKEY hkey, const WCHAR *name, unsigned int name_size, - KEY_VALUE_PARTIAL_INFORMATION *value, unsigned int size ) -{ - HKEY subkey; - - if (!(subkey = reg_open_key( hkey, name, name_size ))) return 0; - size = query_reg_value( subkey, NULL, value, size ); - NtClose( subkey ); - return size; -} - static BOOL read_monitor_settings( struct adapter *adapter, DWORD index, struct monitor *monitor ) { char buffer[4096];
1
0
0
0
Piotr Caban : maintainers: Update Microsoft C Runtime files list.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 93ba92def7f987f931f356ab891a60dc07ef9e85 URL:
https://gitlab.winehq.org/wine/wine/-/commit/93ba92def7f987f931f356ab891a60…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Oct 27 12:42:35 2022 +0200 maintainers: Update Microsoft C Runtime files list. --- MAINTAINERS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index f7669c09b97..721341266a9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -219,7 +219,11 @@ F: dlls/winegstreamer/wmv_decoder.c Microsoft C Runtime M: Piotr Caban <piotr(a)codeweavers.com> +F: dlls/concrt140/ F: dlls/msvc*/ +F: dlls/ucrtbase/ +F: dlls/vcruntime140/ +F: dlls/vcruntime140_1/ MSI installers M: Hans Leidekker <hans(a)codeweavers.com>
1
0
0
0
Piotr Caban : compstui: Test that callbacks are executed.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: d115861031e44a98ff61be0f751c9ad69f9960dc URL:
https://gitlab.winehq.org/wine/wine/-/commit/d115861031e44a98ff61be0f751c9a…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Sep 28 13:34:37 2022 +0200 compstui: Test that callbacks are executed. --- dlls/compstui/tests/compstui.c | 79 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/dlls/compstui/tests/compstui.c b/dlls/compstui/tests/compstui.c index 72ac9b93f28..2634875db63 100644 --- a/dlls/compstui/tests/compstui.c +++ b/dlls/compstui/tests/compstui.c @@ -22,6 +22,42 @@ #include "wine/test.h" +#define DEFINE_EXPECT(func) \ + static BOOL expect_ ## func = FALSE, called_ ## func = FALSE + +#define SET_EXPECT(func) \ + do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0) + +#define CHECK_EXPECT2(func) \ + do { \ + ok(expect_ ##func, "unexpected call " #func "\n"); \ + called_ ## func = TRUE; \ + }while(0) + +#define CHECK_EXPECT(func) \ + do { \ + CHECK_EXPECT2(func); \ + expect_ ## func = FALSE; \ + }while(0) + +#define CHECK_CALLED(func) \ + do { \ + ok(called_ ## func, "expected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + +#define CLEAR_CALLED(func) \ + expect_ ## func = called_ ## func = FALSE + +DEFINE_EXPECT(page_proc_WM_INITDIALOG); +DEFINE_EXPECT(page_proc2_WM_INITDIALOG); +DEFINE_EXPECT(device_PROPSHEETUI_REASON_INIT); +DEFINE_EXPECT(device_PROPSHEETUI_REASON_DESTROY); +DEFINE_EXPECT(callback_PROPSHEETUI_REASON_BEFORE_INIT); +DEFINE_EXPECT(callback_PROPSHEETUI_REASON_INIT); +DEFINE_EXPECT(callback_PROPSHEETUI_REASON_GET_INFO_HEADER); +DEFINE_EXPECT(callback_PROPSHEETUI_REASON_DESTROY); + typedef struct { WORD cbSize; WORD Flags; @@ -40,6 +76,8 @@ static INT_PTR CALLBACK prop_page_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA { HWND dlg = GetParent(hwnd); + CHECK_EXPECT(page_proc_WM_INITDIALOG); + PostMessageW(dlg, PSM_PRESSBUTTON, PSBTN_OK, 0); } return FALSE; @@ -53,6 +91,8 @@ static INT_PTR CALLBACK prop_page_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPAR PSPINFO *info = (PSPINFO*)((BYTE*)lparam + psp->dwSize); HWND dlg = GetParent(hwnd); + CHECK_EXPECT(page_proc2_WM_INITDIALOG); + ok(psp->dwSize == sizeof(PROPSHEETPAGEW), "psp->dwSize = %ld\n", psp->dwSize); ok(psp->pfnDlgProc == prop_page_proc2, "psp->pfnDlgProc != prop_page_proc2\n"); ok(!psp->lParam, "psp->lParam = %Ix\n", psp->lParam); @@ -70,6 +110,11 @@ static INT_PTR CALLBACK prop_page_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPAR static LONG WINAPI device_property_sheets(PROPSHEETUI_INFO *info, LPARAM lparam) { + if (info->Reason == PROPSHEETUI_REASON_INIT) + CHECK_EXPECT(device_PROPSHEETUI_REASON_INIT); + else + CHECK_EXPECT(device_PROPSHEETUI_REASON_DESTROY); + ok(info->cbSize == sizeof(*info), "info->cbSize = %hd\n", info->cbSize); ok(info->Version == PROPSHEETUI_INFO_VERSION, "info->Version = %hd\n", info->Version); ok(info->Flags == info->lParamInit ? PSUIINFO_UNICODE : 0, "info->Flags = %hd\n", info->Flags); @@ -98,6 +143,7 @@ static LONG WINAPI propsheetui_callback(PROPSHEETUI_INFO *info, LPARAM lparam) switch(info->Reason) { case PROPSHEETUI_REASON_BEFORE_INIT: + CHECK_EXPECT(callback_PROPSHEETUI_REASON_BEFORE_INIT); ok(!info->Version, "info->Version = %hd\n", info->Version); ok(!info->Flags, "info->Flags = %hd\n", info->Flags); ok(!info->hComPropSheet, "info->hComPropSheet = %p\n", info->hComPropSheet); @@ -105,6 +151,7 @@ static LONG WINAPI propsheetui_callback(PROPSHEETUI_INFO *info, LPARAM lparam) ok(!info->Result, "info->Result = %Ix\n", info->Result); break; case PROPSHEETUI_REASON_INIT: + CHECK_EXPECT(callback_PROPSHEETUI_REASON_INIT); ok(info->Version == PROPSHEETUI_INFO_VERSION, "info->Version = %hd\n", info->Version); ok(info->Flags == PSUIINFO_UNICODE, "info->Flags = %hd\n", info->Flags); ok(info->hComPropSheet != NULL, "info->hComPropSheet = NULL\n"); @@ -113,6 +160,7 @@ static LONG WINAPI propsheetui_callback(PROPSHEETUI_INFO *info, LPARAM lparam) ok(!info->Result, "info->Result = %Ix\n", info->Result); break; case PROPSHEETUI_REASON_GET_INFO_HEADER: + CHECK_EXPECT(callback_PROPSHEETUI_REASON_GET_INFO_HEADER); ok(info->Version == PROPSHEETUI_INFO_VERSION, "info->Version = %hd\n", info->Version); ok(info->Flags == PSUIINFO_UNICODE, "info->Flags = %hd\n", info->Flags); ok(info->hComPropSheet != NULL, "info->hComPropSheet = NULL\n"); @@ -135,11 +183,18 @@ static LONG WINAPI propsheetui_callback(PROPSHEETUI_INFO *info, LPARAM lparam) PROPSHEETPAGEW psp; LONG_PTR ret; + SET_EXPECT(device_PROPSHEETUI_REASON_INIT); + SET_EXPECT(device_PROPSHEETUI_REASON_DESTROY); ret = info->pfnComPropSheet(info->hComPropSheet, CPSFUNC_ADD_PFNPROPSHEETUIA, (LPARAM)device_property_sheets, 0); ok(!ret, "ret = %Ix\n", ret); + CHECK_CALLED(device_PROPSHEETUI_REASON_INIT); + CHECK_CALLED(device_PROPSHEETUI_REASON_DESTROY); + SET_EXPECT(device_PROPSHEETUI_REASON_INIT); ret = info->pfnComPropSheet(info->hComPropSheet, CPSFUNC_ADD_PFNPROPSHEETUIW, (LPARAM)device_property_sheets, 1); ok(ret, "ret = 0\n"); + CHECK_CALLED(device_PROPSHEETUI_REASON_INIT); + SET_EXPECT(device_PROPSHEETUI_REASON_DESTROY); memset(&psp, 0, sizeof(psp)); psp.dwSize = sizeof(psp); @@ -156,8 +211,12 @@ static LONG WINAPI propsheetui_callback(PROPSHEETUI_INFO *info, LPARAM lparam) } break; case PROPSHEETUI_REASON_DESTROY: + CHECK_EXPECT(callback_PROPSHEETUI_REASON_DESTROY); if (info->lParamInit & ADD_PAGES) + { + CHECK_CALLED(device_PROPSHEETUI_REASON_DESTROY); ok(lparam, "lparam = 0\n"); + } else ok(!lparam, "lparam = %Ix\n", lparam); @@ -188,15 +247,35 @@ static void test_CommonPropertySheetUI(void) ok(res == 0xdeadbeef, "res = %lx\n", res); ok(!GetLastError(), "CommonPropertySheetUIW error %ld\n", GetLastError()); + SET_EXPECT(callback_PROPSHEETUI_REASON_BEFORE_INIT); + SET_EXPECT(callback_PROPSHEETUI_REASON_INIT); + SET_EXPECT(callback_PROPSHEETUI_REASON_GET_INFO_HEADER); + SET_EXPECT(callback_PROPSHEETUI_REASON_DESTROY); res = 0xdeadbeef; ret = CommonPropertySheetUIW((HWND)0x4321, propsheetui_callback, 0, &res); ok(ret == ERR_CPSUI_NO_PROPSHEETPAGE, "CommonPropertySheetUIW returned %ld\n", ret); ok(!res, "res = %lx\n", res); + CLEAR_CALLED(callback_PROPSHEETUI_REASON_BEFORE_INIT); + CHECK_CALLED(callback_PROPSHEETUI_REASON_INIT); + CHECK_CALLED(callback_PROPSHEETUI_REASON_GET_INFO_HEADER); + CHECK_CALLED(callback_PROPSHEETUI_REASON_DESTROY); + SET_EXPECT(callback_PROPSHEETUI_REASON_BEFORE_INIT); + SET_EXPECT(callback_PROPSHEETUI_REASON_INIT); + SET_EXPECT(callback_PROPSHEETUI_REASON_GET_INFO_HEADER); + SET_EXPECT(page_proc2_WM_INITDIALOG); + SET_EXPECT(page_proc_WM_INITDIALOG); + SET_EXPECT(callback_PROPSHEETUI_REASON_DESTROY); res = 0xdeadbeef; ret = CommonPropertySheetUIW((HWND)0x4321, propsheetui_callback, ADD_PAGES, &res); ok(ret == CPSUI_OK, "CommonPropertySheetUIW returned %ld\n", ret); ok(!res, "res = %lx\n", res); + CLEAR_CALLED(callback_PROPSHEETUI_REASON_BEFORE_INIT); + CHECK_CALLED(callback_PROPSHEETUI_REASON_INIT); + CHECK_CALLED(callback_PROPSHEETUI_REASON_GET_INFO_HEADER); + CHECK_CALLED(page_proc2_WM_INITDIALOG); + CHECK_CALLED(page_proc_WM_INITDIALOG); + CHECK_CALLED(callback_PROPSHEETUI_REASON_DESTROY); } START_TEST(compstui)
1
0
0
0
Piotr Caban : compstui: Add CPSFUNC_ADD_PROPSHEETPAGE support.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: f590f72eedf97ce542521d8c79dda099d0308930 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f590f72eedf97ce542521d8c79dda0…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Aug 30 20:24:56 2022 +0200 compstui: Add CPSFUNC_ADD_PROPSHEETPAGE support. --- dlls/compstui/compstui_main.c | 131 ++++++++++++++++++++++++++++++++++++++++- dlls/compstui/tests/compstui.c | 27 +++++++++ include/ddk/compstui.h | 9 +++ 3 files changed, 165 insertions(+), 2 deletions(-) diff --git a/dlls/compstui/compstui_main.c b/dlls/compstui/compstui_main.c index c44942c60a3..60d5f9891b0 100644 --- a/dlls/compstui/compstui_main.c +++ b/dlls/compstui/compstui_main.c @@ -28,7 +28,7 @@ #include "windef.h" #include "winbase.h" #include "winuser.h" -#include "prsht.h" +#include "commctrl.h" #include "ddk/compstui.h" #include "wine/debug.h" @@ -66,6 +66,7 @@ struct propsheet struct propsheetpage { HPROPSHEETPAGE hpsp; + DLGPROC dlg_proc; }; struct propsheetfunc @@ -260,6 +261,130 @@ static HANDLE add_propsheetfunc(HANDLE hcps, PFNPROPSHEETUI func, LPARAM lparam, return ret; } +static HANDLE add_propsheetpage(HANDLE hcps, void *psp, PSPINFO *info, + DLGPROC dlg_proc, BOOL unicode) +{ + struct cps_data *cps_data = get_handle_data(hcps); + struct cps_data *cpsp_data; + HPROPSHEETPAGE hpsp; + HANDLE ret; + + if (!cps_data) + return 0; + + if (cps_data->type != HANDLE_PROPSHEET) + { + FIXME("unsupported handle type %d\n", cps_data->type); + return 0; + } + + if (cps_data->ps->pages_cnt == ARRAY_SIZE(cps_data->ps->pages)) + return 0; + + ret = alloc_handle(&cpsp_data, HANDLE_PROPSHEETPAGE); + if (!ret) + return 0; + + info->cbSize = sizeof(*info); + info->wReserved = 0; + info->hComPropSheet = hcps; + info->hCPSUIPage = ret; + info->pfnComPropSheet = cps_callback; + + if (unicode) + hpsp = CreatePropertySheetPageW((PROPSHEETPAGEW*)psp); + else + hpsp = CreatePropertySheetPageA((PROPSHEETPAGEA*)psp); + if (!hpsp) + { + free_handle(ret); + return 0; + } + + cpsp_data->psp->hpsp = hpsp; + cpsp_data->psp->dlg_proc = dlg_proc; + cps_data->ps->pages[cps_data->ps->pages_cnt++] = ret; + return ret; +} + +static INT_PTR CALLBACK propsheetpage_dlg_procW(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_INITDIALOG) + { + PROPSHEETPAGEW *psp = (PROPSHEETPAGEW*)lparam; + PSPINFO *info = (PSPINFO*)((BYTE*)lparam + psp->dwSize - sizeof(*info)); + struct cps_data *cpsp_data = get_handle_data(info->hCPSUIPage); + + psp->dwSize -= sizeof(*info); + psp->pfnDlgProc = cpsp_data->psp->dlg_proc; + SetWindowLongPtrW(hwnd, DWLP_DLGPROC, (LONG_PTR)psp->pfnDlgProc); + return psp->pfnDlgProc(hwnd, msg, wparam, lparam); + } + + return FALSE; +} + +static HANDLE add_propsheetpageW(HANDLE hcps, PROPSHEETPAGEW *psp) +{ + PROPSHEETPAGEW *psp_copy; + PSPINFO *info; + HANDLE ret; + + if (!psp || psp->dwSize < PROPSHEETPAGEW_V1_SIZE) + return 0; + + psp_copy = (PROPSHEETPAGEW*)malloc(psp->dwSize + sizeof(*info)); + if (!psp_copy) + return 0; + memcpy(psp_copy, psp, psp->dwSize); + psp_copy->dwSize += sizeof(*info); + psp_copy->pfnDlgProc = propsheetpage_dlg_procW; + + info = (PSPINFO*)((BYTE*)psp_copy + psp->dwSize); + ret = add_propsheetpage(hcps, psp_copy, info, psp->pfnDlgProc, TRUE); + free(psp_copy); + return ret; +} + +static INT_PTR CALLBACK propsheetpage_dlg_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_INITDIALOG) + { + PROPSHEETPAGEA *psp = (PROPSHEETPAGEA*)lparam; + PSPINFO *info = (PSPINFO*)((BYTE*)lparam + psp->dwSize - sizeof(*info)); + struct cps_data *cpsp_data = get_handle_data(info->hCPSUIPage); + + psp->dwSize -= sizeof(*info); + psp->pfnDlgProc = cpsp_data->psp->dlg_proc; + SetWindowLongPtrA(hwnd, DWLP_DLGPROC, (LONG_PTR)psp->pfnDlgProc); + return psp->pfnDlgProc(hwnd, msg, wparam, lparam); + } + + return FALSE; +} + +static HANDLE add_propsheetpageA(HANDLE hcps, PROPSHEETPAGEA *psp) +{ + PROPSHEETPAGEA *psp_copy; + PSPINFO *info; + HANDLE ret; + + if (!psp || psp->dwSize < PROPSHEETPAGEW_V1_SIZE) + return 0; + + psp_copy = (PROPSHEETPAGEA*)malloc(psp->dwSize + sizeof(*info)); + if (!psp_copy) + return 0; + memcpy(psp_copy, psp, psp->dwSize); + psp_copy->dwSize += sizeof(*info); + psp_copy->pfnDlgProc = propsheetpage_dlg_procA; + + info = (PSPINFO*)((BYTE*)psp_copy + psp->dwSize); + ret = add_propsheetpage(hcps, psp_copy, info, psp->pfnDlgProc, FALSE); + free(psp_copy); + return ret; +} + static LONG_PTR WINAPI cps_callback(HANDLE hcps, UINT func, LPARAM lparam1, LPARAM lparam2) { TRACE("(%p, %u, %Ix, %Ix\n", hcps, func, lparam1, lparam2); @@ -272,7 +397,10 @@ static LONG_PTR WINAPI cps_callback(HANDLE hcps, UINT func, LPARAM lparam1, LPAR case CPSFUNC_ADD_PFNPROPSHEETUIW: return (LONG_PTR)add_propsheetfunc(hcps, (PFNPROPSHEETUI)lparam1, lparam2, func == CPSFUNC_ADD_PFNPROPSHEETUIW); + case CPSFUNC_ADD_PROPSHEETPAGEA: + return (LONG_PTR)add_propsheetpageA(hcps, (PROPSHEETPAGEA*)lparam1); case CPSFUNC_ADD_PROPSHEETPAGEW: + return (LONG_PTR)add_propsheetpageW(hcps, (PROPSHEETPAGEW*)lparam1); case CPSFUNC_ADD_PCOMPROPSHEETUIA: case CPSFUNC_ADD_PCOMPROPSHEETUIW: case CPSFUNC_DELETE_HCOMPROPSHEET: @@ -284,7 +412,6 @@ static LONG_PTR WINAPI cps_callback(HANDLE hcps, UINT func, LPARAM lparam1, LPAR case CPSFUNC_LOAD_CPSUI_STRINGW: case CPSFUNC_LOAD_CPSUI_ICON: case CPSFUNC_GET_PFNPROPSHEETUI_ICON: - case CPSFUNC_ADD_PROPSHEETPAGEA: case CPSFUNC_INSERT_PSUIPAGEA: case CPSFUNC_INSERT_PSUIPAGEW: case CPSFUNC_SET_PSUIPAGE_TITLEA: diff --git a/dlls/compstui/tests/compstui.c b/dlls/compstui/tests/compstui.c index be63c7645ec..72ac9b93f28 100644 --- a/dlls/compstui/tests/compstui.c +++ b/dlls/compstui/tests/compstui.c @@ -45,6 +45,29 @@ static INT_PTR CALLBACK prop_page_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA return FALSE; } +static INT_PTR CALLBACK prop_page_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_INITDIALOG) + { + PROPSHEETPAGEW *psp = (PROPSHEETPAGEW*)lparam; + PSPINFO *info = (PSPINFO*)((BYTE*)lparam + psp->dwSize); + HWND dlg = GetParent(hwnd); + + ok(psp->dwSize == sizeof(PROPSHEETPAGEW), "psp->dwSize = %ld\n", psp->dwSize); + ok(psp->pfnDlgProc == prop_page_proc2, "psp->pfnDlgProc != prop_page_proc2\n"); + ok(!psp->lParam, "psp->lParam = %Ix\n", psp->lParam); + + ok(info->cbSize == sizeof(*info), "info->cbSize = %hd\n", info->cbSize); + ok(!info->wReserved, "info->wReserved = %hd\n", info->wReserved); + ok(info->hComPropSheet != NULL, "info->hComPropSheet = NULL\n"); + ok(info->hCPSUIPage != NULL, "info->hCPSUIPage = NULL\n"); + ok(info->pfnComPropSheet != NULL, "info->pfnComPropSheet = NULL\n"); + + PostMessageW(dlg, PSM_SETCURSEL, 1, 0); + } + return FALSE; +} + static LONG WINAPI device_property_sheets(PROPSHEETUI_INFO *info, LPARAM lparam) { ok(info->cbSize == sizeof(*info), "info->cbSize = %hd\n", info->cbSize); @@ -121,6 +144,10 @@ static LONG WINAPI propsheetui_callback(PROPSHEETUI_INFO *info, LPARAM lparam) memset(&psp, 0, sizeof(psp)); psp.dwSize = sizeof(psp); U(psp).pszTemplate = L"prop_page1"; + psp.pfnDlgProc = prop_page_proc2; + ret = info->pfnComPropSheet(info->hComPropSheet, CPSFUNC_ADD_PROPSHEETPAGEW, (LPARAM)&psp, 0); + ok(ret, "ret = 0\n"); + psp.pfnDlgProc = prop_page_proc; hpsp = CreatePropertySheetPageW(&psp); ok(hpsp != NULL, "hpsp = %p\n", hpsp); diff --git a/include/ddk/compstui.h b/include/ddk/compstui.h index aa167830207..1563450e26b 100644 --- a/include/ddk/compstui.h +++ b/include/ddk/compstui.h @@ -440,6 +440,15 @@ extern "C" { /* TYPES */ typedef LONG_PTR (CALLBACK *PFNCOMPROPSHEET)(HANDLE, UINT, LPARAM, LPARAM); + +typedef struct _PSPINFO { + WORD cbSize; + WORD wReserved; + HANDLE hComPropSheet; + HANDLE hCPSUIPage; + PFNCOMPROPSHEET pfnComPropSheet; +} PSPINFO, *PPSPINFO; + typedef struct _PROPSHEETUI_INFO { WORD cbSize; WORD Version;
1
0
0
0
Piotr Caban : compstui: Add CPSFUNC_ADD_PFNPROPSHEETUI support.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 70bf3d521d2b5faf0507e2ca3322e7171b62db55 URL:
https://gitlab.winehq.org/wine/wine/-/commit/70bf3d521d2b5faf0507e2ca3322e7…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Aug 25 18:28:03 2022 +0200 compstui: Add CPSFUNC_ADD_PFNPROPSHEETUI support. --- dlls/compstui/compstui_main.c | 102 +++++++++++++++++++++++++++++++++++++++-- dlls/compstui/tests/compstui.c | 25 ++++++++++ 2 files changed, 122 insertions(+), 5 deletions(-) diff --git a/dlls/compstui/compstui_main.c b/dlls/compstui/compstui_main.c index b7a08e1c52b..c44942c60a3 100644 --- a/dlls/compstui/compstui_main.c +++ b/dlls/compstui/compstui_main.c @@ -32,6 +32,7 @@ #include "ddk/compstui.h" #include "wine/debug.h" +#include "wine/list.h" WINE_DEFAULT_DEBUG_CHANNEL(compstui); @@ -59,6 +60,7 @@ struct propsheet { int pages_cnt; HANDLE pages[100]; + struct list funcs; }; struct propsheetpage @@ -66,6 +68,17 @@ struct propsheetpage HPROPSHEETPAGE hpsp; }; +struct propsheetfunc +{ + struct list entry; + HANDLE handle; + PFNPROPSHEETUI func; + LPARAM lparam; + BOOL unicode; + ULONG_PTR user_data; + ULONG_PTR result; +}; + #define HANDLE_FIRST 0x43440001 static struct cps_data { @@ -73,7 +86,8 @@ static struct cps_data { HANDLE_FREE = 0, HANDLE_PROPSHEET, - HANDLE_PROPSHEETPAGE + HANDLE_PROPSHEETPAGE, + HANDLE_PROPSHEETFUNC, } type; union { @@ -81,6 +95,7 @@ static struct cps_data struct cps_data *next_free; struct propsheet *ps; struct propsheetpage *psp; + struct propsheetfunc *psf; }; } handles[0x1000]; static struct cps_data *first_free_handle = handles; @@ -94,6 +109,8 @@ static CRITICAL_SECTION_DEBUG handles_cs_debug = }; static CRITICAL_SECTION handles_cs = { &handles_cs_debug, -1, 0, 0, 0, 0 }; +static LONG_PTR WINAPI cps_callback(HANDLE hcps, UINT func, LPARAM lparam1, LPARAM lparam2); + static struct cps_data* get_handle_data(HANDLE handle) { struct cps_data *ret; @@ -117,6 +134,9 @@ static HANDLE alloc_handle(struct cps_data **cps_data, int type) case HANDLE_PROPSHEETPAGE: data = calloc(1, sizeof(struct propsheetpage)); break; + case HANDLE_PROPSHEETFUNC: + data = calloc(1, sizeof(struct propsheetfunc)); + break; } if (!data) @@ -187,6 +207,59 @@ static HANDLE add_hpropsheetpage(HANDLE hcps, HPROPSHEETPAGE hpsp) return ret; } +static HANDLE add_propsheetfunc(HANDLE hcps, PFNPROPSHEETUI func, LPARAM lparam, BOOL unicode) +{ + struct cps_data *cps_data = get_handle_data(hcps); + struct cps_data *cpsf_data; + PROPSHEETUI_INFO info, callback_info; + HANDLE ret; + LONG lret; + + if (!cps_data || !func) + return 0; + + if (cps_data->type != HANDLE_PROPSHEET) + { + FIXME("unsupported handle type %d\n", cps_data->type); + return 0; + } + + ret = alloc_handle(&cpsf_data, HANDLE_PROPSHEETFUNC); + if (!ret) + return 0; + cpsf_data->psf->handle = ret; + cpsf_data->psf->func = func; + cpsf_data->psf->unicode = unicode; + cpsf_data->psf->lparam = lparam; + + memset(&info, 0, sizeof(info)); + info.cbSize = sizeof(info); + info.Version = PROPSHEETUI_INFO_VERSION; + info.Flags = unicode ? PSUIINFO_UNICODE : 0; + info.Reason = PROPSHEETUI_REASON_INIT; + info.hComPropSheet = hcps; + info.pfnComPropSheet = cps_callback; + info.lParamInit = lparam; + + callback_info = info; + lret = func(&callback_info, lparam); + cpsf_data->psf->user_data = callback_info.UserData; + cpsf_data->psf->result = callback_info.Result; + if (lret <= 0) + { + callback_info = info; + callback_info.Reason = PROPSHEETUI_REASON_DESTROY; + callback_info.UserData = cpsf_data->psf->user_data; + callback_info.Result = cpsf_data->psf->result; + free_handle(ret); + func(&callback_info, 0); + return 0; + } + + list_add_tail(&cps_data->ps->funcs, &cpsf_data->psf->entry); + return ret; +} + static LONG_PTR WINAPI cps_callback(HANDLE hcps, UINT func, LPARAM lparam1, LPARAM lparam2) { TRACE("(%p, %u, %Ix, %Ix\n", hcps, func, lparam1, lparam2); @@ -195,11 +268,13 @@ static LONG_PTR WINAPI cps_callback(HANDLE hcps, UINT func, LPARAM lparam1, LPAR { case CPSFUNC_ADD_HPROPSHEETPAGE: return (LONG_PTR)add_hpropsheetpage(hcps, (HPROPSHEETPAGE)lparam1); + case CPSFUNC_ADD_PFNPROPSHEETUIA: + case CPSFUNC_ADD_PFNPROPSHEETUIW: + return (LONG_PTR)add_propsheetfunc(hcps, (PFNPROPSHEETUI)lparam1, + lparam2, func == CPSFUNC_ADD_PFNPROPSHEETUIW); case CPSFUNC_ADD_PROPSHEETPAGEW: case CPSFUNC_ADD_PCOMPROPSHEETUIA: case CPSFUNC_ADD_PCOMPROPSHEETUIW: - case CPSFUNC_ADD_PFNPROPSHEETUIA: - case CPSFUNC_ADD_PFNPROPSHEETUIW: case CPSFUNC_DELETE_HCOMPROPSHEET: case CPSFUNC_SET_HSTARTPAGE: case CPSFUNC_GET_PAGECOUNT: @@ -324,6 +399,7 @@ static LONG create_prop_dlg(HWND hwnd, PFNPROPSHEETUI callback, LPARAM lparam, D SetLastError(0); return ERR_CPSUI_GETLASTERROR; } + list_init(&cps_data->ps->funcs); memset(&info, 0, sizeof(info)); info.cbSize = sizeof(info); @@ -364,9 +440,25 @@ static LONG create_prop_dlg(HWND hwnd, PFNPROPSHEETUI callback, LPARAM lparam, D ret = create_property_sheetW(cps_data->ps, &header); destroy: + info.Reason = PROPSHEETUI_REASON_DESTROY; + while (!list_empty(&cps_data->ps->funcs)) + { + struct propsheetfunc *func = LIST_ENTRY(list_head(&cps_data->ps->funcs), + struct propsheetfunc, entry); + + list_remove(&func->entry); + + callback_info = info; + callback_info.Flags = func->unicode ? PSUIINFO_UNICODE : 0; + callback_info.lParamInit = func->lparam; + callback_info.UserData = func->user_data; + callback_info.Result = func->result; + func->func(&callback_info, ret <= 0 ? 0 : 0x100); + free_handle(func->handle); + } + callback_info = info; - callback_info.Reason = PROPSHEETUI_REASON_DESTROY; - callback(&callback_info, ret < 0 ? 0 : 0x100); + callback(&callback_info, ret <= 0 ? 0 : 0x100); for (i = 0; i < cps_data->ps->pages_cnt; i++) free_handle(cps_data->ps->pages[i]); diff --git a/dlls/compstui/tests/compstui.c b/dlls/compstui/tests/compstui.c index f4e3af459a9..be63c7645ec 100644 --- a/dlls/compstui/tests/compstui.c +++ b/dlls/compstui/tests/compstui.c @@ -45,6 +45,25 @@ static INT_PTR CALLBACK prop_page_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA return FALSE; } +static LONG WINAPI device_property_sheets(PROPSHEETUI_INFO *info, LPARAM lparam) +{ + ok(info->cbSize == sizeof(*info), "info->cbSize = %hd\n", info->cbSize); + ok(info->Version == PROPSHEETUI_INFO_VERSION, "info->Version = %hd\n", info->Version); + ok(info->Flags == info->lParamInit ? PSUIINFO_UNICODE : 0, "info->Flags = %hd\n", info->Flags); + ok(info->Reason == PROPSHEETUI_REASON_INIT || info->Reason == PROPSHEETUI_REASON_DESTROY, + "info->Reason = %hx\n", info->Reason); + ok(info->hComPropSheet != NULL, "info->hComPropSheet = NULL\n"); + ok(info->pfnComPropSheet != NULL, "info->pfnComPropSheet = NULL\n"); + if (info->Reason == PROPSHEETUI_REASON_INIT) + { + ok(info->lParamInit == lparam, "info->lParamInit = %Ix, lparam = %Ix\n", + info->lParamInit, lparam); + } + ok(!info->UserData, "info->UserData = %Ix\n", info->UserData); + ok(!info->Result, "info->Result = %Ix\n", info->Result); + return lparam; +} + #define ADD_PAGES 0x1 static LONG WINAPI propsheetui_callback(PROPSHEETUI_INFO *info, LPARAM lparam) @@ -93,6 +112,12 @@ static LONG WINAPI propsheetui_callback(PROPSHEETUI_INFO *info, LPARAM lparam) PROPSHEETPAGEW psp; LONG_PTR ret; + ret = info->pfnComPropSheet(info->hComPropSheet, CPSFUNC_ADD_PFNPROPSHEETUIA, (LPARAM)device_property_sheets, 0); + ok(!ret, "ret = %Ix\n", ret); + + ret = info->pfnComPropSheet(info->hComPropSheet, CPSFUNC_ADD_PFNPROPSHEETUIW, (LPARAM)device_property_sheets, 1); + ok(ret, "ret = 0\n"); + memset(&psp, 0, sizeof(psp)); psp.dwSize = sizeof(psp); U(psp).pszTemplate = L"prop_page1";
1
0
0
0
← Newer
1
2
3
4
...
11
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
Results per page:
10
25
50
100
200