ReactOS 0.4.17-dev-357-ga8f14ff
mimeole.c
Go to the documentation of this file.
1/*
2 * MIME OLE Interfaces
3 *
4 * Copyright 2006 Robert Shearman for CodeWeavers
5 * Copyright 2007 Huw Davies for CodeWeavers
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#define COBJMACROS
23
24#include <stdarg.h>
25#include <stdio.h>
26
27#include "windef.h"
28#include "winbase.h"
29#include "winternl.h"
30#include "winuser.h"
31#include "objbase.h"
32#include "ole2.h"
33#include "mimeole.h"
34#include "propvarutil.h"
35
36#include "wine/list.h"
37#include "wine/debug.h"
38
39#include "inetcomm_private.h"
40
42
43typedef struct
44{
47 DWORD flags; /* MIMEPROPFLAGS */
50
51typedef struct
52{
53 struct list entry;
56
57static const property_t default_props[] =
58{
59 {"X-Newsgroup", PID_HDR_NEWSGROUP, 0, VT_LPSTR},
60 {"Newsgroups", PID_HDR_NEWSGROUPS, 0, VT_LPSTR},
61 {"References", PID_HDR_REFS, 0, VT_LPSTR},
62 {"Subject", PID_HDR_SUBJECT, 0, VT_LPSTR},
63 {"From", PID_HDR_FROM, MPF_ADDRESS, VT_LPSTR},
64 {"Message-ID", PID_HDR_MESSAGEID, 0, VT_LPSTR},
65 {"Return-Path", PID_HDR_RETURNPATH, MPF_ADDRESS, VT_LPSTR},
66 {"Rr", PID_HDR_RR, 0, VT_LPSTR},
67 {"Return-Receipt-To", PID_HDR_RETRCPTO, MPF_ADDRESS, VT_LPSTR},
68 {"Apparently-To", PID_HDR_APPARTO, MPF_ADDRESS, VT_LPSTR},
69 {"Date", PID_HDR_DATE, 0, VT_LPSTR},
70 {"Received", PID_HDR_RECEIVED, 0, VT_LPSTR},
71 {"Reply-To", PID_HDR_REPLYTO, MPF_ADDRESS, VT_LPSTR},
72 {"X-Mailer", PID_HDR_XMAILER, 0, VT_LPSTR},
73 {"Bcc", PID_HDR_BCC, MPF_ADDRESS, VT_LPSTR},
74 {"MIME-Version", PID_HDR_MIMEVER, MPF_MIME, VT_LPSTR},
75 {"Content-Type", PID_HDR_CNTTYPE, MPF_MIME | MPF_HASPARAMS, VT_LPSTR},
76 {"Content-Transfer-Encoding", PID_HDR_CNTXFER, MPF_MIME, VT_LPSTR},
77 {"Content-ID", PID_HDR_CNTID, MPF_MIME, VT_LPSTR},
78 {"Content-Description", PID_HDR_CNTDESC, MPF_MIME, VT_LPSTR},
79 {"Content-Disposition", PID_HDR_CNTDISP, MPF_MIME | MPF_HASPARAMS, VT_LPSTR},
80 {"Content-Base", PID_HDR_CNTBASE, MPF_MIME, VT_LPSTR},
81 {"Content-Location", PID_HDR_CNTLOC, MPF_MIME, VT_LPSTR},
82 {"To", PID_HDR_TO, MPF_ADDRESS, VT_LPSTR},
83 {"Path", PID_HDR_PATH, 0, VT_LPSTR},
84 {"Followup-To", PID_HDR_FOLLOWUPTO, 0, VT_LPSTR},
85 {"Expires", PID_HDR_EXPIRES, 0, VT_LPSTR},
86 {"Cc", PID_HDR_CC, MPF_ADDRESS, VT_LPSTR},
87 {"Control", PID_HDR_CONTROL, 0, VT_LPSTR},
88 {"Distribution", PID_HDR_DISTRIB, 0, VT_LPSTR},
89 {"Keywords", PID_HDR_KEYWORDS, 0, VT_LPSTR},
90 {"Summary", PID_HDR_SUMMARY, 0, VT_LPSTR},
91 {"Approved", PID_HDR_APPROVED, 0, VT_LPSTR},
92 {"Lines", PID_HDR_LINES, 0, VT_LPSTR},
93 {"Xref", PID_HDR_XREF, 0, VT_LPSTR},
94 {"Organization", PID_HDR_ORG, 0, VT_LPSTR},
95 {"X-Newsreader", PID_HDR_XNEWSRDR, 0, VT_LPSTR},
96 {"X-Priority", PID_HDR_XPRI, 0, VT_LPSTR},
97 {"X-MSMail-Priority", PID_HDR_XMSPRI, 0, VT_LPSTR},
98 {"par:content-disposition:filename", PID_PAR_FILENAME, 0, VT_LPSTR},
99 {"par:content-type:boundary", PID_PAR_BOUNDARY, 0, VT_LPSTR},
100 {"par:content-type:charset", PID_PAR_CHARSET, 0, VT_LPSTR},
101 {"par:content-type:name", PID_PAR_NAME, 0, VT_LPSTR},
102 {"att:filename", PID_ATT_FILENAME, 0, VT_LPSTR},
103 {"att:pri-content-type", PID_ATT_PRITYPE, 0, VT_LPSTR},
104 {"att:sub-content-type", PID_ATT_SUBTYPE, 0, VT_LPSTR},
105 {"att:illegal-lines", PID_ATT_ILLEGAL, 0, VT_LPSTR},
106 {"att:rendered", PID_ATT_RENDERED, 0, VT_LPSTR},
107 {"att:sent-time", PID_ATT_SENTTIME, 0, VT_LPSTR},
108 {"att:priority", PID_ATT_PRIORITY, 0, VT_LPSTR},
109 {"Comment", PID_HDR_COMMENT, 0, VT_LPSTR},
110 {"Encoding", PID_HDR_ENCODING, 0, VT_LPSTR},
111 {"Encrypted", PID_HDR_ENCRYPTED, 0, VT_LPSTR},
112 {"X-Offsets", PID_HDR_OFFSETS, 0, VT_LPSTR},
113 {"X-Unsent", PID_HDR_XUNSENT, 0, VT_LPSTR},
114 {"X-ArticleId", PID_HDR_ARTICLEID, 0, VT_LPSTR},
115 {"Sender", PID_HDR_SENDER, MPF_ADDRESS, VT_LPSTR},
116 {"att:athena-server", PID_ATT_SERVER, 0, VT_LPSTR},
117 {"att:athena-account-id", PID_ATT_ACCOUNT, 0, VT_LPSTR},
118 {"att:athena-pop3-uidl", PID_ATT_UIDL, 0, VT_LPSTR},
119 {"att:athena-store-msgid", PID_ATT_STOREMSGID, 0, VT_LPSTR},
120 {"att:athena-user-name", PID_ATT_USERNAME, 0, VT_LPSTR},
121 {"att:athena-forward-to", PID_ATT_FORWARDTO, 0, VT_LPSTR},
122 {"att:athena-store-fdrid", PID_ATT_STOREFOLDERID,0, VT_LPSTR},
123 {"att:athena-ghosted", PID_ATT_GHOSTED, 0, VT_LPSTR},
124 {"att:athena-uncachedsize", PID_ATT_UNCACHEDSIZE, 0, VT_LPSTR},
125 {"att:athena-combined", PID_ATT_COMBINED, 0, VT_LPSTR},
126 {"att:auto-inlined", PID_ATT_AUTOINLINED, 0, VT_LPSTR},
127 {"Disposition-Notification-To", PID_HDR_DISP_NOTIFICATION_TO, 0, VT_LPSTR},
128 {"par:Content-Type:reply-type", PID_PAR_REPLYTYPE, 0, VT_LPSTR},
129 {"par:Content-Type:format", PID_PAR_FORMAT , 0, VT_LPSTR},
130 {"att:format", PID_ATT_FORMAT , 0, VT_LPSTR},
131 {"In-Reply-To", PID_HDR_INREPLYTO, 0, VT_LPSTR},
132 {"att:athena-account-name", PID_ATT_ACCOUNTNAME, 0, VT_LPSTR},
133 {NULL, 0, 0, 0}
134};
135
136typedef struct
137{
138 struct list entry;
139 char *name;
140 char *value;
141} param_t;
142
143typedef struct
144{
145 struct list entry;
147 PROPVARIANT value;
148 struct list params;
149} header_t;
150
151typedef struct MimeBody
152{
155
156 HBODY handle;
157
158 struct list headers;
159 struct list new_props; /* FIXME: This should be in a PropertySchema */
163 ENCODINGTYPE encoding;
164 void *data;
166 BODYOFFSETS body_offsets;
168
169typedef struct
170{
176
178{
179 return CONTAINING_RECORD(iface, sub_stream_t, IStream_iface);
180}
181
183{
185
186 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
187 *ppv = NULL;
188
190 IsEqualIID(riid, &IID_ISequentialStream) ||
191 IsEqualIID(riid, &IID_IStream))
192 {
193 IStream_AddRef(iface);
194 *ppv = iface;
195 return S_OK;
196 }
197 return E_NOINTERFACE;
198}
199
201{
204
205 TRACE("(%p) ref=%ld\n", This, ref);
206
207 return ref;
208}
209
211{
214
215 TRACE("(%p) ref=%ld\n", This, ref);
216
217 if(!ref)
218 {
219 IStream_Release(This->base);
220 free(This);
221 }
222 return ref;
223}
224
226 IStream* iface,
227 void *pv,
228 ULONG cb,
229 ULONG *pcbRead)
230{
232 HRESULT hr;
233 LARGE_INTEGER tmp_pos;
234
235 TRACE("(%p, %ld, %p)\n", pv, cb, pcbRead);
236
237 tmp_pos.QuadPart = This->pos.QuadPart + This->start.QuadPart;
238 IStream_Seek(This->base, tmp_pos, STREAM_SEEK_SET, NULL);
239
240 if(This->pos.QuadPart + cb > This->length.QuadPart)
241 cb = This->length.QuadPart - This->pos.QuadPart;
242
243 hr = IStream_Read(This->base, pv, cb, pcbRead);
244
245 This->pos.QuadPart += *pcbRead;
246
247 return hr;
248}
249
251 IStream* iface,
252 const void *pv,
253 ULONG cb,
254 ULONG *pcbWritten)
255{
256 FIXME("stub\n");
257 return E_NOTIMPL;
258}
259
261 IStream* iface,
262 LARGE_INTEGER dlibMove,
263 DWORD dwOrigin,
264 ULARGE_INTEGER *plibNewPosition)
265{
267 LARGE_INTEGER new_pos;
268
269 TRACE("(%08lx.%08lx, %lx, %p)\n", dlibMove.HighPart, dlibMove.LowPart, dwOrigin, plibNewPosition);
270
271 switch(dwOrigin)
272 {
273 case STREAM_SEEK_SET:
274 new_pos = dlibMove;
275 break;
276 case STREAM_SEEK_CUR:
277 new_pos.QuadPart = This->pos.QuadPart + dlibMove.QuadPart;
278 break;
279 case STREAM_SEEK_END:
280 new_pos.QuadPart = This->length.QuadPart + dlibMove.QuadPart;
281 break;
282 default:
284 }
285
286 if(new_pos.QuadPart < 0) new_pos.QuadPart = 0;
287 else if(new_pos.QuadPart > This->length.QuadPart) new_pos.QuadPart = This->length.QuadPart;
288
289 This->pos.QuadPart = new_pos.QuadPart;
290
291 if(plibNewPosition) *plibNewPosition = This->pos;
292 return S_OK;
293}
294
296 IStream* iface,
297 ULARGE_INTEGER libNewSize)
298{
299 FIXME("stub\n");
300 return E_NOTIMPL;
301}
302
304 IStream* iface,
305 IStream *pstm,
307 ULARGE_INTEGER *pcbRead,
308 ULARGE_INTEGER *pcbWritten)
309{
310 HRESULT hr = S_OK;
311 BYTE tmpBuffer[128];
312 ULONG bytesRead, bytesWritten, copySize;
313 ULARGE_INTEGER totalBytesRead;
314 ULARGE_INTEGER totalBytesWritten;
315
316 TRACE("(%p)->(%p, %ld, %p, %p)\n", iface, pstm, cb.LowPart, pcbRead, pcbWritten);
317
318 totalBytesRead.QuadPart = 0;
319 totalBytesWritten.QuadPart = 0;
320
321 while ( cb.QuadPart > 0 )
322 {
323 if ( cb.QuadPart >= sizeof(tmpBuffer) )
324 copySize = sizeof(tmpBuffer);
325 else
326 copySize = cb.LowPart;
327
328 hr = IStream_Read(iface, tmpBuffer, copySize, &bytesRead);
329 if (FAILED(hr)) break;
330
331 totalBytesRead.QuadPart += bytesRead;
332
333 if (bytesRead)
334 {
335 hr = IStream_Write(pstm, tmpBuffer, bytesRead, &bytesWritten);
336 if (FAILED(hr)) break;
337 totalBytesWritten.QuadPart += bytesWritten;
338 }
339
340 if (bytesRead != copySize)
341 cb.QuadPart = 0;
342 else
343 cb.QuadPart -= bytesRead;
344 }
345
346 if (pcbRead) pcbRead->QuadPart = totalBytesRead.QuadPart;
347 if (pcbWritten) pcbWritten->QuadPart = totalBytesWritten.QuadPart;
348
349 return hr;
350}
351
353 IStream* iface,
354 DWORD grfCommitFlags)
355{
356 FIXME("stub\n");
357 return E_NOTIMPL;
358}
359
361 IStream* iface)
362{
363 FIXME("stub\n");
364 return E_NOTIMPL;
365}
366
368 IStream* iface,
369 ULARGE_INTEGER libOffset,
371 DWORD dwLockType)
372{
373 FIXME("stub\n");
374 return E_NOTIMPL;
375}
376
378 IStream* iface,
379 ULARGE_INTEGER libOffset,
381 DWORD dwLockType)
382{
383 FIXME("stub\n");
384 return E_NOTIMPL;
385}
386
388 IStream* iface,
389 STATSTG *pstatstg,
390 DWORD grfStatFlag)
391{
393 FIXME("(%p)->(%p, %08lx)\n", This, pstatstg, grfStatFlag);
394 memset(pstatstg, 0, sizeof(*pstatstg));
395 pstatstg->cbSize = This->length;
396 return S_OK;
397}
398
400 IStream* iface,
401 IStream **ppstm)
402{
403 FIXME("stub\n");
404 return E_NOTIMPL;
405}
406
407static struct IStreamVtbl sub_stream_vtbl =
408{
423};
424
426{
428
429 *out = NULL;
430 This = malloc(sizeof(*This));
431 if(!This) return E_OUTOFMEMORY;
432
433 This->IStream_iface.lpVtbl = &sub_stream_vtbl;
434 This->ref = 1;
435 This->start = start;
436 This->length = length;
437 This->pos.QuadPart = 0;
438 IStream_AddRef(stream);
439 This->base = stream;
440
441 *out = &This->IStream_iface;
442 return S_OK;
443}
444
446{
447 STATSTG statstg = {NULL};
450
451 hres = IStream_Stat(stream, &statstg, STATFLAG_NONAME);
452 if(SUCCEEDED(hres)) {
453 *size = statstg.cbSize;
454 return S_OK;
455 }
456
457 zero.QuadPart = 0;
458 return IStream_Seek(stream, zero, STREAM_SEEK_END, size);
459}
460
462{
463 return CONTAINING_RECORD(iface, MimeBody, IMimeBody_iface);
464}
465
466typedef struct propschema
467{
468 IMimePropertySchema IMimePropertySchema_iface;
471
472static inline propschema *impl_from_IMimePropertySchema(IMimePropertySchema *iface)
473{
474 return CONTAINING_RECORD(iface, propschema, IMimePropertySchema_iface);
475}
476
477#define PARSER_BUF_SIZE 1024
478
479/*****************************************************
480 * copy_headers_to_buf [internal]
481 *
482 * Copies the headers into a '\0' terminated memory block and leave
483 * the stream's current position set to after the blank line.
484 */
486{
487 char *buf = NULL, *new_buf;
488 DWORD size = PARSER_BUF_SIZE, offset = 0, last_end = 0;
489 HRESULT hr;
490 BOOL done = FALSE;
491
492 *ptr = NULL;
493
494 do
495 {
496 char *end;
497 DWORD read;
498
499 if(buf) size *= 2;
500 new_buf = realloc(buf, size + 1);
501 if(!new_buf)
502 {
504 goto fail;
505 }
506 buf = new_buf;
507
508 hr = IStream_Read(stm, buf + offset, size - offset, &read);
509 if(FAILED(hr)) goto fail;
510
511 offset += read;
512 buf[offset] = '\0';
513
514 if(read == 0) done = TRUE;
515
516 while(!done && (end = strstr(buf + last_end, "\r\n")))
517 {
518 DWORD new_end = end - buf + 2;
519 if(new_end - last_end == 2)
520 {
521 LARGE_INTEGER off;
522 off.QuadPart = (LONGLONG)new_end - offset;
523 IStream_Seek(stm, off, STREAM_SEEK_CUR, NULL);
524 buf[new_end] = '\0';
525 done = TRUE;
526 }
527 else
528 last_end = new_end;
529 }
530 } while(!done);
531
532 *ptr = buf;
533 return S_OK;
534
535fail:
536 free(buf);
537 return hr;
538}
539
541{
542 char *colon = strchr(*ptr, ':');
543 const property_t *prop;
544 header_t *ret;
545
546 if(!colon) return NULL;
547
548 *colon = '\0';
549
550 for(prop = default_props; prop->name; prop++)
551 {
552 if(!lstrcmpiA(*ptr, prop->name))
553 {
554 TRACE("%s: found match with default property id %ld\n", *ptr, prop->id);
555 break;
556 }
557 }
558
559 if(!prop->name)
560 {
561 property_list_entry_t *prop_entry;
562 LIST_FOR_EACH_ENTRY(prop_entry, &body->new_props, property_list_entry_t, entry)
563 {
564 if(!lstrcmpiA(*ptr, prop_entry->prop.name))
565 {
566 TRACE("%s: found match with already added new property id %ld\n", *ptr, prop_entry->prop.id);
567 prop = &prop_entry->prop;
568 break;
569 }
570 }
571 if(!prop->name)
572 {
573 prop_entry = malloc(sizeof(*prop_entry));
574 prop_entry->prop.name = strdup(*ptr);
575 prop_entry->prop.id = body->next_prop_id++;
576 prop_entry->prop.flags = 0;
577 prop_entry->prop.default_vt = VT_LPSTR;
578 list_add_tail(&body->new_props, &prop_entry->entry);
579 prop = &prop_entry->prop;
580 TRACE("%s: allocating new prop id %ld\n", *ptr, prop_entry->prop.id);
581 }
582 }
583
584 ret = malloc(sizeof(*ret));
585 ret->prop = prop;
586 PropVariantInit(&ret->value);
587 list_init(&ret->params);
588 *ptr = colon + 1;
589
590 return ret;
591}
592
593static void unfold_header(char *header, int len)
594{
595 char *start = header, *cp = header;
596
597 do {
598 while(*cp == ' ' || *cp == '\t')
599 {
600 cp++;
601 len--;
602 }
603 if(cp != start)
604 memmove(start, cp, len + 1);
605
606 cp = strstr(start, "\r\n");
607 len -= (cp - start);
608 start = cp;
609 *start = ' ';
610 start++;
611 len--;
612 cp += 2;
613 } while(*cp == ' ' || *cp == '\t');
614
615 *(start - 1) = '\0';
616}
617
618static char *unquote_string(const char *str)
619{
620 BOOL quoted = FALSE;
621 char *ret, *cp;
622
623 while(*str == ' ' || *str == '\t') str++;
624
625 if(*str == '"')
626 {
627 quoted = TRUE;
628 str++;
629 }
630 ret = strdup(str);
631 for(cp = ret; *cp; cp++)
632 {
633 if(*cp == '\\')
634 memmove(cp, cp + 1, strlen(cp + 1) + 1);
635 else if(*cp == '"')
636 {
637 if(!quoted)
638 {
639 WARN("quote in unquoted string\n");
640 }
641 else
642 {
643 *cp = '\0';
644 break;
645 }
646 }
647 }
648 return ret;
649}
650
651static void add_param(header_t *header, const char *p)
652{
653 const char *key = p, *value, *cp = p;
654 param_t *param;
655 char *name;
656
657 TRACE("got param %s\n", p);
658
659 while (*key == ' ' || *key == '\t' ) key++;
660
661 cp = strchr(key, '=');
662 if(!cp)
663 {
664 WARN("malformed parameter - skipping\n");
665 return;
666 }
667
668 name = malloc(cp - key + 1);
669 memcpy(name, key, cp - key);
670 name[cp - key] = '\0';
671
672 value = cp + 1;
673
674 param = malloc(sizeof(*param));
675 param->name = name;
676 param->value = unquote_string(value);
677 list_add_tail(&header->params, &param->entry);
678}
679
680static void split_params(header_t *header, char *value)
681{
682 char *cp = value, *start = value;
683 BOOL in_quotes = FALSE, done_value = FALSE;
684
685 while(*cp)
686 {
687 if(!in_quotes && *cp == ';')
688 {
689 *cp = '\0';
690 if(done_value) add_param(header, start);
691 done_value = TRUE;
692 start = cp + 1;
693 }
694 else if(*cp == '"')
695 in_quotes = !in_quotes;
696 cp++;
697 }
698 if(done_value) add_param(header, start);
699}
700
701static void read_value(header_t *header, char **cur)
702{
703 char *end = *cur, *value;
704 DWORD len;
705
706 do {
707 end = strstr(end, "\r\n");
708 end += 2;
709 } while(*end == ' ' || *end == '\t');
710
711 len = end - *cur;
712 value = CoTaskMemAlloc(len + 1);
713 memcpy(value, *cur, len);
714 value[len] = '\0';
715
717 TRACE("value %s\n", debugstr_a(value));
718
719 if(header->prop->flags & MPF_HASPARAMS)
720 {
722 TRACE("value w/o params %s\n", debugstr_a(value));
723 }
724
725 header->value.vt = VT_LPSTR;
726 header->value.pszVal = value;
727
728 *cur = end;
729}
730
732{
733 char *slash;
734 DWORD len;
735
736 slash = strchr(header->value.pszVal, '/');
737 if(!slash)
738 {
739 WARN("malformed context type value\n");
740 return;
741 }
742 len = slash - header->value.pszVal;
743 body->content_pri_type = malloc(len + 1);
744 memcpy(body->content_pri_type, header->value.pszVal, len);
745 body->content_pri_type[len] = '\0';
746 body->content_sub_type = strdup(slash + 1);
747}
748
750{
751 const char *encoding = header->value.pszVal;
752
753 if(!stricmp(encoding, "base64"))
754 body->encoding = IET_BASE64;
755 else if(!stricmp(encoding, "quoted-printable"))
756 body->encoding = IET_QP;
757 else if(!stricmp(encoding, "7bit"))
758 body->encoding = IET_7BIT;
759 else if(!stricmp(encoding, "8bit"))
760 body->encoding = IET_8BIT;
761 else
762 FIXME("unknown encoding %s\n", debugstr_a(encoding));
763}
764
766{
767 char *header_buf, *cur_header_ptr;
768 HRESULT hr;
770
771 hr = copy_headers_to_buf(stm, &header_buf);
772 if(FAILED(hr)) return hr;
773
774 cur_header_ptr = header_buf;
775 while((header = read_prop(body, &cur_header_ptr)))
776 {
777 read_value(header, &cur_header_ptr);
778 list_add_tail(&body->headers, &header->entry);
779
780 switch(header->prop->id) {
781 case PID_HDR_CNTTYPE:
783 break;
784 case PID_HDR_CNTXFER:
786 break;
787 }
788 }
789
790 free(header_buf);
791 return hr;
792}
793
794static void empty_param_list(struct list *list)
795{
796 param_t *param, *cursor2;
797
799 {
800 list_remove(&param->entry);
801 free(param->name);
802 free(param->value);
803 free(param);
804 }
805}
806
808{
809 list_remove(&header->entry);
811 empty_param_list(&header->params);
812 free(header);
813}
814
815static void empty_header_list(struct list *list)
816{
817 header_t *header, *cursor2;
818
820 {
822 }
823}
824
825static void empty_new_prop_list(struct list *list)
826{
827 property_list_entry_t *prop, *cursor2;
828
830 {
831 list_remove(&prop->entry);
832 free((char *)prop->prop.name);
833 free(prop);
834 }
835}
836
837static void release_data(REFIID riid, void *data)
838{
839 if(!data) return;
840
841 if(IsEqualIID(riid, &IID_IStream))
842 IStream_Release((IStream *)data);
843 else
844 FIXME("Unhandled data format %s\n", debugstr_guid(riid));
845}
846
847static HRESULT find_prop(MimeBody *body, const char *name, header_t **prop)
848{
850
851 *prop = NULL;
852
854 {
855 if(ISPIDSTR(name))
856 {
857 if(STRTOPID(name) == header->prop->id)
858 {
859 *prop = header;
860 return S_OK;
861 }
862 }
863 else if(!lstrcmpiA(name, header->prop->name))
864 {
865 *prop = header;
866 return S_OK;
867 }
868 }
869
870 return MIME_E_NOT_FOUND;
871}
872
873static const property_t *find_default_prop(const char *name)
874{
875 const property_t *prop_def = NULL;
876
877 for(prop_def = default_props; prop_def->name; prop_def++)
878 {
879 if(ISPIDSTR(name))
880 {
881 if(STRTOPID(name) == prop_def->id)
882 {
883 break;
884 }
885 }
886 else if(!lstrcmpiA(name, prop_def->name))
887 {
888 break;
889 }
890 }
891
892 if(prop_def->id)
893 TRACE("%s: found match with default property id %ld\n", prop_def->name, prop_def->id);
894 else
895 prop_def = NULL;
896
897 return prop_def;
898}
899
901 REFIID riid,
902 void** ppvObject)
903{
904 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppvObject);
905
906 *ppvObject = NULL;
907
911 IsEqualIID(riid, &IID_IMimePropertySet) ||
912 IsEqualIID(riid, &IID_IMimeBody))
913 {
914 *ppvObject = iface;
915 }
916
917 if(*ppvObject)
918 {
919 IUnknown_AddRef((IUnknown*)*ppvObject);
920 return S_OK;
921 }
922
923 FIXME("no interface for %s\n", debugstr_guid(riid));
924 return E_NOINTERFACE;
925}
926
928{
931
932 TRACE("(%p) ref=%ld\n", This, ref);
933
934 return ref;
935}
936
938{
941
942 TRACE("(%p) ref=%ld\n", This, ref);
943
944 if (!ref)
945 {
946 empty_header_list(&This->headers);
947 empty_new_prop_list(&This->new_props);
948
949 free(This->content_pri_type);
950 free(This->content_sub_type);
951
952 release_data(&This->data_iid, This->data);
953
954 free(This);
955 }
956
957 return ref;
958}
959
961 IMimeBody* iface,
962 CLSID* pClassID)
963{
965
966 TRACE("(%p)->(%p)\n", This, pClassID);
967
968 if(!pClassID)
969 return E_INVALIDARG;
970
971 *pClassID = IID_IMimeBody;
972 return S_OK;
973}
974
976 IMimeBody* iface)
977{
979 FIXME("(%p)->() stub\n", This);
980 return E_NOTIMPL;
981}
982
984{
986 TRACE("(%p)->(%p)\n", This, pStm);
987 return parse_headers(This, pStm);
988}
989
990static HRESULT WINAPI MimeBody_Save(IMimeBody *iface, IStream *pStm, BOOL fClearDirty)
991{
993 FIXME("(%p)->(%p, %d)\n", This, pStm, fClearDirty);
994 return E_NOTIMPL;
995}
996
998 IMimeBody* iface,
999 ULARGE_INTEGER* pcbSize)
1000{
1002 FIXME("(%p)->(%p) stub\n", This, pcbSize);
1003 return E_NOTIMPL;
1004}
1005
1007 IMimeBody* iface)
1008{
1010 TRACE("(%p)->()\n", This);
1011 return S_OK;
1012}
1013
1015 IMimeBody* iface,
1016 LPCSTR pszName,
1017 LPMIMEPROPINFO pInfo)
1018{
1021 HRESULT hr;
1022 DWORD supported = PIM_PROPID | PIM_VTDEFAULT;
1023
1024 TRACE("(%p)->(%s, %p) semi-stub\n", This, debugstr_a(pszName), pInfo);
1025
1026 if(!pszName || !pInfo)
1027 return E_INVALIDARG;
1028
1029 TRACE("mask 0x%04lx\n", pInfo->dwMask);
1030
1031 if(pInfo->dwMask & ~supported)
1032 FIXME("Unsupported mask flags 0x%04lx\n", pInfo->dwMask & ~supported);
1033
1034 hr = find_prop(This, pszName, &header);
1035 if(hr == S_OK)
1036 {
1037 if(pInfo->dwMask & PIM_CHARSET)
1038 pInfo->hCharset = 0;
1039 if(pInfo->dwMask & PIM_FLAGS)
1040 pInfo->dwFlags = 0x00000000;
1041 if(pInfo->dwMask & PIM_ROWNUMBER)
1042 pInfo->dwRowNumber = 0;
1043 if(pInfo->dwMask & PIM_ENCODINGTYPE)
1044 pInfo->ietEncoding = 0;
1045 if(pInfo->dwMask & PIM_VALUES)
1046 pInfo->cValues = 0;
1047 if(pInfo->dwMask & PIM_PROPID)
1048 pInfo->dwPropId = header->prop->id;
1049 if(pInfo->dwMask & PIM_VTDEFAULT)
1050 pInfo->vtDefault = header->prop->default_vt;
1051 if(pInfo->dwMask & PIM_VTCURRENT)
1052 pInfo->vtCurrent = 0;
1053 }
1054
1055 return hr;
1056}
1057
1059 IMimeBody* iface,
1060 LPCSTR pszName,
1061 LPCMIMEPROPINFO pInfo)
1062{
1064 FIXME("(%p)->(%s, %p) stub\n", This, debugstr_a(pszName), pInfo);
1065 return E_NOTIMPL;
1066}
1067
1069 IMimeBody* iface,
1070 LPCSTR pszName,
1071 DWORD dwFlags,
1072 LPPROPVARIANT pValue)
1073{
1076 HRESULT hr;
1077
1078 TRACE("(%p)->(%s, 0x%lx, %p)\n", This, debugstr_a(pszName), dwFlags, pValue);
1079
1080 if(!pszName || !pValue)
1081 return E_INVALIDARG;
1082
1083 if(!ISPIDSTR(pszName) && !lstrcmpiA(pszName, "att:pri-content-type"))
1084 {
1086 pValue->vt = VT_LPSTR;
1087 pValue->pszVal = CoTaskMemAlloc(strlen(This->content_pri_type) + 1);
1088 strcpy(pValue->pszVal, This->content_pri_type);
1089 return S_OK;
1090 }
1091
1092 hr = find_prop(This, pszName, &header);
1093 if(hr == S_OK)
1094 {
1095 TRACE("type %d->%d\n", header->value.vt, pValue->vt);
1096
1098 if(FAILED(hr))
1099 FIXME("Conversion not currently supported (%d->%d)\n", header->value.vt, pValue->vt);
1100 }
1101
1102 return hr;
1103}
1104
1106 IMimeBody* iface,
1107 LPCSTR pszName,
1108 DWORD dwFlags,
1109 LPCPROPVARIANT pValue)
1110{
1113 HRESULT hr;
1114
1115 TRACE("(%p)->(%s, 0x%lx, %p)\n", This, debugstr_a(pszName), dwFlags, pValue);
1116
1117 if(!pszName || !pValue)
1118 return E_INVALIDARG;
1119
1120 hr = find_prop(This, pszName, &header);
1121 if(hr != S_OK)
1122 {
1123 property_list_entry_t *prop_entry;
1124 const property_t *prop = NULL;
1125
1126 LIST_FOR_EACH_ENTRY(prop_entry, &This->new_props, property_list_entry_t, entry)
1127 {
1128 if(ISPIDSTR(pszName))
1129 {
1130 if(STRTOPID(pszName) == prop_entry->prop.id)
1131 {
1132 TRACE("Found match with already added new property id %ld\n", prop_entry->prop.id);
1133 prop = &prop_entry->prop;
1134 break;
1135 }
1136 }
1137 else if(!lstrcmpiA(pszName, prop_entry->prop.name))
1138 {
1139 TRACE("Found match with already added new property id %ld\n", prop_entry->prop.id);
1140 prop = &prop_entry->prop;
1141 break;
1142 }
1143 }
1144
1145 header = malloc(sizeof(*header));
1146 if(!header)
1147 return E_OUTOFMEMORY;
1148
1149 if(!prop)
1150 {
1151 const property_t *prop_def = NULL;
1152 prop_entry = malloc(sizeof(*prop_entry));
1153 if(!prop_entry)
1154 {
1155 free(header);
1156 return E_OUTOFMEMORY;
1157 }
1158
1159 prop_def = find_default_prop(pszName);
1160 if(prop_def)
1161 {
1162 prop_entry->prop.name = strdup(prop_def->name);
1163 prop_entry->prop.id = prop_def->id;
1164 }
1165 else
1166 {
1167 if(ISPIDSTR(pszName))
1168 {
1169 free(prop_entry);
1170 free(header);
1171 return MIME_E_NOT_FOUND;
1172 }
1173
1174 prop_entry->prop.name = strdup(pszName);
1175 prop_entry->prop.id = This->next_prop_id++;
1176 }
1177
1178 prop_entry->prop.flags = 0;
1179 prop_entry->prop.default_vt = pValue->vt;
1180 list_add_tail(&This->new_props, &prop_entry->entry);
1181 prop = &prop_entry->prop;
1182 TRACE("Allocating new prop id %ld\n", prop_entry->prop.id);
1183 }
1184
1185 header->prop = prop;
1186 PropVariantInit(&header->value);
1187 list_init(&header->params);
1188 list_add_tail(&This->headers, &header->entry);
1189 }
1190
1192
1193 return S_OK;
1194}
1195
1197 IMimeBody* iface,
1198 LPCSTR pszName,
1199 DWORD dwFlags,
1200 LPPROPVARIANT pValue)
1201{
1203 FIXME("(%p)->(%s, 0x%lx, %p) stub\n", This, debugstr_a(pszName), dwFlags, pValue);
1204 return E_NOTIMPL;
1205}
1206
1208 IMimeBody* iface,
1209 LPCSTR pszName)
1210{
1213 BOOL found;
1214
1215 TRACE("(%p)->(%s) stub\n", This, debugstr_a(pszName));
1216
1218 {
1219 if(ISPIDSTR(pszName))
1220 found = STRTOPID(pszName) == cursor->prop->id;
1221 else
1222 found = !lstrcmpiA(pszName, cursor->prop->name);
1223
1224 if(found)
1225 {
1227 return S_OK;
1228 }
1229 }
1230
1231 return MIME_E_NOT_FOUND;
1232}
1233
1235 IMimeBody* iface,
1236 ULONG cNames,
1237 LPCSTR* prgszName,
1238 IMimePropertySet* pPropertySet)
1239{
1241 FIXME("(%p)->(%ld, %p, %p) stub\n", This, cNames, prgszName, pPropertySet);
1242 return E_NOTIMPL;
1243}
1244
1246 IMimeBody* iface,
1247 ULONG cNames,
1248 LPCSTR* prgszName,
1249 IMimePropertySet* pPropertySet)
1250{
1252 FIXME("(%p)->(%ld, %p, %p) stub\n", This, cNames, prgszName, pPropertySet);
1253 return E_NOTIMPL;
1254}
1255
1257 IMimeBody* iface,
1258 ULONG cNames,
1259 LPCSTR* prgszName)
1260{
1262 FIXME("(%p)->(%ld, %p) stub\n", This, cNames, prgszName);
1263 return E_NOTIMPL;
1264}
1265
1267 IMimeBody* iface,
1268 LPCSTR pszName,
1269 LPCSTR pszCriteria,
1270 boolean fSubString,
1271 boolean fCaseSensitive)
1272{
1274 FIXME("(%p)->(%s, %s, %d, %d) stub\n", This, debugstr_a(pszName), debugstr_a(pszCriteria), fSubString, fCaseSensitive);
1275 return E_NOTIMPL;
1276}
1277
1279 IMimeBody* iface,
1280 LPHCHARSET phCharset)
1281{
1283 FIXME("(%p)->(%p) stub\n", This, phCharset);
1284 *phCharset = NULL;
1285 return S_OK;
1286}
1287
1289 IMimeBody* iface,
1290 HCHARSET hCharset,
1291 CSETAPPLYTYPE applytype)
1292{
1294 FIXME("(%p)->(%p, %d) stub\n", This, hCharset, applytype);
1295 return E_NOTIMPL;
1296}
1297
1299 IMimeBody* iface,
1300 LPCSTR pszName,
1301 ULONG* pcParams,
1302 LPMIMEPARAMINFO* pprgParam)
1303{
1305 HRESULT hr;
1307
1308 TRACE("(%p)->(%s, %p, %p)\n", iface, debugstr_a(pszName), pcParams, pprgParam);
1309
1310 *pprgParam = NULL;
1311 *pcParams = 0;
1312
1313 hr = find_prop(This, pszName, &header);
1314 if(hr != S_OK) return hr;
1315
1316 *pcParams = list_count(&header->params);
1317 if(*pcParams)
1318 {
1319 IMimeAllocator *alloc;
1320 param_t *param;
1321 MIMEPARAMINFO *info;
1322
1324
1325 *pprgParam = info = IMimeAllocator_Alloc(alloc, *pcParams * sizeof(**pprgParam));
1327 {
1328 int len;
1329
1330 len = strlen(param->name) + 1;
1331 info->pszName = IMimeAllocator_Alloc(alloc, len);
1332 memcpy(info->pszName, param->name, len);
1333 len = strlen(param->value) + 1;
1334 info->pszData = IMimeAllocator_Alloc(alloc, len);
1335 memcpy(info->pszData, param->value, len);
1336 info++;
1337 }
1338 IMimeAllocator_Release(alloc);
1339 }
1340 return S_OK;
1341}
1342
1344 IMimeBody* iface,
1345 LPCSTR pszPriType,
1346 LPCSTR pszSubType)
1347{
1349
1350 TRACE("(%p)->(%s, %s)\n", This, debugstr_a(pszPriType), debugstr_a(pszSubType));
1351 if(pszPriType)
1352 {
1353 const char *pri = This->content_pri_type;
1354 if(!pri) pri = "text";
1355 if(lstrcmpiA(pri, pszPriType)) return S_FALSE;
1356 }
1357
1358 if(pszSubType)
1359 {
1360 const char *sub = This->content_sub_type;
1361 if(!sub) sub = "plain";
1362 if(lstrcmpiA(sub, pszSubType)) return S_FALSE;
1363 }
1364
1365 return S_OK;
1366}
1367
1369 IMimeBody* iface,
1370 REFIID riid,
1371 void** ppvObject)
1372{
1374 FIXME("(%p)->(%s, %p) stub\n", This, debugstr_guid(riid), ppvObject);
1375 return E_NOTIMPL;
1376}
1377
1379 IMimeBody* iface,
1380 IMimePropertySet** ppPropertySet)
1381{
1383 FIXME("(%p)->(%p) stub\n", This, ppPropertySet);
1384 return E_NOTIMPL;
1385}
1386
1388 IMimeBody* iface,
1389 const TYPEDID oid,
1390 LPCPROPVARIANT pValue)
1391{
1394 TRACE("(%p)->(%08lx, %p)\n", This, oid, pValue);
1395
1396 if(pValue->vt != TYPEDID_TYPE(oid))
1397 {
1398 WARN("Called with vartype %04x and oid %08lx\n", pValue->vt, oid);
1399 return E_INVALIDARG;
1400 }
1401
1402 switch(oid)
1403 {
1404 case OID_SECURITY_HWND_OWNER:
1405 FIXME("OID_SECURITY_HWND_OWNER (value %08lx): ignoring\n", pValue->ulVal);
1406 hr = S_OK;
1407 break;
1408 case OID_TRANSMIT_BODY_ENCODING:
1409 FIXME("OID_TRANSMIT_BODY_ENCODING (value %08lx): ignoring\n", pValue->ulVal);
1410 hr = S_OK;
1411 break;
1412 default:
1413 FIXME("Unhandled oid %08lx\n", oid);
1414 }
1415
1416 return hr;
1417}
1418
1420 IMimeBody* iface,
1421 const TYPEDID oid,
1422 LPPROPVARIANT pValue)
1423{
1425 FIXME("(%p)->(%08lx, %p): stub\n", This, oid, pValue);
1426 return E_NOTIMPL;
1427}
1428
1430 IMimeBody* iface,
1431 DWORD dwFlags,
1432 IMimeEnumProperties** ppEnum)
1433{
1435 FIXME("(%p)->(0x%lx, %p) stub\n", This, dwFlags, ppEnum);
1436 return E_NOTIMPL;
1437}
1438
1440 IMimeBody* iface,
1441 IMSGBODYTYPE bodytype)
1442{
1444
1445 TRACE("(%p)->(%d)\n", This, bodytype);
1446 switch(bodytype)
1447 {
1448 case IBT_EMPTY:
1449 return This->data ? S_FALSE : S_OK;
1450 default:
1451 FIXME("Unimplemented bodytype %d - returning S_OK\n", bodytype);
1452 }
1453 return S_OK;
1454}
1455
1457 IMimeBody* iface,
1458 LPCSTR pszDisplay)
1459{
1461 FIXME("(%p)->(%s) stub\n", This, debugstr_a(pszDisplay));
1462 return E_NOTIMPL;
1463}
1464
1466 IMimeBody* iface,
1467 LPSTR* ppszDisplay)
1468{
1470 FIXME("(%p)->(%p) stub\n", This, ppszDisplay);
1471 return E_NOTIMPL;
1472}
1473
1475 IMimeBody* iface,
1476 LPBODYOFFSETS pOffsets)
1477{
1479 TRACE("(%p)->(%p)\n", This, pOffsets);
1480
1481 *pOffsets = This->body_offsets;
1482
1483 if(This->body_offsets.cbBodyEnd == 0) return MIME_E_NO_DATA;
1484 return S_OK;
1485}
1486
1488 IMimeBody* iface,
1489 ENCODINGTYPE* pietEncoding)
1490{
1492
1493 TRACE("(%p)->(%p)\n", This, pietEncoding);
1494
1495 *pietEncoding = This->encoding;
1496 return S_OK;
1497}
1498
1500 IMimeBody* iface,
1501 ENCODINGTYPE ietEncoding)
1502{
1504
1505 TRACE("(%p)->(%d)\n", This, ietEncoding);
1506
1507 This->encoding = ietEncoding;
1508 return S_OK;
1509}
1510
1512 IMimeBody* iface,
1513 ENCODINGTYPE ietEncoding,
1514 ULONG* pcbSize)
1515{
1517 FIXME("(%p)->(%d, %p) stub\n", This, ietEncoding, pcbSize);
1518 return E_NOTIMPL;
1519}
1520
1522 IMimeBody* iface,
1523 ENCODINGTYPE ietEncoding,
1524 IStream* pStream)
1525{
1527 FIXME("(%p)->(%d, %p) stub\n", This, ietEncoding, pStream);
1528 return E_NOTIMPL;
1529}
1530
1531static const signed char base64_decode_table[] =
1532{
1533 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x00 */
1534 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x10 */
1535 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, /* 0x20 */
1536 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, /* 0x30 */
1537 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, /* 0x40 */
1538 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, /* 0x50 */
1539 -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, /* 0x60 */
1540 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 /* 0x70 */
1541};
1542
1544{
1545 const unsigned char *ptr, *end;
1546 unsigned char buf[1024];
1548 unsigned char *ret;
1549 unsigned char in[4];
1550 IStream *output;
1551 DWORD size;
1552 int n = 0;
1553 HRESULT hres;
1554
1555 pos.QuadPart = 0;
1556 hres = IStream_Seek(input, pos, STREAM_SEEK_SET, NULL);
1557 if(FAILED(hres))
1558 return hres;
1559
1560 hres = CreateStreamOnHGlobal(NULL, TRUE, &output);
1561 if(FAILED(hres))
1562 return hres;
1563
1564 while(1) {
1565 hres = IStream_Read(input, buf, sizeof(buf), &size);
1566 if(FAILED(hres) || !size)
1567 break;
1568
1569 ptr = ret = buf;
1570 end = buf + size;
1571
1572 while(1) {
1573 /* skip invalid chars */
1574 while(ptr < end && (*ptr >= ARRAY_SIZE(base64_decode_table)
1575 || base64_decode_table[*ptr] == -1))
1576 ptr++;
1577 if(ptr == end)
1578 break;
1579
1580 in[n++] = base64_decode_table[*ptr++];
1581 switch(n) {
1582 case 2:
1583 *ret++ = in[0] << 2 | in[1] >> 4;
1584 continue;
1585 case 3:
1586 *ret++ = in[1] << 4 | in[2] >> 2;
1587 continue;
1588 case 4:
1589 *ret++ = ((in[2] << 6) & 0xc0) | in[3];
1590 n = 0;
1591 }
1592 }
1593
1594 if(ret > buf) {
1595 hres = IStream_Write(output, buf, ret - buf, NULL);
1596 if(FAILED(hres))
1597 break;
1598 }
1599 }
1600
1601 if(SUCCEEDED(hres))
1602 hres = IStream_Seek(output, pos, STREAM_SEEK_SET, NULL);
1603 if(FAILED(hres)) {
1604 IStream_Release(output);
1605 return hres;
1606 }
1607
1608 *ret_stream = output;
1609 return S_OK;
1610}
1611
1612static int hex_digit(char c)
1613{
1614 if('0' <= c && c <= '9')
1615 return c - '0';
1616 if('A' <= c && c <= 'F')
1617 return c - 'A' + 10;
1618 if('a' <= c && c <= 'f')
1619 return c - 'a' + 10;
1620 return -1;
1621}
1622
1623static HRESULT decode_qp(IStream *input, IStream **ret_stream)
1624{
1625 const unsigned char *ptr, *end;
1626 unsigned char *ret, prev = 0;
1627 unsigned char buf[1024];
1629 IStream *output;
1630 DWORD size;
1631 int n = -1;
1632 HRESULT hres;
1633
1634 pos.QuadPart = 0;
1635 hres = IStream_Seek(input, pos, STREAM_SEEK_SET, NULL);
1636 if(FAILED(hres))
1637 return hres;
1638
1639 hres = CreateStreamOnHGlobal(NULL, TRUE, &output);
1640 if(FAILED(hres))
1641 return hres;
1642
1643 while(1) {
1644 hres = IStream_Read(input, buf, sizeof(buf), &size);
1645 if(FAILED(hres) || !size)
1646 break;
1647
1648 ptr = ret = buf;
1649 end = buf + size;
1650
1651 while(ptr < end) {
1652 unsigned char byte = *ptr++;
1653
1654 switch(n) {
1655 case -1:
1656 if(byte == '=')
1657 n = 0;
1658 else
1659 *ret++ = byte;
1660 continue;
1661 case 0:
1662 prev = byte;
1663 n = 1;
1664 continue;
1665 case 1:
1666 if(prev != '\r' || byte != '\n') {
1667 int h1 = hex_digit(prev), h2 = hex_digit(byte);
1668 if(h1 != -1 && h2 != -1)
1669 *ret++ = (h1 << 4) | h2;
1670 else
1671 *ret++ = '=';
1672 }
1673 n = -1;
1674 continue;
1675 }
1676 }
1677
1678 if(ret > buf) {
1679 hres = IStream_Write(output, buf, ret - buf, NULL);
1680 if(FAILED(hres))
1681 break;
1682 }
1683 }
1684
1685 if(SUCCEEDED(hres))
1686 hres = IStream_Seek(output, pos, STREAM_SEEK_SET, NULL);
1687 if(FAILED(hres)) {
1688 IStream_Release(output);
1689 return hres;
1690 }
1691
1692 *ret_stream = output;
1693 return S_OK;
1694}
1695
1697 IMimeBody* iface,
1698 ENCODINGTYPE ietEncoding,
1699 IStream** ppStream)
1700{
1703 HRESULT hres;
1704
1705 TRACE("(%p)->(%d %p)\n", This, ietEncoding, ppStream);
1706
1707 if(This->encoding != ietEncoding) {
1708 switch(This->encoding) {
1709 case IET_BASE64:
1710 hres = decode_base64(This->data, ppStream);
1711 break;
1712 case IET_QP:
1713 hres = decode_qp(This->data, ppStream);
1714 break;
1715 default:
1716 FIXME("Decoding %d is not supported.\n", This->encoding);
1717 hres = S_FALSE;
1718 }
1719 if(ietEncoding != IET_BINARY)
1720 FIXME("Encoding %d is not supported.\n", ietEncoding);
1721 if(hres != S_FALSE)
1722 return hres;
1723 }
1724
1725 start.QuadPart = 0;
1726 hres = get_stream_size(This->data, &size);
1727 if(SUCCEEDED(hres))
1728 hres = create_sub_stream(This->data, start, size, ppStream);
1729 return hres;
1730}
1731
1733 IMimeBody* iface,
1734 ENCODINGTYPE ietEncoding,
1735 LPCSTR pszPriType,
1736 LPCSTR pszSubType,
1737 REFIID riid,
1738 LPVOID pvObject)
1739{
1741 TRACE("(%p)->(%d, %s, %s, %s %p)\n", This, ietEncoding, debugstr_a(pszPriType), debugstr_a(pszSubType),
1742 debugstr_guid(riid), pvObject);
1743
1744 if(IsEqualIID(riid, &IID_IStream))
1745 IStream_AddRef((IStream *)pvObject);
1746 else
1747 {
1748 FIXME("Unhandled object type %s\n", debugstr_guid(riid));
1749 return E_INVALIDARG;
1750 }
1751
1752 if(This->data)
1753 release_data(&This->data_iid, This->data);
1754
1755 This->data_iid = *riid;
1756 This->data = pvObject;
1757
1758 IMimeBody_SetCurrentEncoding(iface, ietEncoding);
1759
1760 /* FIXME: Update the content type.
1761 If pszPriType == NULL use 'application'
1762 If pszSubType == NULL use 'octet-stream' */
1763
1764 return S_OK;
1765}
1766
1768 IMimeBody* iface)
1769{
1771 FIXME("(%p)->() stub\n", This);
1772 return E_NOTIMPL;
1773}
1774
1776 IMimeBody* iface,
1777 IMimeBody* pBody)
1778{
1780 FIXME("(%p)->(%p) stub\n", This, pBody);
1781 return E_NOTIMPL;
1782}
1783
1785 IMimeBody* iface,
1786 LPTRANSMITINFO pTransmitInfo)
1787{
1789 FIXME("(%p)->(%p) stub\n", This, pTransmitInfo);
1790 return E_NOTIMPL;
1791}
1792
1794 IMimeBody* iface,
1795 ENCODINGTYPE ietEncoding,
1796 LPCSTR pszFilePath)
1797{
1799 FIXME("(%p)->(%d, %s) stub\n", This, ietEncoding, debugstr_a(pszFilePath));
1800 return E_NOTIMPL;
1801}
1802
1804 IMimeBody* iface,
1805 LPHBODY phBody)
1806{
1808 TRACE("(%p)->(%p)\n", iface, phBody);
1809
1810 if(!phBody)
1811 return E_INVALIDARG;
1812
1813 *phBody = This->handle;
1814 return This->handle ? S_OK : MIME_E_NO_DATA;
1815}
1816
1817static IMimeBodyVtbl body_vtbl =
1818{
1862};
1863
1865{
1866 TRACE("setting offsets to %ld, %ld, %ld, %ld\n", offsets->cbBoundaryStart,
1867 offsets->cbHeaderStart, offsets->cbBodyStart, offsets->cbBodyEnd);
1868
1869 body->body_offsets = *offsets;
1870 return S_OK;
1871}
1872
1873#define FIRST_CUSTOM_PROP_ID 0x100
1874
1876{
1877 MimeBody *This;
1878 BODYOFFSETS body_offsets;
1879
1880 This = malloc(sizeof(*This));
1881 if (!This)
1882 return NULL;
1883
1884 This->IMimeBody_iface.lpVtbl = &body_vtbl;
1885 This->ref = 1;
1886 This->handle = NULL;
1887 list_init(&This->headers);
1888 list_init(&This->new_props);
1889 This->next_prop_id = FIRST_CUSTOM_PROP_ID;
1890 This->content_pri_type = NULL;
1891 This->content_sub_type = NULL;
1892 This->encoding = IET_7BIT;
1893 This->data = NULL;
1894 This->data_iid = IID_NULL;
1895
1896 body_offsets.cbBoundaryStart = body_offsets.cbHeaderStart = 0;
1897 body_offsets.cbBodyStart = body_offsets.cbBodyEnd = 0;
1898 MimeBody_set_offsets(This, &body_offsets);
1899
1900 return This;
1901}
1902
1904{
1905 MimeBody *mb;
1906
1907 if(outer)
1908 return CLASS_E_NOAGGREGATION;
1909
1910 if ((mb = mimebody_create()))
1911 {
1912 *ppv = &mb->IMimeBody_iface;
1913 return S_OK;
1914 }
1915 else
1916 {
1917 *ppv = NULL;
1918 return E_OUTOFMEMORY;
1919 }
1920}
1921
1922typedef struct body_t
1923{
1924 struct list entry;
1927
1931
1932typedef struct MimeMessage
1933{
1937
1941
1943{
1944 return CONTAINING_RECORD(iface, MimeMessage, IMimeMessage_iface);
1945}
1946
1948{
1949 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
1950
1951 if (IsEqualIID(riid, &IID_IUnknown) ||
1954 IsEqualIID(riid, &IID_IMimeMessageTree) ||
1955 IsEqualIID(riid, &IID_IMimeMessage))
1956 {
1957 *ppv = iface;
1958 IMimeMessage_AddRef(iface);
1959 return S_OK;
1960 }
1961
1962 FIXME("no interface for %s\n", debugstr_guid(riid));
1963 *ppv = NULL;
1964 return E_NOINTERFACE;
1965}
1966
1968{
1971
1972 TRACE("(%p) ref=%ld\n", This, ref);
1973
1974 return ref;
1975}
1976
1977static void empty_body_list(struct list *list)
1978{
1979 body_t *body, *cursor2;
1981 {
1982 empty_body_list(&body->children);
1983 list_remove(&body->entry);
1984 IMimeBody_Release(&body->mime_body->IMimeBody_iface);
1985 free(body);
1986 }
1987}
1988
1990{
1993
1994 TRACE("(%p) ref=%ld\n", This, ref);
1995
1996 if (!ref)
1997 {
1998 empty_body_list(&This->body_tree);
1999
2000 if(This->stream) IStream_Release(This->stream);
2001 free(This);
2002 }
2003
2004 return ref;
2005}
2006
2007/*** IPersist methods ***/
2009 IMimeMessage *iface,
2010 CLSID *pClassID)
2011{
2012 FIXME("(%p)->(%p)\n", iface, pClassID);
2013 return E_NOTIMPL;
2014}
2015
2016/*** IPersistStreamInit methods ***/
2018 IMimeMessage *iface)
2019{
2020 FIXME("(%p)->()\n", iface);
2021 return E_NOTIMPL;
2022}
2023
2025{
2026 body_t *body = malloc(sizeof(*body));
2027 if(body)
2028 {
2029 body->mime_body = mime_body;
2030 body->index = index;
2031 list_init(&body->children);
2032 body->parent = parent;
2033
2034 mime_body->handle = UlongToHandle(body->index);
2035 }
2036 return body;
2037}
2038
2039typedef struct
2040{
2041 struct list entry;
2042 BODYOFFSETS offsets;
2044
2045static HRESULT create_body_offset_list(IStream *stm, const char *boundary, struct list *body_offsets)
2046{
2047 HRESULT hr;
2048 DWORD read, boundary_start;
2049 int boundary_len = strlen(boundary);
2050 char *buf, *ptr, *overlap;
2051 DWORD start = 0, overlap_no;
2052 offset_entry_t *cur_body = NULL;
2053 BOOL is_first_line = TRUE;
2056
2057 list_init(body_offsets);
2058
2059 overlap_no = boundary_len + 5;
2060
2061 overlap = buf = malloc(overlap_no + PARSER_BUF_SIZE + 1);
2062
2063 zero.QuadPart = 0;
2064 hr = IStream_Seek(stm, zero, STREAM_SEEK_CUR, &cur);
2065 start = cur.LowPart;
2066
2067 do {
2068 hr = IStream_Read(stm, overlap, PARSER_BUF_SIZE, &read);
2069 if(FAILED(hr)) goto end;
2070 if(read == 0) break;
2071 overlap[read] = '\0';
2072
2073 ptr = buf;
2074 while(1) {
2075 if(is_first_line) {
2076 is_first_line = FALSE;
2077 }else {
2078 ptr = strstr(ptr, "\r\n");
2079 if(!ptr)
2080 break;
2081 ptr += 2;
2082 }
2083
2084 boundary_start = start + ptr - buf;
2085
2086 if(*ptr == '-' && *(ptr + 1) == '-' && !memcmp(ptr + 2, boundary, boundary_len)) {
2087 ptr += boundary_len + 2;
2088
2089 if(*ptr == '\r' && *(ptr + 1) == '\n')
2090 {
2091 ptr += 2;
2092 if(cur_body)
2093 {
2094 cur_body->offsets.cbBodyEnd = boundary_start - 2;
2095 list_add_tail(body_offsets, &cur_body->entry);
2096 }
2097 cur_body = malloc(sizeof(*cur_body));
2098 cur_body->offsets.cbBoundaryStart = boundary_start;
2099 cur_body->offsets.cbHeaderStart = start + ptr - buf;
2100 }
2101 else if(*ptr == '-' && *(ptr + 1) == '-')
2102 {
2103 if(cur_body)
2104 {
2105 cur_body->offsets.cbBodyEnd = boundary_start - 2;
2106 list_add_tail(body_offsets, &cur_body->entry);
2107 goto end;
2108 }
2109 }
2110 }
2111 }
2112
2113 if(overlap == buf) /* 1st iteration */
2114 {
2115 memmove(buf, buf + PARSER_BUF_SIZE - overlap_no, overlap_no);
2116 overlap = buf + overlap_no;
2117 start += read - overlap_no;
2118 }
2119 else
2120 {
2121 memmove(buf, buf + PARSER_BUF_SIZE, overlap_no);
2122 start += read;
2123 }
2124 } while(1);
2125
2126end:
2127 free(buf);
2128 return hr;
2129}
2130
2132{
2134 MimeBody *mime_body;
2135 HRESULT hr;
2136 body_t *body;
2138
2139 pos.QuadPart = offset->cbHeaderStart;
2140 IStream_Seek(pStm, pos, STREAM_SEEK_SET, NULL);
2141
2142 mime_body = mimebody_create();
2143 IMimeBody_Load(&mime_body->IMimeBody_iface, pStm);
2144
2145 pos.QuadPart = 0;
2146 hr = IStream_Seek(pStm, pos, STREAM_SEEK_CUR, &start);
2147 offset->cbBodyStart = start.QuadPart;
2148 if (parent) MimeBody_set_offsets(mime_body, offset);
2149
2150 length.QuadPart = offset->cbBodyEnd - offset->cbBodyStart;
2151 create_sub_stream(pStm, start, length, (IStream**)&mime_body->data);
2152 mime_body->data_iid = IID_IStream;
2153
2154 body = new_body_entry(mime_body, msg->next_index++, parent);
2155
2156 if(IMimeBody_IsContentType(&mime_body->IMimeBody_iface, "multipart", NULL) == S_OK)
2157 {
2158 MIMEPARAMINFO *param_info;
2159 ULONG count, i;
2160 IMimeAllocator *alloc;
2161
2162 hr = IMimeBody_GetParameters(&mime_body->IMimeBody_iface, "Content-Type", &count,
2163 &param_info);
2164 if(hr != S_OK || count == 0) return body;
2165
2167
2168 for(i = 0; i < count; i++)
2169 {
2170 if(!lstrcmpiA(param_info[i].pszName, "boundary"))
2171 {
2172 struct list offset_list;
2173 offset_entry_t *cur, *cursor2;
2174 hr = create_body_offset_list(pStm, param_info[i].pszData, &offset_list);
2175 LIST_FOR_EACH_ENTRY_SAFE(cur, cursor2, &offset_list, offset_entry_t, entry)
2176 {
2177 body_t *sub_body;
2178
2179 sub_body = create_sub_body(msg, pStm, &cur->offsets, body);
2180 list_add_tail(&body->children, &sub_body->entry);
2181 list_remove(&cur->entry);
2182 free(cur);
2183 }
2184 break;
2185 }
2186 }
2187 IMimeAllocator_FreeParamInfoArray(alloc, count, param_info, TRUE);
2188 IMimeAllocator_Release(alloc);
2189 }
2190 return body;
2191}
2192
2194{
2196 body_t *root_body;
2197 BODYOFFSETS offsets;
2200
2201 TRACE("(%p)->(%p)\n", iface, pStm);
2202
2203 if(This->stream)
2204 {
2205 FIXME("already loaded a message\n");
2206 return E_FAIL;
2207 }
2208
2209 empty_body_list(&This->body_tree);
2210
2211 IStream_AddRef(pStm);
2212 This->stream = pStm;
2213 offsets.cbBoundaryStart = offsets.cbHeaderStart = 0;
2214 offsets.cbBodyStart = offsets.cbBodyEnd = 0;
2215
2216 root_body = create_sub_body(This, pStm, &offsets, NULL);
2217
2218 zero.QuadPart = 0;
2219 IStream_Seek(pStm, zero, STREAM_SEEK_END, &cur);
2220 offsets.cbBodyEnd = cur.LowPart;
2222
2223 list_add_head(&This->body_tree, &root_body->entry);
2224
2225 return S_OK;
2226}
2227
2228static HRESULT WINAPI MimeMessage_Save(IMimeMessage *iface, IStream *pStm, BOOL fClearDirty)
2229{
2230 FIXME("(%p)->(%p, %s)\n", iface, pStm, fClearDirty ? "TRUE" : "FALSE");
2231 return E_NOTIMPL;
2232}
2233
2235 IMimeMessage *iface,
2236 ULARGE_INTEGER *pcbSize)
2237{
2238 FIXME("(%p)->(%p)\n", iface, pcbSize);
2239 return E_NOTIMPL;
2240}
2241
2243 IMimeMessage *iface)
2244{
2245 FIXME("(%p)->()\n", iface);
2246 return E_NOTIMPL;
2247}
2248
2249/*** IMimeMessageTree methods ***/
2251 DWORD dwFlags)
2252{
2254
2255 FIXME("(%p)->(%p, 0x%lx)\n", iface, ppStream, dwFlags);
2256
2257 IStream_AddRef(This->stream);
2258 *ppStream = This->stream;
2259 return S_OK;
2260}
2261
2263 IMimeMessage *iface,
2264 ULONG *pcbSize,
2265 DWORD dwFlags)
2266{
2267 FIXME("(%p)->(%p, 0x%lx)\n", iface, pcbSize, dwFlags);
2268 return E_NOTIMPL;
2269}
2270
2272 IMimeMessage *iface,
2273 IStream *pStream)
2274{
2275 FIXME("(%p)->(%p)\n", iface, pStream);
2276 return E_NOTIMPL;
2277}
2278
2280 IMimeMessage *iface,
2281 IStream *pStream,
2282 DWORD dwFlags)
2283{
2284 FIXME("(%p)->(%p, 0x%lx)\n", iface, pStream, dwFlags);
2285 return E_NOTIMPL;
2286}
2287
2288
2290 IMimeMessage *iface,
2291 DWORD *pdwFlags)
2292{
2293 FIXME("(%p)->(%p)\n", iface, pdwFlags);
2294 return E_NOTIMPL;
2295}
2296
2298 IMimeMessage *iface,
2299 DWORD dwFlags)
2300{
2301 FIXME("(%p)->(0x%lx)\n", iface, dwFlags);
2302 return S_OK;
2303}
2304
2305
2307 IMimeMessage *iface)
2308{
2309 FIXME("(%p)->()\n", iface);
2310 return E_NOTIMPL;
2311}
2312
2313static HRESULT find_body(struct list *list, HBODY hbody, body_t **body)
2314{
2315 body_t *cur;
2316 HRESULT hr;
2317
2318 if(hbody == HBODY_ROOT)
2319 {
2321 return S_OK;
2322 }
2323
2325 {
2326 if(cur->index == HandleToUlong(hbody))
2327 {
2328 *body = cur;
2329 return S_OK;
2330 }
2331 hr = find_body(&cur->children, hbody, body);
2332 if(hr == S_OK) return S_OK;
2333 }
2334 return S_FALSE;
2335}
2336
2338 void **ppvObject)
2339{
2341 HRESULT hr;
2342 body_t *body;
2343
2344 TRACE("(%p)->(%p, %s, %p)\n", iface, hBody, debugstr_guid(riid), ppvObject);
2345
2346 hr = find_body(&This->body_tree, hBody, &body);
2347
2348 if(hr != S_OK) return hr;
2349
2350 if(IsEqualIID(riid, &IID_IMimeBody))
2351 {
2352 IMimeBody_AddRef(&body->mime_body->IMimeBody_iface);
2353 *ppvObject = &body->mime_body->IMimeBody_iface;
2354 return S_OK;
2355 }
2356
2357 return E_NOINTERFACE;
2358}
2359
2361 IMimeMessage *iface,
2362 HBODY hBody,
2363 DWORD dwFlags,
2364 IStream *pStream)
2365{
2366 FIXME("(%p)->(%p, 0x%lx, %p)\n", iface, hBody, dwFlags, pStream);
2367 return E_NOTIMPL;
2368}
2369
2370static HRESULT get_body(MimeMessage *msg, BODYLOCATION location, HBODY pivot, body_t **out)
2371{
2372 body_t *root = LIST_ENTRY(list_head(&msg->body_tree), body_t, entry);
2373 body_t *body;
2374 HRESULT hr;
2375 struct list *list;
2376
2377 if(location == IBL_ROOT)
2378 {
2379 *out = root;
2380 return S_OK;
2381 }
2382
2383 hr = find_body(&msg->body_tree, pivot, &body);
2384
2385 if(hr == S_OK)
2386 {
2387 switch(location)
2388 {
2389 case IBL_PARENT:
2390 if(body->parent)
2391 *out = body->parent;
2392 else
2393 hr = MIME_E_NOT_FOUND;
2394 break;
2395
2396 case IBL_FIRST:
2397 list = list_head(&body->children);
2398 if(list)
2400 else
2401 hr = MIME_E_NOT_FOUND;
2402 break;
2403
2404 case IBL_LAST:
2405 list = list_tail(&body->children);
2406 if(list)
2408 else
2409 hr = MIME_E_NOT_FOUND;
2410 break;
2411
2412 case IBL_NEXT:
2413 list = list_next(&body->parent->children, &body->entry);
2414 if(list)
2416 else
2417 hr = MIME_E_NOT_FOUND;
2418 break;
2419
2420 case IBL_PREVIOUS:
2421 list = list_prev(&body->parent->children, &body->entry);
2422 if(list)
2424 else
2425 hr = MIME_E_NOT_FOUND;
2426 break;
2427
2428 default:
2429 hr = E_FAIL;
2430 break;
2431 }
2432 }
2433
2434 return hr;
2435}
2436
2437
2439 IMimeMessage *iface,
2440 BODYLOCATION location,
2441 HBODY hPivot,
2442 LPHBODY phBody)
2443{
2444 FIXME("(%p)->(%d, %p, %p)\n", iface, location, hPivot, phBody);
2445 return E_NOTIMPL;
2446}
2447
2448static HRESULT WINAPI MimeMessage_GetBody(IMimeMessage *iface, BODYLOCATION location, HBODY hPivot,
2449 HBODY *phBody)
2450{
2452 body_t *body;
2453 HRESULT hr;
2454
2455 TRACE("(%p)->(%d, %p, %p)\n", iface, location, hPivot, phBody);
2456
2457 if(!phBody)
2458 return E_INVALIDARG;
2459
2460 *phBody = NULL;
2461
2462 hr = get_body(This, location, hPivot, &body);
2463
2464 if(hr == S_OK) *phBody = UlongToHandle(body->index);
2465
2466 return hr;
2467}
2468
2470 IMimeMessage *iface,
2471 HBODY hBody,
2472 DWORD dwFlags)
2473{
2474 FIXME("(%p)->(%p, %08lx)\n", iface, hBody, dwFlags);
2475 return E_NOTIMPL;
2476}
2477
2479 IMimeMessage *iface,
2480 HBODY hBody,
2481 BODYLOCATION location)
2482{
2483 FIXME("(%p)->(%d)\n", iface, location);
2484 return E_NOTIMPL;
2485}
2486
2487static void count_children(body_t *body, boolean recurse, ULONG *count)
2488{
2489 body_t *child;
2490
2492 {
2493 (*count)++;
2494 if(recurse) count_children(child, recurse, count);
2495 }
2496}
2497
2498static HRESULT WINAPI MimeMessage_CountBodies(IMimeMessage *iface, HBODY hParent, boolean fRecurse,
2499 ULONG *pcBodies)
2500{
2501 HRESULT hr;
2503 body_t *body;
2504
2505 TRACE("(%p)->(%p, %s, %p)\n", iface, hParent, fRecurse ? "TRUE" : "FALSE", pcBodies);
2506
2507 hr = find_body(&This->body_tree, hParent, &body);
2508 if(hr != S_OK) return hr;
2509
2510 *pcBodies = 1;
2511 count_children(body, fRecurse, pcBodies);
2512
2513 return S_OK;
2514}
2515
2516static HRESULT find_next(MimeMessage *This, body_t *body, FINDBODY *find, HBODY *out)
2517{
2518 struct list *ptr;
2519 HBODY next;
2520
2521 for (;;)
2522 {
2523 if (!body) ptr = list_head( &This->body_tree );
2524 else
2525 {
2526 ptr = list_head( &body->children );
2527 while (!ptr)
2528 {
2529 if (!body->parent) return MIME_E_NOT_FOUND;
2530 if (!(ptr = list_next( &body->parent->children, &body->entry ))) body = body->parent;
2531 }
2532 }
2533
2535 next = UlongToHandle( body->index );
2536 find->dwReserved = body->index;
2537 if (IMimeBody_IsContentType(&body->mime_body->IMimeBody_iface, find->pszPriType,
2538 find->pszSubType) == S_OK)
2539 {
2540 *out = next;
2541 return S_OK;
2542 }
2543 }
2544 return MIME_E_NOT_FOUND;
2545}
2546
2547static HRESULT WINAPI MimeMessage_FindFirst(IMimeMessage *iface, FINDBODY *pFindBody, HBODY *phBody)
2548{
2550
2551 TRACE("(%p)->(%p, %p)\n", iface, pFindBody, phBody);
2552
2553 pFindBody->dwReserved = 0;
2554 return find_next(This, NULL, pFindBody, phBody);
2555}
2556
2557static HRESULT WINAPI MimeMessage_FindNext(IMimeMessage *iface, FINDBODY *pFindBody, HBODY *phBody)
2558{
2560 body_t *body;
2561 HRESULT hr;
2562
2563 TRACE("(%p)->(%p, %p)\n", iface, pFindBody, phBody);
2564
2565 hr = find_body( &This->body_tree, UlongToHandle( pFindBody->dwReserved ), &body );
2566 if (hr != S_OK) return MIME_E_NOT_FOUND;
2567 return find_next(This, body, pFindBody, phBody);
2568}
2569
2571 IMimeMessage *iface,
2572 HBODY hRelated,
2573 LPCSTR pszBase,
2574 LPCSTR pszURL,
2575 DWORD dwFlags,
2576 LPHBODY phBody)
2577{
2578 FIXME("(%p)->(%p, %s, %s, 0x%lx, %p)\n", iface, hRelated, pszBase, pszURL, dwFlags, phBody);
2579 return E_NOTIMPL;
2580}
2581
2583 IMimeMessage *iface,
2584 HBODY hBody,
2585 LPCSTR pszSubType,
2586 LPHBODY phMultipart)
2587{
2588 FIXME("(%p)->(%p, %s, %p)\n", iface, hBody, pszSubType, phMultipart);
2589 return E_NOTIMPL;
2590}
2591
2593 IMimeMessage *iface,
2594 HBODY hBody,
2595 LPBODYOFFSETS pOffsets)
2596{
2597 FIXME("(%p)->(%p, %p)\n", iface, hBody, pOffsets);
2598 return E_NOTIMPL;
2599}
2600
2602 IMimeMessage *iface,
2603 LPHCHARSET phCharset)
2604{
2605 FIXME("(%p)->(%p)\n", iface, phCharset);
2606 *phCharset = NULL;
2607 return S_OK;
2608}
2609
2611 IMimeMessage *iface,
2612 HCHARSET hCharset,
2613 CSETAPPLYTYPE applytype)
2614{
2615 FIXME("(%p)->(%p, %d)\n", iface, hCharset, applytype);
2616 return E_NOTIMPL;
2617}
2618
2620 IMimeMessage *iface,
2621 HBODY hBody,
2622 IMSGBODYTYPE bodytype)
2623{
2624 HRESULT hr;
2625 IMimeBody *mime_body;
2626 TRACE("(%p)->(%p, %d)\n", iface, hBody, bodytype);
2627
2628 hr = IMimeMessage_BindToObject(iface, hBody, &IID_IMimeBody, (void**)&mime_body);
2629 if(hr != S_OK) return hr;
2630
2631 hr = IMimeBody_IsType(mime_body, bodytype);
2632 MimeBody_Release(mime_body);
2633 return hr;
2634}
2635
2637 IMimeMessage *iface,
2638 HBODY hBody,
2639 LPCSTR pszPriType,
2640 LPCSTR pszSubType)
2641{
2642 HRESULT hr;
2643 IMimeBody *mime_body;
2644 TRACE("(%p)->(%p, %s, %s)\n", iface, hBody, debugstr_a(pszPriType),
2645 debugstr_a(pszSubType));
2646
2647 hr = IMimeMessage_BindToObject(iface, hBody, &IID_IMimeBody, (void**)&mime_body);
2648 if(FAILED(hr)) return hr;
2649
2650 hr = IMimeBody_IsContentType(mime_body, pszPriType, pszSubType);
2651 IMimeBody_Release(mime_body);
2652 return hr;
2653}
2654
2656 IMimeMessage *iface,
2657 HBODY hBody,
2658 LPCSTR pszName,
2659 LPCSTR pszCriteria,
2660 boolean fSubString,
2661 boolean fCaseSensitive)
2662{
2663 FIXME("(%p)->(%p, %s, %s, %s, %s)\n", iface, hBody, pszName, pszCriteria, fSubString ? "TRUE" : "FALSE", fCaseSensitive ? "TRUE" : "FALSE");
2664 return E_NOTIMPL;
2665}
2666
2668 IMimeMessage *iface,
2669 HBODY hBody,
2670 LPCSTR pszName,
2671 DWORD dwFlags,
2672 LPPROPVARIANT pValue)
2673{
2674 HRESULT hr;
2675 IMimeBody *mime_body;
2676
2677 TRACE("(%p)->(%p, %s, 0x%lx, %p)\n", iface, hBody, pszName, dwFlags, pValue);
2678
2679 hr = IMimeMessage_BindToObject(iface, hBody, &IID_IMimeBody, (void**)&mime_body);
2680 if(hr != S_OK) return hr;
2681
2682 hr = IMimeBody_GetProp(mime_body, pszName, dwFlags, pValue);
2683 IMimeBody_Release(mime_body);
2684
2685 return hr;
2686}
2687
2689 IMimeMessage *iface,
2690 HBODY hBody,
2691 LPCSTR pszName,
2692 DWORD dwFlags,
2693 LPCPROPVARIANT pValue)
2694{
2695 FIXME("(%p)->(%p, %s, 0x%lx, %p)\n", iface, hBody, pszName, dwFlags, pValue);
2696 return E_NOTIMPL;
2697}
2698
2700 IMimeMessage *iface,
2701 HBODY hBody,
2702 LPCSTR pszName)
2703{
2704 FIXME("(%p)->(%p, %s)\n", iface, hBody, pszName);
2705 return E_NOTIMPL;
2706}
2707
2709 IMimeMessage *iface,
2710 const TYPEDID oid,
2711 LPCPROPVARIANT pValue)
2712{
2713 HRESULT hr = S_OK;
2714 TRACE("(%p)->(%08lx, %p)\n", iface, oid, pValue);
2715
2716 /* Message ID is checked before type.
2717 * OID 0x4D -> 0x56 and 0x58 aren't defined but will filtered out later.
2718 */
2719 if(TYPEDID_ID(oid) < TYPEDID_ID(OID_ALLOW_8BIT_HEADER) || TYPEDID_ID(oid) > TYPEDID_ID(OID_SECURITY_2KEY_CERT_BAG_64))
2720 {
2721 WARN("oid (%08lx) out of range\n", oid);
2722 return MIME_E_INVALID_OPTION_ID;
2723 }
2724
2725 if(pValue->vt != TYPEDID_TYPE(oid))
2726 {
2727 WARN("Called with vartype %04x and oid %08lx\n", pValue->vt, oid);
2728 return S_OK;
2729 }
2730
2731 switch(oid)
2732 {
2733 case OID_HIDE_TNEF_ATTACHMENTS:
2734 FIXME("OID_HIDE_TNEF_ATTACHMENTS (value %d): ignoring\n", pValue->boolVal);
2735 break;
2736 case OID_SHOW_MACBINARY:
2737 FIXME("OID_SHOW_MACBINARY (value %d): ignoring\n", pValue->boolVal);
2738 break;
2739 case OID_SAVEBODY_KEEPBOUNDARY:
2740 FIXME("OID_SAVEBODY_KEEPBOUNDARY (value %d): ignoring\n", pValue->boolVal);
2741 break;
2742 case OID_CLEANUP_TREE_ON_SAVE:
2743 FIXME("OID_CLEANUP_TREE_ON_SAVE (value %d): ignoring\n", pValue->boolVal);
2744 break;
2745 default:
2746 FIXME("Unhandled oid %08lx\n", oid);
2747 hr = MIME_E_INVALID_OPTION_ID;
2748 }
2749
2750 return hr;
2751}
2752
2754 IMimeMessage *iface,
2755 const TYPEDID oid,
2756 LPPROPVARIANT pValue)
2757{
2758 FIXME("(%p)->(%08lx, %p)\n", iface, oid, pValue);
2759 return E_NOTIMPL;
2760}
2761
2762/*** IMimeMessage methods ***/
2764 IMimeMessage *iface,
2765 IStream *pRootStm,
2766 LPWEBPAGEOPTIONS pOptions,
2767 IMimeMessageCallback *pCallback,
2768 IMoniker **ppMoniker)
2769{
2770 FIXME("(%p)->(%p, %p, %p, %p)\n", iface, pRootStm, pOptions, pCallback, ppMoniker);
2771 *ppMoniker = NULL;
2772 return E_NOTIMPL;
2773}
2774
2776 IMimeMessage *iface,
2777 LPCSTR pszName,
2778 DWORD dwFlags,
2779 LPPROPVARIANT pValue)
2780{
2781 FIXME("(%p)->(%s, 0x%lx, %p)\n", iface, pszName, dwFlags, pValue);
2782 return E_NOTIMPL;
2783}
2784
2786 IMimeMessage *iface,
2787 LPCSTR pszName,
2788 DWORD dwFlags,
2789 LPCPROPVARIANT pValue)
2790{
2791 FIXME("(%p)->(%s, 0x%lx, %p)\n", iface, pszName, dwFlags, pValue);
2792 return E_NOTIMPL;
2793}
2794
2796 IMimeMessage *iface,
2797 LPCSTR pszName)
2798{
2799 FIXME("(%p)->(%s)\n", iface, pszName);
2800 return E_NOTIMPL;
2801}
2802
2804 IMimeMessage *iface,
2805 LPCSTR pszName,
2806 LPCSTR pszCriteria,
2807 boolean fSubString,
2808 boolean fCaseSensitive)
2809{
2810 FIXME("(%p)->(%s, %s, %s, %s)\n", iface, pszName, pszCriteria, fSubString ? "TRUE" : "FALSE", fCaseSensitive ? "TRUE" : "FALSE");
2811 return E_NOTIMPL;
2812}
2813
2815 IMimeMessage *iface,
2816 DWORD dwTxtType,
2817 ENCODINGTYPE ietEncoding,
2818 IStream **pStream,
2819 LPHBODY phBody)
2820{
2821 HRESULT hr;
2822 HBODY hbody;
2823 FINDBODY find_struct;
2824 IMimeBody *mime_body;
2825 static char text[] = "text";
2826 static char plain[] = "plain";
2827 static char html[] = "html";
2828
2829 TRACE("(%p)->(%ld, %d, %p, %p)\n", iface, dwTxtType, ietEncoding, pStream, phBody);
2830
2831 find_struct.pszPriType = text;
2832
2833 switch(dwTxtType)
2834 {
2835 case TXT_PLAIN:
2836 find_struct.pszSubType = plain;
2837 break;
2838 case TXT_HTML:
2839 find_struct.pszSubType = html;
2840 break;
2841 default:
2842 return MIME_E_INVALID_TEXT_TYPE;
2843 }
2844
2845 hr = IMimeMessage_FindFirst(iface, &find_struct, &hbody);
2846 if(hr != S_OK)
2847 {
2848 TRACE("not found hr %08lx\n", hr);
2849 *phBody = NULL;
2850 return hr;
2851 }
2852
2853 IMimeMessage_BindToObject(iface, hbody, &IID_IMimeBody, (void**)&mime_body);
2854
2855 IMimeBody_GetData(mime_body, ietEncoding, pStream);
2856 *phBody = hbody;
2857 IMimeBody_Release(mime_body);
2858 return hr;
2859}
2860
2862 IMimeMessage *iface,
2863 DWORD dwTxtType,
2864 ENCODINGTYPE ietEncoding,
2865 HBODY hAlternative,
2866 IStream *pStream,
2867 LPHBODY phBody)
2868{
2869 FIXME("(%p)->(%ld, %d, %p, %p, %p)\n", iface, dwTxtType, ietEncoding, hAlternative, pStream, phBody);
2870 return E_NOTIMPL;
2871}
2872
2874 IMimeMessage *iface,
2875 REFIID riid,
2876 void *pvObject,
2877 LPHBODY phBody)
2878{
2879 FIXME("(%p)->(%s, %p, %p)\n", iface, debugstr_guid(riid), pvObject, phBody);
2880 return E_NOTIMPL;
2881}
2882
2884 IMimeMessage *iface,
2885 LPCSTR pszFilePath,
2886 IStream *pstmFile,
2887 LPHBODY phBody)
2888{
2889 FIXME("(%p)->(%s, %p, %p)\n", iface, pszFilePath, pstmFile, phBody);
2890 return E_NOTIMPL;
2891}
2892
2894 IMimeMessage *iface,
2895 LPCSTR pszBase,
2896 LPCSTR pszURL,
2897 DWORD dwFlags,
2898 IStream *pstmURL,
2899 LPSTR *ppszCIDURL,
2900 LPHBODY phBody)
2901{
2902 FIXME("(%p)->(%s, %s, 0x%lx, %p, %p, %p)\n", iface, pszBase, pszURL, dwFlags, pstmURL, ppszCIDURL, phBody);
2903 return E_NOTIMPL;
2904}
2905
2907 IMimeMessage *iface,
2908 ULONG *pcAttach,
2909 LPHBODY *pprghAttach)
2910{
2911 HRESULT hr;
2912 FINDBODY find_struct;
2913 HBODY hbody;
2914 LPHBODY array;
2915 ULONG size = 10;
2916
2917 TRACE("(%p)->(%p, %p)\n", iface, pcAttach, pprghAttach);
2918
2919 *pcAttach = 0;
2920 array = CoTaskMemAlloc(size * sizeof(HBODY));
2921
2922 find_struct.pszPriType = find_struct.pszSubType = NULL;
2923 hr = IMimeMessage_FindFirst(iface, &find_struct, &hbody);
2924 while(hr == S_OK)
2925 {
2926 hr = IMimeMessage_IsContentType(iface, hbody, "multipart", NULL);
2927 TRACE("IsCT rets %08lx %ld\n", hr, *pcAttach);
2928 if(hr != S_OK)
2929 {
2930 if(*pcAttach + 1 > size)
2931 {
2932 size *= 2;
2933 array = CoTaskMemRealloc(array, size * sizeof(HBODY));
2934 }
2935 array[*pcAttach] = hbody;
2936 (*pcAttach)++;
2937 }
2938 hr = IMimeMessage_FindNext(iface, &find_struct, &hbody);
2939 }
2940
2941 *pprghAttach = array;
2942 return S_OK;
2943}
2944
2946 IMimeMessage *iface,
2947 IMimeAddressTable **ppTable)
2948{
2949 FIXME("(%p)->(%p)\n", iface, ppTable);
2950 return E_NOTIMPL;
2951}
2952
2954 IMimeMessage *iface,
2955 LPADDRESSPROPS pAddress)
2956{
2957 FIXME("(%p)->(%p)\n", iface, pAddress);
2958 return E_NOTIMPL;
2959}
2960
2962 IMimeMessage *iface,
2963 DWORD dwAdrTypes,
2964 DWORD dwProps,
2965 LPADDRESSLIST pList)
2966{
2967 FIXME("(%p)->(%ld, %ld, %p)\n", iface, dwAdrTypes, dwProps, pList);
2968 return E_NOTIMPL;
2969}
2970
2972 IMimeMessage *iface,
2973 DWORD dwAdrTypes,
2974 ADDRESSFORMAT format,
2975 LPSTR *ppszFormat)
2976{
2977 FIXME("(%p)->(%ld, %d, %p)\n", iface, dwAdrTypes, format, ppszFormat);
2978 return E_NOTIMPL;
2979}
2980
2982 IMimeMessage *iface,
2983 DWORD dwAdrTypes,
2984 DWORD dwProps,
2985 IMimeEnumAddressTypes **ppEnum)
2986{
2987 FIXME("(%p)->(%ld, %ld, %p)\n", iface, dwAdrTypes, dwProps, ppEnum);
2988 return E_NOTIMPL;
2989}
2990
2992 IMimeMessage *iface,
2993 ULONG cbMaxPart,
2994 IMimeMessageParts **ppParts)
2995{
2996 FIXME("(%p)->(%ld, %p)\n", iface, cbMaxPart, ppParts);
2997 return E_NOTIMPL;
2998}
2999
3001 IMimeMessage *iface,
3002 IMoniker **ppMoniker)
3003{
3004 FIXME("(%p)->(%p)\n", iface, ppMoniker);
3005 return E_NOTIMPL;
3006}
3007
3008static const IMimeMessageVtbl MimeMessageVtbl =
3009{
3066};
3067
3069{
3071 MimeBody *mime_body;
3072 body_t *root_body;
3073
3074 TRACE("(%p, %p)\n", outer, obj);
3075
3076 if (outer)
3077 {
3078 FIXME("outer unknown not supported yet\n");
3079 return E_NOTIMPL;
3080 }
3081
3082 *obj = NULL;
3083
3084 This = malloc(sizeof(*This));
3085 if (!This) return E_OUTOFMEMORY;
3086
3087 This->IMimeMessage_iface.lpVtbl = &MimeMessageVtbl;
3088 This->ref = 1;
3089 This->stream = NULL;
3090 list_init(&This->body_tree);
3091 This->next_index = 1;
3092
3093 mime_body = mimebody_create();
3094 root_body = new_body_entry(mime_body, This->next_index++, NULL);
3095 list_add_head(&This->body_tree, &root_body->entry);
3096
3097 *obj = &This->IMimeMessage_iface;
3098 return S_OK;
3099}
3100
3101/***********************************************************************
3102 * MimeOleCreateMessage (INETCOMM.@)
3103 */
3105{
3106 TRACE("(%p, %p)\n", pUnkOuter, ppMessage);
3107 return MimeMessage_create(NULL, (void **)ppMessage);
3108}
3109
3110/***********************************************************************
3111 * MimeOleSetCompatMode (INETCOMM.@)
3112 */
3114{
3115 FIXME("(0x%lx)\n", dwMode);
3116 return S_OK;
3117}
3118
3119/***********************************************************************
3120 * MimeOleCreateVirtualStream (INETCOMM.@)
3121 */
3123{
3124 HRESULT hr;
3125 FIXME("(%p)\n", ppStream);
3126
3127 hr = CreateStreamOnHGlobal(NULL, TRUE, ppStream);
3128 return hr;
3129}
3130
3131typedef struct MimeSecurity
3132{
3136
3138{
3139 return CONTAINING_RECORD(iface, MimeSecurity, IMimeSecurity_iface);
3140}
3141
3143{
3144 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
3145
3146 if (IsEqualIID(riid, &IID_IUnknown) ||
3147 IsEqualIID(riid, &IID_IMimeSecurity))
3148 {
3149 *ppv = iface;
3150 IMimeSecurity_AddRef(iface);
3151 return S_OK;
3152 }
3153
3154 FIXME("no interface for %s\n", debugstr_guid(riid));
3155 *ppv = NULL;
3156 return E_NOINTERFACE;
3157}
3158
3160{
3163
3164 TRACE("(%p) ref=%ld\n", This, ref);
3165
3166 return ref;
3167}
3168
3170{
3173
3174 TRACE("(%p) ref=%ld\n", This, ref);
3175
3176 if (!ref)
3177 free(This);
3178
3179 return ref;
3180}
3181
3183 IMimeSecurity* iface)
3184{
3185 FIXME("(%p)->(): stub\n", iface);
3186 return S_OK;
3187}
3188
3190 IMimeSecurity* iface)
3191{
3192 FIXME("(%p)->(): stub\n", iface);
3193 return E_NOTIMPL;
3194}
3195
3197 IMimeSecurity* iface,
3198 IMimeMessageTree* pTree,
3199 DWORD dwFlags)
3200{
3201 FIXME("(%p)->(%p, %08lx): stub\n", iface, pTree, dwFlags);
3202 return E_NOTIMPL;
3203}
3204
3206 IMimeSecurity* iface,
3207 IMimeMessageTree* pTree,
3208 HBODY hEncodeRoot,
3209 DWORD dwFlags)
3210{
3211 FIXME("(%p)->(%p, %p, %08lx): stub\n", iface, pTree, hEncodeRoot, dwFlags);
3212 return E_NOTIMPL;
3213}
3214
3216 IMimeSecurity* iface,
3217 IMimeMessageTree* pTree,
3218 DWORD dwFlags)
3219{
3220 FIXME("(%p)->(%p, %08lx): stub\n", iface, pTree, dwFlags);
3221 return E_NOTIMPL;
3222}
3223
3225 IMimeSecurity* iface,
3226 IMimeMessageTree* pTree,
3227 HBODY hDecodeRoot,
3228 DWORD dwFlags)
3229{
3230 FIXME("(%p)->(%p, %p, %08lx): stub\n", iface, pTree, hDecodeRoot, dwFlags);
3231 return E_NOTIMPL;
3232}
3233
3235 IMimeSecurity* iface,
3236 HCAPICERTSTORE hc,
3237 DWORD dwUsage,
3238 PCX509CERT pPrev,
3239 PCX509CERT* ppCert)
3240{
3241 FIXME("(%p)->(%p, %08lx, %p, %p): stub\n", iface, hc, dwUsage, pPrev, ppCert);
3242 return E_NOTIMPL;
3243}
3244
3246 IMimeSecurity* iface,
3247 const PCX509CERT pX509Cert,
3248 const CERTNAMETYPE cn,
3249 LPSTR* ppszName)
3250{
3251 FIXME("(%p)->(%p, %08x, %p): stub\n", iface, pX509Cert, cn, ppszName);
3252 return E_NOTIMPL;
3253}
3254
3256 IMimeSecurity* iface,
3257 const HWND hwndParent,
3258 IMimeBody* pBody,
3259 DWORD* pdwSecType)
3260{
3261 FIXME("(%p)->(%p, %p, %p): stub\n", iface, hwndParent, pBody, pdwSecType);
3262 return E_NOTIMPL;
3263}
3264
3266 IMimeSecurity* iface,
3267 const PCX509CERT pX509Cert,
3268 const CERTDATAID dataid,
3269 LPPROPVARIANT pValue)
3270{
3271 FIXME("(%p)->(%p, %x, %p): stub\n", iface, pX509Cert, dataid, pValue);
3272 return E_NOTIMPL;
3273}
3274
3275
3276static const IMimeSecurityVtbl MimeSecurityVtbl =
3277{
3291};
3292
3294{
3296
3297 *obj = NULL;
3298
3299 if (outer) return CLASS_E_NOAGGREGATION;
3300
3301 This = malloc(sizeof(*This));
3302 if (!This) return E_OUTOFMEMORY;
3303
3304 This->IMimeSecurity_iface.lpVtbl = &MimeSecurityVtbl;
3305 This->ref = 1;
3306
3307 *obj = &This->IMimeSecurity_iface;
3308 return S_OK;
3309}
3310
3311/***********************************************************************
3312 * MimeOleCreateSecurity (INETCOMM.@)
3313 */
3315{
3316 return MimeSecurity_create(NULL, (void **)ppSecurity);
3317}
3318
3320 IMimeAllocator* iface,
3321 REFIID riid,
3322 void **obj)
3323{
3324 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), obj);
3325
3326 if (IsEqualIID(riid, &IID_IUnknown) ||
3327 IsEqualIID(riid, &IID_IMalloc) ||
3328 IsEqualIID(riid, &IID_IMimeAllocator))
3329 {
3330 *obj = iface;
3331 IMimeAllocator_AddRef(iface);
3332 return S_OK;
3333 }
3334
3335 FIXME("no interface for %s\n", debugstr_guid(riid));
3336 *obj = NULL;
3337 return E_NOINTERFACE;
3338}
3339
3341 IMimeAllocator* iface)
3342{
3343 return 2;
3344}
3345
3347 IMimeAllocator* iface)
3348{
3349 return 1;
3350}
3351
3353 IMimeAllocator* iface,
3354 SIZE_T cb)
3355{
3356 return CoTaskMemAlloc(cb);
3357}
3358
3360 IMimeAllocator* iface,
3361 LPVOID pv,
3362 SIZE_T cb)
3363{
3364 return CoTaskMemRealloc(pv, cb);
3365}
3366
3368 IMimeAllocator* iface,
3369 LPVOID pv)
3370{
3371 CoTaskMemFree(pv);
3372}
3373
3375 IMimeAllocator* iface,
3376 LPVOID pv)
3377{
3378 FIXME("stub\n");
3379 return 0;
3380}
3381
3383 IMimeAllocator* iface,
3384 LPVOID pv)
3385{
3386 FIXME("stub\n");
3387 return 0;
3388}
3389
3391 IMimeAllocator* iface)
3392{
3393 FIXME("stub\n");
3394 return;
3395}
3396
3398 IMimeAllocator* iface,
3399 ULONG cParams,
3400 LPMIMEPARAMINFO prgParam,
3401 boolean fFreeArray)
3402{
3403 ULONG i;
3404 TRACE("(%p)->(%ld, %p, %d)\n", iface, cParams, prgParam, fFreeArray);
3405
3406 for(i = 0; i < cParams; i++)
3407 {
3408 IMimeAllocator_Free(iface, prgParam[i].pszName);
3409 IMimeAllocator_Free(iface, prgParam[i].pszData);
3410 }
3411 if(fFreeArray) IMimeAllocator_Free(iface, prgParam);
3412 return S_OK;
3413}
3414
3416 IMimeAllocator* iface,
3417 LPADDRESSLIST pList)
3418{
3419 FIXME("stub\n");
3420 return E_NOTIMPL;
3421}
3422
3424 IMimeAllocator* iface,
3425 LPADDRESSPROPS pAddress)
3426{
3427 FIXME("stub\n");
3428 return E_NOTIMPL;
3429}
3430
3432 IMimeAllocator* iface,
3433 ULONG cObjects,
3434 IUnknown **prgpUnknown,
3435 boolean fFreeArray)
3436{
3437 FIXME("stub\n");
3438 return E_NOTIMPL;
3439}
3440
3441
3443 IMimeAllocator* iface,
3444 ULONG cRows,
3445 LPENUMHEADERROW prgRow,
3446 boolean fFreeArray)
3447{
3448 FIXME("stub\n");
3449 return E_NOTIMPL;
3450}
3451
3453 IMimeAllocator* iface,
3454 ULONG cProps,
3455 LPENUMPROPERTY prgProp,
3456 boolean fFreeArray)
3457{
3458 FIXME("stub\n");
3459 return E_NOTIMPL;
3460}
3461
3463 IMimeAllocator* iface,
3464 THUMBBLOB *pthumbprint)
3465{
3466 FIXME("stub\n");
3467 return E_NOTIMPL;
3468}
3469
3470
3472 IMimeAllocator* iface,
3473 LPPROPVARIANT pProp)
3474{
3475 FIXME("stub\n");
3476 return E_NOTIMPL;
3477}
3478
3479static IMimeAllocatorVtbl mime_alloc_vtbl =
3480{
3498};
3499
3500static IMimeAllocator mime_allocator =
3501{
3503};
3504
3506{
3507 if(outer) return CLASS_E_NOAGGREGATION;
3508
3509 *obj = &mime_allocator;
3510 return S_OK;
3511}
3512
3514{
3515 return MimeAllocator_create(NULL, (void**)alloc);
3516}
3517
3519{
3520 FIXME("(%p, %p)\n", outer, obj);
3521
3522 *obj = NULL;
3523 if (outer) return CLASS_E_NOAGGREGATION;
3524
3526}
3527
3528/* IMimePropertySchema Interface */
3529static HRESULT WINAPI propschema_QueryInterface(IMimePropertySchema *iface, REFIID riid, void **out)
3530{
3532 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), out);
3533
3534 *out = NULL;
3535
3536 if (IsEqualIID(riid, &IID_IUnknown) ||
3537 IsEqualIID(riid, &IID_IMimePropertySchema))
3538 {
3539 *out = iface;
3540 }
3541 else
3542 {
3543 FIXME("no interface for %s\n", debugstr_guid(riid));
3544 return E_NOINTERFACE;
3545 }
3546
3547 IMimePropertySchema_AddRef(iface);
3548 return S_OK;
3549}
3550
3551static ULONG WINAPI propschema_AddRef(IMimePropertySchema *iface)
3552{
3555
3556 TRACE("(%p) ref=%ld\n", This, ref);
3557
3558 return ref;
3559}
3560
3561static ULONG WINAPI propschema_Release(IMimePropertySchema *iface)
3562{
3565
3566 TRACE("(%p) ref=%ld\n", This, ref);
3567
3568 if (!ref)
3569 {
3570 free(This);
3571 }
3572
3573 return ref;
3574}
3575
3576static HRESULT WINAPI propschema_RegisterProperty(IMimePropertySchema *iface, const char *name, DWORD flags,
3577 DWORD rownumber, VARTYPE vtdefault, DWORD *propid)
3578{
3580 FIXME("(%p)->(%s, %lx, %ld, %d, %p) stub\n", This, debugstr_a(name), flags, rownumber, vtdefault, propid);
3581 return E_NOTIMPL;
3582}
3583
3584static HRESULT WINAPI propschema_ModifyProperty(IMimePropertySchema *iface, const char *name, DWORD flags,
3585 DWORD rownumber, VARTYPE vtdefault)
3586{
3588 FIXME("(%p)->(%s, %lx, %ld, %d) stub\n", This, debugstr_a(name), flags, rownumber, vtdefault);
3589 return S_OK;
3590}
3591
3592static HRESULT WINAPI propschema_GetPropertyId(IMimePropertySchema *iface, const char *name, DWORD *propid)
3593{
3595 FIXME("(%p)->(%s, %p) stub\n", This, debugstr_a(name), propid);
3596 return E_NOTIMPL;
3597}
3598
3599static HRESULT WINAPI propschema_GetPropertyName(IMimePropertySchema *iface, DWORD propid, char **name)
3600{
3602 FIXME("(%p)->(%ld, %p) stub\n", This, propid, name);
3603 return E_NOTIMPL;
3604}
3605
3606static HRESULT WINAPI propschema_RegisterAddressType(IMimePropertySchema *iface, const char *name, DWORD *adrtype)
3607{
3609 FIXME("(%p)->(%s, %p) stub\n", This, debugstr_a(name), adrtype);
3610 return E_NOTIMPL;
3611}
3612
3613static IMimePropertySchemaVtbl prop_schema_vtbl =
3614{
3623};
3624
3625
3627{
3629
3630 TRACE("(%p) stub\n", schema);
3631
3632 This = malloc(sizeof(*This));
3633 if (!This)
3634 return E_OUTOFMEMORY;
3635
3636 This->IMimePropertySchema_iface.lpVtbl = &prop_schema_vtbl;
3637 This->ref = 1;
3638
3639 *schema = &This->IMimePropertySchema_iface;
3640
3641 return S_OK;
3642}
3643
3645 ADDRESSFORMAT addr_format, WCHAR **address)
3646{
3647 FIXME("(%s, %p, %ld, %d, %p) stub\n", debugstr_guid(riid), object, addr_type, addr_format, address);
3648
3649 return E_NOTIMPL;
3650}
3651
3653{
3654 FIXME("(%s %p)\n", debugstr_guid(riid), ppv);
3655 *ppv = NULL;
3656 return E_NOINTERFACE;
3657}
3658
3660{
3661 TRACE("\n");
3662 return 2;
3663}
3664
3666{
3667 TRACE("\n");
3668 return 1;
3669}
3670
3671static const IUnknownVtbl mime_obj_vtbl = {
3675};
3676
3678
3680 REFIID riid, void **out, IMoniker **moniker_new)
3681{
3682 WCHAR *display_name, *mhtml_url;
3683 size_t len;
3684 HRESULT hres;
3685
3686 WARN("(0x%08x, %p, %p, %s, %p, %p) semi-stub\n", bindf, moniker, binding, debugstr_guid(riid), out, moniker_new);
3687
3688 if(!IsEqualGUID(&IID_IUnknown, riid)) {
3689 FIXME("Unsupported riid %s\n", debugstr_guid(riid));
3690 return E_NOINTERFACE;
3691 }
3692
3693 hres = IMoniker_GetDisplayName(moniker, NULL, NULL, &display_name);
3694 if(FAILED(hres))
3695 return hres;
3696
3697 TRACE("display name %s\n", debugstr_w(display_name));
3698
3699 len = lstrlenW(display_name);
3700 mhtml_url = malloc(len * sizeof(WCHAR) + sizeof(L"mhtml:"));
3701 if(!mhtml_url)
3702 return E_OUTOFMEMORY;
3703
3704 lstrcpyW(mhtml_url, L"mhtml:");
3705 lstrcatW(mhtml_url, display_name);
3706 CoTaskMemFree(display_name);
3707
3708 hres = CreateURLMoniker(NULL, mhtml_url, moniker_new);
3709 free(mhtml_url);
3710 if(FAILED(hres))
3711 return hres;
3712
3713 /* FIXME: We most likely should start binding here and return something more meaningful as mime object. */
3714 *out = &mime_obj;
3715 return S_OK;
3716}
static INT pivot(list_t &list, INT i, INT j)
#define read
Definition: acwin.h:97
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define msg(x)
Definition: auth_time.c:54
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
#define ARRAY_SIZE(A)
Definition: main.h:20
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
static void list_init(struct list_entry *head)
Definition: list.h:51
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define UlongToHandle(ul)
Definition: basetsd.h:91
#define HandleToUlong(h)
Definition: basetsd.h:73
const GUID IID_IUnknown
struct _root root
#define hex_digit(c)
Definition: btrfs_drv.h:1748
Definition: list.h:37
static HWND hwndParent
Definition: cryptui.c:299
static TAGID TAGID find
Definition: db.cpp:156
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
Definition: combase.c:709
HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, const PROPVARIANT *pvarSrc)
Definition: combase.c:827
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL delete_on_release, IStream **stream)
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
void *WINAPI CoTaskMemRealloc(void *ptr, SIZE_T size)
Definition: malloc.c:397
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
#define stricmp(_String1, _String2)
Definition: compat.h:24
unsigned short VARTYPE
Definition: compat.h:2254
#define lstrcpyW
Definition: compat.h:749
@ VT_LPSTR
Definition: compat.h:2324
#define lstrlenW
Definition: compat.h:750
static HRESULT WINAPI propschema_GetPropertyName(IMimePropertySchema *iface, DWORD propid, char **name)
Definition: mimeole.c:3599
static HRESULT WINAPI MimeMessage_LoadOffsetTable(IMimeMessage *iface, IStream *pStream)
Definition: mimeole.c:2271
HRESULT VirtualStream_create(IUnknown *outer, void **obj)
Definition: mimeole.c:3518
HRESULT WINAPI MimeGetAddressFormatW(REFIID riid, void *object, DWORD addr_type, ADDRESSFORMAT addr_format, WCHAR **address)
Definition: mimeole.c:3644
static HRESULT create_body_offset_list(IStream *stm, const char *boundary, struct list *body_offsets)
Definition: mimeole.c:2045
static HRESULT WINAPI MimeMessage_EnumAddressTypes(IMimeMessage *iface, DWORD dwAdrTypes, DWORD dwProps, IMimeEnumAddressTypes **ppEnum)
Definition: mimeole.c:2981
static HRESULT WINAPI MimeBody_QueryProp(IMimeBody *iface, LPCSTR pszName, LPCSTR pszCriteria, boolean fSubString, boolean fCaseSensitive)
Definition: mimeole.c:1266
static HRESULT WINAPI MimeAlloc_FreeThumbprint(IMimeAllocator *iface, THUMBBLOB *pthumbprint)
Definition: mimeole.c:3462
static HRESULT WINAPI sub_stream_Seek(IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: mimeole.c:260
static HRESULT WINAPI MimeMessage_ResolveURL(IMimeMessage *iface, HBODY hRelated, LPCSTR pszBase, LPCSTR pszURL, DWORD dwFlags, LPHBODY phBody)
Definition: mimeole.c:2570
static void WINAPI MimeAlloc_Free(IMimeAllocator *iface, LPVOID pv)
Definition: mimeole.c:3367
static HRESULT WINAPI MimeMessage_GetMessageSize(IMimeMessage *iface, ULONG *pcbSize, DWORD dwFlags)
Definition: mimeole.c:2262
static HRESULT WINAPI MimeBody_CopyTo(IMimeBody *iface, IMimeBody *pBody)
Definition: mimeole.c:1775
static HRESULT WINAPI MimeBody_IsType(IMimeBody *iface, IMSGBODYTYPE bodytype)
Definition: mimeole.c:1439
static ULONG WINAPI MimeSecurity_Release(IMimeSecurity *iface)
Definition: mimeole.c:3169
HRESULT WINAPI MimeOleGetPropertySchema(IMimePropertySchema **schema)
Definition: mimeole.c:3626
static void init_content_encoding(MimeBody *body, header_t *header)
Definition: mimeole.c:749
static HRESULT WINAPI MimeBody_GetTransmitInfo(IMimeBody *iface, LPTRANSMITINFO pTransmitInfo)
Definition: mimeole.c:1784
static HRESULT MimeBody_set_offsets(MimeBody *body, const BODYOFFSETS *offsets)
Definition: mimeole.c:1864
static HRESULT WINAPI MimeMessage_GetRootMoniker(IMimeMessage *iface, IMoniker **ppMoniker)
Definition: mimeole.c:3000
static HRESULT WINAPI MimeMessage_GetMessageSource(IMimeMessage *iface, IStream **ppStream, DWORD dwFlags)
Definition: mimeole.c:2250
static HRESULT WINAPI MimeMessage_AttachObject(IMimeMessage *iface, REFIID riid, void *pvObject, LPHBODY phBody)
Definition: mimeole.c:2873
static void unfold_header(char *header, int len)
Definition: mimeole.c:593
static HRESULT WINAPI MimeBody_GetDisplayName(IMimeBody *iface, LPSTR *ppszDisplay)
Definition: mimeole.c:1465
static sub_stream_t * impl_from_IStream(IStream *iface)
Definition: mimeole.c:177
static HRESULT WINAPI MimeMessage_InitNew(IMimeMessage *iface)
Definition: mimeole.c:2242
static HRESULT get_body(MimeMessage *msg, BODYLOCATION location, HBODY pivot, body_t **out)
Definition: mimeole.c:2370
static HRESULT WINAPI MimeBody_GetData(IMimeBody *iface, ENCODINGTYPE ietEncoding, IStream **ppStream)
Definition: mimeole.c:1696
static const IUnknownVtbl mime_obj_vtbl
Definition: mimeole.c:3671
static HRESULT find_prop(MimeBody *body, const char *name, header_t **prop)
Definition: mimeole.c:847
static HRESULT WINAPI MimeBody_GetParameters(IMimeBody *iface, LPCSTR pszName, ULONG *pcParams, LPMIMEPARAMINFO *pprgParam)
Definition: mimeole.c:1298
static HRESULT WINAPI MimeMessage_GetTextBody(IMimeMessage *iface, DWORD dwTxtType, ENCODINGTYPE ietEncoding, IStream **pStream, LPHBODY phBody)
Definition: mimeole.c:2814
static HRESULT WINAPI propschema_ModifyProperty(IMimePropertySchema *iface, const char *name, DWORD flags, DWORD rownumber, VARTYPE vtdefault)
Definition: mimeole.c:3584
static const IMimeSecurityVtbl MimeSecurityVtbl
Definition: mimeole.c:3276
static HRESULT WINAPI MimeBody_GetClassID(IMimeBody *iface, CLSID *pClassID)
Definition: mimeole.c:960
static HRESULT WINAPI MimeSecurity_DecodeBody(IMimeSecurity *iface, IMimeMessageTree *pTree, HBODY hDecodeRoot, DWORD dwFlags)
Definition: mimeole.c:3224
static void free_header(header_t *header)
Definition: mimeole.c:807
static HRESULT WINAPI propschema_RegisterAddressType(IMimePropertySchema *iface, const char *name, DWORD *adrtype)
Definition: mimeole.c:3606
static HRESULT WINAPI MimeMessage_DeleteProp(IMimeMessage *iface, LPCSTR pszName)
Definition: mimeole.c:2795
static MimeMessage * impl_from_IMimeMessage(IMimeMessage *iface)
Definition: mimeole.c:1942
static char * unquote_string(const char *str)
Definition: mimeole.c:618
static HRESULT WINAPI MimeSecurity_DecodeMessage(IMimeSecurity *iface, IMimeMessageTree *pTree, DWORD dwFlags)
Definition: mimeole.c:3215
static HRESULT WINAPI MimeBody_GetHandle(IMimeBody *iface, LPHBODY phBody)
Definition: mimeole.c:1803
static HRESULT WINAPI MimeBody_IsDirty(IMimeBody *iface)
Definition: mimeole.c:975
static HRESULT WINAPI MimeBody_GetOption(IMimeBody *iface, const TYPEDID oid, LPPROPVARIANT pValue)
Definition: mimeole.c:1419
static void count_children(body_t *body, boolean recurse, ULONG *count)
Definition: mimeole.c:2487
static LPVOID WINAPI MimeAlloc_Alloc(IMimeAllocator *iface, SIZE_T cb)
Definition: mimeole.c:3352
static HRESULT WINAPI MimeMessage_SetCharset(IMimeMessage *iface, HCHARSET hCharset, CSETAPPLYTYPE applytype)
Definition: mimeole.c:2610
static HRESULT WINAPI MimeBody_SetDisplayName(IMimeBody *iface, LPCSTR pszDisplay)
Definition: mimeole.c:1456
static HRESULT WINAPI propschema_QueryInterface(IMimePropertySchema *iface, REFIID riid, void **out)
Definition: mimeole.c:3529
#define PARSER_BUF_SIZE
Definition: mimeole.c:477
static HRESULT WINAPI sub_stream_QueryInterface(IStream *iface, REFIID riid, void **ppv)
Definition: mimeole.c:182
static void init_content_type(MimeBody *body, header_t *header)
Definition: mimeole.c:731
static HRESULT WINAPI MimeSecurity_EncodeMessage(IMimeSecurity *iface, IMimeMessageTree *pTree, DWORD dwFlags)
Definition: mimeole.c:3196
static HRESULT WINAPI MimeAlloc_FreeEnumPropertyArray(IMimeAllocator *iface, ULONG cProps, LPENUMPROPERTY prgProp, boolean fFreeArray)
Definition: mimeole.c:3452
static LPVOID WINAPI MimeAlloc_Realloc(IMimeAllocator *iface, LPVOID pv, SIZE_T cb)
Definition: mimeole.c:3359
static ULONG WINAPI MimeMessage_AddRef(IMimeMessage *iface)
Definition: mimeole.c:1967
static HRESULT WINAPI mime_obj_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
Definition: mimeole.c:3652
static HRESULT decode_base64(IStream *input, IStream **ret_stream)
Definition: mimeole.c:1543
static void empty_body_list(struct list *list)
Definition: mimeole.c:1977
static HRESULT find_next(MimeMessage *This, body_t *body, FINDBODY *find, HBODY *out)
Definition: mimeole.c:2516
static HRESULT WINAPI MimeMessage_GetSender(IMimeMessage *iface, LPADDRESSPROPS pAddress)
Definition: mimeole.c:2953
static MimeBody * mimebody_create(void)
Definition: mimeole.c:1875
static void read_value(header_t *header, char **cur)
Definition: mimeole.c:701
static HRESULT WINAPI MimeSecurity_EncodeBody(IMimeSecurity *iface, IMimeMessageTree *pTree, HBODY hEncodeRoot, DWORD dwFlags)
Definition: mimeole.c:3205
static propschema * impl_from_IMimePropertySchema(IMimePropertySchema *iface)
Definition: mimeole.c:472
static HRESULT WINAPI MimeMessage_BindToObject(IMimeMessage *iface, const HBODY hBody, REFIID riid, void **ppvObject)
Definition: mimeole.c:2337
static HRESULT WINAPI MimeMessage_GetAttachments(IMimeMessage *iface, ULONG *pcAttach, LPHBODY *pprghAttach)
Definition: mimeole.c:2906
static HRESULT WINAPI MimeMessage_SaveOffsetTable(IMimeMessage *iface, IStream *pStream, DWORD dwFlags)
Definition: mimeole.c:2279
static HRESULT WINAPI MimeBody_SetCharset(IMimeBody *iface, HCHARSET hCharset, CSETAPPLYTYPE applytype)
Definition: mimeole.c:1288
static void empty_param_list(struct list *list)
Definition: mimeole.c:794
static HRESULT WINAPI MimeBody_DeleteProp(IMimeBody *iface, LPCSTR pszName)
Definition: mimeole.c:1207
static HRESULT WINAPI sub_stream_Revert(IStream *iface)
Definition: mimeole.c:360
static HRESULT WINAPI MimeMessage_GetCharset(IMimeMessage *iface, LPHCHARSET phCharset)
Definition: mimeole.c:2601
static HRESULT WINAPI MimeSecurity_QueryInterface(IMimeSecurity *iface, REFIID riid, void **ppv)
Definition: mimeole.c:3142
static HRESULT WINAPI MimeMessage_AttachFile(IMimeMessage *iface, LPCSTR pszFilePath, IStream *pstmFile, LPHBODY phBody)
Definition: mimeole.c:2883
static HRESULT WINAPI propschema_GetPropertyId(IMimePropertySchema *iface, const char *name, DWORD *propid)
Definition: mimeole.c:3592
static HRESULT parse_headers(MimeBody *body, IStream *stm)
Definition: mimeole.c:765
static HRESULT WINAPI MimeMessage_GetBodyProp(IMimeMessage *iface, HBODY hBody, LPCSTR pszName, DWORD dwFlags, LPPROPVARIANT pValue)
Definition: mimeole.c:2667
static void add_param(header_t *header, const char *p)
Definition: mimeole.c:651
static HRESULT WINAPI MimeBody_Save(IMimeBody *iface, IStream *pStm, BOOL fClearDirty)
Definition: mimeole.c:990
static void WINAPI MimeAlloc_HeapMinimize(IMimeAllocator *iface)
Definition: mimeole.c:3390
static HRESULT WINAPI sub_stream_SetSize(IStream *iface, ULARGE_INTEGER libNewSize)
Definition: mimeole.c:295
static HRESULT WINAPI MimeBody_GetCurrentEncoding(IMimeBody *iface, ENCODINGTYPE *pietEncoding)
Definition: mimeole.c:1487
static HRESULT WINAPI MimeBody_GetEstimatedSize(IMimeBody *iface, ENCODINGTYPE ietEncoding, ULONG *pcbSize)
Definition: mimeole.c:1511
static HRESULT decode_qp(IStream *input, IStream **ret_stream)
Definition: mimeole.c:1623
static HRESULT WINAPI MimeAlloc_FreeAddressProps(IMimeAllocator *iface, LPADDRESSPROPS pAddress)
Definition: mimeole.c:3423
static HRESULT WINAPI MimeMessage_GetAddressTable(IMimeMessage *iface, IMimeAddressTable **ppTable)
Definition: mimeole.c:2945
static HRESULT get_stream_size(IStream *stream, ULARGE_INTEGER *size)
Definition: mimeole.c:445
static HRESULT WINAPI MimeMessage_GetProp(IMimeMessage *iface, LPCSTR pszName, DWORD dwFlags, LPPROPVARIANT pValue)
Definition: mimeole.c:2775
static ULONG WINAPI sub_stream_AddRef(IStream *iface)
Definition: mimeole.c:200
HRESULT WINAPI MimeOleObjectFromMoniker(BINDF bindf, IMoniker *moniker, IBindCtx *binding, REFIID riid, void **out, IMoniker **moniker_new)
Definition: mimeole.c:3679
static HRESULT WINAPI MimeMessage_QueryBodyProp(IMimeMessage *iface, HBODY hBody, LPCSTR pszName, LPCSTR pszCriteria, boolean fSubString, boolean fCaseSensitive)
Definition: mimeole.c:2655
static const property_t * find_default_prop(const char *name)
Definition: mimeole.c:873
static HRESULT WINAPI MimeMessage_GetSizeMax(IMimeMessage *iface, ULARGE_INTEGER *pcbSize)
Definition: mimeole.c:2234
static void empty_new_prop_list(struct list *list)
Definition: mimeole.c:825
static ULONG WINAPI MimeSecurity_AddRef(IMimeSecurity *iface)
Definition: mimeole.c:3159
static HRESULT WINAPI MimeMessage_SetOption(IMimeMessage *iface, const TYPEDID oid, LPCPROPVARIANT pValue)
Definition: mimeole.c:2708
static HRESULT WINAPI MimeBody_GetPropInfo(IMimeBody *iface, LPCSTR pszName, LPMIMEPROPINFO pInfo)
Definition: mimeole.c:1014
static const signed char base64_decode_table[]
Definition: mimeole.c:1531
static HRESULT WINAPI MimeBody_IsContentType(IMimeBody *iface, LPCSTR pszPriType, LPCSTR pszSubType)
Definition: mimeole.c:1343
static HRESULT WINAPI MimeSecurity_GetCertData(IMimeSecurity *iface, const PCX509CERT pX509Cert, const CERTDATAID dataid, LPPROPVARIANT pValue)
Definition: mimeole.c:3265
HRESULT WINAPI MimeOleGetAllocator(IMimeAllocator **alloc)
Definition: mimeole.c:3513
static void release_data(REFIID riid, void *data)
Definition: mimeole.c:837
static HRESULT WINAPI sub_stream_LockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
Definition: mimeole.c:367
static HRESULT WINAPI MimeBody_EmptyData(IMimeBody *iface)
Definition: mimeole.c:1767
static HRESULT WINAPI MimeAlloc_FreeParamInfoArray(IMimeAllocator *iface, ULONG cParams, LPMIMEPARAMINFO prgParam, boolean fFreeArray)
Definition: mimeole.c:3397
static ULONG WINAPI MimeAlloc_Release(IMimeAllocator *iface)
Definition: mimeole.c:3346
static HRESULT WINAPI MimeMessage_QueryInterface(IMimeMessage *iface, REFIID riid, void **ppv)
Definition: mimeole.c:1947
static HRESULT WINAPI MimeMessage_IsContentType(IMimeMessage *iface, HBODY hBody, LPCSTR pszPriType, LPCSTR pszSubType)
Definition: mimeole.c:2636
static struct IStreamVtbl sub_stream_vtbl
Definition: mimeole.c:407
static HRESULT WINAPI MimeBody_CopyProps(IMimeBody *iface, ULONG cNames, LPCSTR *prgszName, IMimePropertySet *pPropertySet)
Definition: mimeole.c:1234
static HRESULT WINAPI MimeMessage_SetBodyProp(IMimeMessage *iface, HBODY hBody, LPCSTR pszName, DWORD dwFlags, LPCPROPVARIANT pValue)
Definition: mimeole.c:2688
static HRESULT WINAPI MimeMessage_GetBodyOffsets(IMimeMessage *iface, HBODY hBody, LPBODYOFFSETS pOffsets)
Definition: mimeole.c:2592
#define FIRST_CUSTOM_PROP_ID
Definition: mimeole.c:1873
static HRESULT WINAPI MimeMessage_DeleteBody(IMimeMessage *iface, HBODY hBody, DWORD dwFlags)
Definition: mimeole.c:2469
static HRESULT find_body(struct list *list, HBODY hbody, body_t **body)
Definition: mimeole.c:2313
static HRESULT WINAPI MimeMessage_GetAddressFormat(IMimeMessage *iface, DWORD dwAdrTypes, ADDRESSFORMAT format, LPSTR *ppszFormat)
Definition: mimeole.c:2971
static HRESULT WINAPI MimeBody_GetCharset(IMimeBody *iface, LPHCHARSET phCharset)
Definition: mimeole.c:1278
static HRESULT WINAPI MimeMessage_DeleteBodyProp(IMimeMessage *iface, HBODY hBody, LPCSTR pszName)
Definition: mimeole.c:2699
static HRESULT WINAPI MimeAlloc_PropVariantClear(IMimeAllocator *iface, LPPROPVARIANT pProp)
Definition: mimeole.c:3471
static HRESULT WINAPI MimeBody_AppendProp(IMimeBody *iface, LPCSTR pszName, DWORD dwFlags, LPPROPVARIANT pValue)
Definition: mimeole.c:1196
static IMimePropertySchemaVtbl prop_schema_vtbl
Definition: mimeole.c:3613
static HRESULT WINAPI MimeAlloc_ReleaseObjects(IMimeAllocator *iface, ULONG cObjects, IUnknown **prgpUnknown, boolean fFreeArray)
Definition: mimeole.c:3431
static HRESULT WINAPI MimeMessage_FindNext(IMimeMessage *iface, FINDBODY *pFindBody, HBODY *phBody)
Definition: mimeole.c:2557
static ULONG WINAPI mime_obj_Release(IUnknown *iface)
Definition: mimeole.c:3665
static ULONG WINAPI propschema_Release(IMimePropertySchema *iface)
Definition: mimeole.c:3561
static HRESULT WINAPI MimeBody_GetProp(IMimeBody *iface, LPCSTR pszName, DWORD dwFlags, LPPROPVARIANT pValue)
Definition: mimeole.c:1068
HRESULT WINAPI MimeOleCreateVirtualStream(IStream **ppStream)
Definition: mimeole.c:3122
static HRESULT WINAPI MimeSecurity_CheckInit(IMimeSecurity *iface)
Definition: mimeole.c:3189
static body_t * new_body_entry(MimeBody *mime_body, DWORD index, body_t *parent)
Definition: mimeole.c:2024
static HRESULT WINAPI MimeBody_SaveToFile(IMimeBody *iface, ENCODINGTYPE ietEncoding, LPCSTR pszFilePath)
Definition: mimeole.c:1793
static HRESULT WINAPI sub_stream_Write(IStream *iface, const void *pv, ULONG cb, ULONG *pcbWritten)
Definition: mimeole.c:250
static HRESULT WINAPI MimeMessage_SplitMessage(IMimeMessage *iface, ULONG cbMaxPart, IMimeMessageParts **ppParts)
Definition: mimeole.c:2991
HRESULT MimeAllocator_create(IUnknown *outer, void **obj)
Definition: mimeole.c:3505
static HRESULT WINAPI propschema_RegisterProperty(IMimePropertySchema *iface, const char *name, DWORD flags, DWORD rownumber, VARTYPE vtdefault, DWORD *propid)
Definition: mimeole.c:3576
HRESULT WINAPI MimeOleSetCompatMode(DWORD dwMode)
Definition: mimeole.c:3113
static MimeBody * impl_from_IMimeBody(IMimeBody *iface)
Definition: mimeole.c:461
static void empty_header_list(struct list *list)
Definition: mimeole.c:815
static HRESULT WINAPI MimeSecurity_GetMessageType(IMimeSecurity *iface, const HWND hwndParent, IMimeBody *pBody, DWORD *pdwSecType)
Definition: mimeole.c:3255
static HRESULT WINAPI MimeBody_GetSizeMax(IMimeBody *iface, ULARGE_INTEGER *pcbSize)
Definition: mimeole.c:997
static ULONG WINAPI mime_obj_AddRef(IUnknown *iface)
Definition: mimeole.c:3659
static HRESULT WINAPI MimeMessage_CreateWebPage(IMimeMessage *iface, IStream *pRootStm, LPWEBPAGEOPTIONS pOptions, IMimeMessageCallback *pCallback, IMoniker **ppMoniker)
Definition: mimeole.c:2763
static HRESULT copy_headers_to_buf(IStream *stm, char **ptr)
Definition: mimeole.c:485
static HRESULT WINAPI MimeBody_DeleteExcept(IMimeBody *iface, ULONG cNames, LPCSTR *prgszName)
Definition: mimeole.c:1256
static HRESULT WINAPI MimeBody_GetDataHere(IMimeBody *iface, ENCODINGTYPE ietEncoding, IStream *pStream)
Definition: mimeole.c:1521
static HRESULT WINAPI MimeMessage_IsBodyType(IMimeMessage *iface, HBODY hBody, IMSGBODYTYPE bodytype)
Definition: mimeole.c:2619
static HRESULT WINAPI MimeMessage_GetBody(IMimeMessage *iface, BODYLOCATION location, HBODY hPivot, HBODY *phBody)
Definition: mimeole.c:2448
static HRESULT WINAPI MimeMessage_SetTextBody(IMimeMessage *iface, DWORD dwTxtType, ENCODINGTYPE ietEncoding, HBODY hAlternative, IStream *pStream, LPHBODY phBody)
Definition: mimeole.c:2861
HRESULT MimeMessage_create(IUnknown *outer, void **obj)
Definition: mimeole.c:3068
static HRESULT WINAPI sub_stream_CopyTo(IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
Definition: mimeole.c:303
static SIZE_T WINAPI MimeAlloc_GetSize(IMimeAllocator *iface, LPVOID pv)
Definition: mimeole.c:3374
static HRESULT WINAPI MimeBody_SetPropInfo(IMimeBody *iface, LPCSTR pszName, LPCMIMEPROPINFO pInfo)
Definition: mimeole.c:1058
static HRESULT WINAPI MimeMessage_Save(IMimeMessage *iface, IStream *pStm, BOOL fClearDirty)
Definition: mimeole.c:2228
static HRESULT WINAPI MimeMessage_ToMultipart(IMimeMessage *iface, HBODY hBody, LPCSTR pszSubType, LPHBODY phMultipart)
Definition: mimeole.c:2582
static HRESULT WINAPI MimeMessage_SaveBody(IMimeMessage *iface, HBODY hBody, DWORD dwFlags, IStream *pStream)
Definition: mimeole.c:2360
static HRESULT WINAPI MimeBody_SetOption(IMimeBody *iface, const TYPEDID oid, LPCPROPVARIANT pValue)
Definition: mimeole.c:1387
static HRESULT WINAPI MimeMessage_IsDirty(IMimeMessage *iface)
Definition: mimeole.c:2017
static HRESULT WINAPI sub_stream_Clone(IStream *iface, IStream **ppstm)
Definition: mimeole.c:399
static const IMimeMessageVtbl MimeMessageVtbl
Definition: mimeole.c:3008
static void split_params(header_t *header, char *value)
Definition: mimeole.c:680
static HRESULT WINAPI MimeBody_QueryInterface(IMimeBody *iface, REFIID riid, void **ppvObject)
Definition: mimeole.c:900
static header_t * read_prop(MimeBody *body, char **ptr)
Definition: mimeole.c:540
static HRESULT WINAPI MimeMessage_GetOption(IMimeMessage *iface, const TYPEDID oid, LPPROPVARIANT pValue)
Definition: mimeole.c:2753
static HRESULT WINAPI MimeMessage_SetProp(IMimeMessage *iface, LPCSTR pszName, DWORD dwFlags, LPCPROPVARIANT pValue)
Definition: mimeole.c:2785
static ULONG WINAPI propschema_AddRef(IMimePropertySchema *iface)
Definition: mimeole.c:3551
static HRESULT WINAPI MimeMessage_FindFirst(IMimeMessage *iface, FINDBODY *pFindBody, HBODY *phBody)
Definition: mimeole.c:2547
HRESULT MimeSecurity_create(IUnknown *outer, void **obj)
Definition: mimeole.c:3293
static HRESULT WINAPI MimeBody_SetCurrentEncoding(IMimeBody *iface, ENCODINGTYPE ietEncoding)
Definition: mimeole.c:1499
static ULONG WINAPI MimeBody_AddRef(IMimeBody *iface)
Definition: mimeole.c:927
static HRESULT WINAPI sub_stream_Read(IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: mimeole.c:225
static HRESULT WINAPI sub_stream_Stat(IStream *iface, STATSTG *pstatstg, DWORD grfStatFlag)
Definition: mimeole.c:387
static IUnknown mime_obj
Definition: mimeole.c:3677
static IMimeBodyVtbl body_vtbl
Definition: mimeole.c:1817
static HRESULT WINAPI MimeSecurity_GetCertificateName(IMimeSecurity *iface, const PCX509CERT pX509Cert, const CERTNAMETYPE cn, LPSTR *ppszName)
Definition: mimeole.c:3245
HRESULT WINAPI MimeOleCreateSecurity(IMimeSecurity **ppSecurity)
Definition: mimeole.c:3314
static HRESULT WINAPI MimeMessage_Load(IMimeMessage *iface, IStream *pStm)
Definition: mimeole.c:2193
HRESULT WINAPI MimeOleCreateMessage(IUnknown *pUnkOuter, IMimeMessage **ppMessage)
Definition: mimeole.c:3104
static HRESULT WINAPI MimeMessage_AttachURL(IMimeMessage *iface, LPCSTR pszBase, LPCSTR pszURL, DWORD dwFlags, IStream *pstmURL, LPSTR *ppszCIDURL, LPHBODY phBody)
Definition: mimeole.c:2893
static ULONG WINAPI sub_stream_Release(IStream *iface)
Definition: mimeole.c:210
static body_t * create_sub_body(MimeMessage *msg, IStream *pStm, BODYOFFSETS *offset, body_t *parent)
Definition: mimeole.c:2131
static const property_t default_props[]
Definition: mimeole.c:57
static ULONG WINAPI MimeAlloc_AddRef(IMimeAllocator *iface)
Definition: mimeole.c:3340
HRESULT MimeBody_create(IUnknown *outer, void **ppv)
Definition: mimeole.c:1903
static MimeSecurity * impl_from_IMimeSecurity(IMimeSecurity *iface)
Definition: mimeole.c:3137
static HRESULT WINAPI MimeBody_Clone(IMimeBody *iface, IMimePropertySet **ppPropertySet)
Definition: mimeole.c:1378
static HRESULT WINAPI MimeMessage_GetClassID(IMimeMessage *iface, CLSID *pClassID)
Definition: mimeole.c:2008
static HRESULT WINAPI MimeMessage_HandsOffStorage(IMimeMessage *iface)
Definition: mimeole.c:2306
static HRESULT WINAPI MimeBody_BindToObject(IMimeBody *iface, REFIID riid, void **ppvObject)
Definition: mimeole.c:1368
static HRESULT WINAPI sub_stream_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
Definition: mimeole.c:377
static HRESULT WINAPI MimeSecurity_InitNew(IMimeSecurity *iface)
Definition: mimeole.c:3182
static IMimeAllocatorVtbl mime_alloc_vtbl
Definition: mimeole.c:3479
static HRESULT WINAPI MimeAlloc_FreeEnumHeaderRowArray(IMimeAllocator *iface, ULONG cRows, LPENUMHEADERROW prgRow, boolean fFreeArray)
Definition: mimeole.c:3442
static HRESULT WINAPI MimeMessage_GetAddressTypes(IMimeMessage *iface, DWORD dwAdrTypes, DWORD dwProps, LPADDRESSLIST pList)
Definition: mimeole.c:2961
static IMimeAllocator mime_allocator
Definition: mimeole.c:3500
static HRESULT WINAPI MimeBody_EnumProps(IMimeBody *iface, DWORD dwFlags, IMimeEnumProperties **ppEnum)
Definition: mimeole.c:1429
static HRESULT WINAPI MimeMessage_CountBodies(IMimeMessage *iface, HBODY hParent, boolean fRecurse, ULONG *pcBodies)
Definition: mimeole.c:2498
static ULONG WINAPI MimeBody_Release(IMimeBody *iface)
Definition: mimeole.c:937
static HRESULT WINAPI MimeMessage_InsertBody(IMimeMessage *iface, BODYLOCATION location, HBODY hPivot, LPHBODY phBody)
Definition: mimeole.c:2438
static HRESULT WINAPI MimeMessage_MoveBody(IMimeMessage *iface, HBODY hBody, BODYLOCATION location)
Definition: mimeole.c:2478
static HRESULT WINAPI MimeMessage_QueryProp(IMimeMessage *iface, LPCSTR pszName, LPCSTR pszCriteria, boolean fSubString, boolean fCaseSensitive)
Definition: mimeole.c:2803
static HRESULT WINAPI MimeBody_MoveProps(IMimeBody *iface, ULONG cNames, LPCSTR *prgszName, IMimePropertySet *pPropertySet)
Definition: mimeole.c:1245
static HRESULT WINAPI MimeBody_Load(IMimeBody *iface, IStream *pStm)
Definition: mimeole.c:983
static int WINAPI MimeAlloc_DidAlloc(IMimeAllocator *iface, LPVOID pv)
Definition: mimeole.c:3382
static HRESULT WINAPI MimeMessage_GetFlags(IMimeMessage *iface, DWORD *pdwFlags)
Definition: mimeole.c:2289
static HRESULT WINAPI MimeBody_GetOffsets(IMimeBody *iface, LPBODYOFFSETS pOffsets)
Definition: mimeole.c:1474
static HRESULT WINAPI MimeMessage_Commit(IMimeMessage *iface, DWORD dwFlags)
Definition: mimeole.c:2297
static HRESULT create_sub_stream(IStream *stream, ULARGE_INTEGER start, ULARGE_INTEGER length, IStream **out)
Definition: mimeole.c:425
static HRESULT WINAPI MimeBody_SetProp(IMimeBody *iface, LPCSTR pszName, DWORD dwFlags, LPCPROPVARIANT pValue)
Definition: mimeole.c:1105
static HRESULT WINAPI sub_stream_Commit(IStream *iface, DWORD grfCommitFlags)
Definition: mimeole.c:352
static HRESULT WINAPI MimeAlloc_FreeAddressList(IMimeAllocator *iface, LPADDRESSLIST pList)
Definition: mimeole.c:3415
static HRESULT WINAPI MimeSecurity_EnumCertificates(IMimeSecurity *iface, HCAPICERTSTORE hc, DWORD dwUsage, PCX509CERT pPrev, PCX509CERT *ppCert)
Definition: mimeole.c:3234
static ULONG WINAPI MimeMessage_Release(IMimeMessage *iface)
Definition: mimeole.c:1989
static HRESULT WINAPI MimeBody_SetData(IMimeBody *iface, ENCODINGTYPE ietEncoding, LPCSTR pszPriType, LPCSTR pszSubType, REFIID riid, LPVOID pvObject)
Definition: mimeole.c:1732
static HRESULT WINAPI MimeAlloc_QueryInterface(IMimeAllocator *iface, REFIID riid, void **obj)
Definition: mimeole.c:3319
static HRESULT WINAPI MimeBody_InitNew(IMimeBody *iface)
Definition: mimeole.c:1006
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4133
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
const WCHAR * text
Definition: package.c:1794
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
_ACRTIMP char *__cdecl strchr(const char *, int)
Definition: string.c:3291
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
_ACRTIMP char *__cdecl strstr(const char *, const char *)
Definition: string.c:3420
static char * strdup(const char *buf)
Definition: string.h:83
HRESULT WINAPI PropVariantChangeType(PROPVARIANT *ppropvarDest, REFPROPVARIANT propvarSrc, PROPVAR_CHANGE_FLAGS flags, VARTYPE vt)
Definition: propvar.c:537
#define byte(x, n)
Definition: tomcrypt.h:118
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxChildList * pList
static const FxOffsetAndName offsets[]
FxPnpStateCallbackInfo * pCallback
PWCHAR pValue
FxCollectionEntry * cur
GLuint start
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble n
Definition: glext.h:7729
GLuint address
Definition: glext.h:9393
GLenum GLsizei GLuint GLint * bytesWritten
Definition: glext.h:11123
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
const GLubyte * c
Definition: glext.h:8905
GLuint index
Definition: glext.h:6031
GLenum const GLfloat * params
Definition: glext.h:5645
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint in
Definition: glext.h:9616
GLbitfield flags
Definition: glext.h:7161
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLfloat GLfloat p
Definition: glext.h:8902
GLfloat param
Definition: glext.h:5796
GLenum GLsizei len
Definition: glext.h:6722
GLenum GLenum GLenum input
Definition: glext.h:9031
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
const char cursor[]
Definition: icontest.c:13
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
POINT cp
Definition: magnifier.c:59
const WCHAR * schema
@ PID_PAR_BOUNDARY
Definition: mimeole.idl:118
@ PID_HDR_EXPIRES
Definition: mimeole.idl:104
@ PID_HDR_LINES
Definition: mimeole.idl:111
@ PID_ATT_ACCOUNTNAME
Definition: mimeole.idl:154
@ PID_HDR_KEYWORDS
Definition: mimeole.idl:108
@ PID_ATT_UIDL
Definition: mimeole.idl:140
@ PID_PAR_NAME
Definition: mimeole.idl:120
@ PID_HDR_XUNSENT
Definition: mimeole.idl:135
@ PID_ATT_PRIORITY
Definition: mimeole.idl:130
@ PID_ATT_SENTTIME
Definition: mimeole.idl:128
@ PID_HDR_ARTICLEID
Definition: mimeole.idl:136
@ PID_HDR_CNTXFER
Definition: mimeole.idl:95
@ PID_HDR_RETRCPTO
Definition: mimeole.idl:86
@ PID_ATT_ACCOUNT
Definition: mimeole.idl:139
@ PID_HDR_PATH
Definition: mimeole.idl:102
@ PID_HDR_CNTDESC
Definition: mimeole.idl:97
@ PID_HDR_CNTDISP
Definition: mimeole.idl:98
@ PID_ATT_GHOSTED
Definition: mimeole.idl:145
@ PID_ATT_AUTOINLINED
Definition: mimeole.idl:148
@ PID_HDR_XNEWSRDR
Definition: mimeole.idl:114
@ PID_HDR_XMAILER
Definition: mimeole.idl:91
@ PID_HDR_CNTTYPE
Definition: mimeole.idl:94
@ PID_HDR_MIMEVER
Definition: mimeole.idl:93
@ PID_HDR_SENDER
Definition: mimeole.idl:137
@ PID_HDR_DATE
Definition: mimeole.idl:88
@ PID_PAR_FILENAME
Definition: mimeole.idl:117
@ PID_HDR_CNTBASE
Definition: mimeole.idl:99
@ PID_HDR_RETURNPATH
Definition: mimeole.idl:84
@ PID_HDR_DISP_NOTIFICATION_TO
Definition: mimeole.idl:149
@ PID_ATT_STOREFOLDERID
Definition: mimeole.idl:144
@ PID_HDR_FOLLOWUPTO
Definition: mimeole.idl:103
@ PID_HDR_APPROVED
Definition: mimeole.idl:110
@ PID_HDR_CONTROL
Definition: mimeole.idl:106
@ PID_HDR_REPLYTO
Definition: mimeole.idl:90
@ PID_ATT_RENDERED
Definition: mimeole.idl:127
@ PID_HDR_SUBJECT
Definition: mimeole.idl:81
@ PID_HDR_ENCRYPTED
Definition: mimeole.idl:133
@ PID_HDR_DISTRIB
Definition: mimeole.idl:107
@ PID_ATT_SUBTYPE
Definition: mimeole.idl:124
@ PID_HDR_TO
Definition: mimeole.idl:101
@ PID_ATT_FORMAT
Definition: mimeole.idl:152
@ PID_ATT_FORWARDTO
Definition: mimeole.idl:143
@ PID_ATT_SERVER
Definition: mimeole.idl:138
@ PID_HDR_CNTLOC
Definition: mimeole.idl:100
@ PID_ATT_ILLEGAL
Definition: mimeole.idl:126
@ PID_ATT_FILENAME
Definition: mimeole.idl:121
@ PID_PAR_CHARSET
Definition: mimeole.idl:119
@ PID_HDR_ORG
Definition: mimeole.idl:113
@ PID_HDR_BCC
Definition: mimeole.idl:92
@ PID_HDR_OFFSETS
Definition: mimeole.idl:134
@ PID_HDR_COMMENT
Definition: mimeole.idl:131
@ PID_HDR_RECEIVED
Definition: mimeole.idl:89
@ PID_HDR_SUMMARY
Definition: mimeole.idl:109
@ PID_HDR_RR
Definition: mimeole.idl:85
@ PID_PAR_REPLYTYPE
Definition: mimeole.idl:150
@ PID_HDR_FROM
Definition: mimeole.idl:82
@ PID_HDR_APPARTO
Definition: mimeole.idl:87
@ PID_HDR_ENCODING
Definition: mimeole.idl:132
@ PID_HDR_CNTID
Definition: mimeole.idl:96
@ PID_HDR_XMSPRI
Definition: mimeole.idl:116
@ PID_HDR_XREF
Definition: mimeole.idl:112
@ PID_HDR_MESSAGEID
Definition: mimeole.idl:83
@ PID_HDR_NEWSGROUP
Definition: mimeole.idl:78
@ PID_ATT_PRITYPE
Definition: mimeole.idl:123
@ PID_ATT_COMBINED
Definition: mimeole.idl:147
@ PID_HDR_REFS
Definition: mimeole.idl:80
@ PID_HDR_CC
Definition: mimeole.idl:105
@ PID_ATT_STOREMSGID
Definition: mimeole.idl:141
@ PID_HDR_XPRI
Definition: mimeole.idl:115
@ PID_PAR_FORMAT
Definition: mimeole.idl:151
@ PID_ATT_UNCACHEDSIZE
Definition: mimeole.idl:146
@ PID_HDR_INREPLYTO
Definition: mimeole.idl:153
@ PID_ATT_USERNAME
Definition: mimeole.idl:142
@ PID_HDR_NEWSGROUPS
Definition: mimeole.idl:79
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static PVOID ptr
Definition: dispmode.c:27
static BYTE cn[]
Definition: cert.c:2987
HRESULT hres
Definition: protocol.c:465
static DWORD bindf
Definition: protocol.c:70
static IUnknown * outer
Definition: compobj.c:82
static RPC_BINDING_HANDLE binding
Definition: server.c:166
static HWND child
Definition: cursoricon.c:298
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
const GUID IID_IPersistStreamInit
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
const GUID IID_IPersist
Definition: proxy.cpp:14
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define IID_NULL
Definition: guiddef.h:98
static unsigned __int64 next
Definition: rand_nt.c:6
#define alloc
Definition: rosglue.h:13
#define list
Definition: rosglue.h:35
const WCHAR * str
strcpy
Definition: string.h:131
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
Definition: list.h:155
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
__WINE_SERVER_LIST_INLINE struct list * list_prev(const struct list *list, const struct list *elem)
Definition: list.h:123
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:115
__WINE_SERVER_LIST_INLINE struct list * list_tail(const struct list *list)
Definition: list.h:137
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
Definition: md5.c:100
#define memset(x, y, z)
Definition: compat.h:39
int zero
Definition: sehframes.cpp:29
SIGDN PWSTR * ppszName
Definition: shobjidl.idl:606
#define TRACE(s)
Definition: solgame.cpp:4
void * data
Definition: mimeole.c:164
DWORD next_prop_id
Definition: mimeole.c:160
IID data_iid
Definition: mimeole.c:165
ENCODINGTYPE encoding
Definition: mimeole.c:163
char * content_sub_type
Definition: mimeole.c:162
struct list new_props
Definition: mimeole.c:159
HBODY handle
Definition: mimeole.c:156
IMimeBody IMimeBody_iface
Definition: mimeole.c:153
BODYOFFSETS body_offsets
Definition: mimeole.c:166
char * content_pri_type
Definition: mimeole.c:161
struct list headers
Definition: mimeole.c:158
LONG ref
Definition: mimeole.c:154
IMimeMessage IMimeMessage_iface
Definition: mimeole.c:1934
DWORD next_index
Definition: mimeole.c:1939
LONG ref
Definition: mimeole.c:1935
IStream * stream
Definition: mimeole.c:1936
struct list body_tree
Definition: mimeole.c:1938
IMimeSecurity IMimeSecurity_iface
Definition: mimeole.c:3133
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
Definition: undname.c:54
struct list children
Definition: mimeole.c:1929
struct body_t * parent
Definition: mimeole.c:1928
DWORD index
Definition: mimeole.c:1925
struct list entry
Definition: mimeole.c:1924
MimeBody * mime_body
Definition: mimeole.c:1926
Definition: format.c:58
const property_t * prop
Definition: mimeole.c:146
PROPVARIANT value
Definition: mimeole.c:147
WCHAR * value
Definition: copy.c:22
Definition: list.h:15
Definition: main.c:40
Definition: name.c:39
Definition: mimeole.c:2040
BODYOFFSETS offsets
Definition: mimeole.c:2042
struct list entry
Definition: mimeole.c:2041
char * name
Definition: mimeole.c:139
char * value
Definition: mimeole.c:140
Definition: mimeole.c:52
struct list entry
Definition: mimeole.c:53
property_t prop
Definition: mimeole.c:54
DWORD flags
Definition: mimeole.c:47
LPCSTR name
Definition: mimeole.c:45
DWORD id
Definition: mimeole.c:46
VARTYPE default_vt
Definition: mimeole.c:48
LONG ref
Definition: mimeole.c:469
IMimePropertySchema IMimePropertySchema_iface
Definition: mimeole.c:468
Definition: send.c:48
Definition: parse.h:23
IStream * base
Definition: mimeole.c:173
IStream IStream_iface
Definition: mimeole.c:171
LONG ref
Definition: mimeole.c:172
ULARGE_INTEGER length
Definition: mimeole.c:174
#define LIST_ENTRY(type)
Definition: queue.h:175
const char * LPCSTR
Definition: typedefs.h:52
int64_t LONGLONG
Definition: typedefs.h:68
ULONG_PTR SIZE_T
Definition: typedefs.h:80
char * LPSTR
Definition: typedefs.h:51
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
Definition: umon.c:732
LONGLONG QuadPart
Definition: typedefs.h:114
ULONG LowPart
Definition: typedefs.h:106
Definition: pdh_main.c:96
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
#define E_NOINTERFACE
Definition: winerror.h:3479
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771
#define STG_E_INVALIDFUNCTION
Definition: winerror.h:3659
unsigned char BYTE
Definition: xxhash.c:193