af062818b47340eef15700d2f0211576ba3506eevboxsync/*
af062818b47340eef15700d2f0211576ba3506eevboxsync * Copyright 2004 Jon Griffiths
af062818b47340eef15700d2f0211576ba3506eevboxsync *
af062818b47340eef15700d2f0211576ba3506eevboxsync * This library is free software; you can redistribute it and/or
af062818b47340eef15700d2f0211576ba3506eevboxsync * modify it under the terms of the GNU Lesser General Public
af062818b47340eef15700d2f0211576ba3506eevboxsync * License as published by the Free Software Foundation; either
af062818b47340eef15700d2f0211576ba3506eevboxsync * version 2.1 of the License, or (at your option) any later version.
af062818b47340eef15700d2f0211576ba3506eevboxsync *
af062818b47340eef15700d2f0211576ba3506eevboxsync * This library is distributed in the hope that it will be useful,
af062818b47340eef15700d2f0211576ba3506eevboxsync * but WITHOUT ANY WARRANTY; without even the implied warranty of
af062818b47340eef15700d2f0211576ba3506eevboxsync * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
af062818b47340eef15700d2f0211576ba3506eevboxsync * Lesser General Public License for more details.
af062818b47340eef15700d2f0211576ba3506eevboxsync *
af062818b47340eef15700d2f0211576ba3506eevboxsync * You should have received a copy of the GNU Lesser General Public
af062818b47340eef15700d2f0211576ba3506eevboxsync * License along with this library; if not, write to the Free Software
af062818b47340eef15700d2f0211576ba3506eevboxsync * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
af062818b47340eef15700d2f0211576ba3506eevboxsync */
af062818b47340eef15700d2f0211576ba3506eevboxsync
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync/*
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * a choice of LGPL license versions is made available with the language indicating
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * that LGPLv2 or any later version may be used, or where a choice of which version
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * of the LGPL is applied is otherwise unspecified.
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync */
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#ifndef MAPIUTIL_H_
af062818b47340eef15700d2f0211576ba3506eevboxsync#define MAPIUTIL_H_
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#include <mapix.h>
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#ifdef __cplusplus
af062818b47340eef15700d2f0211576ba3506eevboxsyncextern "C" {
af062818b47340eef15700d2f0211576ba3506eevboxsync#endif
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#define TAD_ALL_ROWS 1 /* Delete all rows */
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncLPMALLOC WINAPI MAPIGetDefaultMalloc(void);
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#define SOF_UNIQUEFILENAME 0x80000000U /* Create a unique (temporary) filename */
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#if defined (UNICODE) || defined (__WINESRC__)
af062818b47340eef15700d2f0211576ba3506eevboxsynctypedef HRESULT (WINAPI * LPOPENSTREAMONFILE)(LPALLOCATEBUFFER,LPFREEBUFFER,
af062818b47340eef15700d2f0211576ba3506eevboxsync ULONG,LPWSTR,LPWSTR,LPSTREAM*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncHRESULT WINAPI OpenStreamOnFile(LPALLOCATEBUFFER,LPFREEBUFFER,
af062818b47340eef15700d2f0211576ba3506eevboxsync ULONG,LPWSTR,LPWSTR,LPSTREAM*);
af062818b47340eef15700d2f0211576ba3506eevboxsync#else
af062818b47340eef15700d2f0211576ba3506eevboxsynctypedef HRESULT (WINAPI * LPOPENSTREAMONFILE)(LPALLOCATEBUFFER,LPFREEBUFFER,
af062818b47340eef15700d2f0211576ba3506eevboxsync ULONG,LPSTR,LPSTR,LPSTREAM*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncHRESULT WINAPI OpenStreamOnFile(LPALLOCATEBUFFER,LPFREEBUFFER,
af062818b47340eef15700d2f0211576ba3506eevboxsync ULONG,LPSTR,LPSTR,LPSTREAM*);
af062818b47340eef15700d2f0211576ba3506eevboxsync#endif
af062818b47340eef15700d2f0211576ba3506eevboxsync#define OPENSTREAMONFILE "OpenStreamOnFile"
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncBOOL WINAPI FEqualNames(LPMAPINAMEID,LPMAPINAMEID);
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsynctypedef struct IPropData *LPPROPDATA;
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPROP_READONLY 0x00001U
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPROP_READWRITE 0x00002U
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPROP_CLEAN 0x10000U
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPROP_DIRTY 0x20000U
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI CreateIProp(LPCIID,ALLOCATEBUFFER*,ALLOCATEMORE*,FREEBUFFER*,
af062818b47340eef15700d2f0211576ba3506eevboxsync LPVOID,LPPROPDATA*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI PropCopyMore(LPSPropValue,LPSPropValue,ALLOCATEMORE*,LPVOID);
af062818b47340eef15700d2f0211576ba3506eevboxsyncULONG WINAPI UlPropSize(LPSPropValue);
af062818b47340eef15700d2f0211576ba3506eevboxsyncVOID WINAPI GetInstance(LPSPropValue,LPSPropValue,ULONG);
af062818b47340eef15700d2f0211576ba3506eevboxsyncBOOL WINAPI FPropContainsProp(LPSPropValue,LPSPropValue,ULONG);
af062818b47340eef15700d2f0211576ba3506eevboxsyncBOOL WINAPI FPropCompareProp(LPSPropValue,ULONG,LPSPropValue);
af062818b47340eef15700d2f0211576ba3506eevboxsyncLONG WINAPI LPropCompareProp(LPSPropValue,LPSPropValue);
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncHRESULT WINAPI HrAddColumns(LPMAPITABLE,LPSPropTagArray,LPALLOCATEBUFFER,LPFREEBUFFER);
af062818b47340eef15700d2f0211576ba3506eevboxsyncHRESULT WINAPI HrAddColumnsEx(LPMAPITABLE,LPSPropTagArray,LPALLOCATEBUFFER,
af062818b47340eef15700d2f0211576ba3506eevboxsync LPFREEBUFFER,void (*)(LPSPropTagArray));
af062818b47340eef15700d2f0211576ba3506eevboxsyncHRESULT WINAPI HrAllocAdviseSink(LPNOTIFCALLBACK,LPVOID,LPMAPIADVISESINK*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncHRESULT WINAPI HrThisThreadAdviseSink(LPMAPIADVISESINK,LPMAPIADVISESINK*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncHRESULT WINAPI HrDispatchNotifications (ULONG);
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncULONG WINAPI UlAddRef(void*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncULONG WINAPI UlRelease(void*);
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncHRESULT WINAPI HrGetOneProp(LPMAPIPROP,ULONG,LPSPropValue*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncHRESULT WINAPI HrSetOneProp(LPMAPIPROP,LPSPropValue);
af062818b47340eef15700d2f0211576ba3506eevboxsyncBOOL WINAPI FPropExists(LPMAPIPROP,ULONG);
af062818b47340eef15700d2f0211576ba3506eevboxsyncvoid WINAPI FreePadrlist(LPADRLIST);
af062818b47340eef15700d2f0211576ba3506eevboxsyncvoid WINAPI FreeProws(LPSRowSet);
af062818b47340eef15700d2f0211576ba3506eevboxsyncHRESULT WINAPI HrQueryAllRows(LPMAPITABLE,LPSPropTagArray,LPSRestriction,
af062818b47340eef15700d2f0211576ba3506eevboxsync LPSSortOrderSet,LONG,LPSRowSet*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncLPSPropValue WINAPI PpropFindProp(LPSPropValue,ULONG,ULONG);
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#if defined (UNICODE) || defined (__WINESRC__)
af062818b47340eef15700d2f0211576ba3506eevboxsyncBOOL WINAPI FBinFromHex(LPWSTR,LPBYTE);
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI ScBinFromHexBounded(LPWSTR,LPBYTE,ULONG);
af062818b47340eef15700d2f0211576ba3506eevboxsyncvoid WINAPI HexFromBin(LPBYTE,int,LPWSTR);
af062818b47340eef15700d2f0211576ba3506eevboxsyncULONG WINAPI UlFromSzHex(LPCWSTR);
af062818b47340eef15700d2f0211576ba3506eevboxsyncLPWSTR WINAPI SzFindCh(LPCWSTR,USHORT);
af062818b47340eef15700d2f0211576ba3506eevboxsyncLPWSTR WINAPI SzFindLastCh(LPCWSTR,USHORT);
af062818b47340eef15700d2f0211576ba3506eevboxsyncLPWSTR WINAPI SzFindSz(LPCWSTR,LPCWSTR);
af062818b47340eef15700d2f0211576ba3506eevboxsyncUINT WINAPI UFromSz(LPCSTR);
af062818b47340eef15700d2f0211576ba3506eevboxsync#else
af062818b47340eef15700d2f0211576ba3506eevboxsyncBOOL WINAPI FBinFromHex(LPSTR,LPBYTE);
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI ScBinFromHexBounded(LPSTR,LPBYTE,ULONG);
af062818b47340eef15700d2f0211576ba3506eevboxsyncvoid WINAPI HexFromBin(LPBYTE,int,LPSTR);
af062818b47340eef15700d2f0211576ba3506eevboxsyncULONG WINAPI UlFromSzHex(LPCSTR);
af062818b47340eef15700d2f0211576ba3506eevboxsyncLPSTR WINAPI SzFindCh(LPCSTR,USHORT);
af062818b47340eef15700d2f0211576ba3506eevboxsyncLPSTR WINAPI SzFindLastCh(LPCSTR,USHORT);
af062818b47340eef15700d2f0211576ba3506eevboxsyncLPSTR WINAPI SzFindSz(LPCSTR,LPCSTR);
af062818b47340eef15700d2f0211576ba3506eevboxsyncUINT WINAPI UFromSz(LPCSTR);
af062818b47340eef15700d2f0211576ba3506eevboxsync#endif
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI ScInitMapiUtil(ULONG);
af062818b47340eef15700d2f0211576ba3506eevboxsyncvoid WINAPI DeinitMapiUtil(void);
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#define szHrDispatchNotifications "_HrDispatchNotifications@4"
af062818b47340eef15700d2f0211576ba3506eevboxsync#define szScCreateConversationIndex "_ScCreateConversationIndex@16"
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsynctypedef HRESULT (WINAPI DISPATCHNOTIFICATIONS)(ULONG);
af062818b47340eef15700d2f0211576ba3506eevboxsynctypedef DISPATCHNOTIFICATIONS *LPDISPATCHNOTIFICATIONS;
af062818b47340eef15700d2f0211576ba3506eevboxsynctypedef SCODE (WINAPI CREATECONVERSATIONINDEX)(ULONG,LPBYTE,ULONG*,LPBYTE*);
af062818b47340eef15700d2f0211576ba3506eevboxsynctypedef CREATECONVERSATIONINDEX *LPCREATECONVERSATIONINDEX;
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsynctypedef struct ITableData *LPTABLEDATA;
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsynctypedef void (WINAPI CALLERRELEASE)(ULONG,LPTABLEDATA,LPMAPITABLE);
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync/*****************************************************************************
af062818b47340eef15700d2f0211576ba3506eevboxsync * ITableData interface
af062818b47340eef15700d2f0211576ba3506eevboxsync *
af062818b47340eef15700d2f0211576ba3506eevboxsync * The underlying table data structure for IMAPITable.
af062818b47340eef15700d2f0211576ba3506eevboxsync */
af062818b47340eef15700d2f0211576ba3506eevboxsync#define INTERFACE ITableData
af062818b47340eef15700d2f0211576ba3506eevboxsyncDECLARE_INTERFACE_(ITableData,IUnknown)
af062818b47340eef15700d2f0211576ba3506eevboxsync{
af062818b47340eef15700d2f0211576ba3506eevboxsync /*** IUnknown methods ***/
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD_(ULONG,AddRef)(THIS) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD_(ULONG,Release)(THIS) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync /*** ITableData methods ***/
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrGetView)(THIS_ LPSSortOrderSet lpSort, CALLERRELEASE *lpRel,
af062818b47340eef15700d2f0211576ba3506eevboxsync ULONG ulData, LPMAPITABLE *lppTable) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrModifyRow)(THIS_ LPSRow lpRow) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrDeleteRow)(THIS_ LPSPropValue lpKey) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrQueryRow)(THIS_ LPSPropValue lpKey, LPSRow *lppRow, ULONG *lpRowNum) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrEnumRow)(THIS_ ULONG ulRowNum, LPSRow *lppRow) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrNotify)(THIS_ ULONG ulFlags, ULONG cValues, LPSPropValue lpValues) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrInsertRow)(THIS_ ULONG ulRow, LPSRow lpRow) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrModifyRows)(THIS_ ULONG ulFlags, LPSRowSet lpRows) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrDeleteRows)(THIS_ ULONG ulFlags, LPSRowSet lpRows, ULONG *lpCount) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync};
af062818b47340eef15700d2f0211576ba3506eevboxsync#undef INTERFACE
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#if !defined(__cplusplus) || defined(CINTERFACE)
af062818b47340eef15700d2f0211576ba3506eevboxsync /*** IUnknown methods ***/
af062818b47340eef15700d2f0211576ba3506eevboxsync#define ITableData_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define ITableData_AddRef(p) (p)->lpVtbl->AddRef(p)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define ITableData_Release(p) (p)->lpVtbl->Release(p)
af062818b47340eef15700d2f0211576ba3506eevboxsync /*** ITableData methods ***/
af062818b47340eef15700d2f0211576ba3506eevboxsync#define ITableData_HrGetView(p,a,b,c,d) (p)->lpVtbl->HrGetView(p,a,b,c,d)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define ITableData_HrModifyRow(p,a) (p)->lpVtbl->HrModifyRow(p,a)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define ITableData_HrDeleteRow(p,a) (p)->lpVtbl->HrDeleteRow(p,a)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define ITableData_HrQueryRow(p,a,b,c) (p)->lpVtbl->HrQueryRow(p,a,b,c)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define ITableData_HrEnumRow(p,a,b) (p)->lpVtbl->HrEnumRow(p,a,b)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define ITableData_HrNotify(p,a,b,c) (p)->lpVtbl->HrNotify(p,a,b,c)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define ITableData_HrInsertRow(p,a,b) (p)->lpVtbl->HrInsertRow(p,a,b)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define ITableData_HrModifyRows(p,a,b) (p)->lpVtbl->HrModifyRows(p,a,b)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define ITableData_HrDeleteRows(p,a,b,c) (p)->lpVtbl->HrDeleteRows(p,a,b,c)
af062818b47340eef15700d2f0211576ba3506eevboxsync#endif
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI CreateTable(LPCIID,ALLOCATEBUFFER*,ALLOCATEMORE*,FREEBUFFER*,
af062818b47340eef15700d2f0211576ba3506eevboxsync LPVOID,ULONG,ULONG,LPSPropTagArray,LPTABLEDATA*);
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI ScCountNotifications(int,LPNOTIFICATION,ULONG*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI ScCountProps(int,LPSPropValue,ULONG*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI ScCopyNotifications(int,LPNOTIFICATION,LPVOID,ULONG*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI ScCopyProps(int,LPSPropValue,LPVOID,ULONG*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI ScDupPropset(int,LPSPropValue,LPALLOCATEBUFFER,LPSPropValue*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI ScRelocNotifications(int,LPNOTIFICATION,LPVOID,LPVOID,ULONG*);
af062818b47340eef15700d2f0211576ba3506eevboxsyncSCODE WINAPI ScRelocProps(int,LPSPropValue,LPVOID,LPVOID,ULONG*);
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncLPSPropValue WINAPI LpValFindProp(ULONG,ULONG,LPSPropValue);
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncstatic inline FILETIME FtAddFt(FILETIME ftLeft, FILETIME ftRight)
af062818b47340eef15700d2f0211576ba3506eevboxsync{
af062818b47340eef15700d2f0211576ba3506eevboxsync LONG64 *pl = (LONG64*)&ftLeft, *pr = (LONG64*)&ftRight;
af062818b47340eef15700d2f0211576ba3506eevboxsync union { FILETIME ft; LONG64 ll; } ftmap;
af062818b47340eef15700d2f0211576ba3506eevboxsync ftmap.ll = *pl + *pr;
af062818b47340eef15700d2f0211576ba3506eevboxsync return ftmap.ft;
af062818b47340eef15700d2f0211576ba3506eevboxsync}
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncstatic inline FILETIME FtSubFt(FILETIME ftLeft, FILETIME ftRight)
af062818b47340eef15700d2f0211576ba3506eevboxsync{
af062818b47340eef15700d2f0211576ba3506eevboxsync LONG64 *pl = (LONG64*)&ftLeft, *pr = (LONG64*)&ftRight;
af062818b47340eef15700d2f0211576ba3506eevboxsync union { FILETIME ft; LONG64 ll; } ftmap;
af062818b47340eef15700d2f0211576ba3506eevboxsync ftmap.ll = *pl - *pr;
af062818b47340eef15700d2f0211576ba3506eevboxsync return ftmap.ft;
af062818b47340eef15700d2f0211576ba3506eevboxsync}
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncstatic inline FILETIME FtNegFt(FILETIME ftLeft)
af062818b47340eef15700d2f0211576ba3506eevboxsync{
af062818b47340eef15700d2f0211576ba3506eevboxsync LONG64 *p = (LONG64*)&ftLeft;
af062818b47340eef15700d2f0211576ba3506eevboxsync union { FILETIME ft; LONG64 ll; } ftmap;
af062818b47340eef15700d2f0211576ba3506eevboxsync ftmap.ll = -*p;
af062818b47340eef15700d2f0211576ba3506eevboxsync return ftmap.ft;
af062818b47340eef15700d2f0211576ba3506eevboxsync}
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncstatic inline FILETIME FtMulDw(DWORD dwLeft, FILETIME ftRight)
af062818b47340eef15700d2f0211576ba3506eevboxsync{
af062818b47340eef15700d2f0211576ba3506eevboxsync LONG64 l = (LONG64)dwLeft, *pr = (LONG64*)&ftRight;
af062818b47340eef15700d2f0211576ba3506eevboxsync union { FILETIME ft; LONG64 ll; } ftmap;
af062818b47340eef15700d2f0211576ba3506eevboxsync ftmap.ll = l * (*pr);
af062818b47340eef15700d2f0211576ba3506eevboxsync return ftmap.ft;
af062818b47340eef15700d2f0211576ba3506eevboxsync}
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsyncstatic inline FILETIME FtMulDwDw(DWORD dwLeft, DWORD dwRight)
af062818b47340eef15700d2f0211576ba3506eevboxsync{
af062818b47340eef15700d2f0211576ba3506eevboxsync LONG64 l = (LONG64)dwLeft, r = (LONG64)dwRight;
af062818b47340eef15700d2f0211576ba3506eevboxsync union { FILETIME ft; LONG64 ll; } ftmap;
af062818b47340eef15700d2f0211576ba3506eevboxsync ftmap.ll = l * r;
af062818b47340eef15700d2f0211576ba3506eevboxsync return ftmap.ft;
af062818b47340eef15700d2f0211576ba3506eevboxsync}
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync/*****************************************************************************
af062818b47340eef15700d2f0211576ba3506eevboxsync * IPropData interface
af062818b47340eef15700d2f0211576ba3506eevboxsync *
af062818b47340eef15700d2f0211576ba3506eevboxsync */
af062818b47340eef15700d2f0211576ba3506eevboxsync#define INTERFACE IPropData
af062818b47340eef15700d2f0211576ba3506eevboxsyncDECLARE_INTERFACE_(IPropData,IMAPIProp)
af062818b47340eef15700d2f0211576ba3506eevboxsync{
af062818b47340eef15700d2f0211576ba3506eevboxsync /*** IUnknown methods ***/
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD_(ULONG,AddRef)(THIS) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD_(ULONG,Release)(THIS) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync /*** IMAPIProp methods ***/
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(GetLastError)(THIS_ HRESULT hRes, ULONG ulFlags, LPMAPIERROR *lppErr) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(SaveChanges)(THIS_ ULONG ulFlags) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(GetProps)(THIS_ LPSPropTagArray lpPropTags, ULONG ulFlags, ULONG *lpValues, LPSPropValue *lppProps) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(GetPropList)(THIS_ ULONG ulFlags, LPSPropTagArray *lppPropTagArray) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(OpenProperty)(THIS_ ULONG ulPropTag, LPCIID lpIid, ULONG ulOpts, ULONG ulFlags, LPUNKNOWN *lppUnk) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(SetProps)(THIS_ ULONG cValues, LPSPropValue lpProps, LPSPropProblemArray *lppProbs) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(DeleteProps)(THIS_ LPSPropTagArray lpPropTags, LPSPropProblemArray *lppProbs) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(CopyTo)(THIS_ ULONG ciidExclude, LPCIID lpIid, LPSPropTagArray lpProps, ULONG ulParam,
af062818b47340eef15700d2f0211576ba3506eevboxsync LPMAPIPROGRESS lpProgress, LPCIID lpIface,LPVOID lpDest, ULONG ulFlags,
af062818b47340eef15700d2f0211576ba3506eevboxsync LPSPropProblemArray *lppProbs) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(CopyProps)(THIS_ LPSPropTagArray lpIncludeProps, ULONG ulParam, LPMAPIPROGRESS lpProgress,
af062818b47340eef15700d2f0211576ba3506eevboxsync LPCIID lpIid, LPVOID lpDestObj, ULONG ulFlags, LPSPropProblemArray *lppProblems) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(GetNamesFromIDs)(THIS_ LPSPropTagArray *lppPropTags, LPGUID lpIid, ULONG ulFlags, ULONG *lpCount,
af062818b47340eef15700d2f0211576ba3506eevboxsync LPMAPINAMEID **lpppNames) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(GetIDsFromNames)(THIS_ ULONG cPropNames, LPMAPINAMEID *lppNames, ULONG ulFlags, LPSPropTagArray *lppPropTags) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync /*** IPropData methods ***/
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrSetObjAccess)(THIS_ ULONG ulAccess) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrSetPropAccess)(THIS_ LPSPropTagArray lpPropTags, ULONG *lpAccess) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrGetPropAccess)(THIS_ LPSPropTagArray *lppPropTags, ULONG **lppAccess) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync STDMETHOD(HrAddObjProps)(THIS_ LPSPropTagArray lppPropTags, LPSPropProblemArray *lppProbs) PURE;
af062818b47340eef15700d2f0211576ba3506eevboxsync};
af062818b47340eef15700d2f0211576ba3506eevboxsync#undef INTERFACE
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#if !defined(__cplusplus) || defined(CINTERFACE)
af062818b47340eef15700d2f0211576ba3506eevboxsync /*** IUnknown methods ***/
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_AddRef(p) (p)->lpVtbl->AddRef(p)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_Release(p) (p)->lpVtbl->Release(p)
af062818b47340eef15700d2f0211576ba3506eevboxsync /*** IMAPIProp methods ***/
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_SaveChanges(p,a) (p)->lpVtbl->SaveChanges(p,a)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_GetProps(p,a,b,c,d) (p)->lpVtbl->GetProps(p,a,b,c,d)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_GetPropList(p,a,b) (p)->lpVtbl->GetPropList(p,a,b)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_OpenProperty(p,a,b,c,d,e) (p)->lpVtbl->OpenProperty(p,a,b,c,d,e)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_SetProps(p,a,b,c) (p)->lpVtbl->SetProps(p,a,b,c)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_DeleteProps(p,a,b) (p)->lpVtbl->DeleteProps(p,a,b)
af062818b47340eef15700d2f0211576ba3506eevboxsync#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)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_CopyProps(p,a,b,c,d,e,f,g) (p)->lpVtbl->CopyProps(p,a,b,c,d,e,f,g)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_GetNamesFromIDs(p,a,b,c,d,e) (p)->lpVtbl->GetNamesFromIDs(p,a,b,c,d,e)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_GetIDsFromNames(p,a,b,c,d) (p)->lpVtbl->GetIDsFromNames(p,a,b,c,d)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_HrSetObjAccess(p,a) (p)->lpVtbl->HrSetObjAccess(p,a)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_HrSetPropAccess(p,a,b) (p)->lpVtbl->HrSetPropAccess(p,a,b)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_HrGetPropAccess(p,a,b) (p)->lpVtbl->HrGetPropAccess(p,a,b)
af062818b47340eef15700d2f0211576ba3506eevboxsync#define IPropData_HrAddObjProps(p,a,b) (p)->lpVtbl->HrAddObjProps(p,a,b)
af062818b47340eef15700d2f0211576ba3506eevboxsync#endif
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#ifdef __cplusplus
af062818b47340eef15700d2f0211576ba3506eevboxsync}
af062818b47340eef15700d2f0211576ba3506eevboxsync#endif
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#endif /* MAPIUTIL_H_ */