WabDefs.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:101k
源码类别:

模拟服务器

开发平台:

C/C++

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