As Wine currently does not have a way to set captions, returning the default value should suffice for most applications.
It looks like Windows does not do error checking for the *value parameter.
For the computed properties, they return E_INVALIDARG when all the captions are set as Default. But they return S_OK if any of the caption settings have been modified, regardless of whether a valid *value parameter is passed.
I expected it to at least return the computed values for the default properties but this does not appear to be the case. I guess there's no reason to keep the checks for each member of the computed color struct? Perhaps keep the checks for E_INVALIDARG and S_OK? I haven't come across an application that uses the functions so I didn't implement them.
For the rest of the properties, the if (0) test was added just to show that it crashes with a NULL value. Also, if the wrong type is passed, the function does not crash on Windows and the value remains unchanged, but it returns S_OK.
-- v4: windows.media: Partially implement IClosedCaptionPropertiesStatics_get_RegionOpacity. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_RegionColor. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_BackgroundOpacity. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_BackgroundColor. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_FontEffect. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_FontStyle. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_FontSize. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_FontOpacity. windows.media: Partially implement IClosedCaptionPropertiesStatics_get_FontColor. windows.media/tests: Add Closed Caption Properties tests.
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- v2: - Remove error checks that crash on Windows. - Remove unreliable tests for computed colors. - Add comments clarifying expected behavior of computed functions. -- v3: - Replace comments with checks for ClosedCaptionColor_Default. -- v4: - Remove checks for ClosedCaptionColor_Default. --- dlls/windows.media/tests/captions.c | 70 +++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+)
diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index b1e1f4fd334..647e5eee1e5 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -26,7 +26,10 @@ #include "roapi.h"
#define WIDL_using_Windows_Foundation +#define WIDL_using_Windows_Foundation_Collections #include "windows.foundation.h" +#define WIDL_using_Windows_UI +#include "windows.ui.h" #define WIDL_using_Windows_Media_ClosedCaptioning #include "windows.media.closedcaptioning.h"
@@ -55,6 +58,13 @@ static void test_CaptionStatics(void) HSTRING str; HRESULT hr; LONG ref; + /* Properties */ + ClosedCaptionColor color; + ClosedCaptionOpacity opacity; + ClosedCaptionSize size; + ClosedCaptionStyle style; + ClosedCaptionEdgeEffect effect; + Color computed_color;
hr = WindowsCreateString( caption_properties_name, wcslen( caption_properties_name ), &str ); ok( hr == S_OK, "got hr %#lx.\n", hr ); @@ -75,6 +85,66 @@ static void test_CaptionStatics(void) hr = IActivationFactory_QueryInterface( factory, &IID_IClosedCaptionPropertiesStatics, (void **)&caption_statics ); ok( hr == S_OK, "got hr %#lx.\n", hr );
+ color = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontColor( caption_statics, &color ); + todo_wine ok( hr == S_OK, "get_FontColor returned %#lx\n", hr ); + todo_wine ok( color == ClosedCaptionColor_Default, "expected default font color, got %d\n", color ); + + hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, &computed_color ); + todo_wine ok( hr == E_INVALIDARG, "get_ComputedFontColor returned %#lx\n", hr ); + hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, NULL ); + todo_wine ok( hr == E_INVALIDARG, "get_ComputedFontColor returned %#lx\n", hr ); + + opacity = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontOpacity( caption_statics, &opacity ); + todo_wine ok( hr == S_OK, "get_FontOpacity returned %#lx\n", hr ); + todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default font opacity, got %d\n", opacity ); + + size = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontSize( caption_statics, &size ); + todo_wine ok( hr == S_OK, "get_FontSize returned %#lx\n", hr ); + todo_wine ok( size == ClosedCaptionSize_Default, "expected default font size, got %d\n", size ); + + style = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontStyle( caption_statics, &style ); + todo_wine ok( hr == S_OK, "get_FontStyle returned %#lx\n", hr ); + todo_wine ok( style == ClosedCaptionStyle_Default, "expected default font style, got %d\n", style ); + + effect = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontEffect( caption_statics, &effect ); + todo_wine ok( hr == S_OK, "get_FontEffect returned %#lx\n", hr ); + todo_wine ok( effect == ClosedCaptionEdgeEffect_Default, "expected default font effect, got %d\n", effect ); + + color = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_BackgroundColor( caption_statics, &color ); + todo_wine ok( hr == S_OK, "get_BackgroundColor returned %#lx\n", hr ); + todo_wine ok( color == ClosedCaptionColor_Default, "expected default background color, got %d\n", color ); + + hr = IClosedCaptionPropertiesStatics_get_ComputedBackgroundColor( caption_statics, &computed_color ); + todo_wine ok( hr == E_INVALIDARG, "get_ComputedBackgroundColor returned %#lx\n", hr ); + hr = IClosedCaptionPropertiesStatics_get_ComputedBackgroundColor( caption_statics, NULL ); + todo_wine ok( hr == E_INVALIDARG, "get_ComputedBackgroundColor returned %#lx\n", hr ); + + opacity = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_BackgroundOpacity( caption_statics, &opacity ); + todo_wine ok( hr == S_OK, "get_BackgroundOpacity returned %#lx\n", hr ); + todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default background opacity, got %d\n", opacity ); + + color = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_RegionColor( caption_statics, &color ); + todo_wine ok( hr == S_OK, "get_RegionColor returned %#lx\n", hr ); + todo_wine ok( color == ClosedCaptionColor_Default, "expected default region color, got %d\n", color ); + + hr = IClosedCaptionPropertiesStatics_get_ComputedRegionColor( caption_statics, &computed_color ); + todo_wine ok( hr == E_INVALIDARG, "get_ComputedRegionColor returned %#lx\n", hr ); + hr = IClosedCaptionPropertiesStatics_get_ComputedRegionColor( caption_statics, NULL ); + todo_wine ok( hr == E_INVALIDARG, "get_ComputedRegionColor returned %#lx\n", hr ); + + opacity = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_RegionOpacity( caption_statics, &opacity ); + todo_wine ok( hr == S_OK, "get_RegionOpacity returned %#lx\n", hr ); + todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default region opacity, got %d\n", opacity ); + ref = IClosedCaptionPropertiesStatics_Release( caption_statics ); ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 2e68948209e..41f14944ec0 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -128,8 +128,10 @@ DEFINE_IINSPECTABLE( captions, IClosedCaptionPropertiesStatics, struct captions_
static HRESULT WINAPI captions_get_FontColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionColor_Default; + return S_OK; }
static HRESULT WINAPI captions_get_ComputedFontColor( IClosedCaptionPropertiesStatics *iface, Color *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 647e5eee1e5..875bfa41d20 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -87,8 +87,8 @@ static void test_CaptionStatics(void)
color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontColor( caption_statics, &color ); - todo_wine ok( hr == S_OK, "get_FontColor returned %#lx\n", hr ); - todo_wine ok( color == ClosedCaptionColor_Default, "expected default font color, got %d\n", color ); + ok( hr == S_OK, "get_FontColor returned %#lx\n", hr ); + ok( color == ClosedCaptionColor_Default, "expected default font color, got %d\n", color );
hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, &computed_color ); todo_wine ok( hr == E_INVALIDARG, "get_ComputedFontColor returned %#lx\n", hr );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 41f14944ec0..43a421f0fa8 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -142,8 +142,10 @@ static HRESULT WINAPI captions_get_ComputedFontColor( IClosedCaptionPropertiesSt
static HRESULT WINAPI captions_get_FontOpacity( IClosedCaptionPropertiesStatics *iface, ClosedCaptionOpacity *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionOpacity_Default; + return S_OK; }
static HRESULT WINAPI captions_get_FontSize( IClosedCaptionPropertiesStatics *iface, ClosedCaptionSize *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 875bfa41d20..df2e02b644b 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -97,8 +97,8 @@ static void test_CaptionStatics(void)
opacity = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontOpacity( caption_statics, &opacity ); - todo_wine ok( hr == S_OK, "get_FontOpacity returned %#lx\n", hr ); - todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default font opacity, got %d\n", opacity ); + ok( hr == S_OK, "get_FontOpacity returned %#lx\n", hr ); + ok( opacity == ClosedCaptionOpacity_Default, "expected default font opacity, got %d\n", opacity );
size = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontSize( caption_statics, &size );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 43a421f0fa8..f9bd9505ea5 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -150,8 +150,10 @@ static HRESULT WINAPI captions_get_FontOpacity( IClosedCaptionPropertiesStatics
static HRESULT WINAPI captions_get_FontSize( IClosedCaptionPropertiesStatics *iface, ClosedCaptionSize *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionSize_Default; + return S_OK; }
static HRESULT WINAPI captions_get_FontStyle( IClosedCaptionPropertiesStatics *iface, ClosedCaptionStyle *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index df2e02b644b..cd3a3ccbd13 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -102,8 +102,8 @@ static void test_CaptionStatics(void)
size = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontSize( caption_statics, &size ); - todo_wine ok( hr == S_OK, "get_FontSize returned %#lx\n", hr ); - todo_wine ok( size == ClosedCaptionSize_Default, "expected default font size, got %d\n", size ); + ok( hr == S_OK, "get_FontSize returned %#lx\n", hr ); + ok( size == ClosedCaptionSize_Default, "expected default font size, got %d\n", size );
style = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontStyle( caption_statics, &style );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index f9bd9505ea5..40f5fbb9800 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -158,8 +158,10 @@ static HRESULT WINAPI captions_get_FontSize( IClosedCaptionPropertiesStatics *if
static HRESULT WINAPI captions_get_FontStyle( IClosedCaptionPropertiesStatics *iface, ClosedCaptionStyle *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionStyle_Default; + return S_OK; }
static HRESULT WINAPI captions_get_FontEffect( IClosedCaptionPropertiesStatics *iface, ClosedCaptionEdgeEffect *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index cd3a3ccbd13..57e1bf6a998 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -107,8 +107,8 @@ static void test_CaptionStatics(void)
style = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontStyle( caption_statics, &style ); - todo_wine ok( hr == S_OK, "get_FontStyle returned %#lx\n", hr ); - todo_wine ok( style == ClosedCaptionStyle_Default, "expected default font style, got %d\n", style ); + ok( hr == S_OK, "get_FontStyle returned %#lx\n", hr ); + ok( style == ClosedCaptionStyle_Default, "expected default font style, got %d\n", style );
effect = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontEffect( caption_statics, &effect );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 40f5fbb9800..d3954eb1b4f 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -166,8 +166,10 @@ static HRESULT WINAPI captions_get_FontStyle( IClosedCaptionPropertiesStatics *i
static HRESULT WINAPI captions_get_FontEffect( IClosedCaptionPropertiesStatics *iface, ClosedCaptionEdgeEffect *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionEdgeEffect_Default; + return S_OK; }
static HRESULT WINAPI captions_get_BackgroundColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 57e1bf6a998..323d77dd3b8 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -112,8 +112,8 @@ static void test_CaptionStatics(void)
effect = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontEffect( caption_statics, &effect ); - todo_wine ok( hr == S_OK, "get_FontEffect returned %#lx\n", hr ); - todo_wine ok( effect == ClosedCaptionEdgeEffect_Default, "expected default font effect, got %d\n", effect ); + ok( hr == S_OK, "get_FontEffect returned %#lx\n", hr ); + ok( effect == ClosedCaptionEdgeEffect_Default, "expected default font effect, got %d\n", effect );
color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_BackgroundColor( caption_statics, &color );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index d3954eb1b4f..b18c2dce820 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -174,8 +174,10 @@ static HRESULT WINAPI captions_get_FontEffect( IClosedCaptionPropertiesStatics *
static HRESULT WINAPI captions_get_BackgroundColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionColor_Default; + return S_OK; }
static HRESULT WINAPI captions_get_ComputedBackgroundColor( IClosedCaptionPropertiesStatics *iface, Color *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 323d77dd3b8..127f5380259 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -117,8 +117,8 @@ static void test_CaptionStatics(void)
color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_BackgroundColor( caption_statics, &color ); - todo_wine ok( hr == S_OK, "get_BackgroundColor returned %#lx\n", hr ); - todo_wine ok( color == ClosedCaptionColor_Default, "expected default background color, got %d\n", color ); + ok( hr == S_OK, "get_BackgroundColor returned %#lx\n", hr ); + ok( color == ClosedCaptionColor_Default, "expected default background color, got %d\n", color );
hr = IClosedCaptionPropertiesStatics_get_ComputedBackgroundColor( caption_statics, &computed_color ); todo_wine ok( hr == E_INVALIDARG, "get_ComputedBackgroundColor returned %#lx\n", hr );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index b18c2dce820..13a88da34ff 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -188,8 +188,10 @@ static HRESULT WINAPI captions_get_ComputedBackgroundColor( IClosedCaptionProper
static HRESULT WINAPI captions_get_BackgroundOpacity( IClosedCaptionPropertiesStatics *iface, ClosedCaptionOpacity *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionOpacity_Default; + return S_OK; }
static HRESULT WINAPI captions_get_RegionColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 127f5380259..26e9ae9ab21 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -127,8 +127,8 @@ static void test_CaptionStatics(void)
opacity = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_BackgroundOpacity( caption_statics, &opacity ); - todo_wine ok( hr == S_OK, "get_BackgroundOpacity returned %#lx\n", hr ); - todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default background opacity, got %d\n", opacity ); + ok( hr == S_OK, "get_BackgroundOpacity returned %#lx\n", hr ); + ok( opacity == ClosedCaptionOpacity_Default, "expected default background opacity, got %d\n", opacity );
color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_RegionColor( caption_statics, &color );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 13a88da34ff..a3a27abc823 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -196,8 +196,10 @@ static HRESULT WINAPI captions_get_BackgroundOpacity( IClosedCaptionPropertiesSt
static HRESULT WINAPI captions_get_RegionColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionColor_Default; + return S_OK; }
static HRESULT WINAPI captions_get_ComputedRegionColor( IClosedCaptionPropertiesStatics *iface, Color *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 26e9ae9ab21..21d15e03589 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -132,8 +132,8 @@ static void test_CaptionStatics(void)
color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_RegionColor( caption_statics, &color ); - todo_wine ok( hr == S_OK, "get_RegionColor returned %#lx\n", hr ); - todo_wine ok( color == ClosedCaptionColor_Default, "expected default region color, got %d\n", color ); + ok( hr == S_OK, "get_RegionColor returned %#lx\n", hr ); + ok( color == ClosedCaptionColor_Default, "expected default region color, got %d\n", color );
hr = IClosedCaptionPropertiesStatics_get_ComputedRegionColor( caption_statics, &computed_color ); todo_wine ok( hr == E_INVALIDARG, "get_ComputedRegionColor returned %#lx\n", hr );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index a3a27abc823..b7e07710603 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -210,8 +210,10 @@ static HRESULT WINAPI captions_get_ComputedRegionColor( IClosedCaptionProperties
static HRESULT WINAPI captions_get_RegionOpacity( IClosedCaptionPropertiesStatics *iface, ClosedCaptionOpacity *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionOpacity_Default; + return S_OK; }
static const struct IClosedCaptionPropertiesStaticsVtbl captions_statics_vtbl = diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 21d15e03589..c496a8503fb 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -142,8 +142,8 @@ static void test_CaptionStatics(void)
opacity = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_RegionOpacity( caption_statics, &opacity ); - todo_wine ok( hr == S_OK, "get_RegionOpacity returned %#lx\n", hr ); - todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default region opacity, got %d\n", opacity ); + ok( hr == S_OK, "get_RegionOpacity returned %#lx\n", hr ); + ok( opacity == ClosedCaptionOpacity_Default, "expected default region opacity, got %d\n", opacity );
ref = IClosedCaptionPropertiesStatics_Release( caption_statics ); ok( ref == 2, "got ref %ld.\n", ref );
On Fri Nov 25 08:32:12 2022 +0000, Mohamad Al-Jaf wrote:
changed this line in [version 4 of the diff](/wine/wine/-/merge_requests/1537/diffs?diff_id=21003&start_sha=0036e4760e7ba634e7c9886421841b2e04a54df8#15d98e6edd6c09265d9ddeed459244f3551accfc_94_94)
It's just to show that get_Computed[Font/Background/Region]Color only works if the user has set a color other than default. This is how it behaves on Windows at least.
I suppose it's not needed given there's no way to set captions in Wine yet. I don't know if there's even a way to set the color programmatically for the Windows tests.
On Fri Nov 25 08:33:41 2022 +0000, Mohamad Al-Jaf wrote:
It's just to show that get_Computed[Font/Background/Region]Color only works if the user has set a color other than default. This is how it behaves on Windows at least. I suppose it's not needed given there's no way to set captions in Wine yet. I don't know if there's even a way to set the color programmatically for the Windows tests.
I don't know either but if the user can do that the test above would fail anyway. So, either it needs to be handled there too or, simpler, we ignore that possibility until we find a way to programmatically do it.
On Fri Nov 25 04:48:20 2022 +0000, Mohamad Al-Jaf wrote:
I find it odd that no error checking is done on Windows. Is this somewhat common?
Yes it's quite common in WinRT afaics.
Looks good but could you strip the v2, v3 comments from the commit message? If you want to add these notes it's better to just add a comment on the Gitlab MR, otherwise they'll stay in the commit when the branch is merged (to the contrary to when we were sending patches, `git am` was stripping comments below `---`).