-
Notifications
You must be signed in to change notification settings - Fork 3
/
AcctMgmt.h
286 lines (217 loc) · 10.5 KB
/
AcctMgmt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
#pragma once
#define ACCT_INIT_NOSYNCH_MAPI_ACCTS 0x00000001
#define E_ACCT_NOT_FOUND 0x800C8101
#define E_ACCT_WRONG_SORT_ORDER 0x800C8105
#define E_OLK_ALREADY_INITIALIZED 0x800C8002
#define E_OLK_NOT_INITIALIZED 0x800C8005
#define E_OLK_PARAM_NOT_SUPPORTED 0x800C8003
#define E_OLK_PROP_READ_ONLY 0x800C800D
#define E_OLK_REGISTRY 0x800C8002
#define NOTIFY_ACCT_CHANGED 1
#define NOTIFY_ACCT_CREATED 2
#define NOTIFY_ACCT_DELETED 3
#define NOTIFY_ACCT_ORDER_CHANGED 4
#define NOTIFY_ACCT_PREDELETED 5
#define OLK_ACCOUNT_NO_FLAGS 0
//Class Identifiers
//Use the DEFINE_GUID macro defined in the Platform SDK header file guiddef.h to associate the GUID symbolic name with its value.
//{ed475410-b0d6-11d2-8c3b-00104b2a6676}
DEFINE_GUID(CLSID_OlkAccountManager, 0xed475410, 0xb0d6, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
//{ed475411-b0d6-11d2-8c3b-00104b2a6676}
DEFINE_GUID(CLSID_OlkPOP3Account, 0xed475411, 0xb0d6, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
//{ed475412-b0d6-11d2-8c3b-00104b2a6676}
DEFINE_GUID(CLSID_OlkIMAP4Account, 0xed475412, 0xb0d6, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
//{ed475414-b0d6-11d2-8c3b-00104b2a6676}
DEFINE_GUID(CLSID_OlkMAPIAccount, 0xed475414, 0xb0d6, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
//{ed475418-b0d6-11d2-8c3b-00104b2a6676}
DEFINE_GUID(CLSID_OlkMail, 0xed475418, 0xb0d6, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
//{ed475419-b0d6-11d2-8c3b-00104b2a6676}
DEFINE_GUID(CLSID_OlkAddressBook, 0xed475419, 0xb0d6, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
//{ed475420-b0d6-11d2-8c3b-00104b2a6676}
DEFINE_GUID(CLSID_OlkStore, 0xed475420, 0xb0d6, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
//{4db5cbf0-3b77-4852-bc8e-bb81908861f3}
DEFINE_GUID(CLSID_OlkHotmailAccount, 0x4db5cbf0, 0x3b77, 0x4852, 0xbc, 0x8e, 0xbb, 0x81, 0x90, 0x88, 0x61, 0xf3);
//{4db5cbf2-3b77-4852-bc8e-bb81908861f3}
DEFINE_GUID(CLSID_OlkLDAPAccount, 0x4db5cbf2, 0x3b77, 0x4852, 0xbc, 0x8e, 0xbb, 0x81, 0x90, 0x88, 0x61, 0xf3);
//Interface Identifiers
//Use the DEFINE_GUID macro defined in the Platform SDK header file guiddef.h to associate the GUID symbolic name with its value.
//{9240A6C0-AF41-11d2-8C3B-00104B2A6676}
DEFINE_GUID(IID_IOlkErrorUnknown, 0x9240a6c0, 0xaf41, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
//{9240A6C1-AF41-11d2-8C3B-00104B2A6676 }
DEFINE_GUID(IID_IOlkEnum, 0x9240a6c0, 0xaf41, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
//{9240a6c3-af41-11d2-8c3b-00104b2a6676}
DEFINE_GUID(IID_IOlkAccountNotify, 0x9240a6c3, 0xaf41, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
//{9240a6cb-af41-11d2-8c3b-00104b2a6676}
DEFINE_GUID(IID_IOlkAccountHelper, 0x9240a6cb, 0xaf41, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
//{9240a6cd-af41-11d2-8c3b-00104b2a6676}
DEFINE_GUID(IID_IOlkAccountManager, 0x9240a6cd, 0xaf41, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
//{9240a6d2-af41-11d2-8c3b-00104b2a6676}
DEFINE_GUID(IID_IOlkAccount, 0x9240a6d2, 0xaf41, 0x11d2, 0x8c, 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
typedef struct {
DWORD cb;
BYTE * pb;
} ACCT_BIN;
typedef struct
{
DWORD dwType;
union
{
DWORD dw;
WCHAR *pwsz;
ACCT_BIN bin;
} Val;
} ACCT_VARIANT;
#define PR_PRIMARY_SEND_ACCT PROP_TAG(PT_UNICODE, 0x0e28)
#define PR_NEXT_SEND_ACCT PROP_TAG(PT_UNICODE, 0x0e29)
#define PROP_ACCT_ID PROP_TAG(PT_LONG, 0x0001)
#define PROP_ACCT_NAME PROP_TAG(PT_UNICODE, 0x0002)
#define PROP_ACCT_USER_DISPLAY_NAME PROP_TAG(PT_UNICODE, 0x000B)
#define PROP_ACCT_USER_EMAIL_ADDR PROP_TAG(PT_UNICODE, 0x000C)
#define PROP_ACCT_STAMP PROP_TAG(PT_UNICODE, 0x000D)
#define PROP_ACCT_SEND_STAMP PROP_TAG(PT_UNICODE, 0x000E)
#define PROP_ACCT_IS_EXCH PROP_TAG(PT_LONG, 0x0014)
#define PROP_ACCT_DELIVERY_STORE PROP_TAG(PT_BINARY, 0x0018)
#define PROP_ACCT_DELIVERY_FOLDER PROP_TAG(PT_BINARY, 0x0019)
#define PROP_ACCT_SENTITEMS_EID PROP_TAG(PT_BINARY, 0x0020)
#define PROP_ACCT_PREFERENCES_UID PROP_TAG(PT_BINARY, 0x0022)
#define PROP_MAPI_IDENTITY_ENTRYID PROP_TAG(PT_BINARY, 0x2002)
#define PROP_MAPI_TRANSPORT_FLAGS PROP_TAG(PT_BINARY, 0x2010)
#define ACCTUI_NO_WARNING 0x0100
#define ACCTUI_SHOW_DATA_TAB 0x0200
#define ACCTUI_SHOW_ACCTWIZARD 0x0400
interface IOlkErrorUnknown : IUnknown
{
//GetLastError Gets a message string for the specified error.
virtual STDMETHODIMP GetLastError(HRESULT hr, LPWSTR* ppwszError);
};
typedef IOlkErrorUnknown FAR * LPOLKERRORUNKNOWN;
interface IOlkAccount : IOlkErrorUnknown
{
public:
//Placeholder member Not supported or documented.
virtual STDMETHODIMP PlaceHolder1();
//Placeholder member Not supported or documented.
virtual STDMETHODIMP PlaceHolder2();
//Placeholder member Not supported or documented.
virtual STDMETHODIMP PlaceHolder3();
//Placeholder member Not supported or documented.
virtual STDMETHODIMP PlaceHolder4();
//Placeholder member Not supported or documented.
virtual STDMETHODIMP PlaceHolder5();
//Placeholder member Not supported or documented.
virtual STDMETHODIMP PlaceHolder6();
//GetAccountInfo Gets the type and categories of the specified account.
virtual STDMETHODIMP GetAccountInfo(CLSID* pclsidType, DWORD* pcCategories, CLSID** prgclsidCategory);
//GetProp Gets the value of the specified account property. See the Properties table below.
virtual STDMETHODIMP GetProp(DWORD dwProp, ACCT_VARIANT* pVar);
//SetProp Sets the value of the specified account property. See the Properties table below.
virtual STDMETHODIMP SetProp(DWORD dwProp, ACCT_VARIANT* pVar);
//Placeholder member Not supported or documented.
virtual STDMETHODIMP PlaceHolder7();
//Placeholder member Not supported or documented.
virtual STDMETHODIMP PlaceHolder8();
//Placeholder member Not supported or documented.
virtual STDMETHODIMP PlaceHolder9();
//FreeMemory Frees memory allocated by the IOlkAccount interface.
virtual STDMETHODIMP FreeMemory(BYTE* pv);
//Placeholder member Not supported or documented.
virtual STDMETHODIMP PlaceHolder10();
//SaveChanges Saves changes to the specified account.
virtual STDMETHODIMP SaveChanges(DWORD dwFlags);
};
typedef IOlkAccount FAR * LPOLKACCOUNT;
interface IOlkAccountHelper : IUnknown
{
public:
//Placeholder1 This member is a placeholder and is not supported.
virtual STDMETHODIMP PlaceHolder1(LPVOID) = 0;
//GetIdentity Gets the profile name of an account.
virtual STDMETHODIMP GetIdentity(LPWSTR pwszIdentity, DWORD * pcch) = 0;
//GetMapiSession Gets the current MAPI session.
virtual STDMETHODIMP GetMapiSession(LPUNKNOWN * ppmsess) = 0;
//HandsOffSession Releases the current MAPI session that has been created by
//IOlkAccountHelper::GetMapiSession.
virtual STDMETHODIMP HandsOffSession() = 0;
};
typedef IOlkAccountHelper FAR * LPOLKACCOUNTHELPER;
interface IOlkAccountNotify : IOlkErrorUnknown
{
public:
//Notify Notifies the client of changes to the specified account.
STDMETHODIMP Notify(DWORD dwNotify, DWORD dwAcctID, DWORD dwFlags);
};
typedef IOlkAccountNotify FAR * LPOLKACCOUNTNOTIFY;
interface IOlkEnum : IUnknown
{
public:
//GetCount Gets the number of accounts in the enumerator.
virtual STDMETHODIMP GetCount(DWORD *pulCount);
//Reset Resets the enumerator to the beginning.
virtual STDMETHODIMP Reset();
//GetNext Gets the next account in the enumerator.
virtual STDMETHODIMP GetNext(LPUNKNOWN* ppunk);
//Skip Skips a specified number of accounts in the enumerator.
virtual STDMETHODIMP Skip(DWORD cSkip);
};
typedef IOlkEnum FAR * LPOLKENUM;
interface IOlkAccountManager : IOlkErrorUnknown
{
public:
//Init Initializes the account manager for use.
virtual STDMETHODIMP Init(IOlkAccountHelper* pAcctHelper, DWORD dwFlags);
//DisplayAccountList Displays the account list wizard
virtual STDMETHODIMP DisplayAccountList(
HWND hwnd,
DWORD dwFlags,
LPCWSTR wszTitle, // Not used
DWORD cCategories, // Not used
const CLSID * rgclsidCategories, // Not used
const CLSID * pclsidType); // Not used
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder1();
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder2();
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder3();
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder4();
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder5();
//FindAccount Finds an account by property value.
virtual STDMETHODIMP FindAccount(DWORD dwProp, ACCT_VARIANT* pVar, IOlkAccount** ppAccount);
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder6();
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder7();
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder8();
//DeleteAccount Deletes the specified account.
virtual STDMETHODIMP DeleteAccount(DWORD dwAcctID);
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder9();
//SaveChanges Saves changes to the specified account.
virtual STDMETHODIMP SaveChanges(DWORD dwAcctID, DWORD dwFlags);
//GetOrder Gets the ordering of the specified category of accounts.
virtual STDMETHODIMP GetOrder(const CLSID* pclsidCategory, DWORD* pcAccts, DWORD* prgAccts[]);
//SetOrder Modifies the ordering of the specified category of accounts.
virtual STDMETHODIMP SetOrder(const CLSID* pclsidCategory, DWORD* pcAccts, DWORD* prgAccts[]);
//EnumerateAccounts Gets an enumerator for the accounts of the specific category and type.
virtual STDMETHODIMP EnumerateAccounts(const CLSID* pclsidCategory, const CLSID* pclsidType, DWORD dwFlags, IOlkEnum** ppEnum);
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder10();
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder11();
//FreeMemory Frees memory allocated by the IOlkAccountManager interface.
virtual STDMETHODIMP FreeMemory(BYTE* pv);
//Advise Registers an account for notifications sent by the account manager.
virtual STDMETHODIMP Advise(IOlkAccountNotify* pNotify, DWORD* pdwCookie);
//Unadvise Unregisters an account for notifications sent by the account manager.
virtual STDMETHODIMP Unadvise(DWORD* pdwCookie);
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder12();
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder13();
//Placeholder member Not supported or documented
virtual STDMETHODIMP PlaceHolder14();
};
typedef IOlkAccountManager FAR * LPOLKACCOUNTMANAGER;