home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / borland / cb / setup / cbuilder / data.z / MAPIDEFS.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  104KB  |  2,673 lines

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