ReactOS 0.4.16-dev-92-g0c2cdca
mimeole.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "wine/winternl.h"
#include "winuser.h"
#include "objbase.h"
#include "ole2.h"
#include "mimeole.h"
#include "propvarutil.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/debug.h"
#include "inetcomm_private.h"
Include dependency graph for mimeole.c:

Go to the source code of this file.

Classes

struct  property_t
 
struct  property_list_entry_t
 
struct  param_t
 
struct  header_t
 
struct  MimeBody
 
struct  sub_stream_t
 
struct  propschema
 
struct  body_t
 
struct  MimeMessage
 
struct  offset_entry_t
 
struct  MimeSecurity
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define PARSER_BUF_SIZE   1024
 
#define FIRST_CUSTOM_PROP_ID   0x100
 

Typedefs

typedef struct MimeBody MimeBody
 
typedef struct propschema propschema
 
typedef struct body_t body_t
 
typedef struct MimeMessage MimeMessage
 
typedef struct MimeSecurity MimeSecurity
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (inetcomm)
 
static sub_stream_timpl_from_IStream (IStream *iface)
 
static HRESULT WINAPI sub_stream_QueryInterface (IStream *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI sub_stream_AddRef (IStream *iface)
 
static ULONG WINAPI sub_stream_Release (IStream *iface)
 
static HRESULT WINAPI sub_stream_Read (IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI sub_stream_Write (IStream *iface, const void *pv, ULONG cb, ULONG *pcbWritten)
 
static HRESULT WINAPI sub_stream_Seek (IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static HRESULT WINAPI sub_stream_SetSize (IStream *iface, ULARGE_INTEGER libNewSize)
 
static HRESULT WINAPI sub_stream_CopyTo (IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
 
static HRESULT WINAPI sub_stream_Commit (IStream *iface, DWORD grfCommitFlags)
 
static HRESULT WINAPI sub_stream_Revert (IStream *iface)
 
static HRESULT WINAPI sub_stream_LockRegion (IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
 
static HRESULT WINAPI sub_stream_UnlockRegion (IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
 
static HRESULT WINAPI sub_stream_Stat (IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag)
 
static HRESULT WINAPI sub_stream_Clone (IStream *iface, IStream **ppstm)
 
static HRESULT create_sub_stream (IStream *stream, ULARGE_INTEGER start, ULARGE_INTEGER length, IStream **out)
 
static HRESULT get_stream_size (IStream *stream, ULARGE_INTEGER *size)
 
static MimeBodyimpl_from_IMimeBody (IMimeBody *iface)
 
static propschemaimpl_from_IMimePropertySchema (IMimePropertySchema *iface)
 
static LPSTR strdupA (LPCSTR str)
 
static HRESULT copy_headers_to_buf (IStream *stm, char **ptr)
 
static header_tread_prop (MimeBody *body, char **ptr)
 
static void unfold_header (char *header, int len)
 
static charunquote_string (const char *str)
 
static void add_param (header_t *header, const char *p)
 
static void split_params (header_t *header, char *value)
 
static void read_value (header_t *header, char **cur)
 
static void init_content_type (MimeBody *body, header_t *header)
 
static void init_content_encoding (MimeBody *body, header_t *header)
 
static HRESULT parse_headers (MimeBody *body, IStream *stm)
 
static void empty_param_list (struct list *list)
 
static void free_header (header_t *header)
 
static void empty_header_list (struct list *list)
 
static void empty_new_prop_list (struct list *list)
 
static void release_data (REFIID riid, void *data)
 
static HRESULT find_prop (MimeBody *body, const char *name, header_t **prop)
 
static const property_tfind_default_prop (const char *name)
 
static HRESULT WINAPI MimeBody_QueryInterface (IMimeBody *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI MimeBody_AddRef (IMimeBody *iface)
 
static ULONG WINAPI MimeBody_Release (IMimeBody *iface)
 
static HRESULT WINAPI MimeBody_GetClassID (IMimeBody *iface, CLSID *pClassID)
 
static HRESULT WINAPI MimeBody_IsDirty (IMimeBody *iface)
 
static HRESULT WINAPI MimeBody_Load (IMimeBody *iface, IStream *pStm)
 
static HRESULT WINAPI MimeBody_Save (IMimeBody *iface, IStream *pStm, BOOL fClearDirty)
 
static HRESULT WINAPI MimeBody_GetSizeMax (IMimeBody *iface, ULARGE_INTEGER *pcbSize)
 
static HRESULT WINAPI MimeBody_InitNew (IMimeBody *iface)
 
static HRESULT WINAPI MimeBody_GetPropInfo (IMimeBody *iface, LPCSTR pszName, LPMIMEPROPINFO pInfo)
 
static HRESULT WINAPI MimeBody_SetPropInfo (IMimeBody *iface, LPCSTR pszName, LPCMIMEPROPINFO pInfo)
 
static HRESULT WINAPI MimeBody_GetProp (IMimeBody *iface, LPCSTR pszName, DWORD dwFlags, LPPROPVARIANT pValue)
 
static HRESULT WINAPI MimeBody_SetProp (IMimeBody *iface, LPCSTR pszName, DWORD dwFlags, LPCPROPVARIANT pValue)
 
static HRESULT WINAPI MimeBody_AppendProp (IMimeBody *iface, LPCSTR pszName, DWORD dwFlags, LPPROPVARIANT pValue)
 
static HRESULT WINAPI MimeBody_DeleteProp (IMimeBody *iface, LPCSTR pszName)
 
static HRESULT WINAPI MimeBody_CopyProps (IMimeBody *iface, ULONG cNames, LPCSTR *prgszName, IMimePropertySet *pPropertySet)
 
static HRESULT WINAPI MimeBody_MoveProps (IMimeBody *iface, ULONG cNames, LPCSTR *prgszName, IMimePropertySet *pPropertySet)
 
static HRESULT WINAPI MimeBody_DeleteExcept (IMimeBody *iface, ULONG cNames, LPCSTR *prgszName)
 
static HRESULT WINAPI MimeBody_QueryProp (IMimeBody *iface, LPCSTR pszName, LPCSTR pszCriteria, boolean fSubString, boolean fCaseSensitive)
 
static HRESULT WINAPI MimeBody_GetCharset (IMimeBody *iface, LPHCHARSET phCharset)
 
static HRESULT WINAPI MimeBody_SetCharset (IMimeBody *iface, HCHARSET hCharset, CSETAPPLYTYPE applytype)
 
static HRESULT WINAPI MimeBody_GetParameters (IMimeBody *iface, LPCSTR pszName, ULONG *pcParams, LPMIMEPARAMINFO *pprgParam)
 
static HRESULT WINAPI MimeBody_IsContentType (IMimeBody *iface, LPCSTR pszPriType, LPCSTR pszSubType)
 
static HRESULT WINAPI MimeBody_BindToObject (IMimeBody *iface, REFIID riid, void **ppvObject)
 
static HRESULT WINAPI MimeBody_Clone (IMimeBody *iface, IMimePropertySet **ppPropertySet)
 
static HRESULT WINAPI MimeBody_SetOption (IMimeBody *iface, const TYPEDID oid, LPCPROPVARIANT pValue)
 
static HRESULT WINAPI MimeBody_GetOption (IMimeBody *iface, const TYPEDID oid, LPPROPVARIANT pValue)
 
static HRESULT WINAPI MimeBody_EnumProps (IMimeBody *iface, DWORD dwFlags, IMimeEnumProperties **ppEnum)
 
static HRESULT WINAPI MimeBody_IsType (IMimeBody *iface, IMSGBODYTYPE bodytype)
 
static HRESULT WINAPI MimeBody_SetDisplayName (IMimeBody *iface, LPCSTR pszDisplay)
 
static HRESULT WINAPI MimeBody_GetDisplayName (IMimeBody *iface, LPSTR *ppszDisplay)
 
static HRESULT WINAPI MimeBody_GetOffsets (IMimeBody *iface, LPBODYOFFSETS pOffsets)
 
static HRESULT WINAPI MimeBody_GetCurrentEncoding (IMimeBody *iface, ENCODINGTYPE *pietEncoding)
 
static HRESULT WINAPI MimeBody_SetCurrentEncoding (IMimeBody *iface, ENCODINGTYPE ietEncoding)
 
static HRESULT WINAPI MimeBody_GetEstimatedSize (IMimeBody *iface, ENCODINGTYPE ietEncoding, ULONG *pcbSize)
 
static HRESULT WINAPI MimeBody_GetDataHere (IMimeBody *iface, ENCODINGTYPE ietEncoding, IStream *pStream)
 
static HRESULT decode_base64 (IStream *input, IStream **ret_stream)
 
static int hex_digit (char c)
 
static HRESULT decode_qp (IStream *input, IStream **ret_stream)
 
static HRESULT WINAPI MimeBody_GetData (IMimeBody *iface, ENCODINGTYPE ietEncoding, IStream **ppStream)
 
static HRESULT WINAPI MimeBody_SetData (IMimeBody *iface, ENCODINGTYPE ietEncoding, LPCSTR pszPriType, LPCSTR pszSubType, REFIID riid, LPVOID pvObject)
 
static HRESULT WINAPI MimeBody_EmptyData (IMimeBody *iface)
 
static HRESULT WINAPI MimeBody_CopyTo (IMimeBody *iface, IMimeBody *pBody)
 
static HRESULT WINAPI MimeBody_GetTransmitInfo (IMimeBody *iface, LPTRANSMITINFO pTransmitInfo)
 
static HRESULT WINAPI MimeBody_SaveToFile (IMimeBody *iface, ENCODINGTYPE ietEncoding, LPCSTR pszFilePath)
 
static HRESULT WINAPI MimeBody_GetHandle (IMimeBody *iface, LPHBODY phBody)
 
static HRESULT MimeBody_set_offsets (MimeBody *body, const BODYOFFSETS *offsets)
 
static MimeBodymimebody_create (void)
 
HRESULT MimeBody_create (IUnknown *outer, void **ppv)
 
static MimeMessageimpl_from_IMimeMessage (IMimeMessage *iface)
 
static HRESULT WINAPI MimeMessage_QueryInterface (IMimeMessage *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI MimeMessage_AddRef (IMimeMessage *iface)
 
static void empty_body_list (struct list *list)
 
static ULONG WINAPI MimeMessage_Release (IMimeMessage *iface)
 
static HRESULT WINAPI MimeMessage_GetClassID (IMimeMessage *iface, CLSID *pClassID)
 
static HRESULT WINAPI MimeMessage_IsDirty (IMimeMessage *iface)
 
static body_tnew_body_entry (MimeBody *mime_body, DWORD index, body_t *parent)
 
static HRESULT create_body_offset_list (IStream *stm, const char *boundary, struct list *body_offsets)
 
static body_tcreate_sub_body (MimeMessage *msg, IStream *pStm, BODYOFFSETS *offset, body_t *parent)
 
static HRESULT WINAPI MimeMessage_Load (IMimeMessage *iface, IStream *pStm)
 
static HRESULT WINAPI MimeMessage_Save (IMimeMessage *iface, IStream *pStm, BOOL fClearDirty)
 
static HRESULT WINAPI MimeMessage_GetSizeMax (IMimeMessage *iface, ULARGE_INTEGER *pcbSize)
 
static HRESULT WINAPI MimeMessage_InitNew (IMimeMessage *iface)
 
static HRESULT WINAPI MimeMessage_GetMessageSource (IMimeMessage *iface, IStream **ppStream, DWORD dwFlags)
 
static HRESULT WINAPI MimeMessage_GetMessageSize (IMimeMessage *iface, ULONG *pcbSize, DWORD dwFlags)
 
static HRESULT WINAPI MimeMessage_LoadOffsetTable (IMimeMessage *iface, IStream *pStream)
 
static HRESULT WINAPI MimeMessage_SaveOffsetTable (IMimeMessage *iface, IStream *pStream, DWORD dwFlags)
 
static HRESULT WINAPI MimeMessage_GetFlags (IMimeMessage *iface, DWORD *pdwFlags)
 
static HRESULT WINAPI MimeMessage_Commit (IMimeMessage *iface, DWORD dwFlags)
 
static HRESULT WINAPI MimeMessage_HandsOffStorage (IMimeMessage *iface)
 
static HRESULT find_body (struct list *list, HBODY hbody, body_t **body)
 
static HRESULT WINAPI MimeMessage_BindToObject (IMimeMessage *iface, const HBODY hBody, REFIID riid, void **ppvObject)
 
static HRESULT WINAPI MimeMessage_SaveBody (IMimeMessage *iface, HBODY hBody, DWORD dwFlags, IStream *pStream)
 
static HRESULT get_body (MimeMessage *msg, BODYLOCATION location, HBODY pivot, body_t **out)
 
static HRESULT WINAPI MimeMessage_InsertBody (IMimeMessage *iface, BODYLOCATION location, HBODY hPivot, LPHBODY phBody)
 
static HRESULT WINAPI MimeMessage_GetBody (IMimeMessage *iface, BODYLOCATION location, HBODY hPivot, HBODY *phBody)
 
static HRESULT WINAPI MimeMessage_DeleteBody (IMimeMessage *iface, HBODY hBody, DWORD dwFlags)
 
static HRESULT WINAPI MimeMessage_MoveBody (IMimeMessage *iface, HBODY hBody, BODYLOCATION location)
 
static void count_children (body_t *body, boolean recurse, ULONG *count)
 
static HRESULT WINAPI MimeMessage_CountBodies (IMimeMessage *iface, HBODY hParent, boolean fRecurse, ULONG *pcBodies)
 
static HRESULT find_next (MimeMessage *This, body_t *body, FINDBODY *find, HBODY *out)
 
static HRESULT WINAPI MimeMessage_FindFirst (IMimeMessage *iface, FINDBODY *pFindBody, HBODY *phBody)
 
static HRESULT WINAPI MimeMessage_FindNext (IMimeMessage *iface, FINDBODY *pFindBody, HBODY *phBody)
 
static HRESULT WINAPI MimeMessage_ResolveURL (IMimeMessage *iface, HBODY hRelated, LPCSTR pszBase, LPCSTR pszURL, DWORD dwFlags, LPHBODY phBody)
 
static HRESULT WINAPI MimeMessage_ToMultipart (IMimeMessage *iface, HBODY hBody, LPCSTR pszSubType, LPHBODY phMultipart)
 
static HRESULT WINAPI MimeMessage_GetBodyOffsets (IMimeMessage *iface, HBODY hBody, LPBODYOFFSETS pOffsets)
 
static HRESULT WINAPI MimeMessage_GetCharset (IMimeMessage *iface, LPHCHARSET phCharset)
 
static HRESULT WINAPI MimeMessage_SetCharset (IMimeMessage *iface, HCHARSET hCharset, CSETAPPLYTYPE applytype)
 
static HRESULT WINAPI MimeMessage_IsBodyType (IMimeMessage *iface, HBODY hBody, IMSGBODYTYPE bodytype)
 
static HRESULT WINAPI MimeMessage_IsContentType (IMimeMessage *iface, HBODY hBody, LPCSTR pszPriType, LPCSTR pszSubType)
 
static HRESULT WINAPI MimeMessage_QueryBodyProp (IMimeMessage *iface, HBODY hBody, LPCSTR pszName, LPCSTR pszCriteria, boolean fSubString, boolean fCaseSensitive)
 
static HRESULT WINAPI MimeMessage_GetBodyProp (IMimeMessage *iface, HBODY hBody, LPCSTR pszName, DWORD dwFlags, LPPROPVARIANT pValue)
 
static HRESULT WINAPI MimeMessage_SetBodyProp (IMimeMessage *iface, HBODY hBody, LPCSTR pszName, DWORD dwFlags, LPCPROPVARIANT pValue)
 
static HRESULT WINAPI MimeMessage_DeleteBodyProp (IMimeMessage *iface, HBODY hBody, LPCSTR pszName)
 
static HRESULT WINAPI MimeMessage_SetOption (IMimeMessage *iface, const TYPEDID oid, LPCPROPVARIANT pValue)
 
static HRESULT WINAPI MimeMessage_GetOption (IMimeMessage *iface, const TYPEDID oid, LPPROPVARIANT pValue)
 
static HRESULT WINAPI MimeMessage_CreateWebPage (IMimeMessage *iface, IStream *pRootStm, LPWEBPAGEOPTIONS pOptions, IMimeMessageCallback *pCallback, IMoniker **ppMoniker)
 
static HRESULT WINAPI MimeMessage_GetProp (IMimeMessage *iface, LPCSTR pszName, DWORD dwFlags, LPPROPVARIANT pValue)
 
static HRESULT WINAPI MimeMessage_SetProp (IMimeMessage *iface, LPCSTR pszName, DWORD dwFlags, LPCPROPVARIANT pValue)
 
static HRESULT WINAPI MimeMessage_DeleteProp (IMimeMessage *iface, LPCSTR pszName)
 
static HRESULT WINAPI MimeMessage_QueryProp (IMimeMessage *iface, LPCSTR pszName, LPCSTR pszCriteria, boolean fSubString, boolean fCaseSensitive)
 
static HRESULT WINAPI MimeMessage_GetTextBody (IMimeMessage *iface, DWORD dwTxtType, ENCODINGTYPE ietEncoding, IStream **pStream, LPHBODY phBody)
 
static HRESULT WINAPI MimeMessage_SetTextBody (IMimeMessage *iface, DWORD dwTxtType, ENCODINGTYPE ietEncoding, HBODY hAlternative, IStream *pStream, LPHBODY phBody)
 
static HRESULT WINAPI MimeMessage_AttachObject (IMimeMessage *iface, REFIID riid, void *pvObject, LPHBODY phBody)
 
static HRESULT WINAPI MimeMessage_AttachFile (IMimeMessage *iface, LPCSTR pszFilePath, IStream *pstmFile, LPHBODY phBody)
 
static HRESULT WINAPI MimeMessage_AttachURL (IMimeMessage *iface, LPCSTR pszBase, LPCSTR pszURL, DWORD dwFlags, IStream *pstmURL, LPSTR *ppszCIDURL, LPHBODY phBody)
 
static HRESULT WINAPI MimeMessage_GetAttachments (IMimeMessage *iface, ULONG *pcAttach, LPHBODY *pprghAttach)
 
static HRESULT WINAPI MimeMessage_GetAddressTable (IMimeMessage *iface, IMimeAddressTable **ppTable)
 
static HRESULT WINAPI MimeMessage_GetSender (IMimeMessage *iface, LPADDRESSPROPS pAddress)
 
static HRESULT WINAPI MimeMessage_GetAddressTypes (IMimeMessage *iface, DWORD dwAdrTypes, DWORD dwProps, LPADDRESSLIST pList)
 
static HRESULT WINAPI MimeMessage_GetAddressFormat (IMimeMessage *iface, DWORD dwAdrTypes, ADDRESSFORMAT format, LPSTR *ppszFormat)
 
static HRESULT WINAPI MimeMessage_EnumAddressTypes (IMimeMessage *iface, DWORD dwAdrTypes, DWORD dwProps, IMimeEnumAddressTypes **ppEnum)
 
static HRESULT WINAPI MimeMessage_SplitMessage (IMimeMessage *iface, ULONG cbMaxPart, IMimeMessageParts **ppParts)
 
static HRESULT WINAPI MimeMessage_GetRootMoniker (IMimeMessage *iface, IMoniker **ppMoniker)
 
HRESULT MimeMessage_create (IUnknown *outer, void **obj)
 
HRESULT WINAPI MimeOleCreateMessage (IUnknown *pUnkOuter, IMimeMessage **ppMessage)
 
HRESULT WINAPI MimeOleSetCompatMode (DWORD dwMode)
 
HRESULT WINAPI MimeOleCreateVirtualStream (IStream **ppStream)
 
static MimeSecurityimpl_from_IMimeSecurity (IMimeSecurity *iface)
 
static HRESULT WINAPI MimeSecurity_QueryInterface (IMimeSecurity *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI MimeSecurity_AddRef (IMimeSecurity *iface)
 
static ULONG WINAPI MimeSecurity_Release (IMimeSecurity *iface)
 
static HRESULT WINAPI MimeSecurity_InitNew (IMimeSecurity *iface)
 
static HRESULT WINAPI MimeSecurity_CheckInit (IMimeSecurity *iface)
 
static HRESULT WINAPI MimeSecurity_EncodeMessage (IMimeSecurity *iface, IMimeMessageTree *pTree, DWORD dwFlags)
 
static HRESULT WINAPI MimeSecurity_EncodeBody (IMimeSecurity *iface, IMimeMessageTree *pTree, HBODY hEncodeRoot, DWORD dwFlags)
 
static HRESULT WINAPI MimeSecurity_DecodeMessage (IMimeSecurity *iface, IMimeMessageTree *pTree, DWORD dwFlags)
 
static HRESULT WINAPI MimeSecurity_DecodeBody (IMimeSecurity *iface, IMimeMessageTree *pTree, HBODY hDecodeRoot, DWORD dwFlags)
 
static HRESULT WINAPI MimeSecurity_EnumCertificates (IMimeSecurity *iface, HCAPICERTSTORE hc, DWORD dwUsage, PCX509CERT pPrev, PCX509CERT *ppCert)
 
static HRESULT WINAPI MimeSecurity_GetCertificateName (IMimeSecurity *iface, const PCX509CERT pX509Cert, const CERTNAMETYPE cn, LPSTR *ppszName)
 
static HRESULT WINAPI MimeSecurity_GetMessageType (IMimeSecurity *iface, const HWND hwndParent, IMimeBody *pBody, DWORD *pdwSecType)
 
static HRESULT WINAPI MimeSecurity_GetCertData (IMimeSecurity *iface, const PCX509CERT pX509Cert, const CERTDATAID dataid, LPPROPVARIANT pValue)
 
HRESULT MimeSecurity_create (IUnknown *outer, void **obj)
 
HRESULT WINAPI MimeOleCreateSecurity (IMimeSecurity **ppSecurity)
 
static HRESULT WINAPI MimeAlloc_QueryInterface (IMimeAllocator *iface, REFIID riid, void **obj)
 
static ULONG WINAPI MimeAlloc_AddRef (IMimeAllocator *iface)
 
static ULONG WINAPI MimeAlloc_Release (IMimeAllocator *iface)
 
static LPVOID WINAPI MimeAlloc_Alloc (IMimeAllocator *iface, SIZE_T cb)
 
static LPVOID WINAPI MimeAlloc_Realloc (IMimeAllocator *iface, LPVOID pv, SIZE_T cb)
 
static void WINAPI MimeAlloc_Free (IMimeAllocator *iface, LPVOID pv)
 
static SIZE_T WINAPI MimeAlloc_GetSize (IMimeAllocator *iface, LPVOID pv)
 
static int WINAPI MimeAlloc_DidAlloc (IMimeAllocator *iface, LPVOID pv)
 
static void WINAPI MimeAlloc_HeapMinimize (IMimeAllocator *iface)
 
static HRESULT WINAPI MimeAlloc_FreeParamInfoArray (IMimeAllocator *iface, ULONG cParams, LPMIMEPARAMINFO prgParam, boolean fFreeArray)
 
static HRESULT WINAPI MimeAlloc_FreeAddressList (IMimeAllocator *iface, LPADDRESSLIST pList)
 
static HRESULT WINAPI MimeAlloc_FreeAddressProps (IMimeAllocator *iface, LPADDRESSPROPS pAddress)
 
static HRESULT WINAPI MimeAlloc_ReleaseObjects (IMimeAllocator *iface, ULONG cObjects, IUnknown **prgpUnknown, boolean fFreeArray)
 
static HRESULT WINAPI MimeAlloc_FreeEnumHeaderRowArray (IMimeAllocator *iface, ULONG cRows, LPENUMHEADERROW prgRow, boolean fFreeArray)
 
static HRESULT WINAPI MimeAlloc_FreeEnumPropertyArray (IMimeAllocator *iface, ULONG cProps, LPENUMPROPERTY prgProp, boolean fFreeArray)
 
static HRESULT WINAPI MimeAlloc_FreeThumbprint (IMimeAllocator *iface, THUMBBLOB *pthumbprint)
 
static HRESULT WINAPI MimeAlloc_PropVariantClear (IMimeAllocator *iface, LPPROPVARIANT pProp)
 
HRESULT MimeAllocator_create (IUnknown *outer, void **obj)
 
HRESULT WINAPI MimeOleGetAllocator (IMimeAllocator **alloc)
 
HRESULT VirtualStream_create (IUnknown *outer, void **obj)
 
static HRESULT WINAPI propschema_QueryInterface (IMimePropertySchema *iface, REFIID riid, void **out)
 
static ULONG WINAPI propschema_AddRef (IMimePropertySchema *iface)
 
static ULONG WINAPI propschema_Release (IMimePropertySchema *iface)
 
static HRESULT WINAPI propschema_RegisterProperty (IMimePropertySchema *iface, const char *name, DWORD flags, DWORD rownumber, VARTYPE vtdefault, DWORD *propid)
 
static HRESULT WINAPI propschema_ModifyProperty (IMimePropertySchema *iface, const char *name, DWORD flags, DWORD rownumber, VARTYPE vtdefault)
 
static HRESULT WINAPI propschema_GetPropertyId (IMimePropertySchema *iface, const char *name, DWORD *propid)
 
static HRESULT WINAPI propschema_GetPropertyName (IMimePropertySchema *iface, DWORD propid, char **name)
 
static HRESULT WINAPI propschema_RegisterAddressType (IMimePropertySchema *iface, const char *name, DWORD *adrtype)
 
HRESULT WINAPI MimeOleGetPropertySchema (IMimePropertySchema **schema)
 
HRESULT WINAPI MimeGetAddressFormatW (REFIID riid, void *object, DWORD addr_type, ADDRESSFORMAT addr_format, WCHAR **address)
 
static HRESULT WINAPI mime_obj_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI mime_obj_AddRef (IUnknown *iface)
 
static ULONG WINAPI mime_obj_Release (IUnknown *iface)
 
HRESULT WINAPI MimeOleObjectFromMoniker (BINDF bindf, IMoniker *moniker, IBindCtx *binding, REFIID riid, void **out, IMoniker **moniker_new)
 

Variables

static const property_t default_props []
 
static struct IStreamVtbl sub_stream_vtbl
 
static const signed char base64_decode_table []
 
static IMimeBodyVtbl body_vtbl
 
static const IMimeMessageVtbl MimeMessageVtbl
 
static const IMimeSecurityVtbl MimeSecurityVtbl
 
static IMimeAllocatorVtbl mime_alloc_vtbl
 
static IMimeAllocator mime_allocator
 
static IMimePropertySchemaVtbl prop_schema_vtbl
 
static const IUnknownVtbl mime_obj_vtbl
 
static IUnknown mime_obj = { &mime_obj_vtbl }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file mimeole.c.

◆ FIRST_CUSTOM_PROP_ID

#define FIRST_CUSTOM_PROP_ID   0x100

Definition at line 1890 of file mimeole.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 23 of file mimeole.c.

◆ PARSER_BUF_SIZE

#define PARSER_BUF_SIZE   1024

Definition at line 491 of file mimeole.c.

Typedef Documentation

◆ body_t

typedef struct body_t body_t

◆ MimeBody

◆ MimeMessage

◆ MimeSecurity

◆ propschema

Function Documentation

◆ add_param()

static void add_param ( header_t header,
const char p 
)
static

Definition at line 669 of file mimeole.c.

670{
671 const char *key = p, *value, *cp = p;
672 param_t *param;
673 char *name;
674
675 TRACE("got param %s\n", p);
676
677 while (*key == ' ' || *key == '\t' ) key++;
678
679 cp = strchr(key, '=');
680 if(!cp)
681 {
682 WARN("malformed parameter - skipping\n");
683 return;
684 }
685
686 name = HeapAlloc(GetProcessHeap(), 0, cp - key + 1);
687 memcpy(name, key, cp - key);
688 name[cp - key] = '\0';
689
690 value = cp + 1;
691
692 param = HeapAlloc(GetProcessHeap(), 0, sizeof(*param));
693 param->name = name;
694 param->value = unquote_string(value);
695 list_add_tail(&header->params, &param->entry);
696}
char * strchr(const char *String, int ch)
Definition: utclib.c:501
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define WARN(fmt,...)
Definition: precomp.h:61
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
static char * unquote_string(const char *str)
Definition: mimeole.c:636
GLfloat GLfloat p
Definition: glext.h:8902
GLfloat param
Definition: glext.h:5796
POINT cp
Definition: magnifier.c:59
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define TRACE(s)
Definition: solgame.cpp:4
Definition: copy.c:22
Definition: name.c:39
Definition: pdh_main.c:94

Referenced by split_params().

◆ copy_headers_to_buf()

static HRESULT copy_headers_to_buf ( IStream stm,
char **  ptr 
)
static

Definition at line 499 of file mimeole.c.

500{
501 char *buf = NULL;
502 DWORD size = PARSER_BUF_SIZE, offset = 0, last_end = 0;
503 HRESULT hr;
504 BOOL done = FALSE;
505
506 *ptr = NULL;
507
508 do
509 {
510 char *end;
511 DWORD read;
512
513 if(!buf)
514 buf = HeapAlloc(GetProcessHeap(), 0, size + 1);
515 else
516 {
517 size *= 2;
518 buf = HeapReAlloc(GetProcessHeap(), 0, buf, size + 1);
519 }
520 if(!buf)
521 {
523 goto fail;
524 }
525
526 hr = IStream_Read(stm, buf + offset, size - offset, &read);
527 if(FAILED(hr)) goto fail;
528
529 offset += read;
530 buf[offset] = '\0';
531
532 if(read == 0) done = TRUE;
533
534 while(!done && (end = strstr(buf + last_end, "\r\n")))
535 {
536 DWORD new_end = end - buf + 2;
537 if(new_end - last_end == 2)
538 {
539 LARGE_INTEGER off;
540 off.QuadPart = (LONGLONG)new_end - offset;
541 IStream_Seek(stm, off, STREAM_SEEK_CUR, NULL);
542 buf[new_end] = '\0';
543 done = TRUE;
544 }
545 else
546 last_end = new_end;
547 }
548 } while(!done);
549
550 *ptr = buf;
551 return S_OK;
552
553fail:
555 return hr;
556}
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
#define read
Definition: acwin.h:96
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define HeapReAlloc
Definition: compat.h:734
#define HeapFree(x, y, z)
Definition: compat.h:735
#define PARSER_BUF_SIZE
Definition: mimeole.c:491
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint end
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLintptr offset
Definition: glext.h:5920
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
static PVOID ptr
Definition: dispmode.c:27
HRESULT hr
Definition: shlfolder.c:183
int64_t LONGLONG
Definition: typedefs.h:68
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by parse_headers().

◆ count_children()

static void count_children ( body_t body,
boolean  recurse,
ULONG count 
)
static

Definition at line 2504 of file mimeole.c.

2505{
2506 body_t *child;
2507
2509 {
2510 (*count)++;
2511 if(recurse) count_children(child, recurse, count);
2512 }
2513}
static void count_children(body_t *body, boolean recurse, ULONG *count)
Definition: mimeole.c:2504
GLuint GLuint GLsizei count
Definition: gl.h:1545
uint32_t entry
Definition: isohybrid.c:63
static HWND child
Definition: cursoricon.c:298
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
Definition: md5.c:100

Referenced by count_children(), and MimeMessage_CountBodies().

◆ create_body_offset_list()

static HRESULT create_body_offset_list ( IStream stm,
const char boundary,
struct list body_offsets 
)
static

Definition at line 2062 of file mimeole.c.

2063{
2064 HRESULT hr;
2065 DWORD read, boundary_start;
2066 int boundary_len = strlen(boundary);
2067 char *buf, *ptr, *overlap;
2068 DWORD start = 0, overlap_no;
2069 offset_entry_t *cur_body = NULL;
2070 BOOL is_first_line = TRUE;
2073
2074 list_init(body_offsets);
2075
2076 overlap_no = boundary_len + 5;
2077
2078 overlap = buf = HeapAlloc(GetProcessHeap(), 0, overlap_no + PARSER_BUF_SIZE + 1);
2079
2080 zero.QuadPart = 0;
2081 hr = IStream_Seek(stm, zero, STREAM_SEEK_CUR, &cur);
2082 start = cur.u.LowPart;
2083
2084 do {
2085 hr = IStream_Read(stm, overlap, PARSER_BUF_SIZE, &read);
2086 if(FAILED(hr)) goto end;
2087 if(read == 0) break;
2088 overlap[read] = '\0';
2089
2090 ptr = buf;
2091 while(1) {
2092 if(is_first_line) {
2093 is_first_line = FALSE;
2094 }else {
2095 ptr = strstr(ptr, "\r\n");
2096 if(!ptr)
2097 break;
2098 ptr += 2;
2099 }
2100
2101 boundary_start = start + ptr - buf;
2102
2103 if(*ptr == '-' && *(ptr + 1) == '-' && !memcmp(ptr + 2, boundary, boundary_len)) {
2104 ptr += boundary_len + 2;
2105
2106 if(*ptr == '\r' && *(ptr + 1) == '\n')
2107 {
2108 ptr += 2;
2109 if(cur_body)
2110 {
2111 cur_body->offsets.cbBodyEnd = boundary_start - 2;
2112 list_add_tail(body_offsets, &cur_body->entry);
2113 }
2114 cur_body = HeapAlloc(GetProcessHeap(), 0, sizeof(*cur_body));
2115 cur_body->offsets.cbBoundaryStart = boundary_start;
2116 cur_body->offsets.cbHeaderStart = start + ptr - buf;
2117 }
2118 else if(*ptr == '-' && *(ptr + 1) == '-')
2119 {
2120 if(cur_body)
2121 {
2122 cur_body->offsets.cbBodyEnd = boundary_start - 2;
2123 list_add_tail(body_offsets, &cur_body->entry);
2124 goto end;
2125 }
2126 }
2127 }
2128 }
2129
2130 if(overlap == buf) /* 1st iteration */
2131 {
2132 memmove(buf, buf + PARSER_BUF_SIZE - overlap_no, overlap_no);
2133 overlap = buf + overlap_no;
2134 start += read - overlap_no;
2135 }
2136 else
2137 {
2138 memmove(buf, buf + PARSER_BUF_SIZE, overlap_no);
2139 start += read;
2140 }
2141 } while(1);
2142
2143end:
2145 return hr;
2146}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void list_init(struct list_entry *head)
Definition: list.h:51
FxCollectionEntry * cur
GLuint start
Definition: gl.h:1545
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
int zero
Definition: sehframes.cpp:29
Definition: mimeole.c:2057
BODYOFFSETS offsets
Definition: mimeole.c:2059
struct list entry
Definition: mimeole.c:2058

Referenced by create_sub_body().

◆ create_sub_body()

static body_t * create_sub_body ( MimeMessage msg,
IStream pStm,
BODYOFFSETS *  offset,
body_t parent 
)
static

Definition at line 2148 of file mimeole.c.

2149{
2151 MimeBody *mime_body;
2152 HRESULT hr;
2153 body_t *body;
2155
2156 pos.QuadPart = offset->cbHeaderStart;
2157 IStream_Seek(pStm, pos, STREAM_SEEK_SET, NULL);
2158
2159 mime_body = mimebody_create();
2160 IMimeBody_Load(&mime_body->IMimeBody_iface, pStm);
2161
2162 pos.QuadPart = 0;
2163 hr = IStream_Seek(pStm, pos, STREAM_SEEK_CUR, &start);
2164 offset->cbBodyStart = start.QuadPart;
2165 if (parent) MimeBody_set_offsets(mime_body, offset);
2166
2167 length.QuadPart = offset->cbBodyEnd - offset->cbBodyStart;
2168 create_sub_stream(pStm, start, length, (IStream**)&mime_body->data);
2169 mime_body->data_iid = IID_IStream;
2170
2171 body = new_body_entry(mime_body, msg->next_index++, parent);
2172
2173 if(IMimeBody_IsContentType(&mime_body->IMimeBody_iface, "multipart", NULL) == S_OK)
2174 {
2175 MIMEPARAMINFO *param_info;
2176 ULONG count, i;
2177 IMimeAllocator *alloc;
2178
2179 hr = IMimeBody_GetParameters(&mime_body->IMimeBody_iface, "Content-Type", &count,
2180 &param_info);
2181 if(hr != S_OK || count == 0) return body;
2182
2184
2185 for(i = 0; i < count; i++)
2186 {
2187 if(!lstrcmpiA(param_info[i].pszName, "boundary"))
2188 {
2189 struct list offset_list;
2190 offset_entry_t *cur, *cursor2;
2191 hr = create_body_offset_list(pStm, param_info[i].pszData, &offset_list);
2192 LIST_FOR_EACH_ENTRY_SAFE(cur, cursor2, &offset_list, offset_entry_t, entry)
2193 {
2194 body_t *sub_body;
2195
2196 sub_body = create_sub_body(msg, pStm, &cur->offsets, body);
2197 list_add_tail(&body->children, &sub_body->entry);
2198 list_remove(&cur->entry);
2200 }
2201 break;
2202 }
2203 }
2204 IMimeAllocator_FreeParamInfoArray(alloc, count, param_info, TRUE);
2205 IMimeAllocator_Release(alloc);
2206 }
2207 return body;
2208}
#define msg(x)
Definition: auth_time.c:54
static void list_remove(struct list_entry *entry)
Definition: list.h:90
Definition: list.h:37
static HRESULT create_body_offset_list(IStream *stm, const char *boundary, struct list *body_offsets)
Definition: mimeole.c:2062
static HRESULT MimeBody_set_offsets(MimeBody *body, const BODYOFFSETS *offsets)
Definition: mimeole.c:1881
static MimeBody * mimebody_create(void)
Definition: mimeole.c:1892
HRESULT WINAPI MimeOleGetAllocator(IMimeAllocator **alloc)
Definition: mimeole.c:3530
static body_t * new_body_entry(MimeBody *mime_body, DWORD index, body_t *parent)
Definition: mimeole.c:2041
static body_t * create_sub_body(MimeMessage *msg, IStream *pStm, BODYOFFSETS *offset, body_t *parent)
Definition: mimeole.c:2148
static HRESULT create_sub_stream(IStream *stream, ULARGE_INTEGER start, ULARGE_INTEGER length, IStream **out)
Definition: mimeole.c:430
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4223
r parent
Definition: btrfs.c:3010
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define alloc
Definition: rosglue.h:13
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
void * data
Definition: mimeole.c:169
IID data_iid
Definition: mimeole.c:170
IMimeBody IMimeBody_iface
Definition: mimeole.c:158
struct list entry
Definition: mimeole.c:1941
uint32_t ULONG
Definition: typedefs.h:59

Referenced by create_sub_body(), and MimeMessage_Load().

◆ create_sub_stream()

static HRESULT create_sub_stream ( IStream stream,
ULARGE_INTEGER  start,
ULARGE_INTEGER  length,
IStream **  out 
)
static

Definition at line 430 of file mimeole.c.

431{
433
434 *out = NULL;
435 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
436 if(!This) return E_OUTOFMEMORY;
437
438 This->IStream_iface.lpVtbl = &sub_stream_vtbl;
439 This->ref = 1;
440 This->start = start;
441 This->length = length;
442 This->pos.QuadPart = 0;
443 IStream_AddRef(stream);
444 This->base = stream;
445
446 *out = &This->IStream_iface;
447 return S_OK;
448}
static struct IStreamVtbl sub_stream_vtbl
Definition: mimeole.c:412
static FILE * out
Definition: regtests2xml.c:44
Definition: parse.h:23

Referenced by create_sub_body(), and MimeBody_GetData().

◆ decode_base64()

static HRESULT decode_base64 ( IStream input,
IStream **  ret_stream 
)
static

Definition at line 1560 of file mimeole.c.

1561{
1562 const unsigned char *ptr, *end;
1563 unsigned char buf[1024];
1565 unsigned char *ret;
1566 unsigned char in[4];
1567 IStream *output;
1568 DWORD size;
1569 int n = 0;
1570 HRESULT hres;
1571
1572 pos.QuadPart = 0;
1573 hres = IStream_Seek(input, pos, STREAM_SEEK_SET, NULL);
1574 if(FAILED(hres))
1575 return hres;
1576
1577 hres = CreateStreamOnHGlobal(NULL, TRUE, &output);
1578 if(FAILED(hres))
1579 return hres;
1580
1581 while(1) {
1582 hres = IStream_Read(input, buf, sizeof(buf), &size);
1583 if(FAILED(hres) || !size)
1584 break;
1585
1586 ptr = ret = buf;
1587 end = buf + size;
1588
1589 while(1) {
1590 /* skip invalid chars */
1591 while(ptr < end && (*ptr >= ARRAY_SIZE(base64_decode_table)
1592 || base64_decode_table[*ptr] == -1))
1593 ptr++;
1594 if(ptr == end)
1595 break;
1596
1597 in[n++] = base64_decode_table[*ptr++];
1598 switch(n) {
1599 case 2:
1600 *ret++ = in[0] << 2 | in[1] >> 4;
1601 continue;
1602 case 3:
1603 *ret++ = in[1] << 4 | in[2] >> 2;
1604 continue;
1605 case 4:
1606 *ret++ = ((in[2] << 6) & 0xc0) | in[3];
1607 n = 0;
1608 }
1609 }
1610
1611 if(ret > buf) {
1612 hres = IStream_Write(output, buf, ret - buf, NULL);
1613 if(FAILED(hres))
1614 break;
1615 }
1616 }
1617
1618 if(SUCCEEDED(hres))
1619 hres = IStream_Seek(output, pos, STREAM_SEEK_SET, NULL);
1620 if(FAILED(hres)) {
1621 IStream_Release(output);
1622 return hres;
1623 }
1624
1625 *ret_stream = output;
1626 return S_OK;
1627}
#define ARRAY_SIZE(A)
Definition: main.h:20
static const signed char base64_decode_table[]
Definition: mimeole.c:1548
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
GLdouble n
Definition: glext.h:7729
GLuint in
Definition: glext.h:9616
GLenum GLenum GLenum input
Definition: glext.h:9031
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hres
Definition: protocol.c:465
int ret

Referenced by MimeBody_GetData().

◆ decode_qp()

static HRESULT decode_qp ( IStream input,
IStream **  ret_stream 
)
static

Definition at line 1640 of file mimeole.c.

1641{
1642 const unsigned char *ptr, *end;
1643 unsigned char *ret, prev = 0;
1644 unsigned char buf[1024];
1646 IStream *output;
1647 DWORD size;
1648 int n = -1;
1649 HRESULT hres;
1650
1651 pos.QuadPart = 0;
1652 hres = IStream_Seek(input, pos, STREAM_SEEK_SET, NULL);
1653 if(FAILED(hres))
1654 return hres;
1655
1656 hres = CreateStreamOnHGlobal(NULL, TRUE, &output);
1657 if(FAILED(hres))
1658 return hres;
1659
1660 while(1) {
1661 hres = IStream_Read(input, buf, sizeof(buf), &size);
1662 if(FAILED(hres) || !size)
1663 break;
1664
1665 ptr = ret = buf;
1666 end = buf + size;
1667
1668 while(ptr < end) {
1669 unsigned char byte = *ptr++;
1670
1671 switch(n) {
1672 case -1:
1673 if(byte == '=')
1674 n = 0;
1675 else
1676 *ret++ = byte;
1677 continue;
1678 case 0:
1679 prev = byte;
1680 n = 1;
1681 continue;
1682 case 1:
1683 if(prev != '\r' || byte != '\n') {
1684 int h1 = hex_digit(prev), h2 = hex_digit(byte);
1685 if(h1 != -1 && h2 != -1)
1686 *ret++ = (h1 << 4) | h2;
1687 else
1688 *ret++ = '=';
1689 }
1690 n = -1;
1691 continue;
1692 }
1693 }
1694
1695 if(ret > buf) {
1696 hres = IStream_Write(output, buf, ret - buf, NULL);
1697 if(FAILED(hres))
1698 break;
1699 }
1700 }
1701
1702 if(SUCCEEDED(hres))
1703 hres = IStream_Seek(output, pos, STREAM_SEEK_SET, NULL);
1704 if(FAILED(hres)) {
1705 IStream_Release(output);
1706 return hres;
1707 }
1708
1709 *ret_stream = output;
1710 return S_OK;
1711}
#define hex_digit(c)
Definition: btrfs_drv.h:1748
#define byte(x, n)
Definition: tomcrypt.h:118

Referenced by MimeBody_GetData().

◆ empty_body_list()

static void empty_body_list ( struct list list)
static

Definition at line 1994 of file mimeole.c.

1995{
1996 body_t *body, *cursor2;
1998 {
1999 empty_body_list(&body->children);
2000 list_remove(&body->entry);
2001 IMimeBody_Release(&body->mime_body->IMimeBody_iface);
2003 }
2004}
static void empty_body_list(struct list *list)
Definition: mimeole.c:1994

Referenced by empty_body_list(), MimeMessage_Load(), and MimeMessage_Release().

◆ empty_header_list()

static void empty_header_list ( struct list list)
static

Definition at line 833 of file mimeole.c.

834{
835 header_t *header, *cursor2;
836
838 {
840 }
841}
static void free_header(header_t *header)
Definition: mimeole.c:825

Referenced by MimeBody_Release().

◆ empty_new_prop_list()

static void empty_new_prop_list ( struct list list)
static

Definition at line 843 of file mimeole.c.

844{
845 property_list_entry_t *prop, *cursor2;
846
848 {
849 list_remove(&prop->entry);
850 HeapFree(GetProcessHeap(), 0, (char *)prop->prop.name);
851 HeapFree(GetProcessHeap(), 0, prop);
852 }
853}
Definition: mimeole.c:57
struct list entry
Definition: mimeole.c:58
property_t prop
Definition: mimeole.c:59
LPCSTR name
Definition: mimeole.c:50

Referenced by MimeBody_Release().

◆ empty_param_list()

static void empty_param_list ( struct list list)
static

Definition at line 812 of file mimeole.c.

813{
814 param_t *param, *cursor2;
815
817 {
818 list_remove(&param->entry);
822 }
823}
char * value
Definition: compiler.c:67
char * name
Definition: compiler.c:66

Referenced by free_header().

◆ find_body()

static HRESULT find_body ( struct list list,
HBODY  hbody,
body_t **  body 
)
static

Definition at line 2330 of file mimeole.c.

2331{
2332 body_t *cur;
2333 HRESULT hr;
2334
2335 if(hbody == HBODY_ROOT)
2336 {
2338 return S_OK;
2339 }
2340
2342 {
2343 if(cur->index == HandleToUlong(hbody))
2344 {
2345 *body = cur;
2346 return S_OK;
2347 }
2348 hr = find_body(&cur->children, hbody, body);
2349 if(hr == S_OK) return S_OK;
2350 }
2351 return S_FALSE;
2352}
#define HandleToUlong(h)
Definition: basetsd.h:79
static HRESULT find_body(struct list *list, HBODY hbody, body_t **body)
Definition: mimeole.c:2330
Definition: list.h:15
#define LIST_ENTRY(type)
Definition: queue.h:175
#define S_FALSE
Definition: winerror.h:2357

Referenced by find_body(), get_body(), MimeMessage_BindToObject(), MimeMessage_CountBodies(), and MimeMessage_FindNext().

◆ find_default_prop()

static const property_t * find_default_prop ( const char name)
static

Definition at line 891 of file mimeole.c.

892{
893 const property_t *prop_def = NULL;
894
895 for(prop_def = default_props; prop_def->name; prop_def++)
896 {
897 if(ISPIDSTR(name))
898 {
899 if(STRTOPID(name) == prop_def->id)
900 {
901 break;
902 }
903 }
904 else if(!lstrcmpiA(name, prop_def->name))
905 {
906 break;
907 }
908 }
909
910 if(prop_def->id)
911 TRACE("%s: found match with default property id %d\n", prop_def->name, prop_def->id);
912 else
913 prop_def = NULL;
914
915 return prop_def;
916}
static const property_t default_props[]
Definition: mimeole.c:62
DWORD id
Definition: mimeole.c:51

Referenced by MimeBody_SetProp().

◆ find_next()

static HRESULT find_next ( MimeMessage This,
body_t body,
FINDBODY *  find,
HBODY *  out 
)
static

Definition at line 2533 of file mimeole.c.

2534{
2535 struct list *ptr;
2536 HBODY next;
2537
2538 for (;;)
2539 {
2540 if (!body) ptr = list_head( &This->body_tree );
2541 else
2542 {
2543 ptr = list_head( &body->children );
2544 while (!ptr)
2545 {
2546 if (!body->parent) return MIME_E_NOT_FOUND;
2547 if (!(ptr = list_next( &body->parent->children, &body->entry ))) body = body->parent;
2548 }
2549 }
2550
2552 next = UlongToHandle( body->index );
2553 find->dwReserved = body->index;
2554 if (IMimeBody_IsContentType(&body->mime_body->IMimeBody_iface, find->pszPriType,
2555 find->pszSubType) == S_OK)
2556 {
2557 *out = next;
2558 return S_OK;
2559 }
2560 }
2561 return MIME_E_NOT_FOUND;
2562}
#define UlongToHandle(ul)
Definition: basetsd.h:97
static TAGID TAGID find
Definition: db.cpp:155
static unsigned __int64 next
Definition: rand_nt.c:6
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:115

Referenced by MimeMessage_FindFirst(), and MimeMessage_FindNext().

◆ find_prop()

static HRESULT find_prop ( MimeBody body,
const char name,
header_t **  prop 
)
static

Definition at line 865 of file mimeole.c.

866{
868
869 *prop = NULL;
870
872 {
873 if(ISPIDSTR(name))
874 {
875 if(STRTOPID(name) == header->prop->id)
876 {
877 *prop = header;
878 return S_OK;
879 }
880 }
881 else if(!lstrcmpiA(name, header->prop->name))
882 {
883 *prop = header;
884 return S_OK;
885 }
886 }
887
888 return MIME_E_NOT_FOUND;
889}

Referenced by MimeBody_GetParameters(), MimeBody_GetProp(), MimeBody_GetPropInfo(), and MimeBody_SetProp().

◆ free_header()

static void free_header ( header_t header)
static

Definition at line 825 of file mimeole.c.

826{
827 list_remove(&header->entry);
829 empty_param_list(&header->params);
831}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
static void empty_param_list(struct list *list)
Definition: mimeole.c:812
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
Definition: ole2.c:2968
WCHAR * value

Referenced by empty_header_list(), and MimeBody_DeleteProp().

◆ get_body()

static HRESULT get_body ( MimeMessage msg,
BODYLOCATION  location,
HBODY  pivot,
body_t **  out 
)
static

Definition at line 2387 of file mimeole.c.

2388{
2389 body_t *root = LIST_ENTRY(list_head(&msg->body_tree), body_t, entry);
2390 body_t *body;
2391 HRESULT hr;
2392 struct list *list;
2393
2394 if(location == IBL_ROOT)
2395 {
2396 *out = root;
2397 return S_OK;
2398 }
2399
2400 hr = find_body(&msg->body_tree, pivot, &body);
2401
2402 if(hr == S_OK)
2403 {
2404 switch(location)
2405 {
2406 case IBL_PARENT:
2407 if(body->parent)
2408 *out = body->parent;
2409 else
2410 hr = MIME_E_NOT_FOUND;
2411 break;
2412
2413 case IBL_FIRST:
2414 list = list_head(&body->children);
2415 if(list)
2417 else
2418 hr = MIME_E_NOT_FOUND;
2419 break;
2420
2421 case IBL_LAST:
2422 list = list_tail(&body->children);
2423 if(list)
2425 else
2426 hr = MIME_E_NOT_FOUND;
2427 break;
2428
2429 case IBL_NEXT:
2430 list = list_next(&body->parent->children, &body->entry);
2431 if(list)
2433 else
2434 hr = MIME_E_NOT_FOUND;
2435 break;
2436
2437 case IBL_PREVIOUS:
2438 list = list_prev(&body->parent->children, &body->entry);
2439 if(list)
2441 else
2442 hr = MIME_E_NOT_FOUND;
2443 break;
2444
2445 default:
2446 hr = E_FAIL;
2447 break;
2448 }
2449 }
2450
2451 return hr;
2452}
static INT pivot(list_t &list, INT i, INT j)
struct _root root
#define E_FAIL
Definition: ddrawi.h:102
#define list
Definition: rosglue.h:35
__WINE_SERVER_LIST_INLINE struct list * list_prev(const struct list *list, const struct list *elem)
Definition: list.h:123
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)
Definition: list.h:137

Referenced by MimeMessage_GetBody().

◆ get_stream_size()

static HRESULT get_stream_size ( IStream stream,
ULARGE_INTEGER size 
)
static

Definition at line 450 of file mimeole.c.

451{
452 STATSTG statstg = {NULL};
455
456 hres = IStream_Stat(stream, &statstg, STATFLAG_NONAME);
457 if(SUCCEEDED(hres)) {
458 *size = statstg.cbSize;
459 return S_OK;
460 }
461
462 zero.QuadPart = 0;
463 return IStream_Seek(stream, zero, STREAM_SEEK_END, size);
464}

Referenced by MimeBody_GetData().

◆ hex_digit()

static int hex_digit ( char  c)
static

Definition at line 1629 of file mimeole.c.

1630{
1631 if('0' <= c && c <= '9')
1632 return c - '0';
1633 if('A' <= c && c <= 'F')
1634 return c - 'A' + 10;
1635 if('a' <= c && c <= 'f')
1636 return c - 'a' + 10;
1637 return -1;
1638}
const GLubyte * c
Definition: glext.h:8905

◆ impl_from_IMimeBody()

◆ impl_from_IMimeMessage()

◆ impl_from_IMimePropertySchema()

static propschema * impl_from_IMimePropertySchema ( IMimePropertySchema *  iface)
inlinestatic

◆ impl_from_IMimeSecurity()

static MimeSecurity * impl_from_IMimeSecurity ( IMimeSecurity iface)
inlinestatic

Definition at line 3154 of file mimeole.c.

3155{
3156 return CONTAINING_RECORD(iface, MimeSecurity, IMimeSecurity_iface);
3157}

Referenced by MimeSecurity_AddRef(), and MimeSecurity_Release().

◆ impl_from_IStream()

◆ init_content_encoding()

static void init_content_encoding ( MimeBody body,
header_t header 
)
static

Definition at line 767 of file mimeole.c.

768{
769 const char *encoding = header->value.u.pszVal;
770
771 if(!_strnicmp(encoding, "base64", -1))
772 body->encoding = IET_BASE64;
773 else if(!_strnicmp(encoding, "quoted-printable", -1))
774 body->encoding = IET_QP;
775 else if(!_strnicmp(encoding, "7bit", -1))
776 body->encoding = IET_7BIT;
777 else if(!_strnicmp(encoding, "8bit", -1))
778 body->encoding = IET_8BIT;
779 else
780 FIXME("unknown encoding %s\n", debugstr_a(encoding));
781}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define _strnicmp(_String1, _String2, _MaxCount)
Definition: compat.h:23
#define debugstr_a
Definition: kernel32.h:31
@ IET_QP
Definition: mimeole.idl:235
@ IET_7BIT
Definition: mimeole.idl:236
@ IET_8BIT
Definition: mimeole.idl:237
@ IET_BASE64
Definition: mimeole.idl:233
static char * encoding
Definition: xmllint.c:155

Referenced by parse_headers().

◆ init_content_type()

static void init_content_type ( MimeBody body,
header_t header 
)
static

Definition at line 749 of file mimeole.c.

750{
751 char *slash;
752 DWORD len;
753
754 slash = strchr(header->value.u.pszVal, '/');
755 if(!slash)
756 {
757 WARN("malformed context type value\n");
758 return;
759 }
760 len = slash - header->value.u.pszVal;
761 body->content_pri_type = HeapAlloc(GetProcessHeap(), 0, len + 1);
762 memcpy(body->content_pri_type, header->value.u.pszVal, len);
763 body->content_pri_type[len] = '\0';
764 body->content_sub_type = strdupA(slash + 1);
765}
static LPSTR strdupA(LPCSTR str)
Definition: mimeole.c:482
GLenum GLsizei len
Definition: glext.h:6722

Referenced by parse_headers().

◆ mime_obj_AddRef()

static ULONG WINAPI mime_obj_AddRef ( IUnknown iface)
static

Definition at line 3676 of file mimeole.c.

3677{
3678 TRACE("\n");
3679 return 2;
3680}

◆ mime_obj_QueryInterface()

static HRESULT WINAPI mime_obj_QueryInterface ( IUnknown iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 3669 of file mimeole.c.

3670{
3671 FIXME("(%s %p)\n", debugstr_guid(riid), ppv);
3672 *ppv = NULL;
3673 return E_NOINTERFACE;
3674}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ mime_obj_Release()

static ULONG WINAPI mime_obj_Release ( IUnknown iface)
static

Definition at line 3682 of file mimeole.c.

3683{
3684 TRACE("\n");
3685 return 1;
3686}

◆ MimeAlloc_AddRef()

static ULONG WINAPI MimeAlloc_AddRef ( IMimeAllocator *  iface)
static

Definition at line 3357 of file mimeole.c.

3359{
3360 return 2;
3361}

◆ MimeAlloc_Alloc()

static LPVOID WINAPI MimeAlloc_Alloc ( IMimeAllocator *  iface,
SIZE_T  cb 
)
static

Definition at line 3369 of file mimeole.c.

3372{
3373 return CoTaskMemAlloc(cb);
3374}
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33

◆ MimeAlloc_DidAlloc()

static int WINAPI MimeAlloc_DidAlloc ( IMimeAllocator *  iface,
LPVOID  pv 
)
static

Definition at line 3399 of file mimeole.c.

3402{
3403 FIXME("stub\n");
3404 return 0;
3405}

◆ MimeAlloc_Free()

static void WINAPI MimeAlloc_Free ( IMimeAllocator *  iface,
LPVOID  pv 
)
static

Definition at line 3384 of file mimeole.c.

3387{
3388 CoTaskMemFree(pv);
3389}
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442

◆ MimeAlloc_FreeAddressList()

static HRESULT WINAPI MimeAlloc_FreeAddressList ( IMimeAllocator *  iface,
LPADDRESSLIST  pList 
)
static

Definition at line 3432 of file mimeole.c.

3435{
3436 FIXME("stub\n");
3437 return E_NOTIMPL;
3438}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ MimeAlloc_FreeAddressProps()

static HRESULT WINAPI MimeAlloc_FreeAddressProps ( IMimeAllocator *  iface,
LPADDRESSPROPS  pAddress 
)
static

Definition at line 3440 of file mimeole.c.

3443{
3444 FIXME("stub\n");
3445 return E_NOTIMPL;
3446}

◆ MimeAlloc_FreeEnumHeaderRowArray()

static HRESULT WINAPI MimeAlloc_FreeEnumHeaderRowArray ( IMimeAllocator *  iface,
ULONG  cRows,
LPENUMHEADERROW  prgRow,
boolean  fFreeArray 
)
static

Definition at line 3459 of file mimeole.c.

3464{
3465 FIXME("stub\n");
3466 return E_NOTIMPL;
3467}

◆ MimeAlloc_FreeEnumPropertyArray()

static HRESULT WINAPI MimeAlloc_FreeEnumPropertyArray ( IMimeAllocator *  iface,
ULONG  cProps,
LPENUMPROPERTY  prgProp,
boolean  fFreeArray 
)
static

Definition at line 3469 of file mimeole.c.

3474{
3475 FIXME("stub\n");
3476 return E_NOTIMPL;
3477}

◆ MimeAlloc_FreeParamInfoArray()

static HRESULT WINAPI MimeAlloc_FreeParamInfoArray ( IMimeAllocator *  iface,
ULONG  cParams,
LPMIMEPARAMINFO  prgParam,
boolean  fFreeArray 
)
static

Definition at line 3414 of file mimeole.c.

3419{
3420 ULONG i;
3421 TRACE("(%p)->(%d, %p, %d)\n", iface, cParams, prgParam, fFreeArray);
3422
3423 for(i = 0; i < cParams; i++)
3424 {
3425 IMimeAllocator_Free(iface, prgParam[i].pszName);
3426 IMimeAllocator_Free(iface, prgParam[i].pszData);
3427 }
3428 if(fFreeArray) IMimeAllocator_Free(iface, prgParam);
3429 return S_OK;
3430}

◆ MimeAlloc_FreeThumbprint()

static HRESULT WINAPI MimeAlloc_FreeThumbprint ( IMimeAllocator *  iface,
THUMBBLOB *  pthumbprint 
)
static

Definition at line 3479 of file mimeole.c.

3482{
3483 FIXME("stub\n");
3484 return E_NOTIMPL;
3485}

◆ MimeAlloc_GetSize()

static SIZE_T WINAPI MimeAlloc_GetSize ( IMimeAllocator *  iface,
LPVOID  pv 
)
static

Definition at line 3391 of file mimeole.c.

3394{
3395 FIXME("stub\n");
3396 return 0;
3397}

◆ MimeAlloc_HeapMinimize()

static void WINAPI MimeAlloc_HeapMinimize ( IMimeAllocator *  iface)
static

Definition at line 3407 of file mimeole.c.

3409{
3410 FIXME("stub\n");
3411 return;
3412}

◆ MimeAlloc_PropVariantClear()

static HRESULT WINAPI MimeAlloc_PropVariantClear ( IMimeAllocator *  iface,
LPPROPVARIANT  pProp 
)
static

Definition at line 3488 of file mimeole.c.

3491{
3492 FIXME("stub\n");
3493 return E_NOTIMPL;
3494}

◆ MimeAlloc_QueryInterface()

static HRESULT WINAPI MimeAlloc_QueryInterface ( IMimeAllocator *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 3336 of file mimeole.c.

3340{
3341 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), obj);
3342
3343 if (IsEqualIID(riid, &IID_IUnknown) ||
3344 IsEqualIID(riid, &IID_IMalloc) ||
3345 IsEqualIID(riid, &IID_IMimeAllocator))
3346 {
3347 *obj = iface;
3348 IMimeAllocator_AddRef(iface);
3349 return S_OK;
3350 }
3351
3352 FIXME("no interface for %s\n", debugstr_guid(riid));
3353 *obj = NULL;
3354 return E_NOINTERFACE;
3355}
const GUID IID_IUnknown
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ MimeAlloc_Realloc()

static LPVOID WINAPI MimeAlloc_Realloc ( IMimeAllocator *  iface,
LPVOID  pv,
SIZE_T  cb 
)
static

Definition at line 3376 of file mimeole.c.

3380{
3381 return CoTaskMemRealloc(pv, cb);
3382}
LPVOID WINAPI CoTaskMemRealloc(LPVOID pvOld, SIZE_T size)
Definition: ifs.c:460

◆ MimeAlloc_Release()

static ULONG WINAPI MimeAlloc_Release ( IMimeAllocator *  iface)
static

Definition at line 3363 of file mimeole.c.

3365{
3366 return 1;
3367}

◆ MimeAlloc_ReleaseObjects()

static HRESULT WINAPI MimeAlloc_ReleaseObjects ( IMimeAllocator *  iface,
ULONG  cObjects,
IUnknown **  prgpUnknown,
boolean  fFreeArray 
)
static

Definition at line 3448 of file mimeole.c.

3453{
3454 FIXME("stub\n");
3455 return E_NOTIMPL;
3456}

◆ MimeAllocator_create()

HRESULT MimeAllocator_create ( IUnknown outer,
void **  obj 
)

Definition at line 3522 of file mimeole.c.

3523{
3524 if(outer) return CLASS_E_NOAGGREGATION;
3525
3526 *obj = &mime_allocator;
3527 return S_OK;
3528}
static IMimeAllocator mime_allocator
Definition: mimeole.c:3517
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

Referenced by MimeOleGetAllocator().

◆ MimeBody_AddRef()

static ULONG WINAPI MimeBody_AddRef ( IMimeBody iface)
static

Definition at line 945 of file mimeole.c.

946{
949
950 TRACE("(%p) ref=%d\n", This, ref);
951
952 return ref;
953}
#define InterlockedIncrement
Definition: armddk.h:53
static MimeBody * impl_from_IMimeBody(IMimeBody *iface)
Definition: mimeole.c:466
long LONG
Definition: pedump.c:60
Definition: send.c:48

◆ MimeBody_AppendProp()

static HRESULT WINAPI MimeBody_AppendProp ( IMimeBody iface,
LPCSTR  pszName,
DWORD  dwFlags,
LPPROPVARIANT  pValue 
)
static

Definition at line 1213 of file mimeole.c.

1218{
1220 FIXME("(%p)->(%s, 0x%x, %p) stub\n", This, debugstr_a(pszName), dwFlags, pValue);
1221 return E_NOTIMPL;
1222}
PWCHAR pValue
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

◆ MimeBody_BindToObject()

static HRESULT WINAPI MimeBody_BindToObject ( IMimeBody iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1385 of file mimeole.c.

1389{
1391 FIXME("(%p)->(%s, %p) stub\n", This, debugstr_guid(riid), ppvObject);
1392 return E_NOTIMPL;
1393}
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ MimeBody_Clone()

static HRESULT WINAPI MimeBody_Clone ( IMimeBody iface,
IMimePropertySet **  ppPropertySet 
)
static

Definition at line 1395 of file mimeole.c.

1398{
1400 FIXME("(%p)->(%p) stub\n", This, ppPropertySet);
1401 return E_NOTIMPL;
1402}

◆ MimeBody_CopyProps()

static HRESULT WINAPI MimeBody_CopyProps ( IMimeBody iface,
ULONG  cNames,
LPCSTR prgszName,
IMimePropertySet *  pPropertySet 
)
static

Definition at line 1251 of file mimeole.c.

1256{
1258 FIXME("(%p)->(%d, %p, %p) stub\n", This, cNames, prgszName, pPropertySet);
1259 return E_NOTIMPL;
1260}

◆ MimeBody_CopyTo()

static HRESULT WINAPI MimeBody_CopyTo ( IMimeBody iface,
IMimeBody pBody 
)
static

Definition at line 1792 of file mimeole.c.

1795{
1797 FIXME("(%p)->(%p) stub\n", This, pBody);
1798 return E_NOTIMPL;
1799}

◆ MimeBody_create()

HRESULT MimeBody_create ( IUnknown outer,
void **  ppv 
)

Definition at line 1920 of file mimeole.c.

1921{
1922 MimeBody *mb;
1923
1924 if(outer)
1925 return CLASS_E_NOAGGREGATION;
1926
1927 if ((mb = mimebody_create()))
1928 {
1929 *ppv = &mb->IMimeBody_iface;
1930 return S_OK;
1931 }
1932 else
1933 {
1934 *ppv = NULL;
1935 return E_OUTOFMEMORY;
1936 }
1937}

◆ mimebody_create()

static MimeBody * mimebody_create ( void  )
static

Definition at line 1892 of file mimeole.c.

1893{
1894 MimeBody *This;
1895 BODYOFFSETS body_offsets;
1896
1897 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
1898 if (!This)
1899 return NULL;
1900
1901 This->IMimeBody_iface.lpVtbl = &body_vtbl;
1902 This->ref = 1;
1903 This->handle = NULL;
1904 list_init(&This->headers);
1905 list_init(&This->new_props);
1906 This->next_prop_id = FIRST_CUSTOM_PROP_ID;
1907 This->content_pri_type = NULL;
1908 This->content_sub_type = NULL;
1909 This->encoding = IET_7BIT;
1910 This->data = NULL;
1911 This->data_iid = IID_NULL;
1912
1913 body_offsets.cbBoundaryStart = body_offsets.cbHeaderStart = 0;
1914 body_offsets.cbBodyStart = body_offsets.cbBodyEnd = 0;
1915 MimeBody_set_offsets(This, &body_offsets);
1916
1917 return This;
1918}
#define FIRST_CUSTOM_PROP_ID
Definition: mimeole.c:1890
static IMimeBodyVtbl body_vtbl
Definition: mimeole.c:1834
#define IID_NULL
Definition: guiddef.h:98

Referenced by create_sub_body(), MimeBody_create(), and MimeMessage_create().

◆ MimeBody_DeleteExcept()

static HRESULT WINAPI MimeBody_DeleteExcept ( IMimeBody iface,
ULONG  cNames,
LPCSTR prgszName 
)
static

Definition at line 1273 of file mimeole.c.

1277{
1279 FIXME("(%p)->(%d, %p) stub\n", This, cNames, prgszName);
1280 return E_NOTIMPL;
1281}

◆ MimeBody_DeleteProp()

static HRESULT WINAPI MimeBody_DeleteProp ( IMimeBody iface,
LPCSTR  pszName 
)
static

Definition at line 1224 of file mimeole.c.

1227{
1230 BOOL found;
1231
1232 TRACE("(%p)->(%s) stub\n", This, debugstr_a(pszName));
1233
1235 {
1236 if(ISPIDSTR(pszName))
1237 found = STRTOPID(pszName) == cursor->prop->id;
1238 else
1239 found = !lstrcmpiA(pszName, cursor->prop->name);
1240
1241 if(found)
1242 {
1244 return S_OK;
1245 }
1246 }
1247
1248 return MIME_E_NOT_FOUND;
1249}
const char cursor[]
Definition: icontest.c:13

◆ MimeBody_EmptyData()

static HRESULT WINAPI MimeBody_EmptyData ( IMimeBody iface)
static

Definition at line 1784 of file mimeole.c.

1786{
1788 FIXME("(%p)->() stub\n", This);
1789 return E_NOTIMPL;
1790}

◆ MimeBody_EnumProps()

static HRESULT WINAPI MimeBody_EnumProps ( IMimeBody iface,
DWORD  dwFlags,
IMimeEnumProperties **  ppEnum 
)
static

Definition at line 1446 of file mimeole.c.

1450{
1452 FIXME("(%p)->(0x%x, %p) stub\n", This, dwFlags, ppEnum);
1453 return E_NOTIMPL;
1454}

◆ MimeBody_GetCharset()

static HRESULT WINAPI MimeBody_GetCharset ( IMimeBody iface,
LPHCHARSET  phCharset 
)
static

Definition at line 1295 of file mimeole.c.

1298{
1300 FIXME("(%p)->(%p) stub\n", This, phCharset);
1301 *phCharset = NULL;
1302 return S_OK;
1303}

◆ MimeBody_GetClassID()

static HRESULT WINAPI MimeBody_GetClassID ( IMimeBody iface,
CLSID pClassID 
)
static

Definition at line 978 of file mimeole.c.

981{
983
984 TRACE("(%p)->(%p)\n", This, pClassID);
985
986 if(!pClassID)
987 return E_INVALIDARG;
988
989 *pClassID = IID_IMimeBody;
990 return S_OK;
991}
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ MimeBody_GetCurrentEncoding()

static HRESULT WINAPI MimeBody_GetCurrentEncoding ( IMimeBody iface,
ENCODINGTYPE *  pietEncoding 
)
static

Definition at line 1504 of file mimeole.c.

1507{
1509
1510 TRACE("(%p)->(%p)\n", This, pietEncoding);
1511
1512 *pietEncoding = This->encoding;
1513 return S_OK;
1514}

◆ MimeBody_GetData()

static HRESULT WINAPI MimeBody_GetData ( IMimeBody iface,
ENCODINGTYPE  ietEncoding,
IStream **  ppStream 
)
static

Definition at line 1713 of file mimeole.c.

1717{
1720 HRESULT hres;
1721
1722 TRACE("(%p)->(%d %p)\n", This, ietEncoding, ppStream);
1723
1724 if(This->encoding != ietEncoding) {
1725 switch(This->encoding) {
1726 case IET_BASE64:
1727 hres = decode_base64(This->data, ppStream);
1728 break;
1729 case IET_QP:
1730 hres = decode_qp(This->data, ppStream);
1731 break;
1732 default:
1733 FIXME("Decoding %d is not supported.\n", This->encoding);
1734 hres = S_FALSE;
1735 }
1736 if(ietEncoding != IET_BINARY)
1737 FIXME("Encoding %d is not supported.\n", ietEncoding);
1738 if(hres != S_FALSE)
1739 return hres;
1740 }
1741
1742 start.QuadPart = 0;
1743 hres = get_stream_size(This->data, &size);
1744 if(SUCCEEDED(hres))
1745 hres = create_sub_stream(This->data, start, size, ppStream);
1746 return hres;
1747}
static HRESULT decode_base64(IStream *input, IStream **ret_stream)
Definition: mimeole.c:1560
static HRESULT decode_qp(IStream *input, IStream **ret_stream)
Definition: mimeole.c:1640
static HRESULT get_stream_size(IStream *stream, ULARGE_INTEGER *size)
Definition: mimeole.c:450

◆ MimeBody_GetDataHere()

static HRESULT WINAPI MimeBody_GetDataHere ( IMimeBody iface,
ENCODINGTYPE  ietEncoding,
IStream pStream 
)
static

Definition at line 1538 of file mimeole.c.

1542{
1544 FIXME("(%p)->(%d, %p) stub\n", This, ietEncoding, pStream);
1545 return E_NOTIMPL;
1546}

◆ MimeBody_GetDisplayName()

static HRESULT WINAPI MimeBody_GetDisplayName ( IMimeBody iface,
LPSTR ppszDisplay 
)
static

Definition at line 1482 of file mimeole.c.

1485{
1487 FIXME("(%p)->(%p) stub\n", This, ppszDisplay);
1488 return E_NOTIMPL;
1489}

◆ MimeBody_GetEstimatedSize()

static HRESULT WINAPI MimeBody_GetEstimatedSize ( IMimeBody iface,
ENCODINGTYPE  ietEncoding,
ULONG pcbSize 
)
static

Definition at line 1528 of file mimeole.c.

1532{
1534 FIXME("(%p)->(%d, %p) stub\n", This, ietEncoding, pcbSize);
1535 return E_NOTIMPL;
1536}

◆ MimeBody_GetHandle()

static HRESULT WINAPI MimeBody_GetHandle ( IMimeBody iface,
LPHBODY  phBody 
)
static

Definition at line 1820 of file mimeole.c.

1823{
1825 TRACE("(%p)->(%p)\n", iface, phBody);
1826
1827 if(!phBody)
1828 return E_INVALIDARG;
1829
1830 *phBody = This->handle;
1831 return This->handle ? S_OK : MIME_E_NO_DATA;
1832}

◆ MimeBody_GetOffsets()

static HRESULT WINAPI MimeBody_GetOffsets ( IMimeBody iface,
LPBODYOFFSETS  pOffsets 
)
static

Definition at line 1491 of file mimeole.c.

1494{
1496 TRACE("(%p)->(%p)\n", This, pOffsets);
1497
1498 *pOffsets = This->body_offsets;
1499
1500 if(This->body_offsets.cbBodyEnd == 0) return MIME_E_NO_DATA;
1501 return S_OK;
1502}

◆ MimeBody_GetOption()

static HRESULT WINAPI MimeBody_GetOption ( IMimeBody iface,
const TYPEDID  oid,
LPPROPVARIANT  pValue 
)
static

Definition at line 1436 of file mimeole.c.

1440{
1442 FIXME("(%p)->(%08x, %p): stub\n", This, oid, pValue);
1443 return E_NOTIMPL;
1444}

◆ MimeBody_GetParameters()

static HRESULT WINAPI MimeBody_GetParameters ( IMimeBody iface,
LPCSTR  pszName,
ULONG pcParams,
LPMIMEPARAMINFO *  pprgParam 
)
static

Definition at line 1315 of file mimeole.c.

1320{
1322 HRESULT hr;
1324
1325 TRACE("(%p)->(%s, %p, %p)\n", iface, debugstr_a(pszName), pcParams, pprgParam);
1326
1327 *pprgParam = NULL;
1328 *pcParams = 0;
1329
1330 hr = find_prop(This, pszName, &header);
1331 if(hr != S_OK) return hr;
1332
1333 *pcParams = list_count(&header->params);
1334 if(*pcParams)
1335 {
1336 IMimeAllocator *alloc;
1337 param_t *param;
1338 MIMEPARAMINFO *info;
1339
1341
1342 *pprgParam = info = IMimeAllocator_Alloc(alloc, *pcParams * sizeof(**pprgParam));
1344 {
1345 int len;
1346
1347 len = strlen(param->name) + 1;
1348 info->pszName = IMimeAllocator_Alloc(alloc, len);
1349 memcpy(info->pszName, param->name, len);
1350 len = strlen(param->value) + 1;
1351 info->pszData = IMimeAllocator_Alloc(alloc, len);
1352 memcpy(info->pszData, param->value, len);
1353 info++;
1354 }
1355 IMimeAllocator_Release(alloc);
1356 }
1357 return S_OK;
1358}
static HRESULT find_prop(MimeBody *body, const char *name, header_t **prop)
Definition: mimeole.c:865
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
Definition: list.h:155

◆ MimeBody_GetProp()

static HRESULT WINAPI MimeBody_GetProp ( IMimeBody iface,
LPCSTR  pszName,
DWORD  dwFlags,
LPPROPVARIANT  pValue 
)
static

Definition at line 1086 of file mimeole.c.

1091{
1094 HRESULT hr;
1095
1096 TRACE("(%p)->(%s, 0x%x, %p)\n", This, debugstr_a(pszName), dwFlags, pValue);
1097
1098 if(!pszName || !pValue)
1099 return E_INVALIDARG;
1100
1101 if(!ISPIDSTR(pszName) && !lstrcmpiA(pszName, "att:pri-content-type"))
1102 {
1104 pValue->vt = VT_LPSTR;
1105 pValue->u.pszVal = strdupA(This->content_pri_type);
1106 return S_OK;
1107 }
1108
1109 hr = find_prop(This, pszName, &header);
1110 if(hr == S_OK)
1111 {
1112 TRACE("type %d->%d\n", header->value.vt, pValue->vt);
1113
1115 if(FAILED(hr))
1116 FIXME("Conversion not currently supported (%d->%d)\n", header->value.vt, pValue->vt);
1117 }
1118
1119 return hr;
1120}
@ VT_LPSTR
Definition: compat.h:2324
HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc, PROPVAR_CHANGE_FLAGS flags, VARTYPE vt)
Definition: propvar.c:428

◆ MimeBody_GetPropInfo()

static HRESULT WINAPI MimeBody_GetPropInfo ( IMimeBody iface,
LPCSTR  pszName,
LPMIMEPROPINFO  pInfo 
)
static

Definition at line 1032 of file mimeole.c.

1036{
1039 HRESULT hr;
1040 DWORD supported = PIM_PROPID | PIM_VTDEFAULT;
1041
1042 TRACE("(%p)->(%s, %p) semi-stub\n", This, debugstr_a(pszName), pInfo);
1043
1044 if(!pszName || !pInfo)
1045 return E_INVALIDARG;
1046
1047 TRACE("mask 0x%04x\n", pInfo->dwMask);
1048
1049 if(pInfo->dwMask & ~supported)
1050 FIXME("Unsupported mask flags 0x%04x\n", pInfo->dwMask & ~supported);
1051
1052 hr = find_prop(This, pszName, &header);
1053 if(hr == S_OK)
1054 {
1055 if(pInfo->dwMask & PIM_CHARSET)
1056 pInfo->hCharset = 0;
1057 if(pInfo->dwMask & PIM_FLAGS)
1058 pInfo->dwFlags = 0x00000000;
1059 if(pInfo->dwMask & PIM_ROWNUMBER)
1060 pInfo->dwRowNumber = 0;
1061 if(pInfo->dwMask & PIM_ENCODINGTYPE)
1062 pInfo->ietEncoding = 0;
1063 if(pInfo->dwMask & PIM_VALUES)
1064 pInfo->cValues = 0;
1065 if(pInfo->dwMask & PIM_PROPID)
1066 pInfo->dwPropId = header->prop->id;
1067 if(pInfo->dwMask & PIM_VTDEFAULT)
1068 pInfo->vtDefault = header->prop->default_vt;
1069 if(pInfo->dwMask & PIM_VTCURRENT)
1070 pInfo->vtCurrent = 0;
1071 }
1072
1073 return hr;
1074}

◆ MimeBody_GetSizeMax()

static HRESULT WINAPI MimeBody_GetSizeMax ( IMimeBody iface,
ULARGE_INTEGER pcbSize 
)
static

Definition at line 1015 of file mimeole.c.

1018{
1020 FIXME("(%p)->(%p) stub\n", This, pcbSize);
1021 return E_NOTIMPL;
1022}

◆ MimeBody_GetTransmitInfo()

static HRESULT WINAPI MimeBody_GetTransmitInfo ( IMimeBody iface,
LPTRANSMITINFO  pTransmitInfo 
)
static

Definition at line 1801 of file mimeole.c.

1804{
1806 FIXME("(%p)->(%p) stub\n", This, pTransmitInfo);
1807 return E_NOTIMPL;
1808}

◆ MimeBody_InitNew()

static HRESULT WINAPI MimeBody_InitNew ( IMimeBody iface)
static

Definition at line 1024 of file mimeole.c.

1026{
1028 TRACE("(%p)->()\n", This);
1029 return S_OK;
1030}

◆ MimeBody_IsContentType()

static HRESULT WINAPI MimeBody_IsContentType ( IMimeBody iface,
LPCSTR  pszPriType,
LPCSTR  pszSubType 
)
static

Definition at line 1360 of file mimeole.c.

1364{
1366
1367 TRACE("(%p)->(%s, %s)\n", This, debugstr_a(pszPriType), debugstr_a(pszSubType));
1368 if(pszPriType)
1369 {
1370 const char *pri = This->content_pri_type;
1371 if(!pri) pri = "text";
1372 if(lstrcmpiA(pri, pszPriType)) return S_FALSE;
1373 }
1374
1375 if(pszSubType)
1376 {
1377 const char *sub = This->content_sub_type;
1378 if(!sub) sub = "plain";
1379 if(lstrcmpiA(sub, pszSubType)) return S_FALSE;
1380 }
1381
1382 return S_OK;
1383}

◆ MimeBody_IsDirty()

static HRESULT WINAPI MimeBody_IsDirty ( IMimeBody iface)
static

Definition at line 993 of file mimeole.c.

995{
997 FIXME("(%p)->() stub\n", This);
998 return E_NOTIMPL;
999}

◆ MimeBody_IsType()

static HRESULT WINAPI MimeBody_IsType ( IMimeBody iface,
IMSGBODYTYPE  bodytype 
)
static

Definition at line 1456 of file mimeole.c.

1459{
1461
1462 TRACE("(%p)->(%d)\n", This, bodytype);
1463 switch(bodytype)
1464 {
1465 case IBT_EMPTY:
1466 return This->data ? S_FALSE : S_OK;
1467 default:
1468 FIXME("Unimplemented bodytype %d - returning S_OK\n", bodytype);
1469 }
1470 return S_OK;
1471}

◆ MimeBody_Load()

static HRESULT WINAPI MimeBody_Load ( IMimeBody iface,
IStream pStm 
)
static

Definition at line 1001 of file mimeole.c.

1002{
1004 TRACE("(%p)->(%p)\n", This, pStm);
1005 return parse_headers(This, pStm);
1006}
static HRESULT parse_headers(MimeBody *body, IStream *stm)
Definition: mimeole.c:783

◆ MimeBody_MoveProps()

static HRESULT WINAPI MimeBody_MoveProps ( IMimeBody iface,
ULONG  cNames,
LPCSTR prgszName,
IMimePropertySet *  pPropertySet 
)
static

Definition at line 1262 of file mimeole.c.

1267{
1269 FIXME("(%p)->(%d, %p, %p) stub\n", This, cNames, prgszName, pPropertySet);
1270 return E_NOTIMPL;
1271}

◆ MimeBody_QueryInterface()

static HRESULT WINAPI MimeBody_QueryInterface ( IMimeBody iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 918 of file mimeole.c.

921{
922 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppvObject);
923
924 *ppvObject = NULL;
925
929 IsEqualIID(riid, &IID_IMimePropertySet) ||
930 IsEqualIID(riid, &IID_IMimeBody))
931 {
932 *ppvObject = iface;
933 }
934
935 if(*ppvObject)
936 {
937 IUnknown_AddRef((IUnknown*)*ppvObject);
938 return S_OK;
939 }
940
941 FIXME("no interface for %s\n", debugstr_guid(riid));
942 return E_NOINTERFACE;
943}
const GUID IID_IPersistStreamInit
const GUID IID_IPersist
Definition: proxy.cpp:14

◆ MimeBody_QueryProp()

static HRESULT WINAPI MimeBody_QueryProp ( IMimeBody iface,
LPCSTR  pszName,
LPCSTR  pszCriteria,
boolean  fSubString,
boolean  fCaseSensitive 
)
static

Definition at line 1283 of file mimeole.c.

1289{
1291 FIXME("(%p)->(%s, %s, %d, %d) stub\n", This, debugstr_a(pszName), debugstr_a(pszCriteria), fSubString, fCaseSensitive);
1292 return E_NOTIMPL;
1293}

◆ MimeBody_Release()

static ULONG WINAPI MimeBody_Release ( IMimeBody iface)
static

Definition at line 955 of file mimeole.c.

956{
959
960 TRACE("(%p) ref=%d\n", This, ref);
961
962 if (!ref)
963 {
964 empty_header_list(&This->headers);
965 empty_new_prop_list(&This->new_props);
966
967 HeapFree(GetProcessHeap(), 0, This->content_pri_type);
968 HeapFree(GetProcessHeap(), 0, This->content_sub_type);
969
970 release_data(&This->data_iid, This->data);
971
973 }
974
975 return ref;
976}
#define InterlockedDecrement
Definition: armddk.h:52
static void empty_new_prop_list(struct list *list)
Definition: mimeole.c:843
static void release_data(REFIID riid, void *data)
Definition: mimeole.c:855
static void empty_header_list(struct list *list)
Definition: mimeole.c:833

Referenced by MimeMessage_IsBodyType().

◆ MimeBody_Save()

static HRESULT WINAPI MimeBody_Save ( IMimeBody iface,
IStream pStm,
BOOL  fClearDirty 
)
static

Definition at line 1008 of file mimeole.c.

1009{
1011 FIXME("(%p)->(%p, %d)\n", This, pStm, fClearDirty);
1012 return E_NOTIMPL;
1013}

◆ MimeBody_SaveToFile()

static HRESULT WINAPI MimeBody_SaveToFile ( IMimeBody iface,
ENCODINGTYPE  ietEncoding,
LPCSTR  pszFilePath 
)
static

Definition at line 1810 of file mimeole.c.

1814{
1816 FIXME("(%p)->(%d, %s) stub\n", This, ietEncoding, debugstr_a(pszFilePath));
1817 return E_NOTIMPL;
1818}

◆ MimeBody_set_offsets()

static HRESULT MimeBody_set_offsets ( MimeBody body,
const BODYOFFSETS *  offsets 
)
static

Definition at line 1881 of file mimeole.c.

1882{
1883 TRACE("setting offsets to %d, %d, %d, %d\n", offsets->cbBoundaryStart,
1884 offsets->cbHeaderStart, offsets->cbBodyStart, offsets->cbBodyEnd);
1885
1886 body->body_offsets = *offsets;
1887 return S_OK;
1888}
static const FxOffsetAndName offsets[]

Referenced by create_sub_body(), mimebody_create(), and MimeMessage_Load().

◆ MimeBody_SetCharset()

static HRESULT WINAPI MimeBody_SetCharset ( IMimeBody iface,
HCHARSET  hCharset,
CSETAPPLYTYPE  applytype 
)
static

Definition at line 1305 of file mimeole.c.

1309{
1311 FIXME("(%p)->(%p, %d) stub\n", This, hCharset, applytype);
1312 return E_NOTIMPL;
1313}

◆ MimeBody_SetCurrentEncoding()

static HRESULT WINAPI MimeBody_SetCurrentEncoding ( IMimeBody iface,
ENCODINGTYPE  ietEncoding 
)
static

Definition at line 1516 of file mimeole.c.

1519{
1521
1522 TRACE("(%p)->(%d)\n", This, ietEncoding);
1523
1524 This->encoding = ietEncoding;
1525 return S_OK;
1526}

◆ MimeBody_SetData()

static HRESULT WINAPI MimeBody_SetData ( IMimeBody iface,
ENCODINGTYPE  ietEncoding,
LPCSTR  pszPriType,
LPCSTR  pszSubType,
REFIID  riid,
LPVOID  pvObject 
)
static

Definition at line 1749 of file mimeole.c.

1756{
1758 TRACE("(%p)->(%d, %s, %s, %s %p)\n", This, ietEncoding, debugstr_a(pszPriType), debugstr_a(pszSubType),
1759 debugstr_guid(riid), pvObject);
1760
1761 if(IsEqualIID(riid, &IID_IStream))
1762 IStream_AddRef((IStream *)pvObject);
1763 else
1764 {
1765 FIXME("Unhandled object type %s\n", debugstr_guid(riid));
1766 return E_INVALIDARG;
1767 }
1768
1769 if(This->data)
1770 release_data(&This->data_iid, This->data);
1771
1772 This->data_iid = *riid;
1773 This->data = pvObject;
1774
1775 IMimeBody_SetCurrentEncoding(iface, ietEncoding);
1776
1777 /* FIXME: Update the content type.
1778 If pszPriType == NULL use 'application'
1779 If pszSubType == NULL use 'octet-stream' */
1780
1781 return S_OK;
1782}

◆ MimeBody_SetDisplayName()

static HRESULT WINAPI MimeBody_SetDisplayName ( IMimeBody iface,
LPCSTR  pszDisplay 
)
static

Definition at line 1473 of file mimeole.c.

1476{
1478 FIXME("(%p)->(%s) stub\n", This, debugstr_a(pszDisplay));
1479 return E_NOTIMPL;
1480}

◆ MimeBody_SetOption()

static HRESULT WINAPI MimeBody_SetOption ( IMimeBody iface,
const TYPEDID  oid,
LPCPROPVARIANT  pValue 
)
static

Definition at line 1404 of file mimeole.c.

1408{
1411 TRACE("(%p)->(%08x, %p)\n", This, oid, pValue);
1412
1413 if(pValue->vt != TYPEDID_TYPE(oid))
1414 {
1415 WARN("Called with vartype %04x and oid %08x\n", pValue->vt, oid);
1416 return E_INVALIDARG;
1417 }
1418
1419 switch(oid)
1420 {
1421 case OID_SECURITY_HWND_OWNER:
1422 FIXME("OID_SECURITY_HWND_OWNER (value %08x): ignoring\n", pValue->u.ulVal);
1423 hr = S_OK;
1424 break;
1425 case OID_TRANSMIT_BODY_ENCODING:
1426 FIXME("OID_TRANSMIT_BODY_ENCODING (value %08x): ignoring\n", pValue->u.ulVal);
1427 hr = S_OK;
1428 break;
1429 default:
1430 FIXME("Unhandled oid %08x\n", oid);
1431 }
1432
1433 return hr;
1434}

◆ MimeBody_SetProp()

static HRESULT WINAPI MimeBody_SetProp ( IMimeBody iface,
LPCSTR  pszName,
DWORD  dwFlags,
LPCPROPVARIANT  pValue 
)
static

Definition at line 1122 of file mimeole.c.

1127{
1130 HRESULT hr;
1131
1132 TRACE("(%p)->(%s, 0x%x, %p)\n", This, debugstr_a(pszName), dwFlags, pValue);
1133
1134 if(!pszName || !pValue)
1135 return E_INVALIDARG;
1136
1137 hr = find_prop(This, pszName, &header);
1138 if(hr != S_OK)
1139 {
1140 property_list_entry_t *prop_entry;
1141 const property_t *prop = NULL;
1142
1143 LIST_FOR_EACH_ENTRY(prop_entry, &This->new_props, property_list_entry_t, entry)
1144 {
1145 if(ISPIDSTR(pszName))
1146 {
1147 if(STRTOPID(pszName) == prop_entry->prop.id)
1148 {
1149 TRACE("Found match with already added new property id %d\n", prop_entry->prop.id);
1150 prop = &prop_entry->prop;
1151 break;
1152 }
1153 }
1154 else if(!lstrcmpiA(pszName, prop_entry->prop.name))
1155 {
1156 TRACE("Found match with already added new property id %d\n", prop_entry->prop.id);
1157 prop = &prop_entry->prop;
1158 break;
1159 }
1160 }
1161
1162 header = HeapAlloc(GetProcessHeap(), 0, sizeof(*header));
1163 if(!header)
1164 return E_OUTOFMEMORY;
1165
1166 if(!prop)
1167 {
1168 const property_t *prop_def = NULL;
1169 prop_entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*prop_entry));
1170 if(!prop_entry)
1171 {
1173 return E_OUTOFMEMORY;
1174 }
1175
1176 prop_def = find_default_prop(pszName);
1177 if(prop_def)
1178 {
1179 prop_entry->prop.name = strdupA(prop_def->name);
1180 prop_entry->prop.id = prop_def->id;
1181 }
1182 else
1183 {
1184 if(ISPIDSTR(pszName))
1185 {
1186 HeapFree(GetProcessHeap(), 0, prop_entry);
1188 return MIME_E_NOT_FOUND;
1189 }
1190
1191 prop_entry->prop.name = strdupA(pszName);
1192 prop_entry->prop.id = This->next_prop_id++;
1193 }
1194
1195 prop_entry->prop.flags = 0;
1196 prop_entry->prop.default_vt = pValue->vt;
1197 list_add_tail(&This->new_props, &prop_entry->entry);
1198 prop = &prop_entry->prop;
1199 TRACE("Allocating new prop id %d\n", prop_entry->prop.id);
1200 }
1201
1202 header->prop = prop;
1203 PropVariantInit(&header->value);
1204 list_init(&header->params);
1205 list_add_tail(&This->headers, &header->entry);
1206 }
1207
1209
1210 return S_OK;
1211}
static const property_t * find_default_prop(const char *name)
Definition: mimeole.c:891
HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, const PROPVARIANT *pvarSrc)
Definition: ole2.c:3086
DWORD flags
Definition: mimeole.c:52
VARTYPE default_vt
Definition: mimeole.c:53

◆ MimeBody_SetPropInfo()

static HRESULT WINAPI MimeBody_SetPropInfo ( IMimeBody iface,
LPCSTR  pszName,
LPCMIMEPROPINFO  pInfo 
)
static

Definition at line 1076 of file mimeole.c.

1080{
1082 FIXME("(%p)->(%s, %p) stub\n", This, debugstr_a(pszName), pInfo);
1083 return E_NOTIMPL;
1084}

◆ MimeGetAddressFormatW()

HRESULT WINAPI MimeGetAddressFormatW ( REFIID  riid,
void object,
DWORD  addr_type,
ADDRESSFORMAT  addr_format,
WCHAR **  address 
)

Definition at line 3661 of file mimeole.c.

3663{
3664 FIXME("(%s, %p, %d, %d, %p) stub\n", debugstr_guid(riid), object, addr_type, addr_format, address);
3665
3666 return E_NOTIMPL;
3667}
GLuint address
Definition: glext.h:9393

◆ MimeMessage_AddRef()

static ULONG WINAPI MimeMessage_AddRef ( IMimeMessage iface)
static

Definition at line 1984 of file mimeole.c.

1985{
1988
1989 TRACE("(%p) ref=%d\n", This, ref);
1990
1991 return ref;
1992}
static MimeMessage * impl_from_IMimeMessage(IMimeMessage *iface)
Definition: mimeole.c:1959

◆ MimeMessage_AttachFile()

static HRESULT WINAPI MimeMessage_AttachFile ( IMimeMessage iface,
LPCSTR  pszFilePath,
IStream pstmFile,
LPHBODY  phBody 
)
static

Definition at line 2900 of file mimeole.c.

2905{
2906 FIXME("(%p)->(%s, %p, %p)\n", iface, pszFilePath, pstmFile, phBody);
2907 return E_NOTIMPL;
2908}

◆ MimeMessage_AttachObject()

static HRESULT WINAPI MimeMessage_AttachObject ( IMimeMessage iface,
REFIID  riid,
void pvObject,
LPHBODY  phBody 
)
static

Definition at line 2890 of file mimeole.c.

2895{
2896 FIXME("(%p)->(%s, %p, %p)\n", iface, debugstr_guid(riid), pvObject, phBody);
2897 return E_NOTIMPL;
2898}

◆ MimeMessage_AttachURL()

static HRESULT WINAPI MimeMessage_AttachURL ( IMimeMessage iface,
LPCSTR  pszBase,
LPCSTR  pszURL,
DWORD  dwFlags,
IStream pstmURL,
LPSTR ppszCIDURL,
LPHBODY  phBody 
)
static

Definition at line 2910 of file mimeole.c.

2918{
2919 FIXME("(%p)->(%s, %s, 0x%x, %p, %p, %p)\n", iface, pszBase, pszURL, dwFlags, pstmURL, ppszCIDURL, phBody);
2920 return E_NOTIMPL;
2921}

◆ MimeMessage_BindToObject()

static HRESULT WINAPI MimeMessage_BindToObject ( IMimeMessage iface,
const HBODY  hBody,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 2354 of file mimeole.c.

2356{
2358 HRESULT hr;
2359 body_t *body;
2360
2361 TRACE("(%p)->(%p, %s, %p)\n", iface, hBody, debugstr_guid(riid), ppvObject);
2362
2363 hr = find_body(&This->body_tree, hBody, &body);
2364
2365 if(hr != S_OK) return hr;
2366
2367 if(IsEqualIID(riid, &IID_IMimeBody))
2368 {
2369 IMimeBody_AddRef(&body->mime_body->IMimeBody_iface);
2370 *ppvObject = &body->mime_body->IMimeBody_iface;
2371 return S_OK;
2372 }
2373
2374 return E_NOINTERFACE;
2375}

◆ MimeMessage_Commit()

static HRESULT WINAPI MimeMessage_Commit ( IMimeMessage iface,
DWORD  dwFlags 
)
static

Definition at line 2314 of file mimeole.c.

2317{
2318 FIXME("(%p)->(0x%x)\n", iface, dwFlags);
2319 return S_OK;
2320}

◆ MimeMessage_CountBodies()

static HRESULT WINAPI MimeMessage_CountBodies ( IMimeMessage iface,
HBODY  hParent,
boolean  fRecurse,
ULONG pcBodies 
)
static

Definition at line 2515 of file mimeole.c.

2517{
2518 HRESULT hr;
2520 body_t *body;
2521
2522 TRACE("(%p)->(%p, %s, %p)\n", iface, hParent, fRecurse ? "TRUE" : "FALSE", pcBodies);
2523
2524 hr = find_body(&This->body_tree, hParent, &body);
2525 if(hr != S_OK) return hr;
2526
2527 *pcBodies = 1;
2528 count_children(body, fRecurse, pcBodies);
2529
2530 return S_OK;
2531}

◆ MimeMessage_create()

HRESULT MimeMessage_create ( IUnknown outer,
void **  obj 
)

Definition at line 3085 of file mimeole.c.

3086{
3088 MimeBody *mime_body;
3089 body_t *root_body;
3090
3091 TRACE("(%p, %p)\n", outer, obj);
3092
3093 if (outer)
3094 {
3095 FIXME("outer unknown not supported yet\n");
3096 return E_NOTIMPL;
3097 }
3098
3099 *obj = NULL;
3100
3101 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
3102 if (!This) return E_OUTOFMEMORY;
3103
3104 This->IMimeMessage_iface.lpVtbl = &MimeMessageVtbl;
3105 This->ref = 1;
3106 This->stream = NULL;
3107 list_init(&This->body_tree);
3108 This->next_index = 1;
3109
3110 mime_body = mimebody_create();
3111 root_body = new_body_entry(mime_body, This->next_index++, NULL);
3112 list_add_head(&This->body_tree, &root_body->entry);
3113
3114 *obj = &This->IMimeMessage_iface;
3115 return S_OK;
3116}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
static const IMimeMessageVtbl MimeMessageVtbl
Definition: mimeole.c:3025

Referenced by load_mime_message(), and MimeOleCreateMessage().

◆ MimeMessage_CreateWebPage()

static HRESULT WINAPI MimeMessage_CreateWebPage ( IMimeMessage iface,
IStream pRootStm,
LPWEBPAGEOPTIONS  pOptions,
IMimeMessageCallback *  pCallback,
IMoniker **  ppMoniker 
)
static

Definition at line 2780 of file mimeole.c.

2786{
2787 FIXME("(%p)->(%p, %p, %p, %p)\n", iface, pRootStm, pOptions, pCallback, ppMoniker);
2788 *ppMoniker = NULL;
2789 return E_NOTIMPL;
2790}
FxPnpStateCallbackInfo * pCallback

◆ MimeMessage_DeleteBody()

static HRESULT WINAPI MimeMessage_DeleteBody ( IMimeMessage iface,
HBODY  hBody,
DWORD  dwFlags 
)
static

Definition at line 2486 of file mimeole.c.

2490{
2491 FIXME("(%p)->(%p, %08x)\n", iface, hBody, dwFlags);
2492 return E_NOTIMPL;
2493}

◆ MimeMessage_DeleteBodyProp()

static HRESULT WINAPI MimeMessage_DeleteBodyProp ( IMimeMessage iface,
HBODY  hBody,
LPCSTR  pszName 
)
static

Definition at line 2716 of file mimeole.c.

2720{
2721 FIXME("(%p)->(%p, %s)\n", iface, hBody, pszName);
2722 return E_NOTIMPL;
2723}

◆ MimeMessage_DeleteProp()

static HRESULT WINAPI MimeMessage_DeleteProp ( IMimeMessage iface,
LPCSTR  pszName 
)
static

Definition at line 2812 of file mimeole.c.

2815{
2816 FIXME("(%p)->(%s)\n", iface, pszName);
2817 return E_NOTIMPL;
2818}

◆ MimeMessage_EnumAddressTypes()

static HRESULT WINAPI MimeMessage_EnumAddressTypes ( IMimeMessage iface,
DWORD  dwAdrTypes,
DWORD  dwProps,
IMimeEnumAddressTypes **  ppEnum 
)
static

Definition at line 2998 of file mimeole.c.

3003{
3004 FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, dwProps, ppEnum);
3005 return E_NOTIMPL;
3006}

◆ MimeMessage_FindFirst()

static HRESULT WINAPI MimeMessage_FindFirst ( IMimeMessage iface,
FINDBODY *  pFindBody,
HBODY *  phBody 
)
static

Definition at line 2564 of file mimeole.c.

2565{
2567
2568 TRACE("(%p)->(%p, %p)\n", iface, pFindBody, phBody);
2569
2570 pFindBody->dwReserved = 0;
2571 return find_next(This, NULL, pFindBody, phBody);
2572}
static HRESULT find_next(MimeMessage *This, body_t *body, FINDBODY *find, HBODY *out)
Definition: mimeole.c:2533

◆ MimeMessage_FindNext()

static HRESULT WINAPI MimeMessage_FindNext ( IMimeMessage iface,
FINDBODY *  pFindBody,
HBODY *  phBody 
)
static

Definition at line 2574 of file mimeole.c.

2575{
2577 body_t *body;
2578 HRESULT hr;
2579
2580 TRACE("(%p)->(%p, %p)\n", iface, pFindBody, phBody);
2581
2582 hr = find_body( &This->body_tree, UlongToHandle( pFindBody->dwReserved ), &body );
2583 if (hr != S_OK) return MIME_E_NOT_FOUND;
2584 return find_next(This, body, pFindBody, phBody);
2585}

◆ MimeMessage_GetAddressFormat()

static HRESULT WINAPI MimeMessage_GetAddressFormat ( IMimeMessage iface,
DWORD  dwAdrTypes,
ADDRESSFORMAT  format,
LPSTR ppszFormat 
)
static

Definition at line 2988 of file mimeole.c.

2993{
2994 FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, format, ppszFormat);
2995 return E_NOTIMPL;
2996}
Definition: format.c:58

◆ MimeMessage_GetAddressTable()

static HRESULT WINAPI MimeMessage_GetAddressTable ( IMimeMessage iface,
IMimeAddressTable **  ppTable 
)
static

Definition at line 2962 of file mimeole.c.

2965{
2966 FIXME("(%p)->(%p)\n", iface, ppTable);
2967 return E_NOTIMPL;
2968}

◆ MimeMessage_GetAddressTypes()

static HRESULT WINAPI MimeMessage_GetAddressTypes ( IMimeMessage iface,
DWORD  dwAdrTypes,
DWORD  dwProps,
LPADDRESSLIST  pList 
)
static

Definition at line 2978 of file mimeole.c.

2983{
2984 FIXME("(%p)->(%d, %d, %p)\n", iface, dwAdrTypes, dwProps, pList);
2985 return E_NOTIMPL;
2986}
FxChildList * pList

◆ MimeMessage_GetAttachments()

static HRESULT WINAPI MimeMessage_GetAttachments ( IMimeMessage iface,
ULONG pcAttach,
LPHBODY *  pprghAttach 
)
static

Definition at line 2923 of file mimeole.c.

2927{
2928 HRESULT hr;
2929 FINDBODY find_struct;
2930 HBODY hbody;
2931 LPHBODY array;
2932 ULONG size = 10;
2933
2934 TRACE("(%p)->(%p, %p)\n", iface, pcAttach, pprghAttach);
2935
2936 *pcAttach = 0;
2937 array = CoTaskMemAlloc(size * sizeof(HBODY));
2938
2939 find_struct.pszPriType = find_struct.pszSubType = NULL;
2940 hr = IMimeMessage_FindFirst(iface, &find_struct, &hbody);
2941 while(hr == S_OK)
2942 {
2943 hr = IMimeMessage_IsContentType(iface, hbody, "multipart", NULL);
2944 TRACE("IsCT rets %08x %d\n", hr, *pcAttach);
2945 if(hr != S_OK)
2946 {
2947 if(*pcAttach + 1 > size)
2948 {
2949 size *= 2;
2950 array = CoTaskMemRealloc(array, size * sizeof(HBODY));
2951 }
2952 array[*pcAttach] = hbody;
2953 (*pcAttach)++;
2954 }
2955 hr = IMimeMessage_FindNext(iface, &find_struct, &hbody);
2956 }
2957
2958 *pprghAttach = array;
2959 return S_OK;
2960}
HBODY * LPHBODY
Definition: mimeole.idl:203

◆ MimeMessage_GetBody()

static HRESULT WINAPI MimeMessage_GetBody ( IMimeMessage iface,
BODYLOCATION  location,
HBODY  hPivot,
HBODY *  phBody 
)
static

Definition at line 2465 of file mimeole.c.

2467{
2469 body_t *body;
2470 HRESULT hr;
2471
2472 TRACE("(%p)->(%d, %p, %p)\n", iface, location, hPivot, phBody);
2473
2474 if(!phBody)
2475 return E_INVALIDARG;
2476
2477 *phBody = NULL;
2478
2479 hr = get_body(This, location, hPivot, &body);
2480
2481 if(hr == S_OK) *phBody = UlongToHandle(body->index);
2482
2483 return hr;
2484}
static HRESULT get_body(MimeMessage *msg, BODYLOCATION location, HBODY pivot, body_t **out)
Definition: mimeole.c:2387

◆ MimeMessage_GetBodyOffsets()

static HRESULT WINAPI MimeMessage_GetBodyOffsets ( IMimeMessage iface,
HBODY  hBody,
LPBODYOFFSETS  pOffsets 
)
static

Definition at line 2609 of file mimeole.c.

2613{
2614 FIXME("(%p)->(%p, %p)\n", iface, hBody, pOffsets);
2615 return E_NOTIMPL;
2616}

◆ MimeMessage_GetBodyProp()

static HRESULT WINAPI MimeMessage_GetBodyProp ( IMimeMessage iface,
HBODY  hBody,
LPCSTR  pszName,
DWORD  dwFlags,
LPPROPVARIANT  pValue 
)
static

Definition at line 2684 of file mimeole.c.

2690{
2691 HRESULT hr;
2692 IMimeBody *mime_body;
2693
2694 TRACE("(%p)->(%p, %s, 0x%x, %p)\n", iface, hBody, pszName, dwFlags, pValue);
2695
2696 hr = IMimeMessage_BindToObject(iface, hBody, &IID_IMimeBody, (void**)&mime_body);
2697 if(hr != S_OK) return hr;
2698
2699 hr = IMimeBody_GetProp(mime_body, pszName, dwFlags, pValue);
2700 IMimeBody_Release(mime_body);
2701
2702 return hr;
2703}

◆ MimeMessage_GetCharset()

static HRESULT WINAPI MimeMessage_GetCharset ( IMimeMessage iface,
LPHCHARSET  phCharset 
)
static

Definition at line 2618 of file mimeole.c.

2621{
2622 FIXME("(%p)->(%p)\n", iface, phCharset);
2623 *phCharset = NULL;
2624 return S_OK;
2625}

◆ MimeMessage_GetClassID()

static HRESULT WINAPI MimeMessage_GetClassID ( IMimeMessage iface,
CLSID pClassID 
)
static

Definition at line 2025 of file mimeole.c.

2028{
2029 FIXME("(%p)->(%p)\n", iface, pClassID);
2030 return E_NOTIMPL;
2031}

◆ MimeMessage_GetFlags()

static HRESULT WINAPI MimeMessage_GetFlags ( IMimeMessage iface,
DWORD pdwFlags 
)
static

Definition at line 2306 of file mimeole.c.

2309{
2310 FIXME("(%p)->(%p)\n", iface, pdwFlags);
2311 return E_NOTIMPL;
2312}

◆ MimeMessage_GetMessageSize()

static HRESULT WINAPI MimeMessage_GetMessageSize ( IMimeMessage iface,
ULONG pcbSize,
DWORD  dwFlags 
)
static

Definition at line 2279 of file mimeole.c.

2283{
2284 FIXME("(%p)->(%p, 0x%x)\n", iface, pcbSize, dwFlags);
2285 return E_NOTIMPL;
2286}

◆ MimeMessage_GetMessageSource()

static HRESULT WINAPI MimeMessage_GetMessageSource ( IMimeMessage iface,
IStream **  ppStream,
DWORD  dwFlags 
)
static

Definition at line 2267 of file mimeole.c.

2269{
2271
2272 FIXME("(%p)->(%p, 0x%x)\n", iface, ppStream, dwFlags);
2273
2274 IStream_AddRef(This->stream);
2275 *ppStream = This->stream;
2276 return S_OK;
2277}

◆ MimeMessage_GetOption()

static HRESULT WINAPI MimeMessage_GetOption ( IMimeMessage iface,
const TYPEDID  oid,
LPPROPVARIANT  pValue 
)
static

Definition at line 2770 of file mimeole.c.

2774{
2775 FIXME("(%p)->(%08x, %p)\n", iface, oid, pValue);
2776 return E_NOTIMPL;
2777}

◆ MimeMessage_GetProp()

static HRESULT WINAPI MimeMessage_GetProp ( IMimeMessage iface,
LPCSTR  pszName,
DWORD  dwFlags,
LPPROPVARIANT  pValue 
)
static

Definition at line 2792 of file mimeole.c.

2797{
2798 FIXME("(%p)->(%s, 0x%x, %p)\n", iface, pszName, dwFlags, pValue);
2799 return E_NOTIMPL;
2800}

◆ MimeMessage_GetRootMoniker()

static HRESULT WINAPI MimeMessage_GetRootMoniker ( IMimeMessage iface,
IMoniker **  ppMoniker 
)
static

Definition at line 3017 of file mimeole.c.

3020{
3021 FIXME("(%p)->(%p)\n", iface, ppMoniker);
3022 return E_NOTIMPL;
3023}

◆ MimeMessage_GetSender()

static HRESULT WINAPI MimeMessage_GetSender ( IMimeMessage iface,
LPADDRESSPROPS  pAddress 
)
static

Definition at line 2970 of file mimeole.c.

2973{
2974 FIXME("(%p)->(%p)\n", iface, pAddress);
2975 return E_NOTIMPL;
2976}

◆ MimeMessage_GetSizeMax()

static HRESULT WINAPI MimeMessage_GetSizeMax ( IMimeMessage iface,
ULARGE_INTEGER pcbSize 
)
static

Definition at line 2251 of file mimeole.c.

2254{
2255 FIXME("(%p)->(%p)\n", iface, pcbSize);
2256 return E_NOTIMPL;
2257}

◆ MimeMessage_GetTextBody()

static HRESULT WINAPI MimeMessage_GetTextBody ( IMimeMessage iface,
DWORD  dwTxtType,
ENCODINGTYPE  ietEncoding,
IStream **  pStream,
LPHBODY  phBody 
)
static

Definition at line 2831 of file mimeole.c.

2837{
2838 HRESULT hr;
2839 HBODY hbody;
2840 FINDBODY find_struct;
2841 IMimeBody *mime_body;
2842 static char text[] = "text";
2843 static char plain[] = "plain";
2844 static char html[] = "html";
2845
2846 TRACE("(%p)->(%d, %d, %p, %p)\n", iface, dwTxtType, ietEncoding, pStream, phBody);
2847
2848 find_struct.pszPriType = text;
2849
2850 switch(dwTxtType)
2851 {
2852 case TXT_PLAIN:
2853 find_struct.pszSubType = plain;
2854 break;
2855 case TXT_HTML:
2856 find_struct.pszSubType = html;
2857 break;
2858 default:
2859 return MIME_E_INVALID_TEXT_TYPE;
2860 }
2861
2862 hr = IMimeMessage_FindFirst(iface, &find_struct, &hbody);
2863 if(hr != S_OK)
2864 {
2865 TRACE("not found hr %08x\n", hr);
2866 *phBody = NULL;
2867 return hr;
2868 }
2869
2870 IMimeMessage_BindToObject(iface, hbody, &IID_IMimeBody, (void**)&mime_body);
2871
2872 IMimeBody_GetData(mime_body, ietEncoding, pStream);
2873 *phBody = hbody;
2874 IMimeBody_Release(mime_body);
2875 return hr;
2876}
const WCHAR * text
Definition: package.c:1794

◆ MimeMessage_HandsOffStorage()

static HRESULT WINAPI MimeMessage_HandsOffStorage ( IMimeMessage iface)
static

Definition at line 2323 of file mimeole.c.

2325{
2326 FIXME("(%p)->()\n", iface);
2327 return E_NOTIMPL;
2328}

◆ MimeMessage_InitNew()

static HRESULT WINAPI MimeMessage_InitNew ( IMimeMessage iface)
static

Definition at line 2259 of file mimeole.c.

2261{
2262 FIXME("(%p)->()\n", iface);
2263 return E_NOTIMPL;
2264}

◆ MimeMessage_InsertBody()

static HRESULT WINAPI MimeMessage_InsertBody ( IMimeMessage iface,
BODYLOCATION  location,
HBODY  hPivot,
LPHBODY  phBody 
)
static

Definition at line 2455 of file mimeole.c.

2460{
2461 FIXME("(%p)->(%d, %p, %p)\n", iface, location, hPivot, phBody);
2462 return E_NOTIMPL;
2463}

◆ MimeMessage_IsBodyType()

static HRESULT WINAPI MimeMessage_IsBodyType ( IMimeMessage iface,
HBODY  hBody,
IMSGBODYTYPE  bodytype 
)
static

Definition at line 2636 of file mimeole.c.

2640{
2641 HRESULT hr;
2642 IMimeBody *mime_body;
2643 TRACE("(%p)->(%p, %d)\n", iface, hBody, bodytype);
2644
2645 hr = IMimeMessage_BindToObject(iface, hBody, &IID_IMimeBody, (void**)&mime_body);
2646 if(hr != S_OK) return hr;
2647
2648 hr = IMimeBody_IsType(mime_body, bodytype);
2649 MimeBody_Release(mime_body);
2650 return hr;
2651}
static ULONG WINAPI MimeBody_Release(IMimeBody *iface)
Definition: mimeole.c:955

◆ MimeMessage_IsContentType()

static HRESULT WINAPI MimeMessage_IsContentType ( IMimeMessage iface,
HBODY  hBody,
LPCSTR  pszPriType,
LPCSTR  pszSubType 
)
static

Definition at line 2653 of file mimeole.c.

2658{
2659 HRESULT hr;
2660 IMimeBody *mime_body;
2661 TRACE("(%p)->(%p, %s, %s)\n", iface, hBody, debugstr_a(pszPriType),
2662 debugstr_a(pszSubType));
2663
2664 hr = IMimeMessage_BindToObject(iface, hBody, &IID_IMimeBody, (void**)&mime_body);
2665 if(FAILED(hr)) return hr;
2666
2667 hr = IMimeBody_IsContentType(mime_body, pszPriType, pszSubType);
2668 IMimeBody_Release(mime_body);
2669 return hr;
2670}

◆ MimeMessage_IsDirty()

static HRESULT WINAPI MimeMessage_IsDirty ( IMimeMessage iface)
static

Definition at line 2034 of file mimeole.c.

2036{
2037 FIXME("(%p)->()\n", iface);
2038 return E_NOTIMPL;
2039}

◆ MimeMessage_Load()

static HRESULT WINAPI MimeMessage_Load ( IMimeMessage iface,
IStream pStm 
)
static

Definition at line 2210 of file mimeole.c.

2211{
2213 body_t *root_body;
2214 BODYOFFSETS offsets;
2217
2218 TRACE("(%p)->(%p)\n", iface, pStm);
2219
2220 if(This->stream)
2221 {
2222 FIXME("already loaded a message\n");
2223 return E_FAIL;
2224 }
2225
2226 empty_body_list(&This->body_tree);
2227
2228 IStream_AddRef(pStm);
2229 This->stream = pStm;
2230 offsets.cbBoundaryStart = offsets.cbHeaderStart = 0;
2231 offsets.cbBodyStart = offsets.cbBodyEnd = 0;
2232
2233 root_body = create_sub_body(This, pStm, &offsets, NULL);
2234
2235 zero.QuadPart = 0;
2236 IStream_Seek(pStm, zero, STREAM_SEEK_END, &cur);
2237 offsets.cbBodyEnd = cur.u.LowPart;
2239
2240 list_add_head(&This->body_tree, &root_body->entry);
2241
2242 return S_OK;
2243}
MimeBody * mime_body
Definition: mimeole.c:1943

◆ MimeMessage_LoadOffsetTable()

static HRESULT WINAPI MimeMessage_LoadOffsetTable ( IMimeMessage iface,
IStream pStream 
)
static

Definition at line 2288 of file mimeole.c.

2291{
2292 FIXME("(%p)->(%p)\n", iface, pStream);
2293 return E_NOTIMPL;
2294}

◆ MimeMessage_MoveBody()

static HRESULT WINAPI MimeMessage_MoveBody ( IMimeMessage iface,
HBODY  hBody,
BODYLOCATION  location 
)
static

Definition at line 2495 of file mimeole.c.

2499{
2500 FIXME("(%p)->(%d)\n", iface, location);
2501 return E_NOTIMPL;
2502}

◆ MimeMessage_QueryBodyProp()

static HRESULT WINAPI MimeMessage_QueryBodyProp ( IMimeMessage iface,
HBODY  hBody,
LPCSTR  pszName,
LPCSTR  pszCriteria,
boolean  fSubString,
boolean  fCaseSensitive 
)
static

Definition at line 2672 of file mimeole.c.

2679{
2680 FIXME("(%p)->(%p, %s, %s, %s, %s)\n", iface, hBody, pszName, pszCriteria, fSubString ? "TRUE" : "FALSE", fCaseSensitive ? "TRUE" : "FALSE");
2681 return E_NOTIMPL;
2682}

◆ MimeMessage_QueryInterface()

static HRESULT WINAPI MimeMessage_QueryInterface ( IMimeMessage iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1964 of file mimeole.c.

1965{
1966 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
1967
1968 if (IsEqualIID(riid, &IID_IUnknown) ||
1971 IsEqualIID(riid, &IID_IMimeMessageTree) ||
1972 IsEqualIID(riid, &IID_IMimeMessage))
1973 {
1974 *ppv = iface;
1975 IMimeMessage_AddRef(iface);
1976 return S_OK;
1977 }
1978
1979 FIXME("no interface for %s\n", debugstr_guid(riid));
1980 *ppv = NULL;
1981 return E_NOINTERFACE;
1982}

◆ MimeMessage_QueryProp()

static HRESULT WINAPI MimeMessage_QueryProp ( IMimeMessage iface,
LPCSTR  pszName,
LPCSTR  pszCriteria,
boolean  fSubString,
boolean  fCaseSensitive 
)
static

Definition at line 2820 of file mimeole.c.

2826{
2827 FIXME("(%p)->(%s, %s, %s, %s)\n", iface, pszName, pszCriteria, fSubString ? "TRUE" : "FALSE", fCaseSensitive ? "TRUE" : "FALSE");
2828 return E_NOTIMPL;
2829}

◆ MimeMessage_Release()

static ULONG WINAPI MimeMessage_Release ( IMimeMessage iface)
static

Definition at line 2006 of file mimeole.c.

2007{
2010
2011 TRACE("(%p) ref=%d\n", This, ref);
2012
2013 if (!ref)
2014 {
2015 empty_body_list(&This->body_tree);
2016
2017 if(This->stream) IStream_Release(This->stream);
2019 }
2020
2021 return ref;
2022}

◆ MimeMessage_ResolveURL()

static HRESULT WINAPI MimeMessage_ResolveURL ( IMimeMessage iface,
HBODY  hRelated,
LPCSTR  pszBase,
LPCSTR  pszURL,
DWORD  dwFlags,
LPHBODY  phBody 
)
static

Definition at line 2587 of file mimeole.c.

2594{
2595 FIXME("(%p)->(%p, %s, %s, 0x%x, %p)\n", iface, hRelated, pszBase, pszURL, dwFlags, phBody);
2596 return E_NOTIMPL;
2597}

◆ MimeMessage_Save()

static HRESULT WINAPI MimeMessage_Save ( IMimeMessage iface,
IStream pStm,
BOOL  fClearDirty 
)
static

Definition at line 2245 of file mimeole.c.

2246{
2247 FIXME("(%p)->(%p, %s)\n", iface, pStm, fClearDirty ? "TRUE" : "FALSE");
2248 return E_NOTIMPL;
2249}

◆ MimeMessage_SaveBody()

static HRESULT WINAPI MimeMessage_SaveBody ( IMimeMessage iface,
HBODY  hBody,
DWORD  dwFlags,
IStream pStream 
)
static

Definition at line 2377 of file mimeole.c.

2382{
2383 FIXME("(%p)->(%p, 0x%x, %p)\n", iface, hBody, dwFlags, pStream);
2384 return E_NOTIMPL;
2385}

◆ MimeMessage_SaveOffsetTable()

static HRESULT WINAPI MimeMessage_SaveOffsetTable ( IMimeMessage iface,
IStream pStream,
DWORD  dwFlags 
)
static

Definition at line 2296 of file mimeole.c.

2300{
2301 FIXME("(%p)->(%p, 0x%x)\n", iface, pStream, dwFlags);
2302 return E_NOTIMPL;
2303}

◆ MimeMessage_SetBodyProp()

static HRESULT WINAPI MimeMessage_SetBodyProp ( IMimeMessage iface,
HBODY  hBody,
LPCSTR  pszName,
DWORD  dwFlags,
LPCPROPVARIANT  pValue 
)
static

Definition at line 2705 of file mimeole.c.

2711{
2712 FIXME("(%p)->(%p, %s, 0x%x, %p)\n", iface, hBody, pszName, dwFlags, pValue);
2713 return E_NOTIMPL;
2714}

◆ MimeMessage_SetCharset()

static HRESULT WINAPI MimeMessage_SetCharset ( IMimeMessage iface,
HCHARSET  hCharset,
CSETAPPLYTYPE  applytype 
)
static

Definition at line 2627 of file mimeole.c.

2631{
2632 FIXME("(%p)->(%p, %d)\n", iface, hCharset, applytype);
2633 return E_NOTIMPL;
2634}

◆ MimeMessage_SetOption()

static HRESULT WINAPI MimeMessage_SetOption ( IMimeMessage iface,
const TYPEDID  oid,
LPCPROPVARIANT  pValue 
)
static

Definition at line 2725 of file mimeole.c.

2729{
2730 HRESULT hr = S_OK;
2731 TRACE("(%p)->(%08x, %p)\n", iface, oid, pValue);
2732
2733 /* Message ID is checked before type.
2734 * OID 0x4D -> 0x56 and 0x58 aren't defined but will filtered out later.
2735 */
2736 if(TYPEDID_ID(oid) < TYPEDID_ID(OID_ALLOW_8BIT_HEADER) || TYPEDID_ID(oid) > TYPEDID_ID(OID_SECURITY_2KEY_CERT_BAG_64))
2737 {
2738 WARN("oid (%08x) out of range\n", oid);
2739 return MIME_E_INVALID_OPTION_ID;
2740 }
2741
2742 if(pValue->vt != TYPEDID_TYPE(oid))
2743 {
2744 WARN("Called with vartype %04x and oid %08x\n", pValue->vt, oid);
2745 return S_OK;
2746 }
2747
2748 switch(oid)
2749 {
2750 case OID_HIDE_TNEF_ATTACHMENTS:
2751 FIXME("OID_HIDE_TNEF_ATTACHMENTS (value %d): ignoring\n", pValue->u.boolVal);
2752 break;
2753 case OID_SHOW_MACBINARY:
2754 FIXME("OID_SHOW_MACBINARY (value %d): ignoring\n", pValue->u.boolVal);
2755 break;
2756 case OID_SAVEBODY_KEEPBOUNDARY:
2757 FIXME("OID_SAVEBODY_KEEPBOUNDARY (value %d): ignoring\n", pValue->u.boolVal);
2758 break;
2759 case OID_CLEANUP_TREE_ON_SAVE:
2760 FIXME("OID_CLEANUP_TREE_ON_SAVE (value %d): ignoring\n", pValue->u.boolVal);
2761 break;
2762 default:
2763 FIXME("Unhandled oid %08x\n", oid);
2764 hr = MIME_E_INVALID_OPTION_ID;
2765 }
2766
2767 return hr;
2768}

◆ MimeMessage_SetProp()

static HRESULT WINAPI MimeMessage_SetProp ( IMimeMessage iface,
LPCSTR  pszName,
DWORD  dwFlags,
LPCPROPVARIANT  pValue 
)
static

Definition at line 2802 of file mimeole.c.

2807{
2808 FIXME("(%p)->(%s, 0x%x, %p)\n", iface, pszName, dwFlags, pValue);
2809 return E_NOTIMPL;
2810}

◆ MimeMessage_SetTextBody()

static HRESULT WINAPI MimeMessage_SetTextBody ( IMimeMessage iface,
DWORD  dwTxtType,
ENCODINGTYPE  ietEncoding,
HBODY  hAlternative,
IStream pStream,
LPHBODY  phBody 
)
static

Definition at line 2878 of file mimeole.c.

2885{
2886 FIXME("(%p)->(%d, %d, %p, %p, %p)\n", iface, dwTxtType, ietEncoding, hAlternative, pStream, phBody);
2887 return E_NOTIMPL;
2888}

◆ MimeMessage_SplitMessage()

static HRESULT WINAPI MimeMessage_SplitMessage ( IMimeMessage iface,
ULONG  cbMaxPart,
IMimeMessageParts **  ppParts 
)
static

Definition at line 3008 of file mimeole.c.

3012{
3013 FIXME("(%p)->(%d, %p)\n", iface, cbMaxPart, ppParts);
3014 return E_NOTIMPL;
3015}

◆ MimeMessage_ToMultipart()

static HRESULT WINAPI MimeMessage_ToMultipart ( IMimeMessage iface,
HBODY  hBody,
LPCSTR  pszSubType,
LPHBODY  phMultipart 
)
static

Definition at line 2599 of file mimeole.c.

2604{
2605 FIXME("(%p)->(%p, %s, %p)\n", iface, hBody, pszSubType, phMultipart);
2606 return E_NOTIMPL;
2607}

◆ MimeOleCreateMessage()

HRESULT WINAPI MimeOleCreateMessage ( IUnknown pUnkOuter,
IMimeMessage **  ppMessage 
)

Definition at line 3121 of file mimeole.c.

3122{
3123 TRACE("(%p, %p)\n", pUnkOuter, ppMessage);
3124 return MimeMessage_create(NULL, (void **)ppMessage);
3125}
HRESULT MimeMessage_create(IUnknown *outer, void **obj)
Definition: mimeole.c:3085

Referenced by test_BindToObject(), test_BodyDeleteProp(), test_CreateMessage(), test_MessageGetPropInfo(), test_MessageOptions(), test_MessageSetProp(), and test_mhtml_message().

◆ MimeOleCreateSecurity()

HRESULT WINAPI MimeOleCreateSecurity ( IMimeSecurity **  ppSecurity)

Definition at line 3331 of file mimeole.c.

3332{
3333 return MimeSecurity_create(NULL, (void **)ppSecurity);
3334}
HRESULT MimeSecurity_create(IUnknown *outer, void **obj)
Definition: mimeole.c:3310

Referenced by test_CreateSecurity().

◆ MimeOleCreateVirtualStream()

HRESULT WINAPI MimeOleCreateVirtualStream ( IStream **  ppStream)

Definition at line 3139 of file mimeole.c.

3140{
3141 HRESULT hr;
3142 FIXME("(%p)\n", ppStream);
3143
3144 hr = CreateStreamOnHGlobal(NULL, TRUE, ppStream);
3145 return hr;
3146}

Referenced by test_CreateVirtualStream(), and VirtualStream_create().

◆ MimeOleGetAllocator()

HRESULT WINAPI MimeOleGetAllocator ( IMimeAllocator **  alloc)

Definition at line 3530 of file mimeole.c.

3531{
3532 return MimeAllocator_create(NULL, (void**)alloc);
3533}
HRESULT MimeAllocator_create(IUnknown *outer, void **obj)
Definition: mimeole.c:3522

Referenced by create_sub_body(), MimeBody_GetParameters(), test_Allocator(), and test_CreateBody().

◆ MimeOleGetPropertySchema()

HRESULT WINAPI MimeOleGetPropertySchema ( IMimePropertySchema **  schema)

Definition at line 3643 of file mimeole.c.

3644{
3646
3647 TRACE("(%p) stub\n", schema);
3648
3649 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
3650 if (!This)
3651 return E_OUTOFMEMORY;
3652
3653 This->IMimePropertySchema_iface.lpVtbl = &prop_schema_vtbl;
3654 This->ref = 1;
3655
3656 *schema = &This->IMimePropertySchema_iface;
3657
3658 return S_OK;
3659}
static IMimePropertySchemaVtbl prop_schema_vtbl
Definition: mimeole.c:3630
const WCHAR * schema

Referenced by test_MimeOleGetPropertySchema().

◆ MimeOleObjectFromMoniker()

HRESULT WINAPI MimeOleObjectFromMoniker ( BINDF  bindf,
IMoniker moniker,
IBindCtx binding,
REFIID  riid,
void **  out,
IMoniker **  moniker_new 
)

Definition at line 3696 of file mimeole.c.

3698{
3699 WCHAR *display_name, *mhtml_url;
3700 size_t len;
3701 HRESULT hres;
3702
3703 static const WCHAR mhtml_prefixW[] = {'m','h','t','m','l',':'};
3704
3705 WARN("(0x%08x, %p, %p, %s, %p, %p) semi-stub\n", bindf, moniker, binding, debugstr_guid(riid), out, moniker_new);
3706
3707 if(!IsEqualGUID(&IID_IUnknown, riid)) {
3708 FIXME("Unsupported riid %s\n", debugstr_guid(riid));
3709 return E_NOINTERFACE;
3710 }
3711
3712 hres = IMoniker_GetDisplayName(moniker, NULL, NULL, &display_name);
3713 if(FAILED(hres))
3714 return hres;
3715
3716 TRACE("display name %s\n", debugstr_w(display_name));
3717
3718 len = lstrlenW(display_name);
3719 mhtml_url = heap_alloc((len+1)*sizeof(WCHAR) + sizeof(mhtml_prefixW));
3720 if(!mhtml_url)
3721 return E_OUTOFMEMORY;
3722
3723 memcpy(mhtml_url, mhtml_prefixW, sizeof(mhtml_prefixW));
3724 lstrcpyW(mhtml_url + ARRAY_SIZE(mhtml_prefixW), display_name);
3725 HeapFree(GetProcessHeap(), 0, display_name);
3726
3727 hres = CreateURLMoniker(NULL, mhtml_url, moniker_new);
3728 heap_free(mhtml_url);
3729 if(FAILED(hres))
3730 return hres;
3731
3732 /* FIXME: We most likely should start binding here and return something more meaningful as mime object. */
3733 *out = &mime_obj;
3734 return S_OK;
3735}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
static IUnknown mime_obj
Definition: mimeole.c:3694
static const WCHAR mhtml_prefixW[]
Definition: protocol.c:62
#define debugstr_w
Definition: kernel32.h:32
static DWORD bindf
Definition: protocol.c:70
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
Definition: main.c:40
HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
Definition: umon.c:732
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by test_MimeOleObjectFromMoniker().

◆ MimeOleSetCompatMode()

HRESULT WINAPI MimeOleSetCompatMode ( DWORD  dwMode)

Definition at line 3130 of file mimeole.c.

3131{
3132 FIXME("(0x%x)\n", dwMode);
3133 return S_OK;
3134}

◆ MimeSecurity_AddRef()

static ULONG WINAPI MimeSecurity_AddRef ( IMimeSecurity iface)
static

Definition at line 3176 of file mimeole.c.

3177{
3180
3181 TRACE("(%p) ref=%d\n", This, ref);
3182
3183 return ref;
3184}
static MimeSecurity * impl_from_IMimeSecurity(IMimeSecurity *iface)
Definition: mimeole.c:3154

◆ MimeSecurity_CheckInit()

static HRESULT WINAPI MimeSecurity_CheckInit ( IMimeSecurity iface)
static

Definition at line 3206 of file mimeole.c.

3208{
3209 FIXME("(%p)->(): stub\n", iface);
3210 return E_NOTIMPL;
3211}

◆ MimeSecurity_create()

HRESULT MimeSecurity_create ( IUnknown outer,
void **  obj 
)

Definition at line 3310 of file mimeole.c.

3311{
3313
3314 *obj = NULL;
3315
3316 if (outer) return CLASS_E_NOAGGREGATION;
3317
3318 This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
3319 if (!This) return E_OUTOFMEMORY;
3320
3321 This->IMimeSecurity_iface.lpVtbl = &MimeSecurityVtbl;
3322 This->ref = 1;
3323
3324 *obj = &This->IMimeSecurity_iface;
3325 return S_OK;
3326}
static const IMimeSecurityVtbl MimeSecurityVtbl
Definition: mimeole.c:3293

Referenced by MimeOleCreateSecurity().

◆ MimeSecurity_DecodeBody()

static HRESULT WINAPI MimeSecurity_DecodeBody ( IMimeSecurity iface,
IMimeMessageTree *  pTree,
HBODY  hDecodeRoot,
DWORD  dwFlags 
)
static

Definition at line 3241 of file mimeole.c.

3246{
3247 FIXME("(%p)->(%p, %p, %08x): stub\n", iface, pTree, hDecodeRoot, dwFlags);
3248 return E_NOTIMPL;
3249}

◆ MimeSecurity_DecodeMessage()

static HRESULT WINAPI MimeSecurity_DecodeMessage ( IMimeSecurity iface,
IMimeMessageTree *  pTree,
DWORD  dwFlags 
)
static

Definition at line 3232 of file mimeole.c.

3236{
3237 FIXME("(%p)->(%p, %08x): stub\n", iface, pTree, dwFlags);
3238 return E_NOTIMPL;
3239}

◆ MimeSecurity_EncodeBody()

static HRESULT WINAPI MimeSecurity_EncodeBody ( IMimeSecurity iface,
IMimeMessageTree *  pTree,
HBODY  hEncodeRoot,
DWORD  dwFlags 
)
static

Definition at line 3222 of file mimeole.c.

3227{
3228 FIXME("(%p)->(%p, %p, %08x): stub\n", iface, pTree, hEncodeRoot, dwFlags);
3229 return E_NOTIMPL;
3230}

◆ MimeSecurity_EncodeMessage()

static HRESULT WINAPI MimeSecurity_EncodeMessage ( IMimeSecurity iface,
IMimeMessageTree *  pTree,
DWORD  dwFlags 
)
static

Definition at line 3213 of file mimeole.c.

3217{
3218 FIXME("(%p)->(%p, %08x): stub\n", iface, pTree, dwFlags);
3219 return E_NOTIMPL;
3220}

◆ MimeSecurity_EnumCertificates()

static HRESULT WINAPI MimeSecurity_EnumCertificates ( IMimeSecurity iface,
HCAPICERTSTORE  hc,
DWORD  dwUsage,
PCX509CERT  pPrev,
PCX509CERT *  ppCert 
)
static

Definition at line 3251 of file mimeole.c.

3257{
3258 FIXME("(%p)->(%p, %08x, %p, %p): stub\n", iface, hc, dwUsage, pPrev, ppCert);
3259 return E_NOTIMPL;
3260}

◆ MimeSecurity_GetCertData()

static HRESULT WINAPI MimeSecurity_GetCertData ( IMimeSecurity iface,
const PCX509CERT  pX509Cert,
const CERTDATAID  dataid,
LPPROPVARIANT  pValue 
)
static

Definition at line 3282 of file mimeole.c.

3287{
3288 FIXME("(%p)->(%p, %x, %p): stub\n", iface, pX509Cert, dataid, pValue);
3289 return E_NOTIMPL;
3290}

◆ MimeSecurity_GetCertificateName()

static HRESULT WINAPI MimeSecurity_GetCertificateName ( IMimeSecurity iface,
const PCX509CERT  pX509Cert,
const CERTNAMETYPE  cn,
LPSTR ppszName 
)
static

Definition at line 3262 of file mimeole.c.

3267{
3268 FIXME("(%p)->(%p, %08x, %p): stub\n", iface, pX509Cert, cn, ppszName);
3269 return E_NOTIMPL;
3270}
static BYTE cn[]
Definition: cert.c:2938
SIGDN PWSTR * ppszName
Definition: shobjidl.idl:606

◆ MimeSecurity_GetMessageType()

static HRESULT WINAPI MimeSecurity_GetMessageType ( IMimeSecurity iface,
const HWND  hwndParent,
IMimeBody pBody,
DWORD pdwSecType 
)
static

Definition at line 3272 of file mimeole.c.

3277{
3278 FIXME("(%p)->(%p, %p, %p): stub\n", iface, hwndParent, pBody, pdwSecType);
3279 return E_NOTIMPL;
3280}
static HWND hwndParent
Definition: cryptui.c:300

◆ MimeSecurity_InitNew()

static HRESULT WINAPI MimeSecurity_InitNew ( IMimeSecurity iface)
static

Definition at line 3199 of file mimeole.c.

3201{
3202 FIXME("(%p)->(): stub\n", iface);
3203 return S_OK;
3204}

◆ MimeSecurity_QueryInterface()

static HRESULT WINAPI MimeSecurity_QueryInterface ( IMimeSecurity iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 3159 of file mimeole.c.

3160{
3161 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
3162
3163 if (IsEqualIID(riid, &IID_IUnknown) ||
3164 IsEqualIID(riid, &IID_IMimeSecurity))
3165 {
3166 *ppv = iface;
3167 IMimeSecurity_AddRef(iface);
3168 return S_OK;
3169 }
3170
3171 FIXME("no interface for %s\n", debugstr_guid(riid));
3172 *ppv = NULL;
3173 return E_NOINTERFACE;
3174}

◆ MimeSecurity_Release()

static ULONG WINAPI MimeSecurity_Release ( IMimeSecurity iface)
static

Definition at line 3186 of file mimeole.c.

3187{
3190
3191 TRACE("(%p) ref=%d\n", This, ref);
3192
3193 if (!ref)
3195
3196 return ref;
3197}

◆ new_body_entry()

static body_t * new_body_entry ( MimeBody mime_body,
DWORD  index,
body_t parent 
)
static

Definition at line 2041 of file mimeole.c.

2042{
2043 body_t *body = HeapAlloc(GetProcessHeap(), 0, sizeof(*body));
2044 if(body)
2045 {
2046 body->mime_body = mime_body;
2047 body->index = index;
2048 list_init(&body->children);
2049 body->parent = parent;
2050
2051 mime_body->handle = UlongToHandle(body->index);
2052 }
2053 return body;
2054}
#define index(s, c)
Definition: various.h:29
HBODY handle
Definition: mimeole.c:161

Referenced by create_sub_body(), and MimeMessage_create().

◆ parse_headers()

static HRESULT parse_headers ( MimeBody body,
IStream stm 
)
static

Definition at line 783 of file mimeole.c.

784{
785 char *header_buf, *cur_header_ptr;
786 HRESULT hr;
788
789 hr = copy_headers_to_buf(stm, &header_buf);
790 if(FAILED(hr)) return hr;
791
792 cur_header_ptr = header_buf;
793 while((header = read_prop(body, &cur_header_ptr)))
794 {
795 read_value(header, &cur_header_ptr);
796 list_add_tail(&body->headers, &header->entry);