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

模拟服务器

开发平台:

C/C++

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