Commit 11b26f05 authored by Jon Griffiths's avatar Jon Griffiths Committed by Alexandre Julliard

Update/Add MAPI headers.

parent 7b6651a9
......@@ -51,6 +51,7 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
#include "shldisp.h"
#include "comcat.h"
#include "urlmon.h"
#include "mapiguid.h"
/* FIXME: cguids declares GUIDs but does not define their values */
......
......@@ -121,6 +121,11 @@ WINDOWS_INCLUDES = \
mapi.h \
mapicode.h \
mapidefs.h \
mapiguid.h \
mapitags.h \
mapiutil.h \
mapival.h \
mapix.h \
mciavi.h \
mcx.h \
mediaerr.h \
......
......@@ -24,11 +24,87 @@
#include <winerror.h>
#define MAKE_MAPI_SCODE(sev,fac,code) \
( (((ULONG)(sev)<<31) | ((ULONG)(fac)<<16) | ((ULONG)(code))) )
((SCODE)(((ULONG)(sev)<<31)|((ULONG)(fac)<<16)|((ULONG)(code))))
#define MAKE_MAPI_E( err ) (MAKE_MAPI_SCODE(1, FACILITY_ITF, err ))
#define MAKE_MAPI_E(e) (MAKE_MAPI_SCODE(1,FACILITY_ITF,(e)))
#define MAKE_MAPI_S(e) (MAKE_MAPI_SCODE(0,FACILITY_ITF,(e)))
#define MAPI_E_NOT_INITIALIZED MAKE_MAPI_E( 0x605)
/* Errors */
#define MAPI_E_ACCOUNT_DISABLED ((SCODE)0x80040124)
#define MAPI_E_AMBIGUOUS_RECIP ((SCODE)0x80040700)
#define MAPI_E_BAD_CHARWIDTH ((SCODE)0x80040103)
#define MAPI_E_BAD_COLUMN ((SCODE)0x80040118)
#define MAPI_E_BAD_VALUE ((SCODE)0x80040301)
#define MAPI_E_BUSY ((SCODE)0x8004010B)
#define MAPI_E_CALL_FAILED E_FAIL
#define MAPI_E_CANCEL ((SCODE)0x80040501)
#define MAPI_E_COLLISION ((SCODE)0x80040604)
#define MAPI_E_COMPUTED ((SCODE)0x8004011A)
#define MAPI_E_CORRUPT_DATA ((SCODE)0x8004011B)
#define MAPI_E_CORRUPT_STORE ((SCODE)0x80040600)
#define MAPI_E_DECLINE_COPY ((SCODE)0x80040306)
#define MAPI_E_DISK_ERROR ((SCODE)0x80040116)
#define MAPI_E_END_OF_SESSION ((SCODE)0x80040200)
#define MAPI_E_EXTENDED_ERROR ((SCODE)0x80040119)
#define MAPI_E_FAILONEPROVIDER ((SCODE)0x8004011D)
#define MAPI_E_FOLDER_CYCLE ((SCODE)0x8004060B)
#define MAPI_E_HAS_FOLDERS ((SCODE)0x80040609)
#define MAPI_E_HAS_MESSAGES ((SCODE)0x8004060A)
#define MAPI_E_INTERFACE_NOT_SUPPORTED E_NOINTERFACE
#define MAPI_E_INVALID_ACCESS_TIME ((SCODE)0x80040123)
#define MAPI_E_INVALID_BOOKMARK ((SCODE)0x80040405)
#define MAPI_E_INVALID_ENTRYID ((SCODE)0x80040107)
#define MAPI_E_INVALID_OBJECT ((SCODE)0x80040108)
#define MAPI_E_INVALID_PARAMETER E_INVALIDARG
#define MAPI_E_INVALID_TYPE ((SCODE)0x80040302)
#define MAPI_E_INVALID_WORKSTATION_ACCOUNT ((SCODE)0x80040122)
#define MAPI_E_LOGON_FAILED ((SCODE)0x80040111)
#define MAPI_E_MISSING_REQUIRED_COLUMN ((SCODE)0x80040202)
#define MAPI_E_NETWORK_ERROR ((SCODE)0x80040115)
#define MAPI_E_NO_ACCESS E_ACCESSDENIED
#define MAPI_E_NON_STANDARD ((SCODE)0x80040606)
#define MAPI_E_NO_RECIPIENTS ((SCODE)0x80040607)
#define MAPI_E_NO_SUPPORT ((SCODE)0x80040102)
#define MAPI_E_NO_SUPPRESS ((SCODE)0x80040602)
#define MAPI_E_NOT_ENOUGH_DISK ((SCODE)0x8004010D)
#define MAPI_E_NOT_ENOUGH_MEMORY E_OUTOFMEMORY
#define MAPI_E_NOT_ENOUGH_RESOURCES ((SCODE)0x8004010E)
#define MAPI_E_NOT_FOUND ((SCODE)0x8004010F)
#define MAPI_E_NOT_INITIALIZED ((SCODE)0x80040605)
#define MAPI_E_NOT_IN_QUEUE ((SCODE)0x80040601)
#define MAPI_E_NOT_ME ((SCODE)0x80040502)
#define MAPI_E_OBJECT_CHANGED ((SCODE)0x80040109)
#define MAPI_E_OBJECT_DELETED ((SCODE)0x8004010A)
#define MAPI_E_PASSWORD_CHANGE_REQUIRED ((SCODE)0x80040120)
#define MAPI_E_PASSWORD_EXPIRED ((SCODE)0x80040121)
#define MAPI_E_SESSION_LIMIT ((SCODE)0x80040112)
#define MAPI_E_STRING_TOO_LONG ((SCODE)0x80040105)
#define MAPI_E_SUBMITTED ((SCODE)0x80040608)
#define MAPI_E_TABLE_EMPTY ((SCODE)0x80040402)
#define MAPI_E_TABLE_TOO_BIG ((SCODE)0x80040403)
#define MAPI_E_TIMEOUT ((SCODE)0x80040401)
#define MAPI_E_TOO_BIG ((SCODE)0x80040305)
#define MAPI_E_TOO_COMPLEX ((SCODE)0x80040117)
#define MAPI_E_TYPE_NO_SUPPORT ((SCODE)0x80040303)
#define MAPI_E_UNABLE_TO_ABORT ((SCODE)0x80040114)
#define MAPI_E_UNABLE_TO_COMPLETE ((SCODE)0x80040400)
#define MAPI_E_UNCONFIGURED ((SCODE)0x8004011C)
#define MAPI_E_UNEXPECTED_ID ((SCODE)0x80040307)
#define MAPI_E_UNEXPECTED_TYPE ((SCODE)0x80040304)
#define MAPI_E_UNKNOWN_CPID ((SCODE)0x8004011E)
#define MAPI_E_UNKNOWN_ENTRYID ((SCODE)0x80040201)
#define MAPI_E_UNKNOWN_FLAGS ((SCODE)0x80040106)
#define MAPI_E_UNKNOWN_LCID ((SCODE)0x8004011F)
#define MAPI_E_USER_CANCEL ((SCODE)0x80040113)
#define MAPI_E_VERSION ((SCODE)0x80040110)
#define MAPI_E_WAIT ((SCODE)0x80040500)
/* Warnings */
#define MAPI_W_APPROX_COUNT ((SCODE)0x00040482)
#define MAPI_W_CANCEL_MESSAGE ((SCODE)0x00040580)
#define MAPI_W_ERRORS_RETURNED ((SCODE)0x00040380)
#define MAPI_W_NO_SERVICE ((SCODE)0x00040203)
#define MAPI_W_PARTIAL_COMPLETION ((SCODE)0x00040680)
#define MAPI_W_POSITION_CHANGED ((SCODE)0x00040481)
#endif
#endif /* MAPICODE_H */
/*
* Copyright 2004 Jon Griffiths
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MAPIGUID_H
#define MAPIGUID_H
#define DEFINE_MAPIGUID(n,l,w1,w2) DEFINE_OLEGUID(n,l,w1,w2)
DEFINE_MAPIGUID(IID_IABContainer,0x2030D,0,0);
DEFINE_MAPIGUID(IID_IABLogon,0x20314,0,0);
DEFINE_MAPIGUID(IID_IABProvider,0x20311,0,0);
DEFINE_MAPIGUID(IID_IAddrBook,0x20309,0,0);
DEFINE_MAPIGUID(IID_IAttachment,0x20308,0,0);
DEFINE_MAPIGUID(IID_IDistList,0x2030E,0,0);
DEFINE_MAPIGUID(IID_IEnumMAPIFormProp,0x20323,0,0);
DEFINE_MAPIGUID(IID_IMailUser,0x2030A,0,0);
DEFINE_MAPIGUID(IID_IMAPIAdviseSink,0x20302,0,0);
DEFINE_MAPIGUID(IID_IMAPIContainer,0x2030B,0,0);
DEFINE_MAPIGUID(IID_IMAPIControl,0x2031B,0,0);
DEFINE_MAPIGUID(IID_IMAPIFolder,0x2030C,0,0);
DEFINE_MAPIGUID(IID_IMAPIForm,0x20327,0,0);
DEFINE_MAPIGUID(IID_IMAPIFormAdviseSink,0x2032F,0,0);
DEFINE_MAPIGUID(IID_IMAPIFormContainer,0x2032E,0,0);
DEFINE_MAPIGUID(IID_IMAPIFormFactory,0x20350,0,0);
DEFINE_MAPIGUID(IID_IMAPIFormInfo,0x20324,0,0);
DEFINE_MAPIGUID(IID_IMAPIFormMgr,0x20322,0,0);
DEFINE_MAPIGUID(IID_IMAPIFormProp,0x2032D,0,0);
DEFINE_MAPIGUID(IID_IMAPIMessageSite,0x20370,0,0);
DEFINE_MAPIGUID(IID_IMAPIProgress,0x2031F,0,0);
DEFINE_MAPIGUID(IID_IMAPIProp,0x20303,0,0);
DEFINE_MAPIGUID(IID_IMAPIPropData,0x2031A,0,0);
DEFINE_MAPIGUID(IID_IMAPISession,0x20300,0,0);
DEFINE_MAPIGUID(IID_IMAPISpoolerInit,0x20317,0,0);
DEFINE_MAPIGUID(IID_IMAPISpoolerService,0x2031E,0,0);
DEFINE_MAPIGUID(IID_IMAPISpoolerSession,0x20318,0,0);
DEFINE_MAPIGUID(IID_IMAPIStatus,0x20305,0,0);
DEFINE_MAPIGUID(IID_IMAPISup,0x2030F,0,0);
DEFINE_MAPIGUID(IID_IMAPITable,0x20301,0,0);
DEFINE_MAPIGUID(IID_IMAPITableData,0x20316,0,0);
DEFINE_MAPIGUID(IID_IMAPIViewAdviseSink,0x2032B,0,0);
DEFINE_MAPIGUID(IID_IMAPIViewContext,0x20321,0,0);
DEFINE_MAPIGUID(IID_IMessage,0x20307,0,0);
DEFINE_MAPIGUID(IID_IMsgServiceAdmin,0x2031D,0,0);
DEFINE_MAPIGUID(IID_IMsgStore,0x20306,0,0);
DEFINE_MAPIGUID(IID_IMSLogon,0x20313,0,0);
DEFINE_MAPIGUID(IID_IMSProvider,0x20310,0,0);
DEFINE_MAPIGUID(IID_IPersistMessage,0x2032A,0,0);
DEFINE_MAPIGUID(IID_IProfAdmin,0x2031C,0,0);
DEFINE_MAPIGUID(IID_IProfSect,0x20304,0,0);
DEFINE_MAPIGUID(IID_IProviderAdmin,0x20325,0,0);
DEFINE_MAPIGUID(IID_ISpoolerHook,0x20320,0,0);
DEFINE_MAPIGUID(IID_IStreamDocfile,0x2032C,0,0);
DEFINE_MAPIGUID(IID_IStreamTnef,0x20330,0,0);
DEFINE_MAPIGUID(IID_ITNEF,0x20319,0,0);
DEFINE_MAPIGUID(IID_IXPLogon,0x20315,0,0);
DEFINE_MAPIGUID(IID_IXPProvider,0x20312,0,0);
DEFINE_MAPIGUID(MUID_PROFILE_INSTANCE,0x20385,0,0);
DEFINE_MAPIGUID(PS_MAPI,0x20328,0,0);
DEFINE_MAPIGUID(PS_PUBLIC_STRINGS,0x20329,0,0);
DEFINE_MAPIGUID(PS_ROUTING_ADDRTYPE,0x20381,0,0);
DEFINE_MAPIGUID(PS_ROUTING_DISPLAY_NAME,0x20382,0,0);
DEFINE_MAPIGUID(PS_ROUTING_EMAIL_ADDRESSES,0x20380,0,0);
DEFINE_MAPIGUID(PS_ROUTING_ENTRYID,0x20383,0,0);
DEFINE_MAPIGUID(PS_ROUTING_SEARCH_KEY,0x20384,0,0);
#endif/* MAPIGUID_H */
/*
* Copyright 2004 Jon Griffiths
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MAPIUTIL_H_
#define MAPIUTIL_H_
#include <mapix.h>
#ifdef __cplusplus
extern "C" {
#endif
#define TAD_ALL_ROWS 1 /* Delete all rows */
LPMALLOC WINAPI MAPIGetDefaultMalloc(void);
#define SOF_UNIQUEFILENAME 0x80000000U /* Create a unique (temporary) filename */
#if defined (UNICODE) || defined (__WINESRC__)
typedef HRESULT (WINAPI * LPOPENSTREAMONFILE)(LPALLOCATEBUFFER,LPFREEBUFFER,
ULONG,LPWSTR,LPWSTR,LPSTREAM*);
HRESULT WINAPI OpenStreamOnFile(LPALLOCATEBUFFER,LPFREEBUFFER,
ULONG,LPWSTR,LPWSTR,LPSTREAM*);
#else
typedef HRESULT (WINAPI * LPOPENSTREAMONFILE)(LPALLOCATEBUFFER,LPFREEBUFFER,
ULONG,LPSTR,LPSTR,LPSTREAM*);
HRESULT WINAPI OpenStreamOnFile(LPALLOCATEBUFFER,LPFREEBUFFER,
ULONG,LPSTR,LPSTR,LPSTREAM*);
#endif
#define OPENSTREAMONFILE "OpenStreamOnFile"
BOOL WINAPI FEqualNames(LPMAPINAMEID,LPMAPINAMEID);
typedef struct IPropData IPropData;
typedef IPropData *LPPROPDATA;
#define IPROP_READONLY 0x00001U
#define IPROP_READWRITE 0x00002U
#define IPROP_CLEAN 0x10000U
#define IPROP_DIRTY 0x20000U
SCODE WINAPI CreateIProp(LPCIID,ALLOCATEBUFFER*,ALLOCATEMORE*,FREEBUFFER*,
LPVOID,LPPROPDATA*);
SCODE WINAPI PropCopyMore(LPSPropValue,LPSPropValue,ALLOCATEMORE*,LPVOID);
ULONG WINAPI UlPropSize(LPSPropValue);
VOID WINAPI GetInstance(LPSPropValue,LPSPropValue,ULONG);
BOOL WINAPI FPropContainsProp(LPSPropValue,LPSPropValue,ULONG);
BOOL WINAPI FPropCompareProp(LPSPropValue,ULONG,LPSPropValue);
LONG WINAPI LPropCompareProp(LPSPropValue,LPSPropValue);
HRESULT WINAPI HrAddColumns(LPMAPITABLE,LPSPropTagArray,LPALLOCATEBUFFER,LPFREEBUFFER);
HRESULT WINAPI HrAddColumnsEx(LPMAPITABLE,LPSPropTagArray,LPALLOCATEBUFFER,
LPFREEBUFFER,void (*)(LPSPropTagArray));
HRESULT WINAPI HrAllocAdviseSink(LPNOTIFCALLBACK,LPVOID,LPMAPIADVISESINK*);
HRESULT WINAPI HrThisThreadAdviseSink(LPMAPIADVISESINK,LPMAPIADVISESINK*);
HRESULT WINAPI HrDispatchNotifications (ULONG);
ULONG WINAPI UlAddRef(void*);
ULONG WINAPI UlRelease(void*);
HRESULT WINAPI HrGetOneProp(LPMAPIPROP,ULONG,LPSPropValue*);
HRESULT WINAPI HrSetOneProp(LPMAPIPROP,LPSPropValue);
BOOL WINAPI FPropExists(LPMAPIPROP,ULONG);
void WINAPI FreePadrlist(LPADRLIST);
void WINAPI FreeProws(LPSRowSet);
HRESULT WINAPI HrQueryAllRows(LPMAPITABLE,LPSPropTagArray,LPSRestriction,
LPSSortOrderSet,LONG,LPSRowSet*);
LPSPropValue WINAPI PpropFindProp(LPSPropValue,ULONG,ULONG);
#if defined (UNICODE) || defined (__WINESRC__)
BOOL WINAPI FBinFromHex(LPWSTR,LPBYTE);
SCODE WINAPI ScBinFromHexBounded(LPWSTR,LPBYTE,ULONG);
void WINAPI HexFromBin(LPBYTE,int,LPWSTR);
ULONG WINAPI UlFromSzHex(LPCWSTR);
LPWSTR WINAPI SzFindCh(LPCWSTR,USHORT);
LPWSTR WINAPI SzFindLastCh(LPCWSTR,USHORT);
LPWSTR WINAPI SzFindSz(LPCWSTR,LPCWSTR);
UINT WINAPI UFromSz(LPCSTR);
#else
BOOL WINAPI FBinFromHex(LPSTR,LPBYTE);
SCODE WINAPI ScBinFromHexBounded(LPSTR,LPBYTE,ULONG);
void WINAPI HexFromBin(LPBYTE,int,LPSTR);
ULONG WINAPI UlFromSzHex(LPCSTR);
LPSTR WINAPI SzFindCh(LPCSTR,USHORT);
LPSTR WINAPI SzFindLastCh(LPCSTR,USHORT);
LPSTR WINAPI SzFindSz(LPCSTR,LPCSTR);
UINT WINAPI UFromSz(LPCSTR);
#endif
SCODE WINAPI ScInitMapiUtil(ULONG);
void WINAPI DeinitMapiUtil(void);
#define szHrDispatchNotifications "_HrDispatchNotifications@4"
#define szScCreateConversationIndex "_ScCreateConversationIndex@16"
typedef HRESULT (WINAPI DISPATCHNOTIFICATIONS)(ULONG);
typedef DISPATCHNOTIFICATIONS *LPDISPATCHNOTIFICATIONS;
typedef SCODE (WINAPI CREATECONVERSATIONINDEX)(ULONG,LPBYTE,ULONG*,LPBYTE*);
typedef CREATECONVERSATIONINDEX *LPCREATECONVERSATIONINDEX;
typedef struct ITableData ITableData;
typedef ITableData *LPTABLEDATA;
typedef void (WINAPI CALLERRELEASE)(ULONG,LPTABLEDATA,LPMAPITABLE);
/*****************************************************************************
* ITableData interface
*
* The underlying table data structure for IMAPITable.
*/
#define INTERFACE ITableData
#define ITableData_METHODS \
IUnknown_METHODS \
STDMETHOD(HrGetView)(THIS_ LPSSortOrderSet lpSort, CALLERRELEASE *lpRel, \
ULONG ulData, LPMAPITABLE *lppTable) PURE; \
STDMETHOD(HrModifyRow)(THIS_ LPSRow lpRow) PURE; \
STDMETHOD(HrDeleteRow)(THIS_ LPSPropValue lpKey) PURE; \
STDMETHOD(HrQueryRow)(THIS_ LPSPropValue lpKey, LPSRow *lppRow, ULONG *lpRowNum) PURE; \
STDMETHOD(HrEnumRow)(THIS_ ULONG ulRowNum, LPSRow *lppRow) PURE; \
STDMETHOD(HrNotify)(THIS_ ULONG ulFlags, ULONG cValues, LPSPropValue lpValues) PURE; \
STDMETHOD(HrInsertRow)(THIS_ ULONG ulRow, LPSRow lpRow) PURE; \
STDMETHOD(HrModifyRows)(THIS_ ULONG ulFlags, LPSRowSet lpRows) PURE; \
STDMETHOD(HrDeleteRows)(THIS_ ULONG ulFlags, LPSRowSet lpRows, ULONG *lpCount) PURE;
ICOM_DEFINE(ITableData,IUnknown)
#undef INTERFACE
#ifdef COBJMACROS
/*** IUnknown methods ***/
#define ITableData_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ITableData_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ITableData_Release(p) (p)->lpVtbl->Release(p)
/*** ITableData methods ***/
#define ITableData_HrGetView(p,a,b,c,d) (p)->lpVtbl->HrGetView(p,a,b,c,d)
#define ITableData_HrModifyRow(p,a) (p)->lpVtbl->HrModifyRow(p,a)
#define ITableData_HrDeleteRow(p,a) (p)->lpVtbl->HrDeleteRow(p,a)
#define ITableData_HrQueryRow(p,a,b,c) (p)->lpVtbl->HrQueryRow(p,a,b,c)
#define ITableData_HrEnumRow(p,a,b) (p)->lpVtbl->HrEnumRow(p,a,b)
#define ITableData_HrNotify(p,a,b,c) (p)->lpVtbl->HrNotify(p,a,b,c)
#define ITableData_HrInsertRow(p,a,b) (p)->lpVtbl->HrInsertRow(p,a,b)
#define ITableData_HrModifyRows(p,a,b) (p)->lpVtbl->HrModifyRows(p,a,b)
#define ITableData_HrDeleteRows(p,a,b,c) (p)->lpVtbl->HrDeleteRows(p,a,b,c)
#endif
SCODE WINAPI CreateTable(LPCIID,ALLOCATEBUFFER*,ALLOCATEMORE*,FREEBUFFER*,
LPVOID,ULONG,ULONG,LPSPropTagArray,LPTABLEDATA*);
SCODE WINAPI ScCountNotifications(int,LPNOTIFICATION,ULONG*);
SCODE WINAPI ScCountProps(int,LPSPropValue,ULONG*);
SCODE WINAPI ScCopyNotifications(int,LPNOTIFICATION,LPVOID,ULONG*);
SCODE WINAPI ScCopyProps(int,LPSPropValue,LPVOID,ULONG*);
SCODE WINAPI ScDupPropset(int,LPSPropValue,LPALLOCATEBUFFER,LPSPropValue*);
SCODE WINAPI ScRelocNotifications(int,LPNOTIFICATION,LPVOID,LPVOID,ULONG*);
SCODE WINAPI ScRelocProps(int,LPSPropValue,LPVOID,LPVOID,ULONG*);
LPSPropValue WINAPI LpValFindProp(ULONG,ULONG,LPSPropValue);
static inline FILETIME FtAddFt(FILETIME ftLeft, FILETIME ftRight)
{
LONG64 *pl = (LONG64*)&ftLeft, *pr = (LONG64*)&ftRight;
union { FILETIME ft; LONG64 ll; } ftmap;
ftmap.ll = *pl + *pr;
return ftmap.ft;
}
static inline FILETIME FtSubFt(FILETIME ftLeft, FILETIME ftRight)
{
LONG64 *pl = (LONG64*)&ftLeft, *pr = (LONG64*)&ftRight;
union { FILETIME ft; LONG64 ll; } ftmap;
ftmap.ll = *pl - *pr;
return ftmap.ft;
}
static inline FILETIME FtNegFt(FILETIME ftLeft)
{
LONG64 *p = (LONG64*)&ftLeft;
union { FILETIME ft; LONG64 ll; } ftmap;
ftmap.ll = -*p;
return ftmap.ft;
}
static inline FILETIME FtMulDw(DWORD dwLeft, FILETIME ftRight)
{
LONG64 l = (LONG64)dwLeft, *pr = (LONG64*)&ftRight;
union { FILETIME ft; LONG64 ll; } ftmap;
ftmap.ll = l * (*pr);
return ftmap.ft;
}
static inline FILETIME FtMulDwDw(DWORD dwLeft, DWORD dwRight)
{
LONG64 l = (LONG64)dwLeft, r = (LONG64)dwRight;
union { FILETIME ft; LONG64 ll; } ftmap;
ftmap.ll = l * r;
return ftmap.ft;
}
#ifdef __cplusplus
}
#endif
#endif /* MAPIUTIL_H_ */
/*
* Copyright 2004 Jon Griffiths
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MAPIVAL_H
#define MAPIVAL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <mapiutil.h>
BOOL WINAPI FBadRglpszW(LPWSTR*,ULONG);
BOOL WINAPI FBadRowSet(LPSRowSet);
BOOL WINAPI FBadRglpNameID(LPMAPINAMEID*,ULONG);
BOOL WINAPI FBadEntryList(LPENTRYLIST);
ULONG WINAPI FBadRestriction(LPSRestriction);
ULONG WINAPI FBadPropTag(ULONG);
ULONG WINAPI FBadRow(LPSRow);
ULONG WINAPI FBadProp(LPSPropValue);
ULONG WINAPI FBadSortOrderSet(LPSSortOrderSet);
ULONG WINAPI FBadColumnSet(LPSPropTagArray);
#define FBadRgPropVal(p,n) FAILED(ScCountProps((n),(p),NULL))
#define FBadPropVal(p) FBadRgPropVal(1,(p))
#define FBadAdrList(p) FBadRowSet((LPSRowSet)(p))
#define BAD_STANDARD_OBJ(a,b,c,d) FALSE
#define FBadUnknown(a) FALSE
#define FBadQueryInterface(a,b,c) FALSE
#define FBadAddRef(a) FALSE
#define FBadRelease(a) FALSE
#define FBadGetLastError(a,b,c,d) FALSE
#define FBadSaveChanges(a,b) FALSE
#define FBadGetProps(a,b,c,d) FALSE
#define FBadGetPropList(a,b) FALSE
#define FBadOpenProperty(a,b,c,d,e,f) FALSE
#define FBadSetProps(a,b,c,d) FALSE
#define FBadDeleteProps(a,b,c) FALSE
#define FBadCopyTo(a,b,c,d,e,f,g,h,i,j) FALSE
#define FBadCopyProps(a,b,c,d,e,f,g,h) FALSE
#define FBadGetNamesFromIDs(a,b,c,d,e,f) FALSE
#define FBadGetIDsFromNames(a,b,c,d,e) FALSE
#define ValidateParms(x) do { } while(0)
#define UlValidateParms(x) do { } while(0)
#define CheckParms(x) do { } while(0)
#define ValidateParameters1(a,b) do { } while(0)
#define ValidateParameters2(a,b,c) do { } while(0)
#define ValidateParameters3(a,b,c,d) do { } while(0)
#define ValidateParameters4(a,b,c,d,e) do { } while(0)
#define ValidateParameters5(a,b,c,d,e,f) do { } while(0)
#define ValidateParameters6(a,b,c,d,e,f,g) do { } while(0)
#define ValidateParameters7(a,b,c,d,e,f,g,h) do { } while(0)
#define ValidateParameters8(a,b,c,d,e,f,g,h,i) do { } while(0)
#define ValidateParameters9(a,b,c,d,e,f,g,h,i,j) do { } while(0)
#define ValidateParameters10(a,b,c,d,e,f,g,h,i,j,k) do { } while(0)
#define ValidateParameters11(a,b,c,d,e,f,g,h,i,j,k,l) do { } while(0)
#define ValidateParameters12(a,b,c,d,e,f,g,h,i,j,k,l,m) do { } while(0)
#define ValidateParameters13(a,b,c,d,e,f,g,h,i,j,k,l,m,n) do { } while(0)
#define ValidateParameters14(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) do { } while(0)
#define ValidateParameters15(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) do { } while(0)
#define ValidateParameters16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) do { } while(0)
#define UlValidateParameters1(a,b) do { } while(0)
#define UlValidateParameters2(a,b,c) do { } while(0)
#define UlValidateParameters3(a,b,c,d) do { } while(0)
#define UlValidateParameters4(a,b,c,d,e) do { } while(0)
#define UlValidateParameters5(a,b,c,d,e,f) do { } while(0)
#define UlValidateParameters6(a,b,c,d,e,f,g) do { } while(0)
#define UlValidateParameters7(a,b,c,d,e,f,g,h) do { } while(0)
#define UlValidateParameters8(a,b,c,d,e,f,g,h,i) do { } while(0)
#define UlValidateParameters9(a,b,c,d,e,f,g,h,i,j) do { } while(0)
#define UlValidateParameters10(a,b,c,d,e,f,g,h,i,j,k) do { } while(0)
#define UlValidateParameters11(a,b,c,d,e,f,g,h,i,j,k,l) do { } while(0)
#define UlValidateParameters12(a,b,c,d,e,f,g,h,i,j,k,l,m) do { } while(0)
#define UlValidateParameters13(a,b,c,d,e,f,g,h,i,j,k,l,m,n) do { } while(0)
#define UlValidateParameters14(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) do { } while(0)
#define UlValidateParameters15(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) do { } while(0)
#define UlValidateParameters16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) do { } while(0)
#define CheckParameters1(a,b) do { } while(0)
#define CheckParameters2(a,b,c) do { } while(0)
#define CheckParameters3(a,b,c,d) do { } while(0)
#define CheckParameters4(a,b,c,d,e) do { } while(0)
#define CheckParameters5(a,b,c,d,e,f) do { } while(0)
#define CheckParameters6(a,b,c,d,e,f,g) do { } while(0)
#define CheckParameters7(a,b,c,d,e,f,g,h) do { } while(0)
#define CheckParameters8(a,b,c,d,e,f,g,h,i) do { } while(0)
#define CheckParameters9(a,b,c,d,e,f,g,h,i,j) do { } while(0)
#define CheckParameters10(a,b,c,d,e,f,g,h,i,j,k) do { } while(0)
#define CheckParameters11(a,b,c,d,e,f,g,h,i,j,k,l) do { } while(0)
#define CheckParameters12(a,b,c,d,e,f,g,h,i,j,k,l,m) do { } while(0)
#define CheckParameters13(a,b,c,d,e,f,g,h,i,j,k,l,m,n) do { } while(0)
#define CheckParameters14(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) do { } while(0)
#define CheckParameters15(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) do { } while(0)
#define CheckParameters16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) do { } while(0)
#ifdef __cplusplus
}
#endif
#endif /* MAPIVAL_H */
/*
* Copyright 2004 Jon Griffiths
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MAPIX_H
#define MAPIX_H
#ifndef MAPIDEFS_H
#include <mapidefs.h>
#endif
#ifndef MAPICODE_H
#include <mapicode.h>
#endif
#ifndef MAPIGUID_H
#include <mapiguid.h>
#endif
#ifndef MAPITAGS_H
#include <mapitags.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct IProfAdmin IProfAdmin;
typedef IProfAdmin *LPPROFADMIN;
typedef struct IMsgServiceAdmin IMsgServiceAdmin;
typedef IMsgServiceAdmin *LPSERVICEADMIN;
typedef struct IMAPISession IMAPISession;
typedef IMAPISession *LPMAPISESSION;
typedef unsigned long FLAGS;
/* Flags for MAPILogon and MAPILogonEx */
#define MAPI_LOGON_UI 0x000001
#define MAPI_NEW_SESSION 0x000002
#define MAPI_EXTENDED 0x000020
#define MAPI_FORCE_DOWNLOAD 0x001000
#define MAPI_PASSWORD_UI 0x020000
#define MAPI_ALLOW_OTHERS 0x000008
#define MAPI_EXPLICIT_PROFILE 0x000010
#define MAPI_SERVICE_UI_ALWAYS 0x002000
#define MAPI_NO_MAIL 0x008000
#define MAPI_NT_SERVICE 0x010000
#define MAPI_TIMEOUT_SHORT 0x100000
#define MAPI_SIMPLE_DEFAULT (MAPI_LOGON_UI|MAPI_ALLOW_OTHERS|MAPI_FORCE_DOWNLOAD)
#define MAPI_SIMPLE_EXPLICIT (MAPI_NEW_SESSION|MAPI_EXPLICIT_PROFILE|MAPI_FORCE_DOWNLOAD)
typedef struct tagMAPIINIT_0
{
ULONG ulVersion;
ULONG ulFlags;
} MAPIINIT_0, *LPMAPIINIT_0;
typedef MAPIINIT_0 MAPIINIT, *LPMAPIINIT;
#define MAPI_INIT_VERSION 0U
typedef HRESULT (WINAPI MAPIINITIALIZE)(void*);
typedef MAPIINITIALIZE *LPMAPIINITIALIZE;
MAPIINITIALIZE MAPIInitialize;
typedef void (WINAPI MAPIUNINITIALIZE)(void);
typedef MAPIUNINITIALIZE *LPMAPIUNINITIALIZE;
MAPIUNINITIALIZE MAPIUninitialize;
#if defined (UNICODE) || defined (__WINESRC__)
typedef HRESULT (STDMETHODCALLTYPE MAPILOGONEX)(ULONG_PTR,LPWSTR,LPWSTR,ULONG,LPMAPISESSION*);
#else
typedef HRESULT (STDMETHODCALLTYPE MAPILOGONEX)(ULONG_PTR,LPSTR,LPSTR,ULONG,LPMAPISESSION *);
#endif
typedef MAPILOGONEX *LPMAPILOGONEX;
MAPILOGONEX MAPILogonEx;
typedef SCODE (WINAPI MAPIALLOCATEBUFFER)(ULONG,LPVOID*);
typedef MAPIALLOCATEBUFFER *LPMAPIALLOCATEBUFFER;
MAPIALLOCATEBUFFER MAPIAllocateBuffer;
typedef SCODE (WINAPI MAPIALLOCATEMORE)(ULONG,LPVOID,LPVOID*);
typedef MAPIALLOCATEMORE *LPMAPIALLOCATEMORE;
MAPIALLOCATEMORE MAPIAllocateMore;
typedef ULONG (WINAPI MAPIFREEBUFFER)(LPVOID);
typedef MAPIFREEBUFFER *LPMAPIFREEBUFFER;
MAPIFREEBUFFER MAPIFreeBuffer;
/*****************************************************************************
* IMAPISession interface
*/
#define INTERFACE IMAPISession
#define IMAPISession_METHODS \
IUnknown_METHODS \
STDMETHOD(GetLastError)(THIS_ HRESULT hResult, ULONG ulFlags, LPMAPIERROR *lppMAPIError) PURE; \
STDMETHOD(GetMsgStoresTable)(THIS_ ULONG ulFlags, LPMAPITABLE *lppTable) PURE; \
STDMETHOD(OpenMsgStore)(THIS_ ULONG_PTR ulUIParam, ULONG cbId, \
LPENTRYID lpId, LPCIID lpIFace, ULONG ulFlags, LPMDB *lppMDB) PURE; \
STDMETHOD(OpenAddressBook)(THIS_ ULONG_PTR ulUIParam, LPCIID iid, ULONG ulFlags, LPADRBOOK *lppAdrBook) PURE; \
STDMETHOD(OpenProfileSection)(THIS_ LPMAPIUID lpUID, LPCIID iid, ULONG ulFlags, LPPROFSECT *lppProf) PURE; \
STDMETHOD(GetStatusTable)(THIS_ ULONG ulFlags, LPMAPITABLE *lppTable) PURE; \
STDMETHOD(OpenEntry)(THIS_ ULONG cbId, LPENTRYID lpId, LPCIID iid, \
ULONG ulFlags, ULONG *lpType, LPUNKNOWN *lppUnk) PURE; \
STDMETHOD(CompareEntryIDs)(THIS_ ULONG cbLID, LPENTRYID lpLID, ULONG cbRID, \
LPENTRYID lpRID, ULONG ulFlags, ULONG *lpRes) PURE; \
STDMETHOD(Advise)(THIS_ ULONG cbId, LPENTRYID lpId, ULONG ulMask, \
LPMAPIADVISESINK lpSink, ULONG *lpCxn) PURE;\
STDMETHOD(Unadvise)(THIS_ ULONG ulConnection) PURE;\
STDMETHOD(MessageOptions)(THIS_ ULONG_PTR ulUIParam, ULONG ulFlags, LPSTR lpszAddr, LPMESSAGE lpMsg) PURE; \
STDMETHOD(QueryDefaultMessageOpt)(THIS_ LPSTR lpszAddr, ULONG ulFlags, \
ULONG *lpcVals, LPSPropValue *lppOpts) PURE; \
STDMETHOD(EnumAdrTypes)(THIS_ ULONG ulFlags, ULONG *lpcTypes, LPSTR **lpppszTypes) PURE; \
STDMETHOD(QueryIdentity)(THIS_ ULONG *lpcbId, LPENTRYID *lppEntryID) PURE; \
STDMETHOD(Logoff)(THIS_ ULONG_PTR ulUIParam, ULONG ulFlags, ULONG ulReserved) PURE; \
STDMETHOD(SetDefaultStore)(THIS_ ULONG ulFlags, ULONG cbId, LPENTRYID lpId) PURE; \
STDMETHOD(AdminServices)(THIS_ ULONG ulFlags, LPSERVICEADMIN *lppAdmin) PURE; \
STDMETHOD(ShowForm)(THIS_ ULONG_PTR ulUIParam, LPMDB lpStore, \
LPMAPIFOLDER lpParent, LPCIID iid, ULONG ulToken, \
LPMESSAGE lpSent, ULONG ulFlags, ULONG ulStatus, \
ULONG ulMsgFlags, ULONG ulAccess, LPSTR lpszClass) PURE; \
STDMETHOD(PrepareForm)(THIS_ LPCIID lpIFace, LPMESSAGE lpMsg, ULONG *lpToken) PURE;
ICOM_DEFINE(IMAPISession,IUnknown)
#undef INTERFACE
#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IMAPISession_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IMAPISession_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IMAPISession_Release(p) (p)->lpVtbl->Release(p)
/*** IMAPISession methods ***/
#define IMAPISession_GetLastError(p,a,b,c) (p)->lpVtbl->GetLastError(p,a,b,c)
#define IMAPISession_GetMsgStoresTable(p,a,b) (p)->lpVtbl->GetMsgStoresTable(p,a,b)
#define IMAPISession_OpenMsgStore(p,a,b,c,d,e,f) (p)->lpVtbl->OpenMsgStore(p,a,b,c,d,e,f)
#define IMAPISession_OpenAddressBook(p,a,b,c,d) (p)->lpVtbl->OpenAddressBook(p,a,b,c,d)
#define IMAPISession_OpenProfileSection(p,a,b,c,d) (p)->lpVtbl->OpenProfileSection(p,a,b,c,d)
#define IMAPISession_GetStatusTable(p,a,b) (p)->lpVtbl->GetStatusTable(p,a,b)
#define IMAPISession_OpenEntry(p,a,b,c,d,e,f) (p)->lpVtbl->OpenEntry(p,a,b,c,d,e,f)
#define IMAPISession_CompareEntryIDs(p,a,b,c,d,e,f) (p)->lpVtbl->CompareEntryIDs(p,a,b,c,d,e,f)
#define IMAPISession_Advise(p,a,b,c,d,e) (p)->lpVtbl->Advise(p,a,b,c,d,e)
#define IMAPISession_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a)
#define IMAPISession_MessageOptions(p,a,b,c,d) (p)->lpVtbl->MessageOptions)(p,a,b,c,d)
#define IMAPISession_QueryDefaultMessageOpt(p,a,b,c,d) \
(p)->lpVtbl->QueryDefaultMessageOpt(p,a,b,c,d)
#define IMAPISession_EnumAdrTypes(p,a,b,c) (p)->lpVtbl->EnumAdrTypes(p,a,b,c)
#define IMAPISession_QueryIdentity(p,a,b) (p)->lpVtbl->QueryIdentity(p,a,b)
#define IMAPISession_Logoff(p,a,b,c) (p)->lpVtbl->Logoff(p,a,b,c)
#define IMAPISession_SetDefaultStore(p,a,b,c) (p)->lpVtbl->SetDefaultStore(p,a,b,c)
#define IMAPISession_AdminServices(p,a,b) (p)->lpVtbl->AdminServices(p,a,b)
#define IMAPISession_ShowForm(p,a,b,c,d,e,f,g,h,i,j,k) \
(p)->lpVtbl->ShowForm(p,a,b,c,d,e,f,g,h,i,j,k)
#define IMAPISession_PrepareForm(p,a,b,c) (p)->lpVtbl->PrepareForm(p,a,b,c)
#endif
#ifdef __cplusplus
}
#endif
#endif /* MAPIX_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment