home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / MAPIDEFS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-08  |  100.3 KB  |  2,632 lines

  1. #if !defined(__TOPLEVEL_NEXT_COMMON_INCLUDE__)
  2. #define __TOPLEVEL_NEXT_COMMON_INCLUDE__
  3. #define __TOPLEVEL_MAPIDEFS_H_ 
  4. #include <next_common_defines.h>
  5. #endif /* __TOPLEVEL_NEXT_COMMON_INCLUDE__ */
  6.  
  7. /*
  8.  *  M A P I D E F S . H
  9.  *
  10.  *  Definitions used by MAPI clients and service providers.
  11.  *
  12.  *  Copyright 1993-1995 Microsoft Corporation. All Rights Reserved.
  13.  */
  14.  
  15. #ifndef MAPIDEFS_H
  16. #define MAPIDEFS_H
  17.  
  18. #ifndef DUMMYUNIONNAME
  19. #ifdef NONAMELESSUNION
  20. #define DUMMYUNIONNAME   u
  21. #define DUMMYUNIONNAME2  u2
  22. #define DUMMYUNIONNAME3  u3
  23. #else
  24. #define DUMMYUNIONNAME
  25. #define DUMMYUNIONNAME2
  26. #define DUMMYUNIONNAME3
  27. #endif
  28. #endif // DUMMYUNIONNAME
  29.  
  30. #if defined (WIN32) && !defined (_MAC)  /* Must include WINDOWS.H on Win32 */
  31. #ifndef _WINDOWS_
  32. #define INC_OLE2 /* Get the OLE2 stuff */
  33. #define INC_RPC  /* harmless on Windows NT; Windows 95 needs it */
  34. #define _INC_OLE /* Windows 95 will include OLE1 without this */
  35. #include <windows.h>
  36. #endif
  37.  
  38. #ifndef _WINERROR_
  39. #include <winerror.h>
  40. #endif
  41. #ifndef _OBJBASE_H_
  42. #include <objbase.h>
  43. #endif
  44. #endif
  45.  
  46. #if defined (WIN16) || defined (DOS) || defined (DOS16) || defined (_MAC)
  47. #ifndef _COMPOBJ_H_
  48. #include <compobj.h>
  49. #endif
  50. #endif
  51.  
  52. #ifndef _INC_STDDEF
  53. #include <stddef.h>
  54. #endif
  55.  
  56. /* Array dimension for structures with variable-sized arrays at the end. */
  57.  
  58. #ifndef MAPI_DIM
  59. #define MAPI_DIM    1
  60. #endif
  61.  
  62. /* Provider init type. Force to cdecl always */
  63.  
  64. #ifndef STDMAPIINITCALLTYPE
  65. #if !defined (_MAC) && defined (WIN32)
  66. #define STDMAPIINITCALLTYPE     __cdecl
  67. #else
  68. #define STDMAPIINITCALLTYPE     STDMETHODCALLTYPE
  69. #endif
  70. #define STDINITMETHODIMP        HRESULT STDMAPIINITCALLTYPE
  71. #define STDINITMETHODIMP_(type) type STDMAPIINITCALLTYPE
  72. #endif
  73.  
  74. #ifdef  __cplusplus
  75. extern "C" {
  76. #endif
  77.  
  78. /* Simple data types */
  79.  
  80.  
  81. typedef WORD                WCHAR;
  82.  
  83. #ifdef UNICODE
  84. typedef WCHAR               TCHAR;
  85. #else
  86. typedef char                TCHAR;
  87. #endif
  88.  
  89. typedef WCHAR FAR *         LPWSTR;
  90. typedef const WCHAR FAR *   LPCWSTR;
  91. typedef TCHAR FAR *         LPTSTR;
  92. typedef const TCHAR FAR *   LPCTSTR;
  93. typedef BYTE FAR *          LPBYTE;
  94. typedef ULONG FAR *         LPULONG;
  95.  
  96. #ifndef __LHANDLE
  97. #define __LHANDLE
  98. typedef unsigned long   LHANDLE, FAR * LPLHANDLE;
  99. #endif
  100.  
  101. #if !defined(_WINBASE_) && !defined(_FILETIME_)
  102. #define _FILETIME_
  103. typedef struct _FILETIME
  104. {
  105.     DWORD dwLowDateTime;
  106.     DWORD dwHighDateTime;
  107. } FILETIME, FAR * LPFILETIME;
  108. #endif
  109.  
  110. #ifndef BEGIN_INTERFACE
  111. #define BEGIN_INTERFACE
  112. #endif
  113.  
  114. /*
  115.  *  This flag is used in many different MAPI calls to signify that
  116.  *  the object opened by the call should be modifiable (MAPI_MODIFY).
  117.  *  If the flag MAPI_MAX_ACCESS is set, the object returned should be
  118.  *  returned at the maximum access level allowed.  An additional
  119.  *  property available on the object (PR_ACCESS_LEVEL) uses the same
  120.  *  MAPI_MODIFY flag to say just what this new access level is.
  121.  */
  122.  
  123. #define MAPI_MODIFY             ((ULONG) 0x00000001)
  124.  
  125. /*
  126.  *  The following flags are used to indicate to the client what access
  127.  *  level is permissible in the object. They appear in PR_ACCESS in
  128.  *  message and folder objects as well as in contents and associated
  129.  *  contents tables
  130.  */
  131.  
  132. #define MAPI_ACCESS_MODIFY                  ((ULONG) 0x00000001)
  133. #define MAPI_ACCESS_READ                    ((ULONG) 0x00000002)
  134. #define MAPI_ACCESS_DELETE                  ((ULONG) 0x00000004)
  135. #define MAPI_ACCESS_CREATE_HIERARCHY        ((ULONG) 0x00000008)
  136. #define MAPI_ACCESS_CREATE_CONTENTS         ((ULONG) 0x00000010)
  137. #define MAPI_ACCESS_CREATE_ASSOCIATED       ((ULONG) 0x00000020)
  138.  
  139. /*
  140.  *  The MAPI_UNICODE flag is used in many different MAPI calls to signify
  141.  *  that strings passed through the interface are in Unicode (a 16-bit
  142.  *  character set). The default is an 8-bit character set.
  143.  *
  144.  *  The value fMapiUnicode can be used as the 'normal' value for
  145.  *  that bit, given the application's default character set.
  146.  */
  147.  
  148. #define MAPI_UNICODE            ((ULONG) 0x80000000)
  149.  
  150. #ifdef UNICODE
  151. #define fMapiUnicode            MAPI_UNICODE
  152. #else
  153. #define fMapiUnicode            0
  154. #endif
  155.  
  156. /* successful HRESULT */
  157. #define hrSuccess               0
  158.  
  159.  
  160.  
  161. /* Recipient types */
  162. #ifndef MAPI_ORIG               /* also defined in mapi.h */
  163. #define MAPI_ORIG   0           /* Recipient is message originator          */
  164. #define MAPI_TO     1           /* Recipient is a primary recipient         */
  165. #define MAPI_CC     2           /* Recipient is a copy recipient            */
  166. #define MAPI_BCC    3           /* Recipient is blind copy recipient        */
  167. #define MAPI_P1     0x10000000  /* Recipient is a P1 resend recipient       */
  168. #define MAPI_SUBMITTED 0x80000000 /* Recipient is already processed         */
  169. /* #define MAPI_AUTHORIZE 4        recipient is a CMC authorizing user      */
  170. /*#define MAPI_DISCRETE 0x10000000 Recipient is a P1 resend recipient       */
  171. #endif
  172.  
  173. /* Bit definitions for abFlags[0] of ENTRYID */
  174. #define MAPI_SHORTTERM          0x80
  175. #define MAPI_NOTRECIP           0x40
  176. #define MAPI_THISSESSION        0x20
  177. #define MAPI_NOW                0x10
  178. #define MAPI_NOTRESERVED        0x08
  179.  
  180. /* Bit definitions for abFlags[1] of ENTRYID */
  181. #define MAPI_COMPOUND           0x80
  182.  
  183. /* ENTRYID */
  184. typedef struct
  185. {
  186.     BYTE    abFlags[4];
  187.     BYTE    ab[MAPI_DIM];
  188. } ENTRYID, FAR *LPENTRYID;
  189.  
  190. #define CbNewENTRYID(_cb)       (offsetof(ENTRYID,ab) + (_cb))
  191. #define CbENTRYID(_cb)          (offsetof(ENTRYID,ab) + (_cb))
  192. #define SizedENTRYID(_cb, _name) \
  193.     struct _ENTRYID_ ## _name \
  194. { \
  195.     BYTE    abFlags[4]; \
  196.     BYTE    ab[_cb]; \
  197. } _name
  198.  
  199. /* Byte-order-independent version of GUID (world-unique identifier) */
  200. typedef struct _MAPIUID
  201. {
  202.     BYTE ab[16];
  203. } MAPIUID, FAR * LPMAPIUID;
  204.  
  205. /* Note:  need to include C run-times (memory.h) to use this macro */
  206.  
  207. #define IsEqualMAPIUID(lpuid1, lpuid2)  (!memcmp(lpuid1, lpuid2, sizeof(MAPIUID)))
  208.  
  209.  
  210. /* Object type */
  211.  
  212. #define MAPI_STORE      ((ULONG) 0x00000001)    /* Message Store */
  213. #define MAPI_ADDRBOOK   ((ULONG) 0x00000002)    /* Address Book */
  214. #define MAPI_FOLDER     ((ULONG) 0x00000003)    /* Folder */
  215. #define MAPI_ABCONT     ((ULONG) 0x00000004)    /* Address Book Container */
  216. #define MAPI_MESSAGE    ((ULONG) 0x00000005)    /* Message */
  217. #define MAPI_MAILUSER   ((ULONG) 0x00000006)    /* Individual Recipient */
  218. #define MAPI_ATTACH     ((ULONG) 0x00000007)    /* Attachment */
  219. #define MAPI_DISTLIST   ((ULONG) 0x00000008)    /* Distribution List Recipient */
  220. #define MAPI_PROFSECT   ((ULONG) 0x00000009)    /* Profile Section */
  221. #define MAPI_STATUS     ((ULONG) 0x0000000A)    /* Status Object */
  222. #define MAPI_SESSION    ((ULONG) 0x0000000B)    /* Session */
  223. #define MAPI_FORMINFO   ((ULONG) 0x0000000C)    /* Form Information */
  224.  
  225.  
  226. /*
  227.  *  Maximum length of profile names and passwords, not including
  228.  *  the null termination character.
  229.  */
  230. #ifndef cchProfileNameMax
  231. #define cchProfileNameMax   64
  232. #define cchProfilePassMax   64
  233. #endif
  234.  
  235.  
  236. /* Property Types */
  237.  
  238. #define MV_FLAG         0x1000          /* Multi-value flag */
  239.  
  240. #define PT_UNSPECIFIED  ((ULONG)  0)    /* (Reserved for interface use) type doesn't matter to caller */
  241. #define PT_NULL         ((ULONG)  1)    /* NULL property value */
  242. #define PT_I2           ((ULONG)  2)    /* Signed 16-bit value */
  243. #define PT_LONG         ((ULONG)  3)    /* Signed 32-bit value */
  244. #define PT_R4           ((ULONG)  4)    /* 4-byte floating point */
  245. #define PT_DOUBLE       ((ULONG)  5)    /* Floating point double */
  246. #define PT_CURRENCY     ((ULONG)  6)    /* Signed 64-bit int (decimal w/    4 digits right of decimal pt) */
  247. #define PT_APPTIME      ((ULONG)  7)    /* Application time */
  248. #define PT_ERROR        ((ULONG) 10)    /* 32-bit error value */
  249. #define PT_BOOLEAN      ((ULONG) 11)    /* 16-bit boolean (non-zero true) */
  250. #define PT_OBJECT       ((ULONG) 13)    /* Embedded object in a property */
  251. #define PT_I8           ((ULONG) 20)    /* 8-byte signed integer */
  252. #define PT_STRING8      ((ULONG) 30)    /* Null terminated 8-bit character string */
  253. #define PT_UNICODE      ((ULONG) 31)    /* Null terminated Unicode string */
  254. #define PT_SYSTIME      ((ULONG) 64)    /* FILETIME 64-bit int w/ number of 100ns periods since Jan 1,1601 */
  255. #define PT_CLSID        ((ULONG) 72)    /* OLE GUID */
  256. #define PT_BINARY       ((ULONG) 258)   /* Uninterpreted (counted byte array) */
  257. /* Changes are likely to these numbers, and to their structures. */
  258.  
  259. /* Alternate property type names for ease of use */
  260. #define PT_SHORT    PT_I2
  261. #define PT_I4       PT_LONG
  262. #define PT_FLOAT    PT_R4
  263. #define PT_R8       PT_DOUBLE
  264. #define PT_LONGLONG PT_I8
  265.  
  266. /*
  267.  *  The type of a MAPI-defined string property is indirected, so
  268.  *  that it defaults to Unicode string on a Unicode platform and to
  269.  *  String8 on an ANSI or DBCS platform.
  270.  *
  271.  *  Macros are defined here both for the property type, and for the
  272.  *  field of the property value structure which should be
  273.  *  dereferenced to obtain the string pointer.
  274.  */
  275.  
  276. #ifdef  UNICODE
  277. #define PT_TSTRING          PT_UNICODE
  278. #define PT_MV_TSTRING       (MV_FLAG|PT_UNICODE)
  279. #define LPSZ                lpszW
  280. #define LPPSZ               lppszW
  281. #define MVSZ                MVszW
  282. #else
  283. #define PT_TSTRING          PT_STRING8
  284. #define PT_MV_TSTRING       (MV_FLAG|PT_STRING8)
  285. #define LPSZ                lpszA
  286. #define LPPSZ               lppszA
  287. #define MVSZ                MVszA
  288. #endif
  289.  
  290.  
  291. /* Property Tags
  292.  *
  293.  * By convention, MAPI never uses 0 or FFFF as a property ID.
  294.  * Use as null values, initializers, sentinels, or what have you.
  295.  */
  296.  
  297. #define PROP_TYPE_MASK          ((ULONG)0x0000FFFF) /* Mask for Property type */
  298. #define PROP_TYPE(ulPropTag)    (((ULONG)(ulPropTag))&PROP_TYPE_MASK)
  299. #define PROP_ID(ulPropTag)      (((ULONG)(ulPropTag))>>16)
  300. #define PROP_TAG(ulPropType,ulPropID)   ((((ULONG)(ulPropID))<<16)|((ULONG)(ulPropType)))
  301. #define PROP_ID_NULL            0
  302. #define PROP_ID_INVALID         0xFFFF
  303. #define PR_NULL                 PROP_TAG( PT_NULL, PROP_ID_NULL)
  304. #define CHANGE_PROP_TYPE(ulPropTag, ulPropType) \
  305.                         (((ULONG)0xFFFF0000 & ulPropTag) | ulPropType)
  306.  
  307.  
  308. /* Multi-valued Property Types */
  309.  
  310. #define PT_MV_I2        (MV_FLAG|PT_I2)
  311. #define PT_MV_LONG      (MV_FLAG|PT_LONG)
  312. #define PT_MV_R4        (MV_FLAG|PT_R4)
  313. #define PT_MV_DOUBLE    (MV_FLAG|PT_DOUBLE)
  314. #define PT_MV_CURRENCY  (MV_FLAG|PT_CURRENCY)
  315. #define PT_MV_APPTIME   (MV_FLAG|PT_APPTIME)
  316. #define PT_MV_SYSTIME   (MV_FLAG|PT_SYSTIME)
  317. #define PT_MV_STRING8   (MV_FLAG|PT_STRING8)
  318. #define PT_MV_BINARY    (MV_FLAG|PT_BINARY)
  319. #define PT_MV_UNICODE   (MV_FLAG|PT_UNICODE)
  320. #define PT_MV_CLSID     (MV_FLAG|PT_CLSID)
  321. #define PT_MV_I8        (MV_FLAG|PT_I8)
  322.  
  323. /* Alternate property type names for ease of use */
  324. #define PT_MV_SHORT     PT_MV_I2
  325. #define PT_MV_I4        PT_MV_LONG
  326. #define PT_MV_FLOAT     PT_MV_R4
  327. #define PT_MV_R8        PT_MV_DOUBLE
  328. #define PT_MV_LONGLONG  PT_MV_I8
  329.  
  330. /*
  331.  *  Property type reserved bits
  332.  *
  333.  *  MV_INSTANCE is used as a flag in table operations to request
  334.  *  that a multi-valued property be presented as a single-valued
  335.  *  property appearing in multiple rows.
  336.  */
  337.  
  338. #define MV_INSTANCE     0x2000
  339. #define MVI_FLAG        (MV_FLAG | MV_INSTANCE)
  340. #define MVI_PROP(tag)   ((tag) | MVI_FLAG)
  341.  
  342. /* --------------- */
  343. /* Data Structures */
  344. /* --------------- */
  345.  
  346. /* Property Tag Array */
  347.  
  348. typedef struct _SPropTagArray
  349. {
  350.     ULONG   cValues;
  351.     ULONG   aulPropTag[MAPI_DIM];
  352. } SPropTagArray, FAR * LPSPropTagArray;
  353.  
  354. #define CbNewSPropTagArray(_ctag) \
  355.     (offsetof(SPropTagArray,aulPropTag) + (_ctag)*sizeof(ULONG))
  356. #define CbSPropTagArray(_lparray) \
  357.     (offsetof(SPropTagArray,aulPropTag) + \
  358.     (UINT)((_lparray)->cValues)*sizeof(ULONG))
  359. /*  SPropTagArray */
  360. #define SizedSPropTagArray(_ctag, _name) \
  361. struct _SPropTagArray_ ## _name \
  362. { \
  363.     ULONG   cValues; \
  364.     ULONG   aulPropTag[_ctag]; \
  365. } _name
  366.  
  367. /* -------------- */
  368. /* Property Value */
  369. /* -------------- */
  370.  
  371. typedef struct _SPropValue  SPropValue;
  372.  
  373.  
  374. /* 32-bit CURRENCY definition stolen from oaidl.h */
  375. /* 16-bit CURRENCY definition stolen from variant.h */
  376.  
  377. #ifndef _tagCY_DEFINED
  378. #define _tagCY_DEFINED
  379. #define _CY_DEFINED
  380. #if (defined (WIN16) || defined (DOS)) && !defined (_VARIANT_H_)
  381. typedef struct FARSTRUCT tagCY {
  382. #ifdef _MAC          
  383.         long      Hi;
  384.         long Lo;     
  385. #else                
  386.         unsigned long Lo;
  387.         long      Hi;
  388. #endif               
  389. } CY;
  390. #elif defined (WIN32)
  391. /* real definition that makes the C++ compiler happy */
  392. typedef union tagCY {
  393.     struct {         
  394. #ifdef _MAC          
  395.         long      Hi;
  396.         long Lo;     
  397. #else                
  398.         unsigned long Lo;
  399.         long      Hi;
  400. #endif               
  401.     } DUMMYUNIONNAME;               
  402.     LONGLONG int64;  
  403. } CY;                
  404. #endif /* 16-bit vs 32-bit definition */
  405. #endif
  406.             /* size is 8 */
  407. typedef CY CURRENCY;
  408.  
  409. typedef struct _SBinary
  410. {
  411.     ULONG       cb;
  412.     LPBYTE      lpb;
  413. } SBinary, FAR *LPSBinary;
  414.  
  415. typedef struct _SShortArray
  416. {
  417.     ULONG       cValues;
  418.     short int   FAR *lpi;
  419. } SShortArray;
  420.  
  421. typedef struct _SGuidArray
  422. {
  423.     ULONG       cValues;
  424.     GUID        FAR *lpguid;
  425. } SGuidArray;
  426.  
  427. typedef struct _SRealArray
  428. {
  429.     ULONG       cValues;
  430.     float       FAR *lpflt;
  431. } SRealArray;
  432.  
  433. typedef struct _SLongArray
  434. {
  435.     ULONG       cValues;
  436.     LONG        FAR *lpl;
  437. } SLongArray;
  438.  
  439. typedef struct _SLargeIntegerArray
  440. {
  441.     ULONG       cValues;
  442.     LARGE_INTEGER   FAR *lpli;
  443. } SLargeIntegerArray;
  444.  
  445. typedef struct _SDateTimeArray
  446. {
  447.     ULONG       cValues;
  448.     FILETIME    FAR *lpft;
  449. } SDateTimeArray;
  450.  
  451. typedef struct _SAppTimeArray
  452. {
  453.     ULONG       cValues;
  454.     double      FAR *lpat;
  455. } SAppTimeArray;
  456.  
  457. typedef struct _SCurrencyArray
  458. {
  459.     ULONG       cValues;
  460.     CURRENCY    FAR *lpcur;
  461. } SCurrencyArray;
  462.  
  463. typedef struct _SBinaryArray
  464. {
  465.     ULONG       cValues;
  466.     SBinary     FAR *lpbin;
  467. } SBinaryArray;
  468.  
  469. typedef struct _SDoubleArray
  470. {
  471.     ULONG       cValues;
  472.     double      FAR *lpdbl;
  473. } SDoubleArray;
  474.  
  475. typedef struct _SWStringArray
  476. {
  477.     ULONG       cValues;
  478.     LPWSTR      FAR *lppszW;
  479. } SWStringArray;
  480.  
  481. typedef struct _SLPSTRArray
  482. {
  483.     ULONG       cValues;
  484.     LPSTR       FAR *lppszA;
  485. } SLPSTRArray;
  486.  
  487. typedef union _PV
  488. {
  489.     short int           i;          /* case PT_I2 */
  490.     LONG                l;          /* case PT_LONG */
  491.     ULONG               ul;         /* alias for PT_LONG */
  492.     float               flt;        /* case PT_R4 */
  493.     double              dbl;        /* case PT_DOUBLE */
  494.     unsigned short int  b;          /* case PT_BOOLEAN */
  495.     CURRENCY            cur;        /* case PT_CURRENCY */
  496.     double              at;         /* case PT_APPTIME */
  497.     FILETIME            ft;         /* case PT_SYSTIME */
  498.     LPSTR               lpszA;      /* case PT_STRING8 */
  499.     SBinary             bin;        /* case PT_BINARY */
  500.     LPWSTR              lpszW;      /* case PT_UNICODE */
  501.     LPGUID              lpguid;     /* case PT_CLSID */
  502.     LARGE_INTEGER       li;         /* case PT_I8 */
  503.     SShortArray         MVi;        /* case PT_MV_I2 */
  504.     SLongArray          MVl;        /* case PT_MV_LONG */
  505.     SRealArray          MVflt;      /* case PT_MV_R4 */
  506.     SDoubleArray        MVdbl;      /* case PT_MV_DOUBLE */
  507.     SCurrencyArray      MVcur;      /* case PT_MV_CURRENCY */
  508.     SAppTimeArray       MVat;       /* case PT_MV_APPTIME */
  509.     SDateTimeArray      MVft;       /* case PT_MV_SYSTIME */
  510.     SBinaryArray        MVbin;      /* case PT_MV_BINARY */
  511.     SLPSTRArray         MVszA;      /* case PT_MV_STRING8 */
  512.     SWStringArray       MVszW;      /* case PT_MV_UNICODE */
  513.     SGuidArray          MVguid;     /* case PT_MV_CLSID */
  514.     SLargeIntegerArray  MVli;       /* case PT_MV_I8 */
  515.     SCODE               err;        /* case PT_ERROR */
  516.     LONG                x;          /* case PT_NULL, PT_OBJECT (no usable value) */
  517. } __UPV;
  518.  
  519. typedef struct _SPropValue
  520. {
  521.     ULONG       ulPropTag;
  522.     ULONG       dwAlignPad;
  523.     union _PV   Value;
  524. } SPropValue, FAR * LPSPropValue;
  525.  
  526.  
  527. /* --------------------------------------------- */
  528. /* Property Problem and Property Problem Arrays */
  529. /* --------------------------------------------- */
  530.  
  531. typedef struct _SPropProblem
  532. {
  533.     ULONG   ulIndex;
  534.     ULONG   ulPropTag;
  535.     SCODE   scode;
  536. } SPropProblem, FAR * LPSPropProblem;
  537.  
  538. typedef struct _SPropProblemArray
  539. {
  540.     ULONG           cProblem;
  541.     SPropProblem    aProblem[MAPI_DIM];
  542. } SPropProblemArray, FAR * LPSPropProblemArray;
  543.  
  544. #define CbNewSPropProblemArray(_cprob) \
  545.     (offsetof(SPropProblemArray,aProblem) + (_cprob)*sizeof(SPropProblem))
  546. #define CbSPropProblemArray(_lparray) \
  547.     (offsetof(SPropProblemArray,aProblem) + \
  548.     (UINT) ((_lparray)->cProblem*sizeof(SPropProblem)))
  549. #define SizedSPropProblemArray(_cprob, _name) \
  550. struct _SPropProblemArray_ ## _name \
  551. { \
  552.     ULONG           cProblem; \
  553.     SPropProblem    aProblem[_cprob]; \
  554. } _name
  555.  
  556. /*
  557.  *  ENTRYLIST
  558.  */
  559.  
  560. typedef SBinaryArray ENTRYLIST, FAR *LPENTRYLIST;
  561.  
  562. /*
  563.  *  FLATENTRYLIST
  564.  *  MTSID
  565.  *  FLATMTSIDLIST
  566.  */
  567.  
  568. typedef struct {
  569.     ULONG cb;
  570.     BYTE abEntry[MAPI_DIM];
  571. } FLATENTRY, FAR *LPFLATENTRY;
  572.  
  573. typedef struct {
  574.     ULONG       cEntries;
  575.     ULONG       cbEntries;
  576.     BYTE        abEntries[MAPI_DIM];
  577. } FLATENTRYLIST, FAR *LPFLATENTRYLIST;
  578.  
  579. typedef struct {
  580.     ULONG       cb;
  581.     BYTE        ab[MAPI_DIM];
  582. } MTSID, FAR *LPMTSID;
  583.  
  584. typedef struct {
  585.     ULONG       cMTSIDs;
  586.     ULONG       cbMTSIDs;
  587.     BYTE        abMTSIDs[MAPI_DIM];
  588. } FLATMTSIDLIST, FAR *LPFLATMTSIDLIST;
  589.  
  590. #define CbNewFLATENTRY(_cb)     (offsetof(FLATENTRY,abEntry) + (_cb))
  591. #define CbFLATENTRY(_lpentry)   (offsetof(FLATENTRY,abEntry) + (_lpentry)->cb)
  592. #define CbNewFLATENTRYLIST(_cb) (offsetof(FLATENTRYLIST,abEntries) + (_cb))
  593. #define CbFLATENTRYLIST(_lplist) (offsetof(FLATENTRYLIST,abEntries) + (_lplist)->cbEntries)
  594. #define CbNewMTSID(_cb)         (offsetof(MTSID,ab) + (_cb))
  595. #define CbMTSID(_lpentry)       (offsetof(MTSID,ab) + (_lpentry)->cb)
  596. #define CbNewFLATMTSIDLIST(_cb) (offsetof(FLATMTSIDLIST,abMTSIDs) + (_cb))
  597. #define CbFLATMTSIDLIST(_lplist) (offsetof(FLATMTSIDLIST,abMTSIDs) + (_lplist)->cbMTSIDs)
  598. /* No SizedXXX macros for these types. */
  599.  
  600. /* ------------------------------ */
  601. /* ADRENTRY, ADRLIST */
  602.  
  603. typedef struct _ADRENTRY
  604. {
  605.     ULONG           ulReserved1;    /* Never used */
  606.     ULONG           cValues;
  607.     LPSPropValue    rgPropVals;
  608. } ADRENTRY, FAR * LPADRENTRY;
  609.  
  610. typedef struct _ADRLIST
  611. {
  612.     ULONG           cEntries;
  613.     ADRENTRY        aEntries[MAPI_DIM];
  614. } ADRLIST, FAR * LPADRLIST;
  615.  
  616. #define CbNewADRLIST(_centries) \
  617.     (offsetof(ADRLIST,aEntries) + (_centries)*sizeof(ADRENTRY))
  618. #define CbADRLIST(_lpadrlist) \
  619.     (offsetof(ADRLIST,aEntries) + (UINT)(_lpadrlist)->cEntries*sizeof(ADRENTRY))
  620. #define SizedADRLIST(_centries, _name) \
  621. struct _ADRLIST_ ## _name \
  622. { \
  623.     ULONG           cEntries; \
  624.     ADRENTRY        aEntries[_centries]; \
  625. } _name
  626.  
  627. /* ------------------------------ */
  628. /* SRow, SRowSet */
  629.  
  630. typedef struct _SRow
  631. {
  632.     ULONG           ulAdrEntryPad;  /* Pad so SRow's can map to ADRENTRY's */
  633.     ULONG           cValues;        /* Count of property values */
  634.     LPSPropValue    lpProps;        /* Property value array */
  635. } SRow, FAR * LPSRow;
  636.  
  637. typedef struct _SRowSet
  638. {
  639.     ULONG           cRows;          /* Count of rows */
  640.     SRow            aRow[MAPI_DIM]; /* Array of rows */
  641. } SRowSet, FAR * LPSRowSet;
  642.  
  643. #define CbNewSRowSet(_crow)     (offsetof(SRowSet,aRow) + (_crow)*sizeof(SRow))
  644. #define CbSRowSet(_lprowset)    (offsetof(SRowSet,aRow) + \
  645.                                     (UINT)((_lprowset)->cRows*sizeof(SRow)))
  646. #define SizedSRowSet(_crow, _name) \
  647. struct _SRowSet_ ## _name \
  648. { \
  649.     ULONG           cRows; \
  650.     SRow            aRow[_crow]; \
  651. } _name
  652.  
  653. /* MAPI Allocation Routines ------------------------------------------------ */
  654.  
  655. typedef SCODE (STDMETHODCALLTYPE ALLOCATEBUFFER)(
  656.     ULONG           cbSize,
  657.     LPVOID FAR *    lppBuffer
  658. );
  659.  
  660. typedef SCODE (STDMETHODCALLTYPE ALLOCATEMORE)(
  661.     ULONG           cbSize,
  662.     LPVOID          lpObject,
  663.     LPVOID FAR *    lppBuffer
  664. );
  665.  
  666. typedef ULONG (STDAPICALLTYPE FREEBUFFER)(
  667.     LPVOID          lpBuffer
  668. );
  669.  
  670. typedef ALLOCATEBUFFER FAR *LPALLOCATEBUFFER;
  671. typedef ALLOCATEMORE FAR *  LPALLOCATEMORE;
  672. typedef FREEBUFFER FAR *    LPFREEBUFFER;
  673.  
  674. /* MAPI Component Object Model Macros -------------------------------------- */
  675.  
  676. #if defined(MAPI_IF) && (!defined(__cplusplus) || defined(CINTERFACE))
  677. #define DECLARE_MAPI_INTERFACE(iface)                                   \
  678.         typedef struct iface##Vtbl iface##Vtbl, FAR * iface;            \
  679.         struct iface##Vtbl
  680. #define DECLARE_MAPI_INTERFACE_(iface, baseiface)                       \
  681.         DECLARE_MAPI_INTERFACE(iface)
  682. #define DECLARE_MAPI_INTERFACE_PTR(iface, piface)                       \
  683.         typedef struct iface##Vtbl iface##Vtbl, FAR * iface, FAR * FAR * piface;
  684. #else
  685. #define DECLARE_MAPI_INTERFACE(iface)                                   \
  686.         DECLARE_INTERFACE(iface)
  687. #define DECLARE_MAPI_INTERFACE_(iface, baseiface)                       \
  688.         DECLARE_INTERFACE_(iface, baseiface)
  689. #ifdef __cplusplus
  690. #define DECLARE_MAPI_INTERFACE_PTR(iface, piface)                       \
  691.         interface iface; typedef iface FAR * piface
  692. #else
  693. #define DECLARE_MAPI_INTERFACE_PTR(iface, piface)                       \
  694.         typedef interface iface iface, FAR * piface
  695. #endif
  696. #endif
  697.  
  698. #define MAPIMETHOD(method)              MAPIMETHOD_(HRESULT, method)
  699. #define MAPIMETHOD_(type, method)       STDMETHOD_(type, method)
  700. #define MAPIMETHOD_DECLARE(type, method, prefix) \
  701.         STDMETHODIMP_(type) prefix##method
  702. #define MAPIMETHOD_TYPEDEF(type, method, prefix) \
  703.         typedef type (STDMETHODCALLTYPE prefix##method##_METHOD)
  704.  
  705. #define MAPI_IUNKNOWN_METHODS(IPURE)                                    \
  706.     MAPIMETHOD(QueryInterface)                                          \
  707.         (THIS_ REFIID riid, LPVOID FAR * ppvObj) IPURE;                 \
  708.     MAPIMETHOD_(ULONG,AddRef)  (THIS) IPURE;                            \
  709.     MAPIMETHOD_(ULONG,Release) (THIS) IPURE;                            \
  710.  
  711. #undef  IMPL
  712. #define IMPL
  713.  
  714. /* Pointers to MAPI Interfaces --------------------------------------------- */
  715.  
  716. typedef const IID FAR * LPCIID;
  717.              
  718. DECLARE_MAPI_INTERFACE_PTR(IMsgStore,       LPMDB);
  719. DECLARE_MAPI_INTERFACE_PTR(IMAPIFolder,     LPMAPIFOLDER);
  720. DECLARE_MAPI_INTERFACE_PTR(IMessage,        LPMESSAGE);
  721. DECLARE_MAPI_INTERFACE_PTR(IAttach,         LPATTACH);
  722. DECLARE_MAPI_INTERFACE_PTR(IAddrBook,       LPADRBOOK);
  723. DECLARE_MAPI_INTERFACE_PTR(IABContainer,    LPABCONT);
  724. DECLARE_MAPI_INTERFACE_PTR(IMailUser,       LPMAILUSER);
  725. DECLARE_MAPI_INTERFACE_PTR(IDistList,       LPDISTLIST);
  726. DECLARE_MAPI_INTERFACE_PTR(IMAPIStatus,     LPMAPISTATUS);
  727. DECLARE_MAPI_INTERFACE_PTR(IMAPITable,      LPMAPITABLE);
  728. DECLARE_MAPI_INTERFACE_PTR(IProfSect,       LPPROFSECT);
  729. DECLARE_MAPI_INTERFACE_PTR(IMAPIProp,       LPMAPIPROP);
  730. DECLARE_MAPI_INTERFACE_PTR(IMAPIContainer,  LPMAPICONTAINER);
  731. DECLARE_MAPI_INTERFACE_PTR(IMAPIAdviseSink, LPMAPIADVISESINK);
  732. DECLARE_MAPI_INTERFACE_PTR(IMAPIProgress,   LPMAPIPROGRESS);
  733. DECLARE_MAPI_INTERFACE_PTR(IProviderAdmin,  LPPROVIDERADMIN);
  734.  
  735. /* Extended MAPI Error Information ----------------------------------------- */
  736.  
  737. typedef struct _MAPIERROR
  738. {
  739.     ULONG   ulVersion;
  740.     LPTSTR  lpszError;
  741.     LPTSTR  lpszComponent;
  742.     ULONG   ulLowLevelError;
  743.     ULONG   ulContext;
  744.  
  745. } MAPIERROR, FAR * LPMAPIERROR;
  746.  
  747.  
  748. /* IMAPIAdviseSink Interface ----------------------------------------------- */
  749.  
  750. /*
  751.  *  Notification event types. The event types can be combined in a bitmask
  752.  *  for filtering. Each one has a parameter structure associated with it:
  753.  *
  754.  *      fnevCriticalError       ERROR_NOTIFICATION
  755.  *      fnevNewMail             NEWMAIL_NOTIFICATION
  756.  *      fnevObjectCreated       OBJECT_NOTIFICATION
  757.  *      fnevObjectDeleted       OBJECT_NOTIFICATION
  758.  *      fnevObjectModified      OBJECT_NOTIFICATION
  759.  *      fnevObjectCopied        OBJECT_NOTIFICATION
  760.  *      fnevSearchComplete      OBJECT_NOTIFICATION
  761.  *      fnevTableModified       TABLE_NOTIFICATION
  762.  *      fnevStatusObjectModified ?
  763.  *
  764.  *      fnevExtended            EXTENDED_NOTIFICATION
  765.  */
  766.  
  767. #define fnevCriticalError           ((ULONG) 0x00000001)
  768. #define fnevNewMail                 ((ULONG) 0x00000002)
  769. #define fnevObjectCreated           ((ULONG) 0x00000004)
  770. #define fnevObjectDeleted           ((ULONG) 0x00000008)
  771. #define fnevObjectModified          ((ULONG) 0x00000010)
  772. #define fnevObjectMoved             ((ULONG) 0x00000020)
  773. #define fnevObjectCopied            ((ULONG) 0x00000040)
  774. #define fnevSearchComplete          ((ULONG) 0x00000080)
  775. #define fnevTableModified           ((ULONG) 0x00000100)
  776. #define fnevStatusObjectModified    ((ULONG) 0x00000200)
  777. #define fnevReservedForMapi         ((ULONG) 0x40000000)
  778. #define fnevExtended                ((ULONG) 0x80000000)
  779.  
  780. /* TABLE_NOTIFICATION event types passed in ulTableEvent */
  781.  
  782. #define TABLE_CHANGED       1
  783. #define TABLE_ERROR         2
  784. #define TABLE_ROW_ADDED     3
  785. #define TABLE_ROW_DELETED   4
  786. #define TABLE_ROW_MODIFIED  5
  787. #define TABLE_SORT_DONE     6
  788. #define TABLE_RESTRICT_DONE 7
  789. #define TABLE_SETCOL_DONE   8
  790. #define TABLE_RELOAD        9
  791.  
  792. /* Event Structures */
  793.  
  794. typedef struct _ERROR_NOTIFICATION
  795. {
  796.     ULONG       cbEntryID;
  797.     LPENTRYID   lpEntryID;
  798.     SCODE       scode;
  799.     ULONG       ulFlags;            /* 0 or MAPI_UNICODE */
  800.     LPMAPIERROR lpMAPIError;        /* Detailed error information */
  801. } ERROR_NOTIFICATION;
  802.  
  803. typedef struct _NEWMAIL_NOTIFICATION
  804. {
  805.     ULONG       cbEntryID;
  806.     LPENTRYID   lpEntryID;          /* identifies the new message */
  807.     ULONG       cbParentID;
  808.     LPENTRYID   lpParentID;         /* identifies the folder it lives in */
  809.     ULONG       ulFlags;            /* 0 or MAPI_UNICODE */
  810.     LPTSTR      lpszMessageClass;   /* message class (UNICODE or string8) */
  811.     ULONG       ulMessageFlags;     /* copy of PR_MESSAGE_FLAGS */
  812. } NEWMAIL_NOTIFICATION;
  813.  
  814. typedef struct _OBJECT_NOTIFICATION
  815. {
  816.     ULONG               cbEntryID;
  817.     LPENTRYID           lpEntryID;      /* EntryID of object */
  818.     ULONG               ulObjType;      /* Type of object */
  819.     ULONG               cbParentID;
  820.     LPENTRYID           lpParentID;     /* EntryID of parent object */
  821.     ULONG               cbOldID;
  822.     LPENTRYID           lpOldID;        /* EntryID of old object */
  823.     ULONG               cbOldParentID;
  824.     LPENTRYID           lpOldParentID;  /* EntryID of old parent */
  825.     LPSPropTagArray     lpPropTagArray;
  826. } OBJECT_NOTIFICATION;
  827.  
  828. typedef struct _TABLE_NOTIFICATION
  829. {
  830.     ULONG               ulTableEvent;   /* Identifies WHICH table event */
  831.     HRESULT             hResult;        /* Value for TABLE_ERROR */
  832.     SPropValue          propIndex;      /* This row's "index property" */
  833.     SPropValue          propPrior;      /* Preceding row's "index property" */
  834.     SRow                row;            /* New data of added/modified row */
  835.     ULONG               ulPad;          /* Force to 8-byte boundary */
  836. } TABLE_NOTIFICATION;
  837.  
  838. typedef struct _EXTENDED_NOTIFICATION
  839. {
  840.     ULONG       ulEvent;                    /* extended event code */
  841.     ULONG       cb;                         /* size of event parameters */
  842.     LPBYTE      pbEventParameters;          /* event parameters */
  843. } EXTENDED_NOTIFICATION;
  844.  
  845. typedef struct
  846. {
  847.     ULONG           cbEntryID;
  848.     LPENTRYID       lpEntryID;
  849.     ULONG           cValues;
  850.     LPSPropValue    lpPropVals;
  851. } STATUS_OBJECT_NOTIFICATION;
  852.  
  853. typedef struct _NOTIFICATION
  854. {
  855.     ULONG   ulEventType;        /* notification type, i.e. fnevSomething */
  856.     ULONG   ulAlignPad;         /* Force to 8-byte boundary */
  857.     union
  858.     {
  859.         ERROR_NOTIFICATION          err;
  860.         NEWMAIL_NOTIFICATION        newmail;
  861.         OBJECT_NOTIFICATION         obj;
  862.         TABLE_NOTIFICATION          tab;
  863.         EXTENDED_NOTIFICATION       ext;
  864.         STATUS_OBJECT_NOTIFICATION  statobj;
  865.     } info;
  866. } NOTIFICATION, FAR * LPNOTIFICATION;
  867.  
  868.  
  869. /* Interface used for registering and issuing notification callbacks. */
  870.  
  871. #define MAPI_IMAPIADVISESINK_METHODS(IPURE)                             \
  872.     MAPIMETHOD_(ULONG, OnNotify)                                        \
  873.         (THIS_  ULONG                       cNotif,                     \
  874.                 LPNOTIFICATION              lpNotifications) IPURE;     \
  875.  
  876. #undef       INTERFACE
  877. #define      INTERFACE  IMAPIAdviseSink
  878. DECLARE_MAPI_INTERFACE_(IMAPIAdviseSink, IUnknown)
  879. {
  880.     BEGIN_INTERFACE
  881.     MAPI_IUNKNOWN_METHODS(PURE)
  882.     MAPI_IMAPIADVISESINK_METHODS(PURE)
  883. };
  884.  
  885. /* Callback function type for MAPIAllocAdviseSink */
  886.  
  887. typedef long (STDAPICALLTYPE NOTIFCALLBACK) (
  888.     LPVOID          lpvContext,
  889.     ULONG           cNotification,
  890.     LPNOTIFICATION  lpNotifications);
  891. typedef NOTIFCALLBACK FAR * LPNOTIFCALLBACK;
  892.  
  893. /*
  894.  *  Message name for the 16-bit MAPI notififcation engine.
  895.  *  This can be used in 16-bit applications to force processing
  896.  *  of notification callbacks.
  897.  */
  898.  
  899. #define szMAPINotificationMsg "MAPI Notify window message"
  900.  
  901.  
  902. /* IMAPIProgress Interface ------------------------------------------------- */
  903.  
  904. /* Flag values for the progress indicator */
  905.  
  906. #define MAPI_TOP_LEVEL      ((ULONG) 0x00000001)
  907.  
  908. #define MAPI_IMAPIPROGRESS_METHODS(IPURE)                               \
  909.     MAPIMETHOD(Progress)                                                \
  910.         (THIS_  ULONG                       ulValue,                    \
  911.                 ULONG                       ulCount,                    \
  912.                 ULONG                       ulTotal) IPURE;             \
  913.     MAPIMETHOD(GetFlags)                                                \
  914.         (THIS_  ULONG FAR *                 lpulFlags) IPURE;           \
  915.     MAPIMETHOD(GetMax)                                                  \
  916.         (THIS_  ULONG FAR *                 lpulMax) IPURE;             \
  917.     MAPIMETHOD(GetMin)                                                  \
  918.         (THIS_  ULONG FAR *                 lpulMin) IPURE;             \
  919.     MAPIMETHOD(SetLimits)                                               \
  920.         (THIS_  LPULONG                     lpulMin,                    \
  921.                 LPULONG                     lpulMax,                    \
  922.                 LPULONG                     lpulFlags) IPURE;           \
  923.  
  924. #undef      INTERFACE
  925. #define     INTERFACE   IMAPIProgress
  926. DECLARE_MAPI_INTERFACE_(IMAPIProgress, IUnknown)
  927. {
  928.     BEGIN_INTERFACE 
  929.     MAPI_IUNKNOWN_METHODS(PURE)
  930.     MAPI_IMAPIPROGRESS_METHODS(PURE)
  931. };
  932.  
  933.  
  934. /* IMAPIProp Interface ----------------------------------------------------- */
  935.  
  936. /* GetLastError */
  937. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  938.  
  939. /*
  940.  *  Version:
  941.  */
  942. #define MAPI_ERROR_VERSION      0x00000000L
  943.  
  944. /* GetPropList */
  945. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  946.  
  947. /* GetProps */
  948. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  949.  
  950. /* SaveChanges */
  951.  
  952. #define KEEP_OPEN_READONLY      ((ULONG) 0x00000001)
  953. #define KEEP_OPEN_READWRITE     ((ULONG) 0x00000002)
  954. #define FORCE_SAVE              ((ULONG) 0x00000004)
  955. /* define MAPI_DEFERRED_ERRORS  ((ULONG) 0x00000008) below */
  956.  
  957. /* OpenProperty  - ulFlags */
  958. /****** MAPI_MODIFY             ((ULONG) 0x00000001) above */
  959. #define MAPI_CREATE             ((ULONG) 0x00000002)
  960. #define STREAM_APPEND           ((ULONG) 0x00000004)
  961. /****** MAPI_DEFERRED_ERRORS    ((ULONG) 0x00000008) below */
  962.  
  963. /* OpenProperty  - ulInterfaceOptions, IID_IMAPITable */
  964. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  965.  
  966. /* CopyTo, CopyProps */
  967.  
  968. #define MAPI_MOVE               ((ULONG) 0x00000001)
  969. #define MAPI_NOREPLACE          ((ULONG) 0x00000002)
  970. #define MAPI_DECLINE_OK         ((ULONG) 0x00000004)
  971.  
  972. #ifndef MAPI_DIALOG             /* also defined in mapi.h */
  973. #define MAPI_DIALOG             ((ULONG) 0x00000008)
  974. #endif
  975.  
  976. #ifndef MAPI_USE_DEFAULT        /* also defined in mapi.h */
  977. #define MAPI_USE_DEFAULT        0x00000040  /* Use default profile in logon */
  978. #endif
  979.  
  980. /* Flags used in GetIDsFromNames  */
  981. /****** MAPI_CREATE             ((ULONG) 0x00000002) above */
  982.  
  983. /* Flags used in GetNamesFromIDs  (bit fields) */
  984. #define MAPI_NO_STRINGS         ((ULONG) 0x00000001)
  985. #define MAPI_NO_IDS             ((ULONG) 0x00000002)
  986.  
  987. /*  Union discriminator  */
  988. #define MNID_ID                 0
  989. #define MNID_STRING             1
  990. typedef struct _MAPINAMEID
  991. {
  992.     LPGUID lpguid;
  993.     ULONG ulKind;
  994.     union {
  995.         LONG lID;
  996.         LPWSTR lpwstrName;
  997.     } Kind;
  998.  
  999. } MAPINAMEID, FAR * LPMAPINAMEID;
  1000.  
  1001. #define MAPI_IMAPIPROP_METHODS(IPURE)                                   \
  1002.     MAPIMETHOD(GetLastError)                                            \
  1003.         (THIS_  HRESULT                     hResult,                    \
  1004.                 ULONG                       ulFlags,                    \
  1005.                 LPMAPIERROR FAR *           lppMAPIError) IPURE;        \
  1006.     MAPIMETHOD(SaveChanges)                                             \
  1007.         (THIS_ ULONG                        ulFlags) IPURE;             \
  1008.     MAPIMETHOD(GetProps)                                                \
  1009.         (THIS_  LPSPropTagArray             lpPropTagArray,             \
  1010.                 ULONG                       ulFlags,                    \
  1011.                 ULONG FAR *                 lpcValues,                  \
  1012.                 LPSPropValue FAR *          lppPropArray) IPURE;        \
  1013.     MAPIMETHOD(GetPropList)                                             \
  1014.         (THIS_  ULONG                       ulFlags,                    \
  1015.                 LPSPropTagArray FAR *       lppPropTagArray) IPURE;     \
  1016.     MAPIMETHOD(OpenProperty)                                            \
  1017.         (THIS_  ULONG                       ulPropTag,                  \
  1018.                 LPCIID                      lpiid,                      \
  1019.                 ULONG                       ulInterfaceOptions,         \
  1020.                 ULONG                       ulFlags,                    \
  1021.                 LPUNKNOWN FAR *             lppUnk) IPURE;              \
  1022.     MAPIMETHOD(SetProps)                                                \
  1023.         (THIS_  ULONG                       cValues,                    \
  1024.                 LPSPropValue                lpPropArray,                \
  1025.                 LPSPropProblemArray FAR *   lppProblems) IPURE;         \
  1026.     MAPIMETHOD(DeleteProps)                                             \
  1027.         (THIS_  LPSPropTagArray             lpPropTagArray,             \
  1028.                 LPSPropProblemArray FAR *   lppProblems) IPURE;         \
  1029.     MAPIMETHOD(CopyTo)                                                  \
  1030.         (THIS_  ULONG                       ciidExclude,                \
  1031.                 LPCIID                      rgiidExclude,               \
  1032.                 LPSPropTagArray             lpExcludeProps,             \
  1033.                 ULONG                       ulUIParam,                  \
  1034.                 LPMAPIPROGRESS              lpProgress,                 \
  1035.                 LPCIID                      lpInterface,                \
  1036.                 LPVOID                      lpDestObj,                  \
  1037.                 ULONG                       ulFlags,                    \
  1038.                 LPSPropProblemArray FAR *   lppProblems) IPURE;         \
  1039.     MAPIMETHOD(CopyProps)                                               \
  1040.         (THIS_  LPSPropTagArray             lpIncludeProps,             \
  1041.                 ULONG                       ulUIParam,                  \
  1042.                 LPMAPIPROGRESS              lpProgress,                 \
  1043.                 LPCIID                      lpInterface,                \
  1044.                 LPVOID                      lpDestObj,                  \
  1045.                 ULONG                       ulFlags,                    \
  1046.                 LPSPropProblemArray FAR *   lppProblems) IPURE;         \
  1047.     MAPIMETHOD(GetNamesFromIDs)                                         \
  1048.         (THIS_  LPSPropTagArray FAR *       lppPropTags,                \
  1049.                 LPGUID                      lpPropSetGuid,              \
  1050.                 ULONG                       ulFlags,                    \
  1051.                 ULONG FAR *                 lpcPropNames,               \
  1052.                 LPMAPINAMEID FAR * FAR *    lpppPropNames) IPURE;       \
  1053.     MAPIMETHOD(GetIDsFromNames)                                         \
  1054.         (THIS_  ULONG                       cPropNames,                 \
  1055.                 LPMAPINAMEID FAR *          lppPropNames,               \
  1056.                 ULONG                       ulFlags,                    \
  1057.                 LPSPropTagArray FAR *       lppPropTags) IPURE;         \
  1058.  
  1059. #undef       INTERFACE
  1060. #define      INTERFACE  IMAPIProp
  1061. DECLARE_MAPI_INTERFACE_(IMAPIProp, IUnknown)
  1062. {
  1063.     BEGIN_INTERFACE 
  1064.     MAPI_IUNKNOWN_METHODS(PURE)
  1065.     MAPI_IMAPIPROP_METHODS(PURE)
  1066. };
  1067.  
  1068. /* IMAPITable Interface ---------------------------------------------------- */
  1069.  
  1070. /* Table status */
  1071.  
  1072. #define TBLSTAT_COMPLETE            ((ULONG) 0)
  1073. #define TBLSTAT_QCHANGED            ((ULONG) 7)
  1074. #define TBLSTAT_SORTING             ((ULONG) 9)
  1075. #define TBLSTAT_SORT_ERROR          ((ULONG) 10)
  1076. #define TBLSTAT_SETTING_COLS        ((ULONG) 11)
  1077. #define TBLSTAT_SETCOL_ERROR        ((ULONG) 13)
  1078. #define TBLSTAT_RESTRICTING         ((ULONG) 14)
  1079. #define TBLSTAT_RESTRICT_ERROR      ((ULONG) 15)
  1080.  
  1081.  
  1082. /* Table Type */
  1083.  
  1084. #define TBLTYPE_SNAPSHOT            ((ULONG) 0)
  1085. #define TBLTYPE_KEYSET              ((ULONG) 1)
  1086. #define TBLTYPE_DYNAMIC             ((ULONG) 2)
  1087.  
  1088.  
  1089. /* Sort order */
  1090.  
  1091. /* bit 0: set if descending, clear if ascending */
  1092.  
  1093. #define TABLE_SORT_ASCEND       ((ULONG) 0x00000000)
  1094. #define TABLE_SORT_DESCEND      ((ULONG) 0x00000001)
  1095. #define TABLE_SORT_COMBINE      ((ULONG) 0x00000002)
  1096.  
  1097.  
  1098. /* Data structures */
  1099.  
  1100. typedef struct _SSortOrder
  1101. {
  1102.     ULONG   ulPropTag;          /* Column to sort on */
  1103.     ULONG   ulOrder;            /* Ascending, descending, combine to left */
  1104. } SSortOrder, FAR * LPSSortOrder;
  1105.  
  1106. typedef struct _SSortOrderSet
  1107. {
  1108.     ULONG           cSorts;     /* Number of sort columns in aSort below*/
  1109.     ULONG           cCategories;    /* 0 for non-categorized, up to cSorts */
  1110.     ULONG           cExpanded;      /* 0 if no categories start expanded, */
  1111.                                     /*      up to cExpanded */
  1112.     SSortOrder      aSort[MAPI_DIM];    /* The sort orders */
  1113. } SSortOrderSet, FAR * LPSSortOrderSet;
  1114.  
  1115. #define CbNewSSortOrderSet(_csort) \
  1116.     (offsetof(SSortOrderSet,aSort) + (_csort)*sizeof(SSortOrder))
  1117. #define CbSSortOrderSet(_lpset) \
  1118.     (offsetof(SSortOrderSet,aSort) + \
  1119.     (UINT)((_lpset)->cSorts*sizeof(SSortOrder)))
  1120. #define SizedSSortOrderSet(_csort, _name) \
  1121. struct _SSortOrderSet_ ## _name \
  1122. { \
  1123.     ULONG           cSorts;         \
  1124.     ULONG           cCategories;    \
  1125.     ULONG           cExpanded;      \
  1126.     SSortOrder      aSort[_csort];  \
  1127. } _name
  1128.  
  1129. typedef ULONG       BOOKMARK;
  1130.  
  1131. #define BOOKMARK_BEGINNING  ((BOOKMARK) 0)      /* Before first row */
  1132. #define BOOKMARK_CURRENT    ((BOOKMARK) 1)      /* Before current row */
  1133. #define BOOKMARK_END        ((BOOKMARK) 2)      /* After last row */
  1134.  
  1135. /* Fuzzy Level */
  1136.  
  1137. #define FL_FULLSTRING       ((ULONG) 0x00000000)
  1138. #define FL_SUBSTRING        ((ULONG) 0x00000001)
  1139. #define FL_PREFIX           ((ULONG) 0x00000002)
  1140.  
  1141. #define FL_IGNORECASE       ((ULONG) 0x00010000)
  1142. #define FL_IGNORENONSPACE   ((ULONG) 0x00020000)
  1143. #define FL_LOOSE            ((ULONG) 0x00040000)
  1144.  
  1145. /* Restrictions */
  1146.  
  1147. typedef struct _SRestriction    FAR * LPSRestriction;
  1148.  
  1149. /* Restriction types */
  1150.  
  1151. #define RES_AND             ((ULONG) 0x00000000)
  1152. #define RES_OR              ((ULONG) 0x00000001)
  1153. #define RES_NOT             ((ULONG) 0x00000002)
  1154. #define RES_CONTENT         ((ULONG) 0x00000003)
  1155. #define RES_PROPERTY        ((ULONG) 0x00000004)
  1156. #define RES_COMPAREPROPS    ((ULONG) 0x00000005)
  1157. #define RES_BITMASK         ((ULONG) 0x00000006)
  1158. #define RES_SIZE            ((ULONG) 0x00000007)
  1159. #define RES_EXIST           ((ULONG) 0x00000008)
  1160. #define RES_SUBRESTRICTION  ((ULONG) 0x00000009)
  1161. #define RES_COMMENT         ((ULONG) 0x0000000A)
  1162.  
  1163. /* Relational operators. These apply to all property comparison restrictions. */
  1164.  
  1165. #define RELOP_LT        ((ULONG) 0)     /* <  */
  1166. #define RELOP_LE        ((ULONG) 1)     /* <= */
  1167. #define RELOP_GT        ((ULONG) 2)     /* >  */
  1168. #define RELOP_GE        ((ULONG) 3)     /* >= */
  1169. #define RELOP_EQ        ((ULONG) 4)     /* == */
  1170. #define RELOP_NE        ((ULONG) 5)     /* != */
  1171. #define RELOP_RE        ((ULONG) 6)     /* LIKE (Regular expression) */
  1172.  
  1173. /* Bitmask operators, for RES_BITMASK only. */
  1174.  
  1175. #define BMR_EQZ     ((ULONG) 0)     /* ==0 */
  1176. #define BMR_NEZ     ((ULONG) 1)     /* !=0 */
  1177.  
  1178. /* Subobject identifiers for RES_SUBRESTRICTION only. See MAPITAGS.H. */
  1179.  
  1180. /* #define PR_MESSAGE_RECIPIENTS  PROP_TAG(PT_OBJECT,0x0E12) */
  1181. /* #define PR_MESSAGE_ATTACHMENTS PROP_TAG(PT_OBJECT,0x0E13) */
  1182.  
  1183. typedef struct _SAndRestriction
  1184. {
  1185.     ULONG           cRes;
  1186.     LPSRestriction  lpRes;
  1187. } SAndRestriction;
  1188.  
  1189. typedef struct _SOrRestriction
  1190. {
  1191.     ULONG           cRes;
  1192.     LPSRestriction  lpRes;
  1193. } SOrRestriction;
  1194.  
  1195. typedef struct _SNotRestriction
  1196. {
  1197.     ULONG           ulReserved;
  1198.     LPSRestriction  lpRes;
  1199. } SNotRestriction;
  1200.  
  1201. typedef struct _SContentRestriction
  1202. {
  1203.     ULONG           ulFuzzyLevel;
  1204.     ULONG           ulPropTag;
  1205.     LPSPropValue    lpProp;
  1206. } SContentRestriction;
  1207.  
  1208. typedef struct _SBitMaskRestriction
  1209. {
  1210.     ULONG           relBMR;
  1211.     ULONG           ulPropTag;
  1212.     ULONG           ulMask;
  1213. } SBitMaskRestriction;
  1214.  
  1215. typedef struct _SPropertyRestriction
  1216. {
  1217.     ULONG           relop;
  1218.     ULONG           ulPropTag;
  1219.     LPSPropValue    lpProp;
  1220. } SPropertyRestriction;
  1221.  
  1222. typedef struct _SComparePropsRestriction
  1223. {
  1224.     ULONG           relop;
  1225.     ULONG           ulPropTag1;
  1226.     ULONG           ulPropTag2;
  1227. } SComparePropsRestriction;
  1228.  
  1229. typedef struct _SSizeRestriction
  1230. {
  1231.     ULONG           relop;
  1232.     ULONG           ulPropTag;
  1233.     ULONG           cb;
  1234. } SSizeRestriction;
  1235.  
  1236. typedef struct _SExistRestriction
  1237. {
  1238.     ULONG           ulReserved1;
  1239.     ULONG           ulPropTag;
  1240.     ULONG           ulReserved2;
  1241. } SExistRestriction;
  1242.  
  1243. typedef struct _SSubRestriction
  1244. {
  1245.     ULONG           ulSubObject;
  1246.     LPSRestriction  lpRes;
  1247. } SSubRestriction;
  1248.  
  1249. typedef struct _SCommentRestriction
  1250. {
  1251.     ULONG           cValues; /* # of properties in lpProp */
  1252.     LPSRestriction  lpRes;
  1253.     LPSPropValue    lpProp;
  1254. } SCommentRestriction;
  1255.  
  1256. typedef struct _SRestriction
  1257. {
  1258.     ULONG   rt;         /* Restriction type */
  1259.     union
  1260.     {
  1261.         SComparePropsRestriction    resCompareProps;    /* first */
  1262.         SAndRestriction             resAnd;
  1263.         SOrRestriction              resOr;
  1264.         SNotRestriction             resNot;
  1265.         SContentRestriction         resContent;
  1266.         SPropertyRestriction        resProperty;
  1267.         SBitMaskRestriction         resBitMask;
  1268.         SSizeRestriction            resSize;
  1269.         SExistRestriction           resExist;
  1270.         SSubRestriction             resSub;
  1271.         SCommentRestriction         resComment;
  1272.     } res;
  1273. } SRestriction;
  1274.  
  1275. /* SComparePropsRestriction is first in the union so that */
  1276. /* static initializations of 3-value restriction work.    */
  1277.  
  1278. /* Flags of the methods of IMAPITable */
  1279.  
  1280. /* QueryColumn */
  1281.  
  1282. #define TBL_ALL_COLUMNS     ((ULONG) 0x00000001)
  1283.  
  1284. /* QueryRows */
  1285. /* Possible values for PR_ROW_TYPE (for categorization) */
  1286.  
  1287. #define TBL_LEAF_ROW            ((ULONG) 1)
  1288. #define TBL_EMPTY_CATEGORY      ((ULONG) 2)
  1289. #define TBL_EXPANDED_CATEGORY   ((ULONG) 3)
  1290. #define TBL_COLLAPSED_CATEGORY  ((ULONG) 4)
  1291.  
  1292. /* Table wait flag */
  1293.  
  1294. #define TBL_NOWAIT          ((ULONG) 0x00000001)
  1295. /* alternative name for TBL_NOWAIT */
  1296. #define TBL_ASYNC           ((ULONG) 0x00000001)
  1297. #define TBL_BATCH           ((ULONG) 0x00000002)
  1298.  
  1299. /* FindRow */
  1300.  
  1301. #define DIR_BACKWARD        ((ULONG) 0x00000001)
  1302.  
  1303. /* Table cursor states */
  1304.  
  1305. #define TBL_NOADVANCE       ((ULONG) 0x00000001)
  1306.  
  1307. #define MAPI_IMAPITABLE_METHODS(IPURE)                                  \
  1308.     MAPIMETHOD(GetLastError)                                            \
  1309.         (THIS_  HRESULT                     hResult,                    \
  1310.                 ULONG                       ulFlags,                    \
  1311.                 LPMAPIERROR FAR *           lppMAPIError) IPURE;        \
  1312.     MAPIMETHOD(Advise)                                                  \
  1313.         (THIS_  ULONG                       ulEventMask,                \
  1314.                 LPMAPIADVISESINK            lpAdviseSink,               \
  1315.                 ULONG FAR *                 lpulConnection) IPURE;      \
  1316.     MAPIMETHOD(Unadvise)                                                \
  1317.         (THIS_  ULONG                       ulConnection) IPURE;        \
  1318.     MAPIMETHOD(GetStatus)                                               \
  1319.         (THIS_  ULONG FAR *                 lpulTableStatus,            \
  1320.                 ULONG FAR *                 lpulTableType) IPURE;       \
  1321.     MAPIMETHOD(SetColumns)                                              \
  1322.         (THIS_  LPSPropTagArray             lpPropTagArray,             \
  1323.                 ULONG                       ulFlags) IPURE;             \
  1324.     MAPIMETHOD(QueryColumns)                                            \
  1325.         (THIS_  ULONG                       ulFlags,                    \
  1326.                 LPSPropTagArray FAR *       lpPropTagArray) IPURE;      \
  1327.     MAPIMETHOD(GetRowCount)                                             \
  1328.         (THIS_  ULONG                       ulFlags,                    \
  1329.                 ULONG FAR *                 lpulCount) IPURE;           \
  1330.     MAPIMETHOD(SeekRow)                                                 \
  1331.         (THIS_  BOOKMARK                    bkOrigin,                   \
  1332.                 LONG                        lRowCount,                  \
  1333.                 LONG FAR *                  lplRowsSought) IPURE;       \
  1334.     MAPIMETHOD(SeekRowApprox)                                           \
  1335.         (THIS_  ULONG                       ulNumerator,                \
  1336.                 ULONG                       ulDenominator) IPURE;       \
  1337.     MAPIMETHOD(QueryPosition)                                           \
  1338.         (THIS_  ULONG FAR *                 lpulRow,                    \
  1339.                 ULONG FAR *                 lpulNumerator,              \
  1340.                 ULONG FAR *                 lpulDenominator) IPURE;     \
  1341.     MAPIMETHOD(FindRow)                                                 \
  1342.         (THIS_  LPSRestriction              lpRestriction,              \
  1343.                 BOOKMARK                    bkOrigin,                   \
  1344.                 ULONG                       ulFlags) IPURE;             \
  1345.     MAPIMETHOD(Restrict)                                                \
  1346.         (THIS_  LPSRestriction              lpRestriction,              \
  1347.                 ULONG                       ulFlags) IPURE;             \
  1348.     MAPIMETHOD(CreateBookmark)                                          \
  1349.         (THIS_  BOOKMARK FAR *              lpbkPosition) IPURE;        \
  1350.     MAPIMETHOD(FreeBookmark)                                            \
  1351.         (THIS_  BOOKMARK                    bkPosition) IPURE;          \
  1352.     MAPIMETHOD(SortTable)                                               \
  1353.         (THIS_  LPSSortOrderSet             lpSortCriteria,             \
  1354.                 ULONG                       ulFlags) IPURE;             \
  1355.     MAPIMETHOD(QuerySortOrder)                                          \
  1356.         (THIS_  LPSSortOrderSet FAR *       lppSortCriteria) IPURE;     \
  1357.     MAPIMETHOD(QueryRows)                                               \
  1358.         (THIS_  LONG                        lRowCount,                  \
  1359.                 ULONG                       ulFlags,                    \
  1360.                 LPSRowSet FAR *             lppRows) IPURE;             \
  1361.     MAPIMETHOD(Abort) (THIS) IPURE;                                     \
  1362.     MAPIMETHOD(ExpandRow)                                               \
  1363.         (THIS_  ULONG                       cbInstanceKey,              \
  1364.                 LPBYTE                      pbInstanceKey,              \
  1365.                 ULONG                       ulRowCount,                 \
  1366.                 ULONG                       ulFlags,                    \
  1367.                 LPSRowSet FAR *             lppRows,                    \
  1368.                 ULONG FAR *                 lpulMoreRows) IPURE;        \
  1369.     MAPIMETHOD(CollapseRow)                                             \
  1370.         (THIS_  ULONG                       cbInstanceKey,              \
  1371.                 LPBYTE                      pbInstanceKey,              \
  1372.                 ULONG                       ulFlags,                    \
  1373.                 ULONG FAR *                 lpulRowCount) IPURE;        \
  1374.     MAPIMETHOD(WaitForCompletion)                                       \
  1375.         (THIS_  ULONG                       ulFlags,                    \
  1376.                 ULONG                       ulTimeout,                  \
  1377.                 ULONG FAR *                 lpulTableStatus) IPURE;     \
  1378.     MAPIMETHOD(GetCollapseState)                                        \
  1379.         (THIS_  ULONG                       ulFlags,                    \
  1380.                 ULONG                       cbInstanceKey,              \
  1381.                 LPBYTE                      lpbInstanceKey,             \
  1382.                 ULONG FAR *                 lpcbCollapseState,          \
  1383.                 LPBYTE FAR *                lppbCollapseState) IPURE;   \
  1384.     MAPIMETHOD(SetCollapseState)                                        \
  1385.         (THIS_  ULONG                       ulFlags,                    \
  1386.                 ULONG                       cbCollapseState,            \
  1387.                 LPBYTE                      pbCollapseState,            \
  1388.                 BOOKMARK FAR *              lpbkLocation) IPURE;        \
  1389.  
  1390. #undef       INTERFACE
  1391. #define      INTERFACE  IMAPITable
  1392. DECLARE_MAPI_INTERFACE_(IMAPITable, IUnknown)
  1393. {
  1394.     BEGIN_INTERFACE 
  1395.     MAPI_IUNKNOWN_METHODS(PURE)
  1396.     MAPI_IMAPITABLE_METHODS(PURE)
  1397. };
  1398.  
  1399. /* IProfSect Interface ----------------------------------------------------- */
  1400.  
  1401. /* Standard section for public profile properties */
  1402.  
  1403. #define PS_PROFILE_PROPERTIES_INIT \
  1404. {   0x98, 0x15, 0xAC, 0x08, 0xAA, 0xB0, 0x10, 0x1A, \
  1405.     0x8C, 0x93, 0x08, 0x00, 0x2B, 0x2A, 0x56, 0xC2  }
  1406.  
  1407.  
  1408. #define MAPI_IPROFSECT_METHODS(IPURE)
  1409.  
  1410. #undef       INTERFACE
  1411. #define      INTERFACE  IProfSect
  1412. DECLARE_MAPI_INTERFACE_(IProfSect, IMAPIProp)
  1413. {
  1414.     BEGIN_INTERFACE 
  1415.     MAPI_IUNKNOWN_METHODS(PURE)
  1416.     MAPI_IMAPIPROP_METHODS(PURE)
  1417.     MAPI_IPROFSECT_METHODS(PURE)
  1418. };
  1419.  
  1420. /* IMAPIStatus Interface --------------------------------------------------- */
  1421.  
  1422. /* Values for PR_RESOURCE_TYPE, _METHODS, _FLAGS */
  1423.  
  1424. #define MAPI_STORE_PROVIDER     ((ULONG) 33)    /* Message Store */
  1425. #define MAPI_AB                 ((ULONG) 34)    /* Address Book */
  1426. #define MAPI_AB_PROVIDER        ((ULONG) 35)    /* Address Book Provider */
  1427. #define MAPI_TRANSPORT_PROVIDER ((ULONG) 36)    /* Transport Provider */
  1428. #define MAPI_SPOOLER            ((ULONG) 37)    /* Message Spooler */
  1429. #define MAPI_PROFILE_PROVIDER   ((ULONG) 38)    /* Profile Provider */
  1430. #define MAPI_SUBSYSTEM          ((ULONG) 39)    /* Overall Subsystem Status */
  1431. #define MAPI_HOOK_PROVIDER      ((ULONG) 40)    /* Spooler Hook */
  1432.  
  1433. #define STATUS_VALIDATE_STATE   ((ULONG) 0x00000001)
  1434. #define STATUS_SETTINGS_DIALOG  ((ULONG) 0x00000002)
  1435. #define STATUS_CHANGE_PASSWORD  ((ULONG) 0x00000004)
  1436. #define STATUS_FLUSH_QUEUES     ((ULONG) 0x00000008)
  1437.  
  1438. #define STATUS_DEFAULT_OUTBOUND ((ULONG) 0x00000001)
  1439. #define STATUS_DEFAULT_STORE    ((ULONG) 0x00000002)
  1440. #define STATUS_PRIMARY_IDENTITY ((ULONG) 0x00000004)
  1441. #define STATUS_SIMPLE_STORE     ((ULONG) 0x00000008)
  1442. #define STATUS_XP_PREFER_LAST   ((ULONG) 0x00000010)
  1443. #define STATUS_NO_PRIMARY_IDENTITY ((ULONG) 0x00000020)
  1444. #define STATUS_NO_DEFAULT_STORE ((ULONG) 0x00000040)
  1445. #define STATUS_TEMP_SECTION     ((ULONG) 0x00000080)
  1446. #define STATUS_OWN_STORE        ((ULONG) 0x00000100)
  1447. /****** HOOK_INBOUND            ((ULONG) 0x00000200) Defined in MAPIHOOK.H */
  1448. /****** HOOK_OUTBOUND           ((ULONG) 0x00000400) Defined in MAPIHOOK.H */
  1449. #define STATUS_NEED_IPM_TREE    ((ULONG) 0x00000800)
  1450. #define STATUS_PRIMARY_STORE    ((ULONG) 0x00001000)
  1451. #define STATUS_SECONDARY_STORE  ((ULONG) 0x00002000)
  1452.  
  1453.  
  1454. /*
  1455.  * PR_STATUS_CODE bit. Low 16 bits for common values; High 16 bits
  1456.  * for provider type-specific values. (DCR 304)
  1457.  */
  1458.  
  1459. #define STATUS_AVAILABLE        ((ULONG) 0x00000001)
  1460. #define STATUS_OFFLINE          ((ULONG) 0x00000002)
  1461. #define STATUS_FAILURE          ((ULONG) 0x00000004)
  1462.  
  1463. /* Transport values of PR_STATUS_CODE */
  1464.  
  1465. #define STATUS_INBOUND_ENABLED  ((ULONG) 0x00010000)
  1466. #define STATUS_INBOUND_ACTIVE   ((ULONG) 0x00020000)
  1467. #define STATUS_INBOUND_FLUSH    ((ULONG) 0x00040000)
  1468. #define STATUS_OUTBOUND_ENABLED ((ULONG) 0x00100000)
  1469. #define STATUS_OUTBOUND_ACTIVE  ((ULONG) 0x00200000)
  1470. #define STATUS_OUTBOUND_FLUSH   ((ULONG) 0x00400000)
  1471. #define STATUS_REMOTE_ACCESS    ((ULONG) 0x00800000)
  1472.  
  1473. /* ValidateState flags */
  1474.  
  1475. #define SUPPRESS_UI                 ((ULONG) 0x00000001)
  1476. #define REFRESH_XP_HEADER_CACHE     ((ULONG) 0x00010000)
  1477. #define PROCESS_XP_HEADER_CACHE     ((ULONG) 0x00020000)
  1478. #define FORCE_XP_CONNECT            ((ULONG) 0x00040000)
  1479. #define FORCE_XP_DISCONNECT         ((ULONG) 0x00080000)
  1480. #define CONFIG_CHANGED              ((ULONG) 0x00100000)
  1481. #define ABORT_XP_HEADER_OPERATION   ((ULONG) 0x00200000)
  1482. #define SHOW_XP_SESSION_UI          ((ULONG) 0x00400000)
  1483.  
  1484. /* SettingsDialog flags */
  1485.  
  1486. #define UI_READONLY     ((ULONG) 0x00000001)
  1487.  
  1488. /* FlushQueues flags */
  1489.  
  1490. #define FLUSH_UPLOAD        ((ULONG) 0x00000002)
  1491. #define FLUSH_DOWNLOAD      ((ULONG) 0x00000004)
  1492. #define FLUSH_FORCE         ((ULONG) 0x00000008)
  1493. #define FLUSH_NO_UI         ((ULONG) 0x00000010)
  1494. #define FLUSH_ASYNC_OK      ((ULONG) 0x00000020)
  1495.  
  1496. #define MAPI_IMAPISTATUS_METHODS(IPURE)                                 \
  1497.     MAPIMETHOD(ValidateState)                                           \
  1498.         (THIS_  ULONG                       ulUIParam,                  \
  1499.                 ULONG                       ulFlags) IPURE;             \
  1500.     MAPIMETHOD(SettingsDialog)                                          \
  1501.         (THIS_  ULONG                       ulUIParam,                  \
  1502.                 ULONG                       ulFlags) IPURE;             \
  1503.     MAPIMETHOD(ChangePassword)                                          \
  1504.         (THIS_  LPTSTR                      lpOldPass,                  \
  1505.                 LPTSTR                      lpNewPass,                  \
  1506.                 ULONG                       ulFlags) IPURE;             \
  1507.     MAPIMETHOD(FlushQueues)                                             \
  1508.         (THIS_  ULONG                       ulUIParam,                  \
  1509.                 ULONG                       cbTargetTransport,          \
  1510.                 LPENTRYID                   lpTargetTransport,          \
  1511.                 ULONG                       ulFlags) IPURE;             \
  1512.  
  1513. #undef       INTERFACE
  1514. #define      INTERFACE  IMAPIStatus
  1515. DECLARE_MAPI_INTERFACE_(IMAPIStatus, IMAPIProp)
  1516. {
  1517.     BEGIN_INTERFACE 
  1518.     MAPI_IUNKNOWN_METHODS(PURE)
  1519.     MAPI_IMAPIPROP_METHODS(PURE)
  1520.     MAPI_IMAPISTATUS_METHODS(PURE)
  1521. };
  1522.  
  1523. /* IMAPIContainer Interface ------------------------------------------------ */
  1524.  
  1525. /* Flags for OpenEntry() */
  1526.  
  1527. /****** MAPI_MODIFY             ((ULONG) 0x00000001) above */
  1528. /****** MAPI_DEFERRED_ERRORS    ((ULONG) 0x00000008) below */
  1529. #define MAPI_BEST_ACCESS        ((ULONG) 0x00000010)
  1530.  
  1531. /* GetContentsTable() */
  1532. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  1533. /****** MAPI_DEFERRED_ERRORS    ((ULONG) 0x00000008) below */
  1534. /****** MAPI_ASSOCIATED         ((ULONG) 0x00000040) below */
  1535.  
  1536. /* GetHierarchyTable() */
  1537. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  1538. #define CONVENIENT_DEPTH        ((ULONG) 0x00000001)
  1539. /****** MAPI_DEFERRED_ERRORS    ((ULONG) 0x00000008) below */
  1540.  
  1541. /* GetSearchCriteria */
  1542. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  1543. #define SEARCH_RUNNING          ((ULONG) 0x00000001)
  1544. #define SEARCH_REBUILD          ((ULONG) 0x00000002)
  1545. #define SEARCH_RECURSIVE        ((ULONG) 0x00000004)
  1546. #define SEARCH_FOREGROUND       ((ULONG) 0x00000008)
  1547.  
  1548. /* SetSearchCriteria */
  1549. #define STOP_SEARCH             ((ULONG) 0x00000001)
  1550. #define RESTART_SEARCH          ((ULONG) 0x00000002)
  1551. #define RECURSIVE_SEARCH        ((ULONG) 0x00000004)
  1552. #define SHALLOW_SEARCH          ((ULONG) 0x00000008)
  1553. #define FOREGROUND_SEARCH       ((ULONG) 0x00000010)
  1554. #define BACKGROUND_SEARCH       ((ULONG) 0x00000020)
  1555.  
  1556. #define MAPI_IMAPICONTAINER_METHODS(IPURE)                              \
  1557.     MAPIMETHOD(GetContentsTable)                                        \
  1558.         (THIS_  ULONG                       ulFlags,                    \
  1559.                 LPMAPITABLE FAR *           lppTable) IPURE;            \
  1560.     MAPIMETHOD(GetHierarchyTable)                                       \
  1561.         (THIS_  ULONG                       ulFlags,                    \
  1562.                 LPMAPITABLE FAR *           lppTable) IPURE;            \
  1563.     MAPIMETHOD(OpenEntry)                                               \
  1564.         (THIS_  ULONG                       cbEntryID,                  \
  1565.                 LPENTRYID                   lpEntryID,                  \
  1566.                 LPCIID                      lpInterface,                \
  1567.                 ULONG                       ulFlags,                    \
  1568.                 ULONG FAR *                 lpulObjType,                \
  1569.                 LPUNKNOWN FAR *             lppUnk) IPURE;              \
  1570.     MAPIMETHOD(SetSearchCriteria)                                       \
  1571.         (THIS_  LPSRestriction              lpRestriction,              \
  1572.                 LPENTRYLIST                 lpContainerList,            \
  1573.                 ULONG                       ulSearchFlags) IPURE;       \
  1574.     MAPIMETHOD(GetSearchCriteria)                                       \
  1575.         (THIS_  ULONG                       ulFlags,                    \
  1576.                 LPSRestriction FAR *        lppRestriction,             \
  1577.                 LPENTRYLIST FAR *           lppContainerList,           \
  1578.                 ULONG FAR *                 lpulSearchState)IPURE;      \
  1579.  
  1580. #undef       INTERFACE
  1581. #define      INTERFACE  IMAPIContainer
  1582. DECLARE_MAPI_INTERFACE_(IMAPIContainer, IMAPIProp)
  1583. {
  1584.     BEGIN_INTERFACE 
  1585.     MAPI_IUNKNOWN_METHODS(PURE)
  1586.     MAPI_IMAPIPROP_METHODS(PURE)
  1587.     MAPI_IMAPICONTAINER_METHODS(PURE)
  1588. };
  1589.  
  1590. /* IABContainer Interface -------------------------------------------------- */
  1591.  
  1592. /*
  1593.  *  IABContainer PR_CONTAINER_FLAGS values
  1594.  *  If AB_UNMODIFIABLE and AB_MODIFIABLE are both set, it means the container
  1595.  *  doesn't know if it's modifiable or not, and the client should
  1596.  *  try to modify the contents but we won't expect it to work.
  1597.  *  If the AB_RECIPIENTS flag is set and neither AB_MODIFIABLE or AB_UNMODIFIABLE
  1598.  *  bits are set, it is an error.
  1599.  */
  1600.  
  1601. typedef struct _flaglist
  1602. {
  1603.     ULONG cFlags;
  1604.     ULONG ulFlag[MAPI_DIM];
  1605. } FlagList, FAR * LPFlagList;
  1606.  
  1607.  
  1608. /*
  1609.  *  Container flags
  1610.  */
  1611. #define AB_RECIPIENTS           ((ULONG) 0x00000001)
  1612. #define AB_SUBCONTAINERS        ((ULONG) 0x00000002)
  1613. #define AB_MODIFIABLE           ((ULONG) 0x00000004)
  1614. #define AB_UNMODIFIABLE         ((ULONG) 0x00000008)
  1615. #define AB_FIND_ON_OPEN         ((ULONG) 0x00000010)
  1616. #define AB_NOT_DEFAULT          ((ULONG) 0x00000020)
  1617.  
  1618. /* CreateEntry() */
  1619.  
  1620. #define CREATE_CHECK_DUP_STRICT ((ULONG) 0x00000001)
  1621. #define CREATE_CHECK_DUP_LOOSE  ((ULONG) 0x00000002)
  1622. #define CREATE_REPLACE          ((ULONG) 0x00000004)
  1623.  
  1624. /* ResolveNames() - ulFlags */
  1625. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  1626.  
  1627. /* ResolveNames() - rgulFlags */
  1628. #define MAPI_UNRESOLVED         ((ULONG) 0x00000000)
  1629. #define MAPI_AMBIGUOUS          ((ULONG) 0x00000001)
  1630. #define MAPI_RESOLVED           ((ULONG) 0x00000002) 
  1631.  
  1632.  
  1633. #define MAPI_IABCONTAINER_METHODS(IPURE)                                \
  1634.     MAPIMETHOD(CreateEntry)                                             \
  1635.         (THIS_  ULONG                       cbEntryID,                  \
  1636.                 LPENTRYID                   lpEntryID,                  \
  1637.                 ULONG                       ulCreateFlags,              \
  1638.                 LPMAPIPROP FAR  *           lppMAPIPropEntry) IPURE;    \
  1639.     MAPIMETHOD(CopyEntries)                                             \
  1640.         (THIS_  LPENTRYLIST                 lpEntries,                  \
  1641.                 ULONG                       ulUIParam,                  \
  1642.                 LPMAPIPROGRESS              lpProgress,                 \
  1643.                 ULONG                       ulFlags) IPURE;             \
  1644.     MAPIMETHOD(DeleteEntries)                                           \
  1645.         (THIS_  LPENTRYLIST                 lpEntries,                  \
  1646.                 ULONG                       ulFlags) IPURE;             \
  1647.     MAPIMETHOD(ResolveNames)                                            \
  1648.         (THIS_  LPSPropTagArray             lpPropTagArray,             \
  1649.                 ULONG                       ulFlags,                    \
  1650.                 LPADRLIST                   lpAdrList,                  \
  1651.                 LPFlagList                  lpFlagList) IPURE;          \
  1652.  
  1653. #undef       INTERFACE
  1654. #define      INTERFACE  IABContainer
  1655. DECLARE_MAPI_INTERFACE_(IABContainer, IMAPIContainer)
  1656. {
  1657.     BEGIN_INTERFACE 
  1658.     MAPI_IUNKNOWN_METHODS(PURE)
  1659.     MAPI_IMAPIPROP_METHODS(PURE)
  1660.     MAPI_IMAPICONTAINER_METHODS(PURE)
  1661.     MAPI_IABCONTAINER_METHODS(PURE)
  1662. };
  1663.  
  1664. /* IMailUser Interface ----------------------------------------------------- */
  1665.  
  1666. /*  Any call which can create a one-off entryID (i.e. MAPISupport::CreateOneOff
  1667.     or IAdrBook::CreateOneOff) can encode the value for PR_SEND_RICH_INFO by
  1668.     passing in the following flag in the ulFlags parameter.  Setting this flag
  1669.     indicates that PR_SEND_RICH_INFO will be FALSE.
  1670. */
  1671. #define MAPI_SEND_NO_RICH_INFO      ((ULONG) 0x00010000)
  1672.  
  1673.  
  1674.  
  1675.  
  1676. /* Values of PR_NDR_DIAG_CODE */
  1677.  
  1678. #define MAPI_DIAG(_code)    ((LONG) _code)
  1679.  
  1680. #define MAPI_DIAG_NO_DIAGNOSTIC                     MAPI_DIAG( -1 )
  1681. #define MAPI_DIAG_OR_NAME_UNRECOGNIZED              MAPI_DIAG( 0 )
  1682. #define MAPI_DIAG_OR_NAME_AMBIGUOUS                 MAPI_DIAG( 1 )
  1683. #define MAPI_DIAG_MTS_CONGESTED                     MAPI_DIAG( 2 )
  1684. #define MAPI_DIAG_LOOP_DETECTED                     MAPI_DIAG( 3 )
  1685. #define MAPI_DIAG_RECIPIENT_UNAVAILABLE             MAPI_DIAG( 4 )
  1686. #define MAPI_DIAG_MAXIMUM_TIME_EXPIRED              MAPI_DIAG( 5 )
  1687. #define MAPI_DIAG_EITS_UNSUPPORTED                  MAPI_DIAG( 6 )
  1688. #define MAPI_DIAG_CONTENT_TOO_LONG                  MAPI_DIAG( 7 )
  1689. #define MAPI_DIAG_IMPRACTICAL_TO_CONVERT            MAPI_DIAG( 8 )
  1690. #define MAPI_DIAG_PROHIBITED_TO_CONVERT             MAPI_DIAG( 9 )
  1691. #define MAPI_DIAG_CONVERSION_UNSUBSCRIBED           MAPI_DIAG( 10 )
  1692. #define MAPI_DIAG_PARAMETERS_INVALID                MAPI_DIAG( 11 )
  1693. #define MAPI_DIAG_CONTENT_SYNTAX_IN_ERROR           MAPI_DIAG( 12 )
  1694. #define MAPI_DIAG_LENGTH_CONSTRAINT_VIOLATD         MAPI_DIAG( 13 )
  1695. #define MAPI_DIAG_NUMBER_CONSTRAINT_VIOLATD         MAPI_DIAG( 14 )
  1696. #define MAPI_DIAG_CONTENT_TYPE_UNSUPPORTED          MAPI_DIAG( 15 )
  1697. #define MAPI_DIAG_TOO_MANY_RECIPIENTS               MAPI_DIAG( 16 )
  1698. #define MAPI_DIAG_NO_BILATERAL_AGREEMENT            MAPI_DIAG( 17 )
  1699. #define MAPI_DIAG_CRITICAL_FUNC_UNSUPPORTED         MAPI_DIAG( 18 )
  1700. #define MAPI_DIAG_CONVERSION_LOSS_PROHIB            MAPI_DIAG( 19 )
  1701. #define MAPI_DIAG_LINE_TOO_LONG                     MAPI_DIAG( 20 )
  1702. #define MAPI_DIAG_PAGE_TOO_LONG                     MAPI_DIAG( 21 )
  1703. #define MAPI_DIAG_PICTORIAL_SYMBOL_LOST             MAPI_DIAG( 22 )
  1704. #define MAPI_DIAG_PUNCTUATION_SYMBOL_LOST           MAPI_DIAG( 23 )
  1705. #define MAPI_DIAG_ALPHABETIC_CHARACTER_LOST         MAPI_DIAG( 24 )
  1706. #define MAPI_DIAG_MULTIPLE_INFO_LOSSES              MAPI_DIAG( 25 )
  1707. #define MAPI_DIAG_REASSIGNMENT_PROHIBITED           MAPI_DIAG( 26 )
  1708. #define MAPI_DIAG_REDIRECTION_LOOP_DETECTED         MAPI_DIAG( 27 )
  1709. #define MAPI_DIAG_EXPANSION_PROHIBITED              MAPI_DIAG( 28 )
  1710. #define MAPI_DIAG_SUBMISSION_PROHIBITED             MAPI_DIAG( 29 )
  1711. #define MAPI_DIAG_EXPANSION_FAILED                  MAPI_DIAG( 30 )
  1712. #define MAPI_DIAG_RENDITION_UNSUPPORTED             MAPI_DIAG( 31 )
  1713. #define MAPI_DIAG_MAIL_ADDRESS_INCORRECT            MAPI_DIAG( 32 )
  1714. #define MAPI_DIAG_MAIL_OFFICE_INCOR_OR_INVD         MAPI_DIAG( 33 )
  1715. #define MAPI_DIAG_MAIL_ADDRESS_INCOMPLETE           MAPI_DIAG( 34 )
  1716. #define MAPI_DIAG_MAIL_RECIPIENT_UNKNOWN            MAPI_DIAG( 35 )
  1717. #define MAPI_DIAG_MAIL_RECIPIENT_DECEASED           MAPI_DIAG( 36 )
  1718. #define MAPI_DIAG_MAIL_ORGANIZATION_EXPIRED         MAPI_DIAG( 37 )
  1719. #define MAPI_DIAG_MAIL_REFUSED                      MAPI_DIAG( 38 )
  1720. #define MAPI_DIAG_MAIL_UNCLAIMED                    MAPI_DIAG( 39 )
  1721. #define MAPI_DIAG_MAIL_RECIPIENT_MOVED              MAPI_DIAG( 40 )
  1722. #define MAPI_DIAG_MAIL_RECIPIENT_TRAVELLING         MAPI_DIAG( 41 )
  1723. #define MAPI_DIAG_MAIL_RECIPIENT_DEPARTED           MAPI_DIAG( 42 )
  1724. #define MAPI_DIAG_MAIL_NEW_ADDRESS_UNKNOWN          MAPI_DIAG( 43 )
  1725. #define MAPI_DIAG_MAIL_FORWARDING_UNWANTED          MAPI_DIAG( 44 )
  1726. #define MAPI_DIAG_MAIL_FORWARDING_PROHIB            MAPI_DIAG( 45 )
  1727. #define MAPI_DIAG_SECURE_MESSAGING_ERROR            MAPI_DIAG( 46 )
  1728. #define MAPI_DIAG_DOWNGRADING_IMPOSSIBLE            MAPI_DIAG( 47 )
  1729.  
  1730.  
  1731. #define MAPI_IMAILUSER_METHODS(IPURE)
  1732.  
  1733. #undef       INTERFACE
  1734. #define      INTERFACE  IMailUser
  1735. DECLARE_MAPI_INTERFACE_(IMailUser, IMAPIProp)
  1736. {
  1737.     BEGIN_INTERFACE 
  1738.     MAPI_IUNKNOWN_METHODS(PURE)
  1739.     MAPI_IMAPIPROP_METHODS(PURE)
  1740.     MAPI_IMAILUSER_METHODS(PURE)
  1741. };
  1742.  
  1743. /* IDistList Interface ----------------------------------------------------- */
  1744.  
  1745. #define MAPI_IDISTLIST_METHODS(IPURE)                                   \
  1746.     MAPIMETHOD(CreateEntry)                                             \
  1747.         (THIS_  ULONG                       cbEntryID,                  \
  1748.                 LPENTRYID                   lpEntryID,                  \
  1749.                 ULONG                       ulCreateFlags,              \
  1750.                 LPMAPIPROP FAR  *           lppMAPIPropEntry) IPURE;    \
  1751.     MAPIMETHOD(CopyEntries)                                             \
  1752.         (THIS_  LPENTRYLIST                 lpEntries,                  \
  1753.                 ULONG                       ulUIParam,                  \
  1754.                 LPMAPIPROGRESS              lpProgress,                 \
  1755.                 ULONG                       ulFlags) IPURE;             \
  1756.     MAPIMETHOD(DeleteEntries)                                           \
  1757.         (THIS_  LPENTRYLIST                 lpEntries,                  \
  1758.                 ULONG                       ulFlags) IPURE;             \
  1759.     MAPIMETHOD(ResolveNames)                                            \
  1760.         (THIS_  LPSPropTagArray             lpPropTagArray,             \
  1761.                 ULONG                       ulFlags,                    \
  1762.                 LPADRLIST                   lpAdrList,                  \
  1763.                 LPFlagList                  lpFlagList) IPURE;          \
  1764.  
  1765. #undef       INTERFACE
  1766. #define      INTERFACE  IDistList
  1767. DECLARE_MAPI_INTERFACE_(IDistList, IMAPIContainer)
  1768. {
  1769.     BEGIN_INTERFACE 
  1770.     MAPI_IUNKNOWN_METHODS(PURE)
  1771.     MAPI_IMAPIPROP_METHODS(PURE)
  1772.     MAPI_IMAPICONTAINER_METHODS(PURE)
  1773.     MAPI_IDISTLIST_METHODS(PURE)
  1774. };
  1775.  
  1776. /* IMAPIFolder Interface --------------------------------------------------- */
  1777.  
  1778. /* IMAPIFolder folder type (enum) */
  1779.  
  1780. #define FOLDER_ROOT             ((ULONG) 0x00000000)
  1781. #define FOLDER_GENERIC          ((ULONG) 0x00000001)
  1782. #define FOLDER_SEARCH           ((ULONG) 0x00000002)
  1783.  
  1784. /* CreateMessage */
  1785. /****** MAPI_DEFERRED_ERRORS    ((ULONG) 0x00000008) below */
  1786. /****** MAPI_ASSOCIATED         ((ULONG) 0x00000040) below */
  1787.  
  1788. /* CopyMessages */
  1789.  
  1790. #define MESSAGE_MOVE            ((ULONG) 0x00000001)
  1791. #define MESSAGE_DIALOG          ((ULONG) 0x00000002)
  1792. /****** MAPI_DECLINE_OK         ((ULONG) 0x00000004) above */
  1793.  
  1794. /* CreateFolder */
  1795.  
  1796. #define OPEN_IF_EXISTS          ((ULONG) 0x00000001)
  1797. /****** MAPI_DEFERRED_ERRORS    ((ULONG) 0x00000008) below */
  1798. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  1799.  
  1800. /* DeleteFolder */
  1801.  
  1802. #define DEL_MESSAGES            ((ULONG) 0x00000001)
  1803. #define FOLDER_DIALOG           ((ULONG) 0x00000002)
  1804. #define DEL_FOLDERS             ((ULONG) 0x00000004)
  1805.  
  1806. /* EmptyFolder */
  1807. #define DEL_ASSOCIATED          ((ULONG) 0x00000008)
  1808.  
  1809. /* CopyFolder */
  1810.  
  1811. #define FOLDER_MOVE             ((ULONG) 0x00000001)
  1812. /****** FOLDER_DIALOG           ((ULONG) 0x00000002) above */
  1813. /****** MAPI_DECLINE_OK         ((ULONG) 0x00000004) above */
  1814. #define COPY_SUBFOLDERS         ((ULONG) 0x00000010)
  1815. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  1816.  
  1817.  
  1818. /* SetReadFlags */
  1819.  
  1820. /****** SUPPRESS_RECEIPT        ((ULONG) 0x00000001) below */
  1821. /****** MESSAGE_DIALOG          ((ULONG) 0x00000002) above */
  1822. /****** CLEAR_READ_FLAG         ((ULONG) 0x00000004) below */
  1823. /****** MAPI_DEFERRED_ERRORS    ((ULONG) 0x00000008) below */
  1824. #define GENERATE_RECEIPT_ONLY   ((ULONG) 0x00000010)
  1825.  
  1826.  
  1827. /* GetMessageStatus */
  1828.  
  1829. #define MSGSTATUS_HIGHLIGHTED   ((ULONG) 0x00000001)
  1830. #define MSGSTATUS_TAGGED        ((ULONG) 0x00000002)
  1831. #define MSGSTATUS_HIDDEN        ((ULONG) 0x00000004)
  1832. #define MSGSTATUS_DELMARKED     ((ULONG) 0x00000008)
  1833.  
  1834. /* Bits for remote message status */
  1835.  
  1836. #define MSGSTATUS_REMOTE_DOWNLOAD   ((ULONG) 0x00001000)
  1837. #define MSGSTATUS_REMOTE_DELETE     ((ULONG) 0x00002000)
  1838.  
  1839. /* SaveContentsSort */
  1840.  
  1841. #define RECURSIVE_SORT          ((ULONG) 0x00000002)
  1842.  
  1843. /* PR_STATUS property */
  1844.  
  1845. #define FLDSTATUS_HIGHLIGHTED   ((ULONG) 0x00000001)
  1846. #define FLDSTATUS_TAGGED        ((ULONG) 0x00000002)
  1847. #define FLDSTATUS_HIDDEN        ((ULONG) 0x00000004)
  1848. #define FLDSTATUS_DELMARKED     ((ULONG) 0x00000008)
  1849.  
  1850. #define MAPI_IMAPIFOLDER_METHODS(IPURE)                                 \
  1851.     MAPIMETHOD(CreateMessage)                                           \
  1852.         (THIS_  LPCIID                      lpInterface,                \
  1853.                 ULONG                       ulFlags,                    \
  1854.                 LPMESSAGE FAR *             lppMessage) IPURE;          \
  1855.     MAPIMETHOD(CopyMessages)                                            \
  1856.         (THIS_  LPENTRYLIST                 lpMsgList,                  \
  1857.                 LPCIID                      lpInterface,                \
  1858.                 LPVOID                      lpDestFolder,               \
  1859.                 ULONG                       ulUIParam,                  \
  1860.                 LPMAPIPROGRESS              lpProgress,                 \
  1861.                 ULONG                       ulFlags) IPURE;             \
  1862.     MAPIMETHOD(DeleteMessages)                                          \
  1863.         (THIS_  LPENTRYLIST                 lpMsgList,                  \
  1864.                 ULONG                       ulUIParam,                  \
  1865.                 LPMAPIPROGRESS              lpProgress,                 \
  1866.                 ULONG                       ulFlags) IPURE;             \
  1867.     MAPIMETHOD(CreateFolder)                                            \
  1868.         (THIS_  ULONG                       ulFolderType,               \
  1869.                 LPTSTR                      lpszFolderName,             \
  1870.                 LPTSTR                      lpszFolderComment,          \
  1871.                 LPCIID                      lpInterface,                \
  1872.                 ULONG                       ulFlags,                    \
  1873.                 LPMAPIFOLDER FAR *          lppFolder) IPURE;           \
  1874.     MAPIMETHOD(CopyFolder)                                              \
  1875.         (THIS_  ULONG                       cbEntryID,                  \
  1876.                 LPENTRYID                   lpEntryID,                  \
  1877.                 LPCIID                      lpInterface,                \
  1878.                 LPVOID                      lpDestFolder,               \
  1879.                 LPTSTR                      lpszNewFolderName,          \
  1880.                 ULONG                       ulUIParam,                  \
  1881.                 LPMAPIPROGRESS              lpProgress,                 \
  1882.                 ULONG                       ulFlags) IPURE;             \
  1883.     MAPIMETHOD(DeleteFolder)                                            \
  1884.         (THIS_  ULONG                       cbEntryID,                  \
  1885.                 LPENTRYID                   lpEntryID,                  \
  1886.                 ULONG                       ulUIParam,                  \
  1887.                 LPMAPIPROGRESS              lpProgress,                 \
  1888.                 ULONG                       ulFlags) IPURE;             \
  1889.     MAPIMETHOD(SetReadFlags)                                            \
  1890.         (THIS_  LPENTRYLIST                 lpMsgList,                  \
  1891.                 ULONG                       ulUIParam,                  \
  1892.                 LPMAPIPROGRESS              lpProgress,                 \
  1893.                 ULONG                       ulFlags) IPURE;             \
  1894.     MAPIMETHOD(GetMessageStatus)                                        \
  1895.         (THIS_  ULONG                       cbEntryID,                  \
  1896.                 LPENTRYID                   lpEntryID,                  \
  1897.                 ULONG                       ulFlags,                    \
  1898.                 ULONG FAR *                 lpulMessageStatus) IPURE;   \
  1899.     MAPIMETHOD(SetMessageStatus)                                        \
  1900.         (THIS_  ULONG                       cbEntryID,                  \
  1901.                 LPENTRYID                   lpEntryID,                  \
  1902.                 ULONG                       ulNewStatus,                \
  1903.                 ULONG                       ulNewStatusMask,            \
  1904.                 ULONG FAR *                 lpulOldStatus) IPURE;       \
  1905.     MAPIMETHOD(SaveContentsSort)                                        \
  1906.         (THIS_  LPSSortOrderSet             lpSortCriteria,             \
  1907.                 ULONG                       ulFlags) IPURE;             \
  1908.     MAPIMETHOD(EmptyFolder)                                             \
  1909.         (THIS_  ULONG                       ulUIParam,                  \
  1910.                 LPMAPIPROGRESS              lpProgress,                 \
  1911.                 ULONG                       ulFlags) IPURE;             \
  1912.  
  1913. #undef       INTERFACE
  1914. #define      INTERFACE  IMAPIFolder
  1915. DECLARE_MAPI_INTERFACE_(IMAPIFolder, IMAPIContainer)
  1916. {
  1917.     BEGIN_INTERFACE 
  1918.     MAPI_IUNKNOWN_METHODS(PURE)
  1919.     MAPI_IMAPIPROP_METHODS(PURE)
  1920.     MAPI_IMAPICONTAINER_METHODS(PURE)
  1921.     MAPI_IMAPIFOLDER_METHODS(PURE)
  1922. };
  1923.  
  1924. /* IMsgStore Interface ----------------------------------------------------- */
  1925.  
  1926. /*  PR_STORE_SUPPORT_MASK bits */
  1927. #define STORE_ENTRYID_UNIQUE    ((ULONG) 0x00000001)
  1928. #define STORE_READONLY          ((ULONG) 0x00000002)
  1929. #define STORE_SEARCH_OK         ((ULONG) 0x00000004)
  1930. #define STORE_MODIFY_OK         ((ULONG) 0x00000008)
  1931. #define STORE_CREATE_OK         ((ULONG) 0x00000010)
  1932. #define STORE_ATTACH_OK         ((ULONG) 0x00000020)
  1933. #define STORE_OLE_OK            ((ULONG) 0x00000040)
  1934. #define STORE_SUBMIT_OK         ((ULONG) 0x00000080)
  1935. #define STORE_NOTIFY_OK         ((ULONG) 0x00000100)
  1936. #define STORE_MV_PROPS_OK       ((ULONG) 0x00000200)
  1937. #define STORE_CATEGORIZE_OK     ((ULONG) 0x00000400)
  1938. #define STORE_RTF_OK            ((ULONG) 0x00000800)
  1939. #define STORE_RESTRICTION_OK    ((ULONG) 0x00001000)
  1940. #define STORE_SORT_OK           ((ULONG) 0x00002000)
  1941.  
  1942. /* PR_STORE_STATE bits, try not to collide with PR_STORE_SUPPORT_MASK */
  1943.  
  1944. #define STORE_HAS_SEARCHES      ((ULONG) 0x01000000)
  1945.  
  1946.  
  1947. /* OpenEntry() */
  1948.  
  1949. /****** MAPI_MODIFY             ((ULONG) 0x00000001) above */
  1950. /****** MAPI_DEFERRED_ERRORS    ((ULONG) 0x00000008) below */
  1951. /****** MAPI_BEST_ACCESS        ((ULONG) 0x00000010) above */
  1952.  
  1953. /* SetReceiveFolder() */
  1954.  
  1955. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  1956.  
  1957. /* GetReceiveFolder() */
  1958.  
  1959. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  1960.  
  1961. /* GetReceiveFolderTable() */
  1962.  
  1963. /****** MAPI_DEFERRED_ERRORS    ((ULONG) 0x00000008) below */
  1964.  
  1965. /* StoreLogoff() */
  1966.  
  1967. #define LOGOFF_NO_WAIT          ((ULONG) 0x00000001)
  1968. #define LOGOFF_ORDERLY          ((ULONG) 0x00000002)
  1969. #define LOGOFF_PURGE            ((ULONG) 0x00000004)
  1970. #define LOGOFF_ABORT            ((ULONG) 0x00000008)
  1971. #define LOGOFF_QUIET            ((ULONG) 0x00000010)
  1972.  
  1973. #define LOGOFF_COMPLETE         ((ULONG) 0x00010000)
  1974. #define LOGOFF_INBOUND          ((ULONG) 0x00020000)
  1975. #define LOGOFF_OUTBOUND         ((ULONG) 0x00040000)
  1976. #define LOGOFF_OUTBOUND_QUEUE   ((ULONG) 0x00080000)
  1977.  
  1978. /* SetLockState() */
  1979.  
  1980. #define MSG_LOCKED              ((ULONG) 0x00000001)
  1981. #define MSG_UNLOCKED            ((ULONG) 0x00000000)
  1982.  
  1983. /* Flag bits for PR_VALID_FOLDER_MASK */
  1984.  
  1985. #define FOLDER_IPM_SUBTREE_VALID        ((ULONG) 0x00000001)
  1986. #define FOLDER_IPM_INBOX_VALID          ((ULONG) 0x00000002)
  1987. #define FOLDER_IPM_OUTBOX_VALID         ((ULONG) 0x00000004)
  1988. #define FOLDER_IPM_WASTEBASKET_VALID    ((ULONG) 0x00000008)
  1989. #define FOLDER_IPM_SENTMAIL_VALID       ((ULONG) 0x00000010)
  1990. #define FOLDER_VIEWS_VALID              ((ULONG) 0x00000020)
  1991. #define FOLDER_COMMON_VIEWS_VALID       ((ULONG) 0x00000040)
  1992. #define FOLDER_FINDER_VALID             ((ULONG) 0x00000080)
  1993.  
  1994. #define MAPI_IMSGSTORE_METHODS(IPURE)                                   \
  1995.     MAPIMETHOD(Advise)                                                  \
  1996.         (THIS_  ULONG                       cbEntryID,                  \
  1997.                 LPENTRYID                   lpEntryID,                  \
  1998.                 ULONG                       ulEventMask,                \
  1999.                 LPMAPIADVISESINK            lpAdviseSink,               \
  2000.                 ULONG FAR *                 lpulConnection) IPURE;      \
  2001.     MAPIMETHOD(Unadvise)                                                \
  2002.         (THIS_  ULONG                       ulConnection) IPURE;        \
  2003.     MAPIMETHOD(CompareEntryIDs)                                         \
  2004.         (THIS_  ULONG                       cbEntryID1,                 \
  2005.                 LPENTRYID                   lpEntryID1,                 \
  2006.                 ULONG                       cbEntryID2,                 \
  2007.                 LPENTRYID                   lpEntryID2,                 \
  2008.                 ULONG                       ulFlags,                    \
  2009.                 ULONG FAR *                 lpulResult) IPURE;          \
  2010.     MAPIMETHOD(OpenEntry)                                               \
  2011.         (THIS_  ULONG                       cbEntryID,                  \
  2012.                 LPENTRYID                   lpEntryID,                  \
  2013.                 LPCIID                      lpInterface,                \
  2014.                 ULONG                       ulFlags,                    \
  2015.                 ULONG FAR *                 lpulObjType,                \
  2016.                 LPUNKNOWN FAR *             lppUnk) IPURE;              \
  2017.     MAPIMETHOD(SetReceiveFolder)                                        \
  2018.         (THIS_  LPTSTR                      lpszMessageClass,           \
  2019.                 ULONG                       ulFlags,                    \
  2020.                 ULONG                       cbEntryID,                  \
  2021.                 LPENTRYID                   lpEntryID) IPURE;           \
  2022.     MAPIMETHOD(GetReceiveFolder)                                        \
  2023.         (THIS_  LPTSTR                      lpszMessageClass,           \
  2024.                 ULONG                       ulFlags,                    \
  2025.                 ULONG FAR *                 lpcbEntryID,                \
  2026.                 LPENTRYID FAR *             lppEntryID,                 \
  2027.                 LPTSTR FAR *                lppszExplicitClass) IPURE;  \
  2028.     MAPIMETHOD(GetReceiveFolderTable)                                   \
  2029.         (THIS_  ULONG                       ulFlags,                    \
  2030.                 LPMAPITABLE FAR *           lppTable) IPURE;            \
  2031.     MAPIMETHOD(StoreLogoff)                                             \
  2032.         (THIS_  ULONG FAR *                 lpulFlags) IPURE;           \
  2033.     MAPIMETHOD(AbortSubmit)                                             \
  2034.         (THIS_  ULONG                       cbEntryID,                  \
  2035.                 LPENTRYID                   lpEntryID,                  \
  2036.                 ULONG                       ulFlags) IPURE;             \
  2037.     MAPIMETHOD(GetOutgoingQueue)                                        \
  2038.         (THIS_  ULONG                       ulFlags,                    \
  2039.                 LPMAPITABLE FAR *           lppTable) IPURE;            \
  2040.     MAPIMETHOD(SetLockState)                                            \
  2041.         (THIS_  LPMESSAGE                   lpMessage,                  \
  2042.                 ULONG                       ulLockState) IPURE;         \
  2043.     MAPIMETHOD(FinishedMsg)                                             \
  2044.         (THIS_  ULONG                       ulFlags,                    \
  2045.                 ULONG                       cbEntryID,                  \
  2046.                 LPENTRYID                   lpEntryID) IPURE;           \
  2047.     MAPIMETHOD(NotifyNewMail)                                           \
  2048.         (THIS_  LPNOTIFICATION              lpNotification) IPURE;      \
  2049.  
  2050. #undef       INTERFACE
  2051. #define      INTERFACE  IMsgStore
  2052. DECLARE_MAPI_INTERFACE_(IMsgStore, IMAPIProp)
  2053. {
  2054.     BEGIN_INTERFACE 
  2055.     MAPI_IUNKNOWN_METHODS(PURE)
  2056.     MAPI_IMAPIPROP_METHODS(PURE)
  2057.     MAPI_IMSGSTORE_METHODS(PURE)
  2058. };
  2059.  
  2060. /* IMessage Interface ------------------------------------------------------ */
  2061.  
  2062. /* SubmitMessage */
  2063.  
  2064. #define FORCE_SUBMIT                ((ULONG) 0x00000001)
  2065.  
  2066. /* Flags defined in PR_MESSAGE_FLAGS */
  2067.  
  2068. #define MSGFLAG_READ            ((ULONG) 0x00000001)
  2069. #define MSGFLAG_UNMODIFIED      ((ULONG) 0x00000002)
  2070. #define MSGFLAG_SUBMIT          ((ULONG) 0x00000004)
  2071. #define MSGFLAG_UNSENT          ((ULONG) 0x00000008)
  2072. #define MSGFLAG_HASATTACH       ((ULONG) 0x00000010)
  2073. #define MSGFLAG_FROMME          ((ULONG) 0x00000020)
  2074. #define MSGFLAG_ASSOCIATED      ((ULONG) 0x00000040)
  2075. #define MSGFLAG_RESEND          ((ULONG) 0x00000080)
  2076.  
  2077. /* Flags defined in PR_SUBMIT_FLAGS */
  2078.  
  2079. #define SUBMITFLAG_LOCKED       ((ULONG) 0x00000001)
  2080. #define SUBMITFLAG_PREPROCESS   ((ULONG) 0x00000002)
  2081.  
  2082. /* GetAttachmentTable() */
  2083. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  2084.  
  2085. /* GetRecipientTable() */
  2086. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  2087.  
  2088. /* ModifyRecipients */
  2089.  
  2090. /* ((ULONG) 0x00000001 is not a valid flag on ModifyRecipients. */
  2091. #define MODRECIP_ADD            ((ULONG) 0x00000002)
  2092. #define MODRECIP_MODIFY         ((ULONG) 0x00000004)
  2093. #define MODRECIP_REMOVE         ((ULONG) 0x00000008)
  2094.  
  2095. /* SetReadFlag */
  2096.  
  2097. #define SUPPRESS_RECEIPT        ((ULONG) 0x00000001)
  2098. #define CLEAR_READ_FLAG         ((ULONG) 0x00000004)
  2099. /****** MAPI_DEFERRED_ERRORS    ((ULONG) 0x00000008) below */
  2100. /****** GENERATE_RECEIPT_ONLY   ((ULONG) 0x00000010) above */
  2101.  
  2102. /* DeleteAttach */
  2103.  
  2104. #define ATTACH_DIALOG           ((ULONG) 0x00000001)
  2105.  
  2106. /* PR_SECURITY values */
  2107. #define SECURITY_SIGNED         ((ULONG) 0x00000001)
  2108. #define SECURITY_ENCRYPTED      ((ULONG) 0x00000002)
  2109.  
  2110. /* PR_PRIORITY values */
  2111. #define PRIO_URGENT             ((long)  1)
  2112. #define PRIO_NORMAL             ((long)  0)
  2113. #define PRIO_NONURGENT          ((long) -1)
  2114.  
  2115. /* PR_SENSITIVITY values */
  2116. #define SENSITIVITY_NONE                    ((ULONG) 0x00000000)
  2117. #define SENSITIVITY_PERSONAL                ((ULONG) 0x00000001)
  2118. #define SENSITIVITY_PRIVATE                 ((ULONG) 0x00000002)
  2119. #define SENSITIVITY_COMPANY_CONFIDENTIAL    ((ULONG) 0x00000003)
  2120.  
  2121. /* PR_IMPORTANCE values */
  2122. #define IMPORTANCE_LOW          ((long) 0)
  2123. #define IMPORTANCE_NORMAL       ((long) 1)
  2124. #define IMPORTANCE_HIGH         ((long) 2)
  2125.  
  2126. #define MAPI_IMESSAGE_METHODS(IPURE)                                    \
  2127.     MAPIMETHOD(GetAttachmentTable)                                      \
  2128.         (THIS_  ULONG                       ulFlags,                    \
  2129.                 LPMAPITABLE FAR *           lppTable) IPURE;            \
  2130.     MAPIMETHOD(OpenAttach)                                              \
  2131.         (THIS_  ULONG                       ulAttachmentNum,            \
  2132.                 LPCIID                      lpInterface,                \
  2133.                 ULONG                       ulFlags,                    \
  2134.                 LPATTACH FAR *              lppAttach) IPURE;           \
  2135.     MAPIMETHOD(CreateAttach)                                            \
  2136.         (THIS_  LPCIID                      lpInterface,                \
  2137.                 ULONG                       ulFlags,                    \
  2138.                 ULONG FAR *                 lpulAttachmentNum,          \
  2139.                 LPATTACH FAR *              lppAttach) IPURE;           \
  2140.     MAPIMETHOD(DeleteAttach)                                            \
  2141.         (THIS_  ULONG                       ulAttachmentNum,            \
  2142.                 ULONG                       ulUIParam,                  \
  2143.                 LPMAPIPROGRESS              lpProgress,                 \
  2144.                 ULONG                       ulFlags) IPURE;             \
  2145.     MAPIMETHOD(GetRecipientTable)                                       \
  2146.         (THIS_  ULONG                       ulFlags,                    \
  2147.                 LPMAPITABLE FAR *           lppTable) IPURE;            \
  2148.     MAPIMETHOD(ModifyRecipients)                                        \
  2149.         (THIS_  ULONG                       ulFlags,                    \
  2150.                 LPADRLIST                   lpMods) IPURE;              \
  2151.     MAPIMETHOD(SubmitMessage)                                           \
  2152.         (THIS_  ULONG                       ulFlags) IPURE;             \
  2153.     MAPIMETHOD(SetReadFlag)                                             \
  2154.         (THIS_  ULONG                       ulFlags) IPURE;             \
  2155.  
  2156. #undef       INTERFACE
  2157. #define      INTERFACE  IMessage
  2158. DECLARE_MAPI_INTERFACE_(IMessage, IMAPIProp)
  2159. {
  2160.     BEGIN_INTERFACE 
  2161.     MAPI_IUNKNOWN_METHODS(PURE)
  2162.     MAPI_IMAPIPROP_METHODS(PURE)
  2163.     MAPI_IMESSAGE_METHODS(PURE)
  2164. };
  2165.  
  2166. /* IAttach Interface ------------------------------------------------------- */
  2167.  
  2168. /* IAttach attachment methods: PR_ATTACH_METHOD values */
  2169.  
  2170. #define NO_ATTACHMENT           ((ULONG) 0x00000000)
  2171. #define ATTACH_BY_VALUE         ((ULONG) 0x00000001)
  2172. #define ATTACH_BY_REFERENCE     ((ULONG) 0x00000002)
  2173. #define ATTACH_BY_REF_RESOLVE   ((ULONG) 0x00000003)
  2174. #define ATTACH_BY_REF_ONLY      ((ULONG) 0x00000004)
  2175. #define ATTACH_EMBEDDED_MSG     ((ULONG) 0x00000005)
  2176. #define ATTACH_OLE              ((ULONG) 0x00000006)
  2177.  
  2178. #define MAPI_IATTACH_METHODS(IPURE)
  2179.  
  2180. #undef       INTERFACE
  2181. #define      INTERFACE  IAttach
  2182. DECLARE_MAPI_INTERFACE_(IAttach, IMAPIProp)
  2183. {
  2184.     BEGIN_INTERFACE 
  2185.     MAPI_IUNKNOWN_METHODS(PURE)
  2186.     MAPI_IMAPIPROP_METHODS(PURE)
  2187.     MAPI_IATTACH_METHODS(PURE)
  2188. };
  2189.  
  2190. /* --------------------------------- */
  2191. /* Address Book interface definition */
  2192.  
  2193. /* ADRPARM ulFlags - top 4 bits used for versioning */
  2194.  
  2195. #define GET_ADRPARM_VERSION(ulFlags)  (((ULONG)ulFlags) & 0xF0000000)
  2196. #define SET_ADRPARM_VERSION(ulFlags, ulVersion)  (((ULONG)ulVersion) | (((ULONG)ulFlags) & 0x0FFFFFFF))
  2197.  
  2198. /*  Current versions of ADRPARM  */
  2199. #define ADRPARM_HELP_CTX        ((ULONG) 0x00000000)
  2200.  
  2201.  
  2202. /*  ulFlags   - bit fields */
  2203. #define DIALOG_MODAL            ((ULONG) 0x00000001)
  2204. #define DIALOG_SDI              ((ULONG) 0x00000002)
  2205. #define DIALOG_OPTIONS          ((ULONG) 0x00000004)
  2206. #define ADDRESS_ONE             ((ULONG) 0x00000008)
  2207. #define AB_SELECTONLY           ((ULONG) 0x00000010)
  2208. #define AB_RESOLVE              ((ULONG) 0x00000020)
  2209.  
  2210. /* --------------------------------- */
  2211. /*  PR_DISPLAY_TYPEs                 */
  2212. /*
  2213.  *  These standard display types are
  2214.  *  by default handled by MAPI.
  2215.  *  They have default icons associated
  2216.  *  with them.
  2217.  */
  2218.  
  2219. /*  For address book contents tables */
  2220. #define DT_MAILUSER         ((ULONG) 0x00000000)
  2221. #define DT_DISTLIST         ((ULONG) 0x00000001)
  2222. #define DT_FORUM            ((ULONG) 0x00000002)
  2223. #define DT_AGENT            ((ULONG) 0x00000003)
  2224. #define DT_ORGANIZATION     ((ULONG) 0x00000004)
  2225. #define DT_PRIVATE_DISTLIST ((ULONG) 0x00000005)
  2226. #define DT_REMOTE_MAILUSER  ((ULONG) 0x00000006)
  2227.  
  2228. /*  For address book hierarchy tables */
  2229. #define DT_MODIFIABLE       ((ULONG) 0x00010000)
  2230. #define DT_GLOBAL           ((ULONG) 0x00020000)
  2231. #define DT_LOCAL            ((ULONG) 0x00030000)
  2232. #define DT_WAN              ((ULONG) 0x00040000)
  2233. #define DT_NOT_SPECIFIC     ((ULONG) 0x00050000)
  2234.  
  2235. /*  For folder hierarchy tables */
  2236. #define DT_FOLDER           ((ULONG) 0x01000000)
  2237. #define DT_FOLDER_LINK      ((ULONG) 0x02000000)
  2238.  
  2239. /*  Accelerator callback for DIALOG_SDI form of AB UI */
  2240. typedef BOOL (STDMETHODCALLTYPE ACCELERATEABSDI)(ULONG ulUIParam,
  2241.                                                 LPVOID lpvmsg);
  2242. typedef ACCELERATEABSDI FAR * LPFNABSDI;
  2243.  
  2244. /*  Callback to application telling it that the DIALOG_SDI form of the */
  2245. /*  AB UI has been dismissed.  This is so that the above LPFNABSDI     */
  2246. /*  function doesn't keep being called.                                */
  2247. typedef void (STDMETHODCALLTYPE DISMISSMODELESS)(ULONG ulUIParam,
  2248.                                                 LPVOID lpvContext);
  2249. typedef DISMISSMODELESS FAR * LPFNDISMISS;
  2250.  
  2251. /*
  2252.  * Prototype for the client function hooked to an optional button on
  2253.  * the address book dialog
  2254.  */
  2255.  
  2256. typedef SCODE (STDMETHODCALLTYPE FAR * LPFNBUTTON)(
  2257.     ULONG               ulUIParam,
  2258.     LPVOID              lpvContext,
  2259.     ULONG               cbEntryID,
  2260.     LPENTRYID           lpSelection,
  2261.     ULONG               ulFlags
  2262. );
  2263.  
  2264.  
  2265. /* Parameters for the address book dialog */
  2266. typedef struct _ADRPARM
  2267. {
  2268.     ULONG           cbABContEntryID;
  2269.     LPENTRYID       lpABContEntryID;
  2270.     ULONG           ulFlags;
  2271.  
  2272.     LPVOID          lpReserved;
  2273.     ULONG           ulHelpContext;
  2274.     LPTSTR          lpszHelpFileName;
  2275.  
  2276.     LPFNABSDI       lpfnABSDI;
  2277.     LPFNDISMISS     lpfnDismiss;
  2278.     LPVOID          lpvDismissContext;
  2279.     LPTSTR          lpszCaption;
  2280.     LPTSTR          lpszNewEntryTitle;
  2281.     LPTSTR          lpszDestWellsTitle;
  2282.     ULONG           cDestFields;
  2283.     ULONG           nDestFieldFocus;
  2284.     LPTSTR FAR *    lppszDestTitles;
  2285.     ULONG FAR *     lpulDestComps;
  2286.     LPSRestriction  lpContRestriction;
  2287.     LPSRestriction  lpHierRestriction;
  2288. } ADRPARM, FAR * LPADRPARM;
  2289.  
  2290.  
  2291. /* ------------ */
  2292. /* Random flags */
  2293.  
  2294. /* Flag for deferred error */
  2295. #define MAPI_DEFERRED_ERRORS    ((ULONG) 0x00000008)
  2296.  
  2297. /* Flag for creating and using Folder Associated Information Messages */
  2298. #define MAPI_ASSOCIATED         ((ULONG) 0x00000040)
  2299.  
  2300. /* Flags for OpenMessageStore() */
  2301.  
  2302. #define MDB_NO_DIALOG           ((ULONG) 0x00000001)
  2303. #define MDB_WRITE               ((ULONG) 0x00000004)
  2304. /****** MAPI_DEFERRED_ERRORS    ((ULONG) 0x00000008) above */
  2305. /****** MAPI_BEST_ACCESS        ((ULONG) 0x00000010) above */
  2306. #define MDB_TEMPORARY           ((ULONG) 0x00000020)
  2307. #define MDB_NO_MAIL             ((ULONG) 0x00000080)
  2308.  
  2309. /* Flags for OpenAddressBook */
  2310.  
  2311. #define AB_NO_DIALOG            ((ULONG) 0x00000001)
  2312.  
  2313. /* IMAPIControl Interface -------------------------------------------------- */
  2314.  
  2315. /* Interface used in controls (particularly the button) defined by */
  2316. /* Display Tables. */
  2317.  
  2318. /*  Flags for GetState */
  2319.  
  2320. #define  MAPI_ENABLED       ((ULONG) 0x00000000)
  2321. #define  MAPI_DISABLED      ((ULONG) 0x00000001)
  2322.  
  2323. #define MAPI_IMAPICONTROL_METHODS(IPURE)                                \
  2324.     MAPIMETHOD(GetLastError)                                            \
  2325.         (THIS_  HRESULT                     hResult,                    \
  2326.                 ULONG                       ulFlags,                    \
  2327.                 LPMAPIERROR FAR *           lppMAPIError) IPURE;        \
  2328.     MAPIMETHOD(Activate)                                                \
  2329.         (THIS_  ULONG                       ulFlags,                    \
  2330.                 ULONG                       ulUIParam) IPURE;           \
  2331.     MAPIMETHOD(GetState)                                                \
  2332.         (THIS_  ULONG                       ulFlags,                    \
  2333.                 ULONG FAR *                 lpulState) IPURE;           \
  2334.  
  2335. #undef       INTERFACE
  2336. #define      INTERFACE  IMAPIControl
  2337. DECLARE_MAPI_INTERFACE_(IMAPIControl, IUnknown)
  2338. {
  2339.     BEGIN_INTERFACE 
  2340.     MAPI_IUNKNOWN_METHODS(PURE)
  2341.     MAPI_IMAPICONTROL_METHODS(PURE)
  2342. };
  2343.  
  2344. DECLARE_MAPI_INTERFACE_PTR(IMAPIControl, LPMAPICONTROL);
  2345.  
  2346. /* Display Tables ---------------------------------------------------------- */
  2347.  
  2348. /* Flags used in display tables - that is, PR_CONTROL_FLAGS */
  2349.  
  2350. #define DT_MULTILINE        ((ULONG) 0x00000001)
  2351. #define DT_EDITABLE         ((ULONG) 0x00000002)
  2352. #define DT_REQUIRED         ((ULONG) 0x00000004)
  2353. #define DT_SET_IMMEDIATE    ((ULONG) 0x00000008)
  2354. #define DT_PASSWORD_EDIT    ((ULONG) 0x00000010)
  2355. #define DT_ACCEPT_DBCS      ((ULONG) 0x00000020)
  2356. #define DT_SET_SELECTION    ((ULONG) 0x00000040)
  2357.  
  2358. /* Display Table structures */
  2359.  
  2360. #define DTCT_LABEL          ((ULONG) 0x00000000)
  2361. #define DTCT_EDIT           ((ULONG) 0x00000001)
  2362. #define DTCT_LBX            ((ULONG) 0x00000002)
  2363. #define DTCT_COMBOBOX       ((ULONG) 0x00000003)
  2364. #define DTCT_DDLBX          ((ULONG) 0x00000004)
  2365. #define DTCT_CHECKBOX       ((ULONG) 0x00000005)
  2366. #define DTCT_GROUPBOX       ((ULONG) 0x00000006)
  2367. #define DTCT_BUTTON         ((ULONG) 0x00000007)
  2368. #define DTCT_PAGE           ((ULONG) 0x00000008)
  2369. #define DTCT_RADIOBUTTON    ((ULONG) 0x00000009)
  2370. #define DTCT_MVLISTBOX      ((ULONG) 0x0000000B)
  2371. #define DTCT_MVDDLBX        ((ULONG) 0x0000000C)
  2372.  
  2373. /* Labels */
  2374. /* Valid ulFlags:
  2375.  *   MAPI_UNICODE
  2376.  */
  2377. typedef struct _DTBLLABEL
  2378. {
  2379.     ULONG ulbLpszLabelName;
  2380.     ULONG ulFlags;
  2381. } DTBLLABEL, FAR * LPDTBLLABEL;
  2382. #define SizedDtblLabel(n,u) \
  2383. struct _DTBLLABEL_ ## u \
  2384. { \
  2385.     DTBLLABEL   dtbllabel; \
  2386.     TCHAR       lpszLabelName[n]; \
  2387. } u
  2388.  
  2389.  
  2390. /*  Simple Text Edits  */
  2391. /* Valid ulFlags:
  2392.  *   MAPI_UNICODE
  2393.  */
  2394. typedef struct _DTBLEDIT
  2395. {
  2396.     ULONG ulbLpszCharsAllowed;
  2397.     ULONG ulFlags;
  2398.     ULONG ulNumCharsAllowed;
  2399.     ULONG ulPropTag;
  2400. } DTBLEDIT, FAR * LPDTBLEDIT;
  2401. #define SizedDtblEdit(n,u) \
  2402. struct _DTBLEDIT_ ## u \
  2403. { \
  2404.     DTBLEDIT    dtbledit; \
  2405.     TCHAR       lpszCharsAllowed[n]; \
  2406. } u
  2407.  
  2408. /*  List Box  */
  2409. /* Valid ulFlags:
  2410.  */
  2411. #define MAPI_NO_HBAR        ((ULONG) 0x00000001)
  2412. #define MAPI_NO_VBAR        ((ULONG) 0x00000002)
  2413.  
  2414. typedef struct _DTBLLBX
  2415. {
  2416.     ULONG ulFlags;
  2417.     ULONG ulPRSetProperty;
  2418.     ULONG ulPRTableName;
  2419. } DTBLLBX, FAR * LPDTBLLBX;
  2420.  
  2421.  
  2422. /*  Combo Box   */
  2423. /* Valid ulFlags:
  2424.  *   MAPI_UNICODE
  2425.  */
  2426. typedef struct _DTBLCOMBOBOX
  2427. {
  2428.     ULONG ulbLpszCharsAllowed;
  2429.     ULONG ulFlags;
  2430.     ULONG ulNumCharsAllowed;
  2431.     ULONG ulPRPropertyName;
  2432.     ULONG ulPRTableName;
  2433. } DTBLCOMBOBOX, FAR * LPDTBLCOMBOBOX;
  2434. #define SizedDtblComboBox(n,u) \
  2435. struct _DTBLCOMBOBOX_ ## u \
  2436. { \
  2437.     DTBLCOMBOBOX    dtblcombobox; \
  2438.     TCHAR           lpszCharsAllowed[n]; \
  2439. } u
  2440.  
  2441.  
  2442. /*  Drop Down   */
  2443. /* Valid ulFlags:
  2444.  *   none
  2445.  */
  2446. typedef struct _DTBLDDLBX
  2447. {
  2448.     ULONG ulFlags;
  2449.     ULONG ulPRDisplayProperty;
  2450.     ULONG ulPRSetProperty;
  2451.     ULONG ulPRTableName;
  2452. } DTBLDDLBX, FAR * LPDTBLDDLBX;
  2453.  
  2454.  
  2455. /*  Check Box   */
  2456. /* Valid ulFlags:
  2457.  *   MAPI_UNICODE
  2458.  */
  2459. typedef struct _DTBLCHECKBOX
  2460. {
  2461.     ULONG ulbLpszLabel;
  2462.     ULONG ulFlags;
  2463.     ULONG ulPRPropertyName;
  2464. } DTBLCHECKBOX, FAR * LPDTBLCHECKBOX;
  2465. #define SizedDtblCheckBox(n,u) \
  2466. struct _DTBLCHECKBOX_ ## u \
  2467. { \
  2468.     DTBLCHECKBOX    dtblcheckbox; \
  2469.     TCHAR       lpszLabel[n]; \
  2470. } u
  2471.  
  2472.  
  2473.  
  2474. /*  Group Box   */
  2475. /* Valid ulFlags:
  2476.  *   MAPI_UNICODE
  2477.  */
  2478. typedef struct _DTBLGROUPBOX
  2479. {
  2480.     ULONG ulbLpszLabel;
  2481.     ULONG ulFlags;
  2482. } DTBLGROUPBOX, FAR * LPDTBLGROUPBOX;
  2483. #define SizedDtblGroupBox(n,u) \
  2484. struct _DTBLGROUPBOX_ ## u \
  2485. { \
  2486.     DTBLGROUPBOX    dtblgroupbox; \
  2487.     TCHAR           lpszLabel[n]; \
  2488. } u
  2489.  
  2490. /*  Button control   */
  2491. /* Valid ulFlags:
  2492.  *   MAPI_UNICODE
  2493.  */
  2494. typedef struct _DTBLBUTTON
  2495. {
  2496.     ULONG ulbLpszLabel;
  2497.     ULONG ulFlags;
  2498.     ULONG ulPRControl;
  2499. } DTBLBUTTON, FAR * LPDTBLBUTTON;
  2500. #define SizedDtblButton(n,u) \
  2501. struct _DTBLBUTTON_ ## u \
  2502. { \
  2503.     DTBLBUTTON  dtblbutton; \
  2504.     TCHAR       lpszLabel[n]; \
  2505. } u
  2506.  
  2507. /*  Pages   */
  2508. /* Valid ulFlags:
  2509.  *   MAPI_UNICODE
  2510.  */
  2511. typedef struct _DTBLPAGE
  2512. {
  2513.     ULONG ulbLpszLabel;
  2514.     ULONG ulFlags;
  2515.     ULONG ulbLpszComponent;
  2516.     ULONG ulContext;
  2517. } DTBLPAGE, FAR * LPDTBLPAGE;
  2518. #define SizedDtblPage(n,n1,u) \
  2519. struct _DTBLPAGE_ ## u \
  2520. { \
  2521.     DTBLPAGE    dtblpage; \
  2522.     TCHAR       lpszLabel[n]; \
  2523.     TCHAR       lpszComponent[n1]; \
  2524. } u
  2525.  
  2526. /*  Radio button   */
  2527. /* Valid ulFlags:
  2528.  *   MAPI_UNICODE
  2529.  */
  2530. typedef struct _DTBLRADIOBUTTON
  2531. {
  2532.     ULONG ulbLpszLabel;
  2533.     ULONG ulFlags;
  2534.     ULONG ulcButtons;
  2535.     ULONG ulPropTag;
  2536.     long lReturnValue;
  2537. } DTBLRADIOBUTTON, FAR * LPDTBLRADIOBUTTON;
  2538. #define SizedDtblRadioButton(n,u) \
  2539. struct _DTBLRADIOBUTTON_ ## u \
  2540. { \
  2541.     DTBLRADIOBUTTON dtblradiobutton; \
  2542.     TCHAR           lpszLabel[n]; \
  2543. } u
  2544.  
  2545.  
  2546. /*  MultiValued listbox */
  2547. /* Valid ulFlags:
  2548.  *   none
  2549.  */
  2550. typedef struct _DTBLMVLISTBOX
  2551. {
  2552.     ULONG ulFlags;
  2553.     ULONG ulMVPropTag;
  2554. } DTBLMVLISTBOX, FAR * LPDTBLMVLISTBOX;
  2555.  
  2556.  
  2557. /*  MultiValued dropdown */
  2558. /* Valid ulFlags:
  2559.  *   none
  2560.  */
  2561. typedef struct _DTBLMVDDLBX
  2562. {
  2563.     ULONG ulFlags;
  2564.     ULONG ulMVPropTag;
  2565. } DTBLMVDDLBX, FAR * LPDTBLMVDDLBX;
  2566.  
  2567.     
  2568.  
  2569.  
  2570.  
  2571. /* IProviderAdmin Interface ---------------------------------------------- */
  2572.  
  2573. /* Flags for ConfigureMsgService */
  2574.  
  2575. #define UI_SERVICE                  0x00000002
  2576. #define SERVICE_UI_ALWAYS           0x00000002      /* Duplicate UI_SERVICE for consistency and compatibility */
  2577. #define SERVICE_UI_ALLOWED          0x00000010
  2578. #define UI_CURRENT_PROVIDER_FIRST   0x00000004
  2579. /* MSG_SERVICE_UI_READ_ONLY         0x00000008 - in MAPISPI.H */
  2580.  
  2581. /* GetProviderTable() */
  2582. /****** MAPI_UNICODE            ((ULONG) 0x80000000) above */
  2583.  
  2584. /* Values for PR_RESOURCE_FLAGS in message service table */
  2585.  
  2586. #define MAPI_IPROVIDERADMIN_METHODS(IPURE)                              \
  2587.     MAPIMETHOD(GetLastError)                                            \
  2588.         (THIS_  HRESULT                     hResult,                    \
  2589.                 ULONG                       ulFlags,                    \
  2590.                 LPMAPIERROR FAR *           lppMAPIError) IPURE;        \
  2591.     MAPIMETHOD(GetProviderTable)                                        \
  2592.         (THIS_  ULONG                       ulFlags,                    \
  2593.                 LPMAPITABLE FAR *           lppTable) IPURE;            \
  2594.     MAPIMETHOD(CreateProvider)                                          \
  2595.         (THIS_  LPTSTR                      lpszProvider,               \
  2596.                 ULONG                       cValues,                    \
  2597.                 LPSPropValue                lpProps,                    \
  2598.                 ULONG                       ulUIParam,                  \
  2599.                 ULONG                       ulFlags,                    \
  2600.                 MAPIUID FAR *               lpUID) IPURE;               \
  2601.     MAPIMETHOD(DeleteProvider)                                          \
  2602.         (THIS_  LPMAPIUID                   lpUID) IPURE;               \
  2603.     MAPIMETHOD(OpenProfileSection)                                      \
  2604.         (THIS_  LPMAPIUID                   lpUID,                      \
  2605.                 LPCIID                      lpInterface,                \
  2606.                 ULONG                       ulFlags,                    \
  2607.                 LPPROFSECT FAR *            lppProfSect) IPURE;         \
  2608.  
  2609.  
  2610. #undef       INTERFACE
  2611. #define      INTERFACE  IProviderAdmin
  2612. DECLARE_MAPI_INTERFACE_(IProviderAdmin, IUnknown)
  2613. {
  2614.     BEGIN_INTERFACE 
  2615.     MAPI_IUNKNOWN_METHODS(PURE)
  2616.     MAPI_IPROVIDERADMIN_METHODS(PURE)
  2617. };
  2618.  
  2619.  
  2620.  
  2621. #ifdef  __cplusplus
  2622. }       /*  extern "C" */
  2623. #endif
  2624.  
  2625. #endif /* MAPIDEFS_H */
  2626.  
  2627. #if defined(__TOPLEVEL_MAPIDEFS_H_)
  2628. #undef __TOPLEVEL_NEXT_COMMON_INCLUDE__
  2629. #undef __TOPLEVEL_MAPIDEFS_H_
  2630. #include <next_common_undefines.h>
  2631. #endif /* __TOPLEVEL_MAPIDEFS_H_ */
  2632.