PageRenderTime 123ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/StdAfx.h

#
C Header | 582 lines | 425 code | 92 blank | 65 comment | 0 complexity | 843d91416cfcae7738ca6a05a5845890 MD5 | raw file
  1. // stdafx.h : include file for standard system include files,
  2. // or project specific include files that are used frequently, but
  3. // are changed infrequently
  4. //
  5. #pragma once
  6. #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
  7. #pragma warning(push)
  8. #pragma warning(disable: 4995)
  9. #include <cstdio>
  10. #include <cstring>
  11. #include <cwchar>
  12. #pragma warning(pop)
  13. // Speed up our string conversions for output
  14. #ifdef MRMAPI
  15. #define _CRT_DISABLE_PERFCRIT_LOCKS
  16. #endif
  17. #include <sal.h>
  18. // A bug in annotations in shobjidl.h forces us to disable 6387 to include afxwin.h
  19. #pragma warning(push)
  20. #pragma warning(disable:6387)
  21. #include <afxwin.h> // MFC core and standard components
  22. #pragma warning(pop)
  23. #include <afxcmn.h> // MFC support for Windows Common Controls
  24. #pragma warning(push)
  25. #pragma warning(disable: 4091)
  26. #include <shlobj.h>
  27. #pragma warning(pop)
  28. // Safe String handling header
  29. #include <strsafe.h>
  30. // Fix a build issue with a few versions of the MAPI headers
  31. #if !defined(FREEBUFFER_DEFINED)
  32. typedef ULONG(STDAPICALLTYPE FREEBUFFER)(
  33. LPVOID lpBuffer
  34. );
  35. #define FREEBUFFER_DEFINED
  36. #endif
  37. #include <MapiX.h>
  38. #include <MapiUtil.h>
  39. #include <MAPIform.h>
  40. #include <MAPIWz.h>
  41. #include <MAPIHook.h>
  42. #include <MSPST.h>
  43. #include <edkmdb.h>
  44. #include <exchform.h>
  45. #include <EMSAbTag.h>
  46. #include <IMessage.h>
  47. #include <edkguid.h>
  48. #include <tnef.h>
  49. #include <mapiaux.h>
  50. #include <aclui.h>
  51. #include <uxtheme.h>
  52. // there's an odd conflict with mimeole.h and richedit.h - this should fix it
  53. #ifdef UNICODE
  54. #undef CHARFORMAT
  55. #endif
  56. #include <mimeole.h>
  57. #ifdef UNICODE
  58. #undef CHARFORMAT
  59. #define CHARFORMAT CHARFORMATW
  60. #endif
  61. #include "resource.h" // main symbols
  62. #include "MFCOutput.h"
  63. #include "registry.h"
  64. #include "error.h"
  65. #include "MFCMAPI.h"
  66. struct TagNames
  67. {
  68. ULONG ulMatchingTableColumn;
  69. UINT uidName;
  70. };
  71. struct _ContentsData
  72. {
  73. LPSBinary lpEntryID; // Allocated with MAPIAllocateMore
  74. LPSBinary lpLongtermID; // Allocated with MAPIAllocateMore
  75. LPSBinary lpInstanceKey; // Allocated with MAPIAllocateMore
  76. LPSBinary lpServiceUID; // Allocated with MAPIAllocateMore
  77. LPSBinary lpProviderUID; // Allocated with MAPIAllocateMore
  78. TCHAR* szDN; // Allocated with MAPIAllocateMore
  79. CHAR* szProfileDisplayName; // Allocated with MAPIAllocateMore
  80. ULONG ulAttachNum;
  81. ULONG ulAttachMethod;
  82. ULONG ulRowID; // for recipients
  83. ULONG ulRowType; // PR_ROW_TYPE
  84. };
  85. struct _PropListData
  86. {
  87. ULONG ulPropTag;
  88. };
  89. struct _MVPropData
  90. {
  91. _PV val; // Allocated with MAPIAllocateMore
  92. };
  93. struct _TagData
  94. {
  95. ULONG ulPropTag;
  96. };
  97. struct _ResData
  98. {
  99. LPSRestriction lpOldRes; // not allocated - just a pointer
  100. LPSRestriction lpNewRes; // Owned by an alloc parent - do not free
  101. };
  102. struct _CommentData
  103. {
  104. LPSPropValue lpOldProp; // not allocated - just a pointer
  105. LPSPropValue lpNewProp; // Owned by an alloc parent - do not free
  106. };
  107. struct _BinaryData
  108. {
  109. SBinary OldBin; // not allocated - just a pointer
  110. SBinary NewBin; // MAPIAllocateMore from m_lpNewEntryList
  111. };
  112. class CAdviseSink;
  113. struct _NodeData
  114. {
  115. LPSBinary lpEntryID; // Allocated with MAPIAllocateMore
  116. LPSBinary lpInstanceKey; // Allocated with MAPIAllocateMore
  117. LPMAPITABLE lpHierarchyTable; // Object - free with Release
  118. CAdviseSink* lpAdviseSink; // Object - free with Release
  119. ULONG_PTR ulAdviseConnection;
  120. LONG cSubfolders; // -1 for unknown, 0 for no subfolders, >0 for at least one subfolder
  121. };
  122. struct SortListData
  123. {
  124. TCHAR* szSortText; // Allocated with MAPIAllocateBuffer
  125. ULARGE_INTEGER ulSortValue;
  126. ULONG ulSortDataType;
  127. union
  128. {
  129. _ContentsData Contents; // SORTLIST_CONTENTS
  130. _PropListData Prop; // SORTLIST_PROP
  131. _MVPropData MV; // SORTLIST_MVPROP
  132. _TagData Tag; // SORTLIST_TAGARRAY
  133. _ResData Res; // SORTLIST_RES
  134. _CommentData Comment; // SORTLIST_COMMENT
  135. _BinaryData Binary; // SORTLIST_BINARY
  136. _NodeData Node; // SORTLIST_TREENODE
  137. } data;
  138. ULONG cSourceProps;
  139. LPSPropValue lpSourceProps; // Stolen from lpsRowData in CContentsTableListCtrl::BuildDataItem - free with MAPIFreeBuffer
  140. bool bItemFullyLoaded;
  141. };
  142. // Macros to assist in OnInitMenu
  143. #define CHECK(state) ((state)?MF_CHECKED:MF_UNCHECKED)
  144. #define DIM(state) ((state)?MF_ENABLED:MF_GRAYED)
  145. #define DIMMSOK(iNumSelected) ((iNumSelected>=1)?MF_ENABLED:MF_GRAYED)
  146. #define DIMMSNOK(iNumSelected) ((iNumSelected==1)?MF_ENABLED:MF_GRAYED)
  147. // Various flags gleaned from product documentation and KB articles
  148. // http://msdn2.microsoft.com/en-us/library/ms526744.aspx
  149. #define STORE_HTML_OK ((ULONG) 0x00010000)
  150. #define STORE_ANSI_OK ((ULONG) 0x00020000)
  151. #define STORE_LOCALSTORE ((ULONG) 0x00080000)
  152. // http://msdn2.microsoft.com/en-us/library/ms531462.aspx
  153. #define ATT_INVISIBLE_IN_HTML ((ULONG) 0x00000001)
  154. #define ATT_INVISIBLE_IN_RTF ((ULONG) 0x00000002)
  155. #define ATT_MHTML_REF ((ULONG) 0x00000004)
  156. // http://msdn2.microsoft.com/en-us/library/ms527629.aspx
  157. #define MSGFLAG_ORIGIN_X400 ((ULONG) 0x00001000)
  158. #define MSGFLAG_ORIGIN_INTERNET ((ULONG) 0x00002000)
  159. #define MSGFLAG_ORIGIN_MISC_EXT ((ULONG) 0x00008000)
  160. #define MSGFLAG_OUTLOOK_NON_EMS_XP ((ULONG) 0x00010000)
  161. // http://msdn2.microsoft.com/en-us/library/ms528848.aspx
  162. #define MSGSTATUS_DRAFT ((ULONG) 0x00000100)
  163. #define MSGSTATUS_ANSWERED ((ULONG) 0x00000200)
  164. #define ENCODING_PREFERENCE ((ULONG) 0x00020000)
  165. #define ENCODING_MIME ((ULONG) 0x00040000)
  166. #define BODY_ENCODING_HTML ((ULONG) 0x00080000)
  167. #define BODY_ENCODING_TEXT_AND_HTML ((ULONG) 0x00100000)
  168. #define MAC_ATTACH_ENCODING_UUENCODE ((ULONG) 0x00200000)
  169. #define MAC_ATTACH_ENCODING_APPLESINGLE ((ULONG) 0x00400000)
  170. #define MAC_ATTACH_ENCODING_APPLEDOUBLE ((ULONG) 0x00600000)
  171. // Custom messages - used to ensure actions occur on the right threads.
  172. // Used by CAdviseSink:
  173. #define WM_MFCMAPI_ADDITEM WM_APP+1
  174. #define WM_MFCMAPI_DELETEITEM WM_APP+2
  175. #define WM_MFCMAPI_MODIFYITEM WM_APP+3
  176. #define WM_MFCMAPI_REFRESHTABLE WM_APP+4
  177. // Used by DwThreadFuncLoadTable
  178. #define WM_MFCMAPI_THREADADDITEM WM_APP+5
  179. #define WM_MFCMAPI_UPDATESTATUSBAR WM_APP+6
  180. #define WM_MFCMAPI_CLEARSINGLEMAPIPROPLIST WM_APP+7
  181. // Used by CSingleMAPIPropListCtrl and CSortHeader
  182. #define WM_MFCMAPI_SAVECOLUMNORDERHEADER WM_APP+10
  183. #define WM_MFCMAPI_SAVECOLUMNORDERLIST WM_APP+11
  184. // Used by CContentsTableDlg
  185. #define WM_MFCMAPI_RESETCOLUMNS WM_APP+12
  186. // Definitions for WrapCompressedRTFStreamEx in param for WrapCompressedRTFStreamEX
  187. // http://msdn2.microsoft.com/en-us/library/bb905293.aspx
  188. struct RTF_WCSINFO {
  189. ULONG size; // Size of the structure
  190. ULONG ulFlags;
  191. /****** MAPI_MODIFY ((ULONG) 0x00000001) above */
  192. /****** STORE_UNCOMPRESSED_RTF ((ULONG) 0x00008000) above */
  193. /****** MAPI_NATIVE_BODY ((ULONG) 0x00010000) mapidefs.h Only used for reading*/
  194. ULONG ulInCodePage; // Codepage of the message, used when passing MAPI_NATIVE_BODY, ignored otherwise
  195. ULONG ulOutCodePage; // Codepage of the Returned Stream, used when passing MAPI_NATIVE_BODY, ignored otherwise
  196. };
  197. // out param type information for WrapCompressedRTFStreamEX
  198. // http://msdn2.microsoft.com/en-us/library/bb905294.aspx
  199. struct RTF_WCSRETINFO {
  200. ULONG size; // Size of the structure
  201. ULONG ulStreamFlags;
  202. /****** MAPI_NATIVE_BODY_TYPE_RTF ((ULONG) 0x00000001) mapidefs.h */
  203. /****** MAPI_NATIVE_BODY_TYPE_HTML ((ULONG) 0x00000002) mapidefs.h */
  204. /****** MAPI_NATIVE_BODY_TYPE_PLAINTEXT ((ULONG) 0x00000004) mapidefs.h */
  205. };
  206. #define MAPI_NATIVE_BODY 0x00010000
  207. /* out param type infomation for WrapCompressedRTFStreamEx */
  208. #define MAPI_NATIVE_BODY_TYPE_RTF 0x00000001
  209. #define MAPI_NATIVE_BODY_TYPE_HTML 0x00000002
  210. #define MAPI_NATIVE_BODY_TYPE_PLAINTEXT 0x00000004
  211. // For EditSecurity
  212. typedef bool (STDAPICALLTYPE EDITSECURITY)
  213. (
  214. HWND hwndOwner,
  215. LPSECURITYINFO psi
  216. );
  217. typedef EDITSECURITY* LPEDITSECURITY;
  218. // For StgCreateStorageEx
  219. typedef HRESULT(STDAPICALLTYPE STGCREATESTORAGEEX)
  220. (
  221. IN const WCHAR* pwcsName,
  222. IN DWORD grfMode,
  223. IN DWORD stgfmt, // enum
  224. IN DWORD grfAttrs, // reserved
  225. IN STGOPTIONS * pStgOptions,
  226. IN void * reserved,
  227. IN REFIID riid,
  228. OUT void ** ppObjectOpen);
  229. typedef STGCREATESTORAGEEX* LPSTGCREATESTORAGEEX;
  230. // For Themes
  231. typedef HTHEME(STDMETHODCALLTYPE OPENTHEMEDATA)
  232. (
  233. HWND hwnd,
  234. LPCWSTR pszClassList);
  235. typedef OPENTHEMEDATA* LPOPENTHEMEDATA;
  236. typedef HTHEME(STDMETHODCALLTYPE CLOSETHEMEDATA)
  237. (
  238. HTHEME hTheme);
  239. typedef CLOSETHEMEDATA* LPCLOSETHEMEDATA;
  240. typedef HRESULT(STDMETHODCALLTYPE GETTHEMEMARGINS)
  241. (
  242. HTHEME hTheme,
  243. OPTIONAL HDC hdc,
  244. int iPartId,
  245. int iStateId,
  246. int iPropId,
  247. OPTIONAL RECT *prc,
  248. OUT MARGINS *pMargins);
  249. typedef GETTHEMEMARGINS* LPGETTHEMEMARGINS;
  250. typedef HRESULT(STDMETHODCALLTYPE SETWINDOWTHEME)
  251. (
  252. __in HWND hwnd,
  253. __in LPCWSTR pszSubAppName,
  254. __in LPCWSTR pszSubIdList
  255. );
  256. typedef SETWINDOWTHEME* LPSETWINDOWTHEME;
  257. typedef int (STDMETHODCALLTYPE GETTHEMESYSSIZE)
  258. (
  259. HTHEME hTheme,
  260. int iSizeID
  261. );
  262. typedef GETTHEMESYSSIZE* LPGETTHEMESYSSIZE;
  263. typedef HRESULT(STDMETHODCALLTYPE MSIPROVIDEQUALIFIEDCOMPONENT)
  264. (
  265. LPCWSTR szCategory,
  266. LPCWSTR szQualifier,
  267. DWORD dwInstallMode,
  268. LPWSTR lpPathBuf,
  269. LPDWORD pcchPathBuf
  270. );
  271. typedef MSIPROVIDEQUALIFIEDCOMPONENT* LPMSIPROVIDEQUALIFIEDCOMPONENT;
  272. typedef HRESULT(STDMETHODCALLTYPE MSIGETFILEVERSION)
  273. (
  274. LPCWSTR szFilePath,
  275. LPWSTR lpVersionBuf,
  276. LPDWORD pcchVersionBuf,
  277. LPWSTR lpLangBuf,
  278. LPDWORD pcchLangBuf
  279. );
  280. typedef MSIGETFILEVERSION* LPMSIGETFILEVERSION;
  281. typedef HRESULT(STDMETHODCALLTYPE SHGETPROPERTYSTOREFORWINDOW)
  282. (
  283. HWND hwnd,
  284. REFIID riid,
  285. void** ppv
  286. );
  287. typedef SHGETPROPERTYSTOREFORWINDOW* LPSHGETPROPERTYSTOREFORWINDOW;
  288. // http://msdn.microsoft.com/en-us/library/office/dn433223.aspx
  289. #pragma pack(4)
  290. struct CONTAB_ENTRYID
  291. {
  292. BYTE abFlags[4];
  293. MAPIUID muid;
  294. ULONG ulVersion;
  295. ULONG ulType;
  296. ULONG ulIndex;
  297. ULONG cbeid;
  298. BYTE abeid[1];
  299. };
  300. typedef CONTAB_ENTRYID* LPCONTAB_ENTRYID;
  301. #pragma pack()
  302. // http://msdn.microsoft.com/en-us/library/office/dn433221.aspx
  303. #pragma pack(4)
  304. struct DIR_ENTRYID
  305. {
  306. BYTE abFlags[4];
  307. MAPIUID muid;
  308. ULONG ulVersion;
  309. ULONG ulType;
  310. MAPIUID muidID;
  311. };
  312. typedef DIR_ENTRYID* LPDIR_ENTRYID;
  313. #pragma pack()
  314. // http://msdn2.microsoft.com/en-us/library/bb820951.aspx
  315. #define MAPI_IPROXYSTOREOBJECT_METHODS(IPURE) \
  316. MAPIMETHOD(PlaceHolder1) \
  317. () IPURE; \
  318. MAPIMETHOD(UnwrapNoRef) \
  319. (LPVOID *ppvObject) IPURE; \
  320. MAPIMETHOD(PlaceHolder2) \
  321. () IPURE;
  322. DECLARE_MAPI_INTERFACE_(IProxyStoreObject, IUnknown)
  323. {
  324. BEGIN_INTERFACE
  325. MAPI_IUNKNOWN_METHODS(PURE)
  326. MAPI_IPROXYSTOREOBJECT_METHODS(PURE)
  327. };
  328. #ifndef MAPI_IMAPICLIENTSHUTDOWN_METHODS
  329. // http://blogs.msdn.com/stephen_griffin/archive/2009/03/03/fastest-shutdown-in-the-west.aspx
  330. DECLARE_MAPI_INTERFACE_PTR(IMAPIClientShutdown, LPMAPICLIENTSHUTDOWN);
  331. #define MAPI_IMAPICLIENTSHUTDOWN_METHODS(IPURE) \
  332. MAPIMETHOD(QueryFastShutdown) \
  333. (THIS) IPURE; \
  334. MAPIMETHOD(NotifyProcessShutdown) \
  335. (THIS) IPURE; \
  336. MAPIMETHOD(DoFastShutdown) \
  337. (THIS) IPURE;
  338. DECLARE_MAPI_INTERFACE_(IMAPIClientShutdown, IUnknown)
  339. {
  340. BEGIN_INTERFACE
  341. MAPI_IUNKNOWN_METHODS(PURE)
  342. MAPI_IMAPICLIENTSHUTDOWN_METHODS(PURE)
  343. };
  344. #define _IID_IMAPIClientShutdown_MISSING_IN_HEADER
  345. #endif // MAPI_IMAPICLIENTSHUTDOWN_METHODS
  346. #ifndef MAPI_IMAPIPROVIDERSHUTDOWN_METHODS
  347. /* IMAPIProviderShutdown Interface --------------------------------------- */
  348. DECLARE_MAPI_INTERFACE_PTR(IMAPIProviderShutdown, LPMAPIPROVIDERSHUTDOWN);
  349. #define MAPI_IMAPIPROVIDERSHUTDOWN_METHODS(IPURE) \
  350. MAPIMETHOD(QueryFastShutdown) \
  351. (THIS) IPURE; \
  352. MAPIMETHOD(NotifyProcessShutdown) \
  353. (THIS) IPURE; \
  354. MAPIMETHOD(DoFastShutdown) \
  355. (THIS) IPURE;
  356. DECLARE_MAPI_INTERFACE_(IMAPIProviderShutdown, IUnknown)
  357. {
  358. BEGIN_INTERFACE
  359. MAPI_IUNKNOWN_METHODS(PURE)
  360. MAPI_IMAPIPROVIDERSHUTDOWN_METHODS(PURE)
  361. };
  362. #endif // MAPI_IMAPIPROVIDERSHUTDOWN_METHODS
  363. // for CompareStrings
  364. static DWORD g_lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT);
  365. // In case we are compiling against an older version of headers
  366. #if !defined ACLTABLE_FREEBUSY
  367. #define ACLTABLE_FREEBUSY ((ULONG) 0x00000002)
  368. #endif // ACLTABLE_FREEBUSY
  369. #if !defined frightsFreeBusySimple
  370. #define frightsFreeBusySimple 0x0000800L
  371. #endif // frightsFreeBusySimple
  372. #if !defined frightsFreeBusyDetailed
  373. #define frightsFreeBusyDetailed 0x0001000L
  374. #endif // frightsFreeBusyDetailed
  375. #if !defined fsdrightFreeBusySimple
  376. #define fsdrightFreeBusySimple 0x00000001
  377. #endif // fsdrightFreeBusySimple
  378. #if !defined fsdrightFreeBusyDetailed
  379. #define fsdrightFreeBusyDetailed 0x00000002
  380. #endif // fsdrightFreeBusyDetailed
  381. // http://msdn2.microsoft.com/en-us/library/bb820933.aspx
  382. #define MAPI_IATTACHMENTSECURITY_METHODS(IPURE) \
  383. MAPIMETHOD(IsAttachmentBlocked) \
  384. (LPCWSTR pwszFileName, BOOL *pfBlocked) IPURE;
  385. DECLARE_MAPI_INTERFACE_(IAttachmentSecurity, IUnknown)
  386. {
  387. BEGIN_INTERFACE
  388. MAPI_IUNKNOWN_METHODS(PURE)
  389. MAPI_IATTACHMENTSECURITY_METHODS(PURE)
  390. };
  391. // http://msdn2.microsoft.com/en-us/library/bb820937.aspx
  392. #define STORE_PUSHER_OK ((ULONG) 0x00800000)
  393. #define fnevIndexing ((ULONG) 0x00010000)
  394. /* Indexing notifications (used for FTE related communications) */
  395. /* Shares EXTENDED_NOTIFICATION to pass structures below, */
  396. /* but NOTIFICATION type will be fnevIndexing */
  397. // Stores that are pusher enabled (PR_STORE_SUPPORT_MASK contains STORE_PUSHER_OK)
  398. // are required to send notifications regarding the process that is pushing.
  399. #define INDEXING_SEARCH_OWNER ((ULONG) 0x00000001)
  400. struct INDEX_SEARCH_PUSHER_PROCESS
  401. {
  402. DWORD dwPID; // PID for process pushing
  403. };
  404. // http://blogs.msdn.com/stephen_griffin/archive/2006/05/11/595338.aspx
  405. #define STORE_FULLTEXT_QUERY_OK ((ULONG) 0x02000000)
  406. #define STORE_FILTER_SEARCH_OK ((ULONG) 0x04000000)
  407. // Will match prefix on words instead of the whole prop value
  408. #define FL_PREFIX_ON_ANY_WORD 0x00000010
  409. // Phrase match means the words have to be exactly matched and the
  410. // sequence matters. This is different than FL_FULLSTRING because
  411. // it doesn't require the whole property value to be the same. One
  412. // term exactly matching a term in the property value is enough for
  413. // a match even if there are more terms in the property.
  414. #define FL_PHRASE_MATCH 0x00000020
  415. // http://msdn2.microsoft.com/en-us/library/bb905283.aspx
  416. #define dispidFormStorage 0x850F
  417. #define dispidPageDirStream 0x8513
  418. #define dispidFormPropStream 0x851B
  419. #define dispidPropDefStream 0x8540
  420. #define dispidScriptStream 0x8541
  421. #define dispidCustomFlag 0x8542
  422. #define INSP_ONEOFFFLAGS 0xD000000
  423. #define INSP_PROPDEFINITION 0x2000000
  424. // Sometimes IExchangeManageStore5 is in edkmdb.h, sometimes it isn't
  425. #ifndef EXCHANGE_IEXCHANGEMANAGESTORE5_METHODS
  426. #define USES_IID_IExchangeManageStore5
  427. /*------------------------------------------------------------------------
  428. *
  429. * 'IExchangeManageStore5' Interface Declaration
  430. *
  431. * Used for store management functions.
  432. *
  433. *-----------------------------------------------------------------------*/
  434. #define EXCHANGE_IEXCHANGEMANAGESTORE5_METHODS(IPURE) \
  435. MAPIMETHOD(GetMailboxTableEx) \
  436. (THIS_ LPSTR lpszServerName, \
  437. LPGUID lpguidMdb, \
  438. LPMAPITABLE* lppTable, \
  439. ULONG ulFlags, \
  440. UINT uOffset) IPURE; \
  441. MAPIMETHOD(GetPublicFolderTableEx) \
  442. (THIS_ LPSTR lpszServerName, \
  443. LPGUID lpguidMdb, \
  444. LPMAPITABLE* lppTable, \
  445. ULONG ulFlags, \
  446. UINT uOffset) IPURE; \
  447. #undef INTERFACE
  448. #define INTERFACE IExchangeManageStore5
  449. DECLARE_MAPI_INTERFACE_(IExchangeManageStore5, IUnknown)
  450. {
  451. MAPI_IUNKNOWN_METHODS(PURE)
  452. EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE)
  453. EXCHANGE_IEXCHANGEMANAGESTORE2_METHODS(PURE)
  454. EXCHANGE_IEXCHANGEMANAGESTORE3_METHODS(PURE)
  455. EXCHANGE_IEXCHANGEMANAGESTORE4_METHODS(PURE)
  456. EXCHANGE_IEXCHANGEMANAGESTORE5_METHODS(PURE)
  457. };
  458. #undef IMPL
  459. #define IMPL
  460. DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStore5, LPEXCHANGEMANAGESTORE5);
  461. #endif // #ifndef EXCHANGE_IEXCHANGEMANAGESTORE5_METHODS
  462. #define EXCHANGE_IEXCHANGEMANAGESTOREEX_METHODS(IPURE) \
  463. MAPIMETHOD(CreateStoreEntryID2) \
  464. (THIS_ ULONG cValues, \
  465. LPSPropValue lpPropArray, \
  466. ULONG ulFlags, \
  467. ULONG* lpcbEntryID, \
  468. LPENTRYID * lppEntryID) IPURE;
  469. #undef INTERFACE
  470. #define INTERFACE IExchangeManageStoreEx
  471. DECLARE_MAPI_INTERFACE_(IExchangeManageStoreEx, IUnknown)
  472. {
  473. MAPI_IUNKNOWN_METHODS(PURE)
  474. EXCHANGE_IEXCHANGEMANAGESTORE_METHODS(PURE)
  475. EXCHANGE_IEXCHANGEMANAGESTOREEX_METHODS(PURE)
  476. };
  477. #undef IMPL
  478. #define IMPL
  479. DECLARE_MAPI_INTERFACE_PTR(IExchangeManageStoreEx, LPEXCHANGEMANAGESTOREEX);
  480. #define CbNewROWLIST(_centries) (offsetof(ROWLIST,aEntries) + \
  481. (_centries)*sizeof(ROWENTRY))
  482. #define MAXNewROWLIST (ULONG_MAX-offsetof(ROWLIST,aEntries))/sizeof(ROWENTRY)
  483. #define MAXMessageClassArray (ULONG_MAX - offsetof(SMessageClassArray, aMessageClass))/sizeof(LPCSTR)
  484. #define MAXNewADRLIST (ULONG_MAX - offsetof(ADRLIST, aEntries))/sizeof(ADRENTRY)
  485. const WORD TZRULE_FLAG_RECUR_CURRENT_TZREG = 0x0001; // see dispidApptTZDefRecur
  486. const WORD TZRULE_FLAG_EFFECTIVE_TZREG = 0x0002;
  487. // http://blogs.msdn.com/stephen_griffin/archive/2007/03/19/mapi-and-exchange-2007.aspx
  488. #define CONNECT_IGNORE_NO_PF ((ULONG)0x8000)
  489. #define TABLE_SORT_CATEG_MAX ((ULONG) 0x00000004)
  490. #define TABLE_SORT_CATEG_MIN ((ULONG) 0x00000008)