home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / WABDEFS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  101.2 KB  |  2,677 lines

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