Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

932 lines
46 KiB

  1. /*
  2. * M A P I S P I . H
  3. *
  4. * Defines the calls and structures exchanged between MAPI or the spooler
  5. * and the MAPI service providers
  6. *
  7. * Copyright 1993-1995 Microsoft Corporation. All Rights Reserved.
  8. */
  9. #ifndef MAPISPI_H
  10. #define MAPISPI_H
  11. /* Include common MAPI header files if they haven't been already. */
  12. #ifndef MAPIDEFS_H
  13. #include <mapidefs.h>
  14. #endif
  15. #ifndef MAPICODE_H
  16. #include <mapicode.h>
  17. #endif
  18. #ifndef MAPIGUID_H
  19. #include <mapiguid.h>
  20. #endif
  21. #ifndef MAPITAGS_H
  22. #include <mapitags.h>
  23. #endif
  24. #if defined (WIN16) || defined (DOS) || defined (DOS16)
  25. #include <storage.h>
  26. #endif
  27. #ifndef BEGIN_INTERFACE
  28. #define BEGIN_INTERFACE
  29. #endif
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /* The MAPI SPI has a version number. MAPIX.DLL knows and supports
  34. * one or more versions of the SPI. Each provider supports one or
  35. * more versions of the SPI. Checks are performed in both MAPIX.DLL
  36. * and in the provider to ensure that they agree to use exactly one
  37. * version of the MAPI SPI.
  38. *
  39. * The SPI version number is composed of a major (8-bit) version,
  40. * minor (8-bit) version, and micro (16-bit) version. The first
  41. * retail ship of MAPI 1.0 is expected to be version 1.0.0.
  42. * The major version number changes rarely.
  43. * The minor version number changes opon each retail ship of
  44. * MAPI if the SPI has been modified.
  45. * The micro version number changes internally at Microsoft
  46. * during development of MAPI.
  47. *
  48. * The version of the SPI documented by this set of header files
  49. * is ALWAYS known as "CURRENT_SPI_VERSION". If you write a
  50. * service provider, and get a new set of header files, and update
  51. * your code to the new interface, you'll be at the "current" version.
  52. */
  53. #define CURRENT_SPI_VERSION 0x00010010L
  54. /* Here are some well-known SPI version numbers:
  55. * (These will eventually be useful for provider-writers who
  56. * might choose to make provider DLLs that support more than
  57. * one version of the MAPI SPI.
  58. */
  59. #define PDK1_SPI_VERSION 0x00010000L /* 0.1.0 MAPI PDK1 Spring 1993 */
  60. #define PDK2_SPI_VERSION 0x00010008L /* 0.1.8 MAPI PDK2 Spring 1994 */
  61. #define PDK3_SPI_VERSION 0x00010010L /* 0.1.16 MAPI PDK3 Fall 1994 */
  62. /*
  63. * Maximum length of profile names and passwords.
  64. */
  65. #define cchProfileNameMax 64
  66. #define cchProfilePassMax 64
  67. /*
  68. * Forward declaration of interface pointers specific to the service
  69. * provider interface.
  70. */
  71. DECLARE_MAPI_INTERFACE_PTR(IMAPISupport, LPMAPISUP);
  72. /* IMAPISupport Interface -------------------------------------------------- */
  73. /* Notification key structure for the MAPI notification engine */
  74. typedef struct
  75. {
  76. ULONG cb; /* How big the key is */
  77. BYTE ab[MAPI_DIM]; /* Key contents */
  78. } NOTIFKEY, FAR * LPNOTIFKEY;
  79. #define CbNewNOTIFKEY(_cb) (offsetof(NOTIFKEY,ab) + (_cb))
  80. #define CbNOTIFKEY(_lpkey) (offsetof(NOTIFKEY,ab) + (_lpkey)->cb)
  81. #define SizedNOTIFKEY(_cb, _name) \
  82. struct _NOTIFKEY_ ## _name \
  83. { \
  84. ULONG cb; \
  85. BYTE ab[_cb]; \
  86. } _name
  87. /* For Subscribe() */
  88. #define NOTIFY_SYNC ((ULONG) 0x40000000)
  89. /* For Notify() */
  90. #define NOTIFY_CANCELED ((ULONG) 0x80000000)
  91. /* From the Notification Callback function (well, this is really a ulResult) */
  92. #define CALLBACK_DISCONTINUE ((ULONG) 0x80000000)
  93. /* For Transport's SpoolerNotify() */
  94. #define NOTIFY_NEWMAIL ((ULONG) 0x00000001)
  95. #define NOTIFY_READYTOSEND ((ULONG) 0x00000002)
  96. #define NOTIFY_SENTDEFERRED ((ULONG) 0x00000004)
  97. #define NOTIFY_CRITSEC ((ULONG) 0x00001000)
  98. #define NOTIFY_NONCRIT ((ULONG) 0x00002000)
  99. #define NOTIFY_CONFIG_CHANGE ((ULONG) 0x00004000)
  100. #define NOTIFY_CRITICAL_ERROR ((ULONG) 0x10000000)
  101. /* For Message Store's SpoolerNotify() */
  102. #define NOTIFY_NEWMAIL_RECEIVED ((ULONG) 0x20000000)
  103. /* For ModifyStatusRow() */
  104. #define STATUSROW_UPDATE ((ULONG) 0x10000000)
  105. /* For IStorageFromStream() */
  106. #define STGSTRM_RESET ((ULONG) 0x00000000)
  107. #define STGSTRM_CURRENT ((ULONG) 0x10000000)
  108. #define STGSTRM_MODIFY ((ULONG) 0x00000002)
  109. #define STGSTRM_CREATE ((ULONG) 0x00001000)
  110. /* For GetOneOffTable() */
  111. /****** MAPI_UNICODE ((ULONG) 0x80000000) */
  112. /* For CreateOneOff() */
  113. /****** MAPI_UNICODE ((ULONG) 0x80000000) */
  114. /* For ReadReceipt() */
  115. #define MAPI_NON_READ ((ULONG) 0x00000001)
  116. /* For DoConfigPropSheet() */
  117. /****** MAPI_UNICODE ((ULONG) 0x80000000) */
  118. /* Preprocessor calls: */
  119. /* PreprocessMessage, first ordinal in RegisterPreprocessor(). */
  120. typedef HRESULT (STDMETHODCALLTYPE PREPROCESSMESSAGE)(
  121. LPMESSAGE lpMessage,
  122. LPADRBOOK lpAdrBook,
  123. LPMAPIFOLDER lpFolder,
  124. LPALLOCATEBUFFER AllocateBuffer,
  125. LPALLOCATEMORE AllocateMore,
  126. LPFREEBUFFER FreeBuffer,
  127. ULONG FAR *lpcOutbound,
  128. LPMESSAGE FAR * FAR *lpppMessage,
  129. LPADRLIST FAR *lppRecipList);
  130. /* RemovePreprocessInfo, second ordinal in RegisterPreprocessor(). */
  131. typedef HRESULT (STDMETHODCALLTYPE REMOVEPREPROCESSINFO)(LPMESSAGE lpMessage);
  132. /* Function pointer for GetReleaseInfo */
  133. #define MAPI_IMAPISUPPORT_METHODS1(IPURE) \
  134. MAPIMETHOD(GetLastError) \
  135. (THIS_ HRESULT hResult, \
  136. ULONG ulFlags, \
  137. LPMAPIERROR FAR * lppMAPIError) IPURE; \
  138. MAPIMETHOD(GetMemAllocRoutines) \
  139. (THIS_ LPALLOCATEBUFFER FAR * lpAllocateBuffer, \
  140. LPALLOCATEMORE FAR * lpAllocateMore, \
  141. LPFREEBUFFER FAR * lpFreeBuffer) IPURE; \
  142. MAPIMETHOD(Subscribe) \
  143. (THIS_ LPNOTIFKEY lpKey, \
  144. ULONG ulEventMask, \
  145. ULONG ulFlags, \
  146. LPMAPIADVISESINK lpAdviseSink, \
  147. ULONG FAR * lpulConnection) IPURE; \
  148. MAPIMETHOD(Unsubscribe) \
  149. (THIS_ ULONG ulConnection) IPURE; \
  150. MAPIMETHOD(Notify) \
  151. (THIS_ LPNOTIFKEY lpKey, \
  152. ULONG cNotification, \
  153. LPNOTIFICATION lpNotifications, \
  154. ULONG FAR * lpulFlags) IPURE; \
  155. MAPIMETHOD(ModifyStatusRow) \
  156. (THIS_ ULONG cValues, \
  157. LPSPropValue lpColumnVals, \
  158. ULONG ulFlags) IPURE; \
  159. MAPIMETHOD(OpenProfileSection) \
  160. (THIS_ LPMAPIUID lpUid, \
  161. ULONG ulFlags, \
  162. LPPROFSECT FAR * lppProfileObj) IPURE; \
  163. MAPIMETHOD(RegisterPreprocessor) \
  164. (THIS_ LPMAPIUID lpMuid, \
  165. LPTSTR lpszAdrType, \
  166. LPTSTR lpszDLLName, \
  167. LPSTR /* String8! */ lpszPreprocess, \
  168. LPSTR /* String8! */ lpszRemovePreprocessInfo, \
  169. ULONG ulFlags) IPURE; \
  170. MAPIMETHOD(NewUID) \
  171. (THIS_ LPMAPIUID lpMuid) IPURE; \
  172. MAPIMETHOD(MakeInvalid) \
  173. (THIS_ ULONG ulFlags, \
  174. LPVOID lpObject, \
  175. ULONG ulRefCount, \
  176. ULONG cMethods) IPURE; \
  177. #define MAPI_IMAPISUPPORT_METHODS2(IPURE) \
  178. MAPIMETHOD(SpoolerYield) \
  179. (THIS_ ULONG ulFlags) IPURE; \
  180. MAPIMETHOD(SpoolerNotify) \
  181. (THIS_ ULONG ulFlags, \
  182. LPVOID lpvData) IPURE; \
  183. MAPIMETHOD(CreateOneOff) \
  184. (THIS_ LPTSTR lpszName, \
  185. LPTSTR lpszAdrType, \
  186. LPTSTR lpszAddress, \
  187. ULONG ulFlags, \
  188. ULONG FAR * lpcbEntryID, \
  189. LPENTRYID FAR * lppEntryID) IPURE; \
  190. MAPIMETHOD(SetProviderUID) \
  191. (THIS_ LPMAPIUID lpProviderID, \
  192. ULONG ulFlags) IPURE; \
  193. MAPIMETHOD(CompareEntryIDs) \
  194. (THIS_ ULONG cbEntry1, \
  195. LPENTRYID lpEntry1, \
  196. ULONG cbEntry2, \
  197. LPENTRYID lpEntry2, \
  198. ULONG ulCompareFlags, \
  199. ULONG FAR * lpulResult) IPURE; \
  200. MAPIMETHOD(OpenTemplateID) \
  201. (THIS_ ULONG cbTemplateID, \
  202. LPENTRYID lpTemplateID, \
  203. ULONG ulTemplateFlags, \
  204. LPMAPIPROP lpMAPIPropData, \
  205. LPCIID lpInterface, \
  206. LPMAPIPROP FAR * lppMAPIPropNew, \
  207. LPMAPIPROP lpMAPIPropSibling) IPURE; \
  208. MAPIMETHOD(OpenEntry) \
  209. (THIS_ ULONG cbEntryID, \
  210. LPENTRYID lpEntryID, \
  211. LPCIID lpInterface, \
  212. ULONG ulOpenFlags, \
  213. ULONG FAR * lpulObjType, \
  214. LPUNKNOWN FAR * lppUnk) IPURE; \
  215. MAPIMETHOD(GetOneOffTable) \
  216. (THIS_ ULONG ulFlags, \
  217. LPMAPITABLE FAR * lppTable) IPURE; \
  218. MAPIMETHOD(Address) \
  219. (THIS_ ULONG FAR * lpulUIParam, \
  220. LPADRPARM lpAdrParms, \
  221. LPADRLIST FAR * lppAdrList) IPURE; \
  222. MAPIMETHOD(Details) \
  223. (THIS_ ULONG FAR * lpulUIParam, \
  224. LPFNDISMISS lpfnDismiss, \
  225. LPVOID lpvDismissContext, \
  226. ULONG cbEntryID, \
  227. LPENTRYID lpEntryID, \
  228. LPFNBUTTON lpfButtonCallback, \
  229. LPVOID lpvButtonContext, \
  230. LPTSTR lpszButtonText, \
  231. ULONG ulFlags) IPURE; \
  232. MAPIMETHOD(NewEntry) \
  233. (THIS_ ULONG ulUIParam, \
  234. ULONG ulFlags, \
  235. ULONG cbEIDContainer, \
  236. LPENTRYID lpEIDContainer, \
  237. ULONG cbEIDNewEntryTpl, \
  238. LPENTRYID lpEIDNewEntryTpl, \
  239. ULONG FAR * lpcbEIDNewEntry, \
  240. LPENTRYID FAR * lppEIDNewEntry) IPURE; \
  241. MAPIMETHOD(DoConfigPropsheet) \
  242. (THIS_ ULONG ulUIParam, \
  243. ULONG ulFlags, \
  244. LPTSTR lpszTitle, \
  245. LPMAPITABLE lpDisplayTable, \
  246. LPMAPIPROP lpCOnfigData, \
  247. ULONG ulTopPage) IPURE; \
  248. MAPIMETHOD(CopyMessages) \
  249. (THIS_ LPCIID lpSrcInterface, \
  250. LPVOID lpSrcFolder, \
  251. LPENTRYLIST lpMsgList, \
  252. LPCIID lpDestInterface, \
  253. LPVOID lpDestFolder, \
  254. ULONG ulUIParam, \
  255. LPMAPIPROGRESS lpProgress, \
  256. ULONG ulFlags) IPURE; \
  257. MAPIMETHOD(CopyFolder) \
  258. (THIS_ LPCIID lpSrcInterface, \
  259. LPVOID lpSrcFolder, \
  260. ULONG cbEntryID, \
  261. LPENTRYID lpEntryID, \
  262. LPCIID lpDestInterface, \
  263. LPVOID lpDestFolder, \
  264. LPTSTR lszNewFolderName, \
  265. ULONG ulUIParam, \
  266. LPMAPIPROGRESS lpProgress, \
  267. ULONG ulFlags) IPURE; \
  268. #define MAPI_IMAPISUPPORT_METHODS3(IPURE) \
  269. MAPIMETHOD(DoCopyTo) \
  270. (THIS_ LPCIID lpSrcInterface, \
  271. LPVOID lpSrcObj, \
  272. ULONG ciidExclude, \
  273. LPCIID rgiidExclude, \
  274. LPSPropTagArray lpExcludeProps, \
  275. ULONG ulUIParam, \
  276. LPMAPIPROGRESS lpProgress, \
  277. LPCIID lpDestInterface, \
  278. LPVOID lpDestObj, \
  279. ULONG ulFlags, \
  280. LPSPropProblemArray FAR * lppProblems) IPURE; \
  281. MAPIMETHOD(DoCopyProps) \
  282. (THIS_ LPCIID lpSrcInterface, \
  283. LPVOID lpSrcObj, \
  284. LPSPropTagArray lpIncludeProps, \
  285. ULONG ulUIParam, \
  286. LPMAPIPROGRESS lpProgress, \
  287. LPCIID lpDestInterface, \
  288. LPVOID lpDestObj, \
  289. ULONG ulFlags, \
  290. LPSPropProblemArray FAR * lppProblems) IPURE; \
  291. MAPIMETHOD(DoProgressDialog) \
  292. (THIS_ ULONG ulUIParam, \
  293. ULONG ulFlags, \
  294. LPMAPIPROGRESS FAR * lppProgress) IPURE; \
  295. MAPIMETHOD(ReadReceipt) \
  296. (THIS_ ULONG ulFlags, \
  297. LPMESSAGE lpReadMessage, \
  298. LPMESSAGE FAR * lppEmptyMessage) IPURE; \
  299. MAPIMETHOD(PrepareSubmit) \
  300. (THIS_ LPMESSAGE lpMessage, \
  301. ULONG FAR * lpulFlags) IPURE; \
  302. MAPIMETHOD(ExpandRecips) \
  303. (THIS_ LPMESSAGE lpMessage, \
  304. ULONG FAR * lpulFlags) IPURE; \
  305. MAPIMETHOD(UpdatePAB) \
  306. (THIS_ ULONG ulFlags, \
  307. LPMESSAGE lpMessage) IPURE; \
  308. MAPIMETHOD(DoSentMail) \
  309. (THIS_ ULONG ulFlags, \
  310. LPMESSAGE lpMessage) IPURE; \
  311. MAPIMETHOD(OpenAddressBook) \
  312. (THIS_ LPCIID lpInterface, \
  313. ULONG ulFlags, \
  314. LPADRBOOK FAR * lppAdrBook) IPURE; \
  315. MAPIMETHOD(Preprocess) \
  316. (THIS_ ULONG ulFlags, \
  317. ULONG cbEntryID, \
  318. LPENTRYID lpEntryID) IPURE; \
  319. MAPIMETHOD(CompleteMsg) \
  320. (THIS_ ULONG ulFlags, \
  321. ULONG cbEntryID, \
  322. LPENTRYID lpEntryID) IPURE; \
  323. MAPIMETHOD(StoreLogoffTransports) \
  324. (THIS_ ULONG FAR * lpulFlags) IPURE; \
  325. MAPIMETHOD(StatusRecips) \
  326. (THIS_ LPMESSAGE lpMessage, \
  327. LPADRLIST lpRecipList) IPURE; \
  328. MAPIMETHOD(WrapStoreEntryID) \
  329. (THIS_ ULONG cbOrigEntry, \
  330. LPENTRYID lpOrigEntry, \
  331. ULONG FAR * lpcbWrappedEntry, \
  332. LPENTRYID FAR * lppWrappedEntry) IPURE; \
  333. MAPIMETHOD(ModifyProfile) \
  334. (THIS_ ULONG ulFlags) IPURE; \
  335. MAPIMETHOD(IStorageFromStream) \
  336. (THIS_ LPUNKNOWN lpUnkIn, \
  337. LPCIID lpInterface, \
  338. ULONG ulFlags, \
  339. LPSTORAGE FAR * lppStorageOut) IPURE; \
  340. MAPIMETHOD(GetSvcConfigSupportObj) \
  341. (THIS_ ULONG ulFlags, \
  342. LPMAPISUP FAR * lppSvcSupport) IPURE; \
  343. #undef INTERFACE
  344. #define INTERFACE IMAPISupport
  345. DECLARE_MAPI_INTERFACE_(IMAPISupport, IUnknown)
  346. {
  347. BEGIN_INTERFACE
  348. MAPI_IUNKNOWN_METHODS(PURE)
  349. MAPI_IMAPISUPPORT_METHODS1(PURE)
  350. MAPI_IMAPISUPPORT_METHODS2(PURE)
  351. MAPI_IMAPISUPPORT_METHODS3(PURE)
  352. };
  353. /********************************************************************/
  354. /* */
  355. /* ADDRESS BOOK SPI */
  356. /* */
  357. /********************************************************************/
  358. /* Address Book Provider ------------------------------------------------- */
  359. /* OpenTemplateID() */
  360. #define FILL_ENTRY ((ULONG) 0x00000001)
  361. /* For Logon() */
  362. /*#define AB_NO_DIALOG ((ULONG) 0x00000001) in mapidefs.h */
  363. /*#define MAPI_UNICODE ((ULONG) 0x80000000) in mapidefs.h */
  364. DECLARE_MAPI_INTERFACE_PTR(IABProvider, LPABPROVIDER);
  365. DECLARE_MAPI_INTERFACE_PTR(IABLogon, LPABLOGON);
  366. #define MAPI_IABPROVIDER_METHODS(IPURE) \
  367. MAPIMETHOD(Shutdown) \
  368. (THIS_ ULONG FAR * lpulFlags) IPURE; \
  369. MAPIMETHOD(Logon) \
  370. (THIS_ LPMAPISUP lpMAPISup, \
  371. ULONG ulUIParam, \
  372. LPTSTR lpszProfileName, \
  373. ULONG ulFlags, \
  374. ULONG FAR * lpulpcbSecurity, \
  375. LPBYTE FAR * lppbSecurity, \
  376. LPMAPIERROR FAR * lppMAPIError, \
  377. LPABLOGON FAR * lppABLogon) IPURE; \
  378. #undef INTERFACE
  379. #define INTERFACE IABProvider
  380. DECLARE_MAPI_INTERFACE_(IABProvider, IUnknown)
  381. {
  382. BEGIN_INTERFACE
  383. MAPI_IUNKNOWN_METHODS(PURE)
  384. MAPI_IABPROVIDER_METHODS(PURE)
  385. };
  386. /* For GetOneOffTable() */
  387. /****** MAPI_UNICODE ((ULONG) 0x80000000) */
  388. #define MAPI_IABLOGON_METHODS(IPURE) \
  389. MAPIMETHOD(GetLastError) \
  390. (THIS_ HRESULT hResult, \
  391. ULONG ulFlags, \
  392. LPMAPIERROR FAR * lppMAPIError) IPURE; \
  393. MAPIMETHOD(Logoff) \
  394. (THIS_ ULONG ulFlags) IPURE; \
  395. MAPIMETHOD(OpenEntry) \
  396. (THIS_ ULONG cbEntryID, \
  397. LPENTRYID lpEntryID, \
  398. LPCIID lpInterface, \
  399. ULONG ulFlags, \
  400. ULONG FAR * lpulObjType, \
  401. LPUNKNOWN FAR * lppUnk) IPURE; \
  402. MAPIMETHOD(CompareEntryIDs) \
  403. (THIS_ ULONG cbEntryID1, \
  404. LPENTRYID lpEntryID1, \
  405. ULONG cbEntryID2, \
  406. LPENTRYID lpEntryID2, \
  407. ULONG ulFlags, \
  408. ULONG FAR * lpulResult) IPURE; \
  409. MAPIMETHOD(Advise) \
  410. (THIS_ ULONG cbEntryID, \
  411. LPENTRYID lpEntryID, \
  412. ULONG ulEventMask, \
  413. LPMAPIADVISESINK lpAdviseSink, \
  414. ULONG FAR * lpulConnection) IPURE; \
  415. MAPIMETHOD(Unadvise) \
  416. (THIS_ ULONG ulConnection) IPURE; \
  417. MAPIMETHOD(OpenStatusEntry) \
  418. (THIS_ LPCIID lpInterface, \
  419. ULONG ulFlags, \
  420. ULONG FAR * lpulObjType, \
  421. LPMAPISTATUS FAR * lppEntry) IPURE; \
  422. MAPIMETHOD(OpenTemplateID) \
  423. (THIS_ ULONG cbTemplateID, \
  424. LPENTRYID lpTemplateID, \
  425. ULONG ulTemplateFlags, \
  426. LPMAPIPROP lpMAPIPropData, \
  427. LPCIID lpInterface, \
  428. LPMAPIPROP FAR * lppMAPIPropNew, \
  429. LPMAPIPROP lpMAPIPropSibling) IPURE; \
  430. MAPIMETHOD(GetOneOffTable) \
  431. (THIS_ ULONG ulFlags, \
  432. LPMAPITABLE FAR * lppTable) IPURE; \
  433. MAPIMETHOD(PrepareRecips) \
  434. (THIS_ ULONG ulFlags, \
  435. LPSPropTagArray lpPropTagArray, \
  436. LPADRLIST lpRecipList) IPURE; \
  437. #undef INTERFACE
  438. #define INTERFACE IABLogon
  439. DECLARE_MAPI_INTERFACE_(IABLogon, IUnknown)
  440. {
  441. BEGIN_INTERFACE
  442. MAPI_IUNKNOWN_METHODS(PURE)
  443. MAPI_IABLOGON_METHODS(PURE)
  444. };
  445. typedef HRESULT (STDMAPIINITCALLTYPE ABPROVIDERINIT)(
  446. HINSTANCE hInstance,
  447. LPMALLOC lpMalloc,
  448. LPALLOCATEBUFFER lpAllocateBuffer,
  449. LPALLOCATEMORE lpAllocateMore,
  450. LPFREEBUFFER lpFreeBuffer,
  451. ULONG ulFlags,
  452. ULONG ulMAPIVer,
  453. ULONG FAR * lpulProviderVer,
  454. LPABPROVIDER FAR * lppABProvider
  455. );
  456. ABPROVIDERINIT ABProviderInit;
  457. /********************************************************************/
  458. /* */
  459. /* TRANSPORT SPI */
  460. /* */
  461. /********************************************************************/
  462. /* For DeinitTransport */
  463. #define DEINIT_NORMAL ((ULONG) 0x00000001)
  464. #define DEINIT_HURRY ((ULONG) 0x80000000)
  465. /* For TransportLogon */
  466. /* Flags that the Spooler may pass to the transport: */
  467. #define LOGON_NO_DIALOG ((ULONG) 0x00000001)
  468. #define LOGON_NO_CONNECT ((ULONG) 0x00000004)
  469. #define LOGON_NO_INBOUND ((ULONG) 0x00000008)
  470. #define LOGON_NO_OUTBOUND ((ULONG) 0x00000010)
  471. /*#define MAPI_UNICODE ((ULONG) 0x80000000) in mapidefs.h */
  472. /* Flags that the transport may pass to the Spooler: */
  473. #define LOGON_SP_IDLE ((ULONG) 0x00010000)
  474. #define LOGON_SP_POLL ((ULONG) 0x00020000)
  475. #define LOGON_SP_RESOLVE ((ULONG) 0x00040000)
  476. DECLARE_MAPI_INTERFACE_PTR(IXPProvider, LPXPPROVIDER);
  477. DECLARE_MAPI_INTERFACE_PTR(IXPLogon, LPXPLOGON);
  478. #define MAPI_IXPPROVIDER_METHODS(IPURE) \
  479. MAPIMETHOD(Shutdown) \
  480. (THIS_ ULONG FAR * lpulFlags) IPURE; \
  481. MAPIMETHOD(TransportLogon) \
  482. (THIS_ LPMAPISUP lpMAPISup, \
  483. ULONG ulUIParam, \
  484. LPTSTR lpszProfileName, \
  485. ULONG FAR * lpulFlags, \
  486. LPMAPIERROR FAR * lppMAPIError, \
  487. LPXPLOGON FAR * lppXPLogon) IPURE; \
  488. #undef INTERFACE
  489. #define INTERFACE IXPProvider
  490. DECLARE_MAPI_INTERFACE_(IXPProvider, IUnknown)
  491. {
  492. BEGIN_INTERFACE
  493. MAPI_IUNKNOWN_METHODS(PURE)
  494. MAPI_IXPPROVIDER_METHODS(PURE)
  495. };
  496. /* OptionData returned from call to RegisterOptions */
  497. #define OPTION_TYPE_RECIPIENT ((ULONG) 0x00000001)
  498. #define OPTION_TYPE_MESSAGE ((ULONG) 0x00000002)
  499. typedef struct _OPTIONDATA
  500. {
  501. ULONG ulFlags; /* MAPI_RECIPIENT, MAPI_MESSAGE */
  502. LPGUID lpRecipGUID; /* Same as returned by AddressTypes() */
  503. LPTSTR lpszAdrType; /* Same as returned by AddressTypes() */
  504. LPTSTR lpszDLLName; /* Options DLL */
  505. ULONG ulOrdinal; /* Ordinal in that DLL */
  506. ULONG cbOptionsData; /* Count of bytes in lpbOptionsData */
  507. LPBYTE lpbOptionsData; /* Providers per [recip|message] option data */
  508. ULONG cOptionsProps; /* Count of Options default prop values */
  509. LPSPropValue lpOptionsProps; /* Default Options property values */
  510. } OPTIONDATA, FAR *LPOPTIONDATA;
  511. typedef SCODE (STDMAPIINITCALLTYPE OPTIONCALLBACK)(
  512. HINSTANCE hInst,
  513. LPMALLOC lpMalloc,
  514. ULONG ulFlags,
  515. ULONG cbOptionData,
  516. LPBYTE lpbOptionData,
  517. LPMAPISUP lpMAPISup,
  518. LPMAPIPROP lpDataSource,
  519. LPMAPIPROP FAR * lppWrappedSource,
  520. LPMAPIERROR FAR * lppMAPIError);
  521. /* For XP_AddressTypes */
  522. /*#define MAPI_UNICODE ((ULONG) 0x80000000) in mapidefs.h */
  523. /* For XP_RegisterRecipOptions */
  524. /*#define MAPI_UNICODE ((ULONG) 0x80000000) in mapidefs.h */
  525. /* For XP_RegisterMessageOptions */
  526. /*#define MAPI_UNICODE ((ULONG) 0x80000000) in mapidefs.h */
  527. /* For TransportNotify */
  528. #define NOTIFY_ABORT_DEFERRED ((ULONG) 0x40000000)
  529. #define NOTIFY_CANCEL_MESSAGE ((ULONG) 0x80000000)
  530. #define NOTIFY_BEGIN_INBOUND ((ULONG) 0x00000001)
  531. #define NOTIFY_END_INBOUND ((ULONG) 0x00010000)
  532. #define NOTIFY_BEGIN_OUTBOUND ((ULONG) 0x00000002)
  533. #define NOTIFY_END_OUTBOUND ((ULONG) 0x00020000)
  534. #define NOTIFY_BEGIN_INBOUND_FLUSH ((ULONG) 0x00000004)
  535. #define NOTIFY_END_INBOUND_FLUSH ((ULONG) 0x00040000)
  536. #define NOTIFY_BEGIN_OUTBOUND_FLUSH ((ULONG) 0x00000008)
  537. #define NOTIFY_END_OUTBOUND_FLUSH ((ULONG) 0x00080000)
  538. /* For TransportLogoff */
  539. #define LOGOFF_NORMAL ((ULONG) 0x00000001)
  540. #define LOGOFF_HURRY ((ULONG) 0x80000000)
  541. /* For SubmitMessage */
  542. #define BEGIN_DEFERRED ((ULONG) 0x00000001)
  543. /* For EndMessage */
  544. /* Flags that the Spooler may pass to the Transport: */
  545. /* Flags that the transport may pass to the Spooler: */
  546. #define END_RESEND_NOW ((ULONG) 0x00010000)
  547. #define END_RESEND_LATER ((ULONG) 0x00020000)
  548. #define END_DONT_RESEND ((ULONG) 0x00040000)
  549. #define MAPI_IXPLOGON_METHODS(IPURE) \
  550. MAPIMETHOD(AddressTypes) \
  551. (THIS_ ULONG FAR * lpulFlags, \
  552. ULONG FAR * lpcAdrType, \
  553. LPTSTR FAR * FAR * lpppAdrTypeArray, \
  554. ULONG FAR * lpcMAPIUID, \
  555. LPMAPIUID FAR * FAR * lpppUIDArray) IPURE; \
  556. MAPIMETHOD(RegisterOptions) \
  557. (THIS_ ULONG FAR * lpulFlags, \
  558. ULONG FAR * lpcOptions, \
  559. LPOPTIONDATA FAR * lppOptions) IPURE; \
  560. MAPIMETHOD(TransportNotify) \
  561. (THIS_ ULONG FAR * lpulFlags, \
  562. LPVOID FAR * lppvData) IPURE; \
  563. MAPIMETHOD(Idle) \
  564. (THIS_ ULONG ulFlags) IPURE; \
  565. MAPIMETHOD(TransportLogoff) \
  566. (THIS_ ULONG ulFlags) IPURE; \
  567. MAPIMETHOD(SubmitMessage) \
  568. (THIS_ ULONG ulFlags, \
  569. LPMESSAGE lpMessage, \
  570. ULONG FAR * lpulMsgRef, \
  571. ULONG FAR * lpulReturnParm) IPURE; \
  572. MAPIMETHOD(EndMessage) \
  573. (THIS_ ULONG ulMsgRef, \
  574. ULONG FAR * lpulFlags) IPURE; \
  575. MAPIMETHOD(Poll) \
  576. (THIS_ ULONG FAR * lpulIncoming) IPURE; \
  577. MAPIMETHOD(StartMessage) \
  578. (THIS_ ULONG ulFlags, \
  579. LPMESSAGE lpMessage, \
  580. ULONG FAR * lpulMsgRef) IPURE; \
  581. MAPIMETHOD(OpenStatusEntry) \
  582. (THIS_ LPCIID lpInterface, \
  583. ULONG ulFlags, \
  584. ULONG FAR * lpulObjType, \
  585. LPMAPISTATUS FAR * lppEntry) IPURE; \
  586. MAPIMETHOD(ValidateState) \
  587. (THIS_ ULONG ulUIParam, \
  588. ULONG ulFlags) IPURE; \
  589. MAPIMETHOD(FlushQueues) \
  590. (THIS_ ULONG ulUIParam, \
  591. ULONG cbTargetTransport, \
  592. LPENTRYID lpTargetTransport, \
  593. ULONG ulFlags) IPURE; \
  594. #undef INTERFACE
  595. #define INTERFACE IXPLogon
  596. DECLARE_MAPI_INTERFACE_(IXPLogon, IUnknown)
  597. {
  598. BEGIN_INTERFACE
  599. MAPI_IUNKNOWN_METHODS(PURE)
  600. MAPI_IXPLOGON_METHODS(PURE)
  601. };
  602. /* Transport Provider Entry Point */
  603. typedef HRESULT (STDMAPIINITCALLTYPE XPPROVIDERINIT)(
  604. HINSTANCE hInstance,
  605. LPMALLOC lpMalloc,
  606. LPALLOCATEBUFFER lpAllocateBuffer,
  607. LPALLOCATEMORE lpAllocateMore,
  608. LPFREEBUFFER lpFreeBuffer,
  609. ULONG ulFlags,
  610. ULONG ulMAPIVer,
  611. ULONG FAR * lpulProviderVer,
  612. LPXPPROVIDER FAR * lppXPProvider);
  613. XPPROVIDERINIT XPProviderInit;
  614. /********************************************************************/
  615. /* */
  616. /* MESSAGE STORE SPI */
  617. /* */
  618. /********************************************************************/
  619. /* Flags and enums */
  620. /* For Logon() */
  621. /*#define MAPI_UNICODE ((ULONG) 0x80000000) in mapidefs.h */
  622. /*#define MDB_NO_DIALOG ((ULONG) 0x00000001) in mapidefs.h */
  623. /*#define MDB_WRITE ((ULONG) 0x00000004) in mapidefs.h */
  624. /*#define MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) in mapidefs.h */
  625. /*#define MDB_TEMPORARY ((ULONG) 0x00000020) in mapidefs.h */
  626. /*#define MDB_NO_MAIL ((ULONG) 0x00000080) in mapidefs.h */
  627. /* For SpoolerLogon() */
  628. /*#define MAPI_UNICODE ((ULONG) 0x80000000) in mapidefs.h */
  629. /*#define MDB_NO_DIALOG ((ULONG) 0x00000001) in mapidefs.h */
  630. /*#define MDB_WRITE ((ULONG) 0x00000004) in mapidefs.h */
  631. /*#define MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) in mapidefs.h */
  632. /* GetCredentials, SetCredentials */
  633. #define LOGON_SP_TRANSPORT ((ULONG) 0x00000001)
  634. #define LOGON_SP_PROMPT ((ULONG) 0x00000002)
  635. #define LOGON_SP_NEWPW ((ULONG) 0x00000004)
  636. #define LOGON_CHANGED ((ULONG) 0x00000008)
  637. /* CopyMessages */
  638. #define MESSAGE_NOMARK ((ULONG) 0x00000008)
  639. /* DoMCDialog */
  640. #define DIALOG_FOLDER ((ULONG) 0x00000001)
  641. #define DIALOG_MESSAGE ((ULONG) 0x00000002)
  642. #define DIALOG_PROP ((ULONG) 0x00000004)
  643. #define DIALOG_ATTACH ((ULONG) 0x00000008)
  644. #define DIALOG_MOVE ((ULONG) 0x00000010)
  645. #define DIALOG_COPY ((ULONG) 0x00000020)
  646. #define DIALOG_DELETE ((ULONG) 0x00000040)
  647. #define DIALOG_ALLOW_CANCEL ((ULONG) 0x00000080)
  648. #define DIALOG_CONFIRM_CANCEL ((ULONG) 0x00000100)
  649. /* ExpandRecips */
  650. #define NEEDS_PREPROCESSING ((ULONG) 0x00000001)
  651. /* PrepareSubmit */
  652. #define CHECK_SENDER ((ULONG) 0x00000001)
  653. #define NON_STANDARD ((ULONG) 0x00010000)
  654. DECLARE_MAPI_INTERFACE_PTR(IMSLogon, LPMSLOGON);
  655. DECLARE_MAPI_INTERFACE_PTR(IMSProvider, LPMSPROVIDER);
  656. /* Message Store Provider Interface (IMSPROVIDER) */
  657. #define MAPI_IMSPROVIDER_METHODS(IPURE) \
  658. MAPIMETHOD(Shutdown) \
  659. (THIS_ ULONG FAR * lpulFlags) IPURE; \
  660. MAPIMETHOD(Logon) \
  661. (THIS_ LPMAPISUP lpMAPISup, \
  662. ULONG ulUIParam, \
  663. LPTSTR lpszProfileName, \
  664. ULONG cbEntryID, \
  665. LPENTRYID lpEntryID, \
  666. ULONG ulFlags, \
  667. LPCIID lpInterface, \
  668. ULONG FAR * lpcbSpoolSecurity, \
  669. LPBYTE FAR * lppbSpoolSecurity, \
  670. LPMAPIERROR FAR * lppMAPIError, \
  671. LPMSLOGON FAR * lppMSLogon, \
  672. LPMDB FAR * lppMDB) IPURE; \
  673. MAPIMETHOD(SpoolerLogon) \
  674. (THIS_ LPMAPISUP lpMAPISup, \
  675. ULONG ulUIParam, \
  676. LPTSTR lpszProfileName, \
  677. ULONG cbEntryID, \
  678. LPENTRYID lpEntryID, \
  679. ULONG ulFlags, \
  680. LPCIID lpInterface, \
  681. ULONG cbSpoolSecurity, \
  682. LPBYTE lpbSpoolSecurity, \
  683. LPMAPIERROR FAR * lppMAPIError, \
  684. LPMSLOGON FAR * lppMSLogon, \
  685. LPMDB FAR * lppMDB) IPURE; \
  686. MAPIMETHOD(CompareStoreIDs) \
  687. (THIS_ ULONG cbEntryID1, \
  688. LPENTRYID lpEntryID1, \
  689. ULONG cbEntryID2, \
  690. LPENTRYID lpEntryID2, \
  691. ULONG ulFlags, \
  692. ULONG FAR * lpulResult) IPURE; \
  693. #undef INTERFACE
  694. #define INTERFACE IMSProvider
  695. DECLARE_MAPI_INTERFACE_(IMSProvider, IUnknown)
  696. {
  697. BEGIN_INTERFACE
  698. MAPI_IUNKNOWN_METHODS(PURE)
  699. MAPI_IMSPROVIDER_METHODS(PURE)
  700. };
  701. /* The MSLOGON object is returned by the Logon() method of the
  702. * MSPROVIDER interface. This object is for use by MAPIX.DLL.
  703. */
  704. #define MAPI_IMSLOGON_METHODS(IPURE) \
  705. MAPIMETHOD(GetLastError) \
  706. (THIS_ HRESULT hResult, \
  707. ULONG ulFlags, \
  708. LPMAPIERROR FAR * lppMAPIError) IPURE; \
  709. MAPIMETHOD(Logoff) \
  710. (THIS_ ULONG FAR * lpulFlags) IPURE; \
  711. MAPIMETHOD(OpenEntry) \
  712. (THIS_ ULONG cbEntryID, \
  713. LPENTRYID lpEntryID, \
  714. LPCIID lpInterface, \
  715. ULONG ulFlags, \
  716. ULONG FAR * lpulObjType, \
  717. LPUNKNOWN FAR * lppUnk) IPURE; \
  718. MAPIMETHOD(CompareEntryIDs) \
  719. (THIS_ ULONG cbEntryID1, \
  720. LPENTRYID lpEntryID1, \
  721. ULONG cbEntryID2, \
  722. LPENTRYID lpEntryID2, \
  723. ULONG ulFlags, \
  724. ULONG FAR * lpulResult) IPURE; \
  725. MAPIMETHOD(Advise) \
  726. (THIS_ ULONG cbEntryID, \
  727. LPENTRYID lpEntryID, \
  728. ULONG ulEventMask, \
  729. LPMAPIADVISESINK lpAdviseSink, \
  730. ULONG FAR * lpulConnection) IPURE; \
  731. MAPIMETHOD(Unadvise) \
  732. (THIS_ ULONG ulConnection) IPURE; \
  733. MAPIMETHOD(OpenStatusEntry) \
  734. (THIS_ LPCIID lpInterface, \
  735. ULONG ulFlags, \
  736. ULONG FAR * lpulObjType, \
  737. LPVOID FAR * lppEntry) IPURE; \
  738. #undef INTERFACE
  739. #define INTERFACE IMSLogon
  740. DECLARE_MAPI_INTERFACE_(IMSLogon, IUnknown)
  741. {
  742. BEGIN_INTERFACE
  743. MAPI_IUNKNOWN_METHODS(PURE)
  744. MAPI_IMSLOGON_METHODS(PURE)
  745. };
  746. /* Message Store Provider Entry Point */
  747. typedef HRESULT (STDMAPIINITCALLTYPE MSPROVIDERINIT)(
  748. HINSTANCE hInstance,
  749. LPMALLOC lpMalloc, /* AddRef() if you keep it */
  750. LPALLOCATEBUFFER lpAllocateBuffer, /* -> AllocateBuffer */
  751. LPALLOCATEMORE lpAllocateMore, /* -> AllocateMore */
  752. LPFREEBUFFER lpFreeBuffer, /* -> FreeBuffer */
  753. ULONG ulFlags,
  754. ULONG ulMAPIVer,
  755. ULONG FAR * lpulProviderVer,
  756. LPMSPROVIDER FAR * lppMSProvider
  757. );
  758. MSPROVIDERINIT MSProviderInit;
  759. /********************************************************************/
  760. /* */
  761. /* MESSAGE SERVICE CONFIGURATION */
  762. /* */
  763. /********************************************************************/
  764. /* Flags for service configuration entry point */
  765. /* #define UI_SERVICE 0x00000002 */
  766. /* #define UI_CURRENT_PROVIDER_FIRST 0x00000004 */
  767. #define MSG_SERVICE_UI_READ_ONLY 0x00000008 /* display parameters only */
  768. /* Contexts for service configuration entry point */
  769. #define MSG_SERVICE_INSTALL 0x00000001
  770. #define MSG_SERVICE_CREATE 0x00000002
  771. #define MSG_SERVICE_CONFIGURE 0x00000003
  772. #define MSG_SERVICE_DELETE 0x00000004
  773. #define MSG_SERVICE_UNINSTALL 0x00000005
  774. #define MSG_SERVICE_PROVIDER_CREATE 0x00000006
  775. #define MSG_SERVICE_PROVIDER_DELETE 0x00000007
  776. /* Prototype for service configuration entry point */
  777. typedef HRESULT (STDAPICALLTYPE MSGSERVICEENTRY)(
  778. HINSTANCE hInstance,
  779. LPMALLOC lpMalloc,
  780. LPMAPISUP lpMAPISup,
  781. ULONG ulUIParam,
  782. ULONG ulFlags,
  783. ULONG ulContext,
  784. ULONG cValues,
  785. LPSPropValue lpProps,
  786. LPPROVIDERADMIN lpProviderAdmin,
  787. LPMAPIERROR FAR *lppMapiError
  788. );
  789. typedef MSGSERVICEENTRY FAR *LPMSGSERVICEENTRY;
  790. #ifdef __cplusplus
  791. }
  792. #endif
  793. #endif /* MAPISPI_H */