[4/5] windowscodecs: Implement IWICComponentInfo::GetSpecVersion.

Vincent Povirk madewokherd at gmail.com
Wed Jun 20 08:02:42 CDT 2012


-------------- next part --------------
From 717dcbd5927872001f3145e2bdc2aff734300916 Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Wed, 13 Jun 2012 09:28:36 -0500
Subject: [PATCH 04/17] windowscodecs: Implement
 IWICComponentInfo::GetSpecVersion.

---
 dlls/windowscodecs/info.c       |   33 +++++++++++++++++++++++++--------
 dlls/windowscodecs/tests/info.c |    4 ++--
 2 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c
index 61c9ba1..f545937 100644
--- a/dlls/windowscodecs/info.c
+++ b/dlls/windowscodecs/info.c
@@ -43,6 +43,7 @@ static const WCHAR pixelformats_keyname[] = {'P','i','x','e','l','F','o','r','m'
 static const WCHAR containerformat_valuename[] = {'C','o','n','t','a','i','n','e','r','F','o','r','m','a','t',0};
 static const WCHAR vendor_valuename[] = {'V','e','n','d','o','r',0};
 static const WCHAR version_valuename[] = {'V','e','r','s','i','o','n',0};
+static const WCHAR specversion_valuename[] = {'S','p','e','c','V','e','r','s','i','o','n',0};
 static const WCHAR bitsperpixel_valuename[] = {'B','i','t','L','e','n','g','t','h',0};
 static const WCHAR channelcount_valuename[] = {'C','h','a','n','n','e','l','C','o','u','n','t',0};
 
@@ -251,8 +252,12 @@ static HRESULT WINAPI BitmapDecoderInfo_GetVersion(IWICBitmapDecoderInfo *iface,
 static HRESULT WINAPI BitmapDecoderInfo_GetSpecVersion(IWICBitmapDecoderInfo *iface, UINT cchSpecVersion,
     WCHAR *wzSpecVersion, UINT *pcchActual)
 {
-    FIXME("(%p,%u,%p,%p): stub\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
-    return E_NOTIMPL;
+    BitmapDecoderInfo *This = impl_from_IWICBitmapDecoderInfo(iface);
+
+    TRACE("(%p,%u,%p,%p)\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
+
+    return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+        cchSpecVersion, wzSpecVersion, pcchActual);
 }
 
 static HRESULT WINAPI BitmapDecoderInfo_GetFriendlyName(IWICBitmapDecoderInfo *iface, UINT cchFriendlyName,
@@ -712,8 +717,12 @@ static HRESULT WINAPI BitmapEncoderInfo_GetVersion(IWICBitmapEncoderInfo *iface,
 static HRESULT WINAPI BitmapEncoderInfo_GetSpecVersion(IWICBitmapEncoderInfo *iface, UINT cchSpecVersion,
     WCHAR *wzSpecVersion, UINT *pcchActual)
 {
-    FIXME("(%p,%u,%p,%p): stub\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
-    return E_NOTIMPL;
+    BitmapEncoderInfo *This = impl_from_IWICBitmapEncoderInfo(iface);
+
+    TRACE("(%p,%u,%p,%p)\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
+
+    return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+        cchSpecVersion, wzSpecVersion, pcchActual);
 }
 
 static HRESULT WINAPI BitmapEncoderInfo_GetFriendlyName(IWICBitmapEncoderInfo *iface, UINT cchFriendlyName,
@@ -998,8 +1007,12 @@ static HRESULT WINAPI FormatConverterInfo_GetVersion(IWICFormatConverterInfo *if
 static HRESULT WINAPI FormatConverterInfo_GetSpecVersion(IWICFormatConverterInfo *iface, UINT cchSpecVersion,
     WCHAR *wzSpecVersion, UINT *pcchActual)
 {
-    FIXME("(%p,%u,%p,%p): stub\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
-    return E_NOTIMPL;
+    FormatConverterInfo *This = impl_from_IWICFormatConverterInfo(iface);
+
+    TRACE("(%p,%u,%p,%p)\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
+
+    return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+        cchSpecVersion, wzSpecVersion, pcchActual);
 }
 
 static HRESULT WINAPI FormatConverterInfo_GetFriendlyName(IWICFormatConverterInfo *iface, UINT cchFriendlyName,
@@ -1219,8 +1232,12 @@ static HRESULT WINAPI PixelFormatInfo_GetVersion(IWICPixelFormatInfo2 *iface, UI
 static HRESULT WINAPI PixelFormatInfo_GetSpecVersion(IWICPixelFormatInfo2 *iface, UINT cchSpecVersion,
     WCHAR *wzSpecVersion, UINT *pcchActual)
 {
-    FIXME("(%p,%u,%p,%p): stub\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
-    return E_NOTIMPL;
+    PixelFormatInfo *This = impl_from_IWICPixelFormatInfo2(iface);
+
+    TRACE("(%p,%u,%p,%p)\n", iface, cchSpecVersion, wzSpecVersion, pcchActual);
+
+    return ComponentInfo_GetStringValue(This->classkey, specversion_valuename,
+        cchSpecVersion, wzSpecVersion, pcchActual);
 }
 
 static HRESULT WINAPI PixelFormatInfo_GetFriendlyName(IWICPixelFormatInfo2 *iface, UINT cchFriendlyName,
diff --git a/dlls/windowscodecs/tests/info.c b/dlls/windowscodecs/tests/info.c
index 75131a3..067c0a1 100644
--- a/dlls/windowscodecs/tests/info.c
+++ b/dlls/windowscodecs/tests/info.c
@@ -203,8 +203,8 @@ static void test_pixelformat_info(void)
 
     len = 0xdeadbeef;
     hr = IWICComponentInfo_GetSpecVersion(info, 0, NULL, &len);
-    todo_wine ok(hr == S_OK, "GetSpecVersion failed, hr=%x\n", hr);
-    todo_wine ok(len == 0, "invalid length 0x%x\n", len); /* spec version does not apply to pixel formats */
+    ok(hr == S_OK, "GetSpecVersion failed, hr=%x\n", hr);
+    ok(len == 0, "invalid length 0x%x\n", len); /* spec version does not apply to pixel formats */
 
     memset(&guid, 0xaa, sizeof(guid));
     hr = IWICComponentInfo_GetVendorGUID(info, &guid);
-- 
1.7.9.5


More information about the wine-patches mailing list