' ########################################################################################
' Microsoft Windows
' File: MAPIX.inc
' Contents: Definitions of objects/flags, etc used by Extended MAPI
' Copyright (c) 2010 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_MAPIX_PBI)
#DEFINE PBX_MAPIX_PBI
%EQUATE `MAPIX_INC = 1
'/* Include common MAPI header files if they haven't been already. */
#INCLUDE ONCE "Legacy/UI/MAPIGuid.inc"
#INCLUDE ONCE "Legacy/System/MAPIDefs.inc"
#INCLUDE ONCE "Legacy/System/MAPICode.inc"
#INCLUDE ONCE "Legacy/System/MAPITags.inc"
'/* ------------------------------------------------------ */
'/* shared with simple mapi */
'typedef ULONG FLAGS;
'/* MAPILogon() flags. */
%EQUATE `MAPI_LOGON_UI = &H00000001 ' /* Display logon UI */
%EQUATE `MAPI_NEW_SESSION = &H00000002 ' /* Don't use shared session */
%EQUATE `MAPI_ALLOW_OTHERS = &H00000008 ' /* Make this a shared session */
%EQUATE `MAPI_EXPLICIT_PROFILE = &H00000010 ' /* Don't use default profile */
%EQUATE `MAPI_EXTENDED = &H00000020 ' /* Extended MAPI Logon */
%EQUATE `MAPI_FORCE_DOWNLOAD = &H00001000 ' /* Get new mail before return */
%EQUATE `MAPI_SERVICE_UI_ALWAYS = &H00002000 ' /* Do logon UI in all providers */
%EQUATE `MAPI_NO_MAIL = &H00008000 ' /* Do not activate transports */
'/* %MAPI_NT_SERVICE = &H00010000 Allow logon from an NT service */
#IF NOT %DEF(%MAPI_PASSWORD_UI)
%EQUATE `MAPI_PASSWORD_UI = &H00020000 ' /* Display password UI only */
#ENDIF
%EQUATE `MAPI_TIMEOUT_SHORT = &H00100000 ' /* Minimal wait for logon resources */
%EQUATE `MAPI_SIMPLE_DEFAULT = %MAPI_LOGON_UI OR %MAPI_FORCE_DOWNLOAD OR %MAPI_ALLOW_OTHERS
%EQUATE `MAPI_SIMPLE_EXPLICIT = %MAPI_NEW_SESSION OR %MAPI_FORCE_DOWNLOAD OR %MAPI_EXPLICIT_PROFILE
'/* Structure passed to MAPIInitialize(), and its ulFlags values */
' // Size = 8 bytes
TYPE MAPIINIT_0 DWORD
 ulVersion AS DWORD ' ULONG
 ulFlags AS DWORD ' ULONG
END TYPE
'typedef MAPIINIT_0 MAPIINIT;
' // Size = 8 bytes
TYPE MAPIINIT DWORD
 ulVersion AS DWORD ' ULONG
 ulFlags AS DWORD ' ULONG
END TYPE
%EQUATE `MAPI_INIT_VERSION = 0
%EQUATE `MAPI_MULTITHREAD_NOTIFICATIONS = &H00000001
'/* Reserved for MAPI 0x40000000 */
'/* #define MAPI_NT_SERVICE 0x00010000 Use from NT service */
'/* MAPI base functions */
DECLARE FUNCTION MAPIInitialize LIB "mapi32.dll" ALIAS "MAPIInitialize" ( BYREF lpMapiInit AS ANY ) AS LONG
DECLARE SUB MAPIUninitialize LIB "mapi32.dll" ALIAS "MAPIUninitialize" ()
'/* Extended MAPI Logon function */
DECLARE FUNCTION MAPILogonEx LIB "mapi32.dll" ALIAS "MAPILogonEx" ( BYVAL ulUIParam AS QUAD , BYREF lpszProfileName AS ASCIIZ , BYREF lpszPassword AS ASCIIZ , BYVAL flFlags AS QUAD , BYREF lppSession AS IMAPISession ) AS LONG
DECLARE FUNCTION MAPIAllocateBuffer LIB "mapi32.dll" ALIAS "MAPIAllocateBuffer" ( BYVAL cbSize AS QUAD
 , BYREF lppBuffer AS ANY
 ) AS LONG ' SCODE
DECLARE FUNCTION MAPIAllocateMore LIB "mapi32.dll" ALIAS "MAPIAllocateMore" ( BYVAL cbSize AS QUAD , BYVAL lpObject AS QUAD , BYREF lppBuffer AS ANY ) AS LONG ' SCODE
DECLARE FUNCTION MAPIFreeBuffer LIB "mapi32.dll" ALIAS "MAPIFreeBuffer" ( BYVAL lpBuffer AS QUAD ) AS QUAD ' ULONG
DECLARE FUNCTION MAPIAdminProfiles LIB "mapi32.dll" ALIAS "MAPIAdminProfiles" ( BYVAL ulFlags AS QUAD , BYREF lppProfAdmin AS IProfAdmin ) AS LONG
'/* IMAPISession Interface -------------------------------------------------- */
'/* Flags for OpenEntry and others */
'/*#define MAPI_MODIFY ((ULONG) 0x00000001) */
'/* Flags for Logoff */
%EQUATE `MAPI_LOGOFF_SHARED = &H00000001 ' /* Close all shared sessions */
%EQUATE `MAPI_LOGOFF_UI = &H00000002 ' /* It's OK to present UI */
'/* Flags for SetDefaultStore. They are mutually exclusive. */
%EQUATE `MAPI_DEFAULT_STORE = &H00000001 ' /* for incoming messages */
%EQUATE `MAPI_SIMPLE_STORE_TEMPORARY = &H00000002 ' /* for simple MAPI and CMC */
%EQUATE `MAPI_SIMPLE_STORE_PERMANENT = &H00000003 ' /* for simple MAPI and CMC */
%EQUATE `MAPI_PRIMARY_STORE = &H00000004 ' /* Used by some clients */
%EQUATE `MAPI_SECONDARY_STORE = &H00000005 ' /* Used by some clients */
'/* Flags for ShowForm. */
%EQUATE `MAPI_POST_MESSAGE = &H00000001 ' /* Selects post/send semantics */
%EQUATE `MAPI_NEW_MESSAGE = &H00000002 ' /* Governs copying during submission */
'/* MessageOptions */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) */
'/* QueryDefaultMessageOpt */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) */
' ========================================================================================
' IMAPISession interface
' $IID_IMAPISession = GUID$("{00020300-0000-0000-C000-000000000046}")
' The IMAPISession interface is used to manage objects associated with a MAPI logon session.
' ========================================================================================
INTERFACE IMAPISession $IID_IMAPISession
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offset = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetMsgStoresTable ( ' VTable offset = 16
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD OpenMsgStore ( ' VTable offset = 20
 BYVAL ulUIParam AS DWORD
 , BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lppMDB AS IMsgStore
 ) AS LONG
 ' =====================================================================================
 METHOD OpenAddressBook ( ' VTable offset = 24
 BYVAL ulUIParam AS DWORD
 , BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lppAdrBook AS IAddrBook
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProfileSection ( ' VTable offset = 28
 BYREF lpUID AS MAPIUID
 , BYREF lpInterface AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lppProfSect AS IProfSect
 ) AS LONG
 ' =====================================================================================
 METHOD GetStatusTable ( ' VTable offset = 32
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD OpenEntry ( ' VTable offset = 36
 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 CompareEntryIDs ( ' VTable offset = 40
 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 Advise ( ' VTable offset = 44
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYVAL ulEventMask AS DWORD
 , BYVAL lpAdviseSink AS IMAPIAdviseSink
 , BYREF lpulConnection AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Unadvise ( ' VTable offset = 48
 BYVAL ulConnection AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD MessageOptions ( ' VTable offset = 52
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lpszAdrType AS ASCIIZ
 , BYVAL lpMessage AS IMessage
 ) AS LONG
 ' =====================================================================================
 METHOD QueryDefaultMessageOpt ( ' VTable offset = 56
 BYREF lpszAdrType AS ASCIIZ
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppOptions AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD EnumAdrTypes ( ' VTable offset = 60
 BYVAL ulFlags AS DWORD
 , BYREF lpcAdrTypes AS DWORD
 , BYREF lpppszAdrTypes AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD QueryIdentity ( ' VTable offset = 64
 BYREF lpcbEntryID AS DWORD
 , BYREF lppEntryID AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Logoff ( ' VTable offset = 68
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL ulReserved AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetDefaultStore ( ' VTable offset = 72
 BYVAL ulFlags AS DWORD
 , BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 ) AS LONG
 ' =====================================================================================
 METHOD AdminServices ( ' VTable offset = 76
 BYVAL ulFlags AS DWORD
 , BYREF lppServiceAdmin AS IMsgServiceAdmin
 ) AS LONG
 ' =====================================================================================
 METHOD ShowForm ( ' VTable offset = 80
 BYVAL ulUIParam AS DWORD
 , BYVAL lpMsgStore AS IMsgStore
 , BYVAL lpParentFolder AS IMAPIFolder
 , BYREF lpInterface AS GUID
 , BYVAL ulMessageToken AS DWORD
 , BYVAL lpMessageSent AS IMessage
 , BYVAL ulFlags AS DWORD
 , BYVAL ulMessageStatus AS DWORD
 , BYVAL ulMessageFlags AS DWORD
 , BYVAL ulAccess AS DWORD
 , BYVAL lpszMessageClass AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD PrepareForm ( ' VTable offset = 84
 BYREF lpInterface AS GUID
 , BYVAL lpMessage AS IMessage
 , BYREF lpulMessageToken AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ========================================================================================
'/* IAddrBook Interface ----------------------------------------------------- */
'/* CreateOneOff */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) */
'/****** MAPI_SEND_NO_RICH_INFO ((ULONG) 0x00010000) */
'/* RecipOptions */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) */
'/* QueryDefaultRecipOpt */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) */
'/* GetSearchPath */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) */
' ========================================================================================
' IAddrBook interface (inherits from IMAPIProp)
' $IID_IAddrBook = GUID$("{00020309-0000-0000-C000-000000000046}")
' The IAddrBook interface supports access to the MAPI address book and includes operations
' such as displaying common dialog boxes, opening containers, messaging users, and
' distribution lists, and performing name resolution.
' ========================================================================================
INTERFACE IAddrBook $IID_IAddrBook
 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
 ' =====================================================================================
 ' =====================================================================================
 ' IAddrBook Methods
 ' =====================================================================================
 METHOD OpenEntry ( ' VTable offser = 56
 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 CompareEntryIDs ( ' VTable offser = 60
 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 Advise ( ' VTable offser = 64
 BYVAL cbEntryID 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 = 68
 BYVAL ulConnection AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CreateOneOff ( ' VTable offser = 72
 BYREF lpszName AS ASCIIZ
 , BYREF lpszAdrType AS ASCIIZ
 , BYREF lpszAddress AS ASCIIZ
 , BYVAL ulFlags AS DWORD
 , BYREF lpcbEntryID AS DWORD
 , BYREF lppEntryID AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD NewEntry ( ' VTable offser = 76
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL cbEIDContainer AS DWORD
 , BYVAL lpEIDContainer AS ENTRYID PTR
 , BYVAL cbEIDNewEntryTpl AS DWORD
 , BYVAL lpEIDNewEntryTpl AS ENTRYID PTR
 , BYREF lpcbEIDNewEntry AS DWORD
 , BYREF lppEIDNewEntry AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD ResolveName ( ' VTable offser = 80
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lpszNewEntryTitle AS DWORD
 , BYVAL lpAdrList AS ADRLIST PTR
 ) AS LONG
 ' =====================================================================================
 METHOD Address ( ' VTable offser = 84
 BYREF lpulUIParam AS DWORD
 , BYREF lpAdrParms AS ADRPARM
 , BYVAL lppAdrList AS ADRLIST PTR
 ) AS LONG
 ' =====================================================================================
 METHOD Details ( ' VTable offser = 88
 BYREF lpulUIParam AS DWORD
 , BYVAL lpfnDismiss AS DWORD
 , BYVAL lpvDismissContext AS DWORD
 , BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 , BYVAL lpfButtonCallback AS DWORD
 , BYVAL lpvButtonContext AS DWORD
 , BYVAL lpszButtonText AS DWORD
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD RecipOptions ( ' VTable offser = 92
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lpRecip AS ADRENTRY PTR
 ) AS LONG
 ' =====================================================================================
 METHOD QueryDefaultRecipOpt ( ' VTable offser = 96
 BYREF lpszAdrType AS ASCIIZ
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppOptions AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPAB ( ' VTable offser = 100
 BYREF lpcbEntryID AS DWORD
 , BYREF lppEntryID AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetPAB ( ' VTable offser = 104
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetDefaultDir ( ' VTable offser = 108
 BYREF lpcbEntryID AS DWORD
 , BYREF lppEntryID AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetDefaultDir ( ' VTable offser = 112
 BYVAL cbEntryID AS DWORD
 , BYVAL lpEntryID AS ENTRYID PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetSearchPath ( ' VTable offser = 116
 BYVAL ulFlags AS DWORD
 , BYREF lppSearchPath AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetSearchPath ( ' VTable offser = 120
 BYVAL ulFlags AS DWORD
 , BYVAL lpSearchPath AS SRowSet PTR
 ) AS LONG
 ' =====================================================================================
 METHOD PrepareRecips ( ' VTable offser = 124
 BYVAL ulFlags AS DWORD
 , BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL lpRecipList AS ADRLIST PTR
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IProfAdmin Interface ---------------------------------------------------- */
'/* Flags for CreateProfile */
%EQUATE `MAPI_DEFAULT_SERVICES = &H00000001
'/* GetProfileTable */
'/****** MAPI_UNICODE ((ULONG) = &H80000000) */
' ========================================================================================
' IProfAdmin interface
' $IID_IProfAdmin = GUID$("{00020325-0000-0000-C000-000000000046}")
' The IProfAdmin interface supports the administration of profiles.
' ========================================================================================
INTERFACE IProfAdmin $IID_IProfAdmin
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offset = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProfileTable ( ' VTable offset = 16
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD CreateProfile ( ' VTable offset = 20
 BYREF lpszProfileName AS ASCIIZ
 , BYREF lpszPassword AS ASCIIZ
 , BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProfile ( ' VTable offset = 24
 BYREF lpszProfileName AS ASCIIZ
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD ChangeProfilePassword ( ' VTable offset = 28
 BYREF lpszProfileName AS ASCIIZ
 , BYREF lpszOldPassword AS ASCIIZ
 , BYREF lpszNewPassword AS ASCIIZ
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProfile ( ' VTable offset = 32
 BYREF lpszProfileName AS ASCIIZ
 , BYREF lpszOldPassword AS ASCIIZ
 , BYREF lpszNewPassword AS ASCIIZ
 , BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD RenameProfile ( ' VTable offset = 36
 BYREF lpszProfileName AS ASCIIZ
 , BYREF lpszOldPassword AS ASCIIZ
 , BYREF lpszNewProfileName AS ASCIIZ
 , BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetDefaultProfile ( ' VTable offset = 40
 BYREF lpszProfileName AS ASCIIZ
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD AdminServices ( ' VTable offset = 44
 BYREF lpszProfileName AS ASCIIZ
 , BYREF lpszPassword AS ASCIIZ
 , BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppServiceAdmin AS IMsgServiceAdmin
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* IMsgServiceAdmin Interface ---------------------------------------------- */
'/* Values for PR_RESOURCE_FLAGS in message service table */
%EQUATE `SERVICE_DEFAULT_STORE = &H00000001
%EQUATE `SERVICE_SINGLE_COPY = &H00000002
%EQUATE `SERVICE_CREATE_WITH_STORE = &H00000004
%EQUATE `SERVICE_PRIMARY_IDENTITY = &H00000008
%EQUATE `SERVICE_NO_PRIMARY_IDENTITY = &H00000020
'/* GetMsgServiceTable */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) */
'/* GetProviderTable */
'/****** MAPI_UNICODE ((ULONG) 0x80000000) */
' ========================================================================================
' IMsgServiceAdmin interface
' $IID_IMsgServiceAdmin = GUID$("{0002031D-0000-0000-C000-000000000046}")
' The IMsgServiceAdmin interface is used to make changes to a message service within a
' profile.
' ========================================================================================
INTERFACE IMsgServiceAdmin $IID_IMsgServiceAdmin
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetMsgServiceTable ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
 METHOD CreateMsgService ( ' VTable offser = 20
 BYREF lpszService AS ASCIIZ
 , BYREF lpszDisplayName AS ASCIIZ
 , BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteMsgService ( ' VTable offser = 24
 BYREF lpUID AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD CopyMsgService ( ' VTable offser = 28
 BYREF lpUID AS GUID
 , BYREF lpszDisplayName AS ASCIIZ
 , BYREF lpInterfaceToCopy AS GUID
 , BYVAL lpObjectDst AS DWORD
 , BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD RenameMsgService ( ' VTable offser = 32
 BYREF lpUID AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpszDisplayName AS ASCIIZ
 ) AS LONG
 ' =====================================================================================
 METHOD ConfigureMsgService ( ' VTable offser = 36
 BYREF lpUID AS GUID
 , BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL cValues AS DWORD
 , BYREF lpProps AS SPropValue
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProfileSection ( ' VTable offser = 40
 BYREF lpUID AS GUID
 , BYREF lpInterface AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppProfSect AS IProfSect
 ) AS LONG
 ' =====================================================================================
 METHOD MsgServiceTransportOrder ( ' VTable offser = 44
 BYVAL cUID AS DWORD
 , BYREF lpUIDList AS GUID
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD AdminProviders ( ' VTable offser = 48
 BYREF lpUID AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lppProviderAdmin AS IProviderAdmin
 ) AS LONG
 ' =====================================================================================
 METHOD SetPrimaryIdentity ( ' VTable offser = 52
 BYREF lpUID AS GUID
 , BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProviderTable ( ' VTable offser = 56
 BYVAL ulFlags AS DWORD
 , BYREF lppTable AS IMAPITable
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' The following functions are not included in any C header:
' ========================================================================================
' The ABProviderInit function initializes an address book provider for operation.
' Note: This is a prorotype for a function that you have to implement if you write an
' address book provider.
' ========================================================================================
'DECLARE FUNCTION ABProviderInit ( ' BYVAL hInstance AS DWORD
' , BYVAL lpMalloc AS IMalloc
' , BYVAL lpAllocateBuffer AS DWORD
' , BYVAL lpAllocateMore AS DWORD
' , BYVAL lpFreeBuffer AS DWORD
' , BYVAL ulFlags AS DWORD
' , BYVAL ulMAPIVer AS DWORD
' , BYREF lpulProviderVer AS DWORD
' , BYREF lppABProvider AS IABProvider
' ) AS LONG
' ========================================================================================
' ========================================================================================
' FGetComponentPath
' The FGetComponentPath function redirects the MAPI call to the private Mapi32.dll.
' FGetComponentPath@20 can also be used as the alias name.
' ========================================================================================
DECLARE FUNCTION FGetComponentPath LIB "mapi32.dll" ALIAS "FGetComponentPath" ( BYREF szComponent AS ASCIIZ , BYREF szQualifier AS ASCIIZ , BYREF szDllPath AS ASCIIZ , BYVAL cchBufferSize AS QUAD , BYVAL fInstall AS LONG ) AS LONG
' ========================================================================================
#ENDIF
