ReactOS  0.4.14-dev-614-gbfd8a84
sendmail.c
Go to the documentation of this file.
1 /*
2  * MAPISendMail implementation
3  *
4  * Copyright 2005 Hans Leidekker
5  * Copyright 2009 Owen Rudge 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 
23 #include <stdio.h>
24 #include <stdarg.h>
25 
26 #define COBJMACROS
27 
28 #include "windef.h"
29 #include "winbase.h"
30 #include "winerror.h"
31 #include "winuser.h"
32 #include "objbase.h"
33 #include "objidl.h"
34 #include "mapi.h"
35 #include "mapix.h"
36 #include "mapiutil.h"
37 #include "mapidefs.h"
38 #include "winreg.h"
39 #include "shellapi.h"
40 #include "shlwapi.h"
41 #include "wine/debug.h"
42 #include "util.h"
43 #include "res.h"
44 
46 
47 #define READ_BUF_SIZE 4096
48 
49 #define STORE_UNICODE_OK 0x00040000
50 
52 {
53  LPSTR str;
54  DWORD len;
55 
56  if (!wstr)
57  return NULL;
58 
59  len = WideCharToMultiByte(CP_ACP, 0, wstr, -1, NULL, 0, NULL, NULL);
61  WideCharToMultiByte(CP_ACP, 0, wstr, -1, str, len, NULL, NULL);
62 
63  return str;
64 }
65 
67 {
68  LPWSTR wstr;
69  DWORD len;
70 
71  if (!str)
72  return NULL;
73 
74  len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
75  wstr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
76  MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, len);
77 
78  return wstr;
79 }
80 
81 /*
82  Internal function to send a message via Extended MAPI. Wrapper around the Simple
83  MAPI function MAPISendMail.
84 */
86  FLAGS flags)
87 {
88  ULONG tags[] = {1, 0};
89  char *subjectA = NULL, *bodyA = NULL;
90  ULONG retval = MAPI_E_FAILURE;
91  IMAPISession *session = NULL;
92  BOOL unicode_aware = FALSE;
93  IMAPITable* msg_table;
94  LPSRowSet rows = NULL;
95  IMsgStore* msg_store;
96  IMAPIFolder* folder = NULL, *draft_folder = NULL;
97  LPENTRYID entry_id;
99  ULONG entry_len;
100  DWORD obj_type;
101  IMessage* msg;
102  ULONG values;
103  HRESULT ret;
104 
105  TRACE("Using Extended MAPI wrapper for MAPISendMail\n");
106 
107  /* Attempt to log on via Extended MAPI */
108 
110  TRACE("MAPILogonEx: %x\n", ret);
111 
112  if (ret != S_OK)
113  {
114  retval = MAPI_E_LOGIN_FAILURE;
115  goto cleanup;
116  }
117 
118  /* Open the default message store */
119 
120  if (IMAPISession_GetMsgStoresTable(session, 0, &msg_table) == S_OK)
121  {
122  /* We want the default store */
123  SizedSPropTagArray(2, columns) = {2, {PR_ENTRYID, PR_DEFAULT_STORE}};
124 
125  /* Set the columns we want */
126  if (IMAPITable_SetColumns(msg_table, (LPSPropTagArray) &columns, 0) == S_OK)
127  {
128  while (1)
129  {
130  if (IMAPITable_QueryRows(msg_table, 1, 0, &rows) != S_OK)
131  {
132  MAPIFreeBuffer(rows);
133  rows = NULL;
134  }
135  else if (rows->cRows != 1)
136  {
137  FreeProws(rows);
138  rows = NULL;
139  }
140  else
141  {
142  /* If it's not the default store, try the next row */
143  if (!rows->aRow[0].lpProps[1].Value.b)
144  {
145  FreeProws(rows);
146  continue;
147  }
148  }
149 
150  break;
151  }
152  }
153 
154  IMAPITable_Release(msg_table);
155  }
156 
157  /* Did we manage to get the right store? */
158  if (!rows)
159  goto logoff;
160 
161  /* Open the message store */
163  (ENTRYID *) rows->aRow[0].lpProps[0].Value.bin.lpb, NULL,
164  MDB_NO_DIALOG | MAPI_BEST_ACCESS, &msg_store);
165 
166  /* We don't need this any more */
167  FreeProws(rows);
168 
169  /* Check if the message store supports Unicode */
171  ret = IMsgStore_GetProps(msg_store, (LPSPropTagArray) tags, 0, &values, &props);
172 
173  if ((ret == S_OK) && (props[0].Value.l & STORE_UNICODE_OK))
174  unicode_aware = TRUE;
175  else
176  {
177  /* Don't convert to ANSI */
179  {
180  WARN("No Unicode-capable mail client, and MAPI_FORCE_UNICODE is specified. MAPISendMail failed.\n");
182  IMsgStore_Release(msg_store);
183  goto logoff;
184  }
185  }
186 
187  /* First open the inbox, from which the drafts folder can be opened */
188  if (IMsgStore_GetReceiveFolder(msg_store, NULL, 0, &entry_len, &entry_id, NULL) == S_OK)
189  {
190  IMsgStore_OpenEntry(msg_store, entry_len, entry_id, NULL, 0, &obj_type, (LPUNKNOWN*) &folder);
191  MAPIFreeBuffer(entry_id);
192  }
193 
195 
196  /* Open the drafts folder, or failing that, try asking the message store for the outbox */
197  if ((folder == NULL) || ((ret = IMAPIFolder_GetProps(folder, (LPSPropTagArray) tags, 0, &values, &props)) != S_OK))
198  {
199  TRACE("Unable to open Drafts folder; opening Outbox instead\n");
201  ret = IMsgStore_GetProps(msg_store, (LPSPropTagArray) tags, 0, &values, &props);
202  }
203 
204  if (ret != S_OK)
205  goto logoff;
206 
207  IMsgStore_OpenEntry(msg_store, props[0].Value.bin.cb, (LPENTRYID) props[0].Value.bin.lpb,
208  NULL, MAPI_MODIFY, &obj_type, (LPUNKNOWN *) &draft_folder);
209 
210  /* Create a new message */
211  if (IMAPIFolder_CreateMessage(draft_folder, NULL, 0, &msg) == S_OK)
212  {
213  ULONG token;
214  SPropValue p;
215 
216  /* Define message properties */
217  p.ulPropTag = PR_MESSAGE_FLAGS;
218  p.Value.l = MSGFLAG_FROMME | MSGFLAG_UNSENT;
219 
220  IMessage_SetProps(msg, 1, &p, NULL);
221 
222  p.ulPropTag = PR_SENTMAIL_ENTRYID;
223  p.Value.bin.cb = props[0].Value.bin.cb;
224  p.Value.bin.lpb = props[0].Value.bin.lpb;
225  IMessage_SetProps(msg, 1,&p, NULL);
226 
227  /* Set message subject */
228  if (message->lpszSubject)
229  {
230  if (unicode_aware)
231  {
232  p.ulPropTag = PR_SUBJECT_W;
233  p.Value.lpszW = message->lpszSubject;
234  }
235  else
236  {
237  subjectA = convert_from_unicode(message->lpszSubject);
238 
239  p.ulPropTag = PR_SUBJECT_A;
240  p.Value.lpszA = subjectA;
241  }
242 
243  IMessage_SetProps(msg, 1, &p, NULL);
244  }
245 
246  /* Set message body */
247  if (message->lpszNoteText)
248  {
249  LPSTREAM stream = NULL;
250 
251  if (IMessage_OpenProperty(msg, unicode_aware ? PR_BODY_W : PR_BODY_A, &IID_IStream, 0,
253  {
254  if (unicode_aware)
255  IStream_Write(stream, message->lpszNoteText, (lstrlenW(message->lpszNoteText)+1) * sizeof(WCHAR), NULL);
256  else
257  {
258  bodyA = convert_from_unicode(message->lpszNoteText);
259  IStream_Write(stream, bodyA, strlen(bodyA)+1, NULL);
260  }
261 
262  IStream_Release(stream);
263  }
264  }
265 
266  /* Add message attachments */
267  if (message->nFileCount > 0)
268  {
269  ULONG num_attach = 0;
270  unsigned int i;
271 
272  for (i = 0; i < message->nFileCount; i++)
273  {
274  IAttach* attachment = NULL;
275  char *filenameA = NULL;
276  SPropValue prop[4];
278  HANDLE file;
279 
280  if (!message->lpFiles[i].lpszPathName)
281  continue;
282 
283  /* Open the attachment for reading */
284  file = CreateFileW(message->lpFiles[i].lpszPathName, GENERIC_READ, FILE_SHARE_READ,
286 
287  if (file == INVALID_HANDLE_VALUE)
288  continue;
289 
290  /* Check if a display filename has been given; if not, get one ourselves from path name */
291  filename = message->lpFiles[i].lpszFileName;
292 
293  if (!filename)
294  {
295  int j;
296 
297  filename = message->lpFiles[i].lpszPathName;
298 
299  for (j = lstrlenW(message->lpFiles[i].lpszPathName)-1; j >= 0; j--)
300  {
301  if (message->lpFiles[i].lpszPathName[i] == '\\' ||
302  message->lpFiles[i].lpszPathName[i] == '/')
303  {
304  filename = &message->lpFiles[i].lpszPathName[i+1];
305  break;
306  }
307  }
308  }
309 
310  TRACE("Attachment %u path: '%s'; filename: '%s'\n", i, debugstr_w(message->lpFiles[i].lpszPathName),
312 
313  /* Create the attachment */
314  if (IMessage_CreateAttach(msg, NULL, 0, &num_attach, &attachment) != S_OK)
315  {
316  TRACE("Unable to create attachment\n");
317  CloseHandle(file);
318  continue;
319  }
320 
321  /* Set the attachment properties */
322  ZeroMemory(prop, sizeof(prop));
323 
324  prop[0].ulPropTag = PR_ATTACH_METHOD;
325  prop[0].Value.ul = ATTACH_BY_VALUE;
326 
327  if (unicode_aware)
328  {
330  prop[1].Value.lpszW = (LPWSTR) filename;
332  prop[2].Value.lpszW = (LPWSTR) filename;
333  }
334  else
335  {
337 
339  prop[1].Value.lpszA = (LPSTR) filenameA;
341  prop[2].Value.lpszA = (LPSTR) filenameA;
342 
343  }
344 
346  prop[3].Value.l = -1;
347 
348  if (IAttach_SetProps(attachment, 4, prop, NULL) == S_OK)
349  {
350  LPSTREAM stream = NULL;
351 
352  if (IAttach_OpenProperty(attachment, PR_ATTACH_DATA_BIN, &IID_IStream, 0,
354  {
356  DWORD size = 0, read, written;
357 
358  while (ReadFile(file, data, READ_BUF_SIZE, &read, NULL) && (read != 0))
359  {
360  IStream_Write(stream, data, read, &written);
361  size += read;
362  }
363 
364  TRACE("%d bytes written of attachment\n", size);
365 
366  IStream_Commit(stream, STGC_DEFAULT);
367  IStream_Release(stream);
368 
369  prop[0].ulPropTag = PR_ATTACH_SIZE;
370  prop[0].Value.ul = size;
371  IAttach_SetProps(attachment, 1, prop, NULL);
372 
374  num_attach++;
375  }
376  }
377 
378  CloseHandle(file);
380 
382  }
383  }
384 
386 
387  /* Prepare the message form */
388 
390  {
391  ULONG access = 0, status = 0, message_flags = 0, pc = 0;
392  ULONG pT[2] = {1, PR_MSG_STATUS};
393 
394  /* Retrieve message status, flags, access rights and class */
395 
396  if (IMessage_GetProps(msg, (LPSPropTagArray) pT, 0, &pc, &props) == S_OK)
397  {
398  status = props->Value.ul;
400  }
401 
402  pT[1] = PR_MESSAGE_FLAGS;
403 
404  if (IMessage_GetProps(msg, (LPSPropTagArray) pT, 0, &pc, &props) == S_OK)
405  {
406  message_flags = props->Value.ul;
408  }
409 
410  pT[1] = PR_ACCESS;
411 
412  if (IMessage_GetProps(msg, (LPSPropTagArray) pT, 0, &pc, &props) == S_OK)
413  {
414  access = props->Value.ul;
416  }
417 
418  pT[1] = PR_MESSAGE_CLASS_A;
419 
420  if (IMessage_GetProps(msg, (LPSPropTagArray) pT, 0, &pc, &props) == S_OK)
421  {
422  /* Show the message form (edit window) */
423 
424  ret = IMAPISession_ShowForm(session, 0, msg_store, draft_folder, NULL,
425  token, NULL, 0, status, message_flags, access,
426  props->Value.lpszA);
427 
428  switch (ret)
429  {
430  case S_OK:
431  retval = SUCCESS_SUCCESS;
432  break;
433 
434  case MAPI_E_USER_CANCEL:
435  retval = MAPI_E_USER_ABORT;
436  break;
437 
438  default:
439  TRACE("ShowForm failure: %x\n", ret);
440  break;
441  }
442  }
443  }
444 
446  }
447 
448  /* Free up the resources we've used */
449  IMAPIFolder_Release(draft_folder);
451  IMsgStore_Release(msg_store);
452 
453  HeapFree(GetProcessHeap(), 0, subjectA);
454  HeapFree(GetProcessHeap(), 0, bodyA);
455 
456 logoff: ;
457  IMAPISession_Logoff(session, 0, 0, 0);
459 
460 cleanup: ;
462  return retval;
463 }
464 
465 /**************************************************************************
466  * MAPISendMail (MAPI32.211)
467  *
468  * Send a mail.
469  *
470  * PARAMS
471  * session [I] Handle to a MAPI session.
472  * uiparam [I] Parent window handle.
473  * message [I] Pointer to a MAPIMessage structure.
474  * flags [I] Flags.
475  * reserved [I] Reserved, pass 0.
476  *
477  * RETURNS
478  * Success: SUCCESS_SUCCESS
479  * Failure: MAPI_E_FAILURE
480  *
481  */
484 {
486 
487  /* Check to see if we have a Simple MAPI provider loaded */
490 
491  /* Check if we have an Extended MAPI provider - if so, use our wrapper */
492  if (MAPIInitialize(NULL) == S_OK)
493  {
495  ULONG ret;
496 
497  ZeroMemory(&messageW, sizeof(MapiMessageW));
498 
499  /* Convert the entries we need to Unicode */
500  messageW.lpszSubject = convert_to_unicode(message->lpszSubject);
501  messageW.lpszNoteText = convert_to_unicode(message->lpszNoteText);
502  messageW.nFileCount = message->nFileCount;
503 
504  if (message->nFileCount && message->lpFiles)
505  {
506  lpMapiFileDescW filesW;
507  unsigned int i;
508 
509  filesW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MapiFileDescW) * message->nFileCount);
510 
511  for (i = 0; i < message->nFileCount; i++)
512  {
513  filesW[i].lpszPathName = convert_to_unicode(message->lpFiles[i].lpszPathName);
514  filesW[i].lpszFileName = convert_to_unicode(message->lpFiles[i].lpszFileName);
515  }
516 
517  messageW.lpFiles = filesW;
518  }
519 
521 
522  /* Now free everything we allocated */
523  if (message->nFileCount && message->lpFiles)
524  {
525  unsigned int i;
526 
527  for (i = 0; i < message->nFileCount; i++)
528  {
529  HeapFree(GetProcessHeap(), 0, messageW.lpFiles[i].lpszPathName);
530  HeapFree(GetProcessHeap(), 0, messageW.lpFiles[i].lpszFileName);
531  }
532 
533  HeapFree(GetProcessHeap(), 0, messageW.lpFiles);
534  }
535 
536  HeapFree(GetProcessHeap(), 0, messageW.lpszSubject);
537  HeapFree(GetProcessHeap(), 0, messageW.lpszNoteText);
538 
539  return ret;
540  }
541 
542  /* Display an error message since we apparently have no mail clients */
544  LoadStringW(hInstMAPI32, IDS_SEND_MAIL, msg_title, ARRAY_SIZE(msg_title));
545 
546  MessageBoxW((HWND) uiparam, error_msg, msg_title, MB_ICONEXCLAMATION);
547 
548  return MAPI_E_NOT_SUPPORTED;
549 }
550 
552 {
554 
555  if (!recipW)
556  return NULL;
557 
558  if (dest)
559  ret = dest;
560  else
562 
563  ret->ulRecipClass = recipW->ulRecipClass;
564  ret->lpszName = convert_from_unicode(recipW->lpszName);
565  ret->lpszAddress = convert_from_unicode(recipW->lpszAddress);
566  ret->ulEIDSize = recipW->ulEIDSize;
567  ret->lpEntryID = recipW->lpEntryID;
568 
569  return ret;
570 }
571 
572 /**************************************************************************
573  * MAPISendMailW (MAPI32.256)
574  *
575  * Send a mail.
576  *
577  * PARAMS
578  * session [I] Handle to a MAPI session.
579  * uiparam [I] Parent window handle.
580  * message [I] Pointer to a MAPIMessageW structure.
581  * flags [I] Flags.
582  * reserved [I] Reserved, pass 0.
583  *
584  * RETURNS
585  * Success: SUCCESS_SUCCESS
586  * Failure: MAPI_E_FAILURE
587  *
588  */
591 {
593 
594  /* Check to see if we have a Simple MAPI provider loaded */
597 
598  /* Check if we have an Extended MAPI provider - if so, use our wrapper */
599  if (MAPIInitialize(NULL) == S_OK)
600  return sendmail_extended_mapi(session, uiparam, message, flags);
601 
603  {
604  MapiMessage messageA;
605  ULONG ret;
606 
609 
610  /* Convert to ANSI and send to MAPISendMail */
611  ZeroMemory(&messageA, sizeof(MapiMessage));
612 
613  messageA.lpszSubject = convert_from_unicode(message->lpszSubject);
614  messageA.lpszNoteText = convert_from_unicode(message->lpszNoteText);
615  messageA.lpszMessageType = convert_from_unicode(message->lpszMessageType);
616  messageA.lpszDateReceived = convert_from_unicode(message->lpszDateReceived);
617  messageA.lpszConversationID = convert_from_unicode(message->lpszConversationID);
618  messageA.flFlags = message->flFlags;
619  messageA.lpOriginator = convert_recipient_from_unicode(message->lpOriginator, NULL);
620  messageA.nRecipCount = message->nRecipCount;
621  messageA.nFileCount = message->nFileCount;
622 
623  if (message->nRecipCount && message->lpRecips)
624  {
625  lpMapiRecipDesc recipsA;
626  unsigned int i;
627 
628  recipsA = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MapiRecipDesc) * message->nRecipCount);
629 
630  for (i = 0; i < message->nRecipCount; i++)
631  {
632  convert_recipient_from_unicode(&message->lpRecips[i], &recipsA[i]);
633  }
634 
635  messageA.lpRecips = recipsA;
636  }
637 
638  if (message->nFileCount && message->lpFiles)
639  {
640  lpMapiFileDesc filesA;
641  unsigned int i;
642 
643  filesA = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MapiFileDesc) * message->nFileCount);
644 
645  for (i = 0; i < message->nFileCount; i++)
646  {
647  filesA[i].flFlags = message->lpFiles[i].flFlags;
648  filesA[i].nPosition = message->lpFiles[i].nPosition;
649  filesA[i].lpszPathName = convert_from_unicode(message->lpFiles[i].lpszPathName);
650  filesA[i].lpszFileName = convert_from_unicode(message->lpFiles[i].lpszFileName);
651  filesA[i].lpFileType = message->lpFiles[i].lpFileType;
652  }
653 
654  messageA.lpFiles = filesA;
655  }
656 
657  ret = mapiFunctions.MAPISendMail(session, uiparam, &messageA, flags, reserved);
658 
659  /* Now free everything we allocated */
660  if (message->lpOriginator)
661  {
662  HeapFree(GetProcessHeap(), 0, messageA.lpOriginator->lpszName);
664  HeapFree(GetProcessHeap(), 0, messageA.lpOriginator);
665  }
666 
667  if (message->nRecipCount && message->lpRecips)
668  {
669  unsigned int i;
670 
671  for (i = 0; i < message->nRecipCount; i++)
672  {
673  HeapFree(GetProcessHeap(), 0, messageA.lpRecips[i].lpszName);
674  HeapFree(GetProcessHeap(), 0, messageA.lpRecips[i].lpszAddress);
675  }
676 
677  HeapFree(GetProcessHeap(), 0, messageA.lpRecips);
678  }
679 
680  if (message->nFileCount && message->lpFiles)
681  {
682  unsigned int i;
683 
684  for (i = 0; i < message->nFileCount; i++)
685  {
686  HeapFree(GetProcessHeap(), 0, messageA.lpFiles[i].lpszPathName);
687  HeapFree(GetProcessHeap(), 0, messageA.lpFiles[i].lpszFileName);
688  }
689 
690  HeapFree(GetProcessHeap(), 0, messageA.lpFiles);
691  }
692 
693  HeapFree(GetProcessHeap(), 0, messageA.lpszSubject);
694  HeapFree(GetProcessHeap(), 0, messageA.lpszNoteText);
695  HeapFree(GetProcessHeap(), 0, messageA.lpszDateReceived);
697 
698  return ret;
699  }
700 
701  /* Display an error message since we apparently have no mail clients */
703  LoadStringW(hInstMAPI32, IDS_SEND_MAIL, msg_title, ARRAY_SIZE(msg_title));
704 
705  MessageBoxW((HWND) uiparam, error_msg, msg_title, MB_ICONEXCLAMATION);
706 
707  return MAPI_E_NOT_SUPPORTED;
708 }
709 
711  LPSTR filenames, ULONG reserved)
712 {
714  return mapiFunctions.MAPISendDocuments(uiparam, delim, paths, filenames, reserved);
715 
716  return MAPI_E_NOT_SUPPORTED;
717 }
LPSTR lpszName
Definition: mapi.h:71
GLenum attachment
Definition: glext.h:6295
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define IMAPIFolder_GetProps(p, a, b, c, d)
Definition: mapidefs.h:1128
ULONG ulEIDSize
Definition: mapi.h:83
#define KEEP_OPEN_READONLY
Definition: mapidefs.h:916
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
const char * tags[7 *8]
Definition: apphelp.c:214
#define CloseHandle
Definition: compat.h:406
Definition: fci.c:115
#define IDS_SEND_MAIL
Definition: res.h:28
static const WCHAR * error_msg[8]
Definition: odbccp32.c:62
#define WideCharToMultiByte
Definition: compat.h:101
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
LPSTR lpszPathName
Definition: mapi.h:45
#define PR_STORE_SUPPORT_MASK
Definition: mapitags.h:412
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
ULONG ulPropTag
Definition: mapidefs.h:408
#define PR_ENTRYID
Definition: mapitags.h:341
#define KEEP_OPEN_READWRITE
Definition: mapidefs.h:917
#define CP_ACP
Definition: compat.h:99
#define PR_MESSAGE_CLASS_A
Definition: mapitags.h:63
#define MAPI_E_UNICODE_NOT_SUPPORTED
Definition: mapi.h:153
#define WARN(fmt,...)
Definition: debug.h:111
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:5666
ULONG cb
Definition: mapidefs.h:289
static const WCHAR messageW[]
Definition: error.c:33
#define PR_SUBJECT_W
Definition: mapitags.h:99
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
#define MSGFLAG_UNSENT
Definition: mapidefs.h:1269
#define ZeroMemory
Definition: winbase.h:1642
#define MDB_NO_DIALOG
Definition: mapidefs.h:171
PWSTR lpszFileName
Definition: mapi.h:56
interface IStream * LPSTREAM
Definition: objfwd.h:10
#define PR_ACCESS
Definition: mapitags.h:355
unsigned short b
Definition: mapidefs.h:380
#define PR_SUBJECT_A
Definition: mapitags.h:100
VOID WINAPI FreeProws(LPSRowSet lpRowSet)
Definition: prop.c:688
lpMapiRecipDesc lpOriginator
Definition: mapi.h:96
char * LPSTR
Definition: xmlstorage.h:182
ULONG nPosition
Definition: mapi.h:44
const char * filename
Definition: ioapi.h:135
#define PR_RENDERING_POSITION
Definition: mapitags.h:475
#define MAPI_FORCE_UNICODE
Definition: mapi.h:181
#define lstrlenW
Definition: compat.h:415
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
LPWSTR lpszW
Definition: mapidefs.h:386
#define IMAPITable_QueryRows(p, a, b, c)
Definition: mapidefs.h:831
#define FILE_SHARE_READ
Definition: compat.h:125
#define IMAPITable_SetColumns(p, a, b)
Definition: mapidefs.h:819
PWSTR lpszName
Definition: mapi.h:81
uint32_t ULONG_PTR
Definition: typedefs.h:63
lpMapiFileDesc lpFiles
Definition: mapi.h:100
#define MB_ICONEXCLAMATION
Definition: winuser.h:779
#define IMsgStore_GetReceiveFolder(p, a, b, c, d, e)
Definition: mapidefs.h:990
LPSTR lpszAddress
Definition: mapi.h:72
#define IMAPIFolder_CreateMessage(p, a, b, c)
Definition: mapidefs.h:1144
#define PR_ATTACH_LONG_FILENAME_A
Definition: mapitags.h:468
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
MAPIFREEBUFFER MAPIFreeBuffer
Definition: mapi.h:206
#define MAPI_USE_DEFAULT
Definition: mapidefs.h:161
lpMapiRecipDesc lpRecips
Definition: mapi.h:98
LONG l
Definition: mapidefs.h:376
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IMessage_CreateAttach(p, a, b, c, d)
Definition: mapidefs.h:1255
static LPUNKNOWN
Definition: ndr_ole.c:49
#define IMessage_GetProps(p, a, b, c, d)
Definition: mapidefs.h:1243
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 token
Definition: glfuncs.h:210
#define debugstr_w
Definition: kernel32.h:32
#define PR_ATTACH_FILENAME_W
Definition: mapitags.h:463
MAPIUNINITIALIZE MAPIUninitialize
Definition: mapix.h:84
#define ATTACH_BY_VALUE
Definition: mapidefs.h:1324
r reserved
Definition: btrfs.c:2865
ULONG_PTR LHANDLE
Definition: mapi.h:30
const WCHAR * str
LPMAPISENDDOCUMENTS MAPISendDocuments
Definition: util.h:45
smooth NULL
Definition: ftsmooth.c:416
#define PR_ATTACH_FILENAME_A
Definition: mapitags.h:464
LPMAPISENDMAIL MAPISendMail
Definition: util.h:43
#define IMAPIFolder_Release(p)
Definition: mapidefs.h:1124
MAPILOGONEX MAPILogonEx
Definition: mapix.h:92
#define IMessage_Release(p)
Definition: mapidefs.h:1239
#define OPEN_EXISTING
Definition: compat.h:434
#define MAPI_E_LOGIN_FAILURE
Definition: mapi.h:129
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 GLint GLint j
Definition: glfuncs.h:250
#define IMAPISession_ShowForm(p, a, b, c, d, e, f, g, h, i, j, k)
Definition: mapix.h:178
#define PR_BODY_A
Definition: mapitags.h:236
#define PR_IPM_DRAFTS_ENTRYID
Definition: mapitags.h:455
DECLSPEC_HIDDEN HINSTANCE hInstMAPI32
Definition: mapi32_main.c:37
LPSTR lpszFileName
Definition: mapi.h:46
#define MAPI_E_NOT_SUPPORTED
Definition: mapi.h:152
LPSTR lpszNoteText
Definition: mapi.h:91
#define TRACE(s)
Definition: solgame.cpp:4
union _PV Value
Definition: mapidefs.h:410
#define IMessage_SaveChanges(p, a)
Definition: mapidefs.h:1242
#define IAttach_Release(p)
Definition: mapidefs.h:1306
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
SBinary bin
Definition: mapidefs.h:385
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
ULONG ul
Definition: mapidefs.h:377
#define PR_MSG_STATUS
Definition: mapitags.h:325
#define WINAPI
Definition: msvc.h:6
const char file[]
Definition: icontest.c:11
#define MSGFLAG_FROMME
Definition: mapidefs.h:1271
FLAGS flFlags
Definition: mapi.h:95
ULONG WINAPI MAPISendDocuments(ULONG_PTR uiparam, LPSTR delim, LPSTR paths, LPSTR filenames, ULONG reserved)
Definition: sendmail.c:710
unsigned long DWORD
Definition: ntddk_ex.h:95
static CHAR filenameA[MAX_PATH]
Definition: storage32.c:42
#define PR_ATTACH_DATA_BIN
Definition: mapitags.h:458
#define PR_BODY_W
Definition: mapitags.h:235
LPSTR lpszMessageType
Definition: mapi.h:92
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define IMessage_OpenProperty(p, a, b, c, d, e)
Definition: mapidefs.h:1245
GLbitfield flags
Definition: glext.h:7161
#define PR_SENTMAIL_ENTRYID
Definition: mapitags.h:313
ULONG ulRecipClass
Definition: mapi.h:80
int ret
PVOID lpEntryID
Definition: mapi.h:84
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define IMessage_SetProps(p, a, b, c)
Definition: mapidefs.h:1246
LPSTR lpszConversationID
Definition: mapi.h:94
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
MAPI_FUNCTIONS mapiFunctions
Definition: util.c:49
#define IDS_NO_MAPI_CLIENT
Definition: res.h:27
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
LPBYTE lpb
Definition: mapidefs.h:290
#define PR_ATTACH_LONG_FILENAME_W
Definition: mapitags.h:467
#define GENERIC_READ
Definition: compat.h:124
static lpMapiRecipDesc convert_recipient_from_unicode(lpMapiRecipDescW recipW, lpMapiRecipDesc dest)
Definition: sendmail.c:551
#define IMAPISession_GetMsgStoresTable(p, a, b)
Definition: mapix.h:161
#define PR_DEFAULT_STORE
Definition: mapitags.h:411
#define IMAPISession_Release(p)
Definition: mapix.h:158
static LPSTR convert_from_unicode(LPCWSTR wstr)
Definition: sendmail.c:51
#define IMAPISession_OpenMsgStore(p, a, b, c, d, e, f)
Definition: mapix.h:162
GLsizei const GLuint * paths
Definition: glext.h:11717
LPSTR lpszA
Definition: mapidefs.h:384
#define IMsgStore_OpenEntry(p, a, b, c, d, e, f)
Definition: mapidefs.h:988
ULONG flFlags
Definition: mapi.h:43
ULONG nFileCount
Definition: mapi.h:99
#define S_OK
Definition: intsafe.h:59
#define PR_ATTACH_SIZE
Definition: mapitags.h:335
LPVOID lpFileType
Definition: mapi.h:47
WINE_DEFAULT_DEBUG_CHANNEL(mapi)
#define IMAPISession_PrepareForm(p, a, b, c)
Definition: mapix.h:180
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
#define ARRAY_SIZE(a)
Definition: main.h:24
#define MAPI_EXTENDED
Definition: mapi.h:165
ULONG cRows
Definition: mapidefs.h:424
#define READ_BUF_SIZE
Definition: sendmail.c:47
#define MAPI_E_USER_ABORT
Definition: mapi.h:126
ULONG WINAPI MAPISendMailW(LHANDLE session, ULONG_PTR uiparam, lpMapiMessageW message, FLAGS flags, ULONG reserved)
Definition: sendmail.c:589
static LPWSTR convert_to_unicode(LPSTR str)
Definition: sendmail.c:66
#define MAPI_NEW_SESSION
Definition: mapi.h:162
#define PR_ATTACH_METHOD
Definition: mapitags.h:466
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define MultiByteToWideChar
Definition: compat.h:100
#define PR_MESSAGE_FLAGS
Definition: mapitags.h:310
#define CreateFileW
Definition: compat.h:408
#define msg(x)
Definition: auth_time.c:54
#define MAPI_CREATE
Definition: mapidefs.h:154
#define SUCCESS_SUCCESS
Definition: mapi.h:122
#define MAPI_MODIFY
Definition: mapidefs.h:153
static const WCHAR props[]
Definition: wbemdisp.c:288
#define IAttach_SetProps(p, a, b, c)
Definition: mapidefs.h:1313
LPSPropValue lpProps
Definition: mapidefs.h:418
#define STORE_UNICODE_OK
Definition: sendmail.c:49
MAPIINITIALIZE MAPIInitialize
Definition: mapix.h:80
PWSTR lpszPathName
Definition: mapi.h:55
unsigned int ULONG
Definition: retypes.h:1
#define IMAPISession_Logoff(p, a, b, c)
Definition: mapix.h:175
char * cleanup(char *str)
Definition: wpickclick.c:99
#define MAPI_BEST_ACCESS
Definition: mapidefs.h:765
ULONG nRecipCount
Definition: mapi.h:97
static char * dest
Definition: rtl.c:135
PWSTR lpszAddress
Definition: mapi.h:82
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IMsgStore_GetProps(p, a, b, c, d)
Definition: mapidefs.h:975
ULONG FLAGS
Definition: mapi.h:36
ULONG WINAPI MAPISendMail(LHANDLE session, ULONG_PTR uiparam, lpMapiMessage message, FLAGS flags, ULONG reserved)
Definition: sendmail.c:482
#define IAttach_SaveChanges(p, a)
Definition: mapidefs.h:1309
LPSTR lpszSubject
Definition: mapi.h:90
#define MAPI_E_FAILURE
Definition: mapi.h:127
BOOL WINAPI ReadFile(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead, OUT LPDWORD lpNumberOfBytesRead OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:123
LPSTR lpszDateReceived
Definition: mapi.h:93
#define IMsgStore_Release(p)
Definition: mapidefs.h:971
#define IAttach_OpenProperty(p, a, b, c, d, e)
Definition: mapidefs.h:1312
LPMAPISENDMAILW MAPISendMailW
Definition: util.h:44
SRow aRow[MAPI_DIM]
Definition: mapidefs.h:425
static ULONG sendmail_extended_mapi(LHANDLE mapi_session, ULONG_PTR uiparam, lpMapiMessageW message, FLAGS flags)
Definition: sendmail.c:85
#define HeapFree(x, y, z)
Definition: compat.h:402
#define PR_IPM_OUTBOX_ENTRYID
Definition: mapitags.h:423
#define MAPI_E_USER_CANCEL
Definition: mapicode.h:102
#define SizedSPropTagArray(n, id)
Definition: mapidefs.h:276
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
Definition: fci.c:126
Definition: ps.c:97
#define IMAPITable_Release(p)
Definition: mapidefs.h:813