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
November 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
1 participants
1171 discussions
Start a n
N
ew thread
Zhiyi Zhang : user32/tests: Test painting standard scroll bars in hovered state.
by Alexandre Julliard
08 Nov '22
08 Nov '22
Module: wine Branch: stable Commit: 8bfb72cc2542324b21e5a3309a15a2b138da5091 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8bfb72cc2542324b21e5a3309a15a2…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Jan 25 15:58:51 2022 +0800 user32/tests: Test painting standard scroll bars in hovered state. Mostly to test that standard scroll bars doesn't get painted in hovered state if they weren't previously painted by DefWinProcA/W(). Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit b9110622be5a4bd31aa24a28d78283a2c1a5a948) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/user32/tests/win.c | 122 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 0156987f529..ed90c5fbe5f 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -1132,12 +1132,42 @@ static void wine_AdjustWindowRectExForDpi( RECT *rect, LONG style, BOOL menu, LO InflateRect(rect, GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE)); } +static int offset; + +static LRESULT CALLBACK test_standard_scrollbar_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) +{ + switch (msg) + { + case WM_NCPAINT: + { + HRGN region; + RECT rect; + + GetWindowRect(hwnd, &rect); + region = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom - offset); + DefWindowProcA(hwnd, msg, (WPARAM)region, lp); + DeleteObject(region); + return 0; + } + default: + return DefWindowProcA(hwnd, msg, wp, lp); + } +} + static void test_nonclient_area(HWND hwnd) { + BOOL (WINAPI *pIsThemeActive)(void); + POINT point, old_cursor_pos; + COLORREF color, old_color; + BOOL is_theme_active; DWORD style, exstyle; RECT rc_window, rc_client, rc; + HWND child, parent; + HMODULE uxtheme; + WNDCLASSA cls; BOOL menu; LRESULT ret; + HDC hdc; style = GetWindowLongA(hwnd, GWL_STYLE); exstyle = GetWindowLongA(hwnd, GWL_EXSTYLE); @@ -1189,6 +1219,98 @@ static void test_nonclient_area(HWND hwnd) ok(EqualRect(&rc, &rc_client), "synthetic rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, client=%s, calc=%s\n", style, exstyle, menu, wine_dbgstr_rect(&rc_client), wine_dbgstr_rect(&rc)); + + /* Test standard scroll bars */ + uxtheme = LoadLibraryA("uxtheme.dll"); + ok(!!uxtheme, "Failed to load uxtheme.dll, error %u.\n", GetLastError()); + pIsThemeActive = (void *)GetProcAddress(uxtheme, "IsThemeActive"); + ok(!!pIsThemeActive, "Failed to load IsThemeActive, error %u.\n", GetLastError()); + is_theme_active = pIsThemeActive(); + + memset(&cls, 0, sizeof(cls)); + cls.lpfnWndProc = DefWindowProcA; + cls.hInstance = GetModuleHandleA(0); + cls.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); + cls.hbrBackground = GetStockObject(LTGRAY_BRUSH); + cls.lpszClassName = "TestStandardScrollbarParentClass"; + RegisterClassA(&cls); + + cls.lpfnWndProc = test_standard_scrollbar_proc; + cls.hbrBackground = GetStockObject(GRAY_BRUSH); + cls.lpszClassName = "TestStandardScrollbarClass"; + RegisterClassA(&cls); + + parent = CreateWindowA("TestStandardScrollbarParentClass", "parent", WS_POPUP | WS_VISIBLE, 100, + 100, 100, 100, NULL, NULL, 0, NULL); + ok(!!parent, "Failed to create a parent window, error %u.\n", GetLastError()); + GetCursorPos(&old_cursor_pos); + + /* Place the cursor on the standard scroll bar arrow button when not painting it at all. + * Expects the standard scroll bar not to appear before and after the cursor position change */ + offset = GetSystemMetrics(SM_CYHSCROLL); + child = CreateWindowA("TestStandardScrollbarClass", "test", WS_CHILD | WS_HSCROLL | WS_VISIBLE, + 0, 0, 50, 50, parent, NULL, 0, NULL); + ok(!!child, "Failed to create a test window, error %u.\n", GetLastError()); + hdc = GetDC(parent); + ok(!!hdc, "GetDC failed, error %d.\n", GetLastError()); + + SetCursorPos(0, 0); + flush_events(TRUE); + RedrawWindow(child, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ERASENOW | RDW_FRAME); + old_color = GetPixel(hdc, 50 - GetSystemMetrics(SM_CXVSCROLL) / 2, + 50 - GetSystemMetrics(SM_CYHSCROLL) / 2); + ok(old_color == 0xc0c0c0, "Expected color %#x, got %#x.\n", 0xc0c0c0, old_color); + + point.x = 50 - GetSystemMetrics(SM_CXVSCROLL) / 2; + point.y = 50 - GetSystemMetrics(SM_CYHSCROLL) / 2; + ClientToScreen(child, &point); + SetCursorPos(point.x, point.y); + flush_events(TRUE); + RedrawWindow(child, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ERASENOW | RDW_FRAME); + color = GetPixel(hdc, 50 - GetSystemMetrics(SM_CXVSCROLL) / 2, + 50 - GetSystemMetrics(SM_CYHSCROLL) / 2); + todo_wine + ok(color == old_color, "Expected color %#x, got %#x.\n", old_color, color); + + ReleaseDC(parent, hdc); + DestroyWindow(child); + + /* Place the cursor on standard scroll bar arrow button when painting 1 pixel of the scroll bar. + * Expects the scroll bar to appear after the cursor position change */ + offset = GetSystemMetrics(SM_CYHSCROLL) - 1; + child = CreateWindowA("TestStandardScrollbarClass", "test", WS_CHILD | WS_HSCROLL | WS_VISIBLE, + 0, 0, 50, 50, parent, NULL, 0, NULL); + ok(!!child, "Failed to create a test window, error %u.\n", GetLastError()); + hdc = GetDC(parent); + ok(!!hdc, "GetDC failed, error %d.\n", GetLastError()); + + SetCursorPos(0, 0); + flush_events(TRUE); + RedrawWindow(child, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ERASENOW | RDW_FRAME); + old_color = GetPixel(hdc, 50 - GetSystemMetrics(SM_CXVSCROLL) / 2, + 50 - GetSystemMetrics(SM_CYHSCROLL) / 2); + + point.x = 50 - GetSystemMetrics(SM_CXVSCROLL) / 2; + point.y = 50 - GetSystemMetrics(SM_CYHSCROLL) / 2; + ClientToScreen(child, &point); + SetCursorPos(point.x, point.y); + flush_events(TRUE); + RedrawWindow(child, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ERASENOW | RDW_FRAME); + color = GetPixel(hdc, 50 - GetSystemMetrics(SM_CXVSCROLL) / 2, + 50 - GetSystemMetrics(SM_CYHSCROLL) / 2); + if (is_theme_active) + ok(color != old_color || broken(color == old_color), /* Win 10 1507 64-bit */ + "Got unexpected color %#x.\n", color); + else + todo_wine + ok(color == old_color, "Expected color %#x, got %#x.\n", old_color, color); + + SetCursorPos(old_cursor_pos.x, old_cursor_pos.y); + ReleaseDC(parent, hdc); + DestroyWindow(parent); + UnregisterClassA("TestStandardScrollbarClass", GetModuleHandleA(0)); + UnregisterClassA("TestStandardScrollbarParentClass", GetModuleHandleA(0)); + FreeLibrary(uxtheme); } static LRESULT CALLBACK cbt_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
1
0
0
0
Henri Verbeet : d3d11/tests: Add some tests for ID3DUserDefinedAnnotation.
by Alexandre Julliard
08 Nov '22
08 Nov '22
Module: wine Branch: stable Commit: 068d0d74125d486d997c72f5b6b37365f54cd4a5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/068d0d74125d486d997c72f5b6b373…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Jan 25 11:51:41 2022 +0100 d3d11/tests: Add some tests for ID3DUserDefinedAnnotation. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 8305c597b95637dda04cde6025fbd6e5511ebcda) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 55a245c744c..91e343dfda5 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -33939,6 +33939,46 @@ static void test_dynamic_map_synchronization(void) release_test_context(&test_context); } +static void test_user_defined_annotation(void) +{ + struct d3d11_test_context test_context; + ID3DUserDefinedAnnotation *annotation; + ID3D11DeviceContext *context; + HRESULT hr; + int ret; + + if (!init_test_context(&test_context, NULL)) + return; + + hr = ID3D11DeviceContext_QueryInterface(test_context.immediate_context, + &IID_ID3DUserDefinedAnnotation, (void **)&annotation); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ret = ID3DUserDefinedAnnotation_BeginEvent(annotation, L"Event 1"); + ok(ret == -1, "Got unexpected ret %d.\n", ret); + ret = ID3DUserDefinedAnnotation_EndEvent(annotation); + ok(ret == -1, "Got unexpected ret %d.\n", ret); + ID3DUserDefinedAnnotation_SetMarker(annotation, L"Marker 1"); + ret = ID3DUserDefinedAnnotation_GetStatus(annotation); + ok(!ret, "Got unexpected status %#x.\n", ret); + ID3DUserDefinedAnnotation_Release(annotation); + + hr = ID3D11Device_CreateDeferredContext(test_context.device, 0, &context); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3D11DeviceContext_QueryInterface(context, &IID_ID3DUserDefinedAnnotation, (void **)&annotation); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ret = ID3DUserDefinedAnnotation_BeginEvent(annotation, L"Event 2"); + ok(ret == -1, "Got unexpected ret %d.\n", ret); + ret = ID3DUserDefinedAnnotation_EndEvent(annotation); + ok(ret == -1, "Got unexpected ret %d.\n", ret); + ID3DUserDefinedAnnotation_SetMarker(annotation, L"Marker 2"); + ret = ID3DUserDefinedAnnotation_GetStatus(annotation); + ok(!ret, "Got unexpected status %#x.\n", ret); + ID3DUserDefinedAnnotation_Release(annotation); + ID3D11DeviceContext_Release(context); + + release_test_context(&test_context); +} + START_TEST(d3d11) { unsigned int argc, i; @@ -34113,6 +34153,7 @@ START_TEST(d3d11) queue_test(test_texture_compressed_3d); queue_test(test_constant_buffer_offset); queue_test(test_dynamic_map_synchronization); + queue_test(test_user_defined_annotation); run_queued_tests();
1
0
0
0
Andrey Gusev : d3d11: Implement the ID3DUserDefinedAnnotation interface.
by Alexandre Julliard
08 Nov '22
08 Nov '22
Module: wine Branch: stable Commit: bbed0402f9de401ab9bc4aee57689dfaba929544 URL:
https://gitlab.winehq.org/wine/wine/-/commit/bbed0402f9de401ab9bc4aee57689d…
Author: Andrey Gusev <andrey.goosev(a)gmail.com> Date: Tue Jan 25 11:51:40 2022 +0100 d3d11: Implement the ID3DUserDefinedAnnotation interface. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51354
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit 369ee8b0e184313ba4814604f7173a619dad9587) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/d3d11/d3d11_private.h | 1 + dlls/d3d11/device.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index afbde9a4bfb..52bbe016af6 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -545,6 +545,7 @@ struct d3d11_device_context { ID3D11DeviceContext1 ID3D11DeviceContext1_iface; ID3D11Multithread ID3D11Multithread_iface; + ID3DUserDefinedAnnotation ID3DUserDefinedAnnotation_iface; LONG refcount; D3D11_DEVICE_CONTEXT_TYPE type; diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 626e4889708..ca0e612b9df 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -484,6 +484,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_context_QueryInterface(ID3D11Devic { *out = &context->ID3D11Multithread_iface; } + else if (IsEqualGUID(iid, &IID_ID3DUserDefinedAnnotation)) + { + *out = &context->ID3DUserDefinedAnnotation_iface; + } else { WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); @@ -3186,11 +3190,86 @@ static const struct ID3D11MultithreadVtbl d3d11_multithread_vtbl = d3d11_multithread_GetMultithreadProtected, }; +/* ID3DUserDefinedAnnotation methods */ + +static inline struct d3d11_device_context *impl_from_ID3DUserDefinedAnnotation(ID3DUserDefinedAnnotation *iface) +{ + return CONTAINING_RECORD(iface, struct d3d11_device_context, ID3DUserDefinedAnnotation_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d11_user_defined_annotation_QueryInterface(ID3DUserDefinedAnnotation *iface, + REFIID iid, void **out) +{ + struct d3d11_device_context *context = impl_from_ID3DUserDefinedAnnotation(iface); + + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + return d3d11_device_context_QueryInterface(&context->ID3D11DeviceContext1_iface, iid, out); +} + +static ULONG STDMETHODCALLTYPE d3d11_user_defined_annotation_AddRef(ID3DUserDefinedAnnotation *iface) +{ + struct d3d11_device_context *context = impl_from_ID3DUserDefinedAnnotation(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_device_context_AddRef(&context->ID3D11DeviceContext1_iface); +} + +static ULONG STDMETHODCALLTYPE d3d11_user_defined_annotation_Release(ID3DUserDefinedAnnotation *iface) +{ + struct d3d11_device_context *context = impl_from_ID3DUserDefinedAnnotation(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_device_context_Release(&context->ID3D11DeviceContext1_iface); +} + +static int STDMETHODCALLTYPE d3d11_user_defined_annotation_BeginEvent(ID3DUserDefinedAnnotation *iface, + const WCHAR *name) +{ + TRACE("iface %p, name %s.\n", iface, debugstr_w(name)); + + return -1; +} + +static int STDMETHODCALLTYPE d3d11_user_defined_annotation_EndEvent(ID3DUserDefinedAnnotation *iface) +{ + TRACE("iface %p.\n", iface); + + return -1; +} + +static void STDMETHODCALLTYPE d3d11_user_defined_annotation_SetMarker(ID3DUserDefinedAnnotation *iface, + const WCHAR *name) +{ + TRACE("iface %p, name %s.\n", iface, debugstr_w(name)); +} + +static BOOL STDMETHODCALLTYPE d3d11_user_defined_annotation_GetStatus(ID3DUserDefinedAnnotation *iface) +{ + TRACE("iface %p.\n", iface); + + return FALSE; +} + +static const struct ID3DUserDefinedAnnotationVtbl d3d11_user_defined_annotation_vtbl = +{ + d3d11_user_defined_annotation_QueryInterface, + d3d11_user_defined_annotation_AddRef, + d3d11_user_defined_annotation_Release, + d3d11_user_defined_annotation_BeginEvent, + d3d11_user_defined_annotation_EndEvent, + d3d11_user_defined_annotation_SetMarker, + d3d11_user_defined_annotation_GetStatus, +}; + static void d3d11_device_context_init(struct d3d11_device_context *context, struct d3d_device *device, D3D11_DEVICE_CONTEXT_TYPE type) { context->ID3D11DeviceContext1_iface.lpVtbl = &d3d11_device_context_vtbl; context->ID3D11Multithread_iface.lpVtbl = &d3d11_multithread_vtbl; + context->ID3DUserDefinedAnnotation_iface.lpVtbl = &d3d11_user_defined_annotation_vtbl; context->refcount = 1; context->type = type;
1
0
0
0
Louis Lenders : wbemprox: Add some properties of SoftwareLicensingProduct class.
by Alexandre Julliard
08 Nov '22
08 Nov '22
Module: wine Branch: stable Commit: ddb357e98a327df7f8d72059ab767c2e35300ef1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ddb357e98a327df7f8d72059ab767c…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Wed Jan 19 12:43:07 2022 +0100 wbemprox: Add some properties of SoftwareLicensingProduct class. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51163
Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit a9826b48e4c385ddce1d7913c41cdc652b8fbf06) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/wbemprox/builtin.c | 16 ++++++++++++++++ dlls/wbemprox/tests/query.c | 26 ++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 6b63c744b69..5a09d64b8fb 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -387,6 +387,11 @@ static const struct column col_sid[] = { L"SID", CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, { L"SidLength", CIM_UINT32 }, }; +static const struct column col_softwarelicensingproduct[] = +{ + { L"LicenseIsAddon", CIM_BOOLEAN }, + { L"LicenseStatus", CIM_UINT32 }, +}; static const struct column col_sounddevice[] = { { L"DeviceID", CIM_STRING|COL_FLAG_DYNAMIC }, @@ -809,6 +814,11 @@ struct record_sid const WCHAR *sid; UINT32 sidlength; }; +struct record_softwarelicensingproduct +{ + int license_is_addon; + UINT32 license_status; +}; struct record_sounddevice { const WCHAR *deviceid; @@ -978,6 +988,11 @@ static const struct record_quickfixengineering data_quickfixengineering[] = { L"
http://winehq.org
", L"KB1234567" }, }; +static const struct record_softwarelicensingproduct data_softwarelicensingproduct[] = +{ + { 0, 1 }, +}; + static const struct record_stdregprov data_stdregprov[] = { { @@ -4110,6 +4125,7 @@ static struct table cimv2_builtin_classes[] = { L"CIM_DataFile", C(col_datafile), 0, 0, NULL, fill_datafile }, { L"CIM_LogicalDisk", C(col_logicaldisk), 0, 0, NULL, fill_logicaldisk }, { L"CIM_Processor", C(col_processor), 0, 0, NULL, fill_processor }, + { L"SoftwareLicensingProduct", C(col_softwarelicensingproduct), D(data_softwarelicensingproduct) }, { L"StdRegProv", C(col_stdregprov), D(data_stdregprov) }, { L"SystemRestore", C(col_sysrestore), D(data_sysrestore) }, { L"Win32_BIOS", C(col_bios), 0, 0, NULL, fill_bios }, diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 912671f4ad2..583ae578efa 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1835,6 +1835,31 @@ static void test_Win32_WinSAT( IWbemServices *services ) SysFreeString( wql ); } +static void test_SoftwareLicensingProduct( IWbemServices *services ) +{ + BSTR wql = SysAllocString( L"wql" ), query = SysAllocString( L"SELECT * FROM SoftwareLicensingProduct" ); + IEnumWbemClassObject *result; + IWbemClassObject *obj; + HRESULT hr; + DWORD count; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK , "got %08x\n", hr ); + + for (;;) + { + hr = IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + if (hr != S_OK) break; + check_property( obj, L"LicenseIsAddon", VT_BOOL, CIM_BOOLEAN ); + check_property( obj, L"LicenseStatus", VT_I4, CIM_UINT32 ); + IWbemClassObject_Release( obj ); + } + + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + SysFreeString( wql ); +} + static void test_Win32_DesktopMonitor( IWbemServices *services ) { BSTR wql = SysAllocString( L"wql" ), query = SysAllocString( L"SELECT * FROM Win32_DesktopMonitor" ); @@ -2187,6 +2212,7 @@ START_TEST(query) test_select( services ); /* classes */ + test_SoftwareLicensingProduct( services ); test_StdRegProv( services ); test_SystemSecurity( services ); test_Win32_Baseboard( services );
1
0
0
0
Hans Leidekker : msi: Use custom action name for MsiBreak handling.
by Alexandre Julliard
08 Nov '22
08 Nov '22
Module: wine Branch: stable Commit: 501e476220621a373da124d1f160613b901f9141 URL:
https://gitlab.winehq.org/wine/wine/-/commit/501e476220621a373da124d1f16061…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Jan 21 16:45:32 2022 +0100 msi: Use custom action name for MsiBreak handling. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50433
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit b74b634335c8d843e6dc2ef21e5d9248ca05bae9) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/msi/custom.c | 31 ++++++++++++++----------------- dlls/msi/winemsi.idl | 4 ++-- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c index 19ad3917265..ee4f59b5faa 100644 --- a/dlls/msi/custom.c +++ b/dlls/msi/custom.c @@ -449,21 +449,15 @@ static msi_custom_action_info *find_action_by_guid( const GUID *guid ) return info; } -static void handle_msi_break(LPCSTR target) +static void handle_msi_break( const WCHAR *action ) { - char format[] = "To debug your custom action, attach your debugger to " - "process %i (0x%X) and press OK"; - char val[MAX_PATH]; - char msg[100]; + const WCHAR fmt[] = L"To debug your custom action, attach your debugger to process %u (0x%x) and press OK"; + WCHAR val[MAX_PATH], msg[100]; - if (!GetEnvironmentVariableA("MsiBreak", val, MAX_PATH)) - return; + if (!GetEnvironmentVariableW( L"MsiBreak", val, MAX_PATH ) || wcscmp( val, action )) return; - if (strcmp(val, target)) - return; - - sprintf(msg, format, GetCurrentProcessId(), GetCurrentProcessId()); - MessageBoxA(NULL, msg, "Windows Installer", MB_OK); + swprintf( msg, ARRAY_SIZE(msg), fmt, GetCurrentProcessId(), GetCurrentProcessId() ); + MessageBoxW( NULL, msg, L"Windows Installer", MB_OK ); DebugBreak(); } @@ -497,7 +491,7 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid) RPC_WSTR binding_str; MSIHANDLE hPackage; RPC_STATUS status; - LPWSTR dll = NULL; + WCHAR *dll = NULL, *action = NULL; LPSTR proc = NULL; HANDLE hModule; INT type; @@ -525,7 +519,7 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid) RpcStringFreeW(&binding_str); } - r = remote_GetActionInfo(guid, &type, &dll, &proc, &remote_package); + r = remote_GetActionInfo(guid, &action, &type, &dll, &proc, &remote_package); if (r != ERROR_SUCCESS) return r; @@ -533,6 +527,7 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid) if (!hPackage) { ERR( "failed to create handle for %x\n", remote_package ); + midl_user_free( action ); midl_user_free( dll ); midl_user_free( proc ); return ERROR_INSTALL_FAILURE; @@ -542,6 +537,7 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid) if (!hModule) { ERR( "failed to load dll %s (%u)\n", debugstr_w( dll ), GetLastError() ); + midl_user_free( action ); midl_user_free( dll ); midl_user_free( proc ); MsiCloseHandle( hPackage ); @@ -552,7 +548,7 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid) if (!fn) WARN( "GetProcAddress(%s) failed\n", debugstr_a(proc) ); else { - handle_msi_break(proc); + handle_msi_break(action); __TRY { @@ -569,11 +565,11 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid) FreeLibrary(hModule); + midl_user_free(action); midl_user_free(dll); midl_user_free(proc); MsiCloseAllHandles(); - return r; } @@ -1612,7 +1608,7 @@ void ACTION_FinishCustomActions(const MSIPACKAGE* package) LeaveCriticalSection( &msi_custom_action_cs ); } -UINT __cdecl s_remote_GetActionInfo(const GUID *guid, int *type, LPWSTR *dll, LPSTR *func, MSIHANDLE *hinst) +UINT __cdecl s_remote_GetActionInfo(const GUID *guid, WCHAR **name, int *type, WCHAR **dll, char **func, MSIHANDLE *hinst) { msi_custom_action_info *info; @@ -1620,6 +1616,7 @@ UINT __cdecl s_remote_GetActionInfo(const GUID *guid, int *type, LPWSTR *dll, LP if (!info) return ERROR_INVALID_DATA; + *name = strdupW(info->action); *type = info->type; *hinst = alloc_msihandle(&info->package->hdr); *dll = strdupW(info->source); diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 7888b0ceb40..e9f0f9e6e59 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -105,7 +105,7 @@ interface IWineMsiRemote UINT remote_EnumComponentCosts( [in] MSIHANDLE hinst, [in, string, unique] LPCWSTR component, [in] DWORD index, [in] INSTALLSTATE state, [out, string, size_is(3)] LPWSTR drive, [out] INT *cost, [out] INT *temp ); - UINT remote_GetActionInfo( [in] const GUID *guid, [out] int *type, [out, string] LPWSTR *dllname, - [out, string] LPSTR *function, [out] MSIHANDLE *hinst ); + UINT remote_GetActionInfo( [in] const GUID *guid, [out, string] WCHAR **action, [out] int *type, [out, string] WCHAR **dllname, + [out, string] char **function, [out] MSIHANDLE *hinst ); UINT remote_CloseHandle( [in] MSIHANDLE handle ); }
1
0
0
0
Gabriel Ivăncescu : ddraw: Use WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES only if window is not in foreground.
by Alexandre Julliard
08 Nov '22
08 Nov '22
Module: wine Branch: stable Commit: 7ab14aba1a1852724ef1aaa408c8bac6805919fb URL:
https://gitlab.winehq.org/wine/wine/-/commit/7ab14aba1a1852724ef1aaa408c8ba…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Tue Jan 18 18:50:25 2022 +0200 ddraw: Use WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES only if window is not in foreground. Fixes a regression introduced by f90d607c67768f19e36d9d74b498594252faa3fd. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50370
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Stefan Dösinger <stefan(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit a384da88655aa6e8e063c5eb361a2339af7ffe6f) Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> --- dlls/ddraw/ddraw.c | 6 +++-- dlls/ddraw/tests/ddraw1.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++- dlls/ddraw/tests/ddraw2.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++- dlls/ddraw/tests/ddraw4.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++- dlls/ddraw/tests/ddraw7.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 268 insertions(+), 6 deletions(-)
1
0
0
0
Anton Baskanov : winegstreamer: Reject incompatible output types in MPEG layer-3 decoder.
by Alexandre Julliard
07 Nov '22
07 Nov '22
Module: wine Branch: master Commit: 1d636da205e39436bbd71849ceeebc5420bf98a9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1d636da205e39436bbd71849ceeebc…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Sun Oct 2 20:07:58 2022 +0700 winegstreamer: Reject incompatible output types in MPEG layer-3 decoder. Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> --- dlls/quartz/tests/mpeglayer3.c | 6 +++--- dlls/winegstreamer/quartz_transform.c | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/quartz/tests/mpeglayer3.c b/dlls/quartz/tests/mpeglayer3.c index 4f06c3ec58e..be4a1dfa97f 100644 --- a/dlls/quartz/tests/mpeglayer3.c +++ b/dlls/quartz/tests/mpeglayer3.c @@ -767,7 +767,7 @@ static void test_media_types(void) init_pcm_mt(&mt, &format, 1, 32000, 16); hr = IPin_QueryAccept(pin, &mt); - todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); IPin_Release(pin); @@ -928,12 +928,12 @@ static void test_connect_pin(void) init_pcm_mt(&req_mt, &req_format, 1, 32000, 16); req_mt.majortype = GUID_NULL; hr = IPin_QueryAccept(source, &req_mt); - todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); init_pcm_mt(&req_mt, &req_format, 1, 32000, 16); req_mt.subtype = GUID_NULL; hr = IPin_QueryAccept(source, &req_mt); - todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); hr = IMediaControl_Pause(control); ok(hr == S_OK, "Got hr %#lx.\n", hr); diff --git a/dlls/winegstreamer/quartz_transform.c b/dlls/winegstreamer/quartz_transform.c index 0956f844bd7..db2c5f69a5b 100644 --- a/dlls/winegstreamer/quartz_transform.c +++ b/dlls/winegstreamer/quartz_transform.c @@ -754,6 +754,13 @@ static HRESULT mpeg_layer3_decoder_sink_query_accept(struct transform *filter, c static HRESULT mpeg_layer3_decoder_source_query_accept(struct transform *filter, const AM_MEDIA_TYPE *mt) { + if (!filter->sink.pin.peer) + return S_FALSE; + + if (!IsEqualGUID(&mt->majortype, &MEDIATYPE_Audio) + || !IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_PCM)) + return S_FALSE; + return S_OK; }
1
0
0
0
Anton Baskanov : quartz/tests: Add tests for MPEG layer-3 decoder sink connection.
by Alexandre Julliard
07 Nov '22
07 Nov '22
Module: wine Branch: master Commit: f114e2d3540de771fdad14e6449b179d06015a89 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f114e2d3540de771fdad14e6449b17…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Sun Oct 2 19:54:47 2022 +0700 quartz/tests: Add tests for MPEG layer-3 decoder sink connection. Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> --- dlls/quartz/tests/mpeglayer3.c | 216 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 216 insertions(+) diff --git a/dlls/quartz/tests/mpeglayer3.c b/dlls/quartz/tests/mpeglayer3.c index 17c4f74597f..4f06c3ec58e 100644 --- a/dlls/quartz/tests/mpeglayer3.c +++ b/dlls/quartz/tests/mpeglayer3.c @@ -20,6 +20,9 @@ #define COBJMACROS #include "dshow.h" #include "mmreg.h" +#include "ks.h" +#include "ksmedia.h" +#include "wine/strmbase.h" #include "wine/test.h" #include "initguid.h" @@ -128,6 +131,33 @@ static const AM_MEDIA_TYPE mp3_mt1 = .pbFormat = (BYTE *)&mp3_format1, }; +static const WAVEFORMATEXTENSIBLE pcm16ex_format = +{ + .Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE, + .Format.nChannels = 1, + .Format.nSamplesPerSec = 32000, + .Format.wBitsPerSample = 16, + .Format.nBlockAlign = 2, + .Format.nAvgBytesPerSec = 64000, + .Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX), + .Samples.wValidBitsPerSample = 16, + .dwChannelMask = KSAUDIO_SPEAKER_STEREO, + /* KSDATAFORMAT_SUBTYPE_PCM */ + .SubFormat = {0x00000001, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}, +}; + +static const AM_MEDIA_TYPE pcm16ex_mt = +{ + /* MEDIATYPE_Audio, MEDIASUBTYPE_PCM, FORMAT_WaveFormatEx */ + .majortype = {0x73647561, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}, + .subtype = {0x00000001, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}, + .bFixedSizeSamples = TRUE, + .lSampleSize = 2, + .formattype = {0x05589f81, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}}, + .cbFormat = sizeof(WAVEFORMATEXTENSIBLE), + .pbFormat = (BYTE *)&pcm16ex_format, +}; + static IBaseFilter *create_mpeg_layer3_decoder(void) { IBaseFilter *filter = NULL; @@ -137,6 +167,12 @@ static IBaseFilter *create_mpeg_layer3_decoder(void) return filter; } +static inline BOOL compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TYPE *b) +{ + return !memcmp(a, b, offsetof(AM_MEDIA_TYPE, pbFormat)) + && !memcmp(a->pbFormat, b->pbFormat, a->cbFormat); +} + static void init_pcm_mt(AM_MEDIA_TYPE *mt, WAVEFORMATEX *format, WORD channels, DWORD sample_rate, WORD depth) { @@ -739,6 +775,185 @@ static void test_media_types(void) ok(!ref, "Got outstanding refcount %ld.\n", ref); } +struct testfilter +{ + struct strmbase_filter filter; + struct strmbase_source source; +}; + +static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filter *iface) +{ + return CONTAINING_RECORD(iface, struct testfilter, filter); +} + +static struct strmbase_pin *testfilter_get_pin(struct strmbase_filter *iface, unsigned int index) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface); + if (!index) + return &filter->source.pin; + return NULL; +} + +static void testfilter_destroy(struct strmbase_filter *iface) +{ + struct testfilter *filter = impl_from_strmbase_filter(iface); + strmbase_source_cleanup(&filter->source); + strmbase_filter_cleanup(&filter->filter); +} + +static const struct strmbase_filter_ops testfilter_ops = +{ + .filter_get_pin = testfilter_get_pin, + .filter_destroy = testfilter_destroy, +}; + +static HRESULT WINAPI testsource_DecideAllocator(struct strmbase_source *iface, + IMemInputPin *peer, IMemAllocator **allocator) +{ + return S_OK; +} + +static const struct strmbase_source_ops testsource_ops = +{ + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideAllocator = testsource_DecideAllocator, +}; + +static void testfilter_init(struct testfilter *filter) +{ + static const GUID clsid = {0xabacab}; + memset(filter, 0, sizeof(*filter)); + strmbase_filter_init(&filter->filter, NULL, &clsid, &testfilter_ops); + strmbase_source_init(&filter->source, &filter->filter, L"source", &testsource_ops); +} + +static void test_connect_pin(void) +{ + IBaseFilter *filter = create_mpeg_layer3_decoder(); + struct testfilter testsource; + IPin *sink, *source, *peer; + WAVEFORMATEX req_format; + IMediaControl *control; + IMemInputPin *meminput; + AM_MEDIA_TYPE req_mt; + IFilterGraph2 *graph; + AM_MEDIA_TYPE mt; + HRESULT hr; + ULONG ref; + + CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, + &IID_IFilterGraph2, (void **)&graph); + testfilter_init(&testsource); + IFilterGraph2_AddFilter(graph, &testsource.filter.IBaseFilter_iface, L"source"); + IFilterGraph2_AddFilter(graph, filter, L"MPEG layer-3 decoder"); + IBaseFilter_FindPin(filter, L"In", &sink); + IBaseFilter_FindPin(filter, L"Out", &source); + IPin_QueryInterface(sink, &IID_IMemInputPin, (void **)&meminput); + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); + + /* Test sink connection. */ + + peer = (IPin *)0xdeadbeef; + hr = IPin_ConnectedTo(sink, &peer); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + ok(!peer, "Got peer %p.\n", peer); + + hr = IPin_ConnectionMediaType(sink, &mt); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &mp3_mt1); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#lx.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + req_mt = mp1_mt; + req_mt.subtype = MEDIASUBTYPE_PCM; + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &req_mt); + ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#lx.\n", hr); + + hr = IFilterGraph2_ConnectDirect(graph, &testsource.source.pin.IPin_iface, sink, &mp3_mt1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IPin_ConnectedTo(sink, &peer); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(peer == &testsource.source.pin.IPin_iface, "Got peer %p.\n", peer); + IPin_Release(peer); + + hr = IPin_ConnectionMediaType(sink, &mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(compare_media_types(&mt, &mp3_mt1), "Media types didn't match.\n"); + ok(compare_media_types(&testsource.source.pin.mt, &mp3_mt1), "Media types didn't match.\n"); + FreeMediaType(&mt); + + init_pcm_mt(&req_mt, &req_format, 1, 32000, 16); + hr = IPin_QueryAccept(source, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + init_pcm_mt(&req_mt, &req_format, 1, 32000, 8); + hr = IPin_QueryAccept(source, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + init_pcm_mt(&req_mt, &req_format, 1, 32000, 16); + req_mt.formattype = GUID_NULL; + hr = IPin_QueryAccept(source, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + init_pcm_mt(&req_mt, &req_format, 2, 32000, 16); + hr = IPin_QueryAccept(source, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + init_pcm_mt(&req_mt, &req_format, 1, 16000, 16); + hr = IPin_QueryAccept(source, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + init_pcm_mt(&req_mt, &req_format, 1, 32000, 24); + hr = IPin_QueryAccept(source, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IPin_QueryAccept(source, &pcm16ex_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + init_pcm_mt(&req_mt, &req_format, 1, 32000, 16); + req_format.nAvgBytesPerSec = 333; + hr = IPin_QueryAccept(source, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + init_pcm_mt(&req_mt, &req_format, 1, 32000, 16); + req_format.nBlockAlign = 333; + hr = IPin_QueryAccept(source, &req_mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + init_pcm_mt(&req_mt, &req_format, 1, 32000, 16); + req_mt.majortype = GUID_NULL; + hr = IPin_QueryAccept(source, &req_mt); + todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + init_pcm_mt(&req_mt, &req_format, 1, 32000, 16); + req_mt.subtype = GUID_NULL; + hr = IPin_QueryAccept(source, &req_mt); + todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IFilterGraph2_Disconnect(graph, sink); + ok(hr == VFW_E_NOT_STOPPED, "Got hr %#lx.\n", hr); + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + IMemInputPin_Release(meminput); + IPin_Release(sink); + IPin_Release(source); + IMediaControl_Release(control); + ref = IFilterGraph2_Release(graph); + ok(!ref, "Got outstanding refcount %ld.\n", ref); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %ld.\n", ref); + ref = IBaseFilter_Release(&testsource.filter.IBaseFilter_iface); + ok(!ref, "Got outstanding refcount %ld.\n", ref); +} + START_TEST(mpeglayer3) { IBaseFilter *filter; @@ -761,6 +976,7 @@ START_TEST(mpeglayer3) test_pin_info(); test_enum_media_types(); test_media_types(); + test_connect_pin(); CoUninitialize(); }
1
0
0
0
Anton Baskanov : winegstreamer: Reject incompatible input media types in MPEG layer-3 decoder.
by Alexandre Julliard
07 Nov '22
07 Nov '22
Module: wine Branch: master Commit: 4489c31b3dbe6ceb24ea7ff4d3796c0b44c02fce URL:
https://gitlab.winehq.org/wine/wine/-/commit/4489c31b3dbe6ceb24ea7ff4d3796c…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Sun Oct 2 19:40:06 2022 +0700 winegstreamer: Reject incompatible input media types in MPEG layer-3 decoder. Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> --- dlls/quartz/tests/mpeglayer3.c | 10 +++++----- dlls/winegstreamer/quartz_transform.c | 12 ++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dlls/quartz/tests/mpeglayer3.c b/dlls/quartz/tests/mpeglayer3.c index 8777232ccc9..17c4f74597f 100644 --- a/dlls/quartz/tests/mpeglayer3.c +++ b/dlls/quartz/tests/mpeglayer3.c @@ -707,23 +707,23 @@ static void test_media_types(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IPin_QueryAccept(pin, &mp1_mt); - todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); hr = IPin_QueryAccept(pin, &mp2_mt); - todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); hr = IPin_QueryAccept(pin, &mp3_mt0); - todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); mt = mp3_mt1; mt.majortype = GUID_NULL; hr = IPin_QueryAccept(pin, &mt); - todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); mt = mp3_mt1; mt.formattype = GUID_NULL; hr = IPin_QueryAccept(pin, &mt); - todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); IPin_Release(pin); diff --git a/dlls/winegstreamer/quartz_transform.c b/dlls/winegstreamer/quartz_transform.c index 79b3a8af89b..0956f844bd7 100644 --- a/dlls/winegstreamer/quartz_transform.c +++ b/dlls/winegstreamer/quartz_transform.c @@ -737,6 +737,18 @@ HRESULT mpeg_audio_codec_create(IUnknown *outer, IUnknown **out) static HRESULT mpeg_layer3_decoder_sink_query_accept(struct transform *filter, const AM_MEDIA_TYPE *mt) { + const MPEGLAYER3WAVEFORMAT *format; + + if (!IsEqualGUID(&mt->majortype, &MEDIATYPE_Audio) + || !IsEqualGUID(&mt->formattype, &FORMAT_WaveFormatEx) + || mt->cbFormat < sizeof(MPEGLAYER3WAVEFORMAT)) + return S_FALSE; + + format = (const MPEGLAYER3WAVEFORMAT *)mt->pbFormat; + + if (format->wfx.wFormatTag != WAVE_FORMAT_MPEGLAYER3) + return S_FALSE; + return S_OK; }
1
0
0
0
Anton Baskanov : quartz/tests: Add tests for MPEG layer-3 decoder accepted media types.
by Alexandre Julliard
07 Nov '22
07 Nov '22
Module: wine Branch: master Commit: fea3691aeaa544d2cbc7d56098c1b4bd50bdfd29 URL:
https://gitlab.winehq.org/wine/wine/-/commit/fea3691aeaa544d2cbc7d56098c1b4…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Sun Oct 2 19:32:28 2022 +0700 quartz/tests: Add tests for MPEG layer-3 decoder accepted media types. Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> --- dlls/quartz/tests/mpeglayer3.c | 177 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) diff --git a/dlls/quartz/tests/mpeglayer3.c b/dlls/quartz/tests/mpeglayer3.c index 66feb35b577..8777232ccc9 100644 --- a/dlls/quartz/tests/mpeglayer3.c +++ b/dlls/quartz/tests/mpeglayer3.c @@ -19,11 +19,115 @@ #define COBJMACROS #include "dshow.h" +#include "mmreg.h" #include "wine/test.h" #include "initguid.h" DEFINE_GUID(CLSID_mpeg_layer3_decoder, 0x38be3000, 0xdbf4, 0x11d0, 0x86, 0x0e, 0x00, 0xa0, 0x24, 0xcf, 0xef, 0x6d); +static const MPEG1WAVEFORMAT mp1_format = +{ + .wfx.wFormatTag = WAVE_FORMAT_MPEG, + .wfx.nChannels = 1, + .wfx.nSamplesPerSec = 32000, + .wfx.nBlockAlign = 48, + .wfx.nAvgBytesPerSec = 4000, + .wfx.cbSize = sizeof(MPEG1WAVEFORMAT) - sizeof(WAVEFORMATEX), + .fwHeadLayer = ACM_MPEG_LAYER1, + .dwHeadBitrate = 32000, + .fwHeadMode = ACM_MPEG_SINGLECHANNEL, + .fwHeadFlags = ACM_MPEG_ID_MPEG1, +}; + +static const AM_MEDIA_TYPE mp1_mt = +{ + /* MEDIATYPE_Audio, MEDIASUBTYPE_MPEG1AudioPayload, FORMAT_WaveFormatEx */ + .majortype = {0x73647561, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}, + .subtype = {0x00000050, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}, + .bFixedSizeSamples = TRUE, + .lSampleSize = 1, + .formattype = {0x05589f81, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}}, + .cbFormat = sizeof(MPEG1WAVEFORMAT), + .pbFormat = (BYTE *)&mp1_format, +}; + +static const MPEG1WAVEFORMAT mp2_format = +{ + .wfx.wFormatTag = WAVE_FORMAT_MPEG, + .wfx.nChannels = 1, + .wfx.nSamplesPerSec = 32000, + .wfx.nBlockAlign = 144, + .wfx.nAvgBytesPerSec = 4000, + .wfx.cbSize = sizeof(MPEG1WAVEFORMAT) - sizeof(WAVEFORMATEX), + .fwHeadLayer = ACM_MPEG_LAYER2, + .dwHeadBitrate = 32000, + .fwHeadMode = ACM_MPEG_SINGLECHANNEL, + .fwHeadFlags = ACM_MPEG_ID_MPEG1, +}; + +static const AM_MEDIA_TYPE mp2_mt = +{ + /* MEDIATYPE_Audio, MEDIASUBTYPE_MPEG1AudioPayload, FORMAT_WaveFormatEx */ + .majortype = {0x73647561, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}, + .subtype = {0x00000050, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}, + .bFixedSizeSamples = TRUE, + .lSampleSize = 1, + .formattype = {0x05589f81, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}}, + .cbFormat = sizeof(MPEG1WAVEFORMAT), + .pbFormat = (BYTE *)&mp2_format, +}; + +static const MPEG1WAVEFORMAT mp3_format0 = +{ + .wfx.wFormatTag = WAVE_FORMAT_MPEG, + .wfx.nChannels = 1, + .wfx.nSamplesPerSec = 32000, + .wfx.nBlockAlign = 144, + .wfx.nAvgBytesPerSec = 4000, + .wfx.cbSize = sizeof(MPEG1WAVEFORMAT) - sizeof(WAVEFORMATEX), + .fwHeadLayer = ACM_MPEG_LAYER3, + .dwHeadBitrate = 32000, + .fwHeadMode = ACM_MPEG_SINGLECHANNEL, + .fwHeadFlags = ACM_MPEG_ID_MPEG1, +}; + +static const AM_MEDIA_TYPE mp3_mt0 = +{ + /* MEDIATYPE_Audio, MEDIASUBTYPE_MPEG1AudioPayload, FORMAT_WaveFormatEx */ + .majortype = {0x73647561, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}, + .subtype = {0x00000050, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}, + .bFixedSizeSamples = TRUE, + .lSampleSize = 1, + .formattype = {0x05589f81, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}}, + .cbFormat = sizeof(MPEG1WAVEFORMAT), + .pbFormat = (BYTE *)&mp3_format0, +}; + +static const MPEGLAYER3WAVEFORMAT mp3_format1 = +{ + .wfx.wFormatTag = WAVE_FORMAT_MPEGLAYER3, + .wfx.nChannels = 1, + .wfx.nSamplesPerSec = 32000, + .wfx.nBlockAlign = 144, + .wfx.nAvgBytesPerSec = 4000, + .wfx.cbSize = sizeof(MPEGLAYER3WAVEFORMAT) - sizeof(WAVEFORMATEX), + .wID = MPEGLAYER3_ID_MPEG, + .nBlockSize = 144, + .nFramesPerBlock = 1, +}; + +static const AM_MEDIA_TYPE mp3_mt1 = +{ + /* MEDIATYPE_Audio, MEDIASUBTYPE_MP3, FORMAT_WaveFormatEx */ + .majortype = {0x73647561, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}, + .subtype = {WAVE_FORMAT_MPEGLAYER3, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}, + .bFixedSizeSamples = TRUE, + .lSampleSize = 1, + .formattype = {0x05589f81, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}}, + .cbFormat = sizeof(MPEGLAYER3WAVEFORMAT), + .pbFormat = (BYTE *)&mp3_format1, +}; + static IBaseFilter *create_mpeg_layer3_decoder(void) { IBaseFilter *filter = NULL; @@ -33,6 +137,26 @@ static IBaseFilter *create_mpeg_layer3_decoder(void) return filter; } +static void init_pcm_mt(AM_MEDIA_TYPE *mt, WAVEFORMATEX *format, + WORD channels, DWORD sample_rate, WORD depth) +{ + memset(format, 0, sizeof(WAVEFORMATEX)); + format->wFormatTag = WAVE_FORMAT_PCM; + format->nChannels = channels; + format->nSamplesPerSec = sample_rate; + format->wBitsPerSample = depth; + format->nBlockAlign = channels * depth / 8; + format->nAvgBytesPerSec = format->nBlockAlign * format->nSamplesPerSec; + memset(mt, 0, sizeof(AM_MEDIA_TYPE)); + mt->majortype = MEDIATYPE_Audio; + mt->subtype = MEDIASUBTYPE_PCM; + mt->bFixedSizeSamples = TRUE; + mt->lSampleSize = format->nBlockAlign; + mt->formattype = FORMAT_WaveFormatEx; + mt->cbFormat = sizeof(WAVEFORMATEX); + mt->pbFormat = (BYTE *)format; +} + static ULONG get_refcount(void *iface) { IUnknown *unknown = iface; @@ -563,6 +687,58 @@ static void test_enum_media_types(void) ok(!ref, "Got outstanding refcount %ld.\n", ref); } +static void test_media_types(void) +{ + IBaseFilter *filter = create_mpeg_layer3_decoder(); + WAVEFORMATEX format; + AM_MEDIA_TYPE mt; + HRESULT hr; + ULONG ref; + IPin *pin; + + IBaseFilter_FindPin(filter, L"In", &pin); + + hr = IPin_QueryAccept(pin, &mp3_mt1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + mt = mp3_mt1; + mt.subtype = MEDIASUBTYPE_PCM; + hr = IPin_QueryAccept(pin, &mt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IPin_QueryAccept(pin, &mp1_mt); + todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IPin_QueryAccept(pin, &mp2_mt); + todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + hr = IPin_QueryAccept(pin, &mp3_mt0); + todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + mt = mp3_mt1; + mt.majortype = GUID_NULL; + hr = IPin_QueryAccept(pin, &mt); + todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + mt = mp3_mt1; + mt.formattype = GUID_NULL; + hr = IPin_QueryAccept(pin, &mt); + todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + IPin_Release(pin); + + IBaseFilter_FindPin(filter, L"Out", &pin); + + init_pcm_mt(&mt, &format, 1, 32000, 16); + hr = IPin_QueryAccept(pin, &mt); + todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + IPin_Release(pin); + + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %ld.\n", ref); +} + START_TEST(mpeglayer3) { IBaseFilter *filter; @@ -584,6 +760,7 @@ START_TEST(mpeglayer3) test_find_pin(); test_pin_info(); test_enum_media_types(); + test_media_types(); CoUninitialize(); }
1
0
0
0
← Newer
1
...
95
96
97
98
99
100
101
...
118
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Results per page:
10
25
50
100
200