Vincent Povirk : windowscodecs: Implement IWICComponentInfo:: GetFriendlyName.

Alexandre Julliard julliard at winehq.org
Tue Jun 19 15:36:25 CDT 2012


Module: wine
Branch: master
Commit: 0dee027df388b83beb63ce25cc31df28d80e2055
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0dee027df388b83beb63ce25cc31df28d80e2055

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Mon Apr 16 15:05:58 2012 -0500

windowscodecs: Implement IWICComponentInfo::GetFriendlyName.

---

 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 ed575a8..48106a8 100644
--- a/dlls/windowscodecs/info.c
+++ b/dlls/windowscodecs/info.c
@@ -38,6 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
 
 static const WCHAR mimetypes_valuename[] = {'M','i','m','e','T','y','p','e','s',0};
 static const WCHAR author_valuename[] = {'A','u','t','h','o','r',0};
+static const WCHAR friendlyname_valuename[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
 static const WCHAR pixelformats_keyname[] = {'P','i','x','e','l','F','o','r','m','a','t','s',0};
 static const WCHAR containerformat_valuename[] = {'C','o','n','t','a','i','n','e','r','F','o','r','m','a','t',0};
 
@@ -219,8 +220,12 @@ static HRESULT WINAPI BitmapDecoderInfo_GetSpecVersion(IWICBitmapDecoderInfo *if
 static HRESULT WINAPI BitmapDecoderInfo_GetFriendlyName(IWICBitmapDecoderInfo *iface, UINT cchFriendlyName,
     WCHAR *wzFriendlyName, UINT *pcchActual)
 {
-    FIXME("(%p,%u,%p,%p): stub\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
-    return E_NOTIMPL;
+    BitmapDecoderInfo *This = impl_from_IWICBitmapDecoderInfo(iface);
+
+    TRACE("(%p,%u,%p,%p)\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
+
+    return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+        cchFriendlyName, wzFriendlyName, pcchActual);
 }
 
 static HRESULT WINAPI BitmapDecoderInfo_GetContainerFormat(IWICBitmapDecoderInfo *iface,
@@ -669,8 +674,12 @@ static HRESULT WINAPI BitmapEncoderInfo_GetSpecVersion(IWICBitmapEncoderInfo *if
 static HRESULT WINAPI BitmapEncoderInfo_GetFriendlyName(IWICBitmapEncoderInfo *iface, UINT cchFriendlyName,
     WCHAR *wzFriendlyName, UINT *pcchActual)
 {
-    FIXME("(%p,%u,%p,%p): stub\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
-    return E_NOTIMPL;
+    BitmapEncoderInfo *This = impl_from_IWICBitmapEncoderInfo(iface);
+
+    TRACE("(%p,%u,%p,%p)\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
+
+    return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+        cchFriendlyName, wzFriendlyName, pcchActual);
 }
 
 static HRESULT WINAPI BitmapEncoderInfo_GetContainerFormat(IWICBitmapEncoderInfo *iface,
@@ -944,8 +953,12 @@ static HRESULT WINAPI FormatConverterInfo_GetSpecVersion(IWICFormatConverterInfo
 static HRESULT WINAPI FormatConverterInfo_GetFriendlyName(IWICFormatConverterInfo *iface, UINT cchFriendlyName,
     WCHAR *wzFriendlyName, UINT *pcchActual)
 {
-    FIXME("(%p,%u,%p,%p): stub\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
-    return E_NOTIMPL;
+    FormatConverterInfo *This = impl_from_IWICFormatConverterInfo(iface);
+
+    TRACE("(%p,%u,%p,%p)\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
+
+    return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+        cchFriendlyName, wzFriendlyName, pcchActual);
 }
 
 static HRESULT WINAPI FormatConverterInfo_GetPixelFormats(IWICFormatConverterInfo *iface,
@@ -1147,8 +1160,12 @@ static HRESULT WINAPI PixelFormatInfo_GetSpecVersion(IWICPixelFormatInfo2 *iface
 static HRESULT WINAPI PixelFormatInfo_GetFriendlyName(IWICPixelFormatInfo2 *iface, UINT cchFriendlyName,
     WCHAR *wzFriendlyName, UINT *pcchActual)
 {
-    FIXME("(%p,%u,%p,%p): stub\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
-    return E_NOTIMPL;
+    PixelFormatInfo *This = impl_from_IWICPixelFormatInfo2(iface);
+
+    TRACE("(%p,%u,%p,%p)\n", iface, cchFriendlyName, wzFriendlyName, pcchActual);
+
+    return ComponentInfo_GetStringValue(This->classkey, friendlyname_valuename,
+        cchFriendlyName, wzFriendlyName, pcchActual);
 }
 
 static HRESULT WINAPI PixelFormatInfo_GetFormatGUID(IWICPixelFormatInfo2 *iface,
diff --git a/dlls/windowscodecs/tests/info.c b/dlls/windowscodecs/tests/info.c
index 0e09bab..3f59d6b 100644
--- a/dlls/windowscodecs/tests/info.c
+++ b/dlls/windowscodecs/tests/info.c
@@ -189,13 +189,13 @@ static void test_pixelformat_info(void)
     ok(hr == S_OK, "GetComponentType failed, hr=%x\n", hr);
     ok(componenttype == WICPixelFormat, "unexpected component type 0x%x\n", componenttype);
 
-    todo_wine
-    {
     len = 0xdeadbeef;
     hr = IWICComponentInfo_GetFriendlyName(info, 0, NULL, &len);
     ok(hr == S_OK, "GetFriendlyName failed, hr=%x\n", hr);
     ok(len < 255 && len > 0, "invalid length 0x%x\n", len);
 
+    todo_wine
+    {
     hr = IWICComponentInfo_GetSigningStatus(info, NULL);
     ok(hr == E_INVALIDARG, "GetSigningStatus failed, hr=%x\n", hr);
 




More information about the wine-cvs mailing list