MAPIDefS.h
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:96k
源码类别:

对话框与窗口

开发平台:

Visual C++

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