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.

931 lines
32 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 1986-1999 Microsoft Corporation. All Rights Reserved.
  8. */
  9. #ifndef MAPISPI_H
  10. #define MAPISPI_H
  11. #if _MSC_VER > 1000
  12. #pragma once
  13. #endif
  14. /* Include common MAPI header files if they haven't been already. */
  15. #ifndef MAPIDEFS_H
  16. #include <mapidefs.h>
  17. #endif
  18. #ifndef MAPICODE_H
  19. #include <mapicode.h>
  20. #endif
  21. #ifndef MAPIGUID_H
  22. #include <mapiguid.h>
  23. #endif
  24. #ifndef MAPITAGS_H
  25. #include <mapitags.h>
  26. #endif
  27. #if defined (WIN16) || defined (DOS) || defined (DOS16)
  28. #include <storage.h>
  29. #endif
  30. #ifndef BEGIN_INTERFACE
  31. #define BEGIN_INTERFACE
  32. #endif
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. /* The MAPI SPI has a version number. MAPIX.DLL knows and supports
  37. * one or more versions of the SPI. Each provider supports one or
  38. * more versions of the SPI. Checks are performed in both MAPIX.DLL
  39. * and in the provider to ensure that they agree to use exactly one
  40. * version of the MAPI SPI.
  41. *
  42. * The SPI version number is composed of a major (8-bit) version,
  43. * minor (8-bit) version, and micro (16-bit) version. The first
  44. * retail ship of MAPI 1.0 is expected to be version 1.0.0.
  45. * The major version number changes rarely.
  46. * The minor version number changes opon each retail ship of
  47. * MAPI if the SPI has been modified.
  48. * The micro version number changes internally at Microsoft
  49. * during development of MAPI.
  50. *
  51. * The version of the SPI documented by this set of header files
  52. * is ALWAYS known as "CURRENT_SPI_VERSION". If you write a
  53. * service provider, and get a new set of header files, and update
  54. * your code to the new interface, you'll be at the "current" version.
  55. */
  56. #define CURRENT_SPI_VERSION 0x00010010L
  57. /* Here are some well-known SPI version numbers:
  58. * (These will eventually be useful for provider-writers who
  59. * might choose to make provider DLLs that support more than
  60. * one version of the MAPI SPI.
  61. */
  62. #define PDK1_SPI_VERSION 0x00010000L /* 0.1.0 MAPI PDK1 Spring 1993 */
  63. #define PDK2_SPI_VERSION 0x00010008L /* 0.1.8 MAPI PDK2 Spring 1994 */
  64. #define PDK3_SPI_VERSION 0x00010010L /* 0.1.16 MAPI PDK3 Fall 1994 */
  65. /*
  66. * Forward declaration of interface pointers specific to the service
  67. * provider interface.
  68. */
  69. DECLARE_MAPI_INTERFACE_PTR(IMAPISupport, LPMAPISUP);
  70. /* IMAPISupport Interface -------------------------------------------------- */
  71. /* Notification key structure for the MAPI notification engine */
  72. typedef struct
  73. {
  74. ULONG cb; /* How big the key is */
  75. BYTE ab[MAPI_DIM]; /* Key contents */
  76. } NOTIFKEY, FAR * LPNOTIFKEY;
  77. #define CbNewNOTIFKEY(_cb) (offsetof(NOTIFKEY,ab) + (_cb))
  78. #define CbNOTIFKEY(_lpkey) (offsetof(NOTIFKEY,ab) + (_lpkey)->cb)
  79. #define SizedNOTIFKEY(_cb, _name) \
  80. struct _NOTIFKEY_ ## _name \
  81. { \
  82. ULONG cb; \
  83. BYTE ab[_cb]; \
  84. } _name
  85. /* For Subscribe() */
  86. #define NOTIFY_SYNC ((ULONG) 0x40000000)
  87. /* For Notify() */
  88. #define NOTIFY_CANCELED ((ULONG) 0x80000000)
  89. /* From the Notification Callback function (well, this is really a ulResult) */
  90. #define CALLBACK_DISCONTINUE ((ULONG) 0x80000000)
  91. /* For Transport's SpoolerNotify() */
  92. #define NOTIFY_NEWMAIL ((ULONG) 0x00000001)
  93. #define NOTIFY_READYTOSEND ((ULONG) 0x00000002)
  94. #define NOTIFY_SENTDEFERRED ((ULONG) 0x00000004)
  95. #define NOTIFY_CRITSEC ((ULONG) 0x00001000)
  96. #define NOTIFY_NONCRIT ((ULONG) 0x00002000)
  97. #define NOTIFY_CONFIG_CHANGE ((ULONG) 0x00004000)
  98. #define NOTIFY_CRITICAL_ERROR ((ULONG) 0x10000000)
  99. /* For Message Store's SpoolerNotify() */
  100. #define NOTIFY_NEWMAIL_RECEIVED ((ULONG) 0x20000000)
  101. /* For ModifyStatusRow() */
  102. #define STATUSROW_UPDATE ((ULONG) 0x10000000)
  103. /* For IStorageFromStream() */
  104. #define STGSTRM_RESET ((ULONG) 0x00000000)
  105. #define STGSTRM_CURRENT ((ULONG) 0x10000000)
  106. #define STGSTRM_MODIFY ((ULONG) 0x00000002)
  107. #define STGSTRM_CREATE ((ULONG) 0x00001000)
  108. /* For GetOneOffTable() */
  109. /****** MAPI_UNICODE ((ULONG) 0x80000000) */
  110. /* For CreateOneOff() */
  111. /****** MAPI_UNICODE ((ULONG) 0x80000000) */
  112. /****** MAPI_SEND_NO_RICH_INFO ((ULONG) 0x00010000) */
  113. /* For ReadReceipt() */
  114. #define MAPI_NON_READ ((ULONG) 0x00000001)
  115. /* For DoConfigPropSheet() */
  116. /****** MAPI_UNICODE ((ULONG) 0x80000000) */
  117. /* Preprocessor calls: */
  118. /* PreprocessMessage, first ordinal in RegisterPreprocessor(). */
  119. typedef HRESULT (STDMETHODCALLTYPE PREPROCESSMESSAGE)(
  120. LPVOID lpvSession,
  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. /* DoMCDialog */
  638. #define DIALOG_FOLDER ((ULONG) 0x00000001)
  639. #define DIALOG_MESSAGE ((ULONG) 0x00000002)
  640. #define DIALOG_PROP ((ULONG) 0x00000004)
  641. #define DIALOG_ATTACH ((ULONG) 0x00000008)
  642. #define DIALOG_MOVE ((ULONG) 0x00000010)
  643. #define DIALOG_COPY ((ULONG) 0x00000020)
  644. #define DIALOG_DELETE ((ULONG) 0x00000040)
  645. #define DIALOG_ALLOW_CANCEL ((ULONG) 0x00000080)
  646. #define DIALOG_CONFIRM_CANCEL ((ULONG) 0x00000100)
  647. /* ExpandRecips */
  648. #define NEEDS_PREPROCESSING ((ULONG) 0x00000001)
  649. #define NEEDS_SPOOLER ((ULONG) 0x00000002)
  650. /* PrepareSubmit */
  651. #define CHECK_SENDER ((ULONG) 0x00000001)
  652. #define NON_STANDARD ((ULONG) 0x00010000)
  653. DECLARE_MAPI_INTERFACE_PTR(IMSLogon, LPMSLOGON);
  654. DECLARE_MAPI_INTERFACE_PTR(IMSProvider, LPMSPROVIDER);
  655. /* Message Store Provider Interface (IMSPROVIDER) */
  656. #define MAPI_IMSPROVIDER_METHODS(IPURE) \
  657. MAPIMETHOD(Shutdown) \
  658. (THIS_ ULONG FAR * lpulFlags) IPURE; \
  659. MAPIMETHOD(Logon) \
  660. (THIS_ LPMAPISUP lpMAPISup, \
  661. ULONG ulUIParam, \
  662. LPTSTR lpszProfileName, \
  663. ULONG cbEntryID, \
  664. LPENTRYID lpEntryID, \
  665. ULONG ulFlags, \
  666. LPCIID lpInterface, \
  667. ULONG FAR * lpcbSpoolSecurity, \
  668. LPBYTE FAR * lppbSpoolSecurity, \
  669. LPMAPIERROR FAR * lppMAPIError, \
  670. LPMSLOGON FAR * lppMSLogon, \
  671. LPMDB FAR * lppMDB) IPURE; \
  672. MAPIMETHOD(SpoolerLogon) \
  673. (THIS_ LPMAPISUP lpMAPISup, \
  674. ULONG ulUIParam, \
  675. LPTSTR lpszProfileName, \
  676. ULONG cbEntryID, \
  677. LPENTRYID lpEntryID, \
  678. ULONG ulFlags, \
  679. LPCIID lpInterface, \
  680. ULONG cbSpoolSecurity, \
  681. LPBYTE lpbSpoolSecurity, \
  682. LPMAPIERROR FAR * lppMAPIError, \
  683. LPMSLOGON FAR * lppMSLogon, \
  684. LPMDB FAR * lppMDB) IPURE; \
  685. MAPIMETHOD(CompareStoreIDs) \
  686. (THIS_ ULONG cbEntryID1, \
  687. LPENTRYID lpEntryID1, \
  688. ULONG cbEntryID2, \
  689. LPENTRYID lpEntryID2, \
  690. ULONG ulFlags, \
  691. ULONG FAR * lpulResult) IPURE; \
  692. #undef INTERFACE
  693. #define INTERFACE IMSProvider
  694. DECLARE_MAPI_INTERFACE_(IMSProvider, IUnknown)
  695. {
  696. BEGIN_INTERFACE
  697. MAPI_IUNKNOWN_METHODS(PURE)
  698. MAPI_IMSPROVIDER_METHODS(PURE)
  699. };
  700. /* The MSLOGON object is returned by the Logon() method of the
  701. * MSPROVIDER interface. This object is for use by MAPIX.DLL.
  702. */
  703. #define MAPI_IMSLOGON_METHODS(IPURE) \
  704. MAPIMETHOD(GetLastError) \
  705. (THIS_ HRESULT hResult, \
  706. ULONG ulFlags, \
  707. LPMAPIERROR FAR * lppMAPIError) IPURE; \
  708. MAPIMETHOD(Logoff) \
  709. (THIS_ ULONG FAR * lpulFlags) IPURE; \
  710. MAPIMETHOD(OpenEntry) \
  711. (THIS_ ULONG cbEntryID, \
  712. LPENTRYID lpEntryID, \
  713. LPCIID lpInterface, \
  714. ULONG ulFlags, \
  715. ULONG FAR * lpulObjType, \
  716. LPUNKNOWN FAR * lppUnk) IPURE; \
  717. MAPIMETHOD(CompareEntryIDs) \
  718. (THIS_ ULONG cbEntryID1, \
  719. LPENTRYID lpEntryID1, \
  720. ULONG cbEntryID2, \
  721. LPENTRYID lpEntryID2, \
  722. ULONG ulFlags, \
  723. ULONG FAR * lpulResult) IPURE; \
  724. MAPIMETHOD(Advise) \
  725. (THIS_ ULONG cbEntryID, \
  726. LPENTRYID lpEntryID, \
  727. ULONG ulEventMask, \
  728. LPMAPIADVISESINK lpAdviseSink, \
  729. ULONG FAR * lpulConnection) IPURE; \
  730. MAPIMETHOD(Unadvise) \
  731. (THIS_ ULONG ulConnection) IPURE; \
  732. MAPIMETHOD(OpenStatusEntry) \
  733. (THIS_ LPCIID lpInterface, \
  734. ULONG ulFlags, \
  735. ULONG FAR * lpulObjType, \
  736. LPVOID FAR * lppEntry) IPURE; \
  737. #undef INTERFACE
  738. #define INTERFACE IMSLogon
  739. DECLARE_MAPI_INTERFACE_(IMSLogon, IUnknown)
  740. {
  741. BEGIN_INTERFACE
  742. MAPI_IUNKNOWN_METHODS(PURE)
  743. MAPI_IMSLOGON_METHODS(PURE)
  744. };
  745. /* Message Store Provider Entry Point */
  746. typedef HRESULT (STDMAPIINITCALLTYPE MSPROVIDERINIT)(
  747. HINSTANCE hInstance,
  748. LPMALLOC lpMalloc, /* AddRef() if you keep it */
  749. LPALLOCATEBUFFER lpAllocateBuffer, /* -> AllocateBuffer */
  750. LPALLOCATEMORE lpAllocateMore, /* -> AllocateMore */
  751. LPFREEBUFFER lpFreeBuffer, /* -> FreeBuffer */
  752. ULONG ulFlags,
  753. ULONG ulMAPIVer,
  754. ULONG FAR * lpulProviderVer,
  755. LPMSPROVIDER FAR * lppMSProvider
  756. );
  757. MSPROVIDERINIT MSProviderInit;
  758. /********************************************************************/
  759. /* */
  760. /* MESSAGE SERVICE CONFIGURATION */
  761. /* */
  762. /********************************************************************/
  763. /* Flags for service configuration entry point */
  764. /* #define MAPI_UNICODE 0x80000000 */
  765. /* #define SERVICE_UI_ALWAYS 0x00000002 */
  766. /* #define SERVICE_UI_ALLOWED 0x00000010 */
  767. #define MSG_SERVICE_UI_READ_ONLY 0x00000008 /* display parameters only */
  768. #define SERVICE_LOGON_FAILED 0x00000020 /* reconfigure provider */
  769. /* Contexts for service configuration entry point */
  770. #define MSG_SERVICE_INSTALL 0x00000001
  771. #define MSG_SERVICE_CREATE 0x00000002
  772. #define MSG_SERVICE_CONFIGURE 0x00000003
  773. #define MSG_SERVICE_DELETE 0x00000004
  774. #define MSG_SERVICE_UNINSTALL 0x00000005
  775. #define MSG_SERVICE_PROVIDER_CREATE 0x00000006
  776. #define MSG_SERVICE_PROVIDER_DELETE 0x00000007
  777. /* Prototype for service configuration entry point */
  778. typedef HRESULT (STDAPICALLTYPE MSGSERVICEENTRY)(
  779. HINSTANCE hInstance,
  780. LPMALLOC lpMalloc,
  781. LPMAPISUP lpMAPISup,
  782. ULONG ulUIParam,
  783. ULONG ulFlags,
  784. ULONG ulContext,
  785. ULONG cValues,
  786. LPSPropValue lpProps,
  787. LPPROVIDERADMIN lpProviderAdmin,
  788. LPMAPIERROR FAR *lppMapiError
  789. );
  790. typedef MSGSERVICEENTRY FAR *LPMSGSERVICEENTRY;
  791. #ifdef __cplusplus
  792. }
  793. #endif
  794. #endif /* MAPISPI_H */