inetcomm: Parse headers into a list.
[wine/multimedia.git] / dlls / inetcomm / mimeole.c
blob5d3353745564abed1e03ab90d6591dec5a245bca
1 /*
2 * MIME OLE Interfaces
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
22 #define COBJMACROS
24 #include <stdarg.h>
25 #include <stdio.h>
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winuser.h"
30 #include "objbase.h"
31 #include "ole2.h"
32 #include "mimeole.h"
34 #include "wine/list.h"
35 #include "wine/debug.h"
37 #include "inetcomm_private.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(inetcomm);
41 typedef struct
43 LPCSTR name;
44 DWORD id;
45 DWORD flags; /* MIMEPROPFLAGS */
46 VARTYPE default_vt;
47 } property_t;
49 typedef struct
51 struct list entry;
52 property_t prop;
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},
76 {NULL, 0, 0, 0}
79 typedef struct
81 struct list entry;
82 const property_t *prop;
83 PROPVARIANT value;
84 } header_t;
86 typedef struct MimeBody
88 const IMimeBodyVtbl *lpVtbl;
89 LONG refs;
91 HBODY handle;
93 struct list headers;
94 struct list new_props; /* FIXME: This should be in a PropertySchema */
95 DWORD next_prop_id;
96 } MimeBody;
98 static inline MimeBody *impl_from_IMimeBody( IMimeBody *iface )
100 return (MimeBody *)((char*)iface - FIELD_OFFSET(MimeBody, lpVtbl));
103 static LPSTR strdupA(LPCSTR str)
105 char *ret;
106 int len = strlen(str);
107 ret = HeapAlloc(GetProcessHeap(), 0, len + 1);
108 memcpy(ret, str, len + 1);
109 return ret;
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)
122 char *buf = NULL;
123 DWORD size = PARSER_BUF_SIZE, offset = 0, last_end = 0;
124 HRESULT hr;
125 int done = 0;
127 *ptr = NULL;
131 char *end;
132 DWORD read;
134 if(!buf)
135 buf = HeapAlloc(GetProcessHeap(), 0, size + 1);
136 else
138 size *= 2;
139 buf = HeapReAlloc(GetProcessHeap(), 0, buf, size + 1);
141 if(!buf)
143 hr = E_OUTOFMEMORY;
144 goto fail;
147 hr = IStream_Read(stm, buf + offset, size - offset, &read);
148 if(FAILED(hr)) goto fail;
150 offset += read;
151 buf[offset] = '\0';
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)
160 LARGE_INTEGER off;
161 off.QuadPart = new_end;
162 IStream_Seek(stm, off, STREAM_SEEK_SET, NULL);
163 buf[new_end] = '\0';
164 done = 1;
166 else
167 last_end = new_end;
169 } while(!done);
171 *ptr = buf;
172 return S_OK;
174 fail:
175 HeapFree(GetProcessHeap(), 0, buf);
176 return hr;
179 static header_t *read_prop(MimeBody *body, char **ptr)
181 char *colon = strchr(*ptr, ':');
182 const property_t *prop;
183 header_t *ret;
185 if(!colon) return NULL;
187 *colon = '\0';
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);
194 break;
198 if(!prop->name)
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;
207 break;
210 if(!prop->name)
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));
224 ret->prop = prop;
225 PropVariantInit(&ret->value);
226 *ptr = colon + 1;
228 return ret;
231 static void read_value(header_t *header, char **cur)
233 char *end = *cur, *value;
234 DWORD len;
236 do {
237 end = strstr(end, "\r\n");
238 end += 2;
239 } while(*end == ' ' || *end == '\t');
241 len = end - *cur;
242 value = HeapAlloc(GetProcessHeap(), 0, len + 1);
243 memcpy(value, *cur, len);
244 value[len] = '\0';
246 header->value.vt = VT_LPSTR;
247 header->value.pszVal = value;
249 *cur = end;
252 static HRESULT parse_headers(MimeBody *body, IStream *stm)
254 char *header_buf, *cur_header_ptr;
255 HRESULT hr;
256 header_t *header;
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);
269 return hr;
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,
297 REFIID riid,
298 void** ppvObject)
300 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppvObject);
302 *ppvObject = NULL;
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))
310 *ppvObject = iface;
313 if(*ppvObject)
315 IUnknown_AddRef((IUnknown*)*ppvObject);
316 return S_OK;
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);
333 ULONG refs;
335 TRACE("(%p)->()\n", iface);
337 refs = InterlockedDecrement(&This->refs);
338 if (!refs)
340 empty_header_list(&This->headers);
341 empty_new_prop_list(&This->new_props);
343 HeapFree(GetProcessHeap(), 0, This);
346 return refs;
349 static HRESULT WINAPI MimeBody_GetClassID(
350 IMimeBody* iface,
351 CLSID* pClassID)
353 FIXME("stub\n");
354 return E_NOTIMPL;
358 static HRESULT WINAPI MimeBody_IsDirty(
359 IMimeBody* iface)
361 FIXME("stub\n");
362 return E_NOTIMPL;
365 static HRESULT WINAPI MimeBody_Load(
366 IMimeBody* iface,
367 LPSTREAM pStm)
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(
375 IMimeBody* iface,
376 LPSTREAM pStm,
377 BOOL fClearDirty)
379 FIXME("stub\n");
380 return E_NOTIMPL;
383 static HRESULT WINAPI MimeBody_GetSizeMax(
384 IMimeBody* iface,
385 ULARGE_INTEGER* pcbSize)
387 FIXME("stub\n");
388 return E_NOTIMPL;
391 static HRESULT WINAPI MimeBody_InitNew(
392 IMimeBody* iface)
394 TRACE("%p->()\n", iface);
395 return S_OK;
398 static HRESULT WINAPI MimeBody_GetPropInfo(
399 IMimeBody* iface,
400 LPCSTR pszName,
401 LPMIMEPROPINFO pInfo)
403 FIXME("stub\n");
404 return E_NOTIMPL;
407 static HRESULT WINAPI MimeBody_SetPropInfo(
408 IMimeBody* iface,
409 LPCSTR pszName,
410 LPCMIMEPROPINFO pInfo)
412 FIXME("stub\n");
413 return E_NOTIMPL;
416 static HRESULT WINAPI MimeBody_GetProp(
417 IMimeBody* iface,
418 LPCSTR pszName,
419 DWORD dwFlags,
420 LPPROPVARIANT pValue)
422 FIXME("stub\n");
423 return E_NOTIMPL;
426 static HRESULT WINAPI MimeBody_SetProp(
427 IMimeBody* iface,
428 LPCSTR pszName,
429 DWORD dwFlags,
430 LPCPROPVARIANT pValue)
432 FIXME("stub\n");
433 return E_NOTIMPL;
436 static HRESULT WINAPI MimeBody_AppendProp(
437 IMimeBody* iface,
438 LPCSTR pszName,
439 DWORD dwFlags,
440 LPPROPVARIANT pValue)
442 FIXME("stub\n");
443 return E_NOTIMPL;
446 static HRESULT WINAPI MimeBody_DeleteProp(
447 IMimeBody* iface,
448 LPCSTR pszName)
450 FIXME("stub\n");
451 return E_NOTIMPL;
454 static HRESULT WINAPI MimeBody_CopyProps(
455 IMimeBody* iface,
456 ULONG cNames,
457 LPCSTR* prgszName,
458 IMimePropertySet* pPropertySet)
460 FIXME("stub\n");
461 return E_NOTIMPL;
464 static HRESULT WINAPI MimeBody_MoveProps(
465 IMimeBody* iface,
466 ULONG cNames,
467 LPCSTR* prgszName,
468 IMimePropertySet* pPropertySet)
470 FIXME("stub\n");
471 return E_NOTIMPL;
474 static HRESULT WINAPI MimeBody_DeleteExcept(
475 IMimeBody* iface,
476 ULONG cNames,
477 LPCSTR* prgszName)
479 FIXME("stub\n");
480 return E_NOTIMPL;
483 static HRESULT WINAPI MimeBody_QueryProp(
484 IMimeBody* iface,
485 LPCSTR pszName,
486 LPCSTR pszCriteria,
487 boolean fSubString,
488 boolean fCaseSensitive)
490 FIXME("stub\n");
491 return E_NOTIMPL;
494 static HRESULT WINAPI MimeBody_GetCharset(
495 IMimeBody* iface,
496 LPHCHARSET phCharset)
498 FIXME("stub\n");
499 return E_NOTIMPL;
502 static HRESULT WINAPI MimeBody_SetCharset(
503 IMimeBody* iface,
504 HCHARSET hCharset,
505 CSETAPPLYTYPE applytype)
507 FIXME("stub\n");
508 return E_NOTIMPL;
511 static HRESULT WINAPI MimeBody_GetParameters(
512 IMimeBody* iface,
513 LPCSTR pszName,
514 ULONG* pcParams,
515 LPMIMEPARAMINFO* pprgParam)
517 FIXME("stub\n");
518 return E_NOTIMPL;
521 static HRESULT WINAPI MimeBody_IsContentType(
522 IMimeBody* iface,
523 LPCSTR pszPriType,
524 LPCSTR pszSubType)
526 FIXME("stub\n");
527 return E_NOTIMPL;
530 static HRESULT WINAPI MimeBody_BindToObject(
531 IMimeBody* iface,
532 REFIID riid,
533 void** ppvObject)
535 FIXME("stub\n");
536 return E_NOTIMPL;
539 static HRESULT WINAPI MimeBody_Clone(
540 IMimeBody* iface,
541 IMimePropertySet** ppPropertySet)
543 FIXME("stub\n");
544 return E_NOTIMPL;
547 static HRESULT WINAPI MimeBody_SetOption(
548 IMimeBody* iface,
549 const TYPEDID oid,
550 LPCPROPVARIANT pValue)
552 FIXME("stub\n");
553 return E_NOTIMPL;
556 static HRESULT WINAPI MimeBody_GetOption(
557 IMimeBody* iface,
558 const TYPEDID oid,
559 LPPROPVARIANT pValue)
561 FIXME("stub\n");
562 return E_NOTIMPL;
565 static HRESULT WINAPI MimeBody_EnumProps(
566 IMimeBody* iface,
567 DWORD dwFlags,
568 IMimeEnumProperties** ppEnum)
570 FIXME("stub\n");
571 return E_NOTIMPL;
574 static HRESULT WINAPI MimeBody_IsType(
575 IMimeBody* iface,
576 IMSGBODYTYPE bodytype)
578 FIXME("stub\n");
579 return E_NOTIMPL;
582 static HRESULT WINAPI MimeBody_SetDisplayName(
583 IMimeBody* iface,
584 LPCSTR pszDisplay)
586 FIXME("stub\n");
587 return E_NOTIMPL;
590 static HRESULT WINAPI MimeBody_GetDisplayName(
591 IMimeBody* iface,
592 LPSTR* ppszDisplay)
594 FIXME("stub\n");
595 return E_NOTIMPL;
598 static HRESULT WINAPI MimeBody_GetOffsets(
599 IMimeBody* iface,
600 LPBODYOFFSETS pOffsets)
602 FIXME("stub\n");
603 return E_NOTIMPL;
606 static HRESULT WINAPI MimeBody_GetCurrentEncoding(
607 IMimeBody* iface,
608 ENCODINGTYPE* pietEncoding)
610 FIXME("stub\n");
611 return E_NOTIMPL;
614 static HRESULT WINAPI MimeBody_SetCurrentEncoding(
615 IMimeBody* iface,
616 ENCODINGTYPE ietEncoding)
618 FIXME("stub\n");
619 return E_NOTIMPL;
622 static HRESULT WINAPI MimeBody_GetEstimatedSize(
623 IMimeBody* iface,
624 ENCODINGTYPE ietEncoding,
625 ULONG* pcbSize)
627 FIXME("stub\n");
628 return E_NOTIMPL;
631 static HRESULT WINAPI MimeBody_GetDataHere(
632 IMimeBody* iface,
633 ENCODINGTYPE ietEncoding,
634 IStream* pStream)
636 FIXME("stub\n");
637 return E_NOTIMPL;
640 static HRESULT WINAPI MimeBody_GetData(
641 IMimeBody* iface,
642 ENCODINGTYPE ietEncoding,
643 IStream** ppStream)
645 FIXME("stub\n");
646 return E_NOTIMPL;
649 static HRESULT WINAPI MimeBody_SetData(
650 IMimeBody* iface,
651 ENCODINGTYPE ietEncoding,
652 LPCSTR pszPriType,
653 LPCSTR pszSubType,
654 REFIID riid,
655 LPVOID pvObject)
657 FIXME("stub\n");
658 return E_NOTIMPL;
661 static HRESULT WINAPI MimeBody_EmptyData(
662 IMimeBody* iface)
664 FIXME("stub\n");
665 return E_NOTIMPL;
668 static HRESULT WINAPI MimeBody_CopyTo(
669 IMimeBody* iface,
670 IMimeBody* pBody)
672 FIXME("stub\n");
673 return E_NOTIMPL;
676 static HRESULT WINAPI MimeBody_GetTransmitInfo(
677 IMimeBody* iface,
678 LPTRANSMITINFO pTransmitInfo)
680 FIXME("stub\n");
681 return E_NOTIMPL;
684 static HRESULT WINAPI MimeBody_SaveToFile(
685 IMimeBody* iface,
686 ENCODINGTYPE ietEncoding,
687 LPCSTR pszFilePath)
689 FIXME("stub\n");
690 return E_NOTIMPL;
693 static HRESULT WINAPI MimeBody_GetHandle(
694 IMimeBody* iface,
695 LPHBODY phBody)
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,
707 MimeBody_AddRef,
708 MimeBody_Release,
709 MimeBody_GetClassID,
710 MimeBody_IsDirty,
711 MimeBody_Load,
712 MimeBody_Save,
713 MimeBody_GetSizeMax,
714 MimeBody_InitNew,
715 MimeBody_GetPropInfo,
716 MimeBody_SetPropInfo,
717 MimeBody_GetProp,
718 MimeBody_SetProp,
719 MimeBody_AppendProp,
720 MimeBody_DeleteProp,
721 MimeBody_CopyProps,
722 MimeBody_MoveProps,
723 MimeBody_DeleteExcept,
724 MimeBody_QueryProp,
725 MimeBody_GetCharset,
726 MimeBody_SetCharset,
727 MimeBody_GetParameters,
728 MimeBody_IsContentType,
729 MimeBody_BindToObject,
730 MimeBody_Clone,
731 MimeBody_SetOption,
732 MimeBody_GetOption,
733 MimeBody_EnumProps,
734 MimeBody_IsType,
735 MimeBody_SetDisplayName,
736 MimeBody_GetDisplayName,
737 MimeBody_GetOffsets,
738 MimeBody_GetCurrentEncoding,
739 MimeBody_SetCurrentEncoding,
740 MimeBody_GetEstimatedSize,
741 MimeBody_GetDataHere,
742 MimeBody_GetData,
743 MimeBody_SetData,
744 MimeBody_EmptyData,
745 MimeBody_CopyTo,
746 MimeBody_GetTransmitInfo,
747 MimeBody_SaveToFile,
748 MimeBody_GetHandle
751 #define FIRST_CUSTOM_PROP_ID 0x100
753 HRESULT MimeBody_create(IUnknown *outer, void **obj)
755 MimeBody *This;
757 *obj = NULL;
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;
765 This->refs = 1;
766 This->handle = NULL;
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;
772 return S_OK;
775 typedef struct MimeMessage
777 const IMimeMessageVtbl *lpVtbl;
779 LONG refs;
780 } MimeMessage;
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))
792 *ppv = iface;
793 IUnknown_AddRef(iface);
794 return S_OK;
797 FIXME("no interface for %s\n", debugstr_guid(riid));
798 *ppv = NULL;
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;
812 ULONG refs;
814 TRACE("(%p)->()\n", iface);
816 refs = InterlockedDecrement(&This->refs);
817 if (!refs)
819 HeapFree(GetProcessHeap(), 0, This);
822 return refs;
825 /*** IPersist methods ***/
826 static HRESULT WINAPI MimeMessage_GetClassID(
827 IMimeMessage *iface,
828 CLSID *pClassID)
830 FIXME("(%p)->(%p)\n", iface, pClassID);
831 return E_NOTIMPL;
834 /*** IPersistStreamInit methods ***/
835 static HRESULT WINAPI MimeMessage_IsDirty(
836 IMimeMessage *iface)
838 FIXME("(%p)->()\n", iface);
839 return E_NOTIMPL;
842 static HRESULT WINAPI MimeMessage_Load(
843 IMimeMessage *iface,
844 LPSTREAM pStm){
845 FIXME("(%p)->(%p)\n", iface, pStm);
846 return E_NOTIMPL;
849 static HRESULT WINAPI MimeMessage_Save(
850 IMimeMessage *iface,
851 LPSTREAM pStm,
852 BOOL fClearDirty)
854 FIXME("(%p)->(%p, %s)\n", iface, pStm, fClearDirty ? "TRUE" : "FALSE");
855 return E_NOTIMPL;
858 static HRESULT WINAPI MimeMessage_GetSizeMax(
859 IMimeMessage *iface,
860 ULARGE_INTEGER *pcbSize)
862 FIXME("(%p)->(%p)\n", iface, pcbSize);
863 return E_NOTIMPL;
866 static HRESULT WINAPI MimeMessage_InitNew(
867 IMimeMessage *iface)
869 FIXME("(%p)->()\n", iface);
870 return E_NOTIMPL;
873 /*** IMimeMessageTree methods ***/
874 static HRESULT WINAPI MimeMessage_GetMessageSource(
875 IMimeMessage *iface,
876 IStream **ppStream,
877 DWORD dwFlags)
879 FIXME("(%p)->(%p, 0x%x)\n", iface, ppStream, dwFlags);
880 return E_NOTIMPL;
883 static HRESULT WINAPI MimeMessage_GetMessageSize(
884 IMimeMessage *iface,
885 ULONG *pcbSize,
886 DWORD dwFlags)
888 FIXME("(%p)->(%p, 0x%x)\n", iface, pcbSize, dwFlags);
889 return E_NOTIMPL;
892 static HRESULT WINAPI MimeMessage_LoadOffsetTable(
893 IMimeMessage *iface,
894 IStream *pStream)
896 FIXME("(%p)->(%p)\n", iface, pStream);
897 return E_NOTIMPL;
900 static HRESULT WINAPI MimeMessage_SaveOffsetTable(
901 IMimeMessage *iface,
902 IStream *pStream,
903 DWORD dwFlags)
905 FIXME("(%p)->(%p, 0x%x)\n", iface, pStream, dwFlags);
906 return E_NOTIMPL;
910 static HRESULT WINAPI MimeMessage_GetFlags(
911 IMimeMessage *iface,
912 DWORD *pdwFlags)
914 FIXME("(%p)->(%p)\n", iface, pdwFlags);
915 return E_NOTIMPL;
918 static HRESULT WINAPI MimeMessage_Commit(
919 IMimeMessage *iface,
920 DWORD dwFlags)
922 FIXME("(%p)->(0x%x)\n", iface, dwFlags);
923 return E_NOTIMPL;
927 static HRESULT WINAPI MimeMessage_HandsOffStorage(
928 IMimeMessage *iface)
930 FIXME("(%p)->()\n", iface);
931 return E_NOTIMPL;
934 static HRESULT WINAPI MimeMessage_BindToObject(
935 IMimeMessage *iface,
936 const HBODY hBody,
937 REFIID riid,
938 void **ppvObject)
940 FIXME("(%p)->(%p, %s, %p)\n", iface, hBody, debugstr_guid(riid), ppvObject);
941 return E_NOTIMPL;
944 static HRESULT WINAPI MimeMessage_SaveBody(
945 IMimeMessage *iface,
946 HBODY hBody,
947 DWORD dwFlags,
948 IStream *pStream)
950 FIXME("(%p)->(%p, 0x%x, %p)\n", iface, hBody, dwFlags, pStream);
951 return E_NOTIMPL;
954 static HRESULT WINAPI MimeMessage_InsertBody(
955 IMimeMessage *iface,
956 BODYLOCATION location,
957 HBODY hPivot,
958 LPHBODY phBody)
960 FIXME("(%p)->(%d, %p, %p)\n", iface, location, hPivot, phBody);
961 return E_NOTIMPL;
964 static HRESULT WINAPI MimeMessage_GetBody(
965 IMimeMessage *iface,
966 BODYLOCATION location,
967 HBODY hPivot,
968 LPHBODY phBody)
970 FIXME("(%p)->(%d, %p, %p)\n", iface, location, hPivot, phBody);
971 return E_NOTIMPL;
974 static HRESULT WINAPI MimeMessage_DeleteBody(
975 IMimeMessage *iface,
976 HBODY hBody,
977 DWORD dwFlags)
979 FIXME("(%p)->(%p, %08x)\n", iface, hBody, dwFlags);
980 return E_NOTIMPL;
983 static HRESULT WINAPI MimeMessage_MoveBody(
984 IMimeMessage *iface,
985 HBODY hBody,
986 BODYLOCATION location)
988 FIXME("(%p)->(%d)\n", iface, location);
989 return E_NOTIMPL;
992 static HRESULT WINAPI MimeMessage_CountBodies(
993 IMimeMessage *iface,
994 HBODY hParent,
995 boolean fRecurse,
996 ULONG *pcBodies)
998 FIXME("(%p)->(%p, %s, %p)\n", iface, hParent, fRecurse ? "TRUE" : "FALSE", pcBodies);
999 return E_NOTIMPL;
1002 static HRESULT WINAPI MimeMessage_FindFirst(
1003 IMimeMessage *iface,
1004 LPFINDBODY pFindBody,
1005 LPHBODY phBody)
1007 FIXME("(%p)->(%p, %p)\n", iface, pFindBody, phBody);
1008 return E_NOTIMPL;
1011 static HRESULT WINAPI MimeMessage_FindNext(
1012 IMimeMessage *iface,
1013 LPFINDBODY pFindBody,
1014 LPHBODY phBody)
1016 FIXME("(%p)->(%p, %p)\n", iface, pFindBody, phBody);
1017 return E_NOTIMPL;
1020 static HRESULT WINAPI MimeMessage_ResolveURL(
1021 IMimeMessage *iface,
1022 HBODY hRelated,
1023 LPCSTR pszBase,
1024 LPCSTR pszURL,
1025 DWORD dwFlags,
1026 LPHBODY phBody)
1028 FIXME("(%p)->(%p, %s, %s, 0x%x, %p)\n", iface, hRelated, pszBase, pszURL, dwFlags, phBody);
1029 return E_NOTIMPL;
1032 static HRESULT WINAPI MimeMessage_ToMultipart(
1033 IMimeMessage *iface,
1034 HBODY hBody,
1035 LPCSTR pszSubType,
1036 LPHBODY phMultipart)
1038 FIXME("(%p)->(%p, %s, %p)\n", iface, hBody, pszSubType, phMultipart);
1039 return E_NOTIMPL;
1042 static HRESULT WINAPI MimeMessage_GetBodyOffsets(
1043 IMimeMessage *iface,
1044 HBODY hBody,
1045 LPBODYOFFSETS pOffsets)
1047 FIXME("(%p)->(%p, %p)\n", iface, hBody, pOffsets);
1048 return E_NOTIMPL;
1051 static HRESULT WINAPI MimeMessage_GetCharset(
1052 IMimeMessage *iface,
1053 LPHCHARSET phCharset)
1055 FIXME("(%p)->(%p)\n", iface, phCharset);
1056 return E_NOTIMPL;
1059 static HRESULT WINAPI MimeMessage_SetCharset(
1060 IMimeMessage *iface,
1061 HCHARSET hCharset,
1062 CSETAPPLYTYPE applytype)
1064 FIXME("(%p)->(%p, %d)\n", iface, hCharset, applytype);
1065 return E_NOTIMPL;
1068 static HRESULT WINAPI MimeMessage_IsBodyType(
1069 IMimeMessage *iface,
1070 HBODY hBody,
1071 IMSGBODYTYPE bodytype)
1073 FIXME("(%p)->(%p, %d)\n", iface, hBody, bodytype);
1074 return E_NOTIMPL;
1077 static HRESULT WINAPI MimeMessage_IsContentType(
1078 IMimeMessage *iface,
1079 HBODY hBody,
1080 LPCSTR pszPriType,
1081 LPCSTR pszSubType)
1083 FIXME("(%p)->(%p, %s, %s)\n", iface, hBody, pszPriType, pszSubType);
1084 return E_NOTIMPL;
1087 static HRESULT WINAPI MimeMessage_QueryBodyProp(
1088 IMimeMessage *iface,
1089 HBODY hBody,
1090 LPCSTR pszName,
1091 LPCSTR pszCriteria,
1092 boolean fSubString,
1093 boolean fCaseSensitive)
1095 FIXME("(%p)->(%p, %s, %s, %s, %s)\n", iface, hBody, pszName, pszCriteria, fSubString ? "TRUE" : "FALSE", fCaseSensitive ? "TRUE" : "FALSE");
1096 return E_NOTIMPL;
1099 static HRESULT WINAPI MimeMessage_GetBodyProp(
1100 IMimeMessage *iface,
1101 HBODY hBody,
1102 LPCSTR pszName,
1103 DWORD dwFlags,
1104 LPPROPVARIANT pValue)
1106 FIXME("(%p)->(%p, %s, 0x%x, %p)\n", iface, hBody, pszName, dwFlags, pValue);
1107 return E_NOTIMPL;
1110 static HRESULT WINAPI MimeMessage_SetBodyProp(
1111 IMimeMessage *iface,
1112 HBODY hBody,
1113 LPCSTR pszName,
1114 DWORD dwFlags,
1115 LPCPROPVARIANT pValue)
1117 FIXME("(%p)->(%p, %s, 0x%x, %p)\n", iface, hBody, pszName, dwFlags, pValue);
1118 return E_NOTIMPL;
1121 static HRESULT WINAPI MimeMessage_DeleteBodyProp(
1122 IMimeMessage *iface,
1123 HBODY hBody,
1124 LPCSTR pszName)
1126 FIXME("(%p)->(%p, %s)\n", iface, hBody, pszName);
1127 return E_NOTIMPL;
1130 static HRESULT WINAPI MimeMessage_SetOption(
1131 IMimeMessage *iface,
1132 const TYPEDID oid,
1133 LPCPROPVARIANT pValue)
1135 FIXME("(%p)->(%d, %p)\n", iface, oid, pValue);
1136 return E_NOTIMPL;
1139 static HRESULT WINAPI MimeMessage_GetOption(
1140 IMimeMessage *iface,
1141 const TYPEDID oid,
1142 LPPROPVARIANT pValue)
1144 FIXME("(%p)->(%d, %p)\n", iface, oid, pValue);
1145 return E_NOTIMPL;
1148 /*** IMimeMessage methods ***/
1149 static HRESULT WINAPI MimeMessage_CreateWebPage(
1150 IMimeMessage *iface,
1151 IStream *pRootStm,
1152 LPWEBPAGEOPTIONS pOptions,
1153 IMimeMessageCallback *pCallback,
1154 IMoniker **ppMoniker)
1156 FIXME("(%p)->(%p, %p, %p, %p)\n", iface, pRootStm, pOptions, pCallback, ppMoniker);
1157 *ppMoniker = NULL;
1158 return E_NOTIMPL;
1161 static HRESULT WINAPI MimeMessage_GetProp(
1162 IMimeMessage *iface,
1163 LPCSTR pszName,
1164 DWORD dwFlags,
1165 LPPROPVARIANT pValue)
1167 FIXME("(%p)->(%s, 0x%x, %p)\n", iface, pszName, dwFlags, pValue);
1168 return E_NOTIMPL;
1171 static HRESULT WINAPI MimeMessage_SetProp(
1172 IMimeMessage *iface,
1173 LPCSTR pszName,
1174 DWORD dwFlags,
1175 LPCPROPVARIANT pValue)
1177 FIXME("(%p)->(%s, 0x%x, %p)\n", iface, pszName, dwFlags, pValue);
1178 return E_NOTIMPL;
1181 static HRESULT WINAPI MimeMessage_DeleteProp(
1182 IMimeMessage *iface,
1183 LPCSTR pszName)
1185 FIXME("(%p)->(%s)\n", iface, pszName);
1186 return E_NOTIMPL;
1189 static HRESULT WINAPI MimeMessage_QueryProp(
1190 IMimeMessage *iface,
1191 LPCSTR pszName,
1192 LPCSTR pszCriteria,
1193 boolean fSubString,
1194 boolean fCaseSensitive)
1196 FIXME("(%p)->(%s, %s, %s, %s)\n", iface, pszName, pszCriteria, fSubString ? "TRUE" : "FALSE", fCaseSensitive ? "TRUE" : "FALSE");
1197 return E_NOTIMPL;
1200 static HRESULT WINAPI MimeMessage_GetTextBody(
1201 IMimeMessage *iface,
1202 DWORD dwTxtType,
1203 ENCODINGTYPE ietEncoding,
1204 IStream **pStream,
1205 LPHBODY phBody)
1207 FIXME("(%p)->(%d, %d, %p, %p)\n", iface, dwTxtType, ietEncoding, pStream, phBody);
1208 return E_NOTIMPL;
1211 static HRESULT WINAPI MimeMessage_SetTextBody(
1212 IMimeMessage *iface,
1213 DWORD dwTxtType,
1214 ENCODINGTYPE ietEncoding,
1215 HBODY hAlternative,
1216 IStream *pStream,
1217 LPHBODY phBody)
1219 FIXME("(%p)->(%d, %d, %p, %p, %p)\n", iface, dwTxtType, ietEncoding, hAlternative, pStream, phBody);
1220 return E_NOTIMPL;
1223 static HRESULT WINAPI MimeMessage_AttachObject(
1224 IMimeMessage *iface,
1225 REFIID riid,
1226 void *pvObject,
1227 LPHBODY phBody)
1229 FIXME("(%p)->(%s, %p, %p)\n", iface, debugstr_guid(riid), pvObject, phBody);
1230 return E_NOTIMPL;
1233 static HRESULT WINAPI MimeMessage_AttachFile(
1234 IMimeMessage *iface,
1235 LPCSTR pszFilePath,
1236 IStream *pstmFile,
1237 LPHBODY phBody)
1239 FIXME("(%p)->(%s, %p, %p)\n", iface, pszFilePath, pstmFile, phBody);
1240 return E_NOTIMPL;
1243 static HRESULT WINAPI MimeMessage_AttachURL(
1244 IMimeMessage *iface,
1245 LPCSTR pszBase,
1246 LPCSTR pszURL,
1247 DWORD dwFlags,
1248 IStream *pstmURL,
1249 LPSTR *ppszCIDURL,
1250 LPHBODY phBody)
1252 FIXME("(%p)->(%s, %s, 0x%x, %p, %p, %p)\n", iface, pszBase, pszURL, dwFlags, pstmURL, ppszCIDURL, phBody);
1253 return E_NOTIMPL;
1256 static HRESULT WINAPI MimeMessage_GetAttachments(
1257 IMimeMessage *iface,
1258 ULONG *pcAttach,
1259 LPHBODY *pprghAttach)
1261 FIXME("(%p)->(%p, %p)\n", iface, pcAttach, pprghAttach);
1262 return E_NOTIMPL;
1265 static HRESULT WINAPI MimeMessage_GetAddressTable(
1266 IMimeMessage *iface,
1267 IMimeAddressTable **ppTable)
1269 FIXME("(%p)->(%p)\n", iface, ppTable);
1270 return E_NOTIMPL;
1273 static HRESULT WINAPI MimeMessage_GetSender(
1274 IMimeMessage *iface,
1275 LPADDRESSPROPS pAddress)
1277 FIXME("(%p)->(%p)\n", iface, pAddress);
1278 return E_NOTIMPL;
1281 static HRESULT WINAPI MimeMessage_GetAddressTypes(
1282 IMimeMessage *iface,
1283 DWORD dwAdrTypes,
1284 DWORD dwProps,
1285 LPADDRESSLIST pList)
1287 FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, dwProps, pList);
1288 return E_NOTIMPL;
1291 static HRESULT WINAPI MimeMessage_GetAddressFormat(
1292 IMimeMessage *iface,
1293 DWORD dwAdrTypes,
1294 ADDRESSFORMAT format,
1295 LPSTR *ppszFormat)
1297 FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, format, ppszFormat);
1298 return E_NOTIMPL;
1301 static HRESULT WINAPI MimeMessage_EnumAddressTypes(
1302 IMimeMessage *iface,
1303 DWORD dwAdrTypes,
1304 DWORD dwProps,
1305 IMimeEnumAddressTypes **ppEnum)
1307 FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, dwProps, ppEnum);
1308 return E_NOTIMPL;
1311 static HRESULT WINAPI MimeMessage_SplitMessage(
1312 IMimeMessage *iface,
1313 ULONG cbMaxPart,
1314 IMimeMessageParts **ppParts)
1316 FIXME("(%p)->(%d, %p)\n", iface, cbMaxPart, ppParts);
1317 return E_NOTIMPL;
1320 static HRESULT WINAPI MimeMessage_GetRootMoniker(
1321 IMimeMessage *iface,
1322 IMoniker **ppMoniker)
1324 FIXME("(%p)->(%p)\n", iface, ppMoniker);
1325 return E_NOTIMPL;
1328 static const IMimeMessageVtbl MimeMessageVtbl =
1330 MimeMessage_QueryInterface,
1331 MimeMessage_AddRef,
1332 MimeMessage_Release,
1333 MimeMessage_GetClassID,
1334 MimeMessage_IsDirty,
1335 MimeMessage_Load,
1336 MimeMessage_Save,
1337 MimeMessage_GetSizeMax,
1338 MimeMessage_InitNew,
1339 MimeMessage_GetMessageSource,
1340 MimeMessage_GetMessageSize,
1341 MimeMessage_LoadOffsetTable,
1342 MimeMessage_SaveOffsetTable,
1343 MimeMessage_GetFlags,
1344 MimeMessage_Commit,
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)
1393 MimeMessage *This;
1395 TRACE("(%p, %p)\n", pUnkOuter, ppMessage);
1397 if (pUnkOuter)
1399 FIXME("outer unknown not supported yet\n");
1400 return E_NOTIMPL;
1403 *ppMessage = NULL;
1405 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
1406 if (!This) return E_OUTOFMEMORY;
1408 This->lpVtbl = &MimeMessageVtbl;
1409 This->refs = 1;
1411 *ppMessage = (IMimeMessage *)&This->lpVtbl;
1412 return S_OK;
1415 /***********************************************************************
1416 * MimeOleSetCompatMode (INETCOMM.@)
1418 HRESULT WINAPI MimeOleSetCompatMode(DWORD dwMode)
1420 FIXME("(0x%x)\n", dwMode);
1421 return S_OK;
1424 /***********************************************************************
1425 * MimeOleCreateVirtualStream (INETCOMM.@)
1427 HRESULT WINAPI MimeOleCreateVirtualStream(IStream **ppStream)
1429 HRESULT hr;
1430 FIXME("(%p)\n", ppStream);
1432 hr = CreateStreamOnHGlobal(NULL, TRUE, ppStream);
1433 return hr;
1436 typedef struct MimeSecurity
1438 const IMimeSecurityVtbl *lpVtbl;
1440 LONG refs;
1441 } MimeSecurity;
1443 static HRESULT WINAPI MimeSecurity_QueryInterface(
1444 IMimeSecurity* iface,
1445 REFIID riid,
1446 void** obj)
1448 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), obj);
1450 if (IsEqualIID(riid, &IID_IUnknown) ||
1451 IsEqualIID(riid, &IID_IMimeSecurity))
1453 *obj = iface;
1454 IUnknown_AddRef(iface);
1455 return S_OK;
1458 FIXME("no interface for %s\n", debugstr_guid(riid));
1459 *obj = NULL;
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;
1475 ULONG refs;
1477 TRACE("(%p)->()\n", iface);
1479 refs = InterlockedDecrement(&This->refs);
1480 if (!refs)
1482 HeapFree(GetProcessHeap(), 0, This);
1485 return refs;
1488 static HRESULT WINAPI MimeSecurity_InitNew(
1489 IMimeSecurity* iface)
1491 FIXME("(%p)->(): stub\n", iface);
1492 return S_OK;
1495 static HRESULT WINAPI MimeSecurity_CheckInit(
1496 IMimeSecurity* iface)
1498 FIXME("(%p)->(): stub\n", iface);
1499 return E_NOTIMPL;
1502 static HRESULT WINAPI MimeSecurity_EncodeMessage(
1503 IMimeSecurity* iface,
1504 IMimeMessageTree* pTree,
1505 DWORD dwFlags)
1507 FIXME("(%p)->(%p, %08x): stub\n", iface, pTree, dwFlags);
1508 return E_NOTIMPL;
1511 static HRESULT WINAPI MimeSecurity_EncodeBody(
1512 IMimeSecurity* iface,
1513 IMimeMessageTree* pTree,
1514 HBODY hEncodeRoot,
1515 DWORD dwFlags)
1517 FIXME("(%p)->(%p, %p, %08x): stub\n", iface, pTree, hEncodeRoot, dwFlags);
1518 return E_NOTIMPL;
1521 static HRESULT WINAPI MimeSecurity_DecodeMessage(
1522 IMimeSecurity* iface,
1523 IMimeMessageTree* pTree,
1524 DWORD dwFlags)
1526 FIXME("(%p)->(%p, %08x): stub\n", iface, pTree, dwFlags);
1527 return E_NOTIMPL;
1530 static HRESULT WINAPI MimeSecurity_DecodeBody(
1531 IMimeSecurity* iface,
1532 IMimeMessageTree* pTree,
1533 HBODY hDecodeRoot,
1534 DWORD dwFlags)
1536 FIXME("(%p)->(%p, %p, %08x): stub\n", iface, pTree, hDecodeRoot, dwFlags);
1537 return E_NOTIMPL;
1540 static HRESULT WINAPI MimeSecurity_EnumCertificates(
1541 IMimeSecurity* iface,
1542 HCAPICERTSTORE hc,
1543 DWORD dwUsage,
1544 PCX509CERT pPrev,
1545 PCX509CERT* ppCert)
1547 FIXME("(%p)->(%p, %08x, %p, %p): stub\n", iface, hc, dwUsage, pPrev, ppCert);
1548 return E_NOTIMPL;
1551 static HRESULT WINAPI MimeSecurity_GetCertificateName(
1552 IMimeSecurity* iface,
1553 const PCX509CERT pX509Cert,
1554 const CERTNAMETYPE cn,
1555 LPSTR* ppszName)
1557 FIXME("(%p)->(%p, %08x, %p): stub\n", iface, pX509Cert, cn, ppszName);
1558 return E_NOTIMPL;
1561 static HRESULT WINAPI MimeSecurity_GetMessageType(
1562 IMimeSecurity* iface,
1563 const HWND hwndParent,
1564 IMimeBody* pBody,
1565 DWORD* pdwSecType)
1567 FIXME("(%p)->(%p, %p, %p): stub\n", iface, hwndParent, pBody, pdwSecType);
1568 return E_NOTIMPL;
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);
1578 return E_NOTIMPL;
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)
1604 MimeSecurity *This;
1606 TRACE("(%p)\n", ppSecurity);
1608 *ppSecurity = NULL;
1610 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
1611 if (!This) return E_OUTOFMEMORY;
1613 This->lpVtbl = &MimeSecurityVtbl;
1614 This->refs = 1;
1616 *ppSecurity = (IMimeSecurity *)&This->lpVtbl;
1617 return S_OK;