4 * Copyright 2006 Robert Shearman for CodeWeavers
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.
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.
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
33 #include "wine/debug.h"
35 #include "inetcomm_private.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(inetcomm);
39 typedef struct MimeMessage
41 const IMimeMessageVtbl *lpVtbl;
46 static HRESULT WINAPI MimeMessage_QueryInterface(IMimeMessage *iface, REFIID riid, void **ppv)
48 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
50 if (IsEqualIID(riid, &IID_IUnknown) ||
51 IsEqualIID(riid, &IID_IPersist) ||
52 IsEqualIID(riid, &IID_IPersistStreamInit) ||
53 IsEqualIID(riid, &IID_IMimeMessageTree) ||
54 IsEqualIID(riid, &IID_IMimeMessage))
57 IUnknown_AddRef(iface);
61 FIXME("no interface for %s\n", debugstr_guid(riid));
66 static ULONG WINAPI MimeMessage_AddRef(IMimeMessage *iface)
68 MimeMessage *This = (MimeMessage *)iface;
69 TRACE("(%p)->()\n", iface);
70 return InterlockedIncrement(&This->refs);
73 static ULONG WINAPI MimeMessage_Release(IMimeMessage *iface)
75 MimeMessage *This = (MimeMessage *)iface;
78 TRACE("(%p)->()\n", iface);
80 refs = InterlockedDecrement(&This->refs);
83 HeapFree(GetProcessHeap(), 0, This);
89 /*** IPersist methods ***/
90 static HRESULT WINAPI MimeMessage_GetClassID(
94 FIXME("(%p)->(%p)\n", iface, pClassID);
98 /*** IPersistStreamInit methods ***/
99 static HRESULT WINAPI MimeMessage_IsDirty(
102 FIXME("(%p)->()\n", iface);
106 static HRESULT WINAPI MimeMessage_Load(
109 FIXME("(%p)->(%p)\n", iface, pStm);
113 static HRESULT WINAPI MimeMessage_Save(
118 FIXME("(%p)->(%p, %s)\n", iface, pStm, fClearDirty ? "TRUE" : "FALSE");
122 static HRESULT WINAPI MimeMessage_GetSizeMax(
124 ULARGE_INTEGER *pcbSize)
126 FIXME("(%p)->(%p)\n", iface, pcbSize);
130 static HRESULT WINAPI MimeMessage_InitNew(
133 FIXME("(%p)->()\n", iface);
137 /*** IMimeMessageTree methods ***/
138 static HRESULT WINAPI MimeMessage_GetMessageSource(
143 FIXME("(%p)->(%p, 0x%x)\n", iface, ppStream, dwFlags);
147 static HRESULT WINAPI MimeMessage_GetMessageSize(
152 FIXME("(%p)->(%p, 0x%x)\n", iface, pcbSize, dwFlags);
156 static HRESULT WINAPI MimeMessage_LoadOffsetTable(
160 FIXME("(%p)->(%p)\n", iface, pStream);
164 static HRESULT WINAPI MimeMessage_SaveOffsetTable(
169 FIXME("(%p)->(%p, 0x%x)\n", iface, pStream, dwFlags);
174 static HRESULT WINAPI MimeMessage_GetFlags(
178 FIXME("(%p)->(%p)\n", iface, pdwFlags);
182 static HRESULT WINAPI MimeMessage_Commit(
186 FIXME("(%p)->(0x%x)\n", iface, dwFlags);
191 static HRESULT WINAPI MimeMessage_HandsOffStorage(
194 FIXME("(%p)->()\n", iface);
198 static HRESULT WINAPI MimeMessage_BindToObject(
204 FIXME("(%p)->(%p, %s, %p)\n", iface, hBody, debugstr_guid(riid), ppvObject);
208 static HRESULT WINAPI MimeMessage_SaveBody(
214 FIXME("(%p)->(%p, 0x%x, %p)\n", iface, hBody, dwFlags, pStream);
218 static HRESULT WINAPI MimeMessage_InsertBody(
220 BODYLOCATION location,
224 FIXME("(%p)->(%d, %p, %p)\n", iface, location, hPivot, phBody);
228 static HRESULT WINAPI MimeMessage_GetBody(
230 BODYLOCATION location,
234 FIXME("(%p)->(%d, %p, %p)\n", iface, location, hPivot, phBody);
238 static HRESULT WINAPI MimeMessage_DeleteBody(
243 FIXME("(%p)->(%p, %08x)\n", iface, hBody, dwFlags);
247 static HRESULT WINAPI MimeMessage_MoveBody(
250 BODYLOCATION location)
252 FIXME("(%p)->(%d)\n", iface, location);
256 static HRESULT WINAPI MimeMessage_CountBodies(
262 FIXME("(%p)->(%p, %s, %p)\n", iface, hParent, fRecurse ? "TRUE" : "FALSE", pcBodies);
266 static HRESULT WINAPI MimeMessage_FindFirst(
268 LPFINDBODY pFindBody,
271 FIXME("(%p)->(%p, %p)\n", iface, pFindBody, phBody);
275 static HRESULT WINAPI MimeMessage_FindNext(
277 LPFINDBODY pFindBody,
280 FIXME("(%p)->(%p, %p)\n", iface, pFindBody, phBody);
284 static HRESULT WINAPI MimeMessage_ResolveURL(
292 FIXME("(%p)->(%p, %s, %s, 0x%x, %p)\n", iface, hRelated, pszBase, pszURL, dwFlags, phBody);
296 static HRESULT WINAPI MimeMessage_ToMultipart(
302 FIXME("(%p)->(%p, %s, %p)\n", iface, hBody, pszSubType, phMultipart);
306 static HRESULT WINAPI MimeMessage_GetBodyOffsets(
309 LPBODYOFFSETS pOffsets)
311 FIXME("(%p)->(%p, %p)\n", iface, hBody, pOffsets);
315 static HRESULT WINAPI MimeMessage_GetCharset(
317 LPHCHARSET phCharset)
319 FIXME("(%p)->(%p)\n", iface, phCharset);
323 static HRESULT WINAPI MimeMessage_SetCharset(
326 CSETAPPLYTYPE applytype)
328 FIXME("(%p)->(%p, %d)\n", iface, hCharset, applytype);
332 static HRESULT WINAPI MimeMessage_IsBodyType(
335 IMSGBODYTYPE bodytype)
337 FIXME("(%p)->(%p, %d)\n", iface, hBody, bodytype);
341 static HRESULT WINAPI MimeMessage_IsContentType(
347 FIXME("(%p)->(%p, %s, %s)\n", iface, hBody, pszPriType, pszSubType);
351 static HRESULT WINAPI MimeMessage_QueryBodyProp(
357 boolean fCaseSensitive)
359 FIXME("(%p)->(%p, %s, %s, %s, %s)\n", iface, hBody, pszName, pszCriteria, fSubString ? "TRUE" : "FALSE", fCaseSensitive ? "TRUE" : "FALSE");
363 static HRESULT WINAPI MimeMessage_GetBodyProp(
368 LPPROPVARIANT pValue)
370 FIXME("(%p)->(%p, %s, 0x%x, %p)\n", iface, hBody, pszName, dwFlags, pValue);
374 static HRESULT WINAPI MimeMessage_SetBodyProp(
379 LPCPROPVARIANT pValue)
381 FIXME("(%p)->(%p, %s, 0x%x, %p)\n", iface, hBody, pszName, dwFlags, pValue);
385 static HRESULT WINAPI MimeMessage_DeleteBodyProp(
390 FIXME("(%p)->(%p, %s)\n", iface, hBody, pszName);
394 static HRESULT WINAPI MimeMessage_SetOption(
397 LPCPROPVARIANT pValue)
399 FIXME("(%p)->(%d, %p)\n", iface, oid, pValue);
403 static HRESULT WINAPI MimeMessage_GetOption(
406 LPPROPVARIANT pValue)
408 FIXME("(%p)->(%d, %p)\n", iface, oid, pValue);
412 /*** IMimeMessage methods ***/
413 static HRESULT WINAPI MimeMessage_CreateWebPage(
416 LPWEBPAGEOPTIONS pOptions,
417 IMimeMessageCallback *pCallback,
418 IMoniker **ppMoniker)
420 FIXME("(%p)->(%p, %p, %p, %p)\n", iface, pRootStm, pOptions, pCallback, ppMoniker);
425 static HRESULT WINAPI MimeMessage_GetProp(
429 LPPROPVARIANT pValue)
431 FIXME("(%p)->(%s, 0x%x, %p)\n", iface, pszName, dwFlags, pValue);
435 static HRESULT WINAPI MimeMessage_SetProp(
439 LPCPROPVARIANT pValue)
441 FIXME("(%p)->(%s, 0x%x, %p)\n", iface, pszName, dwFlags, pValue);
445 static HRESULT WINAPI MimeMessage_DeleteProp(
449 FIXME("(%p)->(%s)\n", iface, pszName);
453 static HRESULT WINAPI MimeMessage_QueryProp(
458 boolean fCaseSensitive)
460 FIXME("(%p)->(%s, %s, %s, %s)\n", iface, pszName, pszCriteria, fSubString ? "TRUE" : "FALSE", fCaseSensitive ? "TRUE" : "FALSE");
464 static HRESULT WINAPI MimeMessage_GetTextBody(
467 ENCODINGTYPE ietEncoding,
471 FIXME("(%p)->(%d, %d, %p, %p)\n", iface, dwTxtType, ietEncoding, pStream, phBody);
475 static HRESULT WINAPI MimeMessage_SetTextBody(
478 ENCODINGTYPE ietEncoding,
483 FIXME("(%p)->(%d, %d, %p, %p, %p)\n", iface, dwTxtType, ietEncoding, hAlternative, pStream, phBody);
487 static HRESULT WINAPI MimeMessage_AttachObject(
493 FIXME("(%p)->(%s, %p, %p)\n", iface, debugstr_guid(riid), pvObject, phBody);
497 static HRESULT WINAPI MimeMessage_AttachFile(
503 FIXME("(%p)->(%s, %p, %p)\n", iface, pszFilePath, pstmFile, phBody);
507 static HRESULT WINAPI MimeMessage_AttachURL(
516 FIXME("(%p)->(%s, %s, 0x%x, %p, %p, %p)\n", iface, pszBase, pszURL, dwFlags, pstmURL, ppszCIDURL, phBody);
520 static HRESULT WINAPI MimeMessage_GetAttachments(
523 LPHBODY *pprghAttach)
525 FIXME("(%p)->(%p, %p)\n", iface, pcAttach, pprghAttach);
529 static HRESULT WINAPI MimeMessage_GetAddressTable(
531 IMimeAddressTable **ppTable)
533 FIXME("(%p)->(%p)\n", iface, ppTable);
537 static HRESULT WINAPI MimeMessage_GetSender(
539 LPADDRESSPROPS pAddress)
541 FIXME("(%p)->(%p)\n", iface, pAddress);
545 static HRESULT WINAPI MimeMessage_GetAddressTypes(
551 FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, dwProps, pList);
555 static HRESULT WINAPI MimeMessage_GetAddressFormat(
558 ADDRESSFORMAT format,
561 FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, format, ppszFormat);
565 static HRESULT WINAPI MimeMessage_EnumAddressTypes(
569 IMimeEnumAddressTypes **ppEnum)
571 FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, dwProps, ppEnum);
575 static HRESULT WINAPI MimeMessage_SplitMessage(
578 IMimeMessageParts **ppParts)
580 FIXME("(%p)->(%d, %p)\n", iface, cbMaxPart, ppParts);
584 static HRESULT WINAPI MimeMessage_GetRootMoniker(
586 IMoniker **ppMoniker)
588 FIXME("(%p)->(%p)\n", iface, ppMoniker);
592 static const IMimeMessageVtbl MimeMessageVtbl =
594 MimeMessage_QueryInterface,
597 MimeMessage_GetClassID,
601 MimeMessage_GetSizeMax,
603 MimeMessage_GetMessageSource,
604 MimeMessage_GetMessageSize,
605 MimeMessage_LoadOffsetTable,
606 MimeMessage_SaveOffsetTable,
607 MimeMessage_GetFlags,
609 MimeMessage_HandsOffStorage,
610 MimeMessage_BindToObject,
611 MimeMessage_SaveBody,
612 MimeMessage_InsertBody,
614 MimeMessage_DeleteBody,
615 MimeMessage_MoveBody,
616 MimeMessage_CountBodies,
617 MimeMessage_FindFirst,
618 MimeMessage_FindNext,
619 MimeMessage_ResolveURL,
620 MimeMessage_ToMultipart,
621 MimeMessage_GetBodyOffsets,
622 MimeMessage_GetCharset,
623 MimeMessage_SetCharset,
624 MimeMessage_IsBodyType,
625 MimeMessage_IsContentType,
626 MimeMessage_QueryBodyProp,
627 MimeMessage_GetBodyProp,
628 MimeMessage_SetBodyProp,
629 MimeMessage_DeleteBodyProp,
630 MimeMessage_SetOption,
631 MimeMessage_GetOption,
632 MimeMessage_CreateWebPage,
635 MimeMessage_DeleteProp,
636 MimeMessage_QueryProp,
637 MimeMessage_GetTextBody,
638 MimeMessage_SetTextBody,
639 MimeMessage_AttachObject,
640 MimeMessage_AttachFile,
641 MimeMessage_AttachURL,
642 MimeMessage_GetAttachments,
643 MimeMessage_GetAddressTable,
644 MimeMessage_GetSender,
645 MimeMessage_GetAddressTypes,
646 MimeMessage_GetAddressFormat,
647 MimeMessage_EnumAddressTypes,
648 MimeMessage_SplitMessage,
649 MimeMessage_GetRootMoniker,
652 /***********************************************************************
653 * MimeOleCreateMessage (INETCOMM.@)
655 HRESULT WINAPI MimeOleCreateMessage(IUnknown *pUnkOuter, IMimeMessage **ppMessage)
659 TRACE("(%p, %p)\n", pUnkOuter, ppMessage);
663 FIXME("outer unknown not supported yet\n");
669 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
670 if (!This) return E_OUTOFMEMORY;
672 This->lpVtbl = &MimeMessageVtbl;
675 *ppMessage = (IMimeMessage *)&This->lpVtbl;
679 /***********************************************************************
680 * MimeOleSetCompatMode (INETCOMM.@)
682 HRESULT WINAPI MimeOleSetCompatMode(DWORD dwMode)
684 FIXME("(0x%x)\n", dwMode);
688 /***********************************************************************
689 * MimeOleCreateVirtualStream (INETCOMM.@)
691 HRESULT WINAPI MimeOleCreateVirtualStream(IStream **ppStream)
694 FIXME("(%p)\n", ppStream);
696 hr = CreateStreamOnHGlobal(NULL, TRUE, ppStream);
700 typedef struct MimeSecurity
702 const IMimeSecurityVtbl *lpVtbl;
707 static HRESULT WINAPI MimeSecurity_QueryInterface(
708 IMimeSecurity* iface,
712 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), obj);
714 if (IsEqualIID(riid, &IID_IUnknown) ||
715 IsEqualIID(riid, &IID_IMimeSecurity))
718 IUnknown_AddRef(iface);
722 FIXME("no interface for %s\n", debugstr_guid(riid));
724 return E_NOINTERFACE;
727 static ULONG WINAPI MimeSecurity_AddRef(
728 IMimeSecurity* iface)
730 MimeSecurity *This = (MimeSecurity *)iface;
731 TRACE("(%p)->()\n", iface);
732 return InterlockedIncrement(&This->refs);
735 static ULONG WINAPI MimeSecurity_Release(
736 IMimeSecurity* iface)
738 MimeSecurity *This = (MimeSecurity *)iface;
741 TRACE("(%p)->()\n", iface);
743 refs = InterlockedDecrement(&This->refs);
746 HeapFree(GetProcessHeap(), 0, This);
752 static HRESULT WINAPI MimeSecurity_InitNew(
753 IMimeSecurity* iface)
755 FIXME("(%p)->(): stub\n", iface);
759 static HRESULT WINAPI MimeSecurity_CheckInit(
760 IMimeSecurity* iface)
762 FIXME("(%p)->(): stub\n", iface);
766 static HRESULT WINAPI MimeSecurity_EncodeMessage(
767 IMimeSecurity* iface,
768 IMimeMessageTree* pTree,
771 FIXME("(%p)->(%p, %08x): stub\n", iface, pTree, dwFlags);
775 static HRESULT WINAPI MimeSecurity_EncodeBody(
776 IMimeSecurity* iface,
777 IMimeMessageTree* pTree,
781 FIXME("(%p)->(%p, %p, %08x): stub\n", iface, pTree, hEncodeRoot, dwFlags);
785 static HRESULT WINAPI MimeSecurity_DecodeMessage(
786 IMimeSecurity* iface,
787 IMimeMessageTree* pTree,
790 FIXME("(%p)->(%p, %08x): stub\n", iface, pTree, dwFlags);
794 static HRESULT WINAPI MimeSecurity_DecodeBody(
795 IMimeSecurity* iface,
796 IMimeMessageTree* pTree,
800 FIXME("(%p)->(%p, %p, %08x): stub\n", iface, pTree, hDecodeRoot, dwFlags);
804 static HRESULT WINAPI MimeSecurity_EnumCertificates(
805 IMimeSecurity* iface,
811 FIXME("(%p)->(%p, %08x, %p, %p): stub\n", iface, hc, dwUsage, pPrev, ppCert);
815 static HRESULT WINAPI MimeSecurity_GetCertificateName(
816 IMimeSecurity* iface,
817 const PCX509CERT pX509Cert,
818 const CERTNAMETYPE cn,
821 FIXME("(%p)->(%p, %08x, %p): stub\n", iface, pX509Cert, cn, ppszName);
825 static HRESULT WINAPI MimeSecurity_GetMessageType(
826 IMimeSecurity* iface,
827 const HWND hwndParent,
831 FIXME("(%p)->(%p, %p, %p): stub\n", iface, hwndParent, pBody, pdwSecType);
835 static HRESULT WINAPI MimeSecurity_GetCertData(
836 IMimeSecurity* iface,
837 const PCX509CERT pX509Cert,
838 const CERTDATAID dataid,
839 LPPROPVARIANT pValue)
841 FIXME("(%p)->(%p, %x, %p): stub\n", iface, pX509Cert, dataid, pValue);
846 static const IMimeSecurityVtbl MimeSecurityVtbl =
848 MimeSecurity_QueryInterface,
850 MimeSecurity_Release,
851 MimeSecurity_InitNew,
852 MimeSecurity_CheckInit,
853 MimeSecurity_EncodeMessage,
854 MimeSecurity_EncodeBody,
855 MimeSecurity_DecodeMessage,
856 MimeSecurity_DecodeBody,
857 MimeSecurity_EnumCertificates,
858 MimeSecurity_GetCertificateName,
859 MimeSecurity_GetMessageType,
860 MimeSecurity_GetCertData
863 /***********************************************************************
864 * MimeOleCreateSecurity (INETCOMM.@)
866 HRESULT WINAPI MimeOleCreateSecurity(IMimeSecurity **ppSecurity)
870 TRACE("(%p)\n", ppSecurity);
874 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
875 if (!This) return E_OUTOFMEMORY;
877 This->lpVtbl = &MimeSecurityVtbl;
880 *ppSecurity = (IMimeSecurity *)&This->lpVtbl;