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
July
June
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
June 2020
----- 2025 -----
July 2025
June 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
947 discussions
Start a n
N
ew thread
Alistair Leslie-Hughes : directmanipulation: Fake success from IDirectManipulationContent::SetContentRect.
by Alexandre Julliard
24 Jun '20
24 Jun '20
Module: wine Branch: master Commit: d0275d4671a811597f57f332c628501301e8cf18 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d0275d4671a811597f57f332…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Jun 24 00:47:29 2020 +0200 directmanipulation: Fake success from IDirectManipulationContent::SetContentRect. Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/directmanipulation/directmanipulation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c index 796e906d64..1460872020 100644 --- a/dlls/directmanipulation/directmanipulation.c +++ b/dlls/directmanipulation/directmanipulation.c @@ -357,7 +357,7 @@ static HRESULT WINAPI content_SetContentRect(IDirectManipulationContent *iface, { struct primarycontext *This = impl_from_IDirectManipulationContent(iface); FIXME("%p, %p\n", This, size); - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI content_GetViewport(IDirectManipulationContent *iface, REFIID riid, void **object)
1
0
0
0
Alistair Leslie-Hughes : directmanipulation: Fake success from IDirectManipulationViewport2::ActivateConfiguration.
by Alexandre Julliard
24 Jun '20
24 Jun '20
Module: wine Branch: master Commit: b2c3d26ee5fa7cc89243831b8d5882411026ddb5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b2c3d26ee5fa7cc89243831b…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Tue Jul 30 09:30:41 2019 +1000 directmanipulation: Fake success from IDirectManipulationViewport2::ActivateConfiguration. Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/directmanipulation/directmanipulation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/directmanipulation/directmanipulation.c b/dlls/directmanipulation/directmanipulation.c index dd2fdda69a..796e906d64 100644 --- a/dlls/directmanipulation/directmanipulation.c +++ b/dlls/directmanipulation/directmanipulation.c @@ -631,7 +631,7 @@ static HRESULT WINAPI viewport_ActivateConfiguration(IDirectManipulationViewport { struct directviewport *This = impl_from_IDirectManipulationViewport2(iface); FIXME("%p, %d\n", This, configuration); - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI viewport_SetManualGesture(IDirectManipulationViewport2 *iface, DIRECTMANIPULATION_GESTURE_CONFIGURATION configuration)
1
0
0
0
Rémi Bernon : user32/tests: Add RIM_EXINPUTSINK rawinput message tests.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: bc282905d9491b9f9fe4ae4b69a8ccdf99c5aaa8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bc282905d9491b9f9fe4ae4b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 15 12:05:43 2020 +0200 user32/tests: Add RIM_EXINPUTSINK rawinput message tests. When RIM_EXINPUTSINK is used, messages are received in background only if the foreground process didn't register for rawinput messages itself. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/input.c | 48 ++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 66d421896f..9ec829860a 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -1888,6 +1888,9 @@ struct rawinput_test rawinput_tests[] = { TRUE, TRUE, 0, FALSE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, { TRUE, TRUE, RIDEV_INPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, TRUE, FALSE }, { TRUE, TRUE, RIDEV_INPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, TRUE, FALSE }, + + { TRUE, TRUE, RIDEV_EXINPUTSINK, FALSE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, + { TRUE, TRUE, RIDEV_EXINPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, TRUE, FALSE }, }; static void rawinput_test_process(void) @@ -1922,6 +1925,8 @@ static void rawinput_test_process(void) case 9: case 10: case 11: + case 12: + case 13: GetCursorPos(&pt); hwnd = CreateWindowA("static", "static", WS_VISIBLE | WS_POPUP, @@ -1938,7 +1943,7 @@ static void rawinput_test_process(void) UpdateWindow(hwnd); empty_message_queue(); - if (i == 9 || i == 10 || i == 11) + if (i == 9 || i == 10 || i == 11 || i == 12) { raw_devices[0].usUsagePage = 0x01; raw_devices[0].usUsage = 0x02; @@ -1967,7 +1972,7 @@ static void rawinput_test_process(void) ResetEvent(done); - if (i == 9 || i == 10 || i == 11) + if (i == 9 || i == 10 || i == 11 || i == 12) { raw_devices[0].dwFlags = RIDEV_REMOVE; raw_devices[0].hwndTarget = 0; @@ -2054,6 +2059,7 @@ static void test_rawinput(const char* argv0) DWORD ret; POINT pt, newpt; HWND hwnd; + BOOL skipped; char path[MAX_PATH]; int i; @@ -2117,14 +2123,16 @@ static void test_rawinput(const char* argv0) raw_devices[0].dwFlags = rawinput_tests[i].register_flags; raw_devices[0].hwndTarget = rawinput_tests[i].register_window ? hwnd : 0; - if (rawinput_tests[i].register_device) + if (!rawinput_tests[i].register_device) + skipped = FALSE; + else { SetLastError(0xdeadbeef); - ret = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); - ok(ret || broken(rawinput_tests[i].register_flags == RIDEV_EXINPUTSINK), /* < vista */ - "%d: RegisterRawInputDevices failed\n", i); - ok(GetLastError() == 0xdeadbeef || broken(rawinput_tests[i].register_flags == RIDEV_EXINPUTSINK), /* < vista */ - "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError()); + skipped = !RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); + if (rawinput_tests[i].register_flags == RIDEV_EXINPUTSINK && skipped) + win_skip("RIDEV_EXINPUTSINK not supported\n"); + else + ok(!skipped, "%d: RegisterRawInputDevices failed: %u\n", i, GetLastError()); } SetEvent(process_ready); @@ -2141,15 +2149,18 @@ static void test_rawinput(const char* argv0) SetEvent(process_done); SetEvent(params.done); - todo_wine_if(rawinput_tests[i].todo_legacy) - ok(rawinput_test_received_legacy == rawinput_tests[i].expect_legacy, - "%d: %sexpected WM_MOUSEMOVE message\n", i, rawinput_tests[i].expect_legacy ? "" : "un"); - todo_wine_if(rawinput_tests[i].todo_raw) - ok(rawinput_test_received_raw == rawinput_tests[i].expect_raw, - "%d: %sexpected WM_INPUT message\n", i, rawinput_tests[i].expect_raw ? "" : "un"); - todo_wine_if(rawinput_tests[i].todo_rawfg) - ok(rawinput_test_received_rawfg == rawinput_tests[i].expect_rawfg, - "%d: %sexpected RIM_INPUT message\n", i, rawinput_tests[i].expect_rawfg ? "" : "un"); + if (!skipped) + { + todo_wine_if(rawinput_tests[i].todo_legacy) + ok(rawinput_test_received_legacy == rawinput_tests[i].expect_legacy, + "%d: %sexpected WM_MOUSEMOVE message\n", i, rawinput_tests[i].expect_legacy ? "" : "un"); + todo_wine_if(rawinput_tests[i].todo_raw) + ok(rawinput_test_received_raw == rawinput_tests[i].expect_raw, + "%d: %sexpected WM_INPUT message\n", i, rawinput_tests[i].expect_raw ? "" : "un"); + todo_wine_if(rawinput_tests[i].todo_rawfg) + ok(rawinput_test_received_rawfg == rawinput_tests[i].expect_rawfg, + "%d: %sexpected RIM_INPUT message\n", i, rawinput_tests[i].expect_rawfg ? "" : "un"); + } GetCursorPos(&newpt); ok((newpt.x - pt.x) == 5 || (newpt.x - pt.x) == 4, "%d: Unexpected cursor movement\n", i); @@ -2161,8 +2172,7 @@ static void test_rawinput(const char* argv0) SetLastError(0xdeadbeef); ret = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); - ok(ret, "%d: RegisterRawInputDevices failed\n", i); - ok(GetLastError() == 0xdeadbeef, "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError()); + ok(ret, "%d: RegisterRawInputDevices failed: %u\n", i, GetLastError()); } DestroyWindow(hwnd);
1
0
0
0
Rémi Bernon : user32/tests: Add inter-process rawinput message tests.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: df5d632324815549d0e7933e64b1d30265145585 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=df5d632324815549d0e7933e…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 15 12:05:42 2020 +0200 user32/tests: Add inter-process rawinput message tests. Rawinput messages are not received anymore if the foreground window is from another process. Using RIDEV_INPUTSINK makes it possible to receive them again, but with RIM_INPUTSINK flag. When multiple processes register for rawinput messages, the foreground process will receive the message, as well as any other that registerd with RIM_INPUTSINK flag, including when the foreground process itself did. Currently the messages may be received correctly, but that depends on where the input events are generated, so add another test case with messages sent from the test process, and validate that nothing should be received. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/input.c | 168 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 162 insertions(+), 6 deletions(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 5fdc3ff36d..66d421896f 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -1878,8 +1878,119 @@ struct rawinput_test rawinput_tests[] = /* same-process foreground tests */ { TRUE, FALSE, 0, FALSE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, { TRUE, TRUE, 0, FALSE, TRUE, TRUE, /* todos: */ FALSE, FALSE, FALSE }, + + /* cross-process foreground tests */ + { TRUE, TRUE, 0, FALSE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, + { TRUE, TRUE, RIDEV_INPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, TRUE, FALSE }, + { TRUE, TRUE, 0, FALSE, FALSE, FALSE, /* todos: */ FALSE, TRUE, TRUE }, + + /* multi-process rawinput tests */ + { TRUE, TRUE, 0, FALSE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, + { TRUE, TRUE, RIDEV_INPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, TRUE, FALSE }, + { TRUE, TRUE, RIDEV_INPUTSINK, FALSE, TRUE, FALSE, /* todos: */ FALSE, TRUE, FALSE }, }; +static void rawinput_test_process(void) +{ + RAWINPUTDEVICE raw_devices[1]; + HANDLE ready, start, done; + DWORD ret; + POINT pt; + HWND hwnd = NULL; + MSG msg; + int i; + + ready = OpenEventA(EVENT_ALL_ACCESS, FALSE, "rawinput_test_process_ready"); + ok(ready != 0, "OpenEventA failed, error: %u\n", GetLastError()); + + start = OpenEventA(EVENT_ALL_ACCESS, FALSE, "rawinput_test_process_start"); + ok(start != 0, "OpenEventA failed, error: %u\n", GetLastError()); + + done = OpenEventA(EVENT_ALL_ACCESS, FALSE, "rawinput_test_process_done"); + ok(done != 0, "OpenEventA failed, error: %u\n", GetLastError()); + + for (i = 0; i < ARRAY_SIZE(rawinput_tests); ++i) + { + WaitForSingleObject(ready, INFINITE); + ResetEvent(ready); + + switch (i) + { + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + GetCursorPos(&pt); + + hwnd = CreateWindowA("static", "static", WS_VISIBLE | WS_POPUP, + pt.x - 50, pt.y - 50, 100, 100, 0, NULL, NULL, NULL); + SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)rawinput_wndproc); + ok(hwnd != 0, "CreateWindow failed\n"); + empty_message_queue(); + + /* FIXME: Try to workaround X11/Win32 focus inconsistencies and + * make the window visible and foreground as hard as possible. */ + ShowWindow(hwnd, SW_SHOW); + SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + SetForegroundWindow(hwnd); + UpdateWindow(hwnd); + empty_message_queue(); + + if (i == 9 || i == 10 || i == 11) + { + raw_devices[0].usUsagePage = 0x01; + raw_devices[0].usUsage = 0x02; + raw_devices[0].dwFlags = i == 11 ? RIDEV_INPUTSINK : 0; + raw_devices[0].hwndTarget = i == 11 ? hwnd : 0; + + SetLastError(0xdeadbeef); + ret = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); + ok(ret, "%d: RegisterRawInputDevices failed\n", i); + ok(GetLastError() == 0xdeadbeef, "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError()); + } + + rawinput_test_received_legacy = FALSE; + rawinput_test_received_raw = FALSE; + rawinput_test_received_rawfg = FALSE; + + if (i != 8) mouse_event(MOUSEEVENTF_MOVE, 5, 0, 0, 0); + empty_message_queue(); + break; + } + + SetEvent(start); + + while (MsgWaitForMultipleObjects(1, &done, FALSE, INFINITE, QS_ALLINPUT) != WAIT_OBJECT_0) + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + + ResetEvent(done); + + if (i == 9 || i == 10 || i == 11) + { + raw_devices[0].dwFlags = RIDEV_REMOVE; + raw_devices[0].hwndTarget = 0; + + ok(rawinput_test_received_legacy, "%d: foreground process expected WM_MOUSEMOVE message\n", i); + ok(rawinput_test_received_raw, "%d: foreground process expected WM_INPUT message\n", i); + ok(rawinput_test_received_rawfg, "%d: foreground process expected RIM_INPUT message\n", i); + + SetLastError(0xdeadbeef); + ret = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); + ok(ret, "%d: RegisterRawInputDevices failed\n", i); + ok(GetLastError() == 0xdeadbeef, "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError()); + } + + if (hwnd) DestroyWindow(hwnd); + } + + WaitForSingleObject(ready, INFINITE); + CloseHandle(done); + CloseHandle(start); + CloseHandle(ready); +} + struct rawinput_test_thread_params { HANDLE ready; @@ -1933,14 +2044,17 @@ static DWORD WINAPI rawinput_test_thread(void *arg) return 0; } -static void test_rawinput(void) +static void test_rawinput(const char* argv0) { struct rawinput_test_thread_params params; + PROCESS_INFORMATION process_info; RAWINPUTDEVICE raw_devices[1]; - HANDLE thread; + STARTUPINFOA startup_info; + HANDLE thread, process_ready, process_start, process_done; DWORD ret; POINT pt, newpt; HWND hwnd; + char path[MAX_PATH]; int i; params.ready = CreateEventA(NULL, FALSE, FALSE, NULL); @@ -1955,6 +2069,24 @@ static void test_rawinput(void) thread = CreateThread(NULL, 0, rawinput_test_thread, ¶ms, 0, NULL); ok(thread != NULL, "CreateThread failed\n"); + process_ready = CreateEventA(NULL, FALSE, FALSE, "rawinput_test_process_ready"); + ok(process_ready != NULL, "CreateEventA failed\n"); + + process_start = CreateEventA(NULL, FALSE, FALSE, "rawinput_test_process_start"); + ok(process_start != NULL, "CreateEventA failed\n"); + + process_done = CreateEventA(NULL, FALSE, FALSE, "rawinput_test_process_done"); + ok(process_done != NULL, "CreateEventA failed\n"); + + memset(&startup_info, 0, sizeof(startup_info)); + startup_info.cb = sizeof(startup_info); + startup_info.dwFlags = STARTF_USESHOWWINDOW; + startup_info.wShowWindow = SW_SHOWNORMAL; + + sprintf(path, "%s input rawinput_test", argv0); + ret = CreateProcessA(NULL, path, NULL, NULL, TRUE, 0, NULL, NULL, &startup_info, &process_info ); + ok(ret, "CreateProcess \"%s\" failed err %u.\n", path, GetLastError()); + SetCursorPos(100, 100); empty_message_queue(); @@ -1989,17 +2121,24 @@ static void test_rawinput(void) { SetLastError(0xdeadbeef); ret = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); - ok(ret, "%d: RegisterRawInputDevices failed\n", i); - ok(GetLastError() == 0xdeadbeef, "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError()); + ok(ret || broken(rawinput_tests[i].register_flags == RIDEV_EXINPUTSINK), /* < vista */ + "%d: RegisterRawInputDevices failed\n", i); + ok(GetLastError() == 0xdeadbeef || broken(rawinput_tests[i].register_flags == RIDEV_EXINPUTSINK), /* < vista */ + "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError()); } + SetEvent(process_ready); + WaitForSingleObject(process_start, INFINITE); + ResetEvent(process_start); + SetEvent(params.ready); WaitForSingleObject(params.start, INFINITE); ResetEvent(params.start); - if (i <= 3) mouse_event(MOUSEEVENTF_MOVE, 5, 0, 0, 0); + if (i <= 3 || i == 8) mouse_event(MOUSEEVENTF_MOVE, 5, 0, 0, 0); empty_message_queue(); + SetEvent(process_done); SetEvent(params.done); todo_wine_if(rawinput_tests[i].todo_legacy) @@ -2029,6 +2168,14 @@ static void test_rawinput(void) DestroyWindow(hwnd); } + SetEvent(process_ready); + winetest_wait_child_process(process_info.hProcess); + CloseHandle(process_info.hProcess); + CloseHandle(process_info.hThread); + CloseHandle(process_done); + CloseHandle(process_start); + CloseHandle(process_ready); + WaitForSingleObject(thread, INFINITE); CloseHandle(params.done); @@ -3230,11 +3377,20 @@ static void test_UnregisterDeviceNotification(void) START_TEST(input) { + char **argv; + int argc; POINT pos; init_function_pointers(); GetCursorPos( &pos ); + argc = winetest_get_mainargs(&argv); + if (argc >= 3 && strcmp(argv[2], "rawinput_test") == 0) + { + rawinput_test_process(); + return; + } + test_Input_blackbox(); test_Input_whitebox(); test_Input_unicode(); @@ -3252,7 +3408,7 @@ START_TEST(input) test_OemKeyScan(); test_GetRawInputData(); test_RegisterRawInputDevices(); - test_rawinput(); + test_rawinput(argv[0]); if(pGetMouseMovePointsEx) test_GetMouseMovePointsEx();
1
0
0
0
Rémi Bernon : user32/tests: Add inter-thread rawinput message tests.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: 8c7c0c5504f838253646ac5f47c9be178091de99 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8c7c0c5504f838253646ac5f…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 15 12:05:41 2020 +0200 user32/tests: Add inter-thread rawinput message tests. The rawinput messages are received on the target window if is from the same process as the foreground window, it doesn't need to be the foreground window itself, or use RIDEV_INPUTSINK. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/input.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 172bcc3c8d..5fdc3ff36d 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -1874,16 +1874,87 @@ struct rawinput_test rawinput_tests[] = { TRUE, FALSE, 0, TRUE, TRUE, TRUE, /* todos: */ FALSE, FALSE, FALSE }, { TRUE, TRUE, 0, TRUE, TRUE, TRUE, /* todos: */ FALSE, FALSE, FALSE }, { TRUE, TRUE, RIDEV_NOLEGACY, FALSE, TRUE, TRUE, /* todos: */ TRUE, FALSE, FALSE }, + + /* same-process foreground tests */ + { TRUE, FALSE, 0, FALSE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, + { TRUE, TRUE, 0, FALSE, TRUE, TRUE, /* todos: */ FALSE, FALSE, FALSE }, }; +struct rawinput_test_thread_params +{ + HANDLE ready; + HANDLE start; + HANDLE done; +}; + +static DWORD WINAPI rawinput_test_thread(void *arg) +{ + struct rawinput_test_thread_params *params = arg; + POINT pt; + HWND hwnd = NULL; + int i; + + for (i = 0; i < ARRAY_SIZE(rawinput_tests); ++i) + { + WaitForSingleObject(params->ready, INFINITE); + ResetEvent(params->ready); + + switch (i) + { + case 4: + case 5: + GetCursorPos(&pt); + + hwnd = CreateWindowA("static", "static", WS_VISIBLE | WS_POPUP, + pt.x - 50, pt.y - 50, 100, 100, 0, NULL, NULL, NULL); + ok(hwnd != 0, "CreateWindow failed\n"); + empty_message_queue(); + + /* FIXME: Try to workaround X11/Win32 focus inconsistencies and + * make the window visible and foreground as hard as possible. */ + ShowWindow(hwnd, SW_SHOW); + SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + SetForegroundWindow(hwnd); + UpdateWindow(hwnd); + empty_message_queue(); + + mouse_event(MOUSEEVENTF_MOVE, 5, 0, 0, 0); + empty_message_queue(); + break; + } + + SetEvent(params->start); + + WaitForSingleObject(params->done, INFINITE); + ResetEvent(params->done); + if (hwnd) DestroyWindow(hwnd); + } + + return 0; +} + static void test_rawinput(void) { + struct rawinput_test_thread_params params; RAWINPUTDEVICE raw_devices[1]; + HANDLE thread; DWORD ret; POINT pt, newpt; HWND hwnd; int i; + params.ready = CreateEventA(NULL, FALSE, FALSE, NULL); + ok(params.ready != NULL, "CreateEvent failed\n"); + + params.start = CreateEventA(NULL, FALSE, FALSE, NULL); + ok(params.start != NULL, "CreateEvent failed\n"); + + params.done = CreateEventA(NULL, FALSE, FALSE, NULL); + ok(params.done != NULL, "CreateEvent failed\n"); + + thread = CreateThread(NULL, 0, rawinput_test_thread, ¶ms, 0, NULL); + ok(thread != NULL, "CreateThread failed\n"); + SetCursorPos(100, 100); empty_message_queue(); @@ -1922,9 +1993,15 @@ static void test_rawinput(void) ok(GetLastError() == 0xdeadbeef, "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError()); } - mouse_event(MOUSEEVENTF_MOVE, 5, 0, 0, 0); + SetEvent(params.ready); + WaitForSingleObject(params.start, INFINITE); + ResetEvent(params.start); + + if (i <= 3) mouse_event(MOUSEEVENTF_MOVE, 5, 0, 0, 0); empty_message_queue(); + SetEvent(params.done); + todo_wine_if(rawinput_tests[i].todo_legacy) ok(rawinput_test_received_legacy == rawinput_tests[i].expect_legacy, "%d: %sexpected WM_MOUSEMOVE message\n", i, rawinput_tests[i].expect_legacy ? "" : "un"); @@ -1951,6 +2028,13 @@ static void test_rawinput(void) DestroyWindow(hwnd); } + + WaitForSingleObject(thread, INFINITE); + + CloseHandle(params.done); + CloseHandle(params.start); + CloseHandle(params.ready); + CloseHandle(thread); } static void test_key_map(void)
1
0
0
0
Rémi Bernon : user32/tests: Add basic rawinput message tests.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: 36a74a7002143937d0377b0a238ee2035255e359 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=36a74a7002143937d0377b0a…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Jun 15 12:05:40 2020 +0200 user32/tests: Add basic rawinput message tests. This tests basic functionality by injecting mouse event and checking the number of each messages received. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/input.c | 135 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 913fabfbd8..172bcc3c8d 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -1819,6 +1819,140 @@ static void test_RegisterRawInputDevices(void) DestroyWindow(hwnd); } +static BOOL rawinput_test_received_legacy; +static BOOL rawinput_test_received_raw; +static BOOL rawinput_test_received_rawfg; + +static LRESULT CALLBACK rawinput_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + UINT ret, raw_size; + RAWINPUT raw; + + if (msg == WM_INPUT) + { + todo_wine_if(rawinput_test_received_raw) + ok(!rawinput_test_received_raw, "Unexpected spurious WM_INPUT message.\n"); + ok(wparam == RIM_INPUT || wparam == RIM_INPUTSINK, "Unexpected wparam: %lu\n", wparam); + + rawinput_test_received_raw = TRUE; + if (wparam == RIM_INPUT) rawinput_test_received_rawfg = TRUE; + + ret = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, NULL, &raw_size, sizeof(RAWINPUTHEADER)); + ok(ret == 0, "GetRawInputData failed\n"); + ok(raw_size <= sizeof(raw), "Unexpected rawinput data size: %u", raw_size); + + raw_size = sizeof(raw); + ret = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &raw, &raw_size, sizeof(RAWINPUTHEADER)); + ok(ret > 0 && ret != (UINT)-1, "GetRawInputData failed\n"); + ok(raw.header.dwType == RIM_TYPEMOUSE, "Unexpected rawinput type: %u\n", raw.header.dwType); + + ok(!(raw.data.mouse.usFlags & MOUSE_MOVE_ABSOLUTE), "Unexpected absolute rawinput motion\n"); + ok(!(raw.data.mouse.usFlags & MOUSE_VIRTUAL_DESKTOP), "Unexpected virtual desktop rawinput motion\n"); + } + + if (msg == WM_MOUSEMOVE) rawinput_test_received_legacy = TRUE; + + return DefWindowProcA(hwnd, msg, wparam, lparam); +} + +struct rawinput_test +{ + BOOL register_device; + BOOL register_window; + DWORD register_flags; + BOOL expect_legacy; + BOOL expect_raw; + BOOL expect_rawfg; + BOOL todo_legacy; + BOOL todo_raw; + BOOL todo_rawfg; +}; + +struct rawinput_test rawinput_tests[] = +{ + { FALSE, FALSE, 0, TRUE, FALSE, FALSE, /* todos: */ FALSE, FALSE, FALSE }, + { TRUE, FALSE, 0, TRUE, TRUE, TRUE, /* todos: */ FALSE, FALSE, FALSE }, + { TRUE, TRUE, 0, TRUE, TRUE, TRUE, /* todos: */ FALSE, FALSE, FALSE }, + { TRUE, TRUE, RIDEV_NOLEGACY, FALSE, TRUE, TRUE, /* todos: */ TRUE, FALSE, FALSE }, +}; + +static void test_rawinput(void) +{ + RAWINPUTDEVICE raw_devices[1]; + DWORD ret; + POINT pt, newpt; + HWND hwnd; + int i; + + SetCursorPos(100, 100); + empty_message_queue(); + + for (i = 0; i < ARRAY_SIZE(rawinput_tests); ++i) + { + GetCursorPos(&pt); + + hwnd = CreateWindowA("static", "static", WS_VISIBLE | WS_POPUP, + pt.x - 50, pt.y - 50, 100, 100, 0, NULL, NULL, NULL); + ok(hwnd != 0, "CreateWindow failed\n"); + SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)rawinput_wndproc); + empty_message_queue(); + + /* FIXME: Try to workaround X11/Win32 focus inconsistencies and + * make the window visible and foreground as hard as possible. */ + ShowWindow(hwnd, SW_SHOW); + SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + SetForegroundWindow(hwnd); + UpdateWindow(hwnd); + empty_message_queue(); + + rawinput_test_received_legacy = FALSE; + rawinput_test_received_raw = FALSE; + rawinput_test_received_rawfg = FALSE; + + raw_devices[0].usUsagePage = 0x01; + raw_devices[0].usUsage = 0x02; + raw_devices[0].dwFlags = rawinput_tests[i].register_flags; + raw_devices[0].hwndTarget = rawinput_tests[i].register_window ? hwnd : 0; + + if (rawinput_tests[i].register_device) + { + SetLastError(0xdeadbeef); + ret = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); + ok(ret, "%d: RegisterRawInputDevices failed\n", i); + ok(GetLastError() == 0xdeadbeef, "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError()); + } + + mouse_event(MOUSEEVENTF_MOVE, 5, 0, 0, 0); + empty_message_queue(); + + todo_wine_if(rawinput_tests[i].todo_legacy) + ok(rawinput_test_received_legacy == rawinput_tests[i].expect_legacy, + "%d: %sexpected WM_MOUSEMOVE message\n", i, rawinput_tests[i].expect_legacy ? "" : "un"); + todo_wine_if(rawinput_tests[i].todo_raw) + ok(rawinput_test_received_raw == rawinput_tests[i].expect_raw, + "%d: %sexpected WM_INPUT message\n", i, rawinput_tests[i].expect_raw ? "" : "un"); + todo_wine_if(rawinput_tests[i].todo_rawfg) + ok(rawinput_test_received_rawfg == rawinput_tests[i].expect_rawfg, + "%d: %sexpected RIM_INPUT message\n", i, rawinput_tests[i].expect_rawfg ? "" : "un"); + + GetCursorPos(&newpt); + ok((newpt.x - pt.x) == 5 || (newpt.x - pt.x) == 4, "%d: Unexpected cursor movement\n", i); + + if (rawinput_tests[i].register_device) + { + raw_devices[0].dwFlags = RIDEV_REMOVE; + raw_devices[0].hwndTarget = 0; + + SetLastError(0xdeadbeef); + ret = RegisterRawInputDevices(raw_devices, ARRAY_SIZE(raw_devices), sizeof(RAWINPUTDEVICE)); + ok(ret, "%d: RegisterRawInputDevices failed\n", i); + ok(GetLastError() == 0xdeadbeef, "%d: RegisterRawInputDevices returned %08x\n", i, GetLastError()); + } + + DestroyWindow(hwnd); + } +} + static void test_key_map(void) { HKL kl = GetKeyboardLayout(0); @@ -3034,6 +3168,7 @@ START_TEST(input) test_OemKeyScan(); test_GetRawInputData(); test_RegisterRawInputDevices(); + test_rawinput(); if(pGetMouseMovePointsEx) test_GetMouseMovePointsEx();
1
0
0
0
Gijs Vermeulen : amstream: Implement IDirectDrawStreamSample::GetMediaStream().
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: 69c69143be02ce2e421fc6db384b47daa6060e7b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=69c69143be02ce2e421fc6db…
Author: Gijs Vermeulen <gijsvrm(a)gmail.com> Date: Tue Jun 23 11:18:02 2020 -0500 amstream: Implement IDirectDrawStreamSample::GetMediaStream(). Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/amstream/ddrawstream.c | 12 ++++++++++-- dlls/amstream/tests/amstream.c | 8 ++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index 0bfbe653e7..ca6a910f3f 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -1023,9 +1023,17 @@ static ULONG WINAPI ddraw_sample_Release(IDirectDrawStreamSample *iface) /*** IStreamSample methods ***/ static HRESULT WINAPI ddraw_sample_GetMediaStream(IDirectDrawStreamSample *iface, IMediaStream **media_stream) { - FIXME("(%p)->(%p): stub\n", iface, media_stream); + struct ddraw_sample *sample = impl_from_IDirectDrawStreamSample(iface); - return E_NOTIMPL; + TRACE("sample %p, media_stream %p.\n", sample, media_stream); + + if (!media_stream) + return E_POINTER; + + IAMMediaStream_AddRef(&sample->parent->IAMMediaStream_iface); + *media_stream = (IMediaStream *)&sample->parent->IAMMediaStream_iface; + + return S_OK; } static HRESULT WINAPI ddraw_sample_GetSampleTimes(IDirectDrawStreamSample *iface, STREAM_TIME *start_time, diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 1259de927d..03c8660a42 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -2050,13 +2050,13 @@ static void test_IDirectDrawStreamSample(void) if (0) { hr = IDirectDrawStreamSample_GetMediaStream(sample, NULL); - ok(hr == E_POINTER, "got 0x%08x\n", hr); + ok(hr == E_POINTER, "Got hr %#x.\n", hr); } hr = IDirectDrawStreamSample_GetMediaStream(sample, &stream2); - todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); - todo_wine ok(stream2 == stream, "Expected stream %p, got %p.\n", stream, stream2); - if (hr == S_OK) IMediaStream_Release(stream2); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(stream2 == stream, "Expected stream %p, got %p.\n", stream, stream2); + IMediaStream_Release(stream2); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface7, (void **)&surface7); ok(hr == S_OK, "got 0x%08x\n", hr);
1
0
0
0
Gijs Vermeulen : amstream: Store parent as struct ddraw_stream in ddraw stream sample.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: 1bdfa9ca79b9026f4e2d3d5d3301cc08ce4f8c34 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1bdfa9ca79b9026f4e2d3d5d…
Author: Gijs Vermeulen <gijsvrm(a)gmail.com> Date: Tue Jun 23 11:18:01 2020 -0500 amstream: Store parent as struct ddraw_stream in ddraw stream sample. Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com> Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/amstream/ddrawstream.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index c471a66200..0bfbe653e7 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -28,9 +28,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(amstream); static const WCHAR sink_id[] = L"I{A35FF56A-9FDA-11D0-8FDF-00C04FD9189D}"; -static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawSurface *surface, - const RECT *rect, IDirectDrawStreamSample **ddraw_stream_sample); - struct ddraw_stream { IAMMediaStream IAMMediaStream_iface; @@ -51,6 +48,9 @@ struct ddraw_stream AM_MEDIA_TYPE mt; }; +static HRESULT ddrawstreamsample_create(struct ddraw_stream *parent, IDirectDrawSurface *surface, + const RECT *rect, IDirectDrawStreamSample **ddraw_stream_sample); + static inline struct ddraw_stream *impl_from_IAMMediaStream(IAMMediaStream *iface) { return CONTAINING_RECORD(iface, struct ddraw_stream, IAMMediaStream_iface); @@ -401,12 +401,15 @@ static HRESULT WINAPI ddraw_IDirectDrawMediaStream_SetDirectDraw(IDirectDrawMedi } static HRESULT WINAPI ddraw_IDirectDrawMediaStream_CreateSample(IDirectDrawMediaStream *iface, - IDirectDrawSurface *surface, const RECT *rect, DWORD dwFlags, - IDirectDrawStreamSample **ppSample) + IDirectDrawSurface *surface, const RECT *rect, DWORD flags, + IDirectDrawStreamSample **sample) { - TRACE("(%p)->(%p,%s,%x,%p)\n", iface, surface, wine_dbgstr_rect(rect), dwFlags, ppSample); + struct ddraw_stream *stream = impl_from_IDirectDrawMediaStream(iface); + + TRACE("stream %p, surface %p, rect %s, flags %#x, sample %p.\n", + stream, surface, wine_dbgstr_rect(rect), flags, sample); - return ddrawstreamsample_create(iface, surface, rect, ppSample); + return ddrawstreamsample_create(stream, surface, rect, sample); } static HRESULT WINAPI ddraw_IDirectDrawMediaStream_GetTimePerFrame(IDirectDrawMediaStream *iface, @@ -959,7 +962,7 @@ struct ddraw_sample { IDirectDrawStreamSample IDirectDrawStreamSample_iface; LONG ref; - IMediaStream *parent; + struct ddraw_stream *parent; IDirectDrawSurface *surface; RECT rect; }; @@ -1011,7 +1014,6 @@ static ULONG WINAPI ddraw_sample_Release(IDirectDrawStreamSample *iface) { if (sample->surface) IDirectDrawSurface_Release(sample->surface); - IMediaStream_Release(sample->parent); HeapFree(GetProcessHeap(), 0, sample); } @@ -1102,7 +1104,7 @@ static const struct IDirectDrawStreamSampleVtbl DirectDrawStreamSample_Vtbl = ddraw_sample_SetRect }; -static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawSurface *surface, +static HRESULT ddrawstreamsample_create(struct ddraw_stream *parent, IDirectDrawSurface *surface, const RECT *rect, IDirectDrawStreamSample **ddraw_stream_sample) { struct ddraw_sample *object; @@ -1116,8 +1118,7 @@ static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectD object->IDirectDrawStreamSample_iface.lpVtbl = &DirectDrawStreamSample_Vtbl; object->ref = 1; - object->parent = (IMediaStream*)parent; - IMediaStream_AddRef(object->parent); + object->parent = parent; if (surface) { @@ -1129,7 +1130,7 @@ static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectD DDSURFACEDESC desc; IDirectDraw *ddraw; - hr = IDirectDrawMediaStream_GetDirectDraw(parent, &ddraw); + hr = IDirectDrawMediaStream_GetDirectDraw(&parent->IDirectDrawMediaStream_iface, &ddraw); if (FAILED(hr)) { IDirectDrawStreamSample_Release(&object->IDirectDrawStreamSample_iface);
1
0
0
0
Jacek Caban : msscript.ocx: Keep script host running as long as any script module is alive.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: fcf6d67b83c31983eae68ebbf359cf738d38e283 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fcf6d67b83c31983eae68ebb…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Jun 23 16:41:04 2020 +0200 msscript.ocx: Keep script host running as long as any script module is alive. Based on patch by Gabriel Ivăncescu. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msscript.ocx/msscript.c | 93 ++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 38 deletions(-) diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c index f7917b2327..8b36f3af9a 100644 --- a/dlls/msscript.ocx/msscript.c +++ b/dlls/msscript.ocx/msscript.c @@ -51,6 +51,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msscript); struct ScriptControl; typedef struct ConnectionPoint ConnectionPoint; +typedef struct ScriptHost ScriptHost; struct ConnectionPoint { IConnectionPoint IConnectionPoint_iface; @@ -68,9 +69,11 @@ struct named_item { typedef struct { IScriptModule IScriptModule_iface; LONG ref; + + ScriptHost *host; } ScriptModule; -typedef struct ScriptHost { +struct ScriptHost { IActiveScriptSite IActiveScriptSite_iface; IActiveScriptSiteWindow IActiveScriptSiteWindow_iface; IServiceProvider IServiceProvider_iface; @@ -83,9 +86,8 @@ typedef struct ScriptHost { CLSID clsid; unsigned int module_count; - struct list named_items; -} ScriptHost; +}; struct ScriptControl { IScriptControl IScriptControl_iface; @@ -355,25 +357,6 @@ static ULONG WINAPI ActiveScriptSite_AddRef(IActiveScriptSite *iface) return ref; } -static void release_script_engine(ScriptHost *host) -{ - if (host->script) { - IActiveScript_Close(host->script); - IActiveScript_Release(host->script); - } - - if (host->parse) - IActiveScriptParse_Release(host->parse); - if (host->script_dispatch) - IDispatch_Release(host->script_dispatch); - - host->script_dispatch = NULL; - host->parse = NULL; - host->script = NULL; - - IActiveScriptSite_Release(&host->IActiveScriptSite_iface); -} - static ULONG WINAPI ActiveScriptSite_Release(IActiveScriptSite *iface) { ScriptHost *This = impl_from_IActiveScriptSite(iface); @@ -572,6 +555,26 @@ static const IServiceProviderVtbl ServiceProviderVtbl = { ServiceProvider_QueryService }; +static void detach_script_host(ScriptHost *host) +{ + if (--host->module_count) + return; + + if (host->script) { + IActiveScript_Close(host->script); + IActiveScript_Release(host->script); + } + + if (host->parse) + IActiveScriptParse_Release(host->parse); + if (host->script_dispatch) + IDispatch_Release(host->script_dispatch); + + host->script_dispatch = NULL; + host->parse = NULL; + host->script = NULL; +} + static HRESULT WINAPI ScriptModule_QueryInterface(IScriptModule *iface, REFIID riid, void **ppv) { ScriptModule *This = impl_from_IScriptModule(iface); @@ -610,7 +613,11 @@ static ULONG WINAPI ScriptModule_Release(IScriptModule *iface) TRACE("(%p) ref=%d\n", This, ref); if (!ref) + { + detach_script_host(This->host); + IActiveScriptSite_Release(&This->host->IActiveScriptSite_iface); heap_free(This); + } return ref; } @@ -756,7 +763,7 @@ static const IScriptModuleVtbl ScriptModuleVtbl = { ScriptModule_Run }; -static ScriptModule *create_module(void) +static ScriptModule *create_module(ScriptHost *host) { ScriptModule *module; @@ -764,6 +771,8 @@ static ScriptModule *create_module(void) module->IScriptModule_iface.lpVtbl = &ScriptModuleVtbl; module->ref = 1; + module->host = host; + IActiveScriptSite_AddRef(&host->IActiveScriptSite_iface); return module; } @@ -992,7 +1001,7 @@ static HRESULT init_script_host(const CLSID *clsid, ScriptHost **ret) return S_OK; failed: - release_script_engine(host); + detach_script_host(host); return hr; } @@ -1072,7 +1081,7 @@ static ULONG WINAPI ScriptControl_Release(IScriptControl *iface) if (This->host) { release_modules(This); - release_script_engine(This->host); + IActiveScriptSite_Release(&This->host->IActiveScriptSite_iface); } heap_free(This); } @@ -1164,6 +1173,7 @@ static HRESULT WINAPI ScriptControl_put_Language(IScriptControl *iface, BSTR lan { ScriptControl *This = impl_from_IScriptControl(iface); CLSID clsid; + HRESULT hres; TRACE("(%p)->(%s)\n", This, debugstr_w(language)); @@ -1171,25 +1181,32 @@ static HRESULT WINAPI ScriptControl_put_Language(IScriptControl *iface, BSTR lan return CTL_E_INVALIDPROPERTYVALUE; if (This->host) { - release_script_engine(This->host); + release_modules(This); This->host = NULL; } - /* Alloc global module */ - This->modules = heap_alloc_zero(sizeof(*This->modules)); - if (!This->modules) return E_OUTOFMEMORY; - - This->modules[0] = create_module(); - if (!This->modules[0]) { - heap_free(This->modules); - This->modules = NULL; - return E_OUTOFMEMORY; - } - if (!language) return S_OK; - return init_script_host(&clsid, &This->host); + hres = init_script_host(&clsid, &This->host); + if (FAILED(hres)) + return hres; + + /* Alloc global module */ + This->modules = heap_alloc_zero(sizeof(*This->modules)); + if (This->modules) { + This->modules[0] = create_module(This->host); + if (!This->modules[0]) { + heap_free(This->modules); + This->modules = NULL; + hres = E_OUTOFMEMORY; + } + } + if (FAILED(hres)) { + This->host = NULL; + detach_script_host(This->host); + } + return hres; } static HRESULT WINAPI ScriptControl_get_State(IScriptControl *iface, ScriptControlStates *p)
1
0
0
0
Jacek Caban : msscript.ocx: Move modules_count to the Script Host.
by Alexandre Julliard
23 Jun '20
23 Jun '20
Module: wine Branch: master Commit: 5a6ac3aac11a6f88d0bc1c30fb791d5dbe1131ed URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5a6ac3aac11a6f88d0bc1c30…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Jun 23 16:40:49 2020 +0200 msscript.ocx: Move modules_count to the Script Host. Based on patch by Gabriel Ivăncescu. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msscript.ocx/msscript.c | 40 +++++++++++++++++++------------------- dlls/msscript.ocx/tests/msscript.c | 9 +++++++++ 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c index 8fb127e0e3..f7917b2327 100644 --- a/dlls/msscript.ocx/msscript.c +++ b/dlls/msscript.ocx/msscript.c @@ -82,6 +82,8 @@ typedef struct ScriptHost { SCRIPTSTATE script_state; CLSID clsid; + unsigned int module_count; + struct list named_items; } ScriptHost; @@ -111,7 +113,6 @@ struct ScriptControl { DWORD view_sink_flags; /* modules */ - unsigned int module_count; ScriptModule **modules; IScriptModuleCollection IScriptModuleCollection_iface; @@ -770,10 +771,9 @@ static void release_modules(ScriptControl *control) { unsigned int i; - for (i = 0; i < control->module_count; i++) + for (i = 0; i < control->host->module_count; i++) IScriptModule_Release(&control->modules[i]->IScriptModule_iface); - control->module_count = 0; heap_free(control->modules); } @@ -896,8 +896,9 @@ static HRESULT WINAPI ScriptModuleCollection_get_Count(IScriptModuleCollection * TRACE("(%p)->(%p)\n", This, plCount); if (!plCount) return E_POINTER; + if (!This->host) return E_FAIL; - *plCount = This->module_count; + *plCount = This->host->module_count; return S_OK; } @@ -945,6 +946,7 @@ static HRESULT init_script_host(const CLSID *clsid, ScriptHost **ret) host->parse = NULL; host->script_dispatch = NULL; host->clsid = *clsid; + host->module_count = 1; list_init(&host->named_items); hr = CoCreateInstance(&host->clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, @@ -1068,8 +1070,10 @@ static ULONG WINAPI ScriptControl_Release(IScriptControl *iface) if (This->site) IOleClientSite_Release(This->site); if (This->host) + { + release_modules(This); release_script_engine(This->host); - release_modules(This); + } heap_free(This); } @@ -1159,7 +1163,6 @@ static HRESULT WINAPI ScriptControl_get_Language(IScriptControl *iface, BSTR *p) static HRESULT WINAPI ScriptControl_put_Language(IScriptControl *iface, BSTR language) { ScriptControl *This = impl_from_IScriptControl(iface); - ScriptModule **modules; CLSID clsid; TRACE("(%p)->(%s)\n", This, debugstr_w(language)); @@ -1167,24 +1170,21 @@ static HRESULT WINAPI ScriptControl_put_Language(IScriptControl *iface, BSTR lan if (language && FAILED(CLSIDFromProgID(language, &clsid))) return CTL_E_INVALIDPROPERTYVALUE; - /* Alloc new global module */ - modules = heap_alloc_zero(sizeof(*modules)); - if (!modules) return E_OUTOFMEMORY; - - modules[0] = create_module(); - if (!modules[0]) { - heap_free(modules); - return E_OUTOFMEMORY; - } - if (This->host) { release_script_engine(This->host); This->host = NULL; } - release_modules(This); - This->modules = modules; - This->module_count = 1; + /* Alloc global module */ + This->modules = heap_alloc_zero(sizeof(*This->modules)); + if (!This->modules) return E_OUTOFMEMORY; + + This->modules[0] = create_module(); + if (!This->modules[0]) { + heap_free(This->modules); + This->modules = NULL; + return E_OUTOFMEMORY; + } if (!language) return S_OK; @@ -1332,7 +1332,7 @@ static HRESULT WINAPI ScriptControl_get_Modules(IScriptControl *iface, IScriptMo TRACE("(%p)->(%p)\n", This, p); - if (!This->module_count) return E_FAIL; + if (!This->host) return E_FAIL; *p = &This->IScriptModuleCollection_iface; IScriptControl_AddRef(iface); diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c index fbbe83191b..b6a5209fa1 100644 --- a/dlls/msscript.ocx/tests/msscript.c +++ b/dlls/msscript.ocx/tests/msscript.c @@ -2414,7 +2414,16 @@ static void test_IScriptControl_get_Modules(void) ok(hr == S_OK, "IScriptModuleCollection_get_Count failed: 0x%08x.\n", hr); ok(count == 1, "count is not 1, got %d.\n", count); + hr = IScriptControl_put_Language(sc, NULL); + ok(hr == S_OK, "IScriptControl_put_Language failed: 0x%08x.\n", hr); + + hr = IScriptModuleCollection_get_Count(mods, &count); + ok(hr == E_FAIL, "IScriptModuleCollection_get_Count returned: 0x%08x.\n", hr); + IScriptModuleCollection_Release(mods); + hr = IScriptControl_get_Modules(sc, &mods); + ok(hr == E_FAIL, "IScriptControl_get_Modules returned: 0x%08x.\n", hr); + IScriptControl_Release(sc); /* custom script engine */
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
95
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
Results per page:
10
25
50
100
200