winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2022
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1024 discussions
Start a n
N
ew thread
Bernhard Kölbl : windows.media.speech: Implement concurrency in IAsyncOperation.
by Alexandre Julliard
22 Apr '22
22 Apr '22
Module: wine Branch: master Commit: f3c131c7689a142e304c6680c1cdd2688c013c87 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f3c131c7689a142e304c6680…
Author: Bernhard Kölbl <besentv(a)gmail.com> Date: Fri Apr 22 14:48:06 2022 +0200 windows.media.speech: Implement concurrency in IAsyncOperation. Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.media.speech/async.c | 95 +++++++++++++++++++++++++++++++- dlls/windows.media.speech/private.h | 4 +- dlls/windows.media.speech/recognizer.c | 7 ++- dlls/windows.media.speech/tests/speech.c | 8 +-- 4 files changed, 105 insertions(+), 9 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=f3c131c7689a142e304c…
1
0
0
0
Bernhard Kölbl : windows.media.speech: Partially implement IAsyncOperation.
by Alexandre Julliard
22 Apr '22
22 Apr '22
Module: wine Branch: master Commit: caf138f59044baece62ed5201a78822c8f011bd1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=caf138f59044baece62ed520…
Author: Bernhard Kölbl <besentv(a)gmail.com> Date: Fri Apr 22 14:48:05 2022 +0200 windows.media.speech: Partially implement IAsyncOperation. Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.media.speech/async.c | 138 +++++++++++++++++++++++++++---- dlls/windows.media.speech/tests/speech.c | 105 ++++++++++++----------- 2 files changed, 177 insertions(+), 66 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=caf138f59044baece62e…
1
0
0
0
Bernhard Kölbl : windows.media.speech/tests: Add tests to check if IAsyncInfo_Close is non blocking.
by Alexandre Julliard
22 Apr '22
22 Apr '22
Module: wine Branch: master Commit: 9d67ca493a43d0effa49992553c1ebf195fab5eb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9d67ca493a43d0effa499925…
Author: Bernhard Kölbl <besentv(a)gmail.com> Date: Fri Apr 22 14:48:04 2022 +0200 windows.media.speech/tests: Add tests to check if IAsyncInfo_Close is non blocking. Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.media.speech/tests/speech.c | 96 +++++++++++++++++++++++++++----- 1 file changed, 82 insertions(+), 14 deletions(-) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 12ac407b751..3df687d1148 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -239,8 +239,8 @@ struct compilation_handler IAsyncHandler_Compilation IAsyncHandler_Compilation_iface; LONG ref; + HANDLE event_block; HANDLE event_finished; - BOOLEAN sleeping; DWORD thread_id; }; @@ -290,8 +290,10 @@ HRESULT WINAPI compilation_handler_Invoke( IAsyncHandler_Compilation *iface, trace("Iface %p, info %p, status %d.\n", iface, info, status); trace("Caller thread id %lu callback thread id %lu.\n", impl->thread_id, id); - ok(status != Started, "Got unexpected status %#x.\n", status); + /* Signal finishing of the handler. */ if (impl->event_finished) SetEvent(impl->event_finished); + /* Block handler until event is set. */ + if (impl->event_block) WaitForSingleObject(impl->event_block, INFINITE); return S_OK; } @@ -813,6 +815,23 @@ static void test_VoiceInformation(void) RoUninitialize(); } +struct async_operation_block_param +{ + IAsyncOperationCompletedHandler_SpeechRecognitionCompilationResult *handler; + IAsyncOperation_SpeechRecognitionCompilationResult *operation; +}; + +static DWORD WINAPI async_operation_block_thread(void *arg) +{ + struct async_operation_block_param *param = arg; + HRESULT hr; + + hr = IAsyncOperation_SpeechRecognitionCompilationResult_put_Completed(param->operation, param->handler); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + return 0; +} + static void test_SpeechRecognizer(void) { static const WCHAR *speech_recognition_name = L"Windows.Media.SpeechRecognition.SpeechRecognizer"; @@ -828,16 +847,17 @@ static void test_SpeechRecognizer(void) ISpeechRecognizer2 *recognizer2 = NULL; IActivationFactory *factory = NULL; IInspectable *inspectable = NULL; - IClosable *closable = NULL; ILanguage *language = NULL; IAsyncInfo *info = NULL; struct completed_event_handler completed_handler; struct recognition_result_handler result_handler; + struct async_operation_block_param block_param; struct compilation_handler compilation_handler; SpeechRecognitionResultStatus result_status; EventRegistrationToken token = { .value = 0 }; AsyncStatus async_status; HSTRING hstr, hstr_lang; + HANDLE blocked_thread; HRESULT hr; UINT32 id; LONG ref; @@ -909,11 +929,16 @@ static void test_SpeechRecognizer(void) hr = IInspectable_QueryInterface(inspectable, &IID_ISpeechRecognizer2, (void **)&recognizer2); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + check_interface(inspectable, &IID_IClosable, TRUE); + hr = ISpeechRecognizer2_get_ContinuousRecognitionSession(recognizer2, &session); ok(hr == S_OK, "ISpeechRecognizer2_get_ContinuousRecognitionSession failed, hr %#lx.\n", hr); check_refcount(session, 2); check_refcount(inspectable, 3); + ref = ISpeechRecognizer2_Release(recognizer2); + ok(ref == 2, "Got unexpected ref %lu.\n", ref); + hr = ISpeechContinuousRecognitionSession_add_Completed(session, NULL, &token); ok(hr == E_INVALIDARG, "ISpeechContinuousRecognitionSession_add_ResultGenerated failed, hr %#lx.\n", hr); @@ -938,6 +963,9 @@ static void test_SpeechRecognizer(void) hr = ISpeechContinuousRecognitionSession_remove_ResultGenerated(session, token); ok(hr == S_OK, "ISpeechContinuousRecognitionSession_remove_ResultGenerated failed, hr %#lx.\n", hr); + ref = ISpeechContinuousRecognitionSession_Release(session); + ok(ref == 1, "Got unexpected ref %lu.\n", ref); + hr = ISpeechRecognizer_get_Constraints(recognizer, &constraints); ok(hr == S_OK, "ISpeechContinuousRecognitionSession_get_Constraints failed, hr %#lx.\n", hr); @@ -1064,22 +1092,62 @@ static void test_SpeechRecognizer(void) ref = IAsyncInfo_Release(info); todo_wine ok(ref == 1, "Got unexpected ref %lu.\n", ref); - -skip_operation: ref = IAsyncOperation_SpeechRecognitionCompilationResult_Release(operation); - ok(!ref, "Got unexpected ref %lu.\n", ref); + todo_wine ok(!ref, "Got unexpected ref %lu.\n", ref); - ref = ISpeechContinuousRecognitionSession_Release(session); - ok(ref == 1, "Got unexpected ref %lu.\n", ref); + ref = ISpeechRecognizer_Release(recognizer); + todo_wine ok(ref == 1, "Got unexpected ref %lu.\n", ref); - hr = IInspectable_QueryInterface(inspectable, &IID_IClosable, (void **)&closable); - ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + ref = IInspectable_Release(inspectable); + todo_wine ok(!ref, "Got unexpected ref %lu.\n", ref); - ref = IClosable_Release(closable); - ok(ref == 3, "Got unexpected ref %lu.\n", ref); + /* Test if AsyncInfo_Close waits for the handler to finish. */ + hr = RoActivateInstance(hstr, &inspectable); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - ref = ISpeechRecognizer2_Release(recognizer2); - ok(ref == 2, "Got unexpected ref %lu.\n", ref); + hr = IInspectable_QueryInterface(inspectable, &IID_ISpeechRecognizer, (void **)&recognizer); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + compilation_handler_create_static(&compilation_handler); + compilation_handler.event_block = CreateEventW(NULL, FALSE, FALSE, NULL); + compilation_handler.event_finished = CreateEventW(NULL, FALSE, FALSE, NULL); + compilation_handler.thread_id = GetCurrentThreadId(); + + todo_wine ok(compilation_handler.event_finished != NULL, "Finished event wasn't created.\n"); + + hr = ISpeechRecognizer_CompileConstraintsAsync(recognizer, &operation); + todo_wine ok(hr == S_OK, "ISpeechRecognizer_CompileConstraintsAsync failed, hr %#lx.\n", hr); + + block_param.handler = &compilation_handler.IAsyncHandler_Compilation_iface; + block_param.operation = operation; + blocked_thread = CreateThread(NULL, 0, async_operation_block_thread, &block_param, 0, NULL); + + todo_wine ok(!WaitForSingleObject(compilation_handler.event_finished, 5000), "Wait for event_finished failed.\n"); + + todo_wine ok(WaitForSingleObject(blocked_thread, 100) == WAIT_TIMEOUT, "Wait for block_thread didn't time out.\n"); + + todo_wine ok(compilation_handler.ref == 3, "Got unexpected ref %lu.\n", compilation_handler.ref); + todo_wine check_refcount(operation, 3); + + hr = IAsyncOperation_SpeechRecognitionCompilationResult_QueryInterface(operation, &IID_IAsyncInfo, (void **)&info); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = IAsyncInfo_Close(info); /* If IAsyncInfo_Close would wait for the handler to finish, the test would get stuck here. */ + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + SetEvent(compilation_handler.event_block); + todo_wine ok(!WaitForSingleObject(blocked_thread, 1000), "Wait for block_thread failed.\n"); + + CloseHandle(blocked_thread); + CloseHandle(compilation_handler.event_block); + CloseHandle(compilation_handler.event_finished); + + ref = IAsyncInfo_Release(info); + todo_wine ok(ref == 1, "Got unexpected ref %lu.\n", ref); + +skip_operation: + ref = IAsyncOperation_SpeechRecognitionCompilationResult_Release(operation); + ok(!ref, "Got unexpected ref %lu.\n", ref); ref = ISpeechRecognizer_Release(recognizer); ok(ref == 1, "Got unexpected ref %lu.\n", ref);
1
0
0
0
Bernhard Kölbl : windows.media.speech/tests: Remove an unnecessary variable.
by Alexandre Julliard
22 Apr '22
22 Apr '22
Module: wine Branch: master Commit: 5839f1da7fcc15eec77e22cb7faa1c76270c4ef0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5839f1da7fcc15eec77e22cb…
Author: Bernhard Kölbl <besentv(a)gmail.com> Date: Fri Apr 22 14:48:03 2022 +0200 windows.media.speech/tests: Remove an unnecessary variable. Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.media.speech/tests/speech.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 4f1f92ded5f..12ac407b751 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -834,7 +834,6 @@ static void test_SpeechRecognizer(void) struct completed_event_handler completed_handler; struct recognition_result_handler result_handler; struct compilation_handler compilation_handler; - struct compilation_handler compilation_handler2; SpeechRecognitionResultStatus result_status; EventRegistrationToken token = { .value = 0 }; AsyncStatus async_status; @@ -1034,11 +1033,11 @@ static void test_SpeechRecognizer(void) IAsyncOperation_SpeechRecognitionCompilationResult_Release(operation); /* Test if AsyncOperation is started immediately. */ - compilation_handler_create_static(&compilation_handler2); - compilation_handler2.event_finished = CreateEventW(NULL, FALSE, FALSE, NULL); - compilation_handler2.thread_id = GetCurrentThreadId(); + compilation_handler_create_static(&compilation_handler); + compilation_handler.event_finished = CreateEventW(NULL, FALSE, FALSE, NULL); + compilation_handler.thread_id = GetCurrentThreadId(); - ok(compilation_handler2.event_finished != NULL, "Finished event wasn't created.\n"); + ok(compilation_handler.event_finished != NULL, "Finished event wasn't created.\n"); hr = ISpeechRecognizer_CompileConstraintsAsync(recognizer, &operation); todo_wine ok(hr == S_OK, "ISpeechRecognizer_CompileConstraintsAsync failed, hr %#lx.\n", hr); @@ -1052,11 +1051,11 @@ static void test_SpeechRecognizer(void) todo_wine ok(hr == S_OK, "IAsyncInfo_get_Status failed, hr %#lx.\n", hr); todo_wine ok(async_status != AsyncStatus_Closed, "Status was %#x.\n", async_status); - hr = IAsyncOperation_SpeechRecognitionCompilationResult_put_Completed(operation, &compilation_handler2.IAsyncHandler_Compilation_iface); + hr = IAsyncOperation_SpeechRecognitionCompilationResult_put_Completed(operation, &compilation_handler.IAsyncHandler_Compilation_iface); todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - todo_wine ok(!WaitForSingleObject(compilation_handler2.event_finished, 1000), "Wait for event_finished failed.\n"); - CloseHandle(compilation_handler2.event_finished); + todo_wine ok(!WaitForSingleObject(compilation_handler.event_finished, 1000), "Wait for event_finished failed.\n"); + CloseHandle(compilation_handler.event_finished); async_status = 0xdeadbeef; hr = IAsyncInfo_get_Status(info, &async_status);
1
0
0
0
Bernhard Kölbl : windows.media.speech/tests: Remove some tests.
by Alexandre Julliard
22 Apr '22
22 Apr '22
Module: wine Branch: master Commit: d25ff1802a0191a03cdba8f7a56e40d50c24e16e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d25ff1802a0191a03cdba8f7…
Author: Bernhard Kölbl <besentv(a)gmail.com> Date: Fri Apr 22 14:48:02 2022 +0200 windows.media.speech/tests: Remove some tests. The tests were mostly broken, racing or inconsistent. Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windows.media.speech/tests/speech.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 3021686b228..4f1f92ded5f 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -966,7 +966,6 @@ static void test_SpeechRecognizer(void) hr = IAsyncOperation_SpeechRecognitionCompilationResult_put_Completed(operation, &compilation_handler.IAsyncHandler_Compilation_iface); todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - todo_wine check_refcount(&compilation_handler.IAsyncHandler_Compilation_iface, 1); todo_wine ok(!WaitForSingleObject(compilation_handler.event_finished, 1000), "Wait for event_finished failed.\n"); CloseHandle(compilation_handler.event_finished); @@ -974,10 +973,8 @@ static void test_SpeechRecognizer(void) hr = IAsyncOperation_SpeechRecognitionCompilationResult_put_Completed(operation, NULL); todo_wine ok(hr == E_ILLEGAL_DELEGATE_ASSIGNMENT, "Got unexpected hr %#lx.\n", hr); - handler = (void*)0xdeadbeef; hr = IAsyncOperation_SpeechRecognitionCompilationResult_get_Completed(operation, &handler); todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - todo_wine ok(handler == NULL, "Handler had value %p.\n", handler); hr = IAsyncOperation_SpeechRecognitionCompilationResult_GetResults(operation, &compilation_result); todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); @@ -996,14 +993,6 @@ static void test_SpeechRecognizer(void) hr = IAsyncOperation_SpeechRecognitionCompilationResult_QueryInterface(operation, &IID_IAsyncInfo, (void **)&info); todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - /* Check if AsyncInfo and AsyncOperation share the same refcount. */ - IAsyncOperation_SpeechRecognitionCompilationResult_AddRef(operation); - todo_wine check_refcount(operation, 3); - todo_wine check_refcount(info, 3); - - IAsyncOperation_SpeechRecognitionCompilationResult_Release(operation); - todo_wine check_refcount(info, 2); - id = 0xdeadbeef; hr = IAsyncInfo_get_Id(info, &id); todo_wine ok(hr == S_OK, "IAsyncInfo_get_Id failed, hr %#lx.\n", hr); @@ -1058,16 +1047,10 @@ static void test_SpeechRecognizer(void) hr = IAsyncOperation_SpeechRecognitionCompilationResult_QueryInterface(operation, &IID_IAsyncInfo, (void **)&info); todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); - /* This one can fail, if the async operation had already finished */ - compilation_result = (void*)0xdeadbeef; - hr = IAsyncOperation_SpeechRecognitionCompilationResult_GetResults(operation, &compilation_result); - todo_wine ok(hr == E_ILLEGAL_METHOD_CALL, "Got unexpected hr %#lx.\n", hr); - todo_wine ok(compilation_result == (void*)0xdeadbeef, "Compilation result had value %p.\n", compilation_result); - async_status = 0xdeadbeef; hr = IAsyncInfo_get_Status(info, &async_status); todo_wine ok(hr == S_OK, "IAsyncInfo_get_Status failed, hr %#lx.\n", hr); - todo_wine ok(async_status == Started || async_status == Completed, "Status was %#x.\n", async_status); + todo_wine ok(async_status != AsyncStatus_Closed, "Status was %#x.\n", async_status); hr = IAsyncOperation_SpeechRecognitionCompilationResult_put_Completed(operation, &compilation_handler2.IAsyncHandler_Compilation_iface); todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
1
0
0
0
Jacek Caban : winex11: Directly use ntdll in X11DRV_GetICMProfile.
by Alexandre Julliard
22 Apr '22
22 Apr '22
Module: wine Branch: master Commit: 30c266a625286f264e65b1e205001f781e5d55c9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=30c266a625286f264e65b1e2…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Apr 22 14:46:45 2022 +0200 winex11: Directly use ntdll in X11DRV_GetICMProfile. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/graphics.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index dadedf2d9cf..715afcb8f6a 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -1660,7 +1660,7 @@ static const WCHAR mntr_key[] = 'V','e','r','s','i','o','n','\\','I','C','M','\\','m','n','t','r'}; static const WCHAR color_path[] = - {'c',':','\\','w','i','n','d','o','w','s','\\','s','y','s','t','e','m','3','2', + {'\\','?','?','\\','c',':','\\','w','i','n','d','o','w','s','\\','s','y','s','t','e','m','3','2', '\\','s','p','o','o','l','\\','d','r','i','v','e','r','s','\\','c','o','l','o','r','\\'}; /*********************************************************************** @@ -1679,6 +1679,8 @@ BOOL CDECL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size, unsigned long buflen, i; ULONG full_size; WCHAR fullname[MAX_PATH + ARRAY_SIZE( color_path )], *p; + UNICODE_STRING name; + OBJECT_ATTRIBUTES attr; if (!size) return FALSE; @@ -1697,8 +1699,10 @@ BOOL CDECL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size, else if ((buffer = get_icm_profile( &buflen ))) { static const WCHAR icm[] = {'.','i','c','m',0}; + IO_STATUS_BLOCK io; UINT64 hash = 0; HANDLE file; + NTSTATUS status; for (i = 0; i < buflen; i++) hash = (hash << 16) - hash + buffer[i]; for (i = 0; i < sizeof(hash) * 2; i++) @@ -1710,14 +1714,15 @@ BOOL CDECL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size, memcpy( p + i, icm, sizeof(icm) ); - file = CreateFileW( fullname, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0 ); - if (file != INVALID_HANDLE_VALUE) + RtlInitUnicodeString( &name, fullname ); + InitializeObjectAttributes( &attr, &name, OBJ_CASE_INSENSITIVE, NULL, NULL ); + status = NtCreateFile( &file, GENERIC_WRITE, &attr, &io, NULL, 0, 0, FILE_CREATE, + FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE, NULL, 0 ); + if (!status) { - DWORD written; - - if (!WriteFile( file, buffer, buflen, &written, NULL ) || written != buflen) - ERR( "Unable to write color profile\n" ); - CloseHandle( file ); + status = NtWriteFile( file, NULL, NULL, NULL, &io, buffer, buflen, NULL, NULL ); + if (status) ERR( "Unable to write color profile: %x\n", status ); + NtClose( file ); } HeapFree( GetProcessHeap(), 0, buffer ); } @@ -1725,7 +1730,7 @@ BOOL CDECL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size, else lstrcpyW( p, srgb ); NtClose( hkey ); - required = strlenW( fullname ) + 1; + required = strlenW( fullname ) + 1 - 4 /* skip NT prefix */; if (*size < required) { *size = required; @@ -1734,9 +1739,12 @@ BOOL CDECL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size, } if (filename) { - strcpyW( filename, fullname ); - if (GetFileAttributesW( filename ) == INVALID_FILE_ATTRIBUTES) - WARN( "color profile not found\n" ); + FILE_BASIC_INFORMATION info; + strcpyW( filename, fullname + 4 ); + RtlInitUnicodeString( &name, fullname ); + InitializeObjectAttributes( &attr, &name, OBJ_CASE_INSENSITIVE, NULL, NULL ); + if (NtQueryAttributesFile( &attr, &info )) + WARN( "color profile not found in %s\n", debugstr_w(fullname) ); } *size = required; return TRUE;
1
0
0
0
Jacek Caban : winex11: Use a simple sdbm hash implementation in X11DRV_GetICMProfile.
by Alexandre Julliard
22 Apr '22
22 Apr '22
Module: wine Branch: master Commit: f1fb42ac4d4924beba3e5d48cf76132a2bbbaecc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f1fb42ac4d4924beba3e5d48…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Apr 22 14:46:31 2022 +0200 winex11: Use a simple sdbm hash implementation in X11DRV_GetICMProfile. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/graphics.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index 4dafb5a339b..dadedf2d9cf 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -1621,12 +1621,13 @@ fallback: return dev->funcs->pGradientFill( dev, vert_array, nvert, grad_array, ngrad, mode ); } -static unsigned char *get_icm_profile( unsigned long *size ) +static char *get_icm_profile( unsigned long *size ) { Atom type; int format; unsigned long count, remaining; - unsigned char *profile, *ret = NULL; + unsigned char *profile; + char *ret = NULL; XGetWindowProperty( gdi_display, DefaultRootWindow(gdi_display), x11drv_atom(_ICC_PROFILE), 0, ~0UL, False, AnyPropertyType, @@ -1674,15 +1675,15 @@ BOOL CDECL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size, DWORD required; char buf[4096]; KEY_VALUE_FULL_INFORMATION *info = (void *)buf; - unsigned char *buffer; - unsigned long buflen; + char *buffer; + unsigned long buflen, i; ULONG full_size; - WCHAR profile[MAX_PATH], fullname[MAX_PATH + ARRAY_SIZE( color_path )]; + WCHAR fullname[MAX_PATH + ARRAY_SIZE( color_path )], *p; if (!size) return FALSE; memcpy( fullname, color_path, sizeof(color_path) ); - fullname[ARRAYSIZE(color_path)] = 0; + p = fullname + ARRAYSIZE(color_path); hkey = reg_open_key( NULL, mntr_key, sizeof(mntr_key) ); @@ -1690,27 +1691,25 @@ BOOL CDECL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size, info, sizeof(buf), &full_size )) { /* FIXME handle multiple values */ - memcpy( fullname + ARRAYSIZE(color_path), info->Name, info->NameLength ); - fullname[ARRAYSIZE(color_path) + info->NameLength / sizeof(WCHAR)] = 0; + memcpy( p, info->Name, info->NameLength ); + p[info->NameLength / sizeof(WCHAR)] = 0; } else if ((buffer = get_icm_profile( &buflen ))) { - static const WCHAR fmt[] = {'%','0','2','x',0}; static const WCHAR icm[] = {'.','i','c','m',0}; - - unsigned char sha1sum[20]; - unsigned int i; - sha_ctx ctx; + UINT64 hash = 0; HANDLE file; - A_SHAInit( &ctx ); - A_SHAUpdate( &ctx, buffer, buflen ); - A_SHAFinal( &ctx, sha1sum ); + for (i = 0; i < buflen; i++) hash = (hash << 16) - hash + buffer[i]; + for (i = 0; i < sizeof(hash) * 2; i++) + { + int digit = hash & 0xf; + p[i] = digit < 10 ? '0' + digit : 'a' - 10 + digit; + hash >>= 4; + } - for (i = 0; i < sizeof(sha1sum); i++) sprintfW( &profile[i * 2], fmt, sha1sum[i] ); - memcpy( &profile[i * 2], icm, sizeof(icm) ); + memcpy( p + i, icm, sizeof(icm) ); - strcatW( fullname, profile ); file = CreateFileW( fullname, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0 ); if (file != INVALID_HANDLE_VALUE) { @@ -1723,7 +1722,7 @@ BOOL CDECL X11DRV_GetICMProfile( PHYSDEV dev, BOOL allow_default, LPDWORD size, HeapFree( GetProcessHeap(), 0, buffer ); } else if (!allow_default) return FALSE; - else strcatW( fullname, srgb ); + else lstrcpyW( p, srgb ); NtClose( hkey ); required = strlenW( fullname ) + 1;
1
0
0
0
Jacek Caban : win32u: Move EnumClipboardFormats implementation from user32.
by Alexandre Julliard
22 Apr '22
22 Apr '22
Module: wine Branch: master Commit: ea9fb81c0998222bf72d982494433c8a2d7149aa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ea9fb81c0998222bf72d9824…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Apr 22 14:46:17 2022 +0200 win32u: Move EnumClipboardFormats implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/clipboard.c | 16 +--------------- dlls/win32u/clipboard.c | 20 ++++++++++++++++++++ dlls/win32u/sysparams.c | 3 +++ dlls/win32u/win32u_private.h | 1 + include/ntuser.h | 6 ++++++ 5 files changed, 31 insertions(+), 15 deletions(-) diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c index 911014ee628..9a7753520f5 100644 --- a/dlls/user32/clipboard.c +++ b/dlls/user32/clipboard.c @@ -764,21 +764,7 @@ done: */ UINT WINAPI EnumClipboardFormats( UINT format ) { - UINT ret = 0; - - SERVER_START_REQ( enum_clipboard_formats ) - { - req->previous = format; - if (!wine_server_call_err( req )) - { - ret = reply->format; - SetLastError( ERROR_SUCCESS ); - } - } - SERVER_END_REQ; - - TRACE( "%s -> %s\n", debugstr_format( format ), debugstr_format( ret )); - return ret; + return NtUserEnumClipboardFormats( format ); } diff --git a/dlls/win32u/clipboard.c b/dlls/win32u/clipboard.c index 29bf36ee80d..bf1c241d7c8 100644 --- a/dlls/win32u/clipboard.c +++ b/dlls/win32u/clipboard.c @@ -334,6 +334,26 @@ DWORD WINAPI NtUserGetClipboardSequenceNumber(void) return seqno; } +/* see EnumClipboardFormats */ +UINT enum_clipboard_formats( UINT format ) +{ + UINT ret = 0; + + SERVER_START_REQ( enum_clipboard_formats ) + { + req->previous = format; + if (!wine_server_call_err( req )) + { + ret = reply->format; + SetLastError( ERROR_SUCCESS ); + } + } + SERVER_END_REQ; + + TRACE( "%s -> %s\n", debugstr_format( format ), debugstr_format( ret )); + return ret; +} + /************************************************************************** * NtUserAddClipboardFormatListener (win32u.@) */ diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 1e8b0fbf489..3b380c017e5 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -4707,6 +4707,9 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ) enable_thunk_lock = arg; return 0; + case NtUserCallOneParam_EnumClipboardFormats: + return enum_clipboard_formats( arg ); + case NtUserCallOneParam_GetClipCursor: return get_clip_cursor( (RECT *)arg ); diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 9d4c7b5021c..4c1b0a7b45b 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -313,6 +313,7 @@ struct unix_funcs }; /* clipboard.c */ +extern UINT enum_clipboard_formats( UINT format ) DECLSPEC_HIDDEN; extern void release_clipboard_owner( HWND hwnd ) DECLSPEC_HIDDEN; /* cursoricon.c */ diff --git a/include/ntuser.h b/include/ntuser.h index 836854a12b4..d06b76ab605 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -637,6 +637,7 @@ enum NtUserCallOneParam_DispatchMessageA, NtUserCallOneParam_EnableDC, NtUserCallOneParam_EnableThunkLock, + NtUserCallOneParam_EnumClipboardFormats, NtUserCallOneParam_GetClipCursor, NtUserCallOneParam_GetCursorPos, NtUserCallOneParam_GetIconParam, @@ -688,6 +689,11 @@ static inline void NtUserEnableThunkLock( BOOL enable ) NtUserCallOneParam( enable, NtUserCallOneParam_EnableThunkLock ); } +static inline UINT NtUserEnumClipboardFormats( UINT format ) +{ + return NtUserCallOneParam( format, NtUserCallOneParam_EnumClipboardFormats ); +} + static inline BOOL NtUserGetClipCursor( RECT *rect ) { return NtUserCallOneParam( (UINT_PTR)rect, NtUserCallOneParam_GetClipCursor );
1
0
0
0
Jacek Caban : win32u: Move NtUserChangeClipboardChain implementation from user32.
by Alexandre Julliard
22 Apr '22
22 Apr '22
Module: wine Branch: master Commit: 357d8654c9fd128e801b7fa914dc635fc84d7b94 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=357d8654c9fd128e801b7fa9…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Apr 22 14:45:59 2022 +0200 win32u: Move NtUserChangeClipboardChain implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/clipboard.c | 27 --------------------------- dlls/user32/user32.spec | 2 +- dlls/win32u/clipboard.c | 26 ++++++++++++++++++++++++++ dlls/win32u/gdiobj.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 + dlls/win32u/wrappers.c | 6 ++++++ include/ntuser.h | 1 + 8 files changed, 37 insertions(+), 29 deletions(-) diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c index 0a502de5846..911014ee628 100644 --- a/dlls/user32/clipboard.c +++ b/dlls/user32/clipboard.c @@ -702,33 +702,6 @@ BOOL WINAPI EmptyClipboard(void) } -/************************************************************************** - * ChangeClipboardChain (USER32.@) - */ -BOOL WINAPI ChangeClipboardChain( HWND hwnd, HWND next ) -{ - NTSTATUS status; - HWND viewer; - - if (!hwnd) return FALSE; - - SERVER_START_REQ( set_clipboard_viewer ) - { - req->viewer = wine_server_user_handle( next ); - req->previous = wine_server_user_handle( hwnd ); - status = wine_server_call( req ); - viewer = wine_server_ptr_handle( reply->old_viewer ); - } - SERVER_END_REQ; - - if (status == STATUS_PENDING) - return !SendMessageW( viewer, WM_CHANGECBCHAIN, (WPARAM)hwnd, (LPARAM)next ); - - if (status) SetLastError( RtlNtStatusToDosError( status )); - return !status; -} - - /************************************************************************** * SetClipboardData (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index fa195442b27..a7b2f7e0681 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -33,7 +33,7 @@ @ stdcall CallWindowProcW(ptr long long long long) @ stdcall CascadeChildWindows(long long) @ stdcall CascadeWindows(long long ptr long ptr) -@ stdcall ChangeClipboardChain(long long) +@ stdcall ChangeClipboardChain(long long) NtUserChangeClipboardChain @ stdcall ChangeDisplaySettingsA(ptr long) @ stdcall ChangeDisplaySettingsExA(str ptr long long ptr) @ stdcall ChangeDisplaySettingsExW(wstr ptr long long ptr) diff --git a/dlls/win32u/clipboard.c b/dlls/win32u/clipboard.c index d4004c045e0..29bf36ee80d 100644 --- a/dlls/win32u/clipboard.c +++ b/dlls/win32u/clipboard.c @@ -274,6 +274,32 @@ HWND WINAPI NtUserGetClipboardViewer(void) return viewer; } +/************************************************************************** + * NtUserChangeClipboardChain (win32u.@) + */ +BOOL WINAPI NtUserChangeClipboardChain( HWND hwnd, HWND next ) +{ + NTSTATUS status; + HWND viewer; + + if (!hwnd) return FALSE; + + SERVER_START_REQ( set_clipboard_viewer ) + { + req->viewer = wine_server_user_handle( next ); + req->previous = wine_server_user_handle( hwnd ); + status = wine_server_call( req ); + viewer = wine_server_ptr_handle( reply->old_viewer ); + } + SERVER_END_REQ; + + if (status == STATUS_PENDING) + return !send_message( viewer, WM_CHANGECBCHAIN, (WPARAM)hwnd, (LPARAM)next ); + + if (status) SetLastError( RtlNtStatusToDosError( status )); + return !status; +} + /************************************************************************** * NtUserGetOpenClipboardWindow (win32u.@) */ diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index 453c4893317..fbaf61a52f6 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -1139,6 +1139,7 @@ static struct unix_funcs unix_funcs = NtUserCallNoParam, NtUserCallOneParam, NtUserCallTwoParam, + NtUserChangeClipboardChain, NtUserChangeDisplaySettings, NtUserClipCursor, NtUserCloseClipboard, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 05818d001cd..aa40be5f652 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -782,7 +782,7 @@ @ stdcall NtUserCallOneParam(long long) @ stdcall NtUserCallTwoParam(long long long) @ stub NtUserCanBrokerForceForeground -@ stub NtUserChangeClipboardChain +@ stdcall NtUserChangeClipboardChain(long long) @ stdcall NtUserChangeDisplaySettings(ptr ptr long long ptr) @ stub NtUserChangeWindowMessageFilterEx @ stub NtUserCheckAccessForIntegrityLevel diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index a693a972830..9d4c7b5021c 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -191,6 +191,7 @@ struct unix_funcs ULONG_PTR (WINAPI *pNtUserCallNoParam)( ULONG code ); ULONG_PTR (WINAPI *pNtUserCallOneParam)( ULONG_PTR arg, ULONG code ); ULONG_PTR (WINAPI *pNtUserCallTwoParam)( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code ); + BOOL (WINAPI *pNtUserChangeClipboardChain)( HWND hwnd, HWND next ); LONG (WINAPI *pNtUserChangeDisplaySettings)( UNICODE_STRING *devname, DEVMODEW *devmode, HWND hwnd, DWORD flags, void *lparam ); BOOL (WINAPI *pNtUserClipCursor)( const RECT *rect ); diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c index 994f8c63a5b..d3497d29f03 100644 --- a/dlls/win32u/wrappers.c +++ b/dlls/win32u/wrappers.c @@ -755,6 +755,12 @@ BOOL WINAPI NtUserCloseClipboard(void) return unix_funcs->pNtUserCloseClipboard(); } +BOOL WINAPI NtUserChangeClipboardChain( HWND hwnd, HWND next ) +{ + if (!unix_funcs) return DISP_CHANGE_FAILED; + return unix_funcs->pNtUserChangeClipboardChain( hwnd, next ); +} + LONG WINAPI NtUserChangeDisplaySettings( UNICODE_STRING *devname, DEVMODEW *devmode, HWND hwnd, DWORD flags, void *lparam ) { diff --git a/include/ntuser.h b/include/ntuser.h index 5d49cd8caba..836854a12b4 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -417,6 +417,7 @@ LRESULT WINAPI NtUserCallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARA ULONG_PTR WINAPI NtUserCallNoParam( ULONG code ); ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code ); ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code ); +BOOL WINAPI NtUserChangeClipboardChain( HWND hwnd, HWND next ); LONG WINAPI NtUserChangeDisplaySettings( UNICODE_STRING *devname, DEVMODEW *devmode, HWND hwnd, DWORD flags, void *lparam ); DWORD WINAPI NtUserCheckMenuItem( HMENU handle, UINT id, UINT flags );
1
0
0
0
Jacek Caban : win32u: Move NtUserSetClipboardViewer implementation from user32.
by Alexandre Julliard
22 Apr '22
22 Apr '22
Module: wine Branch: master Commit: c38e287befdf1f2910d7e23ccff5638d57cd411d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c38e287befdf1f2910d7e23c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Apr 22 14:45:43 2022 +0200 win32u: Move NtUserSetClipboardViewer implementation from user32. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/clipboard.c | 25 ------------------------- dlls/user32/user32.spec | 2 +- dlls/win32u/clipboard.c | 26 ++++++++++++++++++++++++++ dlls/win32u/gdiobj.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 1 + dlls/win32u/wrappers.c | 6 ++++++ include/ntuser.h | 1 + 8 files changed, 37 insertions(+), 27 deletions(-) diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c index f2861fce28f..0a502de5846 100644 --- a/dlls/user32/clipboard.c +++ b/dlls/user32/clipboard.c @@ -702,31 +702,6 @@ BOOL WINAPI EmptyClipboard(void) } -/************************************************************************** - * SetClipboardViewer (USER32.@) - */ -HWND WINAPI SetClipboardViewer( HWND hwnd ) -{ - HWND prev = 0, owner = 0; - - SERVER_START_REQ( set_clipboard_viewer ) - { - req->viewer = wine_server_user_handle( hwnd ); - if (!wine_server_call_err( req )) - { - prev = wine_server_ptr_handle( reply->old_viewer ); - owner = wine_server_ptr_handle( reply->owner ); - } - } - SERVER_END_REQ; - - if (hwnd) SendNotifyMessageW( hwnd, WM_DRAWCLIPBOARD, (WPARAM)owner, 0 ); - - TRACE( "%p returning %p\n", hwnd, prev ); - return prev; -} - - /************************************************************************** * ChangeClipboardChain (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index f8683a78426..fa195442b27 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -655,7 +655,7 @@ @ stdcall SetClassLongW(long long long) @ stdcall SetClassWord(long long long) NtUserSetClassWord @ stdcall SetClipboardData(long long) -@ stdcall SetClipboardViewer(long) +@ stdcall SetClipboardViewer(long) NtUserSetClipboardViewer @ stdcall SetCoalescableTimer(long long long ptr long) NtUserSetTimer # @ stub SetConsoleReserveKeys @ stdcall -import SetCursor(long) NtUserSetCursor diff --git a/dlls/win32u/clipboard.c b/dlls/win32u/clipboard.c index f49d9db3b9d..d4004c045e0 100644 --- a/dlls/win32u/clipboard.c +++ b/dlls/win32u/clipboard.c @@ -231,6 +231,32 @@ HWND WINAPI NtUserGetClipboardOwner(void) return owner; } +/************************************************************************** + * NtUserSetClipboardViewer (win32u.@) + */ +HWND WINAPI NtUserSetClipboardViewer( HWND hwnd ) +{ + HWND prev = 0, owner = 0; + + SERVER_START_REQ( set_clipboard_viewer ) + { + req->viewer = wine_server_user_handle( hwnd ); + if (!wine_server_call_err( req )) + { + prev = wine_server_ptr_handle( reply->old_viewer ); + owner = wine_server_ptr_handle( reply->owner ); + } + } + SERVER_END_REQ; + + if (hwnd) + NtUserMessageCall( hwnd, WM_DRAWCLIPBOARD, (WPARAM)owner, 0, + NULL, NtUserSendNotifyMessage, FALSE ); + + TRACE( "%p returning %p\n", hwnd, prev ); + return prev; +} + /************************************************************************** * NtUserGetClipboardViewer (win32u.@) */ diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index c0f21662403..453c4893317 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -1192,6 +1192,7 @@ static struct unix_funcs unix_funcs = NtUserSetClassLong, NtUserSetClassLongPtr, NtUserSetClassWord, + NtUserSetClipboardViewer, NtUserSetCursor, NtUserSetCursorIconData, NtUserSetCursorPos, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index f3e2f9ca2f5..05818d001cd 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1175,7 +1175,7 @@ @ stdcall NtUserSetClassLongPtr(long long long long) @ stdcall NtUserSetClassWord(long long long) @ stub NtUserSetClipboardData -@ stub NtUserSetClipboardViewer +@ stdcall NtUserSetClipboardViewer(long) @ stub NtUserSetCoreWindow @ stub NtUserSetCoreWindowPartner @ stdcall NtUserSetCursor(long) diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 2299330be0d..a693a972830 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -263,6 +263,7 @@ struct unix_funcs DWORD (WINAPI *pNtUserSetClassLong)( HWND hwnd, INT offset, LONG newval, BOOL ansi ); ULONG_PTR (WINAPI *pNtUserSetClassLongPtr)( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi ); WORD (WINAPI *pNtUserSetClassWord)( HWND hwnd, INT offset, WORD newval ); + HWND (WINAPI *pNtUserSetClipboardViewer)( HWND hwnd ); HCURSOR (WINAPI *pNtUserSetCursor)( HCURSOR cursor ); BOOL (WINAPI *pNtUserSetCursorIconData)( HCURSOR cursor, UNICODE_STRING *module, UNICODE_STRING *res_name, struct cursoricon_desc *desc ); diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c index d8b117bac8f..994f8c63a5b 100644 --- a/dlls/win32u/wrappers.c +++ b/dlls/win32u/wrappers.c @@ -1088,6 +1088,12 @@ WORD WINAPI NtUserSetClassWord( HWND hwnd, INT offset, WORD newval ) return unix_funcs->pNtUserSetClassWord( hwnd, offset, newval ); } +HWND WINAPI NtUserSetClipboardViewer( HWND hwnd ) +{ + if (!unix_funcs) return 0; + return unix_funcs->pNtUserSetClipboardViewer( hwnd ); +} + BOOL WINAPI NtUserSetCursorIconData( HCURSOR cursor, UNICODE_STRING *module, UNICODE_STRING *res_name, struct cursoricon_desc *desc ) { diff --git a/include/ntuser.h b/include/ntuser.h index 7fc52979e7e..5d49cd8caba 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -547,6 +547,7 @@ HWND WINAPI NtUserSetCapture( HWND hwnd ); DWORD WINAPI NtUserSetClassLong( HWND hwnd, INT offset, LONG newval, BOOL ansi ); ULONG_PTR WINAPI NtUserSetClassLongPtr( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi ); WORD WINAPI NtUserSetClassWord( HWND hwnd, INT offset, WORD newval ); +HWND WINAPI NtUserSetClipboardViewer( HWND hwnd ); HCURSOR WINAPI NtUserSetCursor( HCURSOR cursor ); BOOL WINAPI NtUserSetCursorIconData( HCURSOR cursor, UNICODE_STRING *module, UNICODE_STRING *res_name, struct cursoricon_desc *desc );
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
103
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
Results per page:
10
25
50
100
200