1 /*
2  *	M A P I A U X . H
3  *
4  *  Messaging Applications Programming Interface.
5  *
6  *  Copyright (c) 2010 Microsoft Corporation. All Rights Reserved.
7  *
8  *  Purpose:
9  *
10  *    This file defines additional interfaces, structures, and constants
11  *    used by the Messaging Applications Programming Interface
12  */
13 
14 
15 #ifndef MAPIAUXGUID_H
16 #ifdef  INITGUID
17 #include <mapiguid.h>
18 #define MAPIAUXGUID_H
19 #endif /* INITGUID */
20 
21 #if !defined(INITGUID) || defined(USES_IID_IMsgServiceAdmin2)
22 DEFINE_OLEGUID(IID_IMsgServiceAdmin2,0x00020387, 0, 0);
23 #endif
24 
25 #if !defined(INITGUID) || defined(USES_IID_IMessageRaw)
26 DEFINE_OLEGUID(IID_IMessageRaw,		0x0002038A, 0, 0);
27 #endif
28 
29 #endif /* MAPIAUXGUID_H */
30 
31 
32 
33 #ifndef MAPIAUX_H
34 #define MAPIAUX_H
35 
36 /* Include common MAPI header files if they haven't been already. */
37 
38 #ifndef MAPIDEFS_H
39 #include <mapidefs.h>
40 #endif
41 
42 
43 #ifdef	__cplusplus
44 extern "C" {
45 #endif
46 
47 #ifndef BEGIN_INTERFACE
48 #define BEGIN_INTERFACE
49 #endif
50 
51 /* Forward interface declarations */
52 
53 DECLARE_MAPI_INTERFACE_PTR(IMsgServiceAdmin2,	LPSERVICEADMIN2);
54 
55 // Property tags
56 
57 #define PR_ATTACH_CONTENT_ID						PROP_TAG( PT_TSTRING,	0x3712)
58 #define PR_ATTACH_CONTENT_ID_W						PROP_TAG( PT_UNICODE,	0x3712)
59 #define PR_ATTACH_CONTENT_ID_A						PROP_TAG( PT_STRING8,	0x3712)
60 
61 // Additional display attributes, to supplement PR_DISPLAY_TYPE.
62 #define PR_DISPLAY_TYPE_EX							PROP_TAG( PT_LONG,		0x3905)
63 
64 #define PR_MSG_EDITOR_FORMAT						PROP_TAG( PT_LONG,		0x5909 )
65 
66 #define PR_ROH_FLAGS								PROP_TAG( PT_LONG,		0x6623)
67 
68 #define PR_ROH_PROXY_AUTH_SCHEME					PROP_TAG( PT_LONG,		0x6627)
69 
70 
71 // Constants
72 
73 /* MAPILogonEx() flags.       */
74 #define MAPI_BG_SESSION			0x00200000	/* Used for async profile access	*/
75 
76 /* Flags for MAPIINIT_0 structure ulFlags value passed to MAPIInitialize()  */
77 #define MAPI_NO_COINIT			0x00000008
78 
79 /* SaveChanges flags */
80 #define SPAMFILTER_ONSAVE		((ULONG) 0x00000080)
81 #define ITEMPROC_FORCE			((ULONG) 0x00000800)
82 #define NON_EMS_XP_SAVE			((ULONG) 0x00001000)
83 
84 /* Flags for OpenMessageStore() */
85 #define MDB_ONLINE				((ULONG) 0x00000100)
86 
87 
88 /* IMsgStore Interface ----------------------------------------------------- */
89 /*  PR_STORE_SUPPORT_MASK bits */
90 #define STORE_UNICODE_OK		((ULONG) 0x00040000)
91 #define STORE_ITEMPROC			((ULONG) 0x00200000)
92 
93 /* Miscellaneous flags */
94 #define MAPI_NO_CACHE			((ULONG) 0x00000200)
95 #define MAPI_CACHE_ONLY			((ULONG) 0x00004000)
96 
97 
98 /* Values for PR_AGING_GRANULARITY (Determines aging is measured by months, weeks, or days) */
99 #define AG_MONTHS					0
100 #define AG_WEEKS					1
101 #define AG_DAYS						2
102 #define NUM_AG_TYPES				3
103 
104 
105 // PR_DISPLAY_TYPE_EX has the following format
106 //
107 // 33222222222211111111110000000000
108 // 10987654321098765432109876543210
109 //
110 // FAxxxxxxxxxxxxxxRRRRRRRRLLLLLLLL
111 //
112 // F = 1 if remote is valid, 0 if it is not
113 // A = 1 if the user is ACL-able, 0 if the user is not
114 // x - unused at this time, do not interpret as this may be used in the future
115 // R = display type from
116 
117 #define DTE_FLAG_REMOTE_VALID						0x80000000
118 #define DTE_FLAG_ACL_CAPABLE						0x40000000
119 #define DTE_MASK_REMOTE								0x0000ff00
120 #define DTE_MASK_LOCAL								0x000000ff
121 
122 #define DTE_IS_REMOTE_VALID(v)						(!!((v) & DTE_FLAG_REMOTE_VALID))
123 #define DTE_IS_ACL_CAPABLE(v)						(!!((v) & DTE_FLAG_ACL_CAPABLE))
124 #define DTE_REMOTE(v)								(((v) & DTE_MASK_REMOTE) >> 8)
125 #define DTE_LOCAL(v)								((v) & DTE_MASK_LOCAL)
126 
127 #define DT_ROOM				((ULONG) 0x00000007)
128 #define DT_EQUIPMENT		((ULONG) 0x00000008)
129 #define DT_SEC_DISTLIST	((ULONG) 0x00000009)
130 
131 // Sender's editor format (PR_MSG_EDITOR_FORMAT)
132 #define EDITOR_FORMAT_DONTKNOW			((ULONG)0)
133 #define EDITOR_FORMAT_PLAINTEXT 		((ULONG)1)
134 #define EDITOR_FORMAT_HTML				((ULONG)2)
135 #define EDITOR_FORMAT_RTF				((ULONG)3)
136 
137 
138 // Flags used in PR_ROH_FLAGS - http://support.microsoft.com/kb/898835
139 // Connect to my Exchange mailbox using HTTP
140 #define ROHFLAGS_USE_ROH                0x1
141 // Connect using SSL only
142 #define ROHFLAGS_SSL_ONLY               0x2
143 // Mutually authenticate the session when connecting with SSL
144 #define ROHFLAGS_MUTUAL_AUTH            0x4
145 // On fast networks, connect using HTTP first, then connect using TCP/IP
146 #define ROHFLAGS_HTTP_FIRST_ON_FAST     0x8
147 // On slow networks, connect using HTTP first, then connect using TCP/IP
148 #define ROHFLAGS_HTTP_FIRST_ON_SLOW     0x20
149 
150 // Flags used in PR_ROH_PROXY_AUTH_SCHEME
151 // Basic Authentication
152 #define ROHAUTH_BASIC                   0x1
153 // NTLM Authentication
154 #define ROHAUTH_NTLM                    0x2
155 
156 
157 // Interface declarations
158 
159 #define MAPI_IMSGSERVICEADMIN_METHODS(IPURE)							\
160 	MAPIMETHOD(GetLastError)											\
161 		(THIS_	HRESULT						hResult,					\
162 				ULONG						ulFlags,					\
163 				LPMAPIERROR FAR *			lppMAPIError) IPURE;		\
164 	MAPIMETHOD(GetMsgServiceTable)										\
165 		(THIS_	ULONG						ulFlags,					\
166 				LPMAPITABLE FAR *			lppTable) IPURE;			\
167 	MAPIMETHOD(CreateMsgService)										\
168 		(THIS_	LPTSTR						lpszService,				\
169 				LPTSTR						lpszDisplayName,			\
170 				ULONG_PTR					ulUIParam,					\
171 				ULONG						ulFlags) IPURE;				\
172 	MAPIMETHOD(DeleteMsgService)										\
173 		(THIS_	LPMAPIUID					lpUID) IPURE;				\
174 	MAPIMETHOD(CopyMsgService)											\
175 		(THIS_	LPMAPIUID					lpUID,						\
176 				LPTSTR						lpszDisplayName,			\
177 				LPCIID						lpInterfaceToCopy,			\
178 				LPCIID						lpInterfaceDst,				\
179 				LPVOID						lpObjectDst,				\
180 				ULONG_PTR					ulUIParam,					\
181 				ULONG						ulFlags) IPURE;				\
182 	MAPIMETHOD(RenameMsgService)										\
183 		(THIS_	LPMAPIUID					lpUID,						\
184 				ULONG						ulFlags,					\
185 				LPTSTR						lpszDisplayName) IPURE;		\
186 	MAPIMETHOD(ConfigureMsgService)										\
187 		(THIS_	LPMAPIUID					lpUID,						\
188 				ULONG_PTR					ulUIParam,					\
189 				ULONG						ulFlags,					\
190 				ULONG						cValues,					\
191 				LPSPropValue				lpProps) IPURE;				\
192 	MAPIMETHOD(OpenProfileSection)										\
193 		(THIS_	LPMAPIUID					lpUID,						\
194 				LPCIID						lpInterface,				\
195 				ULONG						ulFlags,					\
196 				LPPROFSECT FAR *			lppProfSect) IPURE;			\
197 	MAPIMETHOD(MsgServiceTransportOrder)								\
198 		(THIS_	ULONG						cUID,						\
199 				LPMAPIUID					lpUIDList,					\
200 				ULONG						ulFlags) IPURE;				\
201 	MAPIMETHOD(AdminProviders)											\
202 		(THIS_	LPMAPIUID					lpUID,						\
203 				ULONG						ulFlags,					\
204 				LPPROVIDERADMIN FAR *		lppProviderAdmin) IPURE;	\
205 	MAPIMETHOD(SetPrimaryIdentity)										\
206 		(THIS_	LPMAPIUID					lpUID,						\
207 				ULONG						ulFlags) IPURE;				\
208 	MAPIMETHOD(GetProviderTable)										\
209 		(THIS_	ULONG						ulFlags,					\
210 				LPMAPITABLE FAR *			lppTable) IPURE;			\
211 
212 #define MAPI_IMSGSERVICEADMIN_METHODS2(IPURE)							\
213 	MAPIMETHOD(CreateMsgServiceEx)										\
214 		(THIS_	LPTSTR						lpszService,				\
215 				LPTSTR						lpszDisplayName,			\
216 				ULONG_PTR					ulUIParam,					\
217 				ULONG						ulFlags,					\
218 				LPMAPIUID					lpuidService) IPURE;		\
219 
220 #undef 		 INTERFACE
221 #define 	 INTERFACE	IMsgServiceAdmin2
DECLARE_MAPI_INTERFACE_(IMsgServiceAdmin2,IUnknown)222 DECLARE_MAPI_INTERFACE_(IMsgServiceAdmin2, IUnknown)
223 {
224 	BEGIN_INTERFACE
225 		MAPI_IUNKNOWN_METHODS(PURE)
226 		MAPI_IMSGSERVICEADMIN_METHODS(PURE)
227 		MAPI_IMSGSERVICEADMIN_METHODS2(PURE)
228 };
229 
230 
231 #ifdef	__cplusplus
232 }		/*	extern "C" */
233 #endif
234 
235 #endif /* MAPIAUX_H */
236