ReactOS 0.4.15-dev-8127-g6338913
mapiutil.h
Go to the documentation of this file.
1/*
2 * Copyright 2004 Jon Griffiths
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#ifndef MAPIUTIL_H_
20#define MAPIUTIL_H_
21
22#include <mapix.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#define TAD_ALL_ROWS 1 /* Delete all rows */
29
31
32#define SOF_UNIQUEFILENAME 0x80000000U /* Create a unique (temporary) filename */
33
34#if defined (UNICODE) || defined (__WINESRC__)
39#else
44#endif
45#define OPENSTREAMONFILE "OpenStreamOnFile"
46
48
49typedef struct IPropData *LPPROPDATA;
50
51#define IPROP_READONLY 0x00001U
52#define IPROP_READWRITE 0x00002U
53#define IPROP_CLEAN 0x10000U
54#define IPROP_DIRTY 0x20000U
55
56SCODE WINAPI CreateIProp(LPCIID,ALLOCATEBUFFER*,ALLOCATEMORE*,FREEBUFFER*,
64
71
72ULONG WINAPI UlAddRef(void*);
74
83
84#if defined (UNICODE) || defined (__WINESRC__)
93#else
102#endif
103
105void WINAPI DeinitMapiUtil(void);
106
107#define szHrDispatchNotifications "_HrDispatchNotifications@4"
108#define szScCreateConversationIndex "_ScCreateConversationIndex@16"
109
110typedef HRESULT (WINAPI DISPATCHNOTIFICATIONS)(ULONG);
111typedef DISPATCHNOTIFICATIONS *LPDISPATCHNOTIFICATIONS;
112typedef SCODE (WINAPI CREATECONVERSATIONINDEX)(ULONG,LPBYTE,ULONG*,LPBYTE*);
113typedef CREATECONVERSATIONINDEX *LPCREATECONVERSATIONINDEX;
114
115typedef struct ITableData *LPTABLEDATA;
116
117typedef void (WINAPI CALLERRELEASE)(ULONG,LPTABLEDATA,LPMAPITABLE);
118
119/*****************************************************************************
120 * ITableData interface
121 *
122 * The underlying table data structure for IMAPITable.
123 */
124#define INTERFACE ITableData
126{
127 /*** IUnknown methods ***/
131 /*** ITableData methods ***/
132 STDMETHOD(HrGetView)(THIS_ LPSSortOrderSet lpSort, CALLERRELEASE *lpRel,
133 ULONG ulData, LPMAPITABLE *lppTable) PURE;
134 STDMETHOD(HrModifyRow)(THIS_ LPSRow lpRow) PURE;
135 STDMETHOD(HrDeleteRow)(THIS_ LPSPropValue lpKey) PURE;
136 STDMETHOD(HrQueryRow)(THIS_ LPSPropValue lpKey, LPSRow *lppRow, ULONG *lpRowNum) PURE;
137 STDMETHOD(HrEnumRow)(THIS_ ULONG ulRowNum, LPSRow *lppRow) PURE;
138 STDMETHOD(HrNotify)(THIS_ ULONG ulFlags, ULONG cValues, LPSPropValue lpValues) PURE;
139 STDMETHOD(HrInsertRow)(THIS_ ULONG ulRow, LPSRow lpRow) PURE;
140 STDMETHOD(HrModifyRows)(THIS_ ULONG ulFlags, LPSRowSet lpRows) PURE;
141 STDMETHOD(HrDeleteRows)(THIS_ ULONG ulFlags, LPSRowSet lpRows, ULONG *lpCount) PURE;
142};
143#undef INTERFACE
144
145#if !defined(__cplusplus) || defined(CINTERFACE)
146 /*** IUnknown methods ***/
147#define ITableData_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
148#define ITableData_AddRef(p) (p)->lpVtbl->AddRef(p)
149#define ITableData_Release(p) (p)->lpVtbl->Release(p)
150 /*** ITableData methods ***/
151#define ITableData_HrGetView(p,a,b,c,d) (p)->lpVtbl->HrGetView(p,a,b,c,d)
152#define ITableData_HrModifyRow(p,a) (p)->lpVtbl->HrModifyRow(p,a)
153#define ITableData_HrDeleteRow(p,a) (p)->lpVtbl->HrDeleteRow(p,a)
154#define ITableData_HrQueryRow(p,a,b,c) (p)->lpVtbl->HrQueryRow(p,a,b,c)
155#define ITableData_HrEnumRow(p,a,b) (p)->lpVtbl->HrEnumRow(p,a,b)
156#define ITableData_HrNotify(p,a,b,c) (p)->lpVtbl->HrNotify(p,a,b,c)
157#define ITableData_HrInsertRow(p,a,b) (p)->lpVtbl->HrInsertRow(p,a,b)
158#define ITableData_HrModifyRows(p,a,b) (p)->lpVtbl->HrModifyRows(p,a,b)
159#define ITableData_HrDeleteRows(p,a,b,c) (p)->lpVtbl->HrDeleteRows(p,a,b,c)
160#endif
161
162SCODE WINAPI CreateTable(LPCIID,ALLOCATEBUFFER*,ALLOCATEMORE*,FREEBUFFER*,
164
172
174
175static inline FILETIME FtAddFt(FILETIME ftLeft, FILETIME ftRight)
176{
177 LONG64 *pl = (LONG64*)&ftLeft, *pr = (LONG64*)&ftRight;
178 union { FILETIME ft; LONG64 ll; } ftmap;
179 ftmap.ll = *pl + *pr;
180 return ftmap.ft;
181}
182
183static inline FILETIME FtSubFt(FILETIME ftLeft, FILETIME ftRight)
184{
185 LONG64 *pl = (LONG64*)&ftLeft, *pr = (LONG64*)&ftRight;
186 union { FILETIME ft; LONG64 ll; } ftmap;
187 ftmap.ll = *pl - *pr;
188 return ftmap.ft;
189}
190
191static inline FILETIME FtNegFt(FILETIME ftLeft)
192{
193 LONG64 *p = (LONG64*)&ftLeft;
194 union { FILETIME ft; LONG64 ll; } ftmap;
195 ftmap.ll = -*p;
196 return ftmap.ft;
197}
198
199static inline FILETIME FtMulDw(DWORD dwLeft, FILETIME ftRight)
200{
201 LONG64 l = (LONG64)dwLeft, *pr = (LONG64*)&ftRight;
202 union { FILETIME ft; LONG64 ll; } ftmap;
203 ftmap.ll = l * (*pr);
204 return ftmap.ft;
205}
206
207static inline FILETIME FtMulDwDw(DWORD dwLeft, DWORD dwRight)
208{
209 LONG64 l = (LONG64)dwLeft, r = (LONG64)dwRight;
210 union { FILETIME ft; LONG64 ll; } ftmap;
211 ftmap.ll = l * r;
212 return ftmap.ft;
213}
214
215/*****************************************************************************
216 * IPropData interface
217 *
218 */
219#define INTERFACE IPropData
220DECLARE_INTERFACE_(IPropData,IMAPIProp)
221{
222 /*** IUnknown methods ***/
226 /*** IMAPIProp methods ***/
227 STDMETHOD(GetLastError)(THIS_ HRESULT hRes, ULONG ulFlags, LPMAPIERROR *lppErr) PURE;
228 STDMETHOD(SaveChanges)(THIS_ ULONG ulFlags) PURE;
229 STDMETHOD(GetProps)(THIS_ LPSPropTagArray lpPropTags, ULONG ulFlags, ULONG *lpValues, LPSPropValue *lppProps) PURE;
230 STDMETHOD(GetPropList)(THIS_ ULONG ulFlags, LPSPropTagArray *lppPropTagArray) PURE;
231 STDMETHOD(OpenProperty)(THIS_ ULONG ulPropTag, LPCIID lpIid, ULONG ulOpts, ULONG ulFlags, LPUNKNOWN *lppUnk) PURE;
232 STDMETHOD(SetProps)(THIS_ ULONG cValues, LPSPropValue lpProps, LPSPropProblemArray *lppProbs) PURE;
233 STDMETHOD(DeleteProps)(THIS_ LPSPropTagArray lpPropTags, LPSPropProblemArray *lppProbs) PURE;
234 STDMETHOD(CopyTo)(THIS_ ULONG ciidExclude, LPCIID lpIid, LPSPropTagArray lpProps, ULONG ulParam,
235 LPMAPIPROGRESS lpProgress, LPCIID lpIface,LPVOID lpDest, ULONG ulFlags,
236 LPSPropProblemArray *lppProbs) PURE;
237 STDMETHOD(CopyProps)(THIS_ LPSPropTagArray lpIncludeProps, ULONG ulParam, LPMAPIPROGRESS lpProgress,
238 LPCIID lpIid, LPVOID lpDestObj, ULONG ulFlags, LPSPropProblemArray *lppProblems) PURE;
239 STDMETHOD(GetNamesFromIDs)(THIS_ LPSPropTagArray *lppPropTags, LPGUID lpIid, ULONG ulFlags, ULONG *lpCount,
240 LPMAPINAMEID **lpppNames) PURE;
241 STDMETHOD(GetIDsFromNames)(THIS_ ULONG cPropNames, LPMAPINAMEID *lppNames, ULONG ulFlags, LPSPropTagArray *lppPropTags) PURE;
242 /*** IPropData methods ***/
243 STDMETHOD(HrSetObjAccess)(THIS_ ULONG ulAccess) PURE;
244 STDMETHOD(HrSetPropAccess)(THIS_ LPSPropTagArray lpPropTags, ULONG *lpAccess) PURE;
245 STDMETHOD(HrGetPropAccess)(THIS_ LPSPropTagArray *lppPropTags, ULONG **lppAccess) PURE;
246 STDMETHOD(HrAddObjProps)(THIS_ LPSPropTagArray lppPropTags, LPSPropProblemArray *lppProbs) PURE;
247};
248#undef INTERFACE
249
250#if !defined(__cplusplus) || defined(CINTERFACE)
251 /*** IUnknown methods ***/
252#define IPropData_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
253#define IPropData_AddRef(p) (p)->lpVtbl->AddRef(p)
254#define IPropData_Release(p) (p)->lpVtbl->Release(p)
255 /*** IMAPIProp methods ***/
256#define IPropData_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c)
257#define IPropData_SaveChanges(p,a) (p)->lpVtbl->SaveChanges(p,a)
258#define IPropData_GetProps(p,a,b,c,d) (p)->lpVtbl->GetProps(p,a,b,c,d)
259#define IPropData_GetPropList(p,a,b) (p)->lpVtbl->GetPropList(p,a,b)
260#define IPropData_OpenProperty(p,a,b,c,d,e) (p)->lpVtbl->OpenProperty(p,a,b,c,d,e)
261#define IPropData_SetProps(p,a,b,c) (p)->lpVtbl->SetProps(p,a,b,c)
262#define IPropData_DeleteProps(p,a,b) (p)->lpVtbl->DeleteProps(p,a,b)
263#define IPropData_CopyTo(p,a,b,c,d,e,f,g,h,i) (p)->lpVtbl->CopyTo(p,a,b,c,d,e,f,g,h,i)
264#define IPropData_CopyProps(p,a,b,c,d,e,f,g) (p)->lpVtbl->CopyProps(p,a,b,c,d,e,f,g)
265#define IPropData_GetNamesFromIDs(p,a,b,c,d,e) (p)->lpVtbl->GetNamesFromIDs(p,a,b,c,d,e)
266#define IPropData_GetIDsFromNames(p,a,b,c,d) (p)->lpVtbl->GetIDsFromNames(p,a,b,c,d)
267#define IPropData_HrSetObjAccess(p,a) (p)->lpVtbl->HrSetObjAccess(p,a)
268#define IPropData_HrSetPropAccess(p,a,b) (p)->lpVtbl->HrSetPropAccess(p,a,b)
269#define IPropData_HrGetPropAccess(p,a,b) (p)->lpVtbl->HrGetPropAccess(p,a,b)
270#define IPropData_HrAddObjProps(p,a,b) (p)->lpVtbl->HrAddObjProps(p,a,b)
271#endif
272
273#ifdef __cplusplus
274}
275#endif
276
277#endif /* MAPIUTIL_H_ */
#define DECLARE_INTERFACE_(i, b)
Definition: basetyps.h:78
#define PURE
Definition: basetyps.h:64
#define THIS_
Definition: basetyps.h:65
#define THIS
Definition: basetyps.h:66
#define STDMETHOD_(t, m)
Definition: basetyps.h:63
#define STDMETHOD(m)
Definition: basetyps.h:62
w ll
Definition: byte_order.h:167
r l[0]
Definition: byte_order.h:168
_In_ BOOLEAN Release
Definition: cdrom.h:920
static LPCTSTR lpKey
Definition: virtmem.c:102
LONG SCODE
Definition: compat.h:2252
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLfloat GLfloat p
Definition: glext.h:8902
REFIID riid
Definition: atlbase.h:39
struct IMAPIAdviseSink * LPMAPIADVISESINK
Definition: mapidefs.h:92
IMAPIProgress * LPMAPIPROGRESS
Definition: mapidefs.h:96
IMAPIProp * LPMAPIPROP
Definition: mapidefs.h:914
FREEBUFFER * LPFREEBUFFER
Definition: mapidefs.h:78
IMAPITable * LPMAPITABLE
Definition: mapidefs.h:840
NOTIFCALLBACK * LPNOTIFCALLBACK
Definition: mapidefs.h:762
ALLOCATEBUFFER * LPALLOCATEBUFFER
Definition: mapidefs.h:76
LPSPropValue WINAPI PpropFindProp(LPSPropValue, ULONG, ULONG)
Definition: prop.c:639
SCODE WINAPI PropCopyMore(LPSPropValue, LPSPropValue, ALLOCATEMORE *, LPVOID)
Definition: prop.c:64
HRESULT WINAPI HrSetOneProp(LPMAPIPROP, LPSPropValue)
Definition: prop.c:568
SCODE WINAPI ScInitMapiUtil(ULONG)
Definition: util.c:67
LPMALLOC WINAPI MAPIGetDefaultMalloc(void)
Definition: imalloc.c:62
SCODE WINAPI ScDupPropset(int, LPSPropValue, LPALLOCATEBUFFER, LPSPropValue *)
Definition: prop.c:1108
BOOL WINAPI FPropExists(LPMAPIPROP, ULONG)
Definition: prop.c:592
ULONG LPBYTE *typedef CREATECONVERSATIONINDEX * LPCREATECONVERSATIONINDEX
Definition: mapiutil.h:113
VOID WINAPI GetInstance(LPSPropValue, LPSPropValue, ULONG)
HRESULT WINAPI HrAddColumns(LPMAPITABLE, LPSPropTagArray, LPALLOCATEBUFFER, LPFREEBUFFER)
void WINAPI DeinitMapiUtil(void)
Definition: util.c:93
static FILETIME FtNegFt(FILETIME ftLeft)
Definition: mapiutil.h:191
LPSTR WINAPI SzFindLastCh(LPCSTR, USHORT)
BOOL WINAPI FPropContainsProp(LPSPropValue, LPSPropValue, ULONG)
Definition: prop.c:300
static FILETIME FtSubFt(FILETIME ftLeft, FILETIME ftRight)
Definition: mapiutil.h:183
HRESULT WINAPI HrGetOneProp(LPMAPIPROP, ULONG, LPSPropValue *)
Definition: prop.c:535
BOOL WINAPI FBinFromHex(LPSTR, LPBYTE)
static FILETIME FtAddFt(FILETIME ftLeft, FILETIME ftRight)
Definition: mapiutil.h:175
SCODE WINAPI ScCountProps(int, LPSPropValue, ULONG *)
HRESULT WINAPI HrAddColumnsEx(LPMAPITABLE, LPSPropTagArray, LPALLOCATEBUFFER, LPFREEBUFFER, void(*)(LPSPropTagArray))
SCODE WINAPI ScRelocNotifications(int, LPNOTIFICATION, LPVOID, LPVOID, ULONG *)
ULONG WINAPI UlPropSize(LPSPropValue)
Definition: prop.c:213
HRESULT WINAPI OpenStreamOnFile(LPALLOCATEBUFFER, LPFREEBUFFER, ULONG, LPSTR, LPSTR, LPSTREAM *)
ULONG WINAPI UlAddRef(void *)
Definition: util.c:627
struct ITableData * LPTABLEDATA
Definition: mapiutil.h:115
ULONG WINAPI UlRelease(void *)
Definition: util.c:652
SCODE WINAPI ScBinFromHexBounded(LPSTR, LPBYTE, ULONG)
LPSPropValue WINAPI LpValFindProp(ULONG, ULONG, LPSPropValue)
Definition: prop.c:1076
LPSTR WINAPI SzFindCh(LPCSTR, USHORT)
HRESULT WINAPI HrQueryAllRows(LPMAPITABLE, LPSPropTagArray, LPSRestriction, LPSSortOrderSet, LONG, LPSRowSet *)
Definition: util.c:933
void WINAPI HexFromBin(LPBYTE, int, LPSTR)
static FILETIME FtMulDwDw(DWORD dwLeft, DWORD dwRight)
Definition: mapiutil.h:207
ULONG WINAPI UlFromSzHex(LPCSTR)
SCODE WINAPI ScCopyNotifications(int, LPNOTIFICATION, LPVOID, ULONG *)
void WINAPI FreePadrlist(LPADRLIST)
Definition: prop.c:669
void WINAPI FreeProws(LPSRowSet)
Definition: prop.c:688
BOOL WINAPI FEqualNames(LPMAPINAMEID, LPMAPINAMEID)
Definition: util.c:486
struct IPropData * LPPROPDATA
Definition: mapiutil.h:49
DISPATCHNOTIFICATIONS * LPDISPATCHNOTIFICATIONS
Definition: mapiutil.h:111
LPSTR WINAPI SzFindSz(LPCSTR, LPCSTR)
SCODE WINAPI CreateTable(LPCIID, ALLOCATEBUFFER *, ALLOCATEMORE *, FREEBUFFER *, LPVOID, ULONG, ULONG, LPSPropTagArray, LPTABLEDATA *)
SCODE WINAPI CreateIProp(LPCIID, ALLOCATEBUFFER *, ALLOCATEMORE *, FREEBUFFER *, LPVOID, LPPROPDATA *)
Definition: prop.c:2307
typedef LPMAPITABLE
Definition: mapiutil.h:117
UINT WINAPI UFromSz(LPCSTR)
Definition: util.c:677
typedef LPBYTE
Definition: mapiutil.h:112
HRESULT WINAPI HrAllocAdviseSink(LPNOTIFCALLBACK, LPVOID, LPMAPIADVISESINK *)
SCODE WINAPI ScCopyProps(int, LPSPropValue, LPVOID, ULONG *)
Definition: prop.c:800
static FILETIME FtMulDw(DWORD dwLeft, FILETIME ftRight)
Definition: mapiutil.h:199
LONG WINAPI LPropCompareProp(LPSPropValue, LPSPropValue)
Definition: prop.c:441
HRESULT WINAPI HrDispatchNotifications(ULONG)
Definition: util.c:243
SCODE WINAPI ScRelocProps(int, LPSPropValue, LPVOID, LPVOID, ULONG *)
Definition: prop.c:934
SCODE WINAPI ScCountNotifications(int, LPNOTIFICATION, ULONG *)
HRESULT(WINAPI * LPOPENSTREAMONFILE)(LPALLOCATEBUFFER, LPFREEBUFFER, ULONG, LPSTR, LPSTR, LPSTREAM *)
Definition: mapiutil.h:40
HRESULT WINAPI HrThisThreadAdviseSink(LPMAPIADVISESINK, LPMAPIADVISESINK *)
Definition: util.c:262
BOOL WINAPI FPropCompareProp(LPSPropValue, ULONG, LPSPropValue)
Definition: prop.c:399
static HRESULT QueryInterface(REFIID, void **)
Definition: events.c:2587
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
unsigned int UINT
Definition: ndis.h:50
static LPUNKNOWN
Definition: ndr_ole.c:49
interface IMalloc * LPMALLOC
Definition: objfwd.h:12
interface IStream * LPSTREAM
Definition: objfwd.h:10
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
#define REFIID
Definition: guiddef.h:118
int64_t LONG64
Definition: typedefs.h:68
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185