' ########################################################################################
' Microsoft Windows
' File: MAPIDEfs.inc
' Contents: Definitions used by MAPI clients and service providers
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_MAPIDefs_PBI)
#DEFINE PBX_MAPIDefs_PBI
%EQUATE `MAPIDEFS_INC = 1
#INCLUDE ONCE "Legacy/COM/Ole2.inc"
#INCLUDE ONCE "Legacy/UI/MAPIGuid.inc"
'/* Array dimension for structures with variable-sized arrays at the end. */
#IF NOT %DEF(%MAPI_DIM)
%EQUATE `MAPI_DIM = 1
#ENDIF
%EQUATE `MAPI_NT_SERVICE = &H00010000 ' /* Provider is being loaded in an NT service */
'/* Simple data types */
'#if !defined (MIDL_PASS) /* MIDL doesn't want to see these */
'#if !defined(_NATIVE_WCHAR_T_DEFINED)
'typedef unsigned short WCHAR;
'#endif
'typedef __nullterminated char FAR * LPSTR;
'typedef __nullterminated const char FAR * LPCSTR;
'typedef __nullterminated WCHAR FAR * LPWSTR;
'typedef __nullterminated const WCHAR FAR * LPCWSTR;
'#ifdef UNICODE
'typedef WCHAR TCHAR;
'typedef LPWSTR LPTSTR;
'typedef LPCWSTR LPCTSTR;
'#else
'typedef char TCHAR;
'typedef LPSTR LPTSTR;
'typedef LPCSTR LPCTSTR;
'#endif
'typedef BYTE FAR * LPBYTE;
'#endif /* defined MIDL_PASS */
'typedef ULONG FAR * LPULONG;
'#ifndef __LHANDLE
'#define __LHANDLE
'typedef ULONG_PTR LHANDLE, FAR * LPLHANDLE;
'#endif
#IF NOT %DEF(%FILETIME_DEFINED)
%EQUATE `FILETIME_DEFINED = 1
' // Size = 8 bytes
TYPE FILETIME_STRUCT DWORD
 dwLowDateTime AS DWORD
 dwHighDateTime AS DWORD
END TYPE
' // To allow to use both DWORD's and a QUAD
' // Size = 8 bytes
UNION FILETIME DWORD
 FILETIME_STRUCT
 qDateTime AS QUAD
END UNION
#ENDIF
'/*
' * This flag is used in many different MAPI calls to signify that
' * the object opened by the call should be modifiable (MAPI_MODIFY).
' * If the flag MAPI_MAX_ACCESS is set, the object returned should be
' * returned at the maximum access level allowed. An additional
' * property available on the object (PR_ACCESS_LEVEL) uses the same
' * MAPI_MODIFY flag to say just what this new access level is.
' */
%EQUATE `MAPI_MODIFY = &H00000001
'/*
' * The following flags are used to indicate to the client what access
' * level is permissible in the object. They appear in PR_ACCESS in
' * message and folder objects as well as in contents and associated
' * contents tables
' */
%EQUATE `MAPI_ACCESS_MODIFY = &H00000001
%EQUATE `MAPI_ACCESS_READ = &H00000002
%EQUATE `MAPI_ACCESS_DELETE = &H00000004
%EQUATE `MAPI_ACCESS_CREATE_HIERARCHY = &H00000008
%EQUATE `MAPI_ACCESS_CREATE_CONTENTS = &H00000010
%EQUATE `MAPI_ACCESS_CREATE_ASSOCIATED = &H00000020
'/*
' * The MAPI_UNICODE flag is used in many different MAPI calls to signify
' * that strings passed through the interface are in Unicode (a 16-bit
' * character set). The default is an 8-bit character set.
' *
' * The value fMapiUnicode can be used as the 'normal' value for
' * that bit, given the application's default character set.
' */
%EQUATE `MAPI_UNICODE = &H80000000
'#ifdef UNICODE
'#define fMapiUnicode MAPI_UNICODE
'#else
'#define fMapiUnicode 0
'#endif
' Change to fMapiUnicode = %MAPI_UNICODE for Unicode version
'%fMapiUnicode = 0 ' // Unicode flag
'#IF %fMapiUnicode
' MACRO LPTSTR = DWORD
'#ELSE
' MACRO LPTSTR = ASCIIZ PTR
'#ENDIF
'/* successful HRESULT */
%EQUATE `hrSuccess = 0
'/* Recipient types */
#IF NOT %DEF(%MAPI_ORIG) ' /* also defined in mapi.h */
%EQUATE `MAPI_ORIG = 0 ' /* Recipient is message originator */
%EQUATE `MAPI_TO = 1 ' /* Recipient is a primary recipient */
%EQUATE `MAPI_CC = 2 ' /* Recipient is a copy recipient */
%EQUATE `MAPI_BCC = 3 ' /* Recipient is blind copy recipient */
%EQUATE `MAPI_P1 = &H10000000 ' /* Recipient is a P1 resend recipient */
%EQUATE `MAPI_SUBMITTED = &H80000000 ' /* Recipient is already processed */
'/* #define MAPI_AUTHORIZE 4 recipient is a CMC authorizing user */
'/*#define MAPI_DISCRETE 0x10000000 Recipient is a P1 resend recipient */
#ENDIF
'/* Bit definitions for abFlags[0] of ENTRYID */
%EQUATE `MAPI_SHORTTERM = &H80
%EQUATE `MAPI_NOTRECIP = &H40
%EQUATE `MAPI_THISSESSION = &H20
%EQUATE `MAPI_NOW = &H10
%EQUATE `MAPI_NOTRESERVED = &H08
'/* Bit definitions for abFlags[1] of ENTRYID */
%EQUATE `MAPI_COMPOUND = &H80
'/* ENTRYID */
' // Size = 5 bytes
TYPE ENTRYID BYTE
 abFlags(3) AS BYTE ' BYTE abFlags[4]
 ab(%MAPI_DIM - 1) AS BYTE ' BYTE ab[MAPI_DIM] [variable-length array]
END TYPE
'/* Byte-order-independent version of GUID (world-unique identifier) */
'typedef struct _MAPIUID
'{
' BYTE ab[16];
'} MAPIUID, * LPMAPIUID;
' // Size = 16 bytes
TYPE MAPIUID BYTE
 ab AS STRING * 16 ' BYTE [array]
END TYPE
'/* Note: need to include C run-times (memory.h) to use this macro */
'#define IsEqualMAPIUID(lpuid1, lpuid2) (!memcmp(lpuid1, lpuid2, sizeof(MAPIUID)))
'/*
' * Constants for one-off entry ID:
' * The MAPIUID that identifies the one-off provider;
' * the flag that defines whether the embedded strings are Unicode;
' * the flag that specifies whether the recipient gets TNEF or not.
' */
$MAPI_ONE_OFF_UID = GUID$("{812B1FA4-BEA3-1019-9D6E-00DD010F5402}")
%EQUATE `MAPI_ONE_OFF_UNICODE = &H8000
%EQUATE `MAPI_ONE_OFF_NO_RICH_INFO = &H0001
'/* Object type */
%EQUATE `MAPI_STORE = &H00000001 '/* Message Store */
%EQUATE `MAPI_ADDRBOOK = &H00000002 '/* Address Book */
%EQUATE `MAPI_FOLDER = &H00000003 '/* Folder */
%EQUATE `MAPI_ABCONT = &H00000004 '/* Address Book Container */
%EQUATE `MAPI_MESSAGE = &H00000005 '/* Message */
%EQUATE `MAPI_MAILUSER = &H00000006 '/* Individual Recipient */
%EQUATE `MAPI_ATTACH = &H00000007 '/* Attachment */
%EQUATE `MAPI_DISTLIST = &H00000008 '/* Distribution List Recipient */
%EQUATE `MAPI_PROFSECT = &H00000009 '/* Profile Section */
%EQUATE `MAPI_STATUS = &H0000000A '/* Status Object */
%EQUATE `MAPI_SESSION = &H0000000B '/* Session */
%EQUATE `MAPI_FORMINFO = &H0000000C '/* Form Information */
'/*
' * Maximum length of profile names and passwords, not including
' * the null termination character.
' */
#IF NOT %DEF(%cchProfileNameMax)
%EQUATE `cchProfileNameMax = 64
%EQUATE `cchProfilePassMax = 64
#ENDIF
'/* Property Types */
%EQUATE `MV_FLAG = &H1000 ' /* Multi-value flag */
%EQUATE `PT_UNSPECIFIED = 0 '/* (Reserved for interface use) type doesn't matter to caller */
%EQUATE `PT_NULL = 1 '/* NULL property value */
%EQUATE `PT_I2 = 2 '/* Signed 16-bit value */
%EQUATE `PT_LONG = 3 '/* Signed 32-bit value */
%EQUATE `PT_R4 = 4 '/* 4-byte floating point */
%EQUATE `PT_DOUBLE = 5 '/* Floating point double */
%EQUATE `PT_CURRENCY = 6 '/* Signed 64-bit int (decimal w/ 4 digits right of decimal pt) */
%EQUATE `PT_APPTIME = 7 '/* Application time */
%EQUATE `PT_ERROR = 10 '/* 32-bit error value */
%EQUATE `PT_BOOLEAN = 11 '/* 16-bit boolean (non-zero true) */
%EQUATE `PT_OBJECT = 13 '/* Embedded object in a property */
%EQUATE `PT_I8 = 20 '/* 8-byte signed integer */
%EQUATE `PT_STRING8 = 30 '/* Null terminated 8-bit character string */
%EQUATE `PT_UNICODE = 31 '/* Null terminated Unicode string */
%EQUATE `PT_SYSTIME = 64 '/* FILETIME 64-bit int w/ number of 100ns periods since Jan 1,1601 */
%EQUATE `PT_CLSID = 72 '/* OLE GUID */
%EQUATE `PT_BINARY = 258 '/* Uninterpreted (counted byte array) */
'/* Changes are likely to these numbers, and to their structures. */
'/* Alternate property type names for ease of use */
%EQUATE `PT_SHORT = %PT_I2
%EQUATE `PT_I4 = %PT_LONG
%EQUATE `PT_FLOAT = %PT_R4
%EQUATE `PT_R8 = %PT_DOUBLE
%EQUATE `PT_LONGLONG = %PT_I8
'/*
' * The type of a MAPI-defined string property is indirected, so
' * that it defaults to Unicode string on a Unicode platform and to
' * String8 on an ANSI or DBCS platform.
' *
' * Macros are defined here both for the property type, and for the
' * field of the property value structure which should be
' * dereferenced to obtain the string pointer.
' */
'#ifdef UNICODE
'#define PT_TSTRING PT_UNICODE
'#define PT_MV_TSTRING (MV_FLAG|PT_UNICODE)
'#define LPSZ lpszW
'#define LPPSZ lppszW
'#define MVSZ MVszW
'#else
'#define PT_TSTRING PT_STRING8
'#define PT_MV_TSTRING (MV_FLAG|PT_STRING8)
'#define LPSZ lpszA
'#define LPPSZ lppszA
'#define MVSZ MVszA
'#endif
'#IF %fMapiUnicode
' %PT_TSTRING = %PT_UNICODE
' %PT_MV_TSTRING = %MV_FLAG OR %PT_UNICODE
'#ELSE
' %PT_TSTRING = %PT_STRING8
' %PT_MV_TSTRING = %MV_FLAG OR %PT_STRING8
'#ENDIF
'/* Property Tags
' *
' * By convention, MAPI never uses 0 or FFFF as a property ID.
' * Use as null values, initializers, sentinels, or what have you.
' */
%EQUATE `PROP_TYPE_MASK = &H0000FFFF ' /* Mask for Property type */
'#define PROP_TYPE(ulPropTag) (((ULONG)(ulPropTag))&PROP_TYPE_MASK)
FUNCTION PROP_TYPE (BYVAL ulPropTag AS DWORD) AS DWORD
 FUNCTION = ulPropTag AND %PROP_TYPE_MASK
END FUNCTION
'#define PROP_ID(ulPropTag) (((ULONG)(ulPropTag))>>16)
FUNCTION PROP_ID (BYVAL ulPropTag AS DWORD) AS DWORD
 SHIFT RIGHT ulPropTag, 16
 FUNCTION = ulPropTag
END FUNCTION
'#define PROP_TAG(ulPropType,ulPropID) ((((ULONG)(ulPropID))<<16)|((ULONG)(ulPropType)))
FUNCTION PROP_TAG (BYVAL ulPropType AS DWORD, BYVAL ulPropID AS DWORD) AS DWORD
 SHIFT LEFT ulPropID, 16
 FUNCTION = ulPropID OR ulPropType
END FUNCTION
%EQUATE `PROP_ID_NULL = 0
%EQUATE `PROP_ID_INVALID = &HFFFF
'#define PR_NULL PROP_TAG( PT_NULL, PROP_ID_NULL)
'MACRO PR_NULL = PROP_TAG(%PT_NULL, %PROP_ID_NULL)
%EQUATE `PR_NULL = 1
'#define CHANGE_PROP_TYPE(ulPropTag, ulPropType) \
' (((ULONG)0xFFFF0000 & ulPropTag) | ulPropType)
FUNCTION CHANGE_PROP_TYPE (BYVAL ulPropTag AS DWORD, BYVAL ulPropType AS DWORD) AS DWORD
 ulPropTag = &HFFFF0000 AND ulPropTag
 FUNCTION = ulPropTag OR ulPropType
END FUNCTION
'/* Multi-valued Property Types */
%EQUATE `PT_MV_I2 = %MV_FLAG OR %PT_I2
%EQUATE `PT_MV_LONG = %MV_FLAG OR %PT_LONG
%EQUATE `PT_MV_R4 = %MV_FLAG OR %PT_R4
%EQUATE `PT_MV_DOUBLE = %MV_FLAG OR %PT_DOUBLE
%EQUATE `PT_MV_CURRENCY = %MV_FLAG OR %PT_CURRENCY
%EQUATE `PT_MV_APPTIME = %MV_FLAG OR %PT_APPTIME
%EQUATE `PT_MV_SYSTIME = %MV_FLAG OR %PT_SYSTIME
%EQUATE `PT_MV_STRING8 = %MV_FLAG OR %PT_STRING8
%EQUATE `PT_MV_BINARY = %MV_FLAG OR %PT_BINARY
%EQUATE `PT_MV_UNICODE = %MV_FLAG OR %PT_UNICODE
%EQUATE `PT_MV_CLSID = %MV_FLAG OR %PT_CLSID
%EQUATE `PT_MV_I8 = %MV_FLAG OR %PT_I8
'/* Alternate property type names for ease of use */
%EQUATE `PT_MV_SHORT = %PT_MV_I2
%EQUATE `PT_MV_I4 = %PT_MV_LONG
%EQUATE `PT_MV_FLOAT = %PT_MV_R4
%EQUATE `PT_MV_R8 = %PT_MV_DOUBLE
%EQUATE `PT_MV_LONGLONG = %PT_MV_I8
'/*
' * Property type reserved bits
' *
' * MV_INSTANCE is used as a flag in table operations to request
' * that a multi-valued property be presented as a single-valued
' * property appearing in multiple rows.
' */
%EQUATE `MV_INSTANCE = &H2000
%EQUATE `MVI_FLAG = %MV_FLAG OR %MV_INSTANCE
'#define MVI_PROP(tag) ((tag) | MVI_FLAG)
FUNCTION MVI_PROP (BYVAL tag AS DWORD) AS DWORD
 FUNCTION = tag OR %MVI_FLAG
END FUNCTION
'/* --------------- */
'/* Data Structures */
'/* --------------- */
'/* Property Tag Array */
' // Size = 8 bytes
TYPE SPropTagArray DWORD
 cValues AS DWORD ' ULONG
 aulPropTag(%MAPI_DIM - 1) AS DWORD ' ULONG [variable-length array]
END TYPE
'/* -------------- */
'/* Property Value */
'/* -------------- */
'typedef struct _SPropValue SPropValue;
'/* 32-bit CURRENCY definition stolen from oaidl.h */
'/* 16-bit CURRENCY definition stolen from variant.h */
'#ifndef _tagCY_DEFINED
'#define _tagCY_DEFINED
'#define _CY_DEFINED
'#if (defined (WIN16) || defined (DOS)) && !defined (_VARIANT_H_)
'typedef struct FARSTRUCT tagCY {
'#ifdef _MAC
' long Hi;
' long Lo;
'#else
' unsigned long Lo;
' long Hi;
'#endif
'} CY;
'#elif defined (_WIN32)
'/* real definition that makes the C++ compiler happy */
'typedef union tagCY {
' struct {
'#ifdef _MAC
' long Hi;
' long Lo;
'#else
' unsigned long Lo;
' long Hi;
'#endif
' };
' LONGLONG int64;
'} CY;
'#endif /* 16-bit vs 32-bit definition */
'#endif
' /* size is 8 */
'typedef CY CURRENCY;
#IF NOT %DEF(%CY_DEFINED)
 %CY_DEFINED = 1
TYPE tagCY_STRUCT
 Lo AS DWORD
 Hi AS LONG
END TYPE
UNION tagCY
 tagCY_STRUCT
 int64 AS QUAD
END UNION
MACRO tagCURRENCY_DEFINED = tagCY
#ENDIF
' // Size = 8 bytes
TYPE SBinary DWORD
 cb AS DWORD ' ULONG
 lpb AS BYTE PTR
END TYPE
' // Size = 8 bytes
TYPE SShortArray DWORD
 cValues AS DWORD ' ULONG
 lpi AS INTEGER PTR ' short int *
END TYPE
' // Size = 8 bytes
TYPE SGuidArray DWORD
 cValues AS DWORD ' ULONG
 lpguid AS GUID PTR ' GUID *
END TYPE
' // Size = 8 bytes
TYPE SRealArray DWORD
 cValues AS DWORD ' ULONG
 lpflt AS SINGLE PTR ' float *
END TYPE
' // Size = 8 bytes
TYPE SLongArray DWORD
 cValues AS DWORD ' ULONG
 lpl AS LONG PTR ' LONG *
END TYPE
' // Size = 8 bytes
TYPE SLargeIntegerArray DWORD
 cValues AS DWORD ' ULONG
 lpli AS QUAD PTR ' LARGE_INTEGER *
END TYPE
' // Size = 8 bytes
TYPE SDateTimeArray DWORD
 cValues AS DWORD ' ULONG
 lpft AS FILETIME PTR ' FILETIME *
END TYPE
' // Size = 8 bytes
TYPE SAppTimeArray DWORD
 cValues AS DWORD ' ULONG
 lpat AS DOUBLE PTR ' double *
END TYPE
' // Size = 8 bytes
TYPE SCurrencyArray DWORD
 cValues AS DWORD ' ULONG
 lpcur AS CUR PTR ' CURRENCY *
END TYPE
' // Size = 8 bytes
TYPE SBinaryArray DWORD
 cValues AS DWORD ' ULONG
 lpbin AS SBinary PTR ' SBinary *
END TYPE
' // Size = 8 bytes
TYPE SDoubleArray DWORD
 cValues AS DWORD ' ULONG
 lpdbl AS DOUBLE PTR ' double *
END TYPE
' // Size = 8 bytes
TYPE SWStringArray DWORD
 cValues AS DWORD ' ULONG
 lppszW AS DWORD ' LPWSTR * (unicode)
END TYPE
' // Size = 8 bytes
TYPE SLPSTRArray DWORD
 cValues AS DWORD ' ULONG
 lppszA AS ASCIIZ PTR ' LPSTR *
END TYPE
'typedef union _PV
'{
' short int i; /* case PT_I2 */
' LONG l; /* case PT_LONG */
' ULONG ul; /* alias for PT_LONG */
' float flt; /* case PT_R4 */
' double dbl; /* case PT_DOUBLE */
' unsigned short int b; /* case PT_BOOLEAN */
' CURRENCY cur; /* case PT_CURRENCY */
' double at; /* case PT_APPTIME */
' FILETIME ft; /* case PT_SYSTIME */
' LPSTR lpszA; /* case PT_STRING8 */
' SBinary bin; /* case PT_BINARY */
' LPWSTR lpszW; /* case PT_UNICODE */
' LPGUID lpguid; /* case PT_CLSID */
' LARGE_INTEGER li; /* case PT_I8 */
' SShortArray MVi; /* case PT_MV_I2 */
' SLongArray MVl; /* case PT_MV_LONG */
' SRealArray MVflt; /* case PT_MV_R4 */
' SDoubleArray MVdbl; /* case PT_MV_DOUBLE */
' SCurrencyArray MVcur; /* case PT_MV_CURRENCY */
' SAppTimeArray MVat; /* case PT_MV_APPTIME */
' SDateTimeArray MVft; /* case PT_MV_SYSTIME */
' SBinaryArray MVbin; /* case PT_MV_BINARY */
' SLPSTRArray MVszA; /* case PT_MV_STRING8 */
' SWStringArray MVszW; /* case PT_MV_UNICODE */
' SGuidArray MVguid; /* case PT_MV_CLSID */
' SLargeIntegerArray MVli; /* case PT_MV_I8 */
' SCODE err; /* case PT_ERROR */
' LONG x; /* case PT_NULL, PT_OBJECT (no usable value) */
'} __UPV;
'typedef struct _SPropValue
'{
' ULONG ulPropTag;
' ULONG dwAlignPad;
' union _PV Value;
'} SPropValue, * LPSPropValue;
' // Size = 8 bytes
UNION SPropValue_UNION
 i AS INTEGER ' short int
 l AS LONG
 ul AS DWORD ' ULONG
 flt AS SINGLE ' float
 dbl AS DOUBLE ' double
 b AS WORD ' unsigned short int
 cur AS CUR ' CURRENCY
 at AS DOUBLE ' double
 ft AS FILETIME ' FILETIME
 lpszA AS ASCIIZ PTR
 bin AS SBinary ' byte [array]
 lpszW AS WSTRINGZ PTR
 lpguid AS GUID PTR
 li AS QUAD ' LARGE_INTEGER
 MVi AS SShortArray ' SShortArray
 MVl AS SLongArray ' SLongArray
 MVflt AS SRealArray ' SRealArray
 MVdbl AS SDoubleArray ' SDoubleArray
 MVcur AS SCurrencyArray ' SCurrencyArray
 MVat AS SAppTimeArray ' SAppTimeArray
 MVft AS SDateTimeArray ' SDateTimeArray
 MVbin AS SBinaryArray ' SBinaryArray
 MVszA AS SLPSTRArray ' SLPSTRArray
 MVszW AS SWStringArray ' SWStringArray
 MVguid AS SGuidArray ' SGuidArray
 MVli AS SLargeIntegerArray ' SLargeIntegerArray
 err AS DWORD ' SCODE
 x AS LONG
END UNION
' // Size = 16 bytes
TYPE SPropValue DWORD
 ulPropTag AS DWORD ' ULONG
 dwAlignPad AS DWORD ' ULONG
 Value AS SPropValue_UNION
END TYPE
'/* --------------------------------------------- */
'/* Property Problem and Property Problem Arrays */
'/* --------------------------------------------- */
' // Size = 12 bytes
TYPE SPropProblem DWORD
 ulIndex AS DWORD ' ULONG
 ulPropTag AS DWORD ' ULONG
 scode AS LONG ' SCODE
END TYPE
'typedef struct _SPropProblemArray
'{
' ULONG cProblem;
' SPropProblem aProblem[MAPI_DIM];
'} SPropProblemArray, * LPSPropProblemArray;
' // Size = 16 bytes
TYPE SPropProblemArray DWORD
 cProblem AS DWORD ' ULONG
 aProblem(%MAPI_DIM - 1) AS SPropProblem ' SPropProblem [variable-length array]
END TYPE
'/*
' * ENTRYLIST
' */
'typedef SBinaryArray ENTRYLIST, *LPENTRYLIST;
' // Size = 8 bytes
TYPE ENTRYLIST DWORD
 cValues AS DWORD ' ULONG
 lpbin AS SBinary PTR ' SBinary *
END TYPE
'/*
' * FLATENTRYLIST
' * MTSID
' * FLATMTSIDLIST
' */
' // Size = 8 bytes
TYPE FLATENTRY DWORD
 cb AS DWORD ' ULONG
 abEntry(%MAPI_DIM - 1) AS BYTE ' BYTE [variable-length array]
END TYPE
' // Size = 12 bytes
TYPE FLATENTRYLIST DWORD
 cEntries AS DWORD ' ULONG
 cbEntries AS DWORD ' ULONG
 abEntries(%MAPI_DIM - 1) AS BYTE ' BYTE [variable-length array]
END TYPE
' // Size = 8 bytes
TYPE MTSID DWORD
 cb AS DWORD ' ULONG
 ab(%MAPI_DIM - 1) AS BYTE ' BYTE [variable-length array]
END TYPE
' // Size = 12 bytes
TYPE FLATMTSIDLIST DWORD
 cMTSIDs AS DWORD ' ULONG
 cbMTSIDs AS DWORD ' ULONG
 abMTSIDs(%MAPI_DIM - 1) AS BYTE ' BYTE [variable-length array]
END TYPE
'/* ------------------------------ */
'/* ADRENTRY, ADRLIST */
' // Size = 12 bytes
TYPE ADRENTRY DWORD
 ulReserved1 AS DWORD ' ULONG
 cValues AS DWORD ' ULONG
 rgPropVals AS SPropValue PTR ' LPSPropValue
END TYPE
' // Size = 16 bytes
TYPE ADRLIST DWORD
 cEntries AS DWORD ' ULONG
 aEntries(%MAPI_DIM - 1) AS ADRENTRY ' ADRENTRY [variable-length array]
END TYPE
'/* ------------------------------ */
'/* SRow, SRowSet */
' // Size = 12 bytes
TYPE SRow DWORD
 ulAdrEntryPad AS DWORD ' ULONG ' /* Pad so SRow's can map to ADRENTRY's */
 cValues AS DWORD ' ULONG ' /* Count of property values */
 lpProps AS SPropValue PTR ' LPSPropValue ' /* Property value array */
END TYPE
' // Size = 16 bytes
TYPE SRowSet DWORD
 cRows AS DWORD ' ULONG
 aRow(%MAPI_DIM - 1) AS SRow ' SRow [variable-length array]
END TYPE
'/* MAPI Allocation Routines ------------------------------------------------ */
'typedef SCODE (STDMETHODCALLTYPE ALLOCATEBUFFER)(
' ULONG cbSize,
' LPVOID * lppBuffer
');
'typedef SCODE (STDMETHODCALLTYPE ALLOCATEMORE)(
' ULONG cbSize,
' LPVOID lpObject,
' LPVOID * lppBuffer
');
'typedef ULONG (STDAPICALLTYPE FREEBUFFER)(
' LPVOID lpBuffer
');
'/* Extended MAPI Error Information ----------------------------------------- */
' // Size = 20 bytes
TYPE MAPIERROR DWORD
 ulVersion AS DWORD ' ULONG
 lpszError AS ASCIIZ PTR
 lpszComponent AS ASCIIZ PTR
 ulLowLevelError AS DWORD ' ULONG
 ulContext AS DWORD ' ULONG
END TYPE
'/* IMAPIAdviseSink Interface ----------------------------------------------- */
'/*
' * Notification event types. The event types can be combined in a bitmask
' * for filtering. Each one has a parameter structure associated with it:
' *
' * fnevCriticalError ERROR_NOTIFICATION
' * fnevNewMail NEWMAIL_NOTIFICATION
' * fnevObjectCreated OBJECT_NOTIFICATION
' * fnevObjectDeleted OBJECT_NOTIFICATION
' * fnevObjectModified OBJECT_NOTIFICATION
' * fnevObjectCopied OBJECT_NOTIFICATION
' * fnevSearchComplete OBJECT_NOTIFICATION
' * fnevTableModified TABLE_NOTIFICATION
' * fnevStatusObjectModified ?
' *
' * fnevExtended EXTENDED_NOTIFICATION
' */
%EQUATE `fnevCriticalError = &H00000001
%EQUATE `fnevNewMail = &H00000002
%EQUATE `fnevObjectCreated = &H00000004
%EQUATE `fnevObjectDeleted = &H00000008
%EQUATE `fnevObjectModified = &H00000010
%EQUATE `fnevObjectMoved = &H00000020
%EQUATE `fnevObjectCopied = &H00000040
%EQUATE `fnevSearchComplete = &H00000080
%EQUATE `fnevTableModified = &H00000100
%EQUATE `fnevStatusObjectModified = &H00000200
%EQUATE `fnevReservedForMapi = &H40000000
%EQUATE `fnevExtended = &H80000000
'/* TABLE_NOTIFICATION event types passed in ulTableEvent */
%EQUATE `TABLE_CHANGED = 1
%EQUATE `TABLE_ERROR = 2
%EQUATE `TABLE_ROW_ADDED = 3
%EQUATE `TABLE_ROW_DELETED = 4
%EQUATE `TABLE_ROW_MODIFIED = 5
%EQUATE `TABLE_SORT_DONE = 6
%EQUATE `TABLE_RESTRICT_DONE = 7
%EQUATE `TABLE_SETCOL_DONE = 8
%EQUATE `TABLE_RELOAD = 9
'/* Event Structures */
' // Size = 20 bytes
TYPE ERROR_NOTIFICATION DWORD
 cbEntryID AS DWORD ' ULONG
 lpEntryID AS ENTRYID PTR
 scode AS LONG ' SCODE
 ulFlags AS DWORD ' ULONG
 lpMAPIError AS MAPIERROR PTR
END TYPE
' // Size = 28 bytes
TYPE NEWMAIL_NOTIFICATION DWORD
 cbEntryID AS DWORD ' ULONG
 lpEntryID AS ENTRYID PTR
 cbParentID AS DWORD ' ULONG
 lpParentID AS ENTRYID PTR
 ulFlags AS DWORD ' ULONG
 lpszMessageClass AS ASCIIZ PTR
 ulMessageFlags AS DWORD ' ULONG
END TYPE
' // Size = 40 bytes
TYPE OBJECT_NOTIFICATION DWORD
 cbEntryID AS DWORD ' ULONG
 lpEntryID AS ENTRYID PTR
 ulObjType AS DWORD ' ULONG
 cbParentID AS DWORD ' ULONG
 lpParentID AS ENTRYID PTR
 cbOldID AS DWORD ' ULONG
 lpOldID AS ENTRYID PTR
 cbOldParentID AS DWORD ' ULONG
 lpOldParentID AS ENTRYID PTR
 lpPropTagArray AS SPropTagArray PTR ' LPSPropTagArray
END TYPE
' // Size = 56 bytes
TYPE TABLE_NOTIFICATION DWORD
 ulTableEvent AS DWORD ' ULONG
 hResult AS LONG
 propIndex AS SPropValue ' SPropValue
 propPrior AS SPropValue ' SPropValue
 row AS SRow ' SRow
 ulPad AS DWORD ' ULONG /* Force to 8-byte boundary */
END TYPE
' // Size = 12 bytes
TYPE EXTENDED_NOTIFICATION DWORD
 ulEvent AS DWORD ' ULONG
 cb AS DWORD ' ULONG
 pbEventParameters AS BYTE PTR
END TYPE
' // Size = 16 bytes
TYPE STATUS_OBJECT_NOTIFICATION
 cbEntryID AS DWORD ' ULONG
 lpEntryID AS ENTRYID PTR
 cValues AS DWORD ' ULONG
 lpPropVals AS SPropValue PTR ' LPSPropValue [array]
END TYPE
'typedef struct _NOTIFICATION
'{
' ULONG ulEventType; /* notification type, i.e. fnevSomething */
' ULONG ulAlignPad; /* Force to 8-byte boundary */
' union
' {
' ERROR_NOTIFICATION err;
' NEWMAIL_NOTIFICATION newmail;
' OBJECT_NOTIFICATION obj;
' TABLE_NOTIFICATION tab;
' EXTENDED_NOTIFICATION ext;
' STATUS_OBJECT_NOTIFICATION statobj;
' } info;
'} NOTIFICATION, * LPNOTIFICATION;
' // Size = 56 bytes
UNION NOTIFICATION_UNION
 err AS ERROR_NOTIFICATION
 newmail AS NEWMAIL_NOTIFICATION
 obj AS OBJECT_NOTIFICATION
 tab AS TABLE_NOTIFICATION
 ext AS EXTENDED_NOTIFICATION
 statobj AS STATUS_OBJECT_NOTIFICATION
END UNION
' // Size = 64 bytes
TYPE NOTIFICATION ' Must be 8 byte aligned
 ulEventType AS DWORD ' ULONG
 ulAlignPad AS DWORD ' ULONG /* Force to 8-byte boundary *
 info AS NOTIFICATION_UNION
END TYPE
'/* Interface used for registering and issuing notification callbacks. */
' ########################################################################################
' Interface name = IMAPIAdviseSink
' IID = {00020302-0000-0000-C000-000000000046}
' Inherited interface = IUnknown
' ########################################################################################
INTERFACE IMAPIAdviseSink $IID_IMAPIAdviseSink
 INHERIT IUnknown
 ' =====================================================================================
 METHOD OnNotify ( ' VTable offset = 12
 BYVAL cNotif AS DWORD
 , BYREF lpNotifications AS NOTIFICATION
 ) AS DWORD ' ULONG
 ' =====================================================================================
END INTERFACE
'/* Callback function type for MAPIAllocAdviseSink */
'typedef long (STDAPICALLTYPE NOTIFCALLBACK) (
' LPVOID lpvContext,
' ULONG cNotification,
' LPNOTIFICATION lpNotifications);
'typedef NOTIFCALLBACK * LPNOTIFCALLBACK;
'FUNCTION NOTIFCALLBACK ( ' BYVAL DWORD ' LPVOID lpvContext
' , BYVAL DWORD ' ULONG cNotification
' , BYREF NOTIFICATION ' LPNOTIFICATION lpNotifications
' ) AS LONG ' long
'/*
' * Message name for the 16-bit MAPI notififcation engine.
' * This can be used in 16-bit applications to force processing
' * of notification callbacks.
' */
$szMAPINotificationMsg = "MAPI Notify window message"
'/* IMAPIProgress Interface ------------------------------------------------- */
'/* Flag values for the progress indicator */
%EQUATE `MAPI_TOP_LEVEL = &H00000001
' ########################################################################################
' Interface name = IMAPIProgress
' IID = {0002031F-0000-0000-C000-000000000046}
' Inherited interface = IUnknown
' ########################################################################################
INTERFACE IMAPIProgress $IID_IMAPIProgress
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Progress ( ' VTable offset = 12
 BYVAL ulValue AS DWORD
 , BYVAL ulCount AS DWORD
 , BYVAL ulTotal AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetFlags ( ' VTable offset = 16
 BYREF lpulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetMax ( ' VTable offset = 20
 BYREF lpulMax AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetMin ( ' VTable offset = 24
 BYREF lpulMin AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetLimits ( ' VTable offset = 28
 BYREF lpulMin AS DWORD
 , BYREF lpulMax AS DWORD
 , BYREF lpulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IMAPIProp Interface ----------------------------------------------------- */
'/* GetLastError */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/*
' * Version:
' */
%EQUATE `MAPI_ERROR_VERSION = &H00000000&
'/* GetPropList */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/* GetProps */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/* SaveChanges */
%EQUATE `KEEP_OPEN_READONLY = &H00000001
%EQUATE `KEEP_OPEN_READWRITE = &H00000002
%EQUATE `FORCE_SAVE = &H00000004
'/* define MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
'/* OpenProperty - ulFlags */
'/****** MAPI_MODIFY ((ULONG) 0x00000001) above */
%EQUATE `MAPI_CREATE = &H00000002
%EQUATE `STREAM_APPEND = &H00000004
'/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
'/* OpenProperty - ulInterfaceOptions, IID_IMAPITable */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/* CopyTo, CopyProps */
%EQUATE `MAPI_MOVE = &H00000001
%EQUATE `MAPI_NOREPLACE = &H00000002
%EQUATE `MAPI_DECLINE_OK = &H00000004
#IF NOT %DEF(%MAPI_DIALOG) ' /* also defined in mapi.h */
%EQUATE `MAPI_DIALOG = &H00000008
#ENDIF
#IF NOT %DEF(%MAPI_USE_DEFAULT) ' /* also defined in mapi.h */
%EQUATE `MAPI_USE_DEFAULT = &H00000040 ' /* Use default profile in logon */
#ENDIF
'/* Flags used in GetIDsFromNames */
'/****** MAPI_CREATE ((ULONG) 0x00000002) above */
'/* Flags used in GetNamesFromIDs (bit fields) */
%EQUATE `MAPI_NO_STRINGS = &H00000001
%EQUATE `MAPI_NO_IDS = &H00000002
'/* Union discriminator */
%EQUATE `MNID_ID = 0
%EQUATE `MNID_STRING = 1
'typedef struct _MAPINAMEID
'{
' LPGUID lpguid;
' ULONG ulKind;
' union {
' LONG lID;
' LPWSTR lpwstrName;
' } Kind;
'} MAPINAMEID, * LPMAPINAMEID;
' // Size = 4 bytes
UNION MAPINAMEID_UNION
 lID AS LONG
 lpwstrName AS WSTRINGZ PTR ' LPWSTR (unicode)
END UNION
' // Size = 12 bytes
TYPE MAPINAMEID DWORD
 lpguid AS GUID PTR
 ulKind AS DWORD ' ULONG
 Kind AS MAPINAMEID_UNION
END TYPE
' ========================================================================================
' IMAPIProp interface
' $IID_IMAPIProp = GUID$("{00020303-0000-0000-C000-000000000046}")
' The IMAPIProp interface is implemented by all objects that support properties. It is
' used by clients, service providers, and MAPI to work with properties.
' ========================================================================================
INTERFACE IMAPIProp $IID_IMAPIProp
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveChanges ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProps ( ' VTable offser = 20
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPropList ( ' VTable offser = 24
 BYVAL ulFlags AS DWORD
 , BYREF lppPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProperty ( ' VTable offser = 28
 BYVAL ulPropTag AS DWORD
 , BYREF lpiid AS GUID
 , BYVAL ulInterfaceOptions AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetProps ( ' VTable offser = 32
 BYVAL cValues AS DWORD
 , BYVAL lpPropArray AS SPropValue PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProps ( ' VTable offser = 36
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyTo ( ' VTable offser = 40
 BYVAL ciidExclude AS DWORD
 , BYREF rgiidExclude AS GUID
 , BYVAL lpExcludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProps ( ' VTable offser = 44
 BYVAL lpIncludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetNamesFromIDs ( ' VTable offser = 48
 BYVAL lppPropTags AS SPropTagArray PTR
 , BYREF lpPropSetGuid AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpcPropNames AS DWORD
 , BYREF lpppPropNames AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIDsFromNames ( ' VTable offser = 52
 BYVAL cPropNames AS DWORD
 , BYVAL lppPropNames AS MAPINAMEID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lppPropTags AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IMAPITable Interface ---------------------------------------------------- */
'/* Table status */
%EQUATE `TBLSTAT_COMPLETE = 0
%EQUATE `TBLSTAT_QCHANGED = 7
%EQUATE `TBLSTAT_SORTING = 9
%EQUATE `TBLSTAT_SORT_ERROR = 10
%EQUATE `TBLSTAT_SETTING_COLS = 11
%EQUATE `TBLSTAT_SETCOL_ERROR = 13
%EQUATE `TBLSTAT_RESTRICTING = 14
%EQUATE `TBLSTAT_RESTRICT_ERROR = 15
'/* Table Type */
%EQUATE `TBLTYPE_SNAPSHOT = 0
%EQUATE `TBLTYPE_KEYSET = 1
%EQUATE `TBLTYPE_DYNAMIC = 2
'/* Sort order */
'/* bit 0: set if descending, clear if ascending */
%EQUATE `TABLE_SORT_ASCEND = &H00000000
%EQUATE `TABLE_SORT_DESCEND = &H00000001
%EQUATE `TABLE_SORT_COMBINE = &H00000002
'/* Data structures */
' // Size = 8 bytes
TYPE SSortOrder DWORD
 ulPropTag AS DWORD ' ULONG /* Column to sort on */
 ulOrder AS DWORD ' ULONG /* Ascending, descending, combine to left */
END TYPE
' // Size = 20 bytes
TYPE SSortOrderSet DWORD
 cSorts AS DWORD ' ULONG /* Number of sort columns in aSort below*/
 cCategories AS DWORD ' ULONG /* 0 for non-categorized, up to cSorts */
 cExpanded AS DWORD ' ULONG /* 0 if no categories start expanded, up to cExpanded */
 aSort(%MAPI_DIM - 1) AS SSortOrder ' SSortOrder [variable-length array] /* The sort orders */
END TYPE
'typedef ULONG BOOKMARK;
%EQUATE `BOOKMARK_BEGINNING = 0 ' /* Before first row */
%EQUATE `BOOKMARK_CURRENT = 1 ' /* Before current row */
%EQUATE `BOOKMARK_END = 2 ' /* After last row */
'/* Fuzzy Level */
%EQUATE `FL_FULLSTRING = &H00000000
%EQUATE `FL_SUBSTRING = &H00000001
%EQUATE `FL_PREFIX = &H00000002
%EQUATE `FL_IGNORECASE = &H00010000
%EQUATE `FL_IGNORENONSPACE = &H00020000
%EQUATE `FL_LOOSE = &H00040000
'/* Restrictions */
'/* Restriction types */
%EQUATE `RES_AND = &H00000000
%EQUATE `RES_OR = &H00000001
%EQUATE `RES_NOT = &H00000002
%EQUATE `RES_CONTENT = &H00000003
%EQUATE `RES_PROPERTY = &H00000004
%EQUATE `RES_COMPAREPROPS = &H00000005
%EQUATE `RES_BITMASK = &H00000006
%EQUATE `RES_SIZE = &H00000007
%EQUATE `RES_EXIST = &H00000008
%EQUATE `RES_SUBRESTRICTION = &H00000009
%EQUATE `RES_COMMENT = &H0000000A
'/* Relational operators. These apply to all property comparison restrictions. */
%EQUATE `RELOP_LT = 0 ' /* < */
%EQUATE `RELOP_LE = 1 ' /* <= */
%EQUATE `RELOP_GT = 2 ' /* > */
%EQUATE `RELOP_GE = 3 ' /* >= */
%EQUATE `RELOP_EQ = 4 ' /* == */
%EQUATE `RELOP_NE = 5 ' /* != */
%EQUATE `RELOP_RE = 6 ' /* LIKE (Regular expression) */
'/* Bitmask operators, for RES_BITMASK only. */
%EQUATE `BMR_EQZ = 0 ' /* ==0 */
%EQUATE `BMR_NEZ = 1 ' /* !=0 */
'/* Subobject identifiers for RES_SUBRESTRICTION only. See MAPITAGS.H. */
'/* #define PR_MESSAGE_RECIPIENTS PROP_TAG(PT_OBJECT,0x0E12) */
'/* #define PR_MESSAGE_ATTACHMENTS PROP_TAG(PT_OBJECT,0x0E13) */
' // Size = 8 bytes
TYPE SAndRestriction DWORD
 cRes AS DWORD ' ULONG
 lpRes AS DWORD ' LPSRestriction [array]
END TYPE
' // Size = 8 bytes
TYPE SOrRestriction DWORD
 cRes AS DWORD ' ULONG
 lpRes AS DWORD ' LPSRestriction
END TYPE
' // Size = 8 bytes
TYPE SNotRestriction DWORD
 ulReserved AS DWORD ' ULONG
 lpRes AS DWORD ' LPSRestriction
END TYPE
' // Size = 12 bytes
TYPE SContentRestriction DWORD
 ulFuzzyLevel AS DWORD ' ULONG
 ulPropTag AS DWORD ' ULONG
 lpProp AS SPropValue PTR ' LPSPropValue
END TYPE
' // Size = 12 bytes
TYPE SBitMaskRestriction DWORD
 relBMR AS DWORD ' ULONG
 ulPropTag AS DWORD ' PT_LONG
 ulMask AS DWORD ' ULONG
END TYPE
' // Size = 12 bytes
TYPE SPropertyRestriction DWORD
 relop AS DWORD ' ULONG
 ulPropTag AS DWORD ' ULONG
 lpProp AS SPropValue PTR ' LPSPropValue
END TYPE
' // Size = 12 bytes
TYPE SComparePropsRestriction DWORD
 relop AS DWORD ' ULONG
 ulPropTag1 AS DWORD ' ULONG
 ulPropTag2 AS DWORD ' ULONG
END TYPE
' // Size = 12 bytes
TYPE SSizeRestriction DWORD
 relop AS DWORD ' ULONG
 ulPropTag AS DWORD ' ULONG
 cb AS DWORD ' ULONG
END TYPE
' // Size = 12 bytes
TYPE SExistRestriction DWORD
 ulReserved1 AS DWORD ' ULONG
 ulPropTag AS DWORD ' ULONG
 ulReserved2 AS DWORD ' ULONG
END TYPE
' // Size = 8 bytes
TYPE SSubRestriction DWORD
 ulSubObject AS DWORD ' ULONG
 lpRes AS DWORD ' LPSRestriction
END TYPE
' // Size = 12 bytes
TYPE SCommentRestriction DWORD
 cValues AS DWORD ' ULONG
 lpRes AS DWORD ' LPSRestriction
 lpProp AS DWORD ' LPSPropValue [array]
END TYPE
' // Size = 12 bytes
UNION SRestriction_UNION
 resCompareProps AS SComparePropsRestriction
 resAnd AS SAndRestriction
 resOr AS SOrRestriction
 resNot AS SNotRestriction
 resContent AS SContentRestriction
 resProperty AS SPropertyRestriction
 resBitMask AS SBitMaskRestriction
 resSize AS SSizeRestriction
 resExist AS SExistRestriction
 resSub AS SSubRestriction
 resComment AS SCommentRestriction
END UNION
' // Size = 16 bytes
TYPE SRestriction DWORD
 rt AS DWORD ' ULONG /* Restriction type */
 res AS SRestriction_UNION
END TYPE
'/* SComparePropsRestriction is first in the union so that */
'/* static initializations of 3-value restriction work. */
'/* Flags of the methods of IMAPITable */
'/* QueryColumn */
%EQUATE `TBL_ALL_COLUMNS = &H00000001
'/* QueryRows */
'/* Possible values for PR_ROW_TYPE (for categorization) */
%EQUATE `TBL_LEAF_ROW = 1
%EQUATE `TBL_EMPTY_CATEGORY = 2
%EQUATE `TBL_EXPANDED_CATEGORY = 3
%EQUATE `TBL_COLLAPSED_CATEGORY = 4
'/* Table wait flag */
%EQUATE `TBL_NOWAIT = &H00000001
'/* alternative name for TBL_NOWAIT */
%EQUATE `TBL_ASYNC = &H00000001
%EQUATE `TBL_BATCH = &H00000002
'/* FindRow */
%EQUATE `DIR_BACKWARD = &H00000001
'/* Table cursor states */
%EQUATE `TBL_NOADVANCE = &H00000001
' ========================================================================================
' IMAPITable interface
' $IID_IMAPITable = GUID$("{00020301-0000-0000-C000-000000000046}")
' The IMAPITable interface is used to provide a read-only view of a table. IMAPITable is
' used by clients and service providers to manipulate the way a table appears.
' ========================================================================================
INTERFACE IMAPITable $IID_IMAPITable
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offset = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Advise ( ' VTable offset = 16
 BYVAL ulEventMask AS DWORD
 , BYVAL lpAdviseSink AS IMAPIAdviseSink
 , BYREF lpulConnection AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Unadvise ( ' VTable offset = 20
 BYVAL ulConnection AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetStatus ( ' VTable offset = 24
 BYREF lpulTableStatus AS DWORD
 , BYREF lpulTableType AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetColumns ( ' VTable offset = 28
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD QueryColumns ( ' VTable offset = 32
 BYVAL ulFlags AS DWORD
 , BYREF lpPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetRowCount ( ' VTable offset = 36
 BYVAL ulFlags AS DWORD
 , BYREF lpulCount AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SeekRow ( ' VTable offset = 40
 BYVAL bkOrigin AS DWORD
 , BYVAL lRowCount AS LONG
 , BYREF lplRowsSought AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SeekRowApprox ( ' VTable offset = 44
 BYVAL ulNumerator AS DWORD
 , BYVAL ulDenominator AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD QueryPosition ( ' VTable offset = 48
 BYREF lpulRow AS DWORD
 , BYREF lpulNumerator AS DWORD
 , BYREF lpulDenominator AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD FindRow ( ' VTable offset = 52
 BYREF lpRestriction AS SRestriction
 , BYVAL bkOrigin AS DWORD
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Restrict ( ' VTable offset = 56
 BYREF lpRestriction AS SRestriction
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CreateBookmark ( ' VTable offset = 60
 BYREF lpbkPosition AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD FreeBookmark ( ' VTable offset = 64
 BYVAL bkPosition AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SortTable ( ' VTable offset = 68
 BYVAL lpSortCriteria AS SSortOrderSet PTR
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD QuerySortOrder ( ' VTable offset = 72
 BYREF lppSortCriteria AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD QueryRows ( ' VTable offset = 76
 BYVAL lRowCount AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppRows AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Abort ( ' VTable offset = 80
 ) AS LONG
 ' =====================================================================================
 METHOD ExpandRow ( ' VTable offset = 84
 BYVAL cbInstanceKey AS DWORD
 , BYVAL pbInstanceKey AS BYTE PTR
 , BYVAL ulRowCount AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppRows AS DWORD
 , BYREF lpulMoreRows AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CollapseRow ( ' VTable offset = 88
 BYVAL cbInstanceKey AS DWORD
 , BYVAL pbInstanceKey AS BYTE PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpulRowCount AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD WaitForCompletion ( ' VTable offset = 92
 BYVAL ulFlags AS DWORD
 , BYVAL ulTimeout AS DWORD
 , BYREF lpulTableStatus AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetCollapseState ( ' VTable offset = 96
 BYVAL ulFlags AS DWORD
 , BYVAL cbInstanceKey AS DWORD
 , BYVAL lpbInstanceKey AS DWORD
 , BYREF lpcbCollapseState AS DWORD
 , BYREF lppbCollapseState AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetCollapseState ( ' VTable offset = 100
 BYVAL ulFlags AS DWORD
 , BYVAL cbCollapseState AS DWORD
 , BYVAL pbCollapseState AS BYTE PTR
 , BYREF lpbkLocation AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ========================================================================================
' IABTable interface
' This interface is used for content tables of Microsoft? Windows? Address Book (WAB)
' containers and distribution lists. It is based in IMAPITable.
' ========================================================================================
INTERFACE IABTable $IID_IMAPITable
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offset = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Advise ( ' VTable offset = 16
 BYVAL ulEventMask AS DWORD
 , BYVAL lpAdviseSink AS IMAPIAdviseSink
 , BYREF lpulConnection AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Unadvise ( ' VTable offset = 20
 BYVAL ulConnection AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetStatus ( ' VTable offset = 24
 BYREF lpulTableStatus AS DWORD
 , BYREF lpulTableType AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetColumns ( ' VTable offset = 28
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD QueryColumns ( ' VTable offset = 32
 BYVAL ulFlags AS DWORD
 , BYREF lpPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetRowCount ( ' VTable offset = 36
 BYVAL ulFlags AS DWORD
 , BYREF lpulCount AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SeekRow ( ' VTable offset = 40
 BYVAL bkOrigin AS DWORD
 , BYVAL lRowCount AS LONG
 , BYREF lplRowsSought AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SeekRowApprox ( ' VTable offset = 44
 BYVAL ulNumerator AS DWORD
 , BYVAL ulDenominator AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD QueryPosition ( ' VTable offset = 48
 BYREF lpulRow AS DWORD
 , BYREF lpulNumerator AS DWORD
 , BYREF lpulDenominator AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD FindRow ( ' VTable offset = 52
 BYREF lpRestriction AS SRestriction
 , BYVAL bkOrigin AS DWORD
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Restrict ( ' VTable offset = 56
 BYREF lpRestriction AS SRestriction
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CreateBookmark ( ' VTable offset = 60
 BYREF lpbkPosition AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD FreeBookmark ( ' VTable offset = 64
 BYVAL bkPosition AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SortTable ( ' VTable offset = 68
 BYVAL lpSortCriteria AS SSortOrderSet PTR
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD QuerySortOrder ( ' VTable offset = 72
 BYREF lppSortCriteria AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD QueryRows ( ' VTable offset = 76
 BYVAL lRowCount AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppRows AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Abort ( ' VTable offset = 80
 ) AS LONG
 ' =====================================================================================
 METHOD ExpandRow ( ' VTable offset = 84
 BYVAL cbInstanceKey AS DWORD
 , BYVAL pbInstanceKey AS BYTE PTR
 , BYVAL ulRowCount AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppRows AS DWORD
 , BYREF lpulMoreRows AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CollapseRow ( ' VTable offset = 88
 BYVAL cbInstanceKey AS DWORD
 , BYVAL pbInstanceKey AS BYTE PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpulRowCount AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD WaitForCompletion ( ' VTable offset = 92
 BYVAL ulFlags AS DWORD
 , BYVAL ulTimeout AS DWORD
 , BYREF lpulTableStatus AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetCollapseState ( ' VTable offset = 96
 BYVAL ulFlags AS DWORD
 , BYVAL cbInstanceKey AS DWORD
 , BYVAL lpbInstanceKey AS DWORD
 , BYREF lpcbCollapseState AS DWORD
 , BYREF lppbCollapseState AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetCollapseState ( ' VTable offset = 100
 BYVAL ulFlags AS DWORD
 , BYVAL cbCollapseState AS DWORD
 , BYVAL pbCollapseState AS BYTE PTR
 , BYREF lpbkLocation AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IProfSect Interface ----------------------------------------------------- */
'/* Standard section for public profile properties */
$PS_PROFILE_PROPERTIES_INIT = GUID$("{9815AC08-AAB0-101A-8C93-08002B2A56C2}")
' ========================================================================================
' IProfSect interface (inherits from IMAPIProp)
' $IID_IProfSect = GUID$("{00020304-0000-0000-C000-000000000046}")
' The IProfSect interface is used to work with the properties of profile section objects.
' ========================================================================================
INTERFACE IProfSect $IID_IProfSect
 INHERIT IUnknown
 ' =====================================================================================
 ' IMAPIProp Methods
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveChanges ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProps ( ' VTable offser = 20
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPropList ( ' VTable offser = 24
 BYVAL ulFlags AS DWORD
 , BYREF lppPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProperty ( ' VTable offser = 28
 BYVAL ulPropTag AS DWORD
 , BYREF lpiid AS GUID
 , BYVAL ulInterfaceOptions AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetProps ( ' VTable offser = 32
 BYVAL cValues AS DWORD
 , BYVAL lpPropArray AS SPropValue PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProps ( ' VTable offser = 36
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyTo ( ' VTable offser = 40
 BYVAL ciidExclude AS DWORD
 , BYREF rgiidExclude AS GUID
 , BYVAL lpExcludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProps ( ' VTable offser = 44
 BYVAL lpIncludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetNamesFromIDs ( ' VTable offser = 48
 BYVAL lppPropTags AS SPropTagArray PTR
 , BYREF lpPropSetGuid AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpcPropNames AS DWORD
 , BYREF lpppPropNames AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIDsFromNames ( ' VTable offser = 52
 BYVAL cPropNames AS DWORD
 , BYVAL lppPropNames AS MAPINAMEID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lppPropTags AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IMAPIStatus Interface --------------------------------------------------- */
'/* Values for PR_RESOURCE_TYPE, _METHODS, _FLAGS */
%EQUATE `MAPI_STORE_PROVIDER = 33 ' /* Message Store */
%EQUATE `MAPI_AB = 34 ' /* Address Book */
%EQUATE `MAPI_AB_PROVIDER = 35 ' /* Address Book Provider */
%EQUATE `MAPI_TRANSPORT_PROVIDER = 36 ' /* Transport Provider */
%EQUATE `MAPI_SPOOLER = 37 ' /* Message Spooler */
%EQUATE `MAPI_PROFILE_PROVIDER = 38 ' /* Profile Provider */
%EQUATE `MAPI_SUBSYSTEM = 39 ' /* Overall Subsystem Status */
%EQUATE `MAPI_HOOK_PROVIDER = 40 ' /* Spooler Hook */
%EQUATE `STATUS_VALIDATE_STATE = &H00000001
%EQUATE `STATUS_SETTINGS_DIALOG = &H00000002
%EQUATE `STATUS_CHANGE_PASSWORD = &H00000004
%EQUATE `STATUS_FLUSH_QUEUES = &H00000008
%EQUATE `STATUS_DEFAULT_OUTBOUND = &H00000001
%EQUATE `STATUS_DEFAULT_STORE = &H00000002
%EQUATE `STATUS_PRIMARY_IDENTITY = &H00000004
%EQUATE `STATUS_SIMPLE_STORE = &H00000008
%EQUATE `STATUS_XP_PREFER_LAST = &H00000010
%EQUATE `STATUS_NO_PRIMARY_IDENTITY = &H00000020
%EQUATE `STATUS_NO_DEFAULT_STORE = &H00000040
%EQUATE `STATUS_TEMP_SECTION = &H00000080
%EQUATE `STATUS_OWN_STORE = &H00000100
'/****** HOOK_INBOUND ((ULONG) 0x00000200) Defined in MAPIHOOK.H */
'/****** HOOK_OUTBOUND ((ULONG) 0x00000400) Defined in MAPIHOOK.H */
%EQUATE `STATUS_NEED_IPM_TREE = &H00000800
%EQUATE `STATUS_PRIMARY_STORE = &H00001000
%EQUATE `STATUS_SECONDARY_STORE = &H00002000
'/*
' * PR_STATUS_CODE bit. Low 16 bits for common values; High 16 bits
' * for provider type-specific values. (DCR 304)
' */
%EQUATE `STATUS_AVAILABLE = &H00000001
%EQUATE `STATUS_OFFLINE = &H00000002
%EQUATE `STATUS_FAILURE = &H00000004
'/* Transport values of PR_STATUS_CODE */
%EQUATE `STATUS_INBOUND_ENABLED = &H00010000
%EQUATE `STATUS_INBOUND_ACTIVE = &H00020000
%EQUATE `STATUS_INBOUND_FLUSH = &H00040000
%EQUATE `STATUS_OUTBOUND_ENABLED = &H00100000
%EQUATE `STATUS_OUTBOUND_ACTIVE = &H00200000
%EQUATE `STATUS_OUTBOUND_FLUSH = &H00400000
%EQUATE `STATUS_REMOTE_ACCESS = &H00800000
'/* ValidateState flags */
%EQUATE `SUPPRESS_UI = &H00000001
%EQUATE `REFRESH_XP_HEADER_CACHE = &H00010000
%EQUATE `PROCESS_XP_HEADER_CACHE = &H00020000
%EQUATE `FORCE_XP_CONNECT = &H00040000
%EQUATE `FORCE_XP_DISCONNECT = &H00080000
%EQUATE `CONFIG_CHANGED = &H00100000
%EQUATE `ABORT_XP_HEADER_OPERATION = &H00200000
%EQUATE `SHOW_XP_SESSION_UI = &H00400000
'/* SettingsDialog flags */
%EQUATE `UI_READONLY = &H00000001
'/* FlushQueues flags */
%EQUATE `FLUSH_UPLOAD = &H00000002
%EQUATE `FLUSH_DOWNLOAD = &H00000004
%EQUATE `FLUSH_FORCE = &H00000008
%EQUATE `FLUSH_NO_UI = &H00000010
%EQUATE `FLUSH_ASYNC_OK = &H00000020
' ========================================================================================
' IMAPIStatus interface (inherits from IMAPIProp)
' $IID_IMAPIStatus = GUID$("{00020305-0000-0000-C000-000000000046}")
' MAPI implements the IMAPIStatus interface to provide status information about the MAPI
' subsystem, the integrated address book and the MAPI spooler. A service provider
' implements IMAPIStatus to supply information about its own status.
' ========================================================================================
INTERFACE IMAPIStatus $IID_IMAPIStatus
 INHERIT IUnknown
 ' =====================================================================================
 ' IMAPIProp Methods
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveChanges ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProps ( ' VTable offser = 20
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPropList ( ' VTable offser = 24
 BYVAL ulFlags AS DWORD
 , BYREF lppPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProperty ( ' VTable offser = 28
 BYVAL ulPropTag AS DWORD
 , BYREF lpiid AS GUID
 , BYVAL ulInterfaceOptions AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetProps ( ' VTable offser = 32
 BYVAL cValues AS DWORD
 , BYVAL lpPropArray AS SPropValue PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProps ( ' VTable offser = 36
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyTo ( ' VTable offser = 40
 BYVAL ciidExclude AS DWORD
 , BYREF rgiidExclude AS GUID
 , BYVAL lpExcludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProps ( ' VTable offser = 44
 BYVAL lpIncludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetNamesFromIDs ( ' VTable offser = 48
 BYVAL lppPropTags AS SPropTagArray PTR
 , BYREF lpPropSetGuid AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpcPropNames AS DWORD
 , BYREF lpppPropNames AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIDsFromNames ( ' VTable offser = 52
 BYVAL cPropNames AS DWORD
 , BYVAL lppPropNames AS MAPINAMEID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lppPropTags AS DWORD
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IMAPIStatus Methods
 ' =====================================================================================
 METHOD ValidateState ( ' VTable offser = 56
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SettingsDialog ( ' VTable offser = 60
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD ChangePassword ( ' VTable offser = 64
 BYREF lpOldPass AS ASCIIZ
 , BYREF lpNewPass AS ASCIIZ
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD FlushQueues ( ' VTable offser = 68
 BYVAL ulUIParam AS DWORD
 , BYVAL cbTargetTransport AS DWORD
 , BYVAL lpTargetTransport AS ENTRYID PTR
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IMAPIContainer Interface ------------------------------------------------ */
'/* Flags for OpenEntry() */
'/****** MAPI_MODIFY ((ULONG) 0x00000001) above */
'/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
%EQUATE `MAPI_BEST_ACCESS = &H00000010
'/* GetContentsTable() */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
'/****** MAPI_ASSOCIATED ((ULONG) 0x00000040) below */
'/* GetHierarchyTable() */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
%EQUATE `CONVENIENT_DEPTH = &H00000001
'/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
'/* GetSearchCriteria */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
%EQUATE `SEARCH_RUNNING = &H00000001
%EQUATE `SEARCH_REBUILD = &H00000002
%EQUATE `SEARCH_RECURSIVE = &H00000004
%EQUATE `SEARCH_FOREGROUND = &H00000008
'/* SetSearchCriteria */
%EQUATE `STOP_SEARCH = &H00000001
%EQUATE `RESTART_SEARCH = &H00000002
%EQUATE `RECURSIVE_SEARCH = &H00000004
%EQUATE `SHALLOW_SEARCH = &H00000008
%EQUATE `FOREGROUND_SEARCH = &H00000010
%EQUATE `BACKGROUND_SEARCH = &H00000020
' ========================================================================================
' IMAPIContainer interface (inherits from IMAPIProp)
' $IID_IMAPIContainer = GUID$("{0002030B-0000-0000-C000-000000000046}")
' The IMAPIContainer interface manages high-level operations on container objects such as
' address books, distribution lists, and folders. The IMAPIFolder, IABContainer, and
' IDistList interfaces are derived from IMAPIContainer.
' ========================================================================================
INTERFACE IMAPIContainer $IID_IMAPIContainer
 INHERIT IUnknown
 ' =====================================================================================
 ' IMAPIProp Methods
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveChanges ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProps ( ' VTable offser = 20
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPropList ( ' VTable offser = 24
 BYVAL ulFlags AS DWORD
 , BYREF lppPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProperty ( ' VTable offser = 28
 BYVAL ulPropTag AS DWORD
 , BYREF lpiid AS GUID
 , BYVAL ulInterfaceOptions AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetProps ( ' VTable offser = 32
 BYVAL cValues AS DWORD
 , BYVAL lpPropArray AS SPropValue PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProps ( ' VTable offser = 36
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyTo ( ' VTable offser = 40
 BYVAL ciidExclude AS DWORD
 , BYREF rgiidExclude AS GUID
 , BYVAL lpExcludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProps ( ' VTable offser = 44
 BYVAL lpIncludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetNamesFromIDs ( ' VTable offser = 48
 BYVAL lppPropTags AS SPropTagArray PTR
 , BYREF lpPropSetGuid AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpcPropNames AS DWORD
 , BYREF lpppPropNames AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIDsFromNames ( ' VTable offser = 52
 BYVAL cPropNames AS DWORD
 , BYVAL lppPropNames AS MAPINAMEID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lppPropTags AS DWORD
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IMAPIContainer Methods
 ' =====================================================================================
 METHOD GetContentsTable ( ' VTable offser = 56
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD GetHierarchyTable ( ' VTable offser = 60
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD OpenEntry ( ' VTable offser = 64
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpulObjType AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetSearchCriteria ( ' VTable offser = 68
 BYREF lpRestriction AS SRestriction
 , BYVAL lpContainerList AS ENTRYLIST PTR
 , BYVAL ulSearchFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetSearchCriteria ( ' VTable offser = 72
 BYVAL ulFlags AS DWORD
 , BYREF lppRestriction AS DWORD
 , BYREF lppContainerList AS DWORD
 , BYREF lpulSearchState AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IABContainer Interface -------------------------------------------------- */
'/*
' * IABContainer PR_CONTAINER_FLAGS values
' * If AB_UNMODIFIABLE and AB_MODIFIABLE are both set, it means the container
' * doesn't know if it's modifiable or not, and the client should
' * try to modify the contents but we won't expect it to work.
' * If the AB_RECIPIENTS flag is set and neither AB_MODIFIABLE or AB_UNMODIFIABLE
' * bits are set, it is an error.
' */
' // Size = 8 bytes
TYPE FlagList DWORD
 cFlags AS DWORD ' ULONG
 ulFlags(%MAPI_DIM - 1) AS DWORD ' ULONG [variable-length array]
END TYPE
'/*
' * Container flags
' */
%EQUATE `AB_RECIPIENTS = &H00000001
%EQUATE `AB_SUBCONTAINERS = &H00000002
%EQUATE `AB_MODIFIABLE = &H00000004
%EQUATE `AB_UNMODIFIABLE = &H00000008
%EQUATE `AB_FIND_ON_OPEN = &H00000010
%EQUATE `AB_NOT_DEFAULT = &H00000020
'/* CreateEntry() */
%EQUATE `CREATE_CHECK_DUP_STRICT = &H00000001
%EQUATE `CREATE_CHECK_DUP_LOOSE = &H00000002
%EQUATE `CREATE_REPLACE = &H00000004
'/* ResolveNames() - ulFlags */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/* ResolveNames() - rgulFlags */
%EQUATE `MAPI_UNRESOLVED = &H00000000
%EQUATE `MAPI_AMBIGUOUS = &H00000001
%EQUATE `MAPI_RESOLVED = &H00000002
' ========================================================================================
' IABContainer interface (inherits from IMAPIContainer)
' $IID_IABContainer = GUID$("{0002030D-0000-0000-C000-000000000046}")
' The IABContainer interface provides access to address book containers. MAPI and client
' applications call the methods of IABContainer to perform name resolution and to create,
' copy, and delete recipients.
' ========================================================================================
INTERFACE IABContainer $IID_IABContainer
 INHERIT IUnknown
 ' =====================================================================================
 ' IMAPIProp Methods
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveChanges ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProps ( ' VTable offser = 20
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPropList ( ' VTable offser = 24
 BYVAL ulFlags AS DWORD
 , BYREF lppPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProperty ( ' VTable offser = 28
 BYVAL ulPropTag AS DWORD
 , BYREF lpiid AS GUID
 , BYVAL ulInterfaceOptions AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetProps ( ' VTable offser = 32
 BYVAL cValues AS DWORD
 , BYVAL lpPropArray AS SPropValue PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProps ( ' VTable offser = 36
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyTo ( ' VTable offser = 40
 BYVAL ciidExclude AS DWORD
 , BYREF rgiidExclude AS GUID
 , BYVAL lpExcludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProps ( ' VTable offser = 44
 BYVAL lpIncludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetNamesFromIDs ( ' VTable offser = 48
 BYVAL lppPropTags AS SPropTagArray PTR
 , BYREF lpPropSetGuid AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpcPropNames AS DWORD
 , BYREF lpppPropNames AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIDsFromNames ( ' VTable offser = 52
 BYVAL cPropNames AS DWORD
 , BYVAL lppPropNames AS MAPINAMEID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lppPropTags AS DWORD
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IMAPIContainer Methods
 ' =====================================================================================
 METHOD GetContentsTable ( ' VTable offser = 56
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD GetHierarchyTable ( ' VTable offser = 60
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD OpenEntry ( ' VTable offser = 64
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpulObjType AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetSearchCriteria ( ' VTable offser = 68
 BYREF lpRestriction AS SRestriction
 , BYVAL lpContainerList AS ENTRYLIST PTR
 , BYVAL ulSearchFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetSearchCriteria ( ' VTable offser = 72
 BYVAL ulFlags AS DWORD
 , BYREF lppRestriction AS DWORD
 , BYREF lppContainerList AS DWORD
 , BYREF lpulSearchState AS DWORD
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IABContainer Methods
 ' =====================================================================================
 METHOD CreateEntry ( ' VTable offser = 76
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYVAL ulCreateFlags AS DWORD
 , BYREF lppMAPIPropEntry AS IMAPIProp
 ) AS LONG
 ' =====================================================================================
 METHOD CopyEntries ( ' VTable offser = 80
 BYVAL lpEntries AS ENTRYLIST PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteEntries ( ' VTable offser = 84
 BYVAL lpEntries AS ENTRYLIST PTR
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD ResolveNames ( ' VTable offser = 88
 BYVAL lpPropTagArray AS SpropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYVAL lpAdrList AS ADRLIST PTR
 , BYVAL lpFlagList AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IMailUser Interface ----------------------------------------------------- */
'/* Any call which can create a one-off entryID (i.e. MAPISupport::CreateOneOff
' or IAdrBook::CreateOneOff) can encode the value for PR_SEND_RICH_INFO by
' passing in the following flag in the ulFlags parameter. Setting this flag
' indicates that PR_SEND_RICH_INFO will be FALSE.
'*/
%EQUATE `MAPI_SEND_NO_RICH_INFO = &H00010000
'/* Values of PR_NDR_DIAG_CODE */
'#define MAPI_DIAG(_code) ((LONG) _code)
%EQUATE `MAPI_DIAG_NO_DIAGNOSTIC = -1&
%EQUATE `MAPI_DIAG_OR_NAME_UNRECOGNIZED = 0&
%EQUATE `MAPI_DIAG_OR_NAME_AMBIGUOUS = 1&
%EQUATE `MAPI_DIAG_MTS_CONGESTED = 2&
%EQUATE `MAPI_DIAG_LOOP_DETECTED = 3&
%EQUATE `MAPI_DIAG_RECIPIENT_UNAVAILABLE = 4&
%EQUATE `MAPI_DIAG_MAXIMUM_TIME_EXPIRED = 5&
%EQUATE `MAPI_DIAG_EITS_UNSUPPORTED = 6&
%EQUATE `MAPI_DIAG_CONTENT_TOO_LONG = 7&
%EQUATE `MAPI_DIAG_IMPRACTICAL_TO_CONVERT = 8&
%EQUATE `MAPI_DIAG_PROHIBITED_TO_CONVERT = 9&
%EQUATE `MAPI_DIAG_CONVERSION_UNSUBSCRIBED = 10&
%EQUATE `MAPI_DIAG_PARAMETERS_INVALID = 11&
%EQUATE `MAPI_DIAG_CONTENT_SYNTAX_IN_ERROR = 12&
%EQUATE `MAPI_DIAG_LENGTH_CONSTRAINT_VIOLATD = 13&
%EQUATE `MAPI_DIAG_NUMBER_CONSTRAINT_VIOLATD = 14&
%EQUATE `MAPI_DIAG_CONTENT_TYPE_UNSUPPORTED = 15&
%EQUATE `MAPI_DIAG_TOO_MANY_RECIPIENTS = 16&
%EQUATE `MAPI_DIAG_NO_BILATERAL_AGREEMENT = 17&
%EQUATE `MAPI_DIAG_CRITICAL_FUNC_UNSUPPORTED = 18&
%EQUATE `MAPI_DIAG_CONVERSION_LOSS_PROHIB = 19&
%EQUATE `MAPI_DIAG_LINE_TOO_LONG = 20&
%EQUATE `MAPI_DIAG_PAGE_TOO_LONG = 21&
%EQUATE `MAPI_DIAG_PICTORIAL_SYMBOL_LOST = 22&
%EQUATE `MAPI_DIAG_PUNCTUATION_SYMBOL_LOST = 23&
%EQUATE `MAPI_DIAG_ALPHABETIC_CHARACTER_LOST = 24&
%EQUATE `MAPI_DIAG_MULTIPLE_INFO_LOSSES = 25&
%EQUATE `MAPI_DIAG_REASSIGNMENT_PROHIBITED = 26&
%EQUATE `MAPI_DIAG_REDIRECTION_LOOP_DETECTED = 27&
%EQUATE `MAPI_DIAG_EXPANSION_PROHIBITED = 28&
%EQUATE `MAPI_DIAG_SUBMISSION_PROHIBITED = 29&
%EQUATE `MAPI_DIAG_EXPANSION_FAILED = 30&
%EQUATE `MAPI_DIAG_RENDITION_UNSUPPORTED = 31&
%EQUATE `MAPI_DIAG_MAIL_ADDRESS_INCORRECT = 32&
%EQUATE `MAPI_DIAG_MAIL_OFFICE_INCOR_OR_INVD = 33&
%EQUATE `MAPI_DIAG_MAIL_ADDRESS_INCOMPLETE = 34&
%EQUATE `MAPI_DIAG_MAIL_RECIPIENT_UNKNOWN = 35&
%EQUATE `MAPI_DIAG_MAIL_RECIPIENT_DECEASED = 36&
%EQUATE `MAPI_DIAG_MAIL_ORGANIZATION_EXPIRED = 37&
%EQUATE `MAPI_DIAG_MAIL_REFUSED = 38&
%EQUATE `MAPI_DIAG_MAIL_UNCLAIMED = 39&
%EQUATE `MAPI_DIAG_MAIL_RECIPIENT_MOVED = 40&
%EQUATE `MAPI_DIAG_MAIL_RECIPIENT_TRAVELLING = 41&
%EQUATE `MAPI_DIAG_MAIL_RECIPIENT_DEPARTED = 42&
%EQUATE `MAPI_DIAG_MAIL_NEW_ADDRESS_UNKNOWN = 43&
%EQUATE `MAPI_DIAG_MAIL_FORWARDING_UNWANTED = 44&
%EQUATE `MAPI_DIAG_MAIL_FORWARDING_PROHIB = 45&
%EQUATE `MAPI_DIAG_SECURE_MESSAGING_ERROR = 46&
%EQUATE `MAPI_DIAG_DOWNGRADING_IMPOSSIBLE = 47&
'/* Values of PR_DELIVERY_POINT (MH_T_DELIVERY_POINT) */
%EQUATE `MAPI_MH_DP_PUBLIC_UA = 0
%EQUATE `MAPI_MH_DP_PRIVATE_UA = 1
%EQUATE `MAPI_MH_DP_MS = 2
%EQUATE `MAPI_MH_DP_ML = 3
%EQUATE `MAPI_MH_DP_PDAU = 4
%EQUATE `MAPI_MH_DP_PDS_PATRON = 5
%EQUATE `MAPI_MH_DP_OTHER_AU = 6
' ========================================================================================
' IMailUser interface (inherits from IMAPIProp)
' $IID_IMailUser = GUID$("{0002030A-0000-0000-C000-000000000046}")
' The IMailUser interface is implemented by messaging user objects. IMailUser inherits
' from the IMAPIProp interface and has no unique methods of its own. The IMailUser
' interface provides access to the many properties that are associated with messaging users.
' ========================================================================================
INTERFACE IMailUser $IID_IMailUser
 INHERIT IUnknown
 ' =====================================================================================
 ' IMAPIProp Methods
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveChanges ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProps ( ' VTable offser = 20
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPropList ( ' VTable offser = 24
 BYVAL ulFlags AS DWORD
 , BYREF lppPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProperty ( ' VTable offser = 28
 BYVAL ulPropTag AS DWORD
 , BYREF lpiid AS GUID
 , BYVAL ulInterfaceOptions AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetProps ( ' VTable offser = 32
 BYVAL cValues AS DWORD
 , BYVAL lpPropArray AS SPropValue PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProps ( ' VTable offser = 36
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyTo ( ' VTable offser = 40
 BYVAL ciidExclude AS DWORD
 , BYREF rgiidExclude AS GUID
 , BYVAL lpExcludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProps ( ' VTable offser = 44
 BYVAL lpIncludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetNamesFromIDs ( ' VTable offser = 48
 BYVAL lppPropTags AS SPropTagArray PTR
 , BYREF lpPropSetGuid AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpcPropNames AS DWORD
 , BYREF lpppPropNames AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIDsFromNames ( ' VTable offser = 52
 BYVAL cPropNames AS DWORD
 , BYVAL lppPropNames AS MAPINAMEID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lppPropTags AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IDistList Interface ----------------------------------------------------- */
' ========================================================================================
' IDistList interface (inherits from IMAPIContainer)
' $IID_IDistList = GUID$("{0002030E-0000-0000-C000-000000000046}")
' The IDistList interface is used to provide access to distribution lists in modifiable
' address book containers. IDistList can create, copy, and delete distribution lists, in
' addition to performing name resolution.
' The IDistList interface inherits from IMAPIContainer and includes the same methods
' as address book containers.
' ========================================================================================
INTERFACE IDistList $IID_IDistList
 INHERIT IUnknown
 ' =====================================================================================
 ' IMAPIProp Methods
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveChanges ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProps ( ' VTable offser = 20
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPropList ( ' VTable offser = 24
 BYVAL ulFlags AS DWORD
 , BYREF lppPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProperty ( ' VTable offser = 28
 BYVAL ulPropTag AS DWORD
 , BYREF lpiid AS GUID
 , BYVAL ulInterfaceOptions AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetProps ( ' VTable offser = 32
 BYVAL cValues AS DWORD
 , BYVAL lpPropArray AS SPropValue PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProps ( ' VTable offser = 36
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyTo ( ' VTable offser = 40
 BYVAL ciidExclude AS DWORD
 , BYREF rgiidExclude AS GUID
 , BYVAL lpExcludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProps ( ' VTable offser = 44
 BYVAL lpIncludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetNamesFromIDs ( ' VTable offser = 48
 BYVAL lppPropTags AS SPropTagArray PTR
 , BYREF lpPropSetGuid AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpcPropNames AS DWORD
 , BYREF lpppPropNames AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIDsFromNames ( ' VTable offser = 52
 BYVAL cPropNames AS DWORD
 , BYVAL lppPropNames AS MAPINAMEID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lppPropTags AS DWORD
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IMAPIContainer Methods
 ' =====================================================================================
 METHOD GetContentsTable ( ' VTable offser = 56
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD GetHierarchyTable ( ' VTable offser = 60
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD OpenEntry ( ' VTable offser = 64
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpulObjType AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetSearchCriteria ( ' VTable offser = 68
 BYREF lpRestriction AS SRestriction
 , BYVAL lpContainerList AS ENTRYLIST PTR
 , BYVAL ulSearchFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetSearchCriteria ( ' VTable offser = 72
 BYVAL ulFlags AS DWORD
 , BYREF lppRestriction AS DWORD
 , BYREF lppContainerList AS DWORD
 , BYREF lpulSearchState AS DWORD
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IDistList Methods
 ' =====================================================================================
 METHOD CreateEntry ( ' VTable offser = 76
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYVAL ulCreateFlags AS DWORD
 , BYREF lppMAPIPropEntry AS IMAPIProp
 ) AS LONG
 ' =====================================================================================
 METHOD CopyEntries ( ' VTable offser = 80
 BYVAL lpEntries AS ENTRYLIST PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteEntries ( ' VTable offser = 84
 BYVAL lpEntries AS ENTRYLIST PTR
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD ResolveNames ( ' VTable offser = 88
 BYVAL lpPropTagArray AS SpropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYVAL lpAdrList AS ADRLIST PTR
 , BYVAL lpFlagList AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IMAPIFolder Interface --------------------------------------------------- */
'/* IMAPIFolder folder type (enum) */
%EQUATE `FOLDER_ROOT = &H00000000
%EQUATE `FOLDER_GENERIC = &H00000001
%EQUATE `FOLDER_SEARCH = &H00000002
'/* CreateMessage */
'/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
'/****** MAPI_ASSOCIATED ((ULONG) 0x00000040) below */
'/* CopyMessages */
%EQUATE `MESSAGE_MOVE = &H00000001
%EQUATE `MESSAGE_DIALOG = &H00000002
'/****** MAPI_DECLINE_OK ((ULONG) 0x00000004) above */
'/* CreateFolder */
%EQUATE `OPEN_IF_EXISTS = &H00000001
'/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/* DeleteFolder */
%EQUATE `DEL_MESSAGES = &H00000001
%EQUATE `FOLDER_DIALOG = &H00000002
%EQUATE `DEL_FOLDERS = &H00000004
'/* EmptyFolder */
%EQUATE `DEL_ASSOCIATED = &H00000008
'/* CopyFolder */
%EQUATE `FOLDER_MOVE = &H00000001
'/****** FOLDER_DIALOG ((ULONG) 0x00000002) above */
'/****** MAPI_DECLINE_OK ((ULONG) 0x00000004) above */
%EQUATE `COPY_SUBFOLDERS = &H00000010
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/* SetReadFlags */
'/****** SUPPRESS_RECEIPT ((ULONG) 0x00000001) below */
'/****** FOLDER_DIALOG ((ULONG) 0x00000002) above */
'/****** CLEAR_READ_FLAG ((ULONG) 0x00000004) below */
'/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
'/****** GENERATE_RECEIPT_ONLY ((ULONG) 0x00000010) below */
'/****** CLEAR_RN_PENDING ((ULONG) 0x00000020) below */
'/****** CLEAR_NRN_PENDING ((ULONG) 0x00000040) below */
'/* GetMessageStatus */
%EQUATE `MSGSTATUS_HIGHLIGHTED = &H00000001
%EQUATE `MSGSTATUS_TAGGED = &H00000002
%EQUATE `MSGSTATUS_HIDDEN = &H00000004
%EQUATE `MSGSTATUS_DELMARKED = &H00000008
'/* Bits for remote message status */
%EQUATE `MSGSTATUS_REMOTE_DOWNLOAD = &H00001000
%EQUATE `MSGSTATUS_REMOTE_DELETE = &H00002000
'/* SaveContentsSort */
%EQUATE `RECURSIVE_SORT = &H00000002
'/* PR_STATUS property */
%EQUATE `FLDSTATUS_HIGHLIGHTED = &H00000001
%EQUATE `FLDSTATUS_TAGGED = &H00000002
%EQUATE `FLDSTATUS_HIDDEN = &H00000004
%EQUATE `FLDSTATUS_DELMARKED = &H00000008
' ========================================================================================
' IMAPIFolder interface (inherits from IMAPIContainer)
' $IID_IMAPIFolder = GUID$("{0002030C-0000-0000-C000-000000000046}")
' The IMAPIFolder interface is used to perform operations on the messages and subfolders
' in a folder.
' ========================================================================================
INTERFACE IMAPIFolder $IID_IMAPIFolder
 INHERIT IUnknown
 ' =====================================================================================
 ' IMAPIProp Methods
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveChanges ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProps ( ' VTable offser = 20
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPropList ( ' VTable offser = 24
 BYVAL ulFlags AS DWORD
 , BYREF lppPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProperty ( ' VTable offser = 28
 BYVAL ulPropTag AS DWORD
 , BYREF lpiid AS GUID
 , BYVAL ulInterfaceOptions AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetProps ( ' VTable offser = 32
 BYVAL cValues AS DWORD
 , BYVAL lpPropArray AS SPropValue PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProps ( ' VTable offser = 36
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyTo ( ' VTable offser = 40
 BYVAL ciidExclude AS DWORD
 , BYREF rgiidExclude AS GUID
 , BYVAL lpExcludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProps ( ' VTable offser = 44
 BYVAL lpIncludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetNamesFromIDs ( ' VTable offser = 48
 BYVAL lppPropTags AS SPropTagArray PTR
 , BYREF lpPropSetGuid AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpcPropNames AS DWORD
 , BYREF lpppPropNames AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIDsFromNames ( ' VTable offser = 52
 BYVAL cPropNames AS DWORD
 , BYVAL lppPropNames AS MAPINAMEID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lppPropTags AS DWORD
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IMAPIContainer Methods
 ' =====================================================================================
 METHOD GetContentsTable ( ' VTable offser = 56
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD GetHierarchyTable ( ' VTable offser = 60
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD OpenEntry ( ' VTable offser = 64
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpulObjType AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetSearchCriteria ( ' VTable offser = 68
 BYREF lpRestriction AS SRestriction
 , BYVAL lpContainerList AS ENTRYLIST PTR
 , BYVAL ulSearchFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetSearchCriteria ( ' VTable offser = 72
 BYVAL ulFlags AS DWORD
 , BYREF lppRestriction AS DWORD
 , BYREF lppContainerList AS DWORD
 , BYREF lpulSearchState AS DWORD
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IMAPIFolder Methods
 ' =====================================================================================
 METHOD CreateMessage ( ' VTable offser = 76
 BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lppMessage AS IMessage
 ) AS LONG
 ' =====================================================================================
 METHOD CopyMessages ( ' VTable offser = 80
 BYVAL lpMsgList AS DWORD
 , BYREF lpInterface AS GUID
 , BYVAL lpDestFolder AS IUnknown
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteMessages ( ' VTable offser = 84
 BYVAL lpMsgList AS DWORD
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CreateFolder ( ' VTable offser = 88
 BYVAL ulFolderType AS DWORD
 , BYREF lpszFolderName AS ASCIIZ
 , BYREF lpszFolderComment AS ASCIIZ
 , BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lppFolder AS IMAPIFolder
 ) AS LONG
 ' =====================================================================================
 METHOD CopyFolder ( ' VTable offser = 92
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYREF lpInterface AS GUID
 , BYVAL lpDestFolder AS DWORD
 , BYREF lpszNewFolderName AS ASCIIZ
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteFolder ( ' VTable offser = 96
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL IMAPIProgress
 , BYVAL lpProgress AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetReadFlags ( ' VTable offser = 100
 BYVAL lpMsgList AS DWORD
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetMessageStatus ( ' VTable offser = 104
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpulMessageStatus AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetMessageStatus ( ' VTable offser = 108
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYVAL ulNewStatus AS DWORD
 , BYVAL ulNewStatusMask AS DWORD
 , BYREF lpulOldStatus AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveContentsSort ( ' VTable offser = 112
 BYVAL lpSortCriteria AS SSortOrderSet PTR
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD EmptyFolder ( ' VTable offser = 116
 BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IMsgStore Interface ----------------------------------------------------- */
'/* PR_STORE_SUPPORT_MASK bits */
%EQUATE `STORE_ENTRYID_UNIQUE = &H00000001
%EQUATE `STORE_READONLY = &H00000002
%EQUATE `STORE_SEARCH_OK = &H00000004
%EQUATE `STORE_MODIFY_OK = &H00000008
%EQUATE `STORE_CREATE_OK = &H00000010
%EQUATE `STORE_ATTACH_OK = &H00000020
%EQUATE `STORE_OLE_OK = &H00000040
%EQUATE `STORE_SUBMIT_OK = &H00000080
%EQUATE `STORE_NOTIFY_OK = &H00000100
%EQUATE `STORE_MV_PROPS_OK = &H00000200
%EQUATE `STORE_CATEGORIZE_OK = &H00000400
%EQUATE `STORE_RTF_OK = &H00000800
%EQUATE `STORE_RESTRICTION_OK = &H00001000
%EQUATE `STORE_SORT_OK = &H00002000
%EQUATE `STORE_PUBLIC_FOLDERS = &H00004000
%EQUATE `STORE_UNCOMPRESSED_RTF = &H00008000
'/* PR_STORE_STATE bits, try not to collide with PR_STORE_SUPPORT_MASK */
%EQUATE `STORE_HAS_SEARCHES = &H01000000
'/* OpenEntry() */
'/****** MAPI_MODIFY ((ULONG) 0x00000001) above */
'/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
'/****** MAPI_BEST_ACCESS ((ULONG) 0x00000010) above */
'/* SetReceiveFolder() */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/* GetReceiveFolder() */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/* GetReceiveFolderTable() */
'/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
'/* StoreLogoff() */
%EQUATE `LOGOFF_NO_WAIT = &H00000001
%EQUATE `LOGOFF_ORDERLY = &H00000002
%EQUATE `LOGOFF_PURGE = &H00000004
%EQUATE `LOGOFF_ABORT = &H00000008
%EQUATE `LOGOFF_QUIET = &H00000010
%EQUATE `LOGOFF_COMPLETE = &H00010000
%EQUATE `LOGOFF_INBOUND = &H00020000
%EQUATE `LOGOFF_OUTBOUND = &H00040000
%EQUATE `LOGOFF_OUTBOUND_QUEUE = &H00080000
'/* SetLockState() */
%EQUATE `MSG_LOCKED = &H00000001
%EQUATE `MSG_UNLOCKED = &H00000000
'/* Flag bits for PR_VALID_FOLDER_MASK */
%EQUATE `FOLDER_IPM_SUBTREE_VALID = &H00000001
%EQUATE `FOLDER_IPM_INBOX_VALID = &H00000002
%EQUATE `FOLDER_IPM_OUTBOX_VALID = &H00000004
%EQUATE `FOLDER_IPM_WASTEBASKET_VALID = &H00000008
%EQUATE `FOLDER_IPM_SENTMAIL_VALID = &H00000010
%EQUATE `FOLDER_VIEWS_VALID = &H00000020
%EQUATE `FOLDER_COMMON_VIEWS_VALID = &H00000040
%EQUATE `FOLDER_FINDER_VALID = &H00000080
' ========================================================================================
' IMsgStore interface (inherits from IMAPIProp)
' $IID_IMsgStore = GUID$("{00020306-0000-0000-C000-000000000046}")
' The IMsgStore interface provides access to message store information and to messages
' and folders.
' ========================================================================================
INTERFACE IMsgStore $IID_IMsgStore
 INHERIT IUnknown
 ' =====================================================================================
 ' IMAPIProp Methods
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveChanges ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProps ( ' VTable offser = 20
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPropList ( ' VTable offser = 24
 BYVAL ulFlags AS DWORD
 , BYREF lppPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProperty ( ' VTable offser = 28
 BYVAL ulPropTag AS DWORD
 , BYREF lpiid AS GUID
 , BYVAL ulInterfaceOptions AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetProps ( ' VTable offser = 32
 BYVAL cValues AS DWORD
 , BYVAL lpPropArray AS SPropValue PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProps ( ' VTable offser = 36
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyTo ( ' VTable offser = 40
 BYVAL ciidExclude AS DWORD
 , BYREF rgiidExclude AS GUID
 , BYVAL lpExcludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProps ( ' VTable offser = 44
 BYVAL lpIncludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetNamesFromIDs ( ' VTable offser = 48
 BYVAL lppPropTags AS SPropTagArray PTR
 , BYREF lpPropSetGuid AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpcPropNames AS DWORD
 , BYREF lpppPropNames AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIDsFromNames ( ' VTable offser = 52
 BYVAL cPropNames AS DWORD
 , BYVAL lppPropNames AS MAPINAMEID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lppPropTags AS DWORD
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IMsgStore Methods
 ' =====================================================================================
 METHOD Advise ( ' VTable offser = 56
 BYVAL lpEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYVAL ulEventMask AS DWORD
 , BYVAL lpAdviseSink AS IMAPIAdviseSink
 , BYREF lpulConnection AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Unadvise ( ' VTable offser = 60
 BYVAL ulConnection AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CompareEntryIDs ( ' VTable offser = 64
 BYVAL cbEntryID1 AS DWORD
 , BYVAL lpEntryID1 AS ENTRYID PTR
 , BYVAL cbEntryID2 AS DWORD
 , BYVAL lpEntryID2 AS ENTRYID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpulResult AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenEntry ( ' VTable offser = 68
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpulObjType AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetReceiveFolder ( ' VTable offser = 72
 BYREF lpszMessageClass AS ASCIIZ
 , BYVAL ulFlags AS DWORD
 , BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetReceiveFolder ( ' VTable offser = 76
 BYREF lpszMessageClass AS ASCIIZ
 , BYVAL ulFlags AS DWORD
 , BYREF lpcbEntryID AS DWORD
 , BYREF lppEntryID AS DWORD
 , BYREF lppszExplicitClass AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetReceiveFolderTable ( ' VTable offser = 80
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD StoreLogoff ( ' VTable offser = 84
 BYREF lpulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD AbortSubmit ( ' VTable offser = 88
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetOutgoingQueue ( ' VTable offser = 92
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD SetLockState ( ' VTable offser = 96
 BYVAL lpMessage AS IMessage
 , BYVAL ulLockState AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD FinishedMsg ( ' VTable offser = 100
 BYVAL ulFlags AS DWORD
 , BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 ) AS LONG
 ' =====================================================================================
 METHOD NotifyNewMail ( ' VTable offser = 104
 BYREF lpNotification AS NOTIFICATION
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IMessage Interface ------------------------------------------------------ */
'/* SubmitMessage */
%EQUATE `FORCE_SUBMIT = &H00000001
'/* Flags defined in PR_MESSAGE_FLAGS */
%EQUATE `MSGFLAG_READ = &H00000001
%EQUATE `MSGFLAG_UNMODIFIED = &H00000002
%EQUATE `MSGFLAG_SUBMIT = &H00000004
%EQUATE `MSGFLAG_UNSENT = &H00000008
%EQUATE `MSGFLAG_HASATTACH = &H00000010
%EQUATE `MSGFLAG_FROMME = &H00000020
%EQUATE `MSGFLAG_ASSOCIATED = &H00000040
%EQUATE `MSGFLAG_RESEND = &H00000080
%EQUATE `MSGFLAG_RN_PENDING = &H00000100
%EQUATE `MSGFLAG_NRN_PENDING = &H00000200
'/* Flags defined in PR_SUBMIT_FLAGS */
%EQUATE `SUBMITFLAG_LOCKED = &H00000001
%EQUATE `SUBMITFLAG_PREPROCESS = &H00000002
'/* GetAttachmentTable() */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/* GetRecipientTable() */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/* ModifyRecipients */
'/* ((ULONG) 0x00000001 is not a valid flag on ModifyRecipients. */
%EQUATE `MODRECIP_ADD = &H00000002
%EQUATE `MODRECIP_MODIFY = &H00000004
%EQUATE `MODRECIP_REMOVE = &H00000008
'/* SetReadFlag */
%EQUATE `SUPPRESS_RECEIPT = &H00000001
%EQUATE `CLEAR_READ_FLAG = &H00000004
'/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) below */
%EQUATE `GENERATE_RECEIPT_ONLY = &H00000010
%EQUATE `CLEAR_RN_PENDING = &H00000020
%EQUATE `CLEAR_NRN_PENDING = &H00000040
'/* DeleteAttach */
%EQUATE `ATTACH_DIALOG = &H00000001
'/* PR_SECURITY values */
%EQUATE `SECURITY_SIGNED = &H00000001
%EQUATE `SECURITY_ENCRYPTED = &H00000002
'/* PR_PRIORITY values */
%EQUATE `PRIO_URGENT = 1&
%EQUATE `PRIO_NORMAL = 0&
%EQUATE `PRIO_NONURGENT = -1&
'/* PR_SENSITIVITY values */
%EQUATE `SENSITIVITY_NONE = &H00000000
%EQUATE `SENSITIVITY_PERSONAL = &H00000001
%EQUATE `SENSITIVITY_PRIVATE = &H00000002
%EQUATE `SENSITIVITY_COMPANY_CONFIDENTIAL = &H00000003
'/* PR_IMPORTANCE values */
%EQUATE `IMPORTANCE_LOW = 0&
%EQUATE `IMPORTANCE_NORMAL = 1&
%EQUATE `IMPORTANCE_HIGH = 2&
' ========================================================================================
' IMessage interface (inherits from IMAPIProp
' $IID_IMessage = GUID$("{00020307-0000-0000-C000-000000000046}")
' The IMessage interface is used for managing messages, attachments, and recipients.
' ========================================================================================
INTERFACE IMessage $IID_IMessage
 INHERIT IUnknown
 ' =====================================================================================
 ' IMAPIProp Methods
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveChanges ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProps ( ' VTable offser = 20
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPropList ( ' VTable offser = 24
 BYVAL ulFlags AS DWORD
 , BYREF lppPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProperty ( ' VTable offser = 28
 BYVAL ulPropTag AS DWORD
 , BYREF lpiid AS GUID
 , BYVAL ulInterfaceOptions AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetProps ( ' VTable offser = 32
 BYVAL cValues AS DWORD
 , BYVAL lpPropArray AS SPropValue PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProps ( ' VTable offser = 36
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyTo ( ' VTable offser = 40
 BYVAL ciidExclude AS DWORD
 , BYREF rgiidExclude AS GUID
 , BYVAL lpExcludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProps ( ' VTable offser = 44
 BYVAL lpIncludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetNamesFromIDs ( ' VTable offser = 48
 BYVAL lppPropTags AS SPropTagArray PTR
 , BYREF lpPropSetGuid AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpcPropNames AS DWORD
 , BYREF lpppPropNames AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIDsFromNames ( ' VTable offser = 52
 BYVAL cPropNames AS DWORD
 , BYVAL lppPropNames AS MAPINAMEID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lppPropTags AS DWORD
 ) AS LONG
 ' =====================================================================================
 ' =====================================================================================
 ' IMessage Methods
 ' =====================================================================================
 METHOD GetAttachmentTable ( ' VTable offser = 56
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD OpenAttach ( ' VTable offser = 60
 BYVAL ulAttachmentNum AS DWORD
 , BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lppAttach AS IAttach
 ) AS LONG
 ' =====================================================================================
 METHOD CreateAttach ( ' VTable offser = 64
 BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpulAttachmentNum AS DWORD
 , BYREF lppAttach AS IAttach
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteAttach ( ' VTable offser = 68
 BYVAL ulAttachmentNum AS DWORD
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetRecipientTable ( ' VTable offser = 72
 BYVAL ulFLags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD ModifyRecipients ( ' VTable offser = 76
 BYVAL ulFLags AS DWORD
 , BYVAL lpMods AS ADRLIST PTR
 ) AS LONG
 ' =====================================================================================
 METHOD SubmitMessage ( ' VTable offser = 80
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetReadFlag ( ' VTable offser = 84
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IAttach Interface ------------------------------------------------------- */
'/* IAttach attachment methods: PR_ATTACH_METHOD values */
%EQUATE `NO_ATTACHMENT = &H00000000
%EQUATE `ATTACH_BY_VALUE = &H00000001
%EQUATE `ATTACH_BY_REFERENCE = &H00000002
%EQUATE `ATTACH_BY_REF_RESOLVE = &H00000003
%EQUATE `ATTACH_BY_REF_ONLY = &H00000004
%EQUATE `ATTACH_EMBEDDED_MSG = &H00000005
%EQUATE `ATTACH_OLE = &H00000006
' ========================================================================================
' IAttach interface (inherits from IMAPIProp)
' $IID_IAttachment = GUID$("{00020308-0000-0000-C000-000000000046}")
' The IAttach interface is used to maintain and provide access to the properties of
' attachments in messages. The IAttach interface has no unique methods of its own.
' ========================================================================================
INTERFACE IAttach $IID_IAttach
 INHERIT IUnknown
 ' =====================================================================================
 ' IMAPIProp Methods
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveChanges ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProps ( ' VTable offser = 20
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPropList ( ' VTable offser = 24
 BYVAL ulFlags AS DWORD
 , BYREF lppPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProperty ( ' VTable offser = 28
 BYVAL ulPropTag AS DWORD
 , BYREF lpiid AS GUID
 , BYVAL ulInterfaceOptions AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetProps ( ' VTable offser = 32
 BYVAL cValues AS DWORD
 , BYVAL lpPropArray AS SPropValue PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProps ( ' VTable offser = 36
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyTo ( ' VTable offser = 40
 BYVAL ciidExclude AS DWORD
 , BYREF rgiidExclude AS GUID
 , BYVAL lpExcludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProps ( ' VTable offser = 44
 BYVAL lpIncludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetNamesFromIDs ( ' VTable offser = 48
 BYVAL lppPropTags AS SPropTagArray PTR
 , BYREF lpPropSetGuid AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpcPropNames AS DWORD
 , BYREF lpppPropNames AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIDsFromNames ( ' VTable offser = 52
 BYVAL cPropNames AS DWORD
 , BYVAL lppPropNames AS MAPINAMEID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lppPropTags AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* --------------------------------- */
'/* Address Book interface definition */
'/* ADRPARM ulFlags - top 4 bits used for versioning */
'#define GET_ADRPARM_VERSION(ulFlags) (((ULONG)ulFlags) & 0xF0000000)
FUNCTION GET_ADRPARM_VERSION (BYVAL ulFlags AS DWORD) AS DWORD
 FUNCTION = ulFlags AND &HF0000000
END FUNCTION
'#define SET_ADRPARM_VERSION(ulFlags, ulVersion) (((ULONG)ulVersion) | (((ULONG)ulFlags) & 0x0FFFFFFF))
FUNCTION SET_ADRPARM_VERSION (BYVAL ulFlags AS DWORD, BYVAL ulVersion AS DWORD) AS DWORD
 FUNCTION = ulVersion OR ulFlags AND &H0FFFFFFF
END FUNCTION
'/* Current versions of ADRPARM */
%EQUATE `ADRPARM_HELP_CTX = &H00000000
'/* ulFlags - bit fields */
%EQUATE `DIALOG_MODAL = &H00000001
%EQUATE `DIALOG_SDI = &H00000002
%EQUATE `DIALOG_OPTIONS = &H00000004
%EQUATE `ADDRESS_ONE = &H00000008
%EQUATE `AB_SELECTONLY = &H00000010
%EQUATE `AB_RESOLVE = &H00000020
'/* --------------------------------- */
'/* PR_DISPLAY_TYPEs */
'/*
' * These standard display types are
' * by default handled by MAPI.
' * They have default icons associated
' * with them.
' */
'/* For address book contents tables */
%EQUATE `DT_MAILUSER = &H00000000
%EQUATE `DT_DISTLIST = &H00000001
%EQUATE `DT_FORUM = &H00000002
%EQUATE `DT_AGENT = &H00000003
%EQUATE `DT_ORGANIZATION = &H00000004
%EQUATE `DT_PRIVATE_DISTLIST = &H00000005
%EQUATE `DT_REMOTE_MAILUSER = &H00000006
'/* For address book hierarchy tables */
%EQUATE `DT_MODIFIABLE = &H00010000
%EQUATE `DT_GLOBAL = &H00020000
%EQUATE `DT_LOCAL = &H00030000
%EQUATE `DT_WAN = &H00040000
%EQUATE `DT_NOT_SPECIFIC = &H00050000
'/* For folder hierarchy tables */
%EQUATE `DT_FOLDER = &H01000000
%EQUATE `DT_FOLDER_LINK = &H02000000
%EQUATE `DT_FOLDER_SPECIAL = &H04000000
'/* Accelerator callback for DIALOG_SDI form of AB UI */
'typedef BOOL (STDMETHODCALLTYPE ACCELERATEABSDI)(ULONG ulUIParam,
' LPVOID lpvmsg);
'typedef ACCELERATEABSDI * LPFNABSDI;
'/* Callback to application telling it that the DIALOG_SDI form of the */
'/* AB UI has been dismissed. This is so that the above LPFNABSDI */
'/* function doesn't keep being called. */
'typedef void (STDMETHODCALLTYPE DISMISSMODELESS)(ULONG ulUIParam,
' LPVOID lpvContext);
'typedef DISMISSMODELESS * LPFNDISMISS;
'/*
' * Prototype for the client function hooked to an optional button on
' * the address book dialog
' */
'typedef SCODE (STDMETHODCALLTYPE * LPFNBUTTON)(
' ULONG ulUIParam,
' LPVOID lpvContext,
' ULONG cbEntryID,
' LPENTRYID lpSelection,
' ULONG ulFlags
');
'/* Parameters for the address book dialog */
' // Do not use. Describes the display and behavior of the common address dialog box.
' // Size = 72 bytes
#IF %DEF(%UNICODE)
TYPE ADRPARM DWORD
 cbABContEntryID AS DWORD ' ULONG
 lpABContEntryID AS DWORD
 ulFlags AS DWORD ' ULONG
 lpReserved AS DWORD
 ulHelpContext AS DWORD ' ULONG
 lpszHelpFileName AS WSTRINGZ PTR
 lpfnABSDI AS DWORD
 lpfnDismiss AS DWORD
 lpvDismissContext AS DWORD
 lpszCaption AS WSTRINGZ PTR
 lpszNewEntryTitle AS WSTRINGZ PTR
 lpszDestWellsTitle AS WSTRINGZ PTR
 cDestFields AS DWORD ' ULONG
 nDestFieldFocus AS DWORD ' ULONG
 lppszDestTitles AS DWORD ' LPTSTR * [array]
 lpulDestComps AS DWORD ' ULONG * [array]
 lpContRestriction AS SRestriction PTR ' LPSRestriction
 lpHierRestriction AS SRestriction PTR ' LPSRestriction
END TYPE
#ELSE
TYPE ADRPARM DWORD
 cbABContEntryID AS DWORD ' ULONG
 lpABContEntryID AS DWORD
 ulFlags AS DWORD ' ULONG
 lpReserved AS DWORD
 ulHelpContext AS DWORD ' ULONG
 lpszHelpFileName AS ASCIIZ PTR
 lpfnABSDI AS DWORD
 lpfnDismiss AS DWORD
 lpvDismissContext AS DWORD
 lpszCaption AS ASCIIZ PTR
 lpszNewEntryTitle AS ASCIIZ PTR
 lpszDestWellsTitle AS ASCIIZ PTR
 cDestFields AS DWORD ' ULONG
 nDestFieldFocus AS DWORD ' ULONG
 lppszDestTitles AS DWORD ' LPTSTR * [array]
 lpulDestComps AS DWORD ' ULONG * [array]
 lpContRestriction AS SRestriction PTR ' LPSRestriction
 lpHierRestriction AS SRestriction PTR ' LPSRestriction
END TYPE
#ENDIF
'/* ------------ */
'/* Random flags */
'/* Flag for deferred error */
%EQUATE `MAPI_DEFERRED_ERRORS = &H00000008
'/* Flag for creating and using Folder Associated Information Messages */
%EQUATE `MAPI_ASSOCIATED = &H00000040
'/* Flags for OpenMessageStore() */
%EQUATE `MDB_NO_DIALOG = &H00000001
%EQUATE `MDB_WRITE = &H00000004
'/****** MAPI_DEFERRED_ERRORS ((ULONG) 0x00000008) above */
'/****** MAPI_BEST_ACCESS ((ULONG) 0x00000010) above */
%EQUATE `MDB_TEMPORARY = &H00000020
%EQUATE `MDB_NO_MAIL = &H00000080
'/* Flags for OpenAddressBook */
%EQUATE `AB_NO_DIALOG = &H00000001
'/* IMAPIControl Interface -------------------------------------------------- */
'/* Interface used in controls (particularly the button) defined by */
'/* Display Tables. */
'/* Flags for GetState */
%EQUATE `MAPI_ENABLED = &H00000000
%EQUATE `MAPI_DISABLED = &H00000001
' ========================================================================================
' IMAPIControl interface
' $IID_IMAPIControl = GUID$("{0002031B-0000-0000-C000-000000000046}")
' The IMAPIControl interface is used to enable and disable a button control and to perform
' tasks when a user of a client application clicks the enabled control. Service providers
' implement control objects to create custom buttons on dialog boxes, such as configuration
' property sheets, that are defined with display tables.
' ========================================================================================
INTERFACE IMAPIControl $IID_IMAPIControl
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offset = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Activate ( ' VTable offset = 16
 BYVAL ulFlags AS DWORD
 , BYVAL ulUIParam AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetState ( ' VTable offset = 20
 BYVAL ulFlags AS DWORD
 , BYREF ulUIParam AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* Display Tables ---------------------------------------------------------- */
'/* Flags used in display tables - that is, PR_CONTROL_FLAGS */
%EQUATE `DT_MULTILINE = &H00000001
%EQUATE `DT_EDITABLE = &H00000002
%EQUATE `DT_REQUIRED = &H00000004
%EQUATE `DT_SET_IMMEDIATE = &H00000008
%EQUATE `DT_PASSWORD_EDIT = &H00000010
%EQUATE `DT_ACCEPT_DBCS = &H00000020
%EQUATE `DT_SET_SELECTION = &H00000040
'/* Display Table structures */
%EQUATE `DTCT_LABEL = &H00000000
%EQUATE `DTCT_EDIT = &H00000001
%EQUATE `DTCT_LBX = &H00000002
%EQUATE `DTCT_COMBOBOX = &H00000003
%EQUATE `DTCT_DDLBX = &H00000004
%EQUATE `DTCT_CHECKBOX = &H00000005
%EQUATE `DTCT_GROUPBOX = &H00000006
%EQUATE `DTCT_BUTTON = &H00000007
%EQUATE `DTCT_PAGE = &H00000008
%EQUATE `DTCT_RADIOBUTTON = &H00000009
%EQUATE `DTCT_MVLISTBOX = &H0000000B
%EQUATE `DTCT_MVDDLBX = &H0000000C
'/* Labels */
'/* Valid ulFlags:
' * MAPI_UNICODE
' */
' // Size = 8 bytes
TYPE DTBLLABEL DWORD
 ulbLpszLabelName AS DWORD ' ULONG
 ulFlags AS DWORD ' ULONG
END TYPE
' // Size = 12 bytes
TYPE DTBLEDIT DWORD
 ulbLpszCharsAllowed AS DWORD ' ULONG
 ulFlags AS DWORD ' ULONG
 ulNumCharsAllowed AS DWORD ' ULONG
 ulPropTag AS DWORD ' ULONG
END TYPE
'/* List Box */
'/* Valid ulFlags:
' */
%EQUATE `MAPI_NO_HBAR = &H00000001
%EQUATE `MAPI_NO_VBAR = &H00000002
TYPE DTBLLBX
 ulFlags AS DWORD ' ULONG
 ulPRSetProperty AS DWORD ' ULONG
 ulPRTableName AS DWORD ' ULONG
END TYPE
'/* Combo Box */
'/* Valid ulFlags:
' * MAPI_UNICODE
' */
' // Size = 20 bytes
TYPE DTBLCOMBOBOX DWORD
 ulbLpszCharsAllowed AS DWORD ' ULONG
 ulFlags AS DWORD ' ULONG
 ulNumCharsAllowed AS DWORD ' ULONG
 ulPRPropertyName AS DWORD ' ULONG
 ulPRTableName AS DWORD ' ULONG
END TYPE
'/* Drop Down */
'/* Valid ulFlags:
' * none
' */
' // Size = 16 bytes
TYPE DTBLDDLBX DWORD
 ulFlags AS DWORD ' ULONG
 ulPRDisplayProperty AS DWORD ' ULONG
 ulPRSetProperty AS DWORD ' ULONG
 ulPRTableName AS DWORD ' ULONG
END TYPE
'/* Check Box */
'/* Valid ulFlags:
' * MAPI_UNICODE
' */
' // Size = 12 bytes
TYPE DTBLCHECKBOX DWORD
 ulbLpszLabel AS DWORD ' ULONG
 ulFlags AS DWORD ' ULONG
 ulPRPropertyName AS DWORD ' ULONG
END TYPE
'/* Group Box */
'/* Valid ulFlags:
' * MAPI_UNICODE
' */
' // Size = 8 bytes
TYPE DTBLGROUPBOX DWORD
 ulbLpszLabel AS DWORD ' ULONG
 ulFlags AS DWORD ' ULONG
END TYPE
'/* Button control */
'/* Valid ulFlags:
' * MAPI_UNICODE
' */
' // Size = 12 bytes
TYPE DTBLBUTTON DWORD
 ulbLpszLabel AS DWORD ' ULONG
 ulFlags AS DWORD ' ULONG
 ulPRControl AS DWORD ' ULONG
END TYPE
'/* Pages */
'/* Valid ulFlags:
' * MAPI_UNICODE
' */
' // Size = 16 bytes
TYPE DTBLPAGE DWORD
 ulbLpszLabel AS DWORD ' ULONG
 ulFlags AS DWORD ' ULONG
 ulbLpszComponent AS DWORD ' ULONG
 ulContext AS DWORD ' ULONG
END TYPE
'/* Radio button */
'/* Valid ulFlags:
' * MAPI_UNICODE
' */
' // Size = 20 bytes
TYPE DTBLRADIOBUTTON DWORD
 ulbLpszLabel AS DWORD ' ULONG
 ulFlags AS DWORD ' ULONG
 ulcButtons AS DWORD ' ULONG
 ulPropTag AS DWORD ' ULONG
 lReturnValue AS LONG
END TYPE
'/* MultiValued listbox */
'/* Valid ulFlags:
' * none
' */
' // Size = 8 bytes
TYPE DTBLMVLISTBOX DWORD
 ulFlags AS DWORD ' ULONG
 ulMVPropTag AS DWORD ' ULONG
END TYPE
'/* MultiValued dropdown */
'/* Valid ulFlags:
' * none
' */
' // Size = 8 bytes
TYPE DTBLMVDDLBX DWORD
 ulFlags AS DWORD ' ULONG
 ulMVPropTag AS DWORD ' ULONG
END TYPE
'/* IProviderAdmin Interface ---------------------------------------------- */
'/* Flags for ConfigureMsgService */
%EQUATE `UI_SERVICE = &H00000002
%EQUATE `SERVICE_UI_ALWAYS = &H00000002 ' /* Duplicate UI_SERVICE for consistency and compatibility */
%EQUATE `SERVICE_UI_ALLOWED = &H00000010
%EQUATE `UI_CURRENT_PROVIDER_FIRST = &H00000004
'/* MSG_SERVICE_UI_READ_ONLY 0x00000008 - in MAPISPI.H */
'/* GetProviderTable() */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) above */
'/* Values for PR_RESOURCE_FLAGS in message service table */
' ========================================================================================
' IProviderAdmin interface
' $IID_IProviderAdmin = GUID$("{00020325-0000-0000-C000-000000000046}")
' The IProviderAdmin interface is used to work with service providers within a message service.
' ========================================================================================
INTERFACE IProviderAdmin $IID_IProviderAdmin
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offset = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProviderTable ( ' VTable offset = 16
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD CreateProvider ( ' VTable offset = 20
 BYREF lpszProvider AS ASCIIZ
 , BYVAL cValues AS DWORD
 , BYREF lpProps AS SPropValue
 , BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lpUID AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProvider ( ' VTable offset = 24
 BYREF lpUID AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProfileSection ( ' VTable offset = 28
 BYREF lpUID AS GUID
 , BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lppProfSect AS IProfSect
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF
