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/debug.h"
36 #include "inetcomm_private.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(inetcomm);
40 typedef struct MimeBody
42 const IMimeBodyVtbl *lpVtbl;
48 static inline MimeBody *impl_from_IMimeBody( IMimeBody *iface )
50 return (MimeBody *)((char*)iface - FIELD_OFFSET(MimeBody, lpVtbl));
53 #define PARSER_BUF_SIZE 1024
55 /*****************************************************
56 * copy_headers_to_buf [internal]
58 * Copies the headers into a '\0' terminated memory block and leave
59 * the stream's current position set to after the blank line.
61 static HRESULT copy_headers_to_buf(IStream *stm, char **ptr)
64 DWORD size = PARSER_BUF_SIZE, offset = 0, last_end = 0;
76 buf = HeapAlloc(GetProcessHeap(), 0, size + 1);
80 buf = HeapReAlloc(GetProcessHeap(), 0, buf, size + 1);
88 hr = IStream_Read(stm, buf + offset, size - offset, &read);
89 if(FAILED(hr)) goto fail;
94 if(read == 0) done = 1;
96 while(!done && (end = strstr(buf + last_end, "\r\n")))
98 DWORD new_end = end - buf + 2;
99 if(new_end - last_end == 2)
102 off.QuadPart = new_end;
103 IStream_Seek(stm, off, STREAM_SEEK_SET, NULL);
116 HeapFree(GetProcessHeap(), 0, buf);
120 static HRESULT parse_headers(MimeBody *body, IStream *stm)
125 hr = copy_headers_to_buf(stm, &header_buf);
126 if(FAILED(hr)) return hr;
128 HeapFree(GetProcessHeap(), 0, header_buf);
133 static HRESULT WINAPI MimeBody_QueryInterface(IMimeBody* iface,
137 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppvObject);
141 if (IsEqualIID(riid, &IID_IUnknown) ||
142 IsEqualIID(riid, &IID_IPersist) ||
143 IsEqualIID(riid, &IID_IPersistStreamInit) ||
144 IsEqualIID(riid, &IID_IMimePropertySet) ||
145 IsEqualIID(riid, &IID_IMimeBody))
152 IUnknown_AddRef((IUnknown*)*ppvObject);
156 FIXME("no interface for %s\n", debugstr_guid(riid));
157 return E_NOINTERFACE;
160 static ULONG WINAPI MimeBody_AddRef(IMimeBody* iface)
162 MimeBody *This = impl_from_IMimeBody(iface);
163 TRACE("(%p)->()\n", iface);
164 return InterlockedIncrement(&This->refs);
167 static ULONG WINAPI MimeBody_Release(IMimeBody* iface)
169 MimeBody *This = impl_from_IMimeBody(iface);
172 TRACE("(%p)->()\n", iface);
174 refs = InterlockedDecrement(&This->refs);
177 HeapFree(GetProcessHeap(), 0, This);
183 static HRESULT WINAPI MimeBody_GetClassID(
192 static HRESULT WINAPI MimeBody_IsDirty(
199 static HRESULT WINAPI MimeBody_Load(
203 MimeBody *This = impl_from_IMimeBody(iface);
204 TRACE("(%p)->(%p)\n", iface, pStm);
205 return parse_headers(This, pStm);
208 static HRESULT WINAPI MimeBody_Save(
217 static HRESULT WINAPI MimeBody_GetSizeMax(
219 ULARGE_INTEGER* pcbSize)
225 static HRESULT WINAPI MimeBody_InitNew(
228 TRACE("%p->()\n", iface);
232 static HRESULT WINAPI MimeBody_GetPropInfo(
235 LPMIMEPROPINFO pInfo)
241 static HRESULT WINAPI MimeBody_SetPropInfo(
244 LPCMIMEPROPINFO pInfo)
250 static HRESULT WINAPI MimeBody_GetProp(
254 LPPROPVARIANT pValue)
260 static HRESULT WINAPI MimeBody_SetProp(
264 LPCPROPVARIANT pValue)
270 static HRESULT WINAPI MimeBody_AppendProp(
274 LPPROPVARIANT pValue)
280 static HRESULT WINAPI MimeBody_DeleteProp(
288 static HRESULT WINAPI MimeBody_CopyProps(
292 IMimePropertySet* pPropertySet)
298 static HRESULT WINAPI MimeBody_MoveProps(
302 IMimePropertySet* pPropertySet)
308 static HRESULT WINAPI MimeBody_DeleteExcept(
317 static HRESULT WINAPI MimeBody_QueryProp(
322 boolean fCaseSensitive)
328 static HRESULT WINAPI MimeBody_GetCharset(
330 LPHCHARSET phCharset)
336 static HRESULT WINAPI MimeBody_SetCharset(
339 CSETAPPLYTYPE applytype)
345 static HRESULT WINAPI MimeBody_GetParameters(
349 LPMIMEPARAMINFO* pprgParam)
355 static HRESULT WINAPI MimeBody_IsContentType(
364 static HRESULT WINAPI MimeBody_BindToObject(
373 static HRESULT WINAPI MimeBody_Clone(
375 IMimePropertySet** ppPropertySet)
381 static HRESULT WINAPI MimeBody_SetOption(
384 LPCPROPVARIANT pValue)
390 static HRESULT WINAPI MimeBody_GetOption(
393 LPPROPVARIANT pValue)
399 static HRESULT WINAPI MimeBody_EnumProps(
402 IMimeEnumProperties** ppEnum)
408 static HRESULT WINAPI MimeBody_IsType(
410 IMSGBODYTYPE bodytype)
416 static HRESULT WINAPI MimeBody_SetDisplayName(
424 static HRESULT WINAPI MimeBody_GetDisplayName(
432 static HRESULT WINAPI MimeBody_GetOffsets(
434 LPBODYOFFSETS pOffsets)
440 static HRESULT WINAPI MimeBody_GetCurrentEncoding(
442 ENCODINGTYPE* pietEncoding)
448 static HRESULT WINAPI MimeBody_SetCurrentEncoding(
450 ENCODINGTYPE ietEncoding)
456 static HRESULT WINAPI MimeBody_GetEstimatedSize(
458 ENCODINGTYPE ietEncoding,
465 static HRESULT WINAPI MimeBody_GetDataHere(
467 ENCODINGTYPE ietEncoding,
474 static HRESULT WINAPI MimeBody_GetData(
476 ENCODINGTYPE ietEncoding,
483 static HRESULT WINAPI MimeBody_SetData(
485 ENCODINGTYPE ietEncoding,
495 static HRESULT WINAPI MimeBody_EmptyData(
502 static HRESULT WINAPI MimeBody_CopyTo(
510 static HRESULT WINAPI MimeBody_GetTransmitInfo(
512 LPTRANSMITINFO pTransmitInfo)
518 static HRESULT WINAPI MimeBody_SaveToFile(
520 ENCODINGTYPE ietEncoding,
527 static HRESULT WINAPI MimeBody_GetHandle(
531 MimeBody *This = impl_from_IMimeBody(iface);
532 TRACE("(%p)->(%p)\n", iface, phBody);
534 *phBody = This->handle;
535 return This->handle ? S_OK : MIME_E_NO_DATA;
538 static IMimeBodyVtbl body_vtbl =
540 MimeBody_QueryInterface,
549 MimeBody_GetPropInfo,
550 MimeBody_SetPropInfo,
557 MimeBody_DeleteExcept,
561 MimeBody_GetParameters,
562 MimeBody_IsContentType,
563 MimeBody_BindToObject,
569 MimeBody_SetDisplayName,
570 MimeBody_GetDisplayName,
572 MimeBody_GetCurrentEncoding,
573 MimeBody_SetCurrentEncoding,
574 MimeBody_GetEstimatedSize,
575 MimeBody_GetDataHere,
580 MimeBody_GetTransmitInfo,
585 HRESULT MimeBody_create(IUnknown *outer, void **obj)
591 if(outer) return CLASS_E_NOAGGREGATION;
593 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
594 if (!This) return E_OUTOFMEMORY;
596 This->lpVtbl = &body_vtbl;
600 *obj = (IMimeBody *)&This->lpVtbl;
604 typedef struct MimeMessage
606 const IMimeMessageVtbl *lpVtbl;
611 static HRESULT WINAPI MimeMessage_QueryInterface(IMimeMessage *iface, REFIID riid, void **ppv)
613 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
615 if (IsEqualIID(riid, &IID_IUnknown) ||
616 IsEqualIID(riid, &IID_IPersist) ||
617 IsEqualIID(riid, &IID_IPersistStreamInit) ||
618 IsEqualIID(riid, &IID_IMimeMessageTree) ||
619 IsEqualIID(riid, &IID_IMimeMessage))
622 IUnknown_AddRef(iface);
626 FIXME("no interface for %s\n", debugstr_guid(riid));
628 return E_NOINTERFACE;
631 static ULONG WINAPI MimeMessage_AddRef(IMimeMessage *iface)
633 MimeMessage *This = (MimeMessage *)iface;
634 TRACE("(%p)->()\n", iface);
635 return InterlockedIncrement(&This->refs);
638 static ULONG WINAPI MimeMessage_Release(IMimeMessage *iface)
640 MimeMessage *This = (MimeMessage *)iface;
643 TRACE("(%p)->()\n", iface);
645 refs = InterlockedDecrement(&This->refs);
648 HeapFree(GetProcessHeap(), 0, This);
654 /*** IPersist methods ***/
655 static HRESULT WINAPI MimeMessage_GetClassID(
659 FIXME("(%p)->(%p)\n", iface, pClassID);
663 /*** IPersistStreamInit methods ***/
664 static HRESULT WINAPI MimeMessage_IsDirty(
667 FIXME("(%p)->()\n", iface);
671 static HRESULT WINAPI MimeMessage_Load(
674 FIXME("(%p)->(%p)\n", iface, pStm);
678 static HRESULT WINAPI MimeMessage_Save(
683 FIXME("(%p)->(%p, %s)\n", iface, pStm, fClearDirty ? "TRUE" : "FALSE");
687 static HRESULT WINAPI MimeMessage_GetSizeMax(
689 ULARGE_INTEGER *pcbSize)
691 FIXME("(%p)->(%p)\n", iface, pcbSize);
695 static HRESULT WINAPI MimeMessage_InitNew(
698 FIXME("(%p)->()\n", iface);
702 /*** IMimeMessageTree methods ***/
703 static HRESULT WINAPI MimeMessage_GetMessageSource(
708 FIXME("(%p)->(%p, 0x%x)\n", iface, ppStream, dwFlags);
712 static HRESULT WINAPI MimeMessage_GetMessageSize(
717 FIXME("(%p)->(%p, 0x%x)\n", iface, pcbSize, dwFlags);
721 static HRESULT WINAPI MimeMessage_LoadOffsetTable(
725 FIXME("(%p)->(%p)\n", iface, pStream);
729 static HRESULT WINAPI MimeMessage_SaveOffsetTable(
734 FIXME("(%p)->(%p, 0x%x)\n", iface, pStream, dwFlags);
739 static HRESULT WINAPI MimeMessage_GetFlags(
743 FIXME("(%p)->(%p)\n", iface, pdwFlags);
747 static HRESULT WINAPI MimeMessage_Commit(
751 FIXME("(%p)->(0x%x)\n", iface, dwFlags);
756 static HRESULT WINAPI MimeMessage_HandsOffStorage(
759 FIXME("(%p)->()\n", iface);
763 static HRESULT WINAPI MimeMessage_BindToObject(
769 FIXME("(%p)->(%p, %s, %p)\n", iface, hBody, debugstr_guid(riid), ppvObject);
773 static HRESULT WINAPI MimeMessage_SaveBody(
779 FIXME("(%p)->(%p, 0x%x, %p)\n", iface, hBody, dwFlags, pStream);
783 static HRESULT WINAPI MimeMessage_InsertBody(
785 BODYLOCATION location,
789 FIXME("(%p)->(%d, %p, %p)\n", iface, location, hPivot, phBody);
793 static HRESULT WINAPI MimeMessage_GetBody(
795 BODYLOCATION location,
799 FIXME("(%p)->(%d, %p, %p)\n", iface, location, hPivot, phBody);
803 static HRESULT WINAPI MimeMessage_DeleteBody(
808 FIXME("(%p)->(%p, %08x)\n", iface, hBody, dwFlags);
812 static HRESULT WINAPI MimeMessage_MoveBody(
815 BODYLOCATION location)
817 FIXME("(%p)->(%d)\n", iface, location);
821 static HRESULT WINAPI MimeMessage_CountBodies(
827 FIXME("(%p)->(%p, %s, %p)\n", iface, hParent, fRecurse ? "TRUE" : "FALSE", pcBodies);
831 static HRESULT WINAPI MimeMessage_FindFirst(
833 LPFINDBODY pFindBody,
836 FIXME("(%p)->(%p, %p)\n", iface, pFindBody, phBody);
840 static HRESULT WINAPI MimeMessage_FindNext(
842 LPFINDBODY pFindBody,
845 FIXME("(%p)->(%p, %p)\n", iface, pFindBody, phBody);
849 static HRESULT WINAPI MimeMessage_ResolveURL(
857 FIXME("(%p)->(%p, %s, %s, 0x%x, %p)\n", iface, hRelated, pszBase, pszURL, dwFlags, phBody);
861 static HRESULT WINAPI MimeMessage_ToMultipart(
867 FIXME("(%p)->(%p, %s, %p)\n", iface, hBody, pszSubType, phMultipart);
871 static HRESULT WINAPI MimeMessage_GetBodyOffsets(
874 LPBODYOFFSETS pOffsets)
876 FIXME("(%p)->(%p, %p)\n", iface, hBody, pOffsets);
880 static HRESULT WINAPI MimeMessage_GetCharset(
882 LPHCHARSET phCharset)
884 FIXME("(%p)->(%p)\n", iface, phCharset);
888 static HRESULT WINAPI MimeMessage_SetCharset(
891 CSETAPPLYTYPE applytype)
893 FIXME("(%p)->(%p, %d)\n", iface, hCharset, applytype);
897 static HRESULT WINAPI MimeMessage_IsBodyType(
900 IMSGBODYTYPE bodytype)
902 FIXME("(%p)->(%p, %d)\n", iface, hBody, bodytype);
906 static HRESULT WINAPI MimeMessage_IsContentType(
912 FIXME("(%p)->(%p, %s, %s)\n", iface, hBody, pszPriType, pszSubType);
916 static HRESULT WINAPI MimeMessage_QueryBodyProp(
922 boolean fCaseSensitive)
924 FIXME("(%p)->(%p, %s, %s, %s, %s)\n", iface, hBody, pszName, pszCriteria, fSubString ? "TRUE" : "FALSE", fCaseSensitive ? "TRUE" : "FALSE");
928 static HRESULT WINAPI MimeMessage_GetBodyProp(
933 LPPROPVARIANT pValue)
935 FIXME("(%p)->(%p, %s, 0x%x, %p)\n", iface, hBody, pszName, dwFlags, pValue);
939 static HRESULT WINAPI MimeMessage_SetBodyProp(
944 LPCPROPVARIANT pValue)
946 FIXME("(%p)->(%p, %s, 0x%x, %p)\n", iface, hBody, pszName, dwFlags, pValue);
950 static HRESULT WINAPI MimeMessage_DeleteBodyProp(
955 FIXME("(%p)->(%p, %s)\n", iface, hBody, pszName);
959 static HRESULT WINAPI MimeMessage_SetOption(
962 LPCPROPVARIANT pValue)
964 FIXME("(%p)->(%d, %p)\n", iface, oid, pValue);
968 static HRESULT WINAPI MimeMessage_GetOption(
971 LPPROPVARIANT pValue)
973 FIXME("(%p)->(%d, %p)\n", iface, oid, pValue);
977 /*** IMimeMessage methods ***/
978 static HRESULT WINAPI MimeMessage_CreateWebPage(
981 LPWEBPAGEOPTIONS pOptions,
982 IMimeMessageCallback *pCallback,
983 IMoniker **ppMoniker)
985 FIXME("(%p)->(%p, %p, %p, %p)\n", iface, pRootStm, pOptions, pCallback, ppMoniker);
990 static HRESULT WINAPI MimeMessage_GetProp(
994 LPPROPVARIANT pValue)
996 FIXME("(%p)->(%s, 0x%x, %p)\n", iface, pszName, dwFlags, pValue);
1000 static HRESULT WINAPI MimeMessage_SetProp(
1001 IMimeMessage *iface,
1004 LPCPROPVARIANT pValue)
1006 FIXME("(%p)->(%s, 0x%x, %p)\n", iface, pszName, dwFlags, pValue);
1010 static HRESULT WINAPI MimeMessage_DeleteProp(
1011 IMimeMessage *iface,
1014 FIXME("(%p)->(%s)\n", iface, pszName);
1018 static HRESULT WINAPI MimeMessage_QueryProp(
1019 IMimeMessage *iface,
1023 boolean fCaseSensitive)
1025 FIXME("(%p)->(%s, %s, %s, %s)\n", iface, pszName, pszCriteria, fSubString ? "TRUE" : "FALSE", fCaseSensitive ? "TRUE" : "FALSE");
1029 static HRESULT WINAPI MimeMessage_GetTextBody(
1030 IMimeMessage *iface,
1032 ENCODINGTYPE ietEncoding,
1036 FIXME("(%p)->(%d, %d, %p, %p)\n", iface, dwTxtType, ietEncoding, pStream, phBody);
1040 static HRESULT WINAPI MimeMessage_SetTextBody(
1041 IMimeMessage *iface,
1043 ENCODINGTYPE ietEncoding,
1048 FIXME("(%p)->(%d, %d, %p, %p, %p)\n", iface, dwTxtType, ietEncoding, hAlternative, pStream, phBody);
1052 static HRESULT WINAPI MimeMessage_AttachObject(
1053 IMimeMessage *iface,
1058 FIXME("(%p)->(%s, %p, %p)\n", iface, debugstr_guid(riid), pvObject, phBody);
1062 static HRESULT WINAPI MimeMessage_AttachFile(
1063 IMimeMessage *iface,
1068 FIXME("(%p)->(%s, %p, %p)\n", iface, pszFilePath, pstmFile, phBody);
1072 static HRESULT WINAPI MimeMessage_AttachURL(
1073 IMimeMessage *iface,
1081 FIXME("(%p)->(%s, %s, 0x%x, %p, %p, %p)\n", iface, pszBase, pszURL, dwFlags, pstmURL, ppszCIDURL, phBody);
1085 static HRESULT WINAPI MimeMessage_GetAttachments(
1086 IMimeMessage *iface,
1088 LPHBODY *pprghAttach)
1090 FIXME("(%p)->(%p, %p)\n", iface, pcAttach, pprghAttach);
1094 static HRESULT WINAPI MimeMessage_GetAddressTable(
1095 IMimeMessage *iface,
1096 IMimeAddressTable **ppTable)
1098 FIXME("(%p)->(%p)\n", iface, ppTable);
1102 static HRESULT WINAPI MimeMessage_GetSender(
1103 IMimeMessage *iface,
1104 LPADDRESSPROPS pAddress)
1106 FIXME("(%p)->(%p)\n", iface, pAddress);
1110 static HRESULT WINAPI MimeMessage_GetAddressTypes(
1111 IMimeMessage *iface,
1114 LPADDRESSLIST pList)
1116 FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, dwProps, pList);
1120 static HRESULT WINAPI MimeMessage_GetAddressFormat(
1121 IMimeMessage *iface,
1123 ADDRESSFORMAT format,
1126 FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, format, ppszFormat);
1130 static HRESULT WINAPI MimeMessage_EnumAddressTypes(
1131 IMimeMessage *iface,
1134 IMimeEnumAddressTypes **ppEnum)
1136 FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, dwProps, ppEnum);
1140 static HRESULT WINAPI MimeMessage_SplitMessage(
1141 IMimeMessage *iface,
1143 IMimeMessageParts **ppParts)
1145 FIXME("(%p)->(%d, %p)\n", iface, cbMaxPart, ppParts);
1149 static HRESULT WINAPI MimeMessage_GetRootMoniker(
1150 IMimeMessage *iface,
1151 IMoniker **ppMoniker)
1153 FIXME("(%p)->(%p)\n", iface, ppMoniker);
1157 static const IMimeMessageVtbl MimeMessageVtbl =
1159 MimeMessage_QueryInterface,
1161 MimeMessage_Release,
1162 MimeMessage_GetClassID,
1163 MimeMessage_IsDirty,
1166 MimeMessage_GetSizeMax,
1167 MimeMessage_InitNew,
1168 MimeMessage_GetMessageSource,
1169 MimeMessage_GetMessageSize,
1170 MimeMessage_LoadOffsetTable,
1171 MimeMessage_SaveOffsetTable,
1172 MimeMessage_GetFlags,
1174 MimeMessage_HandsOffStorage,
1175 MimeMessage_BindToObject,
1176 MimeMessage_SaveBody,
1177 MimeMessage_InsertBody,
1178 MimeMessage_GetBody,
1179 MimeMessage_DeleteBody,
1180 MimeMessage_MoveBody,
1181 MimeMessage_CountBodies,
1182 MimeMessage_FindFirst,
1183 MimeMessage_FindNext,
1184 MimeMessage_ResolveURL,
1185 MimeMessage_ToMultipart,
1186 MimeMessage_GetBodyOffsets,
1187 MimeMessage_GetCharset,
1188 MimeMessage_SetCharset,
1189 MimeMessage_IsBodyType,
1190 MimeMessage_IsContentType,
1191 MimeMessage_QueryBodyProp,
1192 MimeMessage_GetBodyProp,
1193 MimeMessage_SetBodyProp,
1194 MimeMessage_DeleteBodyProp,
1195 MimeMessage_SetOption,
1196 MimeMessage_GetOption,
1197 MimeMessage_CreateWebPage,
1198 MimeMessage_GetProp,
1199 MimeMessage_SetProp,
1200 MimeMessage_DeleteProp,
1201 MimeMessage_QueryProp,
1202 MimeMessage_GetTextBody,
1203 MimeMessage_SetTextBody,
1204 MimeMessage_AttachObject,
1205 MimeMessage_AttachFile,
1206 MimeMessage_AttachURL,
1207 MimeMessage_GetAttachments,
1208 MimeMessage_GetAddressTable,
1209 MimeMessage_GetSender,
1210 MimeMessage_GetAddressTypes,
1211 MimeMessage_GetAddressFormat,
1212 MimeMessage_EnumAddressTypes,
1213 MimeMessage_SplitMessage,
1214 MimeMessage_GetRootMoniker,
1217 /***********************************************************************
1218 * MimeOleCreateMessage (INETCOMM.@)
1220 HRESULT WINAPI MimeOleCreateMessage(IUnknown *pUnkOuter, IMimeMessage **ppMessage)
1224 TRACE("(%p, %p)\n", pUnkOuter, ppMessage);
1228 FIXME("outer unknown not supported yet\n");
1234 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
1235 if (!This) return E_OUTOFMEMORY;
1237 This->lpVtbl = &MimeMessageVtbl;
1240 *ppMessage = (IMimeMessage *)&This->lpVtbl;
1244 /***********************************************************************
1245 * MimeOleSetCompatMode (INETCOMM.@)
1247 HRESULT WINAPI MimeOleSetCompatMode(DWORD dwMode)
1249 FIXME("(0x%x)\n", dwMode);
1253 /***********************************************************************
1254 * MimeOleCreateVirtualStream (INETCOMM.@)
1256 HRESULT WINAPI MimeOleCreateVirtualStream(IStream **ppStream)
1259 FIXME("(%p)\n", ppStream);
1261 hr = CreateStreamOnHGlobal(NULL, TRUE, ppStream);
1265 typedef struct MimeSecurity
1267 const IMimeSecurityVtbl *lpVtbl;
1272 static HRESULT WINAPI MimeSecurity_QueryInterface(
1273 IMimeSecurity* iface,
1277 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), obj);
1279 if (IsEqualIID(riid, &IID_IUnknown) ||
1280 IsEqualIID(riid, &IID_IMimeSecurity))
1283 IUnknown_AddRef(iface);
1287 FIXME("no interface for %s\n", debugstr_guid(riid));
1289 return E_NOINTERFACE;
1292 static ULONG WINAPI MimeSecurity_AddRef(
1293 IMimeSecurity* iface)
1295 MimeSecurity *This = (MimeSecurity *)iface;
1296 TRACE("(%p)->()\n", iface);
1297 return InterlockedIncrement(&This->refs);
1300 static ULONG WINAPI MimeSecurity_Release(
1301 IMimeSecurity* iface)
1303 MimeSecurity *This = (MimeSecurity *)iface;
1306 TRACE("(%p)->()\n", iface);
1308 refs = InterlockedDecrement(&This->refs);
1311 HeapFree(GetProcessHeap(), 0, This);
1317 static HRESULT WINAPI MimeSecurity_InitNew(
1318 IMimeSecurity* iface)
1320 FIXME("(%p)->(): stub\n", iface);
1324 static HRESULT WINAPI MimeSecurity_CheckInit(
1325 IMimeSecurity* iface)
1327 FIXME("(%p)->(): stub\n", iface);
1331 static HRESULT WINAPI MimeSecurity_EncodeMessage(
1332 IMimeSecurity* iface,
1333 IMimeMessageTree* pTree,
1336 FIXME("(%p)->(%p, %08x): stub\n", iface, pTree, dwFlags);
1340 static HRESULT WINAPI MimeSecurity_EncodeBody(
1341 IMimeSecurity* iface,
1342 IMimeMessageTree* pTree,
1346 FIXME("(%p)->(%p, %p, %08x): stub\n", iface, pTree, hEncodeRoot, dwFlags);
1350 static HRESULT WINAPI MimeSecurity_DecodeMessage(
1351 IMimeSecurity* iface,
1352 IMimeMessageTree* pTree,
1355 FIXME("(%p)->(%p, %08x): stub\n", iface, pTree, dwFlags);
1359 static HRESULT WINAPI MimeSecurity_DecodeBody(
1360 IMimeSecurity* iface,
1361 IMimeMessageTree* pTree,
1365 FIXME("(%p)->(%p, %p, %08x): stub\n", iface, pTree, hDecodeRoot, dwFlags);
1369 static HRESULT WINAPI MimeSecurity_EnumCertificates(
1370 IMimeSecurity* iface,
1376 FIXME("(%p)->(%p, %08x, %p, %p): stub\n", iface, hc, dwUsage, pPrev, ppCert);
1380 static HRESULT WINAPI MimeSecurity_GetCertificateName(
1381 IMimeSecurity* iface,
1382 const PCX509CERT pX509Cert,
1383 const CERTNAMETYPE cn,
1386 FIXME("(%p)->(%p, %08x, %p): stub\n", iface, pX509Cert, cn, ppszName);
1390 static HRESULT WINAPI MimeSecurity_GetMessageType(
1391 IMimeSecurity* iface,
1392 const HWND hwndParent,
1396 FIXME("(%p)->(%p, %p, %p): stub\n", iface, hwndParent, pBody, pdwSecType);
1400 static HRESULT WINAPI MimeSecurity_GetCertData(
1401 IMimeSecurity* iface,
1402 const PCX509CERT pX509Cert,
1403 const CERTDATAID dataid,
1404 LPPROPVARIANT pValue)
1406 FIXME("(%p)->(%p, %x, %p): stub\n", iface, pX509Cert, dataid, pValue);
1411 static const IMimeSecurityVtbl MimeSecurityVtbl =
1413 MimeSecurity_QueryInterface,
1414 MimeSecurity_AddRef,
1415 MimeSecurity_Release,
1416 MimeSecurity_InitNew,
1417 MimeSecurity_CheckInit,
1418 MimeSecurity_EncodeMessage,
1419 MimeSecurity_EncodeBody,
1420 MimeSecurity_DecodeMessage,
1421 MimeSecurity_DecodeBody,
1422 MimeSecurity_EnumCertificates,
1423 MimeSecurity_GetCertificateName,
1424 MimeSecurity_GetMessageType,
1425 MimeSecurity_GetCertData
1428 /***********************************************************************
1429 * MimeOleCreateSecurity (INETCOMM.@)
1431 HRESULT WINAPI MimeOleCreateSecurity(IMimeSecurity **ppSecurity)
1435 TRACE("(%p)\n", ppSecurity);
1439 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
1440 if (!This) return E_OUTOFMEMORY;
1442 This->lpVtbl = &MimeSecurityVtbl;
1445 *ppSecurity = (IMimeSecurity *)&This->lpVtbl;