Huw Davies : inetcomm: Implement IMimeBody_IsType(IBT_EMPTY).

Alexandre Julliard julliard at winehq.org
Tue Sep 23 09:28:19 CDT 2008


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Sep 22 14:36:13 2008 +0100

inetcomm: Implement IMimeBody_IsType(IBT_EMPTY).

---

 dlls/inetcomm/mimeole.c       |   13 +++++++++++--
 dlls/inetcomm/tests/mimeole.c |    5 +++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/dlls/inetcomm/mimeole.c b/dlls/inetcomm/mimeole.c
index bae7dc7..10c6685 100644
--- a/dlls/inetcomm/mimeole.c
+++ b/dlls/inetcomm/mimeole.c
@@ -864,8 +864,17 @@ static HRESULT WINAPI MimeBody_IsType(
                              IMimeBody* iface,
                              IMSGBODYTYPE bodytype)
 {
-    FIXME("(%p)->(%d): stub\n", iface, bodytype);
-    return E_NOTIMPL;
+    MimeBody *This = impl_from_IMimeBody(iface);
+
+    TRACE("(%p)->(%d)\n", iface, bodytype);
+    switch(bodytype)
+    {
+    case IBT_EMPTY:
+        return This->data ? S_FALSE : S_OK;
+    default:
+        FIXME("Unimplemented bodytype %d - returning S_OK\n", bodytype);
+    }
+    return S_OK;
 }
 
 static HRESULT WINAPI MimeBody_SetDisplayName(
diff --git a/dlls/inetcomm/tests/mimeole.c b/dlls/inetcomm/tests/mimeole.c
index 8200400..1f29abb 100644
--- a/dlls/inetcomm/tests/mimeole.c
+++ b/dlls/inetcomm/tests/mimeole.c
@@ -130,6 +130,8 @@ static void test_CreateBody(void)
     ok(hr == S_FALSE, "ret %08x\n", hr);
     hr = IMimeBody_IsContentType(body, NULL, "mixed");
     ok(hr == S_OK, "ret %08x\n", hr);
+    hr = IMimeBody_IsType(body, IBT_EMPTY);
+    ok(hr == S_OK, "got %08x\n", hr);
 
     hr = IMimeBody_SetData(body, IET_8BIT, "text", "plain", &IID_IStream, in);
     ok(hr == S_OK, "ret %08x\n", hr);
@@ -148,6 +150,9 @@ static void test_CreateBody(void)
     ok(offsets.cbBodyStart == 0, "got %d\n", offsets.cbBodyStart);
     ok(offsets.cbBodyEnd == 0, "got %d\n", offsets.cbBodyEnd);
 
+    hr = IMimeBody_IsType(body, IBT_EMPTY);
+    ok(hr == S_FALSE, "got %08x\n", hr);
+
     hr = MimeOleGetAllocator(&alloc);
     ok(hr == S_OK, "ret %08x\n", hr);
 




More information about the wine-cvs mailing list