user32: Change the desktop colour and pattern to match win2k.
[wine] / dlls / inetcomm / mimeole.c
1 /*
2  * MIME OLE Interfaces
3  *
4  * Copyright 2006 Robert Shearman for CodeWeavers
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #define COBJMACROS
22
23 #include <stdarg.h>
24 #include <stdio.h>
25
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "objbase.h"
30 #include "ole2.h"
31 #include "mimeole.h"
32
33 #include "wine/debug.h"
34
35 #include "inetcomm_private.h"
36
37 WINE_DEFAULT_DEBUG_CHANNEL(inetcomm);
38
39 typedef struct MimeBody
40 {
41     const IMimeBodyVtbl *lpVtbl;
42     LONG refs;
43
44     HBODY handle;
45 } MimeBody;
46
47 static inline MimeBody *impl_from_IMimeBody( IMimeBody *iface )
48 {
49     return (MimeBody *)((char*)iface - FIELD_OFFSET(MimeBody, lpVtbl));
50 }
51
52 static HRESULT WINAPI MimeBody_QueryInterface(IMimeBody* iface,
53                                      REFIID riid,
54                                      void** ppvObject)
55 {
56     TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppvObject);
57
58     *ppvObject = NULL;
59
60     if (IsEqualIID(riid, &IID_IUnknown) ||
61         IsEqualIID(riid, &IID_IPersist) ||
62         IsEqualIID(riid, &IID_IPersistStreamInit) ||
63         IsEqualIID(riid, &IID_IMimePropertySet) ||
64         IsEqualIID(riid, &IID_IMimeBody))
65     {
66         *ppvObject = iface;
67     }
68
69     if(*ppvObject)
70     {
71         IUnknown_AddRef((IUnknown*)*ppvObject);
72         return S_OK;
73     }
74
75     FIXME("no interface for %s\n", debugstr_guid(riid));
76     return E_NOINTERFACE;
77 }
78
79 static ULONG WINAPI MimeBody_AddRef(IMimeBody* iface)
80 {
81     MimeBody *This = impl_from_IMimeBody(iface);
82     TRACE("(%p)->()\n", iface);
83     return InterlockedIncrement(&This->refs);
84 }
85
86 static ULONG WINAPI MimeBody_Release(IMimeBody* iface)
87 {
88     MimeBody *This = impl_from_IMimeBody(iface);
89     ULONG refs;
90
91     TRACE("(%p)->()\n", iface);
92
93     refs = InterlockedDecrement(&This->refs);
94     if (!refs)
95     {
96         HeapFree(GetProcessHeap(), 0, This);
97     }
98
99     return refs;
100 }
101
102 static HRESULT WINAPI MimeBody_GetClassID(
103                                  IMimeBody* iface,
104                                  CLSID* pClassID)
105 {
106     FIXME("stub\n");
107     return E_NOTIMPL;
108 }
109
110
111 static HRESULT WINAPI MimeBody_IsDirty(
112                               IMimeBody* iface)
113 {
114     FIXME("stub\n");
115     return E_NOTIMPL;
116 }
117
118 static HRESULT WINAPI MimeBody_Load(
119                            IMimeBody* iface,
120                            LPSTREAM pStm)
121 {
122     FIXME("(%p)->(%p): stub\n", iface, pStm);
123     return E_NOTIMPL;
124 }
125
126 static HRESULT WINAPI MimeBody_Save(
127                            IMimeBody* iface,
128                            LPSTREAM pStm,
129                            BOOL fClearDirty)
130 {
131     FIXME("stub\n");
132     return E_NOTIMPL;
133 }
134
135 static HRESULT WINAPI MimeBody_GetSizeMax(
136                                  IMimeBody* iface,
137                                  ULARGE_INTEGER* pcbSize)
138 {
139     FIXME("stub\n");
140     return E_NOTIMPL;
141 }
142
143 static HRESULT WINAPI MimeBody_InitNew(
144                               IMimeBody* iface)
145 {
146     FIXME("stub\n");
147     return E_NOTIMPL;
148 }
149
150 static HRESULT WINAPI MimeBody_GetPropInfo(
151                                   IMimeBody* iface,
152                                   LPCSTR pszName,
153                                   LPMIMEPROPINFO pInfo)
154 {
155     FIXME("stub\n");
156     return E_NOTIMPL;
157 }
158
159 static HRESULT WINAPI MimeBody_SetPropInfo(
160                                   IMimeBody* iface,
161                                   LPCSTR pszName,
162                                   LPCMIMEPROPINFO pInfo)
163 {
164     FIXME("stub\n");
165     return E_NOTIMPL;
166 }
167
168 static HRESULT WINAPI MimeBody_GetProp(
169                               IMimeBody* iface,
170                               LPCSTR pszName,
171                               DWORD dwFlags,
172                               LPPROPVARIANT pValue)
173 {
174     FIXME("stub\n");
175     return E_NOTIMPL;
176 }
177
178 static HRESULT WINAPI MimeBody_SetProp(
179                               IMimeBody* iface,
180                               LPCSTR pszName,
181                               DWORD dwFlags,
182                               LPCPROPVARIANT pValue)
183 {
184     FIXME("stub\n");
185     return E_NOTIMPL;
186 }
187
188 static HRESULT WINAPI MimeBody_AppendProp(
189                                  IMimeBody* iface,
190                                  LPCSTR pszName,
191                                  DWORD dwFlags,
192                                  LPPROPVARIANT pValue)
193 {
194     FIXME("stub\n");
195     return E_NOTIMPL;
196 }
197
198 static HRESULT WINAPI MimeBody_DeleteProp(
199                                  IMimeBody* iface,
200                                  LPCSTR pszName)
201 {
202     FIXME("stub\n");
203     return E_NOTIMPL;
204 }
205
206 static HRESULT WINAPI MimeBody_CopyProps(
207                                 IMimeBody* iface,
208                                 ULONG cNames,
209                                 LPCSTR* prgszName,
210                                 IMimePropertySet* pPropertySet)
211 {
212     FIXME("stub\n");
213     return E_NOTIMPL;
214 }
215
216 static HRESULT WINAPI MimeBody_MoveProps(
217                                 IMimeBody* iface,
218                                 ULONG cNames,
219                                 LPCSTR* prgszName,
220                                 IMimePropertySet* pPropertySet)
221 {
222     FIXME("stub\n");
223     return E_NOTIMPL;
224 }
225
226 static HRESULT WINAPI MimeBody_DeleteExcept(
227                                    IMimeBody* iface,
228                                    ULONG cNames,
229                                    LPCSTR* prgszName)
230 {
231     FIXME("stub\n");
232     return E_NOTIMPL;
233 }
234
235 static HRESULT WINAPI MimeBody_QueryProp(
236                                 IMimeBody* iface,
237                                 LPCSTR pszName,
238                                 LPCSTR pszCriteria,
239                                 boolean fSubString,
240                                 boolean fCaseSensitive)
241 {
242     FIXME("stub\n");
243     return E_NOTIMPL;
244 }
245
246 static HRESULT WINAPI MimeBody_GetCharset(
247                                  IMimeBody* iface,
248                                  LPHCHARSET phCharset)
249 {
250     FIXME("stub\n");
251     return E_NOTIMPL;
252 }
253
254 static HRESULT WINAPI MimeBody_SetCharset(
255                                  IMimeBody* iface,
256                                  HCHARSET hCharset,
257                                  CSETAPPLYTYPE applytype)
258 {
259     FIXME("stub\n");
260     return E_NOTIMPL;
261 }
262
263 static HRESULT WINAPI MimeBody_GetParameters(
264                                     IMimeBody* iface,
265                                     LPCSTR pszName,
266                                     ULONG* pcParams,
267                                     LPMIMEPARAMINFO* pprgParam)
268 {
269     FIXME("stub\n");
270     return E_NOTIMPL;
271 }
272
273 static HRESULT WINAPI MimeBody_IsContentType(
274                                     IMimeBody* iface,
275                                     LPCSTR pszPriType,
276                                     LPCSTR pszSubType)
277 {
278     FIXME("stub\n");
279     return E_NOTIMPL;
280 }
281
282 static HRESULT WINAPI MimeBody_BindToObject(
283                                    IMimeBody* iface,
284                                    REFIID riid,
285                                    void** ppvObject)
286 {
287     FIXME("stub\n");
288     return E_NOTIMPL;
289 }
290
291 static HRESULT WINAPI MimeBody_Clone(
292                             IMimeBody* iface,
293                             IMimePropertySet** ppPropertySet)
294 {
295     FIXME("stub\n");
296     return E_NOTIMPL;
297 }
298
299 static HRESULT WINAPI MimeBody_SetOption(
300                                 IMimeBody* iface,
301                                 const TYPEDID oid,
302                                 LPCPROPVARIANT pValue)
303 {
304     FIXME("stub\n");
305     return E_NOTIMPL;
306 }
307
308 static HRESULT WINAPI MimeBody_GetOption(
309                                 IMimeBody* iface,
310                                 const TYPEDID oid,
311                                 LPPROPVARIANT pValue)
312 {
313     FIXME("stub\n");
314     return E_NOTIMPL;
315 }
316
317 static HRESULT WINAPI MimeBody_EnumProps(
318                                 IMimeBody* iface,
319                                 DWORD dwFlags,
320                                 IMimeEnumProperties** ppEnum)
321 {
322     FIXME("stub\n");
323     return E_NOTIMPL;
324 }
325
326 static HRESULT WINAPI MimeBody_IsType(
327                              IMimeBody* iface,
328                              IMSGBODYTYPE bodytype)
329 {
330     FIXME("stub\n");
331     return E_NOTIMPL;
332 }
333
334 static HRESULT WINAPI MimeBody_SetDisplayName(
335                                      IMimeBody* iface,
336                                      LPCSTR pszDisplay)
337 {
338     FIXME("stub\n");
339     return E_NOTIMPL;
340 }
341
342 static HRESULT WINAPI MimeBody_GetDisplayName(
343                                      IMimeBody* iface,
344                                      LPSTR* ppszDisplay)
345 {
346     FIXME("stub\n");
347     return E_NOTIMPL;
348 }
349
350 static HRESULT WINAPI MimeBody_GetOffsets(
351                                  IMimeBody* iface,
352                                  LPBODYOFFSETS pOffsets)
353 {
354     FIXME("stub\n");
355     return E_NOTIMPL;
356 }
357
358 static HRESULT WINAPI MimeBody_GetCurrentEncoding(
359                                          IMimeBody* iface,
360                                          ENCODINGTYPE* pietEncoding)
361 {
362     FIXME("stub\n");
363     return E_NOTIMPL;
364 }
365
366 static HRESULT WINAPI MimeBody_SetCurrentEncoding(
367                                          IMimeBody* iface,
368                                          ENCODINGTYPE ietEncoding)
369 {
370     FIXME("stub\n");
371     return E_NOTIMPL;
372 }
373
374 static HRESULT WINAPI MimeBody_GetEstimatedSize(
375                                        IMimeBody* iface,
376                                        ENCODINGTYPE ietEncoding,
377                                        ULONG* pcbSize)
378 {
379     FIXME("stub\n");
380     return E_NOTIMPL;
381 }
382
383 static HRESULT WINAPI MimeBody_GetDataHere(
384                                   IMimeBody* iface,
385                                   ENCODINGTYPE ietEncoding,
386                                   IStream* pStream)
387 {
388     FIXME("stub\n");
389     return E_NOTIMPL;
390 }
391
392 static HRESULT WINAPI MimeBody_GetData(
393                               IMimeBody* iface,
394                               ENCODINGTYPE ietEncoding,
395                               IStream** ppStream)
396 {
397     FIXME("stub\n");
398     return E_NOTIMPL;
399 }
400
401 static HRESULT WINAPI MimeBody_SetData(
402                               IMimeBody* iface,
403                               ENCODINGTYPE ietEncoding,
404                               LPCSTR pszPriType,
405                               LPCSTR pszSubType,
406                               REFIID riid,
407                               LPVOID pvObject)
408 {
409     FIXME("stub\n");
410     return E_NOTIMPL;
411 }
412
413 static HRESULT WINAPI MimeBody_EmptyData(
414                                 IMimeBody* iface)
415 {
416     FIXME("stub\n");
417     return E_NOTIMPL;
418 }
419
420 static HRESULT WINAPI MimeBody_CopyTo(
421                              IMimeBody* iface,
422                              IMimeBody* pBody)
423 {
424     FIXME("stub\n");
425     return E_NOTIMPL;
426 }
427
428 static HRESULT WINAPI MimeBody_GetTransmitInfo(
429                                       IMimeBody* iface,
430                                       LPTRANSMITINFO pTransmitInfo)
431 {
432     FIXME("stub\n");
433     return E_NOTIMPL;
434 }
435
436 static HRESULT WINAPI MimeBody_SaveToFile(
437                                  IMimeBody* iface,
438                                  ENCODINGTYPE ietEncoding,
439                                  LPCSTR pszFilePath)
440 {
441     FIXME("stub\n");
442     return E_NOTIMPL;
443 }
444
445 static HRESULT WINAPI MimeBody_GetHandle(
446                                 IMimeBody* iface,
447                                 LPHBODY phBody)
448 {
449     MimeBody *This = impl_from_IMimeBody(iface);
450     TRACE("(%p)->(%p)\n", iface, phBody);
451
452     *phBody = This->handle;
453     return This->handle ? S_OK : MIME_E_NO_DATA;
454 }
455
456 static IMimeBodyVtbl body_vtbl =
457 {
458     MimeBody_QueryInterface,
459     MimeBody_AddRef,
460     MimeBody_Release,
461     MimeBody_GetClassID,
462     MimeBody_IsDirty,
463     MimeBody_Load,
464     MimeBody_Save,
465     MimeBody_GetSizeMax,
466     MimeBody_InitNew,
467     MimeBody_GetPropInfo,
468     MimeBody_SetPropInfo,
469     MimeBody_GetProp,
470     MimeBody_SetProp,
471     MimeBody_AppendProp,
472     MimeBody_DeleteProp,
473     MimeBody_CopyProps,
474     MimeBody_MoveProps,
475     MimeBody_DeleteExcept,
476     MimeBody_QueryProp,
477     MimeBody_GetCharset,
478     MimeBody_SetCharset,
479     MimeBody_GetParameters,
480     MimeBody_IsContentType,
481     MimeBody_BindToObject,
482     MimeBody_Clone,
483     MimeBody_SetOption,
484     MimeBody_GetOption,
485     MimeBody_EnumProps,
486     MimeBody_IsType,
487     MimeBody_SetDisplayName,
488     MimeBody_GetDisplayName,
489     MimeBody_GetOffsets,
490     MimeBody_GetCurrentEncoding,
491     MimeBody_SetCurrentEncoding,
492     MimeBody_GetEstimatedSize,
493     MimeBody_GetDataHere,
494     MimeBody_GetData,
495     MimeBody_SetData,
496     MimeBody_EmptyData,
497     MimeBody_CopyTo,
498     MimeBody_GetTransmitInfo,
499     MimeBody_SaveToFile,
500     MimeBody_GetHandle
501 };
502
503 HRESULT MimeBody_create(IUnknown *outer, void **obj)
504 {
505     MimeBody *This;
506
507     *obj = NULL;
508
509     if(outer) return CLASS_E_NOAGGREGATION;
510
511     This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
512     if (!This) return E_OUTOFMEMORY;
513
514     This->lpVtbl = &body_vtbl;
515     This->refs = 1;
516     This->handle = NULL;
517
518     *obj = (IMimeBody *)&This->lpVtbl;
519     return S_OK;
520 }
521
522 typedef struct MimeMessage
523 {
524     const IMimeMessageVtbl *lpVtbl;
525
526     LONG refs;
527 } MimeMessage;
528
529 static HRESULT WINAPI MimeMessage_QueryInterface(IMimeMessage *iface, REFIID riid, void **ppv)
530 {
531     TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
532
533     if (IsEqualIID(riid, &IID_IUnknown) ||
534         IsEqualIID(riid, &IID_IPersist) ||
535         IsEqualIID(riid, &IID_IPersistStreamInit) ||
536         IsEqualIID(riid, &IID_IMimeMessageTree) ||
537         IsEqualIID(riid, &IID_IMimeMessage))
538     {
539         *ppv = iface;
540         IUnknown_AddRef(iface);
541         return S_OK;
542     }
543
544     FIXME("no interface for %s\n", debugstr_guid(riid));
545     *ppv = NULL;
546     return E_NOINTERFACE;
547 }
548
549 static ULONG WINAPI MimeMessage_AddRef(IMimeMessage *iface)
550 {
551     MimeMessage *This = (MimeMessage *)iface;
552     TRACE("(%p)->()\n", iface);
553     return InterlockedIncrement(&This->refs);
554 }
555
556 static ULONG WINAPI MimeMessage_Release(IMimeMessage *iface)
557 {
558     MimeMessage *This = (MimeMessage *)iface;
559     ULONG refs;
560
561     TRACE("(%p)->()\n", iface);
562
563     refs = InterlockedDecrement(&This->refs);
564     if (!refs)
565     {
566         HeapFree(GetProcessHeap(), 0, This);
567     }
568
569     return refs;
570 }
571
572 /*** IPersist methods ***/
573 static HRESULT WINAPI MimeMessage_GetClassID(
574     IMimeMessage *iface,
575     CLSID *pClassID)
576 {
577     FIXME("(%p)->(%p)\n", iface, pClassID);
578     return E_NOTIMPL;
579 }
580
581 /*** IPersistStreamInit methods ***/
582 static HRESULT WINAPI MimeMessage_IsDirty(
583     IMimeMessage *iface)
584 {
585     FIXME("(%p)->()\n", iface);
586     return E_NOTIMPL;
587 }
588
589 static HRESULT WINAPI MimeMessage_Load(
590     IMimeMessage *iface,
591     LPSTREAM pStm){
592     FIXME("(%p)->(%p)\n", iface, pStm);
593     return E_NOTIMPL;
594 }
595
596 static HRESULT WINAPI MimeMessage_Save(
597     IMimeMessage *iface,
598     LPSTREAM pStm,
599     BOOL fClearDirty)
600 {
601     FIXME("(%p)->(%p, %s)\n", iface, pStm, fClearDirty ? "TRUE" : "FALSE");
602     return E_NOTIMPL;
603 }
604
605 static HRESULT WINAPI MimeMessage_GetSizeMax(
606     IMimeMessage *iface,
607     ULARGE_INTEGER *pcbSize)
608 {
609     FIXME("(%p)->(%p)\n", iface, pcbSize);
610     return E_NOTIMPL;
611 }
612
613 static HRESULT WINAPI MimeMessage_InitNew(
614     IMimeMessage *iface)
615 {
616     FIXME("(%p)->()\n", iface);
617     return E_NOTIMPL;
618 }
619
620 /*** IMimeMessageTree methods ***/
621 static HRESULT WINAPI MimeMessage_GetMessageSource(
622     IMimeMessage *iface,
623     IStream **ppStream,
624     DWORD dwFlags)
625 {
626     FIXME("(%p)->(%p, 0x%x)\n", iface, ppStream, dwFlags);
627     return E_NOTIMPL;
628 }
629
630 static HRESULT WINAPI MimeMessage_GetMessageSize(
631     IMimeMessage *iface,
632     ULONG *pcbSize,
633     DWORD dwFlags)
634 {
635     FIXME("(%p)->(%p, 0x%x)\n", iface, pcbSize, dwFlags);
636     return E_NOTIMPL;
637 }
638
639 static HRESULT WINAPI MimeMessage_LoadOffsetTable(
640     IMimeMessage *iface,
641     IStream *pStream)
642 {
643     FIXME("(%p)->(%p)\n", iface, pStream);
644     return E_NOTIMPL;
645 }
646
647 static HRESULT WINAPI MimeMessage_SaveOffsetTable(
648     IMimeMessage *iface,
649     IStream *pStream,
650     DWORD dwFlags)
651 {
652     FIXME("(%p)->(%p, 0x%x)\n", iface, pStream, dwFlags);
653     return E_NOTIMPL;
654 }
655
656
657 static HRESULT WINAPI MimeMessage_GetFlags(
658     IMimeMessage *iface,
659     DWORD *pdwFlags)
660 {
661     FIXME("(%p)->(%p)\n", iface, pdwFlags);
662     return E_NOTIMPL;
663 }
664
665 static HRESULT WINAPI MimeMessage_Commit(
666     IMimeMessage *iface,
667     DWORD dwFlags)
668 {
669     FIXME("(%p)->(0x%x)\n", iface, dwFlags);
670     return E_NOTIMPL;
671 }
672
673
674 static HRESULT WINAPI MimeMessage_HandsOffStorage(
675     IMimeMessage *iface)
676 {
677     FIXME("(%p)->()\n", iface);
678     return E_NOTIMPL;
679 }
680
681 static HRESULT WINAPI MimeMessage_BindToObject(
682     IMimeMessage *iface,
683     const HBODY hBody,
684     REFIID riid,
685     void **ppvObject)
686 {
687     FIXME("(%p)->(%p, %s, %p)\n", iface, hBody, debugstr_guid(riid), ppvObject);
688     return E_NOTIMPL;
689 }
690
691 static HRESULT WINAPI MimeMessage_SaveBody(
692     IMimeMessage *iface,
693     HBODY hBody,
694     DWORD dwFlags,
695     IStream *pStream)
696 {
697     FIXME("(%p)->(%p, 0x%x, %p)\n", iface, hBody, dwFlags, pStream);
698     return E_NOTIMPL;
699 }
700
701 static HRESULT WINAPI MimeMessage_InsertBody(
702     IMimeMessage *iface,
703     BODYLOCATION location,
704     HBODY hPivot,
705     LPHBODY phBody)
706 {
707     FIXME("(%p)->(%d, %p, %p)\n", iface, location, hPivot, phBody);
708     return E_NOTIMPL;
709 }
710
711 static HRESULT WINAPI MimeMessage_GetBody(
712     IMimeMessage *iface,
713     BODYLOCATION location,
714     HBODY hPivot,
715     LPHBODY phBody)
716 {
717     FIXME("(%p)->(%d, %p, %p)\n", iface, location, hPivot, phBody);
718     return E_NOTIMPL;
719 }
720
721 static HRESULT WINAPI MimeMessage_DeleteBody(
722     IMimeMessage *iface,
723     HBODY hBody,
724     DWORD dwFlags)
725 {
726     FIXME("(%p)->(%p, %08x)\n", iface, hBody, dwFlags);
727     return E_NOTIMPL;
728 }
729
730 static HRESULT WINAPI MimeMessage_MoveBody(
731     IMimeMessage *iface,
732     HBODY hBody,
733     BODYLOCATION location)
734 {
735     FIXME("(%p)->(%d)\n", iface, location);
736     return E_NOTIMPL;
737 }
738
739 static HRESULT WINAPI MimeMessage_CountBodies(
740     IMimeMessage *iface,
741     HBODY hParent,
742     boolean fRecurse,
743     ULONG *pcBodies)
744 {
745     FIXME("(%p)->(%p, %s, %p)\n", iface, hParent, fRecurse ? "TRUE" : "FALSE", pcBodies);
746     return E_NOTIMPL;
747 }
748
749 static HRESULT WINAPI MimeMessage_FindFirst(
750     IMimeMessage *iface,
751     LPFINDBODY pFindBody,
752     LPHBODY phBody)
753 {
754     FIXME("(%p)->(%p, %p)\n", iface, pFindBody, phBody);
755     return E_NOTIMPL;
756 }
757
758 static HRESULT WINAPI MimeMessage_FindNext(
759     IMimeMessage *iface,
760     LPFINDBODY pFindBody,
761     LPHBODY phBody)
762 {
763     FIXME("(%p)->(%p, %p)\n", iface, pFindBody, phBody);
764     return E_NOTIMPL;
765 }
766
767 static HRESULT WINAPI MimeMessage_ResolveURL(
768     IMimeMessage *iface,
769     HBODY hRelated,
770     LPCSTR pszBase,
771     LPCSTR pszURL,
772     DWORD dwFlags,
773     LPHBODY phBody)
774 {
775     FIXME("(%p)->(%p, %s, %s, 0x%x, %p)\n", iface, hRelated, pszBase, pszURL, dwFlags, phBody);
776     return E_NOTIMPL;
777 }
778
779 static HRESULT WINAPI MimeMessage_ToMultipart(
780     IMimeMessage *iface,
781     HBODY hBody,
782     LPCSTR pszSubType,
783     LPHBODY phMultipart)
784 {
785     FIXME("(%p)->(%p, %s, %p)\n", iface, hBody, pszSubType, phMultipart);
786     return E_NOTIMPL;
787 }
788
789 static HRESULT WINAPI MimeMessage_GetBodyOffsets(
790     IMimeMessage *iface,
791     HBODY hBody,
792     LPBODYOFFSETS pOffsets)
793 {
794     FIXME("(%p)->(%p, %p)\n", iface, hBody, pOffsets);
795     return E_NOTIMPL;
796 }
797
798 static HRESULT WINAPI MimeMessage_GetCharset(
799     IMimeMessage *iface,
800     LPHCHARSET phCharset)
801 {
802     FIXME("(%p)->(%p)\n", iface, phCharset);
803     return E_NOTIMPL;
804 }
805
806 static HRESULT WINAPI MimeMessage_SetCharset(
807     IMimeMessage *iface,
808     HCHARSET hCharset,
809     CSETAPPLYTYPE applytype)
810 {
811     FIXME("(%p)->(%p, %d)\n", iface, hCharset, applytype);
812     return E_NOTIMPL;
813 }
814
815 static HRESULT WINAPI MimeMessage_IsBodyType(
816     IMimeMessage *iface,
817     HBODY hBody,
818     IMSGBODYTYPE bodytype)
819 {
820     FIXME("(%p)->(%p, %d)\n", iface, hBody, bodytype);
821     return E_NOTIMPL;
822 }
823
824 static HRESULT WINAPI MimeMessage_IsContentType(
825     IMimeMessage *iface,
826     HBODY hBody,
827     LPCSTR pszPriType,
828     LPCSTR pszSubType)
829 {
830     FIXME("(%p)->(%p, %s, %s)\n", iface, hBody, pszPriType, pszSubType);
831     return E_NOTIMPL;
832 }
833
834 static HRESULT WINAPI MimeMessage_QueryBodyProp(
835     IMimeMessage *iface,
836     HBODY hBody,
837     LPCSTR pszName,
838     LPCSTR pszCriteria,
839     boolean fSubString,
840     boolean fCaseSensitive)
841 {
842     FIXME("(%p)->(%p, %s, %s, %s, %s)\n", iface, hBody, pszName, pszCriteria, fSubString ? "TRUE" : "FALSE", fCaseSensitive ? "TRUE" : "FALSE");
843     return E_NOTIMPL;
844 }
845
846 static HRESULT WINAPI MimeMessage_GetBodyProp(
847     IMimeMessage *iface,
848     HBODY hBody,
849     LPCSTR pszName,
850     DWORD dwFlags,
851     LPPROPVARIANT pValue)
852 {
853     FIXME("(%p)->(%p, %s, 0x%x, %p)\n", iface, hBody, pszName, dwFlags, pValue);
854     return E_NOTIMPL;
855 }
856
857 static HRESULT WINAPI MimeMessage_SetBodyProp(
858     IMimeMessage *iface,
859     HBODY hBody,
860     LPCSTR pszName,
861     DWORD dwFlags,
862     LPCPROPVARIANT pValue)
863 {
864     FIXME("(%p)->(%p, %s, 0x%x, %p)\n", iface, hBody, pszName, dwFlags, pValue);
865     return E_NOTIMPL;
866 }
867
868 static HRESULT WINAPI MimeMessage_DeleteBodyProp(
869     IMimeMessage *iface,
870     HBODY hBody,
871     LPCSTR pszName)
872 {
873     FIXME("(%p)->(%p, %s)\n", iface, hBody, pszName);
874     return E_NOTIMPL;
875 }
876
877 static HRESULT WINAPI MimeMessage_SetOption(
878     IMimeMessage *iface,
879     const TYPEDID oid,
880     LPCPROPVARIANT pValue)
881 {
882     FIXME("(%p)->(%d, %p)\n", iface, oid, pValue);
883     return E_NOTIMPL;
884 }
885
886 static HRESULT WINAPI MimeMessage_GetOption(
887     IMimeMessage *iface,
888     const TYPEDID oid,
889     LPPROPVARIANT pValue)
890 {
891     FIXME("(%p)->(%d, %p)\n", iface, oid, pValue);
892     return E_NOTIMPL;
893 }
894
895 /*** IMimeMessage methods ***/
896 static HRESULT WINAPI MimeMessage_CreateWebPage(
897     IMimeMessage *iface,
898     IStream *pRootStm,
899     LPWEBPAGEOPTIONS pOptions,
900     IMimeMessageCallback *pCallback,
901     IMoniker **ppMoniker)
902 {
903     FIXME("(%p)->(%p, %p, %p, %p)\n", iface, pRootStm, pOptions, pCallback, ppMoniker);
904     *ppMoniker = NULL;
905     return E_NOTIMPL;
906 }
907
908 static HRESULT WINAPI MimeMessage_GetProp(
909     IMimeMessage *iface,
910     LPCSTR pszName,
911     DWORD dwFlags,
912     LPPROPVARIANT pValue)
913 {
914     FIXME("(%p)->(%s, 0x%x, %p)\n", iface, pszName, dwFlags, pValue);
915     return E_NOTIMPL;
916 }
917
918 static HRESULT WINAPI MimeMessage_SetProp(
919     IMimeMessage *iface,
920     LPCSTR pszName,
921     DWORD dwFlags,
922     LPCPROPVARIANT pValue)
923 {
924     FIXME("(%p)->(%s, 0x%x, %p)\n", iface, pszName, dwFlags, pValue);
925     return E_NOTIMPL;
926 }
927
928 static HRESULT WINAPI MimeMessage_DeleteProp(
929     IMimeMessage *iface,
930     LPCSTR pszName)
931 {
932     FIXME("(%p)->(%s)\n", iface, pszName);
933     return E_NOTIMPL;
934 }
935
936 static HRESULT WINAPI MimeMessage_QueryProp(
937     IMimeMessage *iface,
938     LPCSTR pszName,
939     LPCSTR pszCriteria,
940     boolean fSubString,
941     boolean fCaseSensitive)
942 {
943     FIXME("(%p)->(%s, %s, %s, %s)\n", iface, pszName, pszCriteria, fSubString ? "TRUE" : "FALSE", fCaseSensitive ? "TRUE" : "FALSE");
944     return E_NOTIMPL;
945 }
946
947 static HRESULT WINAPI MimeMessage_GetTextBody(
948     IMimeMessage *iface,
949     DWORD dwTxtType,
950     ENCODINGTYPE ietEncoding,
951     IStream **pStream,
952     LPHBODY phBody)
953 {
954     FIXME("(%p)->(%d, %d, %p, %p)\n", iface, dwTxtType, ietEncoding, pStream, phBody);
955     return E_NOTIMPL;
956 }
957
958 static HRESULT WINAPI MimeMessage_SetTextBody(
959     IMimeMessage *iface,
960     DWORD dwTxtType,
961     ENCODINGTYPE ietEncoding,
962     HBODY hAlternative,
963     IStream *pStream,
964     LPHBODY phBody)
965 {
966     FIXME("(%p)->(%d, %d, %p, %p, %p)\n", iface, dwTxtType, ietEncoding, hAlternative, pStream, phBody);
967     return E_NOTIMPL;
968 }
969
970 static HRESULT WINAPI MimeMessage_AttachObject(
971     IMimeMessage *iface,
972     REFIID riid,
973     void *pvObject,
974     LPHBODY phBody)
975 {
976     FIXME("(%p)->(%s, %p, %p)\n", iface, debugstr_guid(riid), pvObject, phBody);
977     return E_NOTIMPL;
978 }
979
980 static HRESULT WINAPI MimeMessage_AttachFile(
981     IMimeMessage *iface,
982     LPCSTR pszFilePath,
983     IStream *pstmFile,
984     LPHBODY phBody)
985 {
986     FIXME("(%p)->(%s, %p, %p)\n", iface, pszFilePath, pstmFile, phBody);
987     return E_NOTIMPL;
988 }
989
990 static HRESULT WINAPI MimeMessage_AttachURL(
991     IMimeMessage *iface,
992     LPCSTR pszBase,
993     LPCSTR pszURL,
994     DWORD dwFlags,
995     IStream *pstmURL,
996     LPSTR *ppszCIDURL,
997     LPHBODY phBody)
998 {
999     FIXME("(%p)->(%s, %s, 0x%x, %p, %p, %p)\n", iface, pszBase, pszURL, dwFlags, pstmURL, ppszCIDURL, phBody);
1000     return E_NOTIMPL;
1001 }
1002
1003 static HRESULT WINAPI MimeMessage_GetAttachments(
1004     IMimeMessage *iface,
1005     ULONG *pcAttach,
1006     LPHBODY *pprghAttach)
1007 {
1008     FIXME("(%p)->(%p, %p)\n", iface, pcAttach, pprghAttach);
1009     return E_NOTIMPL;
1010 }
1011
1012 static HRESULT WINAPI MimeMessage_GetAddressTable(
1013     IMimeMessage *iface,
1014     IMimeAddressTable **ppTable)
1015 {
1016     FIXME("(%p)->(%p)\n", iface, ppTable);
1017     return E_NOTIMPL;
1018 }
1019
1020 static HRESULT WINAPI MimeMessage_GetSender(
1021     IMimeMessage *iface,
1022     LPADDRESSPROPS pAddress)
1023 {
1024     FIXME("(%p)->(%p)\n", iface, pAddress);
1025     return E_NOTIMPL;
1026 }
1027
1028 static HRESULT WINAPI MimeMessage_GetAddressTypes(
1029     IMimeMessage *iface,
1030     DWORD dwAdrTypes,
1031     DWORD dwProps,
1032     LPADDRESSLIST pList)
1033 {
1034     FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, dwProps, pList);
1035     return E_NOTIMPL;
1036 }
1037
1038 static HRESULT WINAPI MimeMessage_GetAddressFormat(
1039     IMimeMessage *iface,
1040     DWORD dwAdrTypes,
1041     ADDRESSFORMAT format,
1042     LPSTR *ppszFormat)
1043 {
1044     FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, format, ppszFormat);
1045     return E_NOTIMPL;
1046 }
1047
1048 static HRESULT WINAPI MimeMessage_EnumAddressTypes(
1049     IMimeMessage *iface,
1050     DWORD dwAdrTypes,
1051     DWORD dwProps,
1052     IMimeEnumAddressTypes **ppEnum)
1053 {
1054     FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, dwProps, ppEnum);
1055     return E_NOTIMPL;
1056 }
1057
1058 static HRESULT WINAPI MimeMessage_SplitMessage(
1059     IMimeMessage *iface,
1060     ULONG cbMaxPart,
1061     IMimeMessageParts **ppParts)
1062 {
1063     FIXME("(%p)->(%d, %p)\n", iface, cbMaxPart, ppParts);
1064     return E_NOTIMPL;
1065 }
1066
1067 static HRESULT WINAPI MimeMessage_GetRootMoniker(
1068     IMimeMessage *iface,
1069     IMoniker **ppMoniker)
1070 {
1071     FIXME("(%p)->(%p)\n", iface, ppMoniker);
1072     return E_NOTIMPL;
1073 }
1074
1075 static const IMimeMessageVtbl MimeMessageVtbl =
1076 {
1077     MimeMessage_QueryInterface,
1078     MimeMessage_AddRef,
1079     MimeMessage_Release,
1080     MimeMessage_GetClassID,
1081     MimeMessage_IsDirty,
1082     MimeMessage_Load,
1083     MimeMessage_Save,
1084     MimeMessage_GetSizeMax,
1085     MimeMessage_InitNew,
1086     MimeMessage_GetMessageSource,
1087     MimeMessage_GetMessageSize,
1088     MimeMessage_LoadOffsetTable,
1089     MimeMessage_SaveOffsetTable,
1090     MimeMessage_GetFlags,
1091     MimeMessage_Commit,
1092     MimeMessage_HandsOffStorage,
1093     MimeMessage_BindToObject,
1094     MimeMessage_SaveBody,
1095     MimeMessage_InsertBody,
1096     MimeMessage_GetBody,
1097     MimeMessage_DeleteBody,
1098     MimeMessage_MoveBody,
1099     MimeMessage_CountBodies,
1100     MimeMessage_FindFirst,
1101     MimeMessage_FindNext,
1102     MimeMessage_ResolveURL,
1103     MimeMessage_ToMultipart,
1104     MimeMessage_GetBodyOffsets,
1105     MimeMessage_GetCharset,
1106     MimeMessage_SetCharset,
1107     MimeMessage_IsBodyType,
1108     MimeMessage_IsContentType,
1109     MimeMessage_QueryBodyProp,
1110     MimeMessage_GetBodyProp,
1111     MimeMessage_SetBodyProp,
1112     MimeMessage_DeleteBodyProp,
1113     MimeMessage_SetOption,
1114     MimeMessage_GetOption,
1115     MimeMessage_CreateWebPage,
1116     MimeMessage_GetProp,
1117     MimeMessage_SetProp,
1118     MimeMessage_DeleteProp,
1119     MimeMessage_QueryProp,
1120     MimeMessage_GetTextBody,
1121     MimeMessage_SetTextBody,
1122     MimeMessage_AttachObject,
1123     MimeMessage_AttachFile,
1124     MimeMessage_AttachURL,
1125     MimeMessage_GetAttachments,
1126     MimeMessage_GetAddressTable,
1127     MimeMessage_GetSender,
1128     MimeMessage_GetAddressTypes,
1129     MimeMessage_GetAddressFormat,
1130     MimeMessage_EnumAddressTypes,
1131     MimeMessage_SplitMessage,
1132     MimeMessage_GetRootMoniker,
1133 };
1134
1135 /***********************************************************************
1136  *              MimeOleCreateMessage (INETCOMM.@)
1137  */
1138 HRESULT WINAPI MimeOleCreateMessage(IUnknown *pUnkOuter, IMimeMessage **ppMessage)
1139 {
1140     MimeMessage *This;
1141
1142     TRACE("(%p, %p)\n", pUnkOuter, ppMessage);
1143
1144     if (pUnkOuter)
1145     {
1146         FIXME("outer unknown not supported yet\n");
1147         return E_NOTIMPL;
1148     }
1149
1150     *ppMessage = NULL;
1151
1152     This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
1153     if (!This) return E_OUTOFMEMORY;
1154
1155     This->lpVtbl = &MimeMessageVtbl;
1156     This->refs = 1;
1157
1158     *ppMessage = (IMimeMessage *)&This->lpVtbl;
1159     return S_OK;
1160 }
1161
1162 /***********************************************************************
1163  *              MimeOleSetCompatMode (INETCOMM.@)
1164  */
1165 HRESULT WINAPI MimeOleSetCompatMode(DWORD dwMode)
1166 {
1167     FIXME("(0x%x)\n", dwMode);
1168     return S_OK;
1169 }
1170
1171 /***********************************************************************
1172  *              MimeOleCreateVirtualStream (INETCOMM.@)
1173  */
1174 HRESULT WINAPI MimeOleCreateVirtualStream(IStream **ppStream)
1175 {
1176     HRESULT hr;
1177     FIXME("(%p)\n", ppStream);
1178
1179     hr = CreateStreamOnHGlobal(NULL, TRUE, ppStream);
1180     return hr;
1181 }
1182
1183 typedef struct MimeSecurity
1184 {
1185     const IMimeSecurityVtbl *lpVtbl;
1186
1187     LONG refs;
1188 } MimeSecurity;
1189
1190 static HRESULT WINAPI MimeSecurity_QueryInterface(
1191         IMimeSecurity* iface,
1192         REFIID riid,
1193         void** obj)
1194 {
1195     TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), obj);
1196
1197     if (IsEqualIID(riid, &IID_IUnknown) ||
1198         IsEqualIID(riid, &IID_IMimeSecurity))
1199     {
1200         *obj = iface;
1201         IUnknown_AddRef(iface);
1202         return S_OK;
1203     }
1204
1205     FIXME("no interface for %s\n", debugstr_guid(riid));
1206     *obj = NULL;
1207     return E_NOINTERFACE;
1208 }
1209
1210 static ULONG WINAPI MimeSecurity_AddRef(
1211         IMimeSecurity* iface)
1212 {
1213     MimeSecurity *This = (MimeSecurity *)iface;
1214     TRACE("(%p)->()\n", iface);
1215     return InterlockedIncrement(&This->refs);
1216 }
1217
1218 static ULONG WINAPI MimeSecurity_Release(
1219         IMimeSecurity* iface)
1220 {
1221     MimeSecurity *This = (MimeSecurity *)iface;
1222     ULONG refs;
1223
1224     TRACE("(%p)->()\n", iface);
1225
1226     refs = InterlockedDecrement(&This->refs);
1227     if (!refs)
1228     {
1229         HeapFree(GetProcessHeap(), 0, This);
1230     }
1231
1232     return refs;
1233 }
1234
1235 static HRESULT WINAPI MimeSecurity_InitNew(
1236         IMimeSecurity* iface)
1237 {
1238     FIXME("(%p)->(): stub\n", iface);
1239     return S_OK;
1240 }
1241
1242 static HRESULT WINAPI MimeSecurity_CheckInit(
1243         IMimeSecurity* iface)
1244 {
1245     FIXME("(%p)->(): stub\n", iface);
1246     return E_NOTIMPL;
1247 }
1248
1249 static HRESULT WINAPI MimeSecurity_EncodeMessage(
1250         IMimeSecurity* iface,
1251         IMimeMessageTree* pTree,
1252         DWORD dwFlags)
1253 {
1254     FIXME("(%p)->(%p, %08x): stub\n", iface, pTree, dwFlags);
1255     return E_NOTIMPL;
1256 }
1257
1258 static HRESULT WINAPI MimeSecurity_EncodeBody(
1259         IMimeSecurity* iface,
1260         IMimeMessageTree* pTree,
1261         HBODY hEncodeRoot,
1262         DWORD dwFlags)
1263 {
1264     FIXME("(%p)->(%p, %p, %08x): stub\n", iface, pTree, hEncodeRoot, dwFlags);
1265     return E_NOTIMPL;
1266 }
1267
1268 static HRESULT WINAPI MimeSecurity_DecodeMessage(
1269         IMimeSecurity* iface,
1270         IMimeMessageTree* pTree,
1271         DWORD dwFlags)
1272 {
1273     FIXME("(%p)->(%p, %08x): stub\n", iface, pTree, dwFlags);
1274     return E_NOTIMPL;
1275 }
1276
1277 static HRESULT WINAPI MimeSecurity_DecodeBody(
1278         IMimeSecurity* iface,
1279         IMimeMessageTree* pTree,
1280         HBODY hDecodeRoot,
1281         DWORD dwFlags)
1282 {
1283     FIXME("(%p)->(%p, %p, %08x): stub\n", iface, pTree, hDecodeRoot, dwFlags);
1284     return E_NOTIMPL;
1285 }
1286
1287 static HRESULT WINAPI MimeSecurity_EnumCertificates(
1288         IMimeSecurity* iface,
1289         HCAPICERTSTORE hc,
1290         DWORD dwUsage,
1291         PCX509CERT pPrev,
1292         PCX509CERT* ppCert)
1293 {
1294     FIXME("(%p)->(%p, %08x, %p, %p): stub\n", iface, hc, dwUsage, pPrev, ppCert);
1295     return E_NOTIMPL;
1296 }
1297
1298 static HRESULT WINAPI MimeSecurity_GetCertificateName(
1299         IMimeSecurity* iface,
1300         const PCX509CERT pX509Cert,
1301         const CERTNAMETYPE cn,
1302         LPSTR* ppszName)
1303 {
1304     FIXME("(%p)->(%p, %08x, %p): stub\n", iface, pX509Cert, cn, ppszName);
1305     return E_NOTIMPL;
1306 }
1307
1308 static HRESULT WINAPI MimeSecurity_GetMessageType(
1309         IMimeSecurity* iface,
1310         const HWND hwndParent,
1311         IMimeBody* pBody,
1312         DWORD* pdwSecType)
1313 {
1314     FIXME("(%p)->(%p, %p, %p): stub\n", iface, hwndParent, pBody, pdwSecType);
1315     return E_NOTIMPL;
1316 }
1317
1318 static HRESULT WINAPI MimeSecurity_GetCertData(
1319         IMimeSecurity* iface,
1320         const PCX509CERT pX509Cert,
1321         const CERTDATAID dataid,
1322         LPPROPVARIANT pValue)
1323 {
1324     FIXME("(%p)->(%p, %x, %p): stub\n", iface, pX509Cert, dataid, pValue);
1325     return E_NOTIMPL;
1326 }
1327
1328
1329 static const IMimeSecurityVtbl MimeSecurityVtbl =
1330 {
1331     MimeSecurity_QueryInterface,
1332     MimeSecurity_AddRef,
1333     MimeSecurity_Release,
1334     MimeSecurity_InitNew,
1335     MimeSecurity_CheckInit,
1336     MimeSecurity_EncodeMessage,
1337     MimeSecurity_EncodeBody,
1338     MimeSecurity_DecodeMessage,
1339     MimeSecurity_DecodeBody,
1340     MimeSecurity_EnumCertificates,
1341     MimeSecurity_GetCertificateName,
1342     MimeSecurity_GetMessageType,
1343     MimeSecurity_GetCertData
1344 };
1345
1346 /***********************************************************************
1347  *              MimeOleCreateSecurity (INETCOMM.@)
1348  */
1349 HRESULT WINAPI MimeOleCreateSecurity(IMimeSecurity **ppSecurity)
1350 {
1351     MimeSecurity *This;
1352
1353     TRACE("(%p)\n", ppSecurity);
1354
1355     *ppSecurity = NULL;
1356
1357     This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
1358     if (!This) return E_OUTOFMEMORY;
1359
1360     This->lpVtbl = &MimeSecurityVtbl;
1361     This->refs = 1;
1362
1363     *ppSecurity = (IMimeSecurity *)&This->lpVtbl;
1364     return S_OK;
1365 }