secur32: Split the NTLM credential and context handles into separate objects.
[wine/wine-kai.git] / include / mapidefs.h
blob219177d62eef2b3b1dbfd032aa89811ab97eae33
1 /*
2 * Copyright (C) 1998 Justin Bradford
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef MAPIDEFS_H
20 #define MAPIDEFS_H
22 #ifndef __WINESRC__
23 # include <windows.h>
24 #endif
26 #include <winerror.h>
27 #ifndef _OBJBASE_H_
28 #include <objbase.h>
29 #endif
30 #include <stddef.h>
32 /* Some types from other headers */
33 #ifndef __LHANDLE
34 #define __LHANDLE
35 typedef ULONG_PTR LHANDLE, *LPLHANDLE;
36 #endif
38 #ifndef _tagCY_DEFINED
39 #define _tagCY_DEFINED
40 typedef union tagCY
42 struct
44 #ifdef WORDS_BIGENDIAN
45 LONG Hi;
46 ULONG Lo;
47 #else
48 ULONG Lo;
49 LONG Hi;
50 #endif
51 } DUMMYSTRUCTNAME;
52 LONGLONG int64;
53 } CY;
54 typedef CY CURRENCY;
55 #endif /* _tagCY_DEFINED */
58 #ifndef _FILETIME_
59 #define _FILETIME_
60 typedef struct _FILETIME
62 #ifdef WORDS_BIGENDIAN
63 DWORD dwHighDateTime;
64 DWORD dwLowDateTime;
65 #else
66 DWORD dwLowDateTime;
67 DWORD dwHighDateTime;
68 #endif
69 } FILETIME, *PFILETIME, *LPFILETIME;
70 #endif
72 /* Memory allocation routines */
73 typedef SCODE (WINAPI ALLOCATEBUFFER)(ULONG,LPVOID*);
74 typedef SCODE (WINAPI ALLOCATEMORE)(ULONG,LPVOID,LPVOID*);
75 typedef ULONG (WINAPI FREEBUFFER)(LPVOID);
77 typedef ALLOCATEBUFFER *LPALLOCATEBUFFER;
78 typedef ALLOCATEMORE *LPALLOCATEMORE;
79 typedef FREEBUFFER *LPFREEBUFFER;
81 /* MAPI exposed interfaces */
82 typedef const IID *LPCIID;
84 typedef struct IAddrBook IAddrBook;
85 typedef IAddrBook *LPADRBOOK;
86 typedef struct IABContainer IABContainer;
87 typedef IABContainer *LPABCONT;
88 typedef struct IAttach IAttach;
89 typedef IAttach *LPATTACH;
90 typedef struct IDistList IDistList;
91 typedef IDistList *LPDISTLIST;
92 typedef struct IMailUser IMailUser;
93 typedef IMailUser *LPMAILUSER;
94 typedef struct IMAPIAdviseSink *LPMAPIADVISESINK;
95 typedef struct IMAPIContainer IMAPIContainer;
96 typedef IMAPIContainer *LPMAPICONTAINER;
97 typedef struct IMAPIFolder IMAPIFolder;
98 typedef IMAPIFolder *LPMAPIFOLDER;
99 typedef struct IMAPIProgress IMAPIProgress;
100 typedef IMAPIProgress *LPMAPIPROGRESS;
101 typedef struct IMAPIStatus IMAPIStatus;
102 typedef IMAPIStatus *LPMAPISTATUS;
103 typedef struct IMessage IMessage;
104 typedef IMessage *LPMESSAGE;
105 typedef struct IMsgStore IMsgStore;
106 typedef IMsgStore *LPMDB;
107 typedef struct IProfSect IProfSect;
108 typedef IProfSect *LPPROFSECT;
109 typedef struct IProviderAdmin IProviderAdmin;
110 typedef IProviderAdmin *LPPROVIDERADMIN;
112 #ifndef MAPI_DIM
113 # define MAPI_DIM 1 /* Default to one dimension for variable length arrays */
114 #endif
116 /* Flags for abFlags[0] */
117 #define MAPI_NOTRESERVED 0x08
118 #define MAPI_NOW 0x10
119 #define MAPI_THISSESSION 0x20
120 #define MAPI_NOTRECIP 0x40
121 #define MAPI_SHORTTERM 0x80
123 /* Flags for abFlags[1] */
124 #define MAPI_COMPOUND 0x80
126 typedef struct _ENTRYID
128 BYTE abFlags[4];
129 BYTE ab[MAPI_DIM];
130 } ENTRYID, *LPENTRYID;
132 /* MAPI GUID's */
133 typedef struct _MAPIUID
135 BYTE ab[sizeof(GUID)];
136 } MAPIUID, *LPMAPIUID;
138 #define IsEqualMAPIUID(pl,pr) (!memcmp((pl),(pr),sizeof(MAPIUID)))
140 #define MAPI_ONE_OFF_UID { 0x81,0x2b,0x1f,0xa4,0xbe,0xa3,0x10,0x19,0x9d,0x6e, \
141 0x00,0xdd,0x01,0x0f,0x54,0x02 }
142 #define MAPI_ONE_OFF_UNICODE 0x8000
143 #define MAPI_ONE_OFF_NO_RICH_INFO 0x0001
145 /* Object types */
146 #define MAPI_STORE 1U
147 #define MAPI_ADDRBOOK 2U
148 #define MAPI_FOLDER 3U
149 #define MAPI_ABCONT 4U
150 #define MAPI_MESSAGE 5U
151 #define MAPI_MAILUSER 6U
152 #define MAPI_ATTACH 7U
153 #define MAPI_DISTLIST 8U
154 #define MAPI_PROFSECT 9U
155 #define MAPI_STATUS 10U
156 #define MAPI_SESSION 11U
157 #define MAPI_FORMINFO 12U
159 /* Flags for various calls */
160 #define MAPI_MODIFY 0x00000001U /* Object can be modified */
161 #define MAPI_ACCESS_MODIFY MAPI_MODIFY /* Want write access */
162 #define MAPI_ACCESS_READ 0x00000002U /* Want read access */
163 #define MAPI_ACCESS_DELETE 0x00000004U /* Want delete access */
164 #define MAPI_ACCESS_CREATE_HIERARCHY 0x00000008U
165 #define MAPI_ACCESS_CREATE_CONTENTS 0x00000010U
166 #define MAPI_ACCESS_CREATE_ASSOCIATED 0x00000020U
167 #define MAPI_UNICODE 0x80000000U /* Strings in this call are Unicode */
169 #if defined (UNICODE) || defined (__WINESRC__)
170 #define fMapiUnicode MAPI_UNICODE
171 #else
172 #define fMapiUnicode 0U
173 #endif
175 /* Types of message receivers */
176 #ifndef MAPI_ORIG
177 #define MAPI_ORIG 0 /* The original author */
178 #define MAPI_TO 1 /* The primary message receiver */
179 #define MAPI_CC 2 /* A carbon copy receiver */
180 #define MAPI_BCC 3 /* A blind carbon copy receiver */
181 #define MAPI_P1 0x10000000 /* A message resend */
182 #define MAPI_SUBMITTED 0x80000000 /* This message has already been sent */
183 #endif
185 #ifndef cchProfileNameMax
186 #define cchProfileNameMax 64 /* Maximum length of a profile name */
187 #define cchProfilePassMax 64 /* Maximum length of a profile password */
188 #endif
190 /* Properties: The are the contents of cells in MAPI tables, as well as the
191 * values returned when object properties are queried.
194 /* Property types */
195 #define PT_UNSPECIFIED 0U
196 #define PT_NULL 1U
197 #define PT_I2 2U
198 #define PT_SHORT PT_I2
199 #define PT_LONG 3U
200 #define PT_I4 PT_LONG
201 #define PT_R4 4U
202 #define PT_FLOAT PT_R4
203 #define PT_DOUBLE 5U
204 #define PT_R8 PT_DOUBLE
205 #define PT_CURRENCY 6U
206 #define PT_APPTIME 7U
207 #define PT_ERROR 10U
208 #define PT_BOOLEAN 11U
209 #define PT_OBJECT 13U
210 #define PT_I8 20U
211 #define PT_LONGLONG PT_I8
212 #define PT_STRING8 30U
213 #define PT_UNICODE 31U
214 #define PT_SYSTIME 64U
215 #define PT_CLSID 72U
216 #define PT_BINARY 258U
218 #define MV_FLAG 0x1000 /* This property type is multi-valued (an array) */
219 #define MV_INSTANCE 0x2000
220 #define MVI_FLAG (MV_FLAG|MV_INSTANCE)
221 #define MVI_PROP(t) ((t)|MVI_FLAG)
223 #ifndef __WINESRC__
224 # ifdef UNICODE
225 # define PT_TSTRING PT_UNICODE
226 # define PT_MV_TSTRING (MV_FLAG|PT_UNICODE)
227 # define LPSZ lpszW
228 # define LPPSZ lppszW
229 # define MVSZ MVszW
230 # else
231 # define PT_TSTRING PT_STRING8
232 # define PT_MV_TSTRING (MV_FLAG|PT_STRING8)
233 # define LPSZ lpszA
234 # define LPPSZ lppszA
235 # define MVSZ MVszA
236 # endif
237 #endif
239 #define PROP_TYPE_MASK 0xFFFFU
240 #define PROP_TYPE(t) ((t) & PROP_TYPE_MASK)
241 #define PROP_ID(t) ((t) >> 16)
242 #define PROP_TAG(t,id) (((id) << 16) | t)
243 #define PROP_ID_NULL 0
244 #define PROP_ID_INVALID 0xFFFF
245 #define PR_NULL PROP_TAG(PT_NULL, PROP_ID_NULL)
247 #define CHANGE_PROP_TYPE(t,typ) ((0xFFFF0000 & t) | typ)
249 /* Multi-valued property types */
250 #define PT_MV_I2 (MV_FLAG|PT_I2)
251 #define PT_MV_SHORT PT_MV_I2
252 #define PT_MV_LONG (MV_FLAG|PT_LONG)
253 #define PT_MV_I4 PT_MV_LONG
254 #define PT_MV_R4 (MV_FLAG|PT_R4)
255 #define PT_MV_FLOAT PT_MV_R4
256 #define PT_MV_DOUBLE (MV_FLAG|PT_DOUBLE)
257 #define PT_MV_R8 PT_MV_DOUBLE
258 #define PT_MV_CURRENCY (MV_FLAG|PT_CURRENCY)
259 #define PT_MV_APPTIME (MV_FLAG|PT_APPTIME)
260 #define PT_MV_SYSTIME (MV_FLAG|PT_SYSTIME)
261 #define PT_MV_STRING8 (MV_FLAG|PT_STRING8)
262 #define PT_MV_BINARY (MV_FLAG|PT_BINARY)
263 #define PT_MV_UNICODE (MV_FLAG|PT_UNICODE)
264 #define PT_MV_CLSID (MV_FLAG|PT_CLSID)
265 #define PT_MV_I8 (MV_FLAG|PT_I8)
266 #define PT_MV_LONGLONG PT_MV_I8
269 /* The property tag structure. This describes a list of columns */
270 typedef struct _SPropTagArray
272 ULONG cValues; /* Number of elements in aulPropTag */
273 ULONG aulPropTag[MAPI_DIM]; /* Property tags */
274 } SPropTagArray, *LPSPropTagArray;
276 #define CbNewSPropTagArray(c) (offsetof(SPropTagArray,aulPropTag)+(c)*sizeof(ULONG))
277 #define CbSPropTagArray(p) CbNewSPropTagArray((p)->cValues)
278 #define SizedSPropTagArray(n,id) \
279 struct _SPropTagArray_##id { ULONG cValues; ULONG aulPropTag[n]; } id
281 /* Multi-valued PT_APPTIME property value */
282 typedef struct _SAppTimeArray
284 ULONG cValues; /* Number of doubles in lpat */
285 double *lpat; /* Pointer to double array of length cValues */
286 } SAppTimeArray;
288 /* PT_BINARY property value */
289 typedef struct _SBinary
291 ULONG cb; /* Number of bytes in lpb */
292 LPBYTE lpb; /* Pointer to byte array of length cb */
293 } SBinary, *LPSBinary;
295 /* Multi-valued PT_BINARY property value */
296 typedef struct _SBinaryArray
298 ULONG cValues; /* Number of SBinarys in lpbin */
299 SBinary *lpbin; /* Pointer to SBinary array of length cValues */
300 } SBinaryArray;
302 typedef SBinaryArray ENTRYLIST, *LPENTRYLIST;
304 /* Multi-valued PT_CY property value */
305 typedef struct _SCurrencyArray
307 ULONG cValues; /* Number of CYs in lpcu */
308 CY *lpcur; /* Pointer to CY array of length cValues */
309 } SCurrencyArray;
311 /* Multi-valued PT_SYSTIME property value */
312 typedef struct _SDateTimeArray
314 ULONG cValues; /* Number of FILETIMEs in lpft */
315 FILETIME *lpft; /* Pointer to FILETIME array of length cValues */
316 } SDateTimeArray;
318 /* Multi-valued PT_DOUBLE property value */
319 typedef struct _SDoubleArray
321 ULONG cValues; /* Number of doubles in lpdbl */
322 double *lpdbl; /* Pointer to double array of length cValues */
323 } SDoubleArray;
325 /* Multi-valued PT_CLSID property value */
326 typedef struct _SGuidArray
328 ULONG cValues; /* Number of GUIDs in lpguid */
329 GUID *lpguid; /* Pointer to GUID array of length cValues */
330 } SGuidArray;
332 /* Multi-valued PT_LONGLONG property value */
333 typedef struct _SLargeIntegerArray
335 ULONG cValues; /* Number of long64s in lpli */
336 LARGE_INTEGER *lpli; /* Pointer to long64 array of length cValues */
337 } SLargeIntegerArray;
339 /* Multi-valued PT_LONG property value */
340 typedef struct _SLongArray
342 ULONG cValues; /* Number of longs in lpl */
343 LONG *lpl; /* Pointer to long array of length cValues */
344 } SLongArray;
346 /* Multi-valued PT_STRING8 property value */
347 typedef struct _SLPSTRArray
349 ULONG cValues; /* Number of Ascii strings in lppszA */
350 LPSTR *lppszA; /* Pointer to Ascii string array of length cValues */
351 } SLPSTRArray;
353 /* Multi-valued PT_FLOAT property value */
354 typedef struct _SRealArray
356 ULONG cValues; /* Number of floats in lpflt */
357 float *lpflt; /* Pointer to float array of length cValues */
358 } SRealArray;
360 /* Multi-valued PT_SHORT property value */
361 typedef struct _SShortArray
363 ULONG cValues; /* Number of shorts in lpb */
364 short int *lpi; /* Pointer to short array of length cValues */
365 } SShortArray;
367 /* Multi-valued PT_UNICODE property value */
368 typedef struct _SWStringArray
370 ULONG cValues; /* Number of Unicode strings in lppszW */
371 LPWSTR *lppszW; /* Pointer to Unicode string array of length cValues */
372 } SWStringArray;
374 /* A property value */
375 typedef union _PV
377 short int i;
378 LONG l;
379 ULONG ul;
380 float flt;
381 double dbl;
382 unsigned short b;
383 CY cur;
384 double at;
385 FILETIME ft;
386 LPSTR lpszA;
387 SBinary bin;
388 LPWSTR lpszW;
389 LPGUID lpguid;
390 LARGE_INTEGER li;
391 SShortArray MVi;
392 SLongArray MVl;
393 SRealArray MVflt;
394 SDoubleArray MVdbl;
395 SCurrencyArray MVcur;
396 SAppTimeArray MVat;
397 SDateTimeArray MVft;
398 SBinaryArray MVbin;
399 SLPSTRArray MVszA;
400 SWStringArray MVszW;
401 SGuidArray MVguid;
402 SLargeIntegerArray MVli;
403 SCODE err;
404 LONG x;
405 } __UPV;
407 /* Property value structure. This is essentially a mini-Variant */
408 typedef struct _SPropValue
410 ULONG ulPropTag; /* The property type */
411 ULONG dwAlignPad; /* Alignment, treat as reserved */
412 union _PV Value; /* The property value */
413 } SPropValue, *LPSPropValue;
415 /* Structure describing a table row (a collection of property values) */
416 typedef struct _SRow
418 ULONG ulAdrEntryPad; /* Padding, treat as reserved */
419 ULONG cValues; /* Count of property values in lpProbs */
420 LPSPropValue lpProps; /* Pointer to an array of property values of length cValues */
421 } SRow, *LPSRow;
423 /* Structure describing a set of table rows */
424 typedef struct _SRowSet
426 ULONG cRows; /* Count of rows in aRow */
427 SRow aRow[MAPI_DIM]; /* Array of rows of length cRows */
428 } SRowSet, *LPSRowSet;
430 #define CbNewSRowSet(c) (offsetof(SRowSet,aRow)+(c)*sizeof(SRow))
431 #define CbSRowSet(p) CbNewSRowSet((p)->cRows)
432 #define SizedSRowSet(n,id) \
433 struct _SRowSet_##id { ULONG cRows; SRow aRow[n]; } id
435 /* Structure describing a problem with a property */
436 typedef struct _SPropProblem
438 ULONG ulIndex; /* Index of the property */
439 ULONG ulPropTag; /* Proprty tag of the property */
440 SCODE scode; /* Error code of the problem */
441 } SPropProblem, *LPSPropProblem;
443 /* A collection of property problems */
444 typedef struct _SPropProblemArray
446 ULONG cProblem; /* Number of problems in aProblem */
447 SPropProblem aProblem[MAPI_DIM]; /* Array of problems of length cProblem */
448 } SPropProblemArray, *LPSPropProblemArray;
450 /* FPropContainsProp flags */
451 #define FL_FULLSTRING 0x00000ul /* Exact string match */
452 #define FL_SUBSTRING 0x00001ul /* Substring match */
453 #define FL_PREFIX 0x00002ul /* Prefix match */
454 #define FL_IGNORECASE 0x10000ul /* Case insensitive */
455 #define FL_IGNORENONSPACE 0x20000ul /* Ignore non spacing characters */
456 #define FL_LOOSE 0x40000ul /* Try very hard to match */
459 /* Table types returned by IMAPITable_GetStatus() */
460 #define TBLTYPE_SNAPSHOT 0U /* Table is fixed at creation time and contents do not change */
461 #define TBLTYPE_KEYSET 1U /* Table has a fixed number of rows, but row values may change */
462 #define TBLTYPE_DYNAMIC 2U /* Table values and the number of rows may change */
464 /* Table status returned by IMAPITable_GetStatus() */
465 #define TBLSTAT_COMPLETE 0U /* All operations have completed (normal status) */
466 #define TBLSTAT_QCHANGED 7U /* Table data has changed as expected */
467 #define TBLSTAT_SORTING 9U /* Table is being asynchronously sorted */
468 #define TBLSTAT_SORT_ERROR 10U /* An error occurred while sorting the table */
469 #define TBLSTAT_SETTING_COLS 11U /* Table columns are being asynchronously changed */
470 #define TBLSTAT_SETCOL_ERROR 13U /* An error occurred during column changing */
471 #define TBLSTAT_RESTRICTING 14U /* Table rows are being asynchronously restricted */
472 #define TBLSTAT_RESTRICT_ERROR 15U /* An error occurred during row restriction */
474 /* Flags for IMAPITable operations that can be asynchronous */
475 #define TBL_NOWAIT 1U /* Perform the operation asynchronously */
476 #define TBL_BATCH 2U /* Perform the operation when the results are needed */
477 #define TBL_ASYNC TBL_NOWAIT /* Synonym for TBL_NOWAIT */
479 /* Flags for IMAPITable_FindRow() */
480 #define DIR_BACKWARD 1U /* Read rows backwards from the start bookmark */
482 /* Table bookmarks */
483 typedef ULONG BOOKMARK;
485 #define BOOKMARK_BEGINNING ((BOOKMARK)0) /* The first row */
486 #define BOOKMARK_CURRENT ((BOOKMARK)1) /* The curent table row */
487 #define BOOKMARK_END ((BOOKMARK)2) /* The last row */
489 /* Row restrictions */
490 typedef struct _SRestriction* LPSRestriction;
492 typedef struct _SAndRestriction
494 ULONG cRes;
495 LPSRestriction lpRes;
496 } SAndRestriction;
498 typedef struct _SBitMaskRestriction
500 ULONG relBMR;
501 ULONG ulPropTag;
502 ULONG ulMask;
503 } SBitMaskRestriction;
505 typedef struct _SCommentRestriction
507 ULONG cValues;
508 LPSRestriction lpRes;
509 LPSPropValue lpProp;
510 } SCommentRestriction;
512 #define RELOP_LT 0U
513 #define RELOP_LE 1U
514 #define RELOP_GT 2U
515 #define RELOP_GE 3U
516 #define RELOP_EQ 4U
517 #define RELOP_NE 5U
518 #define RELOP_RE 6U
520 typedef struct _SComparePropsRestriction
522 ULONG relop;
523 ULONG ulPropTag1;
524 ULONG ulPropTag2;
525 } SComparePropsRestriction;
527 typedef struct _SContentRestriction
529 ULONG ulFuzzyLevel;
530 ULONG ulPropTag;
531 LPSPropValue lpProp;
532 } SContentRestriction;
534 typedef struct _SExistRestriction
536 ULONG ulReserved1;
537 ULONG ulPropTag;
538 ULONG ulReserved2;
539 } SExistRestriction;
541 typedef struct _SNotRestriction
543 ULONG ulReserved;
544 LPSRestriction lpRes;
545 } SNotRestriction;
547 typedef struct _SOrRestriction
549 ULONG cRes;
550 LPSRestriction lpRes;
551 } SOrRestriction;
553 typedef struct _SPropertyRestriction
555 ULONG relop;
556 ULONG ulPropTag;
557 LPSPropValue lpProp;
558 } SPropertyRestriction;
560 typedef struct _SSizeRestriction
562 ULONG relop;
563 ULONG ulPropTag;
564 ULONG cb;
565 } SSizeRestriction;
567 typedef struct _SSubRestriction
569 ULONG ulSubObject;
570 LPSRestriction lpRes;
571 } SSubRestriction;
573 /* Restriction types */
574 #define RES_AND 0U
575 #define RES_OR 1U
576 #define RES_NOT 2U
577 #define RES_CONTENT 3U
578 #define RES_PROPERTY 4U
579 #define RES_COMPAREPROPS 5U
580 #define RES_BITMASK 6U
581 #define RES_SIZE 7U
582 #define RES_EXIST 8U
583 #define RES_SUBRESTRICTION 9U
584 #define RES_COMMENT 10U
586 typedef struct _SRestriction
588 ULONG rt;
589 union
591 SAndRestriction resAnd;
592 SBitMaskRestriction resBitMask;
593 SCommentRestriction resComment;
594 SComparePropsRestriction resCompareProps;
595 SContentRestriction resContent;
596 SExistRestriction resExist;
597 SNotRestriction resNot;
598 SOrRestriction resOr;
599 SPropertyRestriction resProperty;
600 SSizeRestriction resSize;
601 SSubRestriction resSub;
602 } res;
603 } SRestriction;
605 /* Errors */
606 typedef struct _MAPIERROR
608 ULONG ulVersion; /* Mapi version */
609 #if defined (UNICODE) || defined (__WINESRC__)
610 LPWSTR lpszError; /* Error and component strings. These are Ascii */
611 LPWSTR lpszComponent; /* unless the MAPI_UNICODE flag is passed in */
612 #else
613 LPSTR lpszError;
614 LPSTR lpszComponent;
615 #endif
616 ULONG ulLowLevelError;
617 ULONG ulContext;
618 } MAPIERROR, *LPMAPIERROR;
620 /* Sorting */
621 #define TABLE_SORT_ASCEND 0U
622 #define TABLE_SORT_DESCEND 1U
623 #define TABLE_SORT_COMBINE 2U
625 typedef struct _SSortOrder
627 ULONG ulPropTag;
628 ULONG ulOrder;
629 } SSortOrder, *LPSSortOrder;
631 typedef struct _SSortOrderSet
633 ULONG cSorts;
634 ULONG cCategories;
635 ULONG cExpanded;
636 SSortOrder aSort[MAPI_DIM];
637 } SSortOrderSet, * LPSSortOrderSet;
639 #define MNID_ID 0
640 #define MNID_STRING 1
642 typedef struct _MAPINAMEID
644 LPGUID lpguid;
645 ULONG ulKind;
646 union
648 LONG lID;
649 LPWSTR lpwstrName;
650 } Kind;
651 } MAPINAMEID, *LPMAPINAMEID;
653 /* Desired notification types (bitflags) */
654 #define fnevCriticalError 0x00000001UL
655 #define fnevNewMail 0x00000002UL
656 #define fnevObjectCreated 0x00000004UL
657 #define fnevObjectDeleted 0x00000008UL
658 #define fnevObjectModified 0x00000010UL
659 #define fnevObjectMoved 0x00000020UL
660 #define fnevObjectCopied 0x00000040UL
661 #define fnevSearchComplete 0x00000080UL
662 #define fnevTableModified 0x00000100UL
663 #define fnevStatusObjectModified 0x00000200UL
664 #define fnevReservedForMapi 0x40000000UL
665 #define fnevExtended 0x80000000UL
667 /* Type of notification event */
668 #define TABLE_CHANGED 1U
669 #define TABLE_ERROR 2U
670 #define TABLE_ROW_ADDED 3U
671 #define TABLE_ROW_DELETED 4U
672 #define TABLE_ROW_MODIFIED 5U
673 #define TABLE_SORT_DONE 6U
674 #define TABLE_RESTRICT_DONE 7U
675 #define TABLE_SETCOL_DONE 8U
676 #define TABLE_RELOAD 9U
678 /* fnevCriticalError notification */
679 typedef struct _ERROR_NOTIFICATION
681 ULONG cbEntryID;
682 LPENTRYID lpEntryID;
683 SCODE scode;
684 ULONG ulFlags;
685 LPMAPIERROR lpMAPIError;
686 } ERROR_NOTIFICATION;
688 /* fnevNewMail notification */
689 typedef struct _NEWMAIL_NOTIFICATION
691 ULONG cbEntryID;
692 LPENTRYID lpEntryID;
693 ULONG cbParentID;
694 LPENTRYID lpParentID;
695 ULONG ulFlags;
696 #if defined (UNICODE) || defined (__WINESRC__)
697 LPWSTR lpszMessageClass;
698 #else
699 LPSTR lpszMessageClass;
700 #endif
701 ULONG ulMessageFlags;
702 } NEWMAIL_NOTIFICATION;
704 /* fnevObjectCreated/Deleted/Modified/Moved/Copied notification */
705 typedef struct _OBJECT_NOTIFICATION
707 ULONG cbEntryID;
708 LPENTRYID lpEntryID;
709 ULONG ulObjType;
710 ULONG cbParentID;
711 LPENTRYID lpParentID;
712 ULONG cbOldID;
713 LPENTRYID lpOldID;
714 ULONG cbOldParentID;
715 LPENTRYID lpOldParentID;
716 LPSPropTagArray lpPropTagArray;
717 } OBJECT_NOTIFICATION;
719 /* fnevTableModified notification */
720 typedef struct _TABLE_NOTIFICATION
722 ULONG ulTableEvent;
723 HRESULT hResult;
724 SPropValue propIndex;
725 SPropValue propPrior;
726 SRow row;
727 ULONG ulPad;
728 } TABLE_NOTIFICATION;
730 /* fnevExtended notification */
731 typedef struct _EXTENDED_NOTIFICATION
733 ULONG ulEvent;
734 ULONG cb;
735 LPBYTE pbEventParameters;
736 } EXTENDED_NOTIFICATION;
738 /* fnevStatusObjectModified notification */
739 typedef struct
741 ULONG cbEntryID;
742 LPENTRYID lpEntryID;
743 ULONG cValues;
744 LPSPropValue lpPropVals;
745 } STATUS_OBJECT_NOTIFICATION;
747 /* The notification structure passed to advise sinks */
748 typedef struct _NOTIFICATION
750 ULONG ulEventType;
751 ULONG ulAlignPad;
752 union
754 ERROR_NOTIFICATION err;
755 NEWMAIL_NOTIFICATION newmail;
756 OBJECT_NOTIFICATION obj;
757 TABLE_NOTIFICATION tab;
758 EXTENDED_NOTIFICATION ext;
759 STATUS_OBJECT_NOTIFICATION statobj;
760 } info;
761 } NOTIFICATION, *LPNOTIFICATION;
763 typedef LONG (WINAPI NOTIFCALLBACK)(LPVOID,ULONG,LPNOTIFICATION);
764 typedef NOTIFCALLBACK *LPNOTIFCALLBACK;
766 /*****************************************************************************
767 * IMAPITable interface
769 * This is the read-only 'view' over an I(MAPI)TableData object.
771 #define INTERFACE IMAPITable
772 DECLARE_INTERFACE_(IMAPITable,IUnknown)
774 /*** IUnknown methods ***/
775 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
776 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
777 STDMETHOD_(ULONG,Release)(THIS) PURE;
778 /*** IMAPITable methods ***/
779 STDMETHOD(GetLastError)(THIS_ HRESULT hRes, ULONG ulFlags, LPMAPIERROR *lppError) PURE;
780 STDMETHOD(Advise)(THIS_ ULONG ulMask, LPMAPIADVISESINK lpSink, ULONG *lpCxn) PURE;
781 STDMETHOD(Unadvise)(THIS_ ULONG ulCxn) PURE;
782 STDMETHOD(GetStatus)(THIS_ ULONG *lpStatus, ULONG *lpType) PURE;
783 STDMETHOD(SetColumns)(THIS_ LPSPropTagArray lpProps, ULONG ulFlags) PURE;
784 STDMETHOD(QueryColumns)(THIS_ ULONG ulFlags, LPSPropTagArray *lpCols) PURE;
785 STDMETHOD(GetRowCount)(THIS_ ULONG ulFlags, ULONG *lpCount) PURE;
786 STDMETHOD(SeekRow)(THIS_ BOOKMARK lpStart, LONG lRows, LONG *lpSeeked) PURE;
787 STDMETHOD(SeekRowApprox)(THIS_ ULONG ulNum, ULONG ulDenom) PURE;
788 STDMETHOD(QueryPosition)(THIS_ ULONG *lpRow, ULONG *lpNum, ULONG *lpDenom) PURE;
789 STDMETHOD(FindRow)(THIS_ LPSRestriction lpRestrict, BOOKMARK lpOrigin, ULONG ulFlags) PURE;
790 STDMETHOD(Restrict)(THIS_ LPSRestriction lpRestrict, ULONG ulFlags) PURE;
791 STDMETHOD(CreateBookmark)(THIS_ BOOKMARK *lppPos) PURE;
792 STDMETHOD(FreeBookmark)(THIS_ BOOKMARK lpPos) PURE;
793 STDMETHOD(SortTable)(THIS_ LPSSortOrderSet lpSortOpts, ULONG ulFlags) PURE;
794 STDMETHOD(QuerySortOrder)(THIS_ LPSSortOrderSet *lppSortOpts) PURE;
795 STDMETHOD(QueryRows)(THIS_ LONG lRows, ULONG ulFlags, LPSRowSet *lppRows) PURE;
796 STDMETHOD(Abort) (THIS) PURE;
797 STDMETHOD(ExpandRow)(THIS_ ULONG cbKey, LPBYTE lpKey, ULONG ulRows,
798 ULONG ulFlags, LPSRowSet *lppRows, ULONG *lpMore) PURE;
799 STDMETHOD(CollapseRow)(THIS_ ULONG cbKey, LPBYTE lpKey, ULONG ulFlags, ULONG *lpRows) PURE;
800 STDMETHOD(WaitForCompletion)(THIS_ ULONG ulFlags, ULONG ulTime, ULONG *lpState) PURE;
801 STDMETHOD(GetCollapseState)(THIS_ ULONG ulFlags, ULONG cbKey, LPBYTE lpKey,
802 ULONG *lpStateLen, LPBYTE *lpState) PURE;
803 STDMETHOD(SetCollapseState)(THIS_ ULONG ulFlags, ULONG ulLen,
804 LPBYTE lpStart, BOOKMARK *lppWhere) PURE;
806 #undef INTERFACE
808 #if !defined(__cplusplus) || defined(CINTERFACE)
809 /*** IUnknown methods ***/
810 #define IMAPITable_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
811 #define IMAPITable_AddRef(p) (p)->lpVtbl->AddRef(p)
812 #define IMAPITable_Release(p) (p)->lpVtbl->Release(p)
813 /*** IMAPITable methods ***/
814 #define IMAPITable_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c)
815 #define IMAPITable_Advise(p,a,b,c) (p)->lpVtbl->Advise(p,a,b,c)
816 #define IMAPITable_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a)
817 #define IMAPITable_GetStatus(p,a,b) (p)->lpVtbl->GetStatus(p,a,b)
818 #define IMAPITable_SetColumns(p,a,b) (p)->lpVtbl->SetColumns(p,a,b)
819 #define IMAPITable_QueryColumns(p,a,b) (p)->lpVtbl->QueryColumns(p,a,b)
820 #define IMAPITable_GetRowCount(p,a,b) (p)->lpVtbl->GetRowCount(p,a,b)
821 #define IMAPITable_SeekRow(p,a,b) (p)->lpVtbl->SeekRow(p,a,b)
822 #define IMAPITable_SeekRowApprox(p,a,b) (p)->lpVtbl->SeekRowApprox(p,a,b)
823 #define IMAPITable_QueryPosition(p,a,b) (p)->lpVtbl->QueryPosition(p,a,b)
824 #define IMAPITable_FindRow(p,a,b,c) (p)->lpVtbl->FindRow(p,a,b,c)
825 #define IMAPITable_Restrict(p,a,b) (p)->lpVtbl->Recstrict(p,a,b)
826 #define IMAPITable_CreateBookmark(p,a) (p)->lpVtbl->CreateBookmark(p,a)
827 #define IMAPITable_FreeBookmark(p,a) (p)->lpVtbl->FreeBookmark(p,a)
828 #define IMAPITable_SortTable(p,a,b) (p)->lpVtbl->SortTable(p,a,b)
829 #define IMAPITable_QuerySortOrder(p,a) (p)->lpVtbl->QuerySortOrder(p,a)
830 #define IMAPITable_QueryRows(p,a,b,c) (p)->lpVtbl->QueryRows(p,a,b,c)
831 #define IMAPITable_Abort(p) (p)->lpVtbl->Abort(p)
832 #define IMAPITable_ExpandRow(p,a,b,c,d,e,f) (p)->lpVtbl->ExpandRow(p,a,b,c,d,e,f)
833 #define IMAPITable_CollapseRow(p,a,b,c,d) (p)->lpVtbl->CollapseRow(p,a,b,c,d)
834 #define IMAPITable_WaitForCompletion(p,a,b,c) (p)->lpVtbl->WaitForCompletion(p,a,b,c)
835 #define IMAPITable_GetCollapseState(p,a,b,c,d,e) (p)->lpVtbl->GetCollapseState(p,a,b,c,d,e)
836 #define IMAPITable_SetCollapseState(p,a,b,c,d) (p)->lpVtbl->SetCollapseState(p,a,b,c,d)
837 #endif
839 typedef IMAPITable *LPMAPITABLE;
841 /*****************************************************************************
842 * IMAPIAdviseSink interface
844 #define INTERFACE IMAPIAdviseSink
845 DECLARE_INTERFACE_(IMAPIAdviseSink,IUnknown)
847 /*** IUnknown methods ***/
848 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
849 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
850 STDMETHOD_(ULONG,Release)(THIS) PURE;
851 /*** IMAPIAdviseSink methods ***/
852 STDMETHOD(OnNotify)(THIS_ ULONG NumNotif, LPNOTIFICATION lpNotif) PURE;
854 #undef INTERFACE
856 #if !defined(__cplusplus) || defined(CINTERFACE)
857 /*** IUnknown methods ***/
858 #define IMAPIAdviseSink_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
859 #define IMAPIAdviseSink_AddRef(p) (p)->lpVtbl->AddRef(p)
860 #define IMAPIAdviseSink_Release(p) (p)->lpVtbl->Release(p)
861 /*** IMAPIAdviseSink methods ***/
862 #define IMAPIAdviseSink_OnNotify(p,a,b) (p)->lpVtbl->OnNotify(p,a,b)
863 #endif
865 /*****************************************************************************
866 * IMAPIProp interface
868 #define INTERFACE IMAPIProp
869 DECLARE_INTERFACE_(IMAPIProp,IUnknown)
871 /*** IUnknown methods ***/
872 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
873 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
874 STDMETHOD_(ULONG,Release)(THIS) PURE;
875 /*** IMAPIProp methods ***/
876 STDMETHOD(GetLastError)(THIS_ HRESULT hRes, ULONG ulFlags, LPMAPIERROR *lppErr) PURE;
877 STDMETHOD(SaveChanges)(THIS_ ULONG ulFlags) PURE;
878 STDMETHOD(GetProps)(THIS_ LPSPropTagArray lpPropTags, ULONG ulFlags, ULONG *lpValues, LPSPropValue *lppProps) PURE;
879 STDMETHOD(GetPropList)(THIS_ ULONG ulFlags, LPSPropTagArray *lppPropTagArray) PURE;
880 STDMETHOD(OpenProperty)(THIS_ ULONG ulPropTag, LPCIID lpIid, ULONG ulOpts, ULONG ulFlags, LPUNKNOWN *lppUnk) PURE;
881 STDMETHOD(SetProps)(THIS_ ULONG cValues, LPSPropValue lpProps, LPSPropProblemArray *lppProbs) PURE;
882 STDMETHOD(DeleteProps)(THIS_ LPSPropTagArray lpPropTags, LPSPropProblemArray *lppProbs) PURE;
883 STDMETHOD(CopyTo)(THIS_ ULONG ciidExclude, LPCIID lpIid, LPSPropTagArray lpProps, ULONG ulParam,
884 LPMAPIPROGRESS lpProgress, LPCIID lpIface,LPVOID lpDest, ULONG ulFlags,
885 LPSPropProblemArray *lppProbs) PURE;
886 STDMETHOD(CopyProps)(THIS_ LPSPropTagArray lpIncludeProps, ULONG ulParam, LPMAPIPROGRESS lpProgress,
887 LPCIID lpIid, LPVOID lpDestObj, ULONG ulFlags, LPSPropProblemArray *lppProblems) PURE;
888 STDMETHOD(GetNamesFromIDs)(THIS_ LPSPropTagArray *lppPropTags, LPGUID lpIid, ULONG ulFlags, ULONG *lpCount,
889 LPMAPINAMEID **lpppNames) PURE;
890 STDMETHOD(GetIDsFromNames)(THIS_ ULONG cPropNames, LPMAPINAMEID *lppNames, ULONG ulFlags, LPSPropTagArray *lppPropTags) PURE;
892 #undef INTERFACE
894 #if !defined(__cplusplus) || defined(CINTERFACE)
895 /*** IUnknown methods ***/
896 #define IMAPIProp_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
897 #define IMAPIProp_AddRef(p) (p)->lpVtbl->AddRef(p)
898 #define IMAPIProp_Release(p) (p)->lpVtbl->Release(p)
899 /*** IMAPIProp methods ***/
900 #define IMAPIProp_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c)
901 #define IMAPIProp_SaveChanges(p,a) (p)->lpVtbl->SaveChanges(p,a)
902 #define IMAPIProp_GetProps(p,a,b,c,d) (p)->lpVtbl->GetProps(p,a,b,c,d)
903 #define IMAPIProp_GetPropList(p,a,b) (p)->lpVtbl->GetPropList(p,a,b)
904 #define IMAPIProp_OpenProperty(p,a,b,c,d,e) (p)->lpVtbl->OpenProperty(p,a,b,c,d,e)
905 #define IMAPIProp_SetProps(p,a,b,c) (p)->lpVtbl->SetProps(p,a,b,c)
906 #define IMAPIProp_DeleteProps(p,a,b) (p)->lpVtbl->DeleteProps(p,a,b)
907 #define IMAPIProp_CopyTo(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CopyTo(p,a,b,c,d,e,f,g,h,i)
908 #define IMAPIProp_CopyProps(p,a,b,c,d,e,f,g) (p)->lpVtbl->CopyProps(p,a,b,c,d,e,f,g)
909 #define IMAPIProp_GetNamesFromIDs(p,a,b,c,d,e) (p)->lpVtbl->GetNamesFromIDs(p,a,b,c,d,e)
910 #define IMAPIProp_GetIDsFromNames(p,a,b,c,d) (p)->lpVtbl->GetIDsFromNames(p,a,b,c,d)
911 #endif
913 typedef IMAPIProp *LPMAPIPROP;
915 typedef struct
917 ULONG cb;
918 BYTE abEntry[MAPI_DIM];
919 } FLATENTRY, *LPFLATENTRY;
921 typedef struct
923 ULONG cEntries;
924 ULONG cbEntries;
925 BYTE abEntries[MAPI_DIM];
926 } FLATENTRYLIST, *LPFLATENTRYLIST;
928 typedef struct
930 ULONG cb;
931 BYTE ab[MAPI_DIM];
932 } MTSID, *LPMTSID;
934 typedef struct
936 ULONG cMTSIDs;
937 ULONG cbMTSIDs;
938 BYTE abMTSIDs[MAPI_DIM];
939 } FLATMTSIDLIST, *LPFLATMTSIDLIST;
941 typedef struct _ADRENTRY
943 ULONG ulReserved1;
944 ULONG cValues;
945 LPSPropValue rgPropVals;
946 } ADRENTRY, *LPADRENTRY;
948 typedef struct _ADRLIST
950 ULONG cEntries;
951 ADRENTRY aEntries[MAPI_DIM];
952 } ADRLIST, *LPADRLIST;
954 #endif /*MAPIDEFS_H*/