4 * Copyright 2006 Robert Shearman for CodeWeavers
5 * Copyright 2007 Huw Davies for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
34 #include "wine/list.h"
35 #include "wine/debug.h"
37 #include "inetcomm_private.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(inetcomm
);
45 DWORD flags
; /* MIMEPROPFLAGS */
53 } property_list_entry_t
;
55 static const property_t default_props
[] =
57 {"References", PID_HDR_REFS
, 0, VT_LPSTR
},
58 {"Subject", PID_HDR_SUBJECT
, 0, VT_LPSTR
},
59 {"From", PID_HDR_FROM
, MPF_ADDRESS
, VT_LPSTR
},
60 {"Message-ID", PID_HDR_MESSAGEID
, 0, VT_LPSTR
},
61 {"Return-Path", PID_HDR_RETURNPATH
, MPF_ADDRESS
, VT_LPSTR
},
62 {"Date", PID_HDR_DATE
, 0, VT_LPSTR
},
63 {"Received", PID_HDR_RECEIVED
, 0, VT_LPSTR
},
64 {"Reply-To", PID_HDR_REPLYTO
, MPF_ADDRESS
, VT_LPSTR
},
65 {"X-Mailer", PID_HDR_XMAILER
, 0, VT_LPSTR
},
66 {"Bcc", PID_HDR_BCC
, MPF_ADDRESS
, VT_LPSTR
},
67 {"MIME-Version", PID_HDR_MIMEVER
, MPF_MIME
, VT_LPSTR
},
68 {"Content-Type", PID_HDR_CNTTYPE
, MPF_MIME
| MPF_HASPARAMS
, VT_LPSTR
},
69 {"Content-Transfer-Encoding", PID_HDR_CNTXFER
, MPF_MIME
, VT_LPSTR
},
70 {"Content-ID", PID_HDR_CNTID
, MPF_MIME
, VT_LPSTR
},
71 {"Content-Disposition", PID_HDR_CNTDISP
, MPF_MIME
, VT_LPSTR
},
72 {"To", PID_HDR_TO
, MPF_ADDRESS
, VT_LPSTR
},
73 {"Cc", PID_HDR_CC
, MPF_ADDRESS
, VT_LPSTR
},
74 {"Sender", PID_HDR_SENDER
, MPF_ADDRESS
, VT_LPSTR
},
75 {"In-Reply-To", PID_HDR_INREPLYTO
, 0, VT_LPSTR
},
82 const property_t
*prop
;
86 typedef struct MimeBody
88 const IMimeBodyVtbl
*lpVtbl
;
94 struct list new_props
; /* FIXME: This should be in a PropertySchema */
98 static inline MimeBody
*impl_from_IMimeBody( IMimeBody
*iface
)
100 return (MimeBody
*)((char*)iface
- FIELD_OFFSET(MimeBody
, lpVtbl
));
103 static LPSTR
strdupA(LPCSTR str
)
106 int len
= strlen(str
);
107 ret
= HeapAlloc(GetProcessHeap(), 0, len
+ 1);
108 memcpy(ret
, str
, len
+ 1);
112 #define PARSER_BUF_SIZE 1024
114 /*****************************************************
115 * copy_headers_to_buf [internal]
117 * Copies the headers into a '\0' terminated memory block and leave
118 * the stream's current position set to after the blank line.
120 static HRESULT
copy_headers_to_buf(IStream
*stm
, char **ptr
)
123 DWORD size
= PARSER_BUF_SIZE
, offset
= 0, last_end
= 0;
135 buf
= HeapAlloc(GetProcessHeap(), 0, size
+ 1);
139 buf
= HeapReAlloc(GetProcessHeap(), 0, buf
, size
+ 1);
147 hr
= IStream_Read(stm
, buf
+ offset
, size
- offset
, &read
);
148 if(FAILED(hr
)) goto fail
;
153 if(read
== 0) done
= 1;
155 while(!done
&& (end
= strstr(buf
+ last_end
, "\r\n")))
157 DWORD new_end
= end
- buf
+ 2;
158 if(new_end
- last_end
== 2)
161 off
.QuadPart
= new_end
;
162 IStream_Seek(stm
, off
, STREAM_SEEK_SET
, NULL
);
175 HeapFree(GetProcessHeap(), 0, buf
);
179 static header_t
*read_prop(MimeBody
*body
, char **ptr
)
181 char *colon
= strchr(*ptr
, ':');
182 const property_t
*prop
;
185 if(!colon
) return NULL
;
189 for(prop
= default_props
; prop
->name
; prop
++)
191 if(!strcasecmp(*ptr
, prop
->name
))
193 TRACE("%s: found match with default property id %d\n", *ptr
, prop
->id
);
200 property_list_entry_t
*prop_entry
;
201 LIST_FOR_EACH_ENTRY(prop_entry
, &body
->new_props
, property_list_entry_t
, entry
)
203 if(!strcasecmp(*ptr
, prop_entry
->prop
.name
))
205 TRACE("%s: found match with already added new property id %d\n", *ptr
, prop_entry
->prop
.id
);
206 prop
= &prop_entry
->prop
;
212 prop_entry
= HeapAlloc(GetProcessHeap(), 0, sizeof(*prop_entry
));
213 prop_entry
->prop
.name
= strdupA(*ptr
);
214 prop_entry
->prop
.id
= body
->next_prop_id
++;
215 prop_entry
->prop
.flags
= 0;
216 prop_entry
->prop
.default_vt
= VT_LPSTR
;
217 list_add_tail(&body
->new_props
, &prop_entry
->entry
);
218 prop
= &prop_entry
->prop
;
219 TRACE("%s: allocating new prop id %d\n", *ptr
, prop_entry
->prop
.id
);
223 ret
= HeapAlloc(GetProcessHeap(), 0, sizeof(*ret
));
225 PropVariantInit(&ret
->value
);
231 static void read_value(header_t
*header
, char **cur
)
233 char *end
= *cur
, *value
;
237 end
= strstr(end
, "\r\n");
239 } while(*end
== ' ' || *end
== '\t');
242 value
= HeapAlloc(GetProcessHeap(), 0, len
+ 1);
243 memcpy(value
, *cur
, len
);
246 header
->value
.vt
= VT_LPSTR
;
247 header
->value
.pszVal
= value
;
252 static HRESULT
parse_headers(MimeBody
*body
, IStream
*stm
)
254 char *header_buf
, *cur_header_ptr
;
258 hr
= copy_headers_to_buf(stm
, &header_buf
);
259 if(FAILED(hr
)) return hr
;
261 cur_header_ptr
= header_buf
;
262 while((header
= read_prop(body
, &cur_header_ptr
)))
264 read_value(header
, &cur_header_ptr
);
265 list_add_tail(&body
->headers
, &header
->entry
);
268 HeapFree(GetProcessHeap(), 0, header_buf
);
272 static void empty_header_list(struct list
*list
)
274 header_t
*header
, *cursor2
;
276 LIST_FOR_EACH_ENTRY_SAFE(header
, cursor2
, list
, header_t
, entry
)
278 list_remove(&header
->entry
);
279 PropVariantClear(&header
->value
);
280 HeapFree(GetProcessHeap(), 0, header
);
284 static void empty_new_prop_list(struct list
*list
)
286 property_list_entry_t
*prop
, *cursor2
;
288 LIST_FOR_EACH_ENTRY_SAFE(prop
, cursor2
, list
, property_list_entry_t
, entry
)
290 list_remove(&prop
->entry
);
291 HeapFree(GetProcessHeap(), 0, (char *)prop
->prop
.name
);
292 HeapFree(GetProcessHeap(), 0, prop
);
296 static HRESULT WINAPI
MimeBody_QueryInterface(IMimeBody
* iface
,
300 TRACE("(%p)->(%s, %p)\n", iface
, debugstr_guid(riid
), ppvObject
);
304 if (IsEqualIID(riid
, &IID_IUnknown
) ||
305 IsEqualIID(riid
, &IID_IPersist
) ||
306 IsEqualIID(riid
, &IID_IPersistStreamInit
) ||
307 IsEqualIID(riid
, &IID_IMimePropertySet
) ||
308 IsEqualIID(riid
, &IID_IMimeBody
))
315 IUnknown_AddRef((IUnknown
*)*ppvObject
);
319 FIXME("no interface for %s\n", debugstr_guid(riid
));
320 return E_NOINTERFACE
;
323 static ULONG WINAPI
MimeBody_AddRef(IMimeBody
* iface
)
325 MimeBody
*This
= impl_from_IMimeBody(iface
);
326 TRACE("(%p)->()\n", iface
);
327 return InterlockedIncrement(&This
->refs
);
330 static ULONG WINAPI
MimeBody_Release(IMimeBody
* iface
)
332 MimeBody
*This
= impl_from_IMimeBody(iface
);
335 TRACE("(%p)->()\n", iface
);
337 refs
= InterlockedDecrement(&This
->refs
);
340 empty_header_list(&This
->headers
);
341 empty_new_prop_list(&This
->new_props
);
343 HeapFree(GetProcessHeap(), 0, This
);
349 static HRESULT WINAPI
MimeBody_GetClassID(
358 static HRESULT WINAPI
MimeBody_IsDirty(
365 static HRESULT WINAPI
MimeBody_Load(
369 MimeBody
*This
= impl_from_IMimeBody(iface
);
370 TRACE("(%p)->(%p)\n", iface
, pStm
);
371 return parse_headers(This
, pStm
);
374 static HRESULT WINAPI
MimeBody_Save(
383 static HRESULT WINAPI
MimeBody_GetSizeMax(
385 ULARGE_INTEGER
* pcbSize
)
391 static HRESULT WINAPI
MimeBody_InitNew(
394 TRACE("%p->()\n", iface
);
398 static HRESULT WINAPI
MimeBody_GetPropInfo(
401 LPMIMEPROPINFO pInfo
)
407 static HRESULT WINAPI
MimeBody_SetPropInfo(
410 LPCMIMEPROPINFO pInfo
)
416 static HRESULT WINAPI
MimeBody_GetProp(
420 LPPROPVARIANT pValue
)
426 static HRESULT WINAPI
MimeBody_SetProp(
430 LPCPROPVARIANT pValue
)
436 static HRESULT WINAPI
MimeBody_AppendProp(
440 LPPROPVARIANT pValue
)
446 static HRESULT WINAPI
MimeBody_DeleteProp(
454 static HRESULT WINAPI
MimeBody_CopyProps(
458 IMimePropertySet
* pPropertySet
)
464 static HRESULT WINAPI
MimeBody_MoveProps(
468 IMimePropertySet
* pPropertySet
)
474 static HRESULT WINAPI
MimeBody_DeleteExcept(
483 static HRESULT WINAPI
MimeBody_QueryProp(
488 boolean fCaseSensitive
)
494 static HRESULT WINAPI
MimeBody_GetCharset(
496 LPHCHARSET phCharset
)
502 static HRESULT WINAPI
MimeBody_SetCharset(
505 CSETAPPLYTYPE applytype
)
511 static HRESULT WINAPI
MimeBody_GetParameters(
515 LPMIMEPARAMINFO
* pprgParam
)
521 static HRESULT WINAPI
MimeBody_IsContentType(
530 static HRESULT WINAPI
MimeBody_BindToObject(
539 static HRESULT WINAPI
MimeBody_Clone(
541 IMimePropertySet
** ppPropertySet
)
547 static HRESULT WINAPI
MimeBody_SetOption(
550 LPCPROPVARIANT pValue
)
556 static HRESULT WINAPI
MimeBody_GetOption(
559 LPPROPVARIANT pValue
)
565 static HRESULT WINAPI
MimeBody_EnumProps(
568 IMimeEnumProperties
** ppEnum
)
574 static HRESULT WINAPI
MimeBody_IsType(
576 IMSGBODYTYPE bodytype
)
582 static HRESULT WINAPI
MimeBody_SetDisplayName(
590 static HRESULT WINAPI
MimeBody_GetDisplayName(
598 static HRESULT WINAPI
MimeBody_GetOffsets(
600 LPBODYOFFSETS pOffsets
)
606 static HRESULT WINAPI
MimeBody_GetCurrentEncoding(
608 ENCODINGTYPE
* pietEncoding
)
614 static HRESULT WINAPI
MimeBody_SetCurrentEncoding(
616 ENCODINGTYPE ietEncoding
)
622 static HRESULT WINAPI
MimeBody_GetEstimatedSize(
624 ENCODINGTYPE ietEncoding
,
631 static HRESULT WINAPI
MimeBody_GetDataHere(
633 ENCODINGTYPE ietEncoding
,
640 static HRESULT WINAPI
MimeBody_GetData(
642 ENCODINGTYPE ietEncoding
,
649 static HRESULT WINAPI
MimeBody_SetData(
651 ENCODINGTYPE ietEncoding
,
661 static HRESULT WINAPI
MimeBody_EmptyData(
668 static HRESULT WINAPI
MimeBody_CopyTo(
676 static HRESULT WINAPI
MimeBody_GetTransmitInfo(
678 LPTRANSMITINFO pTransmitInfo
)
684 static HRESULT WINAPI
MimeBody_SaveToFile(
686 ENCODINGTYPE ietEncoding
,
693 static HRESULT WINAPI
MimeBody_GetHandle(
697 MimeBody
*This
= impl_from_IMimeBody(iface
);
698 TRACE("(%p)->(%p)\n", iface
, phBody
);
700 *phBody
= This
->handle
;
701 return This
->handle
? S_OK
: MIME_E_NO_DATA
;
704 static IMimeBodyVtbl body_vtbl
=
706 MimeBody_QueryInterface
,
715 MimeBody_GetPropInfo
,
716 MimeBody_SetPropInfo
,
723 MimeBody_DeleteExcept
,
727 MimeBody_GetParameters
,
728 MimeBody_IsContentType
,
729 MimeBody_BindToObject
,
735 MimeBody_SetDisplayName
,
736 MimeBody_GetDisplayName
,
738 MimeBody_GetCurrentEncoding
,
739 MimeBody_SetCurrentEncoding
,
740 MimeBody_GetEstimatedSize
,
741 MimeBody_GetDataHere
,
746 MimeBody_GetTransmitInfo
,
751 #define FIRST_CUSTOM_PROP_ID 0x100
753 HRESULT
MimeBody_create(IUnknown
*outer
, void **obj
)
759 if(outer
) return CLASS_E_NOAGGREGATION
;
761 This
= HeapAlloc(GetProcessHeap(), 0, sizeof(*This
));
762 if (!This
) return E_OUTOFMEMORY
;
764 This
->lpVtbl
= &body_vtbl
;
767 list_init(&This
->headers
);
768 list_init(&This
->new_props
);
769 This
->next_prop_id
= FIRST_CUSTOM_PROP_ID
;
771 *obj
= (IMimeBody
*)&This
->lpVtbl
;
775 typedef struct MimeMessage
777 const IMimeMessageVtbl
*lpVtbl
;
782 static HRESULT WINAPI
MimeMessage_QueryInterface(IMimeMessage
*iface
, REFIID riid
, void **ppv
)
784 TRACE("(%p)->(%s, %p)\n", iface
, debugstr_guid(riid
), ppv
);
786 if (IsEqualIID(riid
, &IID_IUnknown
) ||
787 IsEqualIID(riid
, &IID_IPersist
) ||
788 IsEqualIID(riid
, &IID_IPersistStreamInit
) ||
789 IsEqualIID(riid
, &IID_IMimeMessageTree
) ||
790 IsEqualIID(riid
, &IID_IMimeMessage
))
793 IUnknown_AddRef(iface
);
797 FIXME("no interface for %s\n", debugstr_guid(riid
));
799 return E_NOINTERFACE
;
802 static ULONG WINAPI
MimeMessage_AddRef(IMimeMessage
*iface
)
804 MimeMessage
*This
= (MimeMessage
*)iface
;
805 TRACE("(%p)->()\n", iface
);
806 return InterlockedIncrement(&This
->refs
);
809 static ULONG WINAPI
MimeMessage_Release(IMimeMessage
*iface
)
811 MimeMessage
*This
= (MimeMessage
*)iface
;
814 TRACE("(%p)->()\n", iface
);
816 refs
= InterlockedDecrement(&This
->refs
);
819 HeapFree(GetProcessHeap(), 0, This
);
825 /*** IPersist methods ***/
826 static HRESULT WINAPI
MimeMessage_GetClassID(
830 FIXME("(%p)->(%p)\n", iface
, pClassID
);
834 /*** IPersistStreamInit methods ***/
835 static HRESULT WINAPI
MimeMessage_IsDirty(
838 FIXME("(%p)->()\n", iface
);
842 static HRESULT WINAPI
MimeMessage_Load(
845 FIXME("(%p)->(%p)\n", iface
, pStm
);
849 static HRESULT WINAPI
MimeMessage_Save(
854 FIXME("(%p)->(%p, %s)\n", iface
, pStm
, fClearDirty
? "TRUE" : "FALSE");
858 static HRESULT WINAPI
MimeMessage_GetSizeMax(
860 ULARGE_INTEGER
*pcbSize
)
862 FIXME("(%p)->(%p)\n", iface
, pcbSize
);
866 static HRESULT WINAPI
MimeMessage_InitNew(
869 FIXME("(%p)->()\n", iface
);
873 /*** IMimeMessageTree methods ***/
874 static HRESULT WINAPI
MimeMessage_GetMessageSource(
879 FIXME("(%p)->(%p, 0x%x)\n", iface
, ppStream
, dwFlags
);
883 static HRESULT WINAPI
MimeMessage_GetMessageSize(
888 FIXME("(%p)->(%p, 0x%x)\n", iface
, pcbSize
, dwFlags
);
892 static HRESULT WINAPI
MimeMessage_LoadOffsetTable(
896 FIXME("(%p)->(%p)\n", iface
, pStream
);
900 static HRESULT WINAPI
MimeMessage_SaveOffsetTable(
905 FIXME("(%p)->(%p, 0x%x)\n", iface
, pStream
, dwFlags
);
910 static HRESULT WINAPI
MimeMessage_GetFlags(
914 FIXME("(%p)->(%p)\n", iface
, pdwFlags
);
918 static HRESULT WINAPI
MimeMessage_Commit(
922 FIXME("(%p)->(0x%x)\n", iface
, dwFlags
);
927 static HRESULT WINAPI
MimeMessage_HandsOffStorage(
930 FIXME("(%p)->()\n", iface
);
934 static HRESULT WINAPI
MimeMessage_BindToObject(
940 FIXME("(%p)->(%p, %s, %p)\n", iface
, hBody
, debugstr_guid(riid
), ppvObject
);
944 static HRESULT WINAPI
MimeMessage_SaveBody(
950 FIXME("(%p)->(%p, 0x%x, %p)\n", iface
, hBody
, dwFlags
, pStream
);
954 static HRESULT WINAPI
MimeMessage_InsertBody(
956 BODYLOCATION location
,
960 FIXME("(%p)->(%d, %p, %p)\n", iface
, location
, hPivot
, phBody
);
964 static HRESULT WINAPI
MimeMessage_GetBody(
966 BODYLOCATION location
,
970 FIXME("(%p)->(%d, %p, %p)\n", iface
, location
, hPivot
, phBody
);
974 static HRESULT WINAPI
MimeMessage_DeleteBody(
979 FIXME("(%p)->(%p, %08x)\n", iface
, hBody
, dwFlags
);
983 static HRESULT WINAPI
MimeMessage_MoveBody(
986 BODYLOCATION location
)
988 FIXME("(%p)->(%d)\n", iface
, location
);
992 static HRESULT WINAPI
MimeMessage_CountBodies(
998 FIXME("(%p)->(%p, %s, %p)\n", iface
, hParent
, fRecurse
? "TRUE" : "FALSE", pcBodies
);
1002 static HRESULT WINAPI
MimeMessage_FindFirst(
1003 IMimeMessage
*iface
,
1004 LPFINDBODY pFindBody
,
1007 FIXME("(%p)->(%p, %p)\n", iface
, pFindBody
, phBody
);
1011 static HRESULT WINAPI
MimeMessage_FindNext(
1012 IMimeMessage
*iface
,
1013 LPFINDBODY pFindBody
,
1016 FIXME("(%p)->(%p, %p)\n", iface
, pFindBody
, phBody
);
1020 static HRESULT WINAPI
MimeMessage_ResolveURL(
1021 IMimeMessage
*iface
,
1028 FIXME("(%p)->(%p, %s, %s, 0x%x, %p)\n", iface
, hRelated
, pszBase
, pszURL
, dwFlags
, phBody
);
1032 static HRESULT WINAPI
MimeMessage_ToMultipart(
1033 IMimeMessage
*iface
,
1036 LPHBODY phMultipart
)
1038 FIXME("(%p)->(%p, %s, %p)\n", iface
, hBody
, pszSubType
, phMultipart
);
1042 static HRESULT WINAPI
MimeMessage_GetBodyOffsets(
1043 IMimeMessage
*iface
,
1045 LPBODYOFFSETS pOffsets
)
1047 FIXME("(%p)->(%p, %p)\n", iface
, hBody
, pOffsets
);
1051 static HRESULT WINAPI
MimeMessage_GetCharset(
1052 IMimeMessage
*iface
,
1053 LPHCHARSET phCharset
)
1055 FIXME("(%p)->(%p)\n", iface
, phCharset
);
1059 static HRESULT WINAPI
MimeMessage_SetCharset(
1060 IMimeMessage
*iface
,
1062 CSETAPPLYTYPE applytype
)
1064 FIXME("(%p)->(%p, %d)\n", iface
, hCharset
, applytype
);
1068 static HRESULT WINAPI
MimeMessage_IsBodyType(
1069 IMimeMessage
*iface
,
1071 IMSGBODYTYPE bodytype
)
1073 FIXME("(%p)->(%p, %d)\n", iface
, hBody
, bodytype
);
1077 static HRESULT WINAPI
MimeMessage_IsContentType(
1078 IMimeMessage
*iface
,
1083 FIXME("(%p)->(%p, %s, %s)\n", iface
, hBody
, pszPriType
, pszSubType
);
1087 static HRESULT WINAPI
MimeMessage_QueryBodyProp(
1088 IMimeMessage
*iface
,
1093 boolean fCaseSensitive
)
1095 FIXME("(%p)->(%p, %s, %s, %s, %s)\n", iface
, hBody
, pszName
, pszCriteria
, fSubString
? "TRUE" : "FALSE", fCaseSensitive
? "TRUE" : "FALSE");
1099 static HRESULT WINAPI
MimeMessage_GetBodyProp(
1100 IMimeMessage
*iface
,
1104 LPPROPVARIANT pValue
)
1106 FIXME("(%p)->(%p, %s, 0x%x, %p)\n", iface
, hBody
, pszName
, dwFlags
, pValue
);
1110 static HRESULT WINAPI
MimeMessage_SetBodyProp(
1111 IMimeMessage
*iface
,
1115 LPCPROPVARIANT pValue
)
1117 FIXME("(%p)->(%p, %s, 0x%x, %p)\n", iface
, hBody
, pszName
, dwFlags
, pValue
);
1121 static HRESULT WINAPI
MimeMessage_DeleteBodyProp(
1122 IMimeMessage
*iface
,
1126 FIXME("(%p)->(%p, %s)\n", iface
, hBody
, pszName
);
1130 static HRESULT WINAPI
MimeMessage_SetOption(
1131 IMimeMessage
*iface
,
1133 LPCPROPVARIANT pValue
)
1135 FIXME("(%p)->(%d, %p)\n", iface
, oid
, pValue
);
1139 static HRESULT WINAPI
MimeMessage_GetOption(
1140 IMimeMessage
*iface
,
1142 LPPROPVARIANT pValue
)
1144 FIXME("(%p)->(%d, %p)\n", iface
, oid
, pValue
);
1148 /*** IMimeMessage methods ***/
1149 static HRESULT WINAPI
MimeMessage_CreateWebPage(
1150 IMimeMessage
*iface
,
1152 LPWEBPAGEOPTIONS pOptions
,
1153 IMimeMessageCallback
*pCallback
,
1154 IMoniker
**ppMoniker
)
1156 FIXME("(%p)->(%p, %p, %p, %p)\n", iface
, pRootStm
, pOptions
, pCallback
, ppMoniker
);
1161 static HRESULT WINAPI
MimeMessage_GetProp(
1162 IMimeMessage
*iface
,
1165 LPPROPVARIANT pValue
)
1167 FIXME("(%p)->(%s, 0x%x, %p)\n", iface
, pszName
, dwFlags
, pValue
);
1171 static HRESULT WINAPI
MimeMessage_SetProp(
1172 IMimeMessage
*iface
,
1175 LPCPROPVARIANT pValue
)
1177 FIXME("(%p)->(%s, 0x%x, %p)\n", iface
, pszName
, dwFlags
, pValue
);
1181 static HRESULT WINAPI
MimeMessage_DeleteProp(
1182 IMimeMessage
*iface
,
1185 FIXME("(%p)->(%s)\n", iface
, pszName
);
1189 static HRESULT WINAPI
MimeMessage_QueryProp(
1190 IMimeMessage
*iface
,
1194 boolean fCaseSensitive
)
1196 FIXME("(%p)->(%s, %s, %s, %s)\n", iface
, pszName
, pszCriteria
, fSubString
? "TRUE" : "FALSE", fCaseSensitive
? "TRUE" : "FALSE");
1200 static HRESULT WINAPI
MimeMessage_GetTextBody(
1201 IMimeMessage
*iface
,
1203 ENCODINGTYPE ietEncoding
,
1207 FIXME("(%p)->(%d, %d, %p, %p)\n", iface
, dwTxtType
, ietEncoding
, pStream
, phBody
);
1211 static HRESULT WINAPI
MimeMessage_SetTextBody(
1212 IMimeMessage
*iface
,
1214 ENCODINGTYPE ietEncoding
,
1219 FIXME("(%p)->(%d, %d, %p, %p, %p)\n", iface
, dwTxtType
, ietEncoding
, hAlternative
, pStream
, phBody
);
1223 static HRESULT WINAPI
MimeMessage_AttachObject(
1224 IMimeMessage
*iface
,
1229 FIXME("(%p)->(%s, %p, %p)\n", iface
, debugstr_guid(riid
), pvObject
, phBody
);
1233 static HRESULT WINAPI
MimeMessage_AttachFile(
1234 IMimeMessage
*iface
,
1239 FIXME("(%p)->(%s, %p, %p)\n", iface
, pszFilePath
, pstmFile
, phBody
);
1243 static HRESULT WINAPI
MimeMessage_AttachURL(
1244 IMimeMessage
*iface
,
1252 FIXME("(%p)->(%s, %s, 0x%x, %p, %p, %p)\n", iface
, pszBase
, pszURL
, dwFlags
, pstmURL
, ppszCIDURL
, phBody
);
1256 static HRESULT WINAPI
MimeMessage_GetAttachments(
1257 IMimeMessage
*iface
,
1259 LPHBODY
*pprghAttach
)
1261 FIXME("(%p)->(%p, %p)\n", iface
, pcAttach
, pprghAttach
);
1265 static HRESULT WINAPI
MimeMessage_GetAddressTable(
1266 IMimeMessage
*iface
,
1267 IMimeAddressTable
**ppTable
)
1269 FIXME("(%p)->(%p)\n", iface
, ppTable
);
1273 static HRESULT WINAPI
MimeMessage_GetSender(
1274 IMimeMessage
*iface
,
1275 LPADDRESSPROPS pAddress
)
1277 FIXME("(%p)->(%p)\n", iface
, pAddress
);
1281 static HRESULT WINAPI
MimeMessage_GetAddressTypes(
1282 IMimeMessage
*iface
,
1285 LPADDRESSLIST pList
)
1287 FIXME("(%p)->(%d, %d, %p)\n", iface
, dwAdrTypes
, dwProps
, pList
);
1291 static HRESULT WINAPI
MimeMessage_GetAddressFormat(
1292 IMimeMessage
*iface
,
1294 ADDRESSFORMAT format
,
1297 FIXME("(%p)->(%d, %d, %p)\n", iface
, dwAdrTypes
, format
, ppszFormat
);
1301 static HRESULT WINAPI
MimeMessage_EnumAddressTypes(
1302 IMimeMessage
*iface
,
1305 IMimeEnumAddressTypes
**ppEnum
)
1307 FIXME("(%p)->(%d, %d, %p)\n", iface
, dwAdrTypes
, dwProps
, ppEnum
);
1311 static HRESULT WINAPI
MimeMessage_SplitMessage(
1312 IMimeMessage
*iface
,
1314 IMimeMessageParts
**ppParts
)
1316 FIXME("(%p)->(%d, %p)\n", iface
, cbMaxPart
, ppParts
);
1320 static HRESULT WINAPI
MimeMessage_GetRootMoniker(
1321 IMimeMessage
*iface
,
1322 IMoniker
**ppMoniker
)
1324 FIXME("(%p)->(%p)\n", iface
, ppMoniker
);
1328 static const IMimeMessageVtbl MimeMessageVtbl
=
1330 MimeMessage_QueryInterface
,
1332 MimeMessage_Release
,
1333 MimeMessage_GetClassID
,
1334 MimeMessage_IsDirty
,
1337 MimeMessage_GetSizeMax
,
1338 MimeMessage_InitNew
,
1339 MimeMessage_GetMessageSource
,
1340 MimeMessage_GetMessageSize
,
1341 MimeMessage_LoadOffsetTable
,
1342 MimeMessage_SaveOffsetTable
,
1343 MimeMessage_GetFlags
,
1345 MimeMessage_HandsOffStorage
,
1346 MimeMessage_BindToObject
,
1347 MimeMessage_SaveBody
,
1348 MimeMessage_InsertBody
,
1349 MimeMessage_GetBody
,
1350 MimeMessage_DeleteBody
,
1351 MimeMessage_MoveBody
,
1352 MimeMessage_CountBodies
,
1353 MimeMessage_FindFirst
,
1354 MimeMessage_FindNext
,
1355 MimeMessage_ResolveURL
,
1356 MimeMessage_ToMultipart
,
1357 MimeMessage_GetBodyOffsets
,
1358 MimeMessage_GetCharset
,
1359 MimeMessage_SetCharset
,
1360 MimeMessage_IsBodyType
,
1361 MimeMessage_IsContentType
,
1362 MimeMessage_QueryBodyProp
,
1363 MimeMessage_GetBodyProp
,
1364 MimeMessage_SetBodyProp
,
1365 MimeMessage_DeleteBodyProp
,
1366 MimeMessage_SetOption
,
1367 MimeMessage_GetOption
,
1368 MimeMessage_CreateWebPage
,
1369 MimeMessage_GetProp
,
1370 MimeMessage_SetProp
,
1371 MimeMessage_DeleteProp
,
1372 MimeMessage_QueryProp
,
1373 MimeMessage_GetTextBody
,
1374 MimeMessage_SetTextBody
,
1375 MimeMessage_AttachObject
,
1376 MimeMessage_AttachFile
,
1377 MimeMessage_AttachURL
,
1378 MimeMessage_GetAttachments
,
1379 MimeMessage_GetAddressTable
,
1380 MimeMessage_GetSender
,
1381 MimeMessage_GetAddressTypes
,
1382 MimeMessage_GetAddressFormat
,
1383 MimeMessage_EnumAddressTypes
,
1384 MimeMessage_SplitMessage
,
1385 MimeMessage_GetRootMoniker
,
1388 /***********************************************************************
1389 * MimeOleCreateMessage (INETCOMM.@)
1391 HRESULT WINAPI
MimeOleCreateMessage(IUnknown
*pUnkOuter
, IMimeMessage
**ppMessage
)
1395 TRACE("(%p, %p)\n", pUnkOuter
, ppMessage
);
1399 FIXME("outer unknown not supported yet\n");
1405 This
= HeapAlloc(GetProcessHeap(), 0, sizeof(*This
));
1406 if (!This
) return E_OUTOFMEMORY
;
1408 This
->lpVtbl
= &MimeMessageVtbl
;
1411 *ppMessage
= (IMimeMessage
*)&This
->lpVtbl
;
1415 /***********************************************************************
1416 * MimeOleSetCompatMode (INETCOMM.@)
1418 HRESULT WINAPI
MimeOleSetCompatMode(DWORD dwMode
)
1420 FIXME("(0x%x)\n", dwMode
);
1424 /***********************************************************************
1425 * MimeOleCreateVirtualStream (INETCOMM.@)
1427 HRESULT WINAPI
MimeOleCreateVirtualStream(IStream
**ppStream
)
1430 FIXME("(%p)\n", ppStream
);
1432 hr
= CreateStreamOnHGlobal(NULL
, TRUE
, ppStream
);
1436 typedef struct MimeSecurity
1438 const IMimeSecurityVtbl
*lpVtbl
;
1443 static HRESULT WINAPI
MimeSecurity_QueryInterface(
1444 IMimeSecurity
* iface
,
1448 TRACE("(%p)->(%s, %p)\n", iface
, debugstr_guid(riid
), obj
);
1450 if (IsEqualIID(riid
, &IID_IUnknown
) ||
1451 IsEqualIID(riid
, &IID_IMimeSecurity
))
1454 IUnknown_AddRef(iface
);
1458 FIXME("no interface for %s\n", debugstr_guid(riid
));
1460 return E_NOINTERFACE
;
1463 static ULONG WINAPI
MimeSecurity_AddRef(
1464 IMimeSecurity
* iface
)
1466 MimeSecurity
*This
= (MimeSecurity
*)iface
;
1467 TRACE("(%p)->()\n", iface
);
1468 return InterlockedIncrement(&This
->refs
);
1471 static ULONG WINAPI
MimeSecurity_Release(
1472 IMimeSecurity
* iface
)
1474 MimeSecurity
*This
= (MimeSecurity
*)iface
;
1477 TRACE("(%p)->()\n", iface
);
1479 refs
= InterlockedDecrement(&This
->refs
);
1482 HeapFree(GetProcessHeap(), 0, This
);
1488 static HRESULT WINAPI
MimeSecurity_InitNew(
1489 IMimeSecurity
* iface
)
1491 FIXME("(%p)->(): stub\n", iface
);
1495 static HRESULT WINAPI
MimeSecurity_CheckInit(
1496 IMimeSecurity
* iface
)
1498 FIXME("(%p)->(): stub\n", iface
);
1502 static HRESULT WINAPI
MimeSecurity_EncodeMessage(
1503 IMimeSecurity
* iface
,
1504 IMimeMessageTree
* pTree
,
1507 FIXME("(%p)->(%p, %08x): stub\n", iface
, pTree
, dwFlags
);
1511 static HRESULT WINAPI
MimeSecurity_EncodeBody(
1512 IMimeSecurity
* iface
,
1513 IMimeMessageTree
* pTree
,
1517 FIXME("(%p)->(%p, %p, %08x): stub\n", iface
, pTree
, hEncodeRoot
, dwFlags
);
1521 static HRESULT WINAPI
MimeSecurity_DecodeMessage(
1522 IMimeSecurity
* iface
,
1523 IMimeMessageTree
* pTree
,
1526 FIXME("(%p)->(%p, %08x): stub\n", iface
, pTree
, dwFlags
);
1530 static HRESULT WINAPI
MimeSecurity_DecodeBody(
1531 IMimeSecurity
* iface
,
1532 IMimeMessageTree
* pTree
,
1536 FIXME("(%p)->(%p, %p, %08x): stub\n", iface
, pTree
, hDecodeRoot
, dwFlags
);
1540 static HRESULT WINAPI
MimeSecurity_EnumCertificates(
1541 IMimeSecurity
* iface
,
1547 FIXME("(%p)->(%p, %08x, %p, %p): stub\n", iface
, hc
, dwUsage
, pPrev
, ppCert
);
1551 static HRESULT WINAPI
MimeSecurity_GetCertificateName(
1552 IMimeSecurity
* iface
,
1553 const PCX509CERT pX509Cert
,
1554 const CERTNAMETYPE cn
,
1557 FIXME("(%p)->(%p, %08x, %p): stub\n", iface
, pX509Cert
, cn
, ppszName
);
1561 static HRESULT WINAPI
MimeSecurity_GetMessageType(
1562 IMimeSecurity
* iface
,
1563 const HWND hwndParent
,
1567 FIXME("(%p)->(%p, %p, %p): stub\n", iface
, hwndParent
, pBody
, pdwSecType
);
1571 static HRESULT WINAPI
MimeSecurity_GetCertData(
1572 IMimeSecurity
* iface
,
1573 const PCX509CERT pX509Cert
,
1574 const CERTDATAID dataid
,
1575 LPPROPVARIANT pValue
)
1577 FIXME("(%p)->(%p, %x, %p): stub\n", iface
, pX509Cert
, dataid
, pValue
);
1582 static const IMimeSecurityVtbl MimeSecurityVtbl
=
1584 MimeSecurity_QueryInterface
,
1585 MimeSecurity_AddRef
,
1586 MimeSecurity_Release
,
1587 MimeSecurity_InitNew
,
1588 MimeSecurity_CheckInit
,
1589 MimeSecurity_EncodeMessage
,
1590 MimeSecurity_EncodeBody
,
1591 MimeSecurity_DecodeMessage
,
1592 MimeSecurity_DecodeBody
,
1593 MimeSecurity_EnumCertificates
,
1594 MimeSecurity_GetCertificateName
,
1595 MimeSecurity_GetMessageType
,
1596 MimeSecurity_GetCertData
1599 /***********************************************************************
1600 * MimeOleCreateSecurity (INETCOMM.@)
1602 HRESULT WINAPI
MimeOleCreateSecurity(IMimeSecurity
**ppSecurity
)
1606 TRACE("(%p)\n", ppSecurity
);
1610 This
= HeapAlloc(GetProcessHeap(), 0, sizeof(*This
));
1611 if (!This
) return E_OUTOFMEMORY
;
1613 This
->lpVtbl
= &MimeSecurityVtbl
;
1616 *ppSecurity
= (IMimeSecurity
*)&This
->lpVtbl
;