Huw Davies : inetcomm: Implement IMimeBody:[G|S]etCurrentEncoding.

Alexandre Julliard julliard at winehq.org
Tue Nov 27 09:54:28 CST 2007


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Nov 26 12:04:08 2007 +0000

inetcomm: Implement IMimeBody:[G|S]etCurrentEncoding.

---

 dlls/inetcomm/mimeole.c       |   18 ++++++++++++++----
 dlls/inetcomm/tests/mimeole.c |    5 +++++
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/dlls/inetcomm/mimeole.c b/dlls/inetcomm/mimeole.c
index dea1597..685356c 100644
--- a/dlls/inetcomm/mimeole.c
+++ b/dlls/inetcomm/mimeole.c
@@ -103,6 +103,7 @@ typedef struct MimeBody
     DWORD next_prop_id;
     char *content_pri_type;
     char *content_sub_type;
+    ENCODINGTYPE encoding;
 } MimeBody;
 
 static inline MimeBody *impl_from_IMimeBody( IMimeBody *iface )
@@ -762,16 +763,24 @@ static HRESULT WINAPI MimeBody_GetCurrentEncoding(
                                          IMimeBody* iface,
                                          ENCODINGTYPE* pietEncoding)
 {
-    FIXME("stub\n");
-    return E_NOTIMPL;
+    MimeBody *This = impl_from_IMimeBody(iface);
+
+    TRACE("(%p)->(%p)\n", This, pietEncoding);
+
+    *pietEncoding = This->encoding;
+    return S_OK;
 }
 
 static HRESULT WINAPI MimeBody_SetCurrentEncoding(
                                          IMimeBody* iface,
                                          ENCODINGTYPE ietEncoding)
 {
-    FIXME("stub\n");
-    return E_NOTIMPL;
+    MimeBody *This = impl_from_IMimeBody(iface);
+
+    TRACE("(%p)->(%d)\n", This, ietEncoding);
+
+    This->encoding = ietEncoding;
+    return S_OK;
 }
 
 static HRESULT WINAPI MimeBody_GetEstimatedSize(
@@ -924,6 +933,7 @@ HRESULT MimeBody_create(IUnknown *outer, void **obj)
     This->next_prop_id = FIRST_CUSTOM_PROP_ID;
     This->content_pri_type = NULL;
     This->content_sub_type = NULL;
+    This->encoding = IET_7BIT;
 
     *obj = (IMimeBody *)&This->lpVtbl;
     return S_OK;
diff --git a/dlls/inetcomm/tests/mimeole.c b/dlls/inetcomm/tests/mimeole.c
index 2c814d2..32dec5c 100644
--- a/dlls/inetcomm/tests/mimeole.c
+++ b/dlls/inetcomm/tests/mimeole.c
@@ -89,6 +89,7 @@ static void test_CreateBody(void)
     IStream *in;
     LARGE_INTEGER off;
     ULARGE_INTEGER pos;
+    ENCODINGTYPE enc;
 
     hr = CoCreateInstance(&CLSID_IMimeBody, NULL, CLSCTX_INPROC_SERVER, &IID_IMimeBody, (void**)&body);
     ok(hr == S_OK, "ret %08x\n", hr);
@@ -107,6 +108,10 @@ static void test_CreateBody(void)
     hr = IMimeBody_InitNew(body);
     ok(hr == S_OK, "ret %08x\n", hr);
 
+    hr = IMimeBody_GetCurrentEncoding(body, &enc);
+    ok(hr == S_OK, "ret %08x\n", hr);
+    ok(enc == IET_7BIT, "encoding %d\n", enc);
+
     hr = IMimeBody_Load(body, in);
     ok(hr == S_OK, "ret %08x\n", hr);
     off.QuadPart = 0;




More information about the wine-cvs mailing list