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