home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / wabdefs.h < prev    next >
C/C++ Source or Header  |  2000-02-01  |  104KB  |  2,678 lines

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