libmapi.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <stdarg.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <talloc.h>
#include <dcerpc.h>
#include <util/debug.h>
#include <param.h>
#include <dlinklist.h>
#include <gen_ndr/exchange.h>
#include <gen_ndr/property.h>
#include "libmapi/version.h"
#include "libmapi/nspi.h"
#include "libmapi/emsmdb.h"
#include "libmapi/mapi_context.h"
#include "libmapi/mapi_provider.h"
#include "libmapi/mapi_object.h"
#include "libmapi/mapi_id_array.h"
#include "libmapi/mapi_notification.h"
#include "libmapi/mapi_profile.h"
#include "libmapi/mapidefs.h"
#include "libmapi/mapicode.h"
#include "libmapi/socket/netif.h"
#include "libmapi/idset.h"
#include "libmapi/property_tags.h"
#include "libmapi/property_altnames.h"

Macros

#define __BEGIN_DECLS
 
#define __END_DECLS
 
#define _GNU_SOURCE   1
 
#define _PRINTF_ATTRIBUTE(a1, a2)   PRINTF_ATTRIBUTE(a1, a2)
 
#define _PRINTF_ATTRIBUTE(a1, a2)
 
#define SIZE_DFLT_APPOINTMENTRECURRENCEPATTERN   26
 
#define SIZE_DFLT_EXCEPTIONINFO   22
 
#define SIZE_DFLT_EXTENDEDEXCEPTION   0
 
#define SIZE_DFLT_RECURRENCEPATTERN   50
 

Typedefs

typedef enum MAPISTATUS(* fxparser_delprop_callback_t )(uint32_t, void *)
 
typedef enum MAPISTATUS(* fxparser_marker_callback_t )(uint32_t, void *)
 
typedef enum MAPISTATUS(* fxparser_namedprop_callback_t )(uint32_t, struct MAPINAMEID, void *)
 
typedef enum MAPISTATUS(* fxparser_property_callback_t )(struct SPropValue, void *)
 

Functions

enum MAPISTATUS Abort (mapi_object_t *, uint8_t *)
 
enum MAPISTATUS AbortSubmit (mapi_object_t *, mapi_object_t *, mapi_object_t *)
 
struct mapi_SPropValue * add_mapi_SPropValue (TALLOC_CTX *, struct mapi_SPropValue *, uint16_t *, uint32_t, const void *)
 
struct SPropValue * add_SPropValue (TALLOC_CTX *, struct SPropValue *, uint32_t *, enum MAPITAGS, const void *)
 
enum MAPISTATUS AddressTypes (mapi_object_t *, uint16_t *, struct mapi_LPSTR **)
 
enum MAPISTATUS AddUserPermission (mapi_object_t *, const char *, enum ACLRIGHTS)
 
uint32_t calculateCRC (uint8_t *, uint32_t, uint32_t)
 
uint32_t cast_mapi_SPropValue (TALLOC_CTX *, struct mapi_SPropValue *, struct SPropValue *)
 
void cast_PropertyRow_to_SRow (TALLOC_CTX *, struct PropertyRow_r *, struct SRow *)
 
void cast_PropertyRowSet_to_SRowSet (TALLOC_CTX *, struct PropertyRowSet_r *, struct SRowSet *)
 
void cast_PropertyValue_to_SPropValue (struct PropertyValue_r *, struct SPropValue *)
 
uint32_t cast_SPropValue (TALLOC_CTX *, struct mapi_SPropValue *, struct SPropValue *)
 
enum MAPISTATUS ChangeProfilePassword (struct mapi_context *, const char *, const char *, const char *)
 
enum MAPISTATUS CloneStream (mapi_object_t *, mapi_object_t *)
 
enum MAPISTATUS CollapseRow (mapi_object_t *, uint64_t, uint32_t *)
 
enum MAPISTATUS CommitStream (mapi_object_t *)
 
enum MAPISTATUS compress_rtf (TALLOC_CTX *, const char *, const size_t, uint8_t **, size_t *)
 
enum MAPISTATUS CopyFolder (mapi_object_t *, mapi_object_t *, mapi_object_t *, char *, bool, bool)
 
enum MAPISTATUS CopyProfile (struct mapi_context *, const char *, const char *)
 
enum MAPISTATUS CopyProps (mapi_object_t *, mapi_object_t *, struct SPropTagArray *, uint8_t, uint16_t *, struct PropertyProblem **)
 
enum MAPISTATUS CopyTo (mapi_object_t *, mapi_object_t *, struct SPropTagArray *, uint8_t, uint16_t *, struct PropertyProblem **)
 
enum MAPISTATUS CopyToStream (mapi_object_t *, mapi_object_t *, uint64_t, uint64_t *, uint64_t *)
 
enum MAPISTATUS CreateAttach (mapi_object_t *, mapi_object_t *)
 
enum MAPISTATUS CreateBookmark (mapi_object_t *, uint32_t *)
 
enum MAPISTATUS CreateFolder (mapi_object_t *, enum FOLDER_TYPE, const char *, const char *, uint32_t, mapi_object_t *)
 
enum MAPISTATUS CreateMessage (mapi_object_t *, mapi_object_t *)
 
enum MAPISTATUS CreateProfile (struct mapi_context *, const char *, const char *, const char *, uint32_t)
 
enum MAPISTATUS CreateProfileStore (const char *, const char *)
 
enum MAPISTATUS DeleteAttach (mapi_object_t *, uint32_t)
 
enum MAPISTATUS DeleteFolder (mapi_object_t *, mapi_id_t, uint8_t, bool *)
 
enum MAPISTATUS DeleteMessage (mapi_object_t *, mapi_id_t *, uint32_t)
 
enum MAPISTATUS DeleteProfile (struct mapi_context *, const char *)
 
enum MAPISTATUS DeletePropertiesNoReplicate (mapi_object_t *, struct SPropTagArray *)
 
enum MAPISTATUS DeleteProps (mapi_object_t *, struct SPropTagArray *)
 
enum MAPISTATUS DispatchNotifications (struct mapi_session *)
 
enum MAPISTATUS DuplicateProfile (struct mapi_context *, const char *, const char *, const char *)
 
enum MAPISTATUS EmptyFolder (mapi_object_t *)
 
struct emsmdb_infoemsmdb_get_info (struct mapi_session *)
 
void emsmdb_get_SRowSet (TALLOC_CTX *, struct SRowSet *, struct SPropTagArray *, DATA_BLOB *)
 
NTSTATUS emsmdb_transaction (struct emsmdb_context *, TALLOC_CTX *, struct mapi_request *, struct mapi_response **)
 
NTSTATUS emsmdb_transaction_ext2 (struct emsmdb_context *, TALLOC_CTX *, struct mapi_request *, struct mapi_response **)
 
NTSTATUS emsmdb_transaction_null (struct emsmdb_context *, struct mapi_response **)
 
NTSTATUS emsmdb_transaction_wrapper (struct mapi_session *, TALLOC_CTX *, struct mapi_request *, struct mapi_response **)
 
enum MAPISTATUS EntryIDFromSourceIDForMessage (TALLOC_CTX *, mapi_object_t *, mapi_object_t *, mapi_object_t *, struct SBinary_short *)
 
uint64_t exchange_globcnt (uint64_t)
 
enum MAPISTATUS ExpandRow (mapi_object_t *, uint64_t, uint16_t, struct SRowSet *, uint32_t *)
 
const void * find_mapi_SPropValue_data (struct mapi_SPropValue_array *, uint32_t)
 
const void * find_PropertyValue_data (struct PropertyRow_r *, uint32_t)
 
const void * find_SPropValue_data (struct SRow *, uint32_t)
 
enum MAPISTATUS FindProfileAttr (struct mapi_profile *, const char *, const char *)
 
enum MAPISTATUS FindRow (mapi_object_t *, struct mapi_SRestriction *, enum BOOKMARK, enum FindRow_ulFlags, struct SRowSet *)
 
enum MAPISTATUS FreeBookmark (mapi_object_t *, uint32_t)
 
enum MAPISTATUS FXCopyFolder (mapi_object_t *, uint8_t, uint8_t, mapi_object_t *)
 
enum MAPISTATUS FXCopyMessages (mapi_object_t *, mapi_id_array_t *, uint8_t, uint8_t, mapi_object_t *)
 
enum MAPISTATUS FXCopyProperties (mapi_object_t *, uint8_t, uint32_t, uint8_t, struct SPropTagArray *, mapi_object_t *)
 
enum MAPISTATUS FXCopyTo (mapi_object_t *, uint8_t, uint32_t, uint8_t, struct SPropTagArray *, mapi_object_t *)
 
enum MAPISTATUS FXDestConfigure (mapi_object_t *, enum FastTransferDestConfig_SourceOperation, mapi_object_t *)
 
enum MAPISTATUS FXGetBuffer (mapi_object_t *obj_source_context, uint16_t maxSize, enum TransferStatus *, uint16_t *, uint16_t *, DATA_BLOB *)
 Get data from source fast transfer object. More...
 
struct fx_parser_contextfxparser_init (TALLOC_CTX *, void *)
 
enum MAPISTATUS fxparser_parse (struct fx_parser_context *, DATA_BLOB *)
 
void fxparser_set_delprop_callback (struct fx_parser_context *, fxparser_delprop_callback_t)
 
void fxparser_set_marker_callback (struct fx_parser_context *, fxparser_marker_callback_t)
 
void fxparser_set_namedprop_callback (struct fx_parser_context *, fxparser_namedprop_callback_t)
 
void fxparser_set_property_callback (struct fx_parser_context *, fxparser_property_callback_t)
 
enum MAPISTATUS FXPutBuffer (mapi_object_t *obj_dest_context, DATA_BLOB *blob, uint16_t *usedSize)
 Send data to a destination fast transfer object. More...
 
struct Binary_r * generate_recipient_entryid (TALLOC_CTX *, const char *)
 
struct AddressBookEntryId * get_AddressBookEntryId (TALLOC_CTX *, struct Binary_r *)
 
struct
AppointmentRecurrencePattern * 
get_AppointmentRecurrencePattern (TALLOC_CTX *mem_ctx, struct Binary_r *)
 
struct FolderEntryId * get_FolderEntryId (TALLOC_CTX *, struct Binary_r *)
 
struct GlobalObjectId * get_GlobalObjectId (TALLOC_CTX *, struct Binary_r *)
 
const char * get_importance (uint32_t)
 
int get_interfaces_oc (struct iface_struct *, int)
 
uint32_t get_mapi_property_size (struct mapi_SPropValue *)
 
enum MAPISTATUS get_mapi_SPropValue_array_date_timeval (struct timeval *, struct mapi_SPropValue_array *, uint32_t)
 
const void * get_mapi_SPropValue_data (struct mapi_SPropValue *)
 
enum MAPISTATUS get_mapi_SPropValue_date_timeval (struct timeval *t, struct SPropValue)
 
struct MessageEntryId * get_MessageEntryId (TALLOC_CTX *, struct Binary_r *)
 
const char * get_namedid_name (uint32_t proptag)
 
uint16_t get_namedid_type (uint16_t untypedtag)
 
uint32_t get_namedid_value (const char *propname)
 
uint16_t get_property_type (uint16_t untypedtag)
 
const void * get_PropertyValue (struct PropertyValue_r *, enum MAPITAGS)
 
const void * get_PropertyValue_data (struct PropertyValue_r *)
 
struct PropertyValue_r * get_PropertyValue_PropertyRow (struct PropertyRow_r *, enum MAPITAGS)
 
struct PropertyValue_r * get_PropertyValue_PropertyRowSet (struct PropertyRowSet_r *, enum MAPITAGS)
 
const void * get_PropertyValue_PropertyRowSet_data (struct PropertyRowSet_r *, uint32_t)
 
const char * get_proptag_name (uint32_t)
 
uint32_t get_proptag_value (const char *)
 
struct PtypServerId * get_PtypServerId (TALLOC_CTX *, struct Binary_r *)
 
struct RecurrencePattern * get_RecurrencePattern (TALLOC_CTX *, struct Binary_r *)
 
const void * get_SPropValue (struct SPropValue *, enum MAPITAGS)
 
const void * get_SPropValue_data (struct SPropValue *)
 
struct SPropValue * get_SPropValue_SRow (struct SRow *, uint32_t)
 
const void * get_SPropValue_SRow_data (struct SRow *, uint32_t)
 
struct SPropValue * get_SPropValue_SRowSet (struct SRowSet *, uint32_t)
 
const void * get_SPropValue_SRowSet_data (struct SRowSet *, uint32_t)
 
const char * get_task_status (uint32_t)
 
struct TimeZoneStruct * get_TimeZoneStruct (TALLOC_CTX *, struct Binary_r *)
 
const char * get_TypedString (struct TypedString *)
 
enum MAPISTATUS GetABRecipientInfo (struct mapi_session *, const char *, struct SPropTagArray *, struct PropertyRowSet_r **)
 
enum MAPISTATUS GetAttachmentTable (mapi_object_t *, mapi_object_t *)
 
enum MAPISTATUS GetBestBody (mapi_object_t *, uint8_t *)
 
enum MAPISTATUS GetCollapseState (mapi_object_t *, uint64_t, uint32_t, struct SBinary_short *)
 
enum MAPISTATUS GetContentsTable (mapi_object_t *, mapi_object_t *, uint8_t, uint32_t *)
 
enum MAPISTATUS GetDefaultFolder (mapi_object_t *, uint64_t *, const uint32_t)
 
enum MAPISTATUS GetDefaultProfile (struct mapi_context *, char **)
 
enum MAPISTATUS GetDefaultPublicFolder (mapi_object_t *, uint64_t *, const uint32_t)
 
enum MAPISTATUS GetFIDFromEntryID (uint16_t, uint8_t *, uint64_t, uint64_t *)
 
enum MAPISTATUS GetFolderItemsCount (mapi_object_t *, uint32_t *, uint32_t *)
 
int GetFreeBusyYear (const uint32_t *)
 
enum MAPISTATUS GetGALTable (struct mapi_session *, struct SPropTagArray *, struct PropertyRowSet_r **, uint32_t, uint8_t)
 
enum MAPISTATUS GetGALTableCount (struct mapi_session *, uint32_t *)
 
enum MAPISTATUS GetHierarchyTable (mapi_object_t *, mapi_object_t *, uint8_t, uint32_t *)
 
enum MAPISTATUS GetIdFromLongTermId (mapi_object_t *, struct LongTermId, mapi_id_t *)
 
enum MAPISTATUS GetIDsFromNames (mapi_object_t *, uint16_t, struct MAPINAMEID *, uint32_t, struct SPropTagArray **)
 
enum MAPISTATUS GetLastError (void)
 
enum MAPISTATUS GetLoadparmContext (struct mapi_context *, struct loadparm_context **)
 
enum MAPISTATUS GetLocalReplicaIds (mapi_object_t *, uint32_t, struct GUID *, uint8_t[6])
 
enum MAPISTATUS GetLongTermIdFromId (mapi_object_t *, mapi_id_t, struct LongTermId *)
 
enum MAPISTATUS GetMessageStatus (mapi_object_t *, mapi_id_t, uint32_t *)
 
enum MAPISTATUS GetNamesFromIDs (mapi_object_t *, enum MAPITAGS, uint16_t *, struct MAPINAMEID **)
 
enum MAPISTATUS GetOutboxFolder (mapi_object_t *, mapi_id_t *)
 
enum MAPISTATUS GetOwningServers (mapi_object_t *, mapi_object_t *, uint16_t *, uint16_t *, char **)
 
enum MAPISTATUS GetPermissionsTable (mapi_object_t *, uint8_t, mapi_object_t *)
 
enum MAPISTATUS GetProfileAttr (struct mapi_profile *, const char *, unsigned int *, char ***)
 
enum MAPISTATUS GetProfileTable (struct mapi_context *, struct SRowSet *)
 
enum MAPISTATUS GetPropList (mapi_object_t *, struct SPropTagArray *)
 
enum MAPISTATUS GetProps (mapi_object_t *, uint32_t, struct SPropTagArray *, struct SPropValue **, uint32_t *)
 
enum MAPISTATUS GetPropsAll (mapi_object_t *, uint32_t, struct mapi_SPropValue_array *)
 
enum MAPISTATUS GetReceiveFolder (mapi_object_t *, mapi_id_t *, const char *)
 
enum MAPISTATUS GetReceiveFolderTable (mapi_object_t *, struct SRowSet *)
 
enum MAPISTATUS GetRecipientTable (mapi_object_t *, struct SRowSet *, struct SPropTagArray *)
 
enum MAPISTATUS GetRulesTable (mapi_object_t *, mapi_object_t *, uint8_t)
 
enum MAPISTATUS GetSearchCriteria (mapi_object_t *, struct mapi_SRestriction *, uint32_t *, uint16_t *, uint64_t **)
 
enum MAPISTATUS GetStatus (mapi_object_t *, uint8_t *)
 
enum MAPISTATUS GetStoreState (mapi_object_t *, uint32_t *)
 
enum MAPISTATUS GetStreamSize (mapi_object_t *, uint32_t *)
 
enum MAPISTATUS GetTransportFolder (mapi_object_t *, mapi_id_t *)
 
enum MAPISTATUS GetUserFreeBusyData (mapi_object_t *, const char *, struct SRow *)
 
enum MAPISTATUS GetValidAttach (mapi_object_t *, uint16_t *, uint32_t **)
 
struct globset_rangeGLOBSET_parse (TALLOC_CTX *, DATA_BLOB, uint32_t *, uint32_t *)
 
char * guid_delete_dash (TALLOC_CTX *, const char *)
 
enum MAPISTATUS HardDeleteMessage (mapi_object_t *, mapi_id_t *, uint16_t)
 
enum MAPISTATUS HardDeleteMessagesAndSubfolders (mapi_object_t *)
 
enum MAPISTATUS ICSSyncConfigure (mapi_object_t *, enum SynchronizationType, uint8_t, uint16_t, uint32_t, DATA_BLOB, struct SPropTagArray *, mapi_object_t *)
 
enum MAPISTATUS ICSSyncGetTransferState (mapi_object_t *, mapi_object_t *)
 
enum MAPISTATUS ICSSyncOpenCollector (mapi_object_t *, bool, mapi_object_t *)
 
enum MAPISTATUS ICSSyncUploadStateBegin (mapi_object_t *, enum StateProperty, uint32_t)
 Initialize an ICS Initial State upload. More...
 
enum MAPISTATUS ICSSyncUploadStateContinue (mapi_object_t *, DATA_BLOB)
 Send data for an ICS Initial State upload. More...
 
enum MAPISTATUS ICSSyncUploadStateEnd (mapi_object_t *)
 Signal completion of an ICS Initial State upload. More...
 
void IDSET_dump (const struct idset *, const char *)
 
bool IDSET_includes_eid (const struct idset *, uint64_t)
 
bool IDSET_includes_guid_glob (const struct idset *, struct GUID *, uint64_t)
 
struct idsetIDSET_merge_idsets (TALLOC_CTX *mem_ctx, const struct idset *, const struct idset *)
 
struct idsetIDSET_parse (TALLOC_CTX *, DATA_BLOB, bool)
 
void IDSET_remove_rawidset (struct idset *, const struct rawidset *)
 
struct Binary_r * IDSET_serialize (TALLOC_CTX *, const struct idset *)
 
enum MAPISTATUS IsFreeBusyConflict (mapi_object_t *, struct FILETIME *, bool *)
 
bool IsMailboxFolder (mapi_object_t *, uint64_t, uint32_t *)
 
enum MAPISTATUS LoadProfile (struct mapi_context *, struct mapi_profile *)
 
enum MAPISTATUS LockRegionStream (mapi_object_t *, uint64_t, uint64_t, uint32_t)
 
enum MAPISTATUS Logoff (mapi_object_t *)
 
void mapi_copy_spropvalues (TALLOC_CTX *, struct SPropValue *, struct SPropValue *, uint32_t)
 
void mapi_errstr (const char *, enum MAPISTATUS)
 
uint32_t mapi_get_cpid_from_language (const char *)
 
uint32_t mapi_get_cpid_from_lcid (uint32_t)
 
uint32_t mapi_get_cpid_from_locale (const char *)
 
const char * mapi_get_errstr (enum MAPISTATUS)
 
char ** mapi_get_language_from_group (TALLOC_CTX *, uint32_t)
 
const char * mapi_get_language_from_lcid (uint32_t)
 
const char * mapi_get_language_from_locale (const char *)
 
uint32_t mapi_get_lcid_from_language (const char *)
 
uint32_t mapi_get_lcid_from_locale (const char *)
 
const char * mapi_get_locale_from_language (const char *)
 
const char * mapi_get_locale_from_lcid (uint32_t)
 
char * mapi_get_system_locale (void)
 
enum MAPISTATUS mapi_id_array_add_id (mapi_id_array_t *, mapi_id_t)
 
enum MAPISTATUS mapi_id_array_add_obj (mapi_id_array_t *, mapi_object_t *)
 
enum MAPISTATUS mapi_id_array_del_id (mapi_id_array_t *, mapi_id_t)
 
enum MAPISTATUS mapi_id_array_del_obj (mapi_id_array_t *, mapi_object_t *)
 
enum MAPISTATUS mapi_id_array_get (TALLOC_CTX *, mapi_id_array_t *, mapi_id_t **)
 
enum MAPISTATUS mapi_id_array_init (TALLOC_CTX *, mapi_id_array_t *)
 
enum MAPISTATUS mapi_id_array_release (mapi_id_array_t *)
 
enum MAPISTATUS mapi_nameid_canonical_add (struct mapi_nameid *, uint32_t)
 
enum MAPISTATUS mapi_nameid_custom_lid_add (struct mapi_nameid *, uint16_t, uint16_t, const char *)
 
enum MAPISTATUS mapi_nameid_custom_string_add (struct mapi_nameid *, const char *, uint16_t, const char *)
 
enum MAPISTATUS mapi_nameid_GetIDsFromNames (struct mapi_nameid *, mapi_object_t *, struct SPropTagArray *)
 
enum MAPISTATUS mapi_nameid_lid_add (struct mapi_nameid *, uint16_t, const char *)
 
enum MAPISTATUS mapi_nameid_lid_lookup (uint16_t, const char *, uint16_t *)
 
enum MAPISTATUS mapi_nameid_lid_lookup_canonical (uint16_t, const char *, uint32_t *)
 
enum MAPISTATUS mapi_nameid_lookup_SPropTagArray (struct mapi_nameid *, struct SPropTagArray *)
 
enum MAPISTATUS mapi_nameid_lookup_SPropValue (struct mapi_nameid *, struct SPropValue *, unsigned long)
 
enum MAPISTATUS mapi_nameid_map_SPropTagArray (struct mapi_nameid *, struct SPropTagArray *, struct SPropTagArray *)
 
enum MAPISTATUS mapi_nameid_map_SPropValue (struct mapi_nameid *, struct SPropValue *, uint32_t, struct SPropTagArray *)
 
struct mapi_nameidmapi_nameid_new (TALLOC_CTX *)
 
enum MAPISTATUS mapi_nameid_OOM_add (struct mapi_nameid *, const char *, const char *)
 
enum MAPISTATUS mapi_nameid_OOM_lookup (const char *, const char *, uint16_t *)
 
enum MAPISTATUS mapi_nameid_property_lookup (uint32_t)
 
enum MAPISTATUS mapi_nameid_SPropTagArray (struct mapi_nameid *, struct SPropTagArray *)
 
enum MAPISTATUS mapi_nameid_string_add (struct mapi_nameid *, const char *, const char *)
 
enum MAPISTATUS mapi_nameid_string_lookup (const char *, const char *, uint16_t *)
 
enum MAPISTATUS mapi_nameid_string_lookup_canonical (const char *, const char *, uint32_t *)
 
enum MAPISTATUS mapi_nameid_unmap_SPropTagArray (struct mapi_nameid *, struct SPropTagArray *)
 
enum MAPISTATUS mapi_nameid_unmap_SPropValue (struct mapi_nameid *, struct SPropValue *, uint32_t)
 
enum MAPISTATUS mapi_object_bookmark_debug (mapi_object_t *)
 
enum MAPISTATUS mapi_object_bookmark_get_count (mapi_object_t *, uint32_t *)
 
enum MAPISTATUS mapi_object_copy (mapi_object_t *, mapi_object_t *)
 
void mapi_object_debug (mapi_object_t *)
 
mapi_id_t mapi_object_get_id (mapi_object_t *)
 
enum MAPISTATUS mapi_object_get_logon_id (mapi_object_t *, uint8_t *)
 
struct mapi_sessionmapi_object_get_session (mapi_object_t *)
 
enum MAPISTATUS mapi_object_init (mapi_object_t *)
 
void mapi_object_release (mapi_object_t *)
 
void mapi_object_set_logon_id (mapi_object_t *, uint8_t)
 
void mapi_object_set_logon_store (mapi_object_t *)
 
void mapi_object_set_session (mapi_object_t *, struct mapi_session *)
 
enum MAPISTATUS mapi_profile_add_string_attr (struct mapi_context *, const char *, const char *, const char *)
 
enum MAPISTATUS mapi_profile_delete_string_attr (struct mapi_context *, const char *, const char *, const char *)
 
const char * mapi_profile_get_ldif_path (void)
 
enum MAPISTATUS mapi_profile_modify_string_attr (struct mapi_context *, const char *, const char *, const char *)
 
void mapi_SPropValue_array_named (mapi_object_t *, struct mapi_SPropValue_array *)
 
bool mapi_verify_cpid (uint32_t)
 
enum MAPISTATUS MAPIAllocateBuffer (struct mapi_context *, uint32_t, void **)
 
void mapidump_appointment (struct mapi_SPropValue_array *, const char *)
 
void mapidump_contact (struct mapi_SPropValue_array *, const char *)
 
void mapidump_date (struct mapi_SPropValue_array *, uint32_t, const char *)
 
void mapidump_date_SPropValue (struct SPropValue, const char *, const char *)
 
void mapidump_foldercopied (struct FolderMoveCopyNotification *, const char *)
 
void mapidump_foldercreated (struct FolderCreatedNotification *, const char *)
 
void mapidump_folderdeleted (struct FolderDeletedNotification *, const char *)
 
void mapidump_foldermoved (struct FolderMoveCopyNotification *, const char *)
 
void mapidump_freebusy_date (uint32_t, const char *)
 
void mapidump_freebusy_event (struct Binary_r *, uint32_t, uint32_t, const char *)
 
const char * mapidump_freebusy_month (uint32_t, uint32_t)
 
uint32_t mapidump_freebusy_year (uint32_t, uint32_t)
 
void mapidump_languages_list (void)
 
void mapidump_message (struct mapi_SPropValue_array *, const char *, mapi_object_t *)
 
void mapidump_message_summary (mapi_object_t *)
 
void mapidump_messagecopied (struct MessageMoveCopyNotification *, const char *)
 
void mapidump_messagecreated (struct MessageCreatedNotification *, const char *)
 
void mapidump_messagedeleted (struct MessageDeletedNotification *, const char *)
 
void mapidump_messagemodified (struct MessageModifiedNotification *, const char *)
 
void mapidump_messagemoved (struct MessageMoveCopyNotification *, const char *)
 
void mapidump_msgflags (uint32_t, const char *)
 
void mapidump_newmail (struct NewMailNotification *, const char *)
 
void mapidump_note (struct mapi_SPropValue_array *, const char *)
 
void mapidump_PAB_entry (struct PropertyRow_r *)
 Output a row of the public address book. More...
 
void mapidump_Recipients (const char **, struct SRowSet *, struct PropertyTagArray_r *flaglist)
 
void mapidump_SPropTagArray (struct SPropTagArray *)
 
void mapidump_SPropValue (struct SPropValue, const char *)
 Output one property tag and value. More...
 
void mapidump_SRow (struct SRow *, const char *)
 
void mapidump_SRowSet (struct SRowSet *, const char *)
 
void mapidump_tags (enum MAPITAGS *, uint16_t, const char *)
 
void mapidump_task (struct mapi_SPropValue_array *, const char *)
 
enum MAPISTATUS MAPIFreeBuffer (void *)
 
enum MAPISTATUS MAPIInitialize (struct mapi_context **, const char *)
 
enum MAPISTATUS MapiLogonEx (struct mapi_context *, struct mapi_session **, const char *, const char *)
 
enum MAPISTATUS MapiLogonProvider (struct mapi_context *, struct mapi_session **, const char *, const char *, enum PROVIDER_ID)
 
void MAPIUninitialize (struct mapi_context *)
 
enum MAPISTATUS ModifyPermissions (mapi_object_t *, uint8_t, struct mapi_PermissionsData *)
 
enum MAPISTATUS ModifyRecipients (mapi_object_t *, struct SRowSet *)
 
enum MAPISTATUS ModifyUserPermission (mapi_object_t *, const char *, enum ACLRIGHTS)
 
enum MAPISTATUS MonitorNotification (struct mapi_session *, void *, struct mapi_notify_continue_callback_data *)
 
enum MAPISTATUS MoveCopyMessages (mapi_object_t *, mapi_object_t *, mapi_id_array_t *, bool)
 
enum MAPISTATUS MoveFolder (mapi_object_t *, mapi_object_t *, mapi_object_t *, char *, bool)
 
void ndr_push_idset (struct ndr_push *, struct idset *)
 
__BEGIN_DECLS struct nspi_contextnspi_bind (TALLOC_CTX *, struct dcerpc_pipe *, struct cli_credentials *, uint32_t, uint32_t, uint32_t)
 
enum MAPISTATUS nspi_CompareMIds (struct nspi_context *, TALLOC_CTX *, uint32_t, uint32_t, uint32_t *)
 
enum MAPISTATUS nspi_DNToMId (struct nspi_context *, TALLOC_CTX *, struct StringsArray_r *, struct PropertyTagArray_r **ppMIds)
 
enum MAPISTATUS nspi_GetIDsFromNames (struct nspi_context *, TALLOC_CTX *, bool, uint32_t, struct PropertyName_r *, struct SPropTagArray **)
 
enum MAPISTATUS nspi_GetMatches (struct nspi_context *, TALLOC_CTX *, struct SPropTagArray *, struct Restriction_r *, uint32_t ulRequested, struct PropertyRowSet_r **, struct PropertyTagArray_r **ppOutMIds)
 
enum MAPISTATUS nspi_GetNamesFromIDs (struct nspi_context *, TALLOC_CTX *, struct FlatUID_r *, struct SPropTagArray *, struct SPropTagArray **, struct PropertyNameSet_r **)
 
enum MAPISTATUS nspi_GetPropList (struct nspi_context *, TALLOC_CTX *, bool, uint32_t, struct SPropTagArray **)
 
enum MAPISTATUS nspi_GetProps (struct nspi_context *, TALLOC_CTX *, struct SPropTagArray *, struct PropertyTagArray_r *MId, struct PropertyRowSet_r **)
 
enum MAPISTATUS nspi_GetSpecialTable (struct nspi_context *, TALLOC_CTX *, uint32_t, struct PropertyRowSet_r **)
 
enum MAPISTATUS nspi_GetTemplateInfo (struct nspi_context *, TALLOC_CTX *, uint32_t, uint32_t, char *, struct PropertyRow_r **)
 
enum MAPISTATUS nspi_ModLinkAtt (struct nspi_context *, bool, uint32_t, uint32_t, struct BinaryArray_r *)
 
enum MAPISTATUS nspi_ModProps (struct nspi_context *, TALLOC_CTX *, uint32_t, struct SPropTagArray *, struct PropertyRow_r *)
 
enum MAPISTATUS nspi_QueryColumns (struct nspi_context *, TALLOC_CTX *, bool, struct SPropTagArray **)
 
enum MAPISTATUS nspi_QueryRows (struct nspi_context *, TALLOC_CTX *, struct SPropTagArray *, struct PropertyTagArray_r *MIds, uint32_t, struct PropertyRowSet_r **)
 
enum MAPISTATUS nspi_ResolveNames (struct nspi_context *, TALLOC_CTX *, const char **, struct SPropTagArray *, struct PropertyRowSet_r ***, struct PropertyTagArray_r ***)
 
enum MAPISTATUS nspi_ResolveNamesW (struct nspi_context *, TALLOC_CTX *, const char **, struct SPropTagArray *, struct PropertyRowSet_r ***, struct PropertyTagArray_r ***)
 
enum MAPISTATUS nspi_ResortRestriction (struct nspi_context *, TALLOC_CTX *, enum TableSortOrders, struct PropertyTagArray_r *pInMIds, struct PropertyTagArray_r **ppMIds)
 
enum MAPISTATUS nspi_SeekEntries (struct nspi_context *, TALLOC_CTX *, enum TableSortOrders, struct PropertyValue_r *, struct SPropTagArray *, struct PropertyTagArray_r *pMIds, struct PropertyRowSet_r **)
 
enum MAPISTATUS nspi_unbind (struct nspi_context *)
 
enum MAPISTATUS nspi_UpdateStat (struct nspi_context *, TALLOC_CTX *, uint32_t *)
 
enum MAPISTATUS OpenAttach (mapi_object_t *, uint32_t, mapi_object_t *)
 
enum MAPISTATUS OpenEmbeddedMessage (mapi_object_t *, mapi_object_t *, enum OpenEmbeddedMessage_OpenModeFlags)
 
enum MAPISTATUS OpenFolder (mapi_object_t *, mapi_id_t, mapi_object_t *)
 
enum MAPISTATUS OpenMessage (mapi_object_t *, mapi_id_t, mapi_id_t, mapi_object_t *, uint8_t)
 
enum MAPISTATUS OpenMsgStore (struct mapi_session *, mapi_object_t *)
 
enum MAPISTATUS OpenProfile (struct mapi_context *, struct mapi_profile *, const char *, const char *)
 
enum MAPISTATUS OpenPublicFolder (struct mapi_session *, mapi_object_t *)
 
enum MAPISTATUS OpenPublicFolderByName (mapi_object_t *, mapi_object_t *, const char *)
 
enum MAPISTATUS OpenStream (mapi_object_t *, enum MAPITAGS, enum OpenStream_OpenModeFlags, mapi_object_t *)
 
enum MAPISTATUS OpenUserMailbox (struct mapi_session *, const char *, mapi_object_t *)
 
enum MAPISTATUS OptionsData (mapi_object_t *, const char *, uint8_t **, uint16_t *, uint8_t **, uint16_t *, const char **)
 
enum MAPISTATUS ProcessNetworkProfile (struct mapi_session *, const char *, mapi_profile_callback_t, const void *)
 
enum MAPISTATUS PropertyRow_addprop (struct PropertyRow_r *, struct PropertyValue_r)
 
uint32_t PropertyRowSet_propcpy (TALLOC_CTX *, struct PropertyRowSet_r *, struct PropertyValue_r)
 
enum MAPISTATUS PublicFolderIsGhosted (mapi_object_t *, mapi_object_t *, bool *)
 
enum MAPISTATUS QueryColumns (mapi_object_t *, struct SPropTagArray *)
 
enum MAPISTATUS QueryNamedProperties (mapi_object_t *, uint8_t, struct GUID *, uint16_t *, uint16_t **, struct MAPINAMEID **)
 
enum MAPISTATUS QueryPosition (mapi_object_t *, uint32_t *, uint32_t *)
 
enum MAPISTATUS QueryRows (mapi_object_t *, uint16_t, enum QueryRowsFlags, struct SRowSet *)
 
struct idsetRAWIDSET_convert_to_idset (TALLOC_CTX *, const struct rawidset *)
 
struct rawidsetRAWIDSET_make (TALLOC_CTX *, bool, bool)
 
void RAWIDSET_push_eid (struct rawidset *, uint64_t)
 
void RAWIDSET_push_guid_glob (struct rawidset *, const struct GUID *, uint64_t)
 
enum MAPISTATUS ReadRecipients (mapi_object_t *, uint32_t, uint8_t *, struct ReadRecipientRow **)
 
enum MAPISTATUS ReadStream (mapi_object_t *, unsigned char *, uint16_t, uint16_t *)
 
enum MAPISTATUS RegisterAsyncNotification (struct mapi_session *, uint32_t *)
 
enum MAPISTATUS RegisterNotification (struct mapi_session *)
 
enum MAPISTATUS Release (mapi_object_t *)
 
enum MAPISTATUS ReloadCachedInformation (mapi_object_t *)
 
enum MAPISTATUS RemoveAllRecipients (mapi_object_t *)
 
enum MAPISTATUS RemoveUserPermission (mapi_object_t *, const char *)
 
enum MAPISTATUS RenameProfile (struct mapi_context *, const char *, const char *)
 
enum MAPISTATUS Reset (mapi_object_t *)
 
enum MAPISTATUS ResolveNames (struct mapi_session *, const char **, struct SPropTagArray *, struct PropertyRowSet_r **, struct PropertyTagArray_r **, uint32_t)
 
enum MAPISTATUS Restrict (mapi_object_t *, struct mapi_SRestriction *, uint8_t *)
 
enum MAPISTATUS RfrGetFQDNFromLegacyDN (struct mapi_context *, struct mapi_session *, const char **)
 
enum MAPISTATUS RfrGetNewDSA (struct mapi_context *, struct mapi_session *, const char *, const char *, char **)
 
enum MAPISTATUS SaveChangesAttachment (mapi_object_t *, mapi_object_t *, enum SaveFlags)
 
enum MAPISTATUS SaveChangesMessage (mapi_object_t *, mapi_object_t *, uint8_t)
 
enum MAPISTATUS SeekRow (mapi_object_t *, enum BOOKMARK, int32_t, uint32_t *)
 
enum MAPISTATUS SeekRowApprox (mapi_object_t *, uint32_t, uint32_t)
 
enum MAPISTATUS SeekRowBookmark (mapi_object_t *, uint32_t, uint32_t, uint32_t *)
 
enum MAPISTATUS SeekStream (mapi_object_t *, uint8_t, uint64_t, uint64_t *)
 
struct Binary_r * set_AppointmentRecurrencePattern (TALLOC_CTX *mem_ctx, const struct AppointmentRecurrencePattern *)
 
size_t set_AppointmentRecurrencePattern_size (const struct AppointmentRecurrencePattern *)
 
enum MAPISTATUS set_default_error_SPropValue_SRow (struct SRow *, enum MAPITAGS, void *)
 
size_t set_ExceptionInfo_size (const struct ExceptionInfo *)
 
size_t set_ExtendedException_size (uint32_t, enum OverrideFlags, const struct ExtendedException *)
 
bool set_mapi_SPropValue (TALLOC_CTX *, struct mapi_SPropValue *, const void *)
 
bool set_mapi_SPropValue_proptag (TALLOC_CTX *, struct mapi_SPropValue *, uint32_t, const void *)
 
bool set_PropertyValue (struct PropertyValue_r *, const void *)
 
struct Binary_r * set_RecurrencePattern (TALLOC_CTX *, const struct RecurrencePattern *)
 
size_t set_RecurrencePattern_size (const struct RecurrencePattern *)
 
struct SPropTagArray * set_SPropTagArray (TALLOC_CTX *, uint32_t,...)
 
bool set_SPropValue (struct SPropValue *, const void *)
 
bool set_SPropValue_proptag (struct SPropValue *, enum MAPITAGS, const void *)
 
bool set_SPropValue_proptag_date_timeval (struct SPropValue *, enum MAPITAGS, const struct timeval *)
 
struct Binary_r * set_TimeZoneDefinition (TALLOC_CTX *, const struct TimeZoneDefinition *)
 
struct Binary_r * set_TimeZoneStruct (TALLOC_CTX *, const struct TimeZoneStruct *)
 
enum MAPISTATUS SetCollapseState (mapi_object_t *, struct SBinary_short *)
 
enum MAPISTATUS SetColumns (mapi_object_t *, struct SPropTagArray *)
 
enum MAPISTATUS SetDefaultProfile (struct mapi_context *, const char *)
 
enum MAPISTATUS SetLocalReplicaMidsetDeleted (mapi_object_t *, const struct GUID, const uint8_t GlobalCountLow[6], const uint8_t GlobalCountHigh[6])
 
enum MAPISTATUS SetMAPIDebugLevel (struct mapi_context *, uint32_t)
 
enum MAPISTATUS SetMAPIDumpData (struct mapi_context *, bool)
 
enum MAPISTATUS SetMessageReadFlag (mapi_object_t *, mapi_object_t *, uint8_t)
 
enum MAPISTATUS SetMessageStatus (mapi_object_t *, mapi_id_t, uint32_t, uint32_t, uint32_t *)
 
enum MAPISTATUS SetPropertiesNoReplicate (mapi_object_t *, uint32_t, struct SPropValue *, unsigned long)
 
enum MAPISTATUS SetProps (mapi_object_t *, uint32_t, struct SPropValue *, unsigned long)
 
enum MAPISTATUS SetReadFlags (mapi_object_t *, uint8_t, uint16_t, uint64_t *)
 
enum MAPISTATUS SetReceiveFolder (mapi_object_t *, mapi_object_t *, const char *)
 
enum MAPISTATUS SetRecipientType (struct SRow *, enum ulRecipClass)
 
enum MAPISTATUS SetSearchCriteria (mapi_object_t *, struct mapi_SRestriction *, uint32_t, mapi_id_array_t *)
 
enum MAPISTATUS SetSpooler (mapi_object_t *)
 
enum MAPISTATUS SetStreamSize (mapi_object_t *, uint64_t)
 
enum MAPISTATUS SetSyncNotificationGuid (mapi_object_t *, const struct GUID)
 
enum MAPISTATUS ShutDown (struct mapi_profile *)
 
enum MAPISTATUS SortTable (mapi_object_t *, struct SSortOrderSet *)
 
enum MAPISTATUS SpoolerLockMessage (mapi_object_t *, mapi_object_t *, enum LockState)
 
enum MAPISTATUS SPropTagArray_add (TALLOC_CTX *, struct SPropTagArray *, enum MAPITAGS)
 
enum MAPISTATUS SPropTagArray_delete (TALLOC_CTX *, struct SPropTagArray *, uint32_t)
 
enum MAPISTATUS SPropTagArray_find (struct SPropTagArray, enum MAPITAGS, uint32_t *)
 
enum MAPISTATUS SRow_addprop (struct SRow *, struct SPropValue)
 
uint32_t SRowSet_propcpy (TALLOC_CTX *, struct SRowSet *, struct SPropValue)
 
enum MAPISTATUS SubmitMessage (mapi_object_t *)
 
enum MAPISTATUS Subscribe (mapi_object_t *, uint32_t *, uint16_t, bool, mapi_notify_callback_t, void *)
 
enum MAPISTATUS SyncOpenAdvisor (mapi_object_t *, mapi_object_t *)
 
enum MAPISTATUS TellVersion (mapi_object_t *, uint16_t version[3])
 
enum MAPISTATUS TransportNewMail (mapi_object_t *, mapi_object_t *, mapi_object_t *, const char *, uint32_t)
 
enum MAPISTATUS TransportSend (mapi_object_t *, struct mapi_SPropValue_array *)
 
enum MAPISTATUS uncompress_rtf (TALLOC_CTX *, uint8_t *, uint32_t, DATA_BLOB *)
 
enum MAPISTATUS UnlockRegionStream (mapi_object_t *, uint64_t, uint64_t, uint32_t)
 
enum MAPISTATUS Unsubscribe (struct mapi_session *, uint32_t)
 
enum MAPISTATUS WrapCompressedRTFStream (mapi_object_t *, DATA_BLOB *)
 
enum MAPISTATUS WriteAndCommitStream (mapi_object_t *, DATA_BLOB *, uint16_t *)
 
enum MAPISTATUS WriteStream (mapi_object_t *, DATA_BLOB *, uint16_t *)
 
char * x500_get_dn_element (TALLOC_CTX *, const char *, const char *)
 
char * x500_get_servername (const char *)
 Retrieve the servername from a string We should definitively find a better way to handle this. More...
 
char * x500_truncate_dn_last_elements (TALLOC_CTX *, const char *, uint32_t)
 

Macro Definition Documentation

#define __BEGIN_DECLS
#define __END_DECLS
#define _GNU_SOURCE   1
#define _PRINTF_ATTRIBUTE (   a1,
  a2 
)    PRINTF_ATTRIBUTE(a1, a2)

struct ExtendedException has fixed response size for:

  1. ReservedBlockEE1Size: uint32_t
  2. ReservedBlockEE2Size: uint32_t
#define _PRINTF_ATTRIBUTE (   a1,
  a2 
)

struct ExtendedException has fixed response size for:

  1. ReservedBlockEE1Size: uint32_t
  2. ReservedBlockEE2Size: uint32_t
#define SIZE_DFLT_APPOINTMENTRECURRENCEPATTERN   26

struct AppointmentRecurrencePattern has fixed response size for:

  1. ReaderVersion2: uint32_t
  2. WriterVersion2: uint32_t
  3. StartTimeOffset: uint32_t
  4. EndTimeOffset: uint32_t
  5. ExceptionCount: uint16_t
  6. ReservedBlock1Size: uint32_t
  7. ReservedBlock2Size: uint32_t

Referenced by set_AppointmentRecurrencePattern_size().

#define SIZE_DFLT_EXCEPTIONINFO   22

struct ExceptionInfo has fixed response size for:

  1. StartDateTime: uint32_t
  2. EndDateTime: uint32_t
  3. OriginalStartDate: uint32_t
  4. OverrideFlags: uint16_t
  5. AppointmentColor uint32_t
  6. ReservedBlock1Size uint32_t

Referenced by set_ExceptionInfo_size().

#define SIZE_DFLT_EXTENDEDEXCEPTION   0

struct ExceptionInfo has not fixed response size

Referenced by set_ExtendedException_size().

#define SIZE_DFLT_RECURRENCEPATTERN   50

struct RecurrencePattern has fixed response size for:

  1. ReaderVersion: uint16_t
  2. WriterVersion: uint16_t
  3. RecurFrequency: uint16_t
  4. PatternType: uint16_t
  5. CalendarType: uint16_t
  6. FirstDateTime: uint32_t
  7. Period: uint32_t
  8. SlidingFlag: uint32_t
  9. EndType: uint32_t
  10. OccurrenceCount: uint32_t
  11. FirstDOW: uint32_t
  12. DeletedInstanceCount: uint32_t
  13. ModifiedInstanceCount: uint32_t
  14. StartDate: uint32_t
  15. EndDate: uint32_t

Referenced by set_RecurrencePattern_size().

Typedef Documentation

typedef enum MAPISTATUS(* fxparser_delprop_callback_t)(uint32_t, void *)
typedef enum MAPISTATUS(* fxparser_marker_callback_t)(uint32_t, void *)
typedef enum MAPISTATUS(* fxparser_namedprop_callback_t)(uint32_t, struct MAPINAMEID, void *)
typedef enum MAPISTATUS(* fxparser_property_callback_t)(struct SPropValue, void *)

Function Documentation

enum MAPISTATUS Abort ( mapi_object_t obj_table,
uint8_t *  TableStatus 
)

Aborts an asynchronous table operation in progress

Parameters
obj_tablethe table object where we want to abort an asynchronous operation
TableStatuspointer on the table status returned by the operation
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table or TableStatus are null
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS AbortSubmit ( mapi_object_t obj_store,
mapi_object_t obj_folder,
mapi_object_t obj_message 
)

Aborts a previous message submission.

Parameters
obj_storethe store object
obj_folderthe folder object where the message has been submitted
obj_messagethe submitted message object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
  • MAPI_E_UNABLE_TO_ABORT: The operation can not be aborted
  • MAPI_E_NOT_IN_QUEUE: The message is no longer in the message store's spooler queue
  • MAPI_E_NO_SUPPORT: the server object associated with the input handle index in the server object table is not of type Logon or the current logon session is a public logon.
See Also
SubmitMessage

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

struct mapi_SPropValue* add_mapi_SPropValue ( TALLOC_CTX *  ,
struct mapi_SPropValue *  ,
uint16_t *  ,
uint32_t  ,
const void *   
)
struct SPropValue* add_SPropValue ( TALLOC_CTX *  ,
struct SPropValue *  ,
uint32_t *  ,
enum  MAPITAGS,
const void *   
)
enum MAPISTATUS AddressTypes ( mapi_object_t obj_store,
uint16_t *  lpcAdrType,
struct mapi_LPSTR **  lpAdrTypeArray 
)

Returns the types of recipients that the transport provider handles.

Parameters
obj_storethe object to get recipients types from
lpcAdrTypethe count of recipients types returned
lpAdrTypeArraypointer on pointer of returned transport provider types
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_store is not initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS AddUserPermission ( mapi_object_t obj_folder,
const char *  username,
enum ACLRIGHTS  role 
)

Adds permissions for a user on a given folder

Parameters
obj_folderthe folder we add permission for
usernamethe Exchange username we add permissions for
rolethe permission mask value

The following permissions and rights are supported:

  • RightsNone
  • RightsReadItems
  • RightsCreateItems
  • RightsEditOwn
  • RightsDeleteOwn
  • RightsEditAll
  • RightsDeleteAll
  • RightsCreateSubfolders
  • RightsFolderOwner
  • RightsFolderContact
  • RoleNone
  • RoleReviewer
  • RoleContributor
  • RoleNoneditingAuthor
  • RoleAuthor
  • RoleEditor
  • RolePublishAuthor
  • RolePublishEditor
  • RightsAll
  • RoleOwner
Returns
MAPI_E_SUCCESS on success, otherwise a failure code (MAPISTATUS) indicating the error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized.
  • MAPI_E_INVALID_PARAMETER: username is NULL
See Also
ResolveNames, ModifyPermissions

References get_PropertyValue_data(), mapi_object_get_session(), MAPI_RESOLVED, MAPIFreeBuffer(), ModifyPermissions(), OPENCHANGE_RETVAL_IF, PR_DISPLAY_NAME, PR_ENTRYID, PR_MEMBER_RIGHTS, ResolveNames(), set_mapi_SPropValue(), and set_SPropTagArray().

uint32_t calculateCRC ( uint8_t *  ,
uint32_t  ,
uint32_t   
)

Referenced by compress_rtf().

uint32_t cast_mapi_SPropValue ( TALLOC_CTX *  mem_ctx,
struct mapi_SPropValue *  mapi_sprop,
struct SPropValue *  sprop 
)

Convenience function to convert a SPropValue structure into a mapi_SPropValue structure and return the associated size.

Parameters
mem_ctxpointer to the memory context to use for allocation
mapi_sproppointer to the MAPI SPropValue structure to copy data to
sproppointer to the SPropValue structure to copy data from
Returns
size of the converted data on success, otherwise 0

References get_utf8_utf16_conv_length(), PT_BINARY, PT_BOOLEAN, PT_CLSID, PT_DOUBLE, PT_ERROR, PT_I2, PT_I8, PT_LONG, PT_MV_BINARY, PT_MV_CLSID, PT_MV_LONG, PT_MV_STRING8, PT_MV_UNICODE, PT_STRING8, PT_SVREID, PT_SYSTIME, and PT_UNICODE.

Referenced by ModifyRecipients(), SetPropertiesNoReplicate(), and SetProps().

void cast_PropertyRow_to_SRow ( TALLOC_CTX *  mem_ctx,
struct PropertyRow_r *  proprow,
struct SRow *  srow 
)

Convenience function to convert a PropertyRow_r structure into a SRow structure.

Parameters
mem_ctxpointer to the allocation context for structure members
proprowpointer to the PropertyRow_r structure to copy data to
srowpointer to the SRow structure to copy data from

References cast_PropertyValue_to_SPropValue().

Referenced by cast_PropertyRowSet_to_SRowSet().

void cast_PropertyRowSet_to_SRowSet ( TALLOC_CTX *  mem_ctx,
struct PropertyRowSet_r *  prowset,
struct SRowSet *  srowset 
)

Convenience function to convert a PropertyRowSet_r structure into a SRowSet structure.

Parameters
mem_ctxpointer to the allocation context for structure members
prowsetpointer to the PropertyRowSet_r structure to copy data to
setrowsetpointer to the SRowSet structure to copy data from

References cast_PropertyRow_to_SRow().

void cast_PropertyValue_to_SPropValue ( struct PropertyValue_r *  propvalue,
struct SPropValue *  spropvalue 
)

Convenience function to convert a PropertyValue_r structure into a SPropValue structure.

Parameters
propvaluepointer to the PropertyValue_r structure to copy data to
spropvaluepointer to the SPropValue structure to copy data from

References PT_BINARY, PT_BOOLEAN, PT_CLSID, PT_ERROR, PT_I2, PT_LONG, PT_MV_BINARY, PT_MV_CLSID, PT_MV_LONG, PT_MV_STRING8, PT_MV_UNICODE, PT_STRING8, PT_SVREID, PT_SYSTIME, and PT_UNICODE.

Referenced by cast_PropertyRow_to_SRow().

uint32_t cast_SPropValue ( TALLOC_CTX *  mem_ctx,
struct mapi_SPropValue *  mapi_sprop,
struct SPropValue *  sprop 
)

Convenience function to convert a mapi_SPropValue structure into a SPropValue structure and return the associated size

Parameters
mem_ctxpointer to the memory context to use for allocation
mapi_sproppointer to the MAPI SPropValue structure to copy data from
sproppointer to the SPropValue structure to copy data to
Returns
size of the converted data on success, otherwise 0

References get_utf8_utf16_conv_length(), PT_BINARY, PT_BOOLEAN, PT_CLSID, PT_DOUBLE, PT_ERROR, PT_I2, PT_I8, PT_LONG, PT_MV_BINARY, PT_MV_CLSID, PT_MV_LONG, PT_MV_STRING8, PT_MV_UNICODE, PT_STRING8, PT_SVREID, PT_SYSTIME, and PT_UNICODE.

enum MAPISTATUS ChangeProfilePassword ( struct mapi_context mapi_ctx,
const char *  profile,
const char *  old_password,
const char *  password 
)

Change the profile password of an existing MAPI profile

Parameters
mapi_ctxpointer to the MAPI context
profilethe name of the profile to have its password changed
old_passwordthe old password
passwordthe new password
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: One of the following argument was not set: profile, old_password, password
  • MAPI_E_NOT_FOUND: The profile was not found in the database
See Also
CreateProfile, GetProfileTable, GetProfileAttr, ProcessNetworkProfile, GetLastError

References mapi_profile_modify_string_attr(), mapi_context::mem_ctx, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS CloneStream ( mapi_object_t obj_src,
mapi_object_t obj_dst 
)

Clone a source stream to another stream

Parameters
obj_srcthe source stream object
obj_dstthe destination stream object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: source or destination streams are not valid.
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenStream

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS CollapseRow ( mapi_object_t obj_table,
uint64_t  categoryId,
uint32_t *  rowCount 
)

Collapse an expanded row in a table

After a contents table has been sorted and categorized using SortTable, rows can be expanded and collapsed (using ExpandRow and CollapseRow repectively).

Parameters
obj_tablethe table we are collapsing the category in.
categoryIdthe row identification for the heading row for the category being collapsed.
rowCount(result) the number of rows that were removed from the table when the row was collapsed.

You obtain the categoryId argument from the PR_INST_ID property of the heading row for the category that is being collapsed.

If you pass rowCount as null, the number of rows will not be returned.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
ExpandRow

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS CommitStream ( mapi_object_t obj_stream)

Commits stream operations

Parameters
obj_streamthe stream object to commit
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: Either the network stream or session context are not valid.
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenStream, ReadStream, WriteStream

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS compress_rtf ( TALLOC_CTX *  ,
const char *  ,
const size_t  ,
uint8_t **  ,
size_t *   
)
enum MAPISTATUS CopyFolder ( mapi_object_t obj_folder,
mapi_object_t obj_src,
mapi_object_t obj_dst,
char *  NewFolderName,
bool  UseUnicode,
bool  WantRecursive 
)

Copy a folder

Parameters
obj_folderthe folder to copy
obj_srcsource object where the folder to copy is stored
obj_dstdestination object where the folder will be copied
NewFolderNamethe new folder name in the destination folder
UseUnicodewhether the folder name is unicode encoded or not
WantRecursivewhether we should copy folder's subdirectories or not
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developer may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenFolder, MoveFolder

References emsmdb_transaction_wrapper(), get_utf8_utf16_conv_length(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS CopyProfile ( struct mapi_context mapi_ctx,
const char *  profile_src,
const char *  profile_dst 
)

Copy a profile

Parameters
mapi_ctxpointer to the MAPI context
profile_srcthe source profile to copy from
profile_dstthe destination profile to copy to
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References mapi_context::ldb_ctx, mapi_context::mem_ctx, and OPENCHANGE_RETVAL_IF.

Referenced by DuplicateProfile().

enum MAPISTATUS CopyProps ( mapi_object_t obj_src,
mapi_object_t obj_dst,
struct SPropTagArray *  tags,
uint8_t  copyFlags,
uint16_t *  problemCount,
struct PropertyProblem **  problems 
)

Copy properties from one object to another

This function copies (or moves) specified properties from one object to another.

Parameters
obj_srcthe object to copy properties from
obj_dstthe object to set properties on
copyFlagsflags to determine whether to copy or move, and whether to overwrite existing properties.
tagsthe list of properties to copy
problemCount(return value) number of entries in the problems array
problems(return value) array of problemCount entries.

The caller is responsible for freeing the problems array using MAPIFreeBuffer(). If the problemCount pointer is NULL, then the problems array will not be returned.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetProps, SetProps, DeleteProps, CopyTo, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS CopyTo ( mapi_object_t obj_src,
mapi_object_t obj_dst,
struct SPropTagArray *  excludeTags,
uint8_t  copyFlags,
uint16_t *  problemCount,
struct PropertyProblem **  problems 
)

Copy multiple properties from one object to another

This function copies (or moves) properties from one object to another. Unlike CopyProperties, this function copies all properties except those identified.

Parameters
obj_srcthe object to copy properties from
obj_dstthe object to set properties on
excludeTagsthe list of properties to not copy
copyFlagsflags to determine whether to copy or move, and whether to overwrite existing properties.
problemCount(return value) number of entries in the problems array
problems(return value) array of problemCount entries.

The caller is responsible for freeing the problems array using MAPIFreeBuffer(). If the problemCount pointer is NULL, then the problems array will not be returned.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetProps, SetProps, DeleteProps, CopyProps

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS CopyToStream ( mapi_object_t obj_src,
mapi_object_t obj_dst,
uint64_t  ByteCount,
uint64_t *  ReadByteCount,
uint64_t *  WrittenByteCount 
)

Copy a number of bytes from a source stream to another stream

Parameters
obj_srcthe source stream object
obj_dstthe destination stream object
ByteCountthe number of bytes to copy
ReadByteCountpointer on the number of bytes read from the source object
WrittenByteCountpointer on the number of bytes written to the destination object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_BOOKMARK: the bookmark specified is invalid or beyond the last row requested.
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenStream

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS CreateAttach ( mapi_object_t obj_message,
mapi_object_t obj_attach 
)

Create a new attachment

This function creates a new attachment to an existing message.

Parameters
obj_messagethe message to attach to
obj_attachthe attachment

Both objects need to exist before you call this message. obj_message should be a valid message on the server. obj_attach needs to be initialised.

enum MAPISTATUS retval;
mapi_object_t obj_message;
mapi_object_t obj_attach;
... open or create the obj_message ...
mapi_object_init(&obj_attach);
retval = CreateAttach(&obj_message, &obj_attach);
... check the return value ...
... use SetProps() to set the attachment up ...
... perhaps OpenStream() / WriteStream() / CommitStream() on obj_attach ...
// Save the changes to the attachment and then the message
retval = SaveChangesAttachment(&obj_message, &obj_attach, KeepOpenReadOnly);
... check the return value ...
retval = SaveChangesMessage(&obj_folder, &obj_message, KeepOpenReadOnly);
... check the return value ...
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CreateMessage, GetAttachmentTable, OpenAttach, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS CreateBookmark ( mapi_object_t obj_table,
uint32_t *  lpbkPosition 
)

Marks the table current position

Parameters
obj_tablethe table we are creating a bookmark in
lpbkPositionpointer to the bookmark value. This bookmark can be passed in a call to the SeekRowBookmark method
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SeekRowBookmark, FreeBookmark

References mapi_obj_bookmark::bin, mapi_obj_table::bk_last, mapi_obj_table::bookmark, emsmdb_transaction_wrapper(), mapi_obj_bookmark::index, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

enum MAPISTATUS CreateFolder ( mapi_object_t obj_parent,
enum FOLDER_TYPE  ulFolderType,
const char *  name,
const char *  comment,
uint32_t  ulFlags,
mapi_object_t obj_child 
)

Create a folder

The function creates a folder (defined with its name, comment and type) within a specified folder.

Parameters
obj_parentthe folder to create the new folder in
ulFolderTypethe type of the folder
namethe name of the new folder
commentthe comment associated with the new folder
ulFlagsflags associated with folder creation
obj_childpointer to the newly created folder

ulFlags possible values:

  • MAPI_UNICODE: use UNICODE folder name and comment
  • OPEN_IF_EXISTS: open the folder if it already exists

ulFolderType possible values:

  • FOLDER_GENERIC
  • FOLDER_SEARCH
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenFolder, DeleteFolder, EmptyFolder, GetLastError

References emsmdb_transaction_wrapper(), get_utf8_utf16_conv_length(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_init(), mapi_object_set_handle(), mapi_object_set_id(), mapi_object_set_logon_id(), mapi_object_set_session(), MAPI_UNICODE, OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS CreateMessage ( mapi_object_t obj_folder,
mapi_object_t obj_message 
)

The function creates a message in the specified folder, and returns a pointer on this message.

Parameters
obj_folderthe folder to create the message in.
obj_messagepointer to the newly created message.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenFolder, DeleteMessage, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS CreateProfile ( struct mapi_context mapi_ctx,
const char *  profile,
const char *  username,
const char *  password,
uint32_t  flag 
)

Create a profile in the MAPI profile database

This function creates a profile named profile in the MAPI profile database and sets the specified username in that profile.

This function may also set the password. If the flags include OC_PROFILE_NOPASSWORD then the password will not be set. Otherwise, the specified password argument will also be saved to the profile.

Parameters
mapi_ctxpointer to the MAPI context
profilethe name of the profile
usernamethe username of the profile
passwordthe password for the profile (if used)
flagthe union of the flags.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized. The MAPI subsystem must be initialized (using MAPIInitialize) prior to creating a profile.
  • MAPI_E_NOT_ENOUGH_RESOURCES: MAPI subsystem failed to allocate the necessary resources to operate properly
  • MAPI_E_NO_SUPPORT: An error was encountered while setting the MAPI profile attributes in the database.
profile information (including the password, if saved to the profile) is stored unencrypted.
See Also
DeleteProfile, SetDefaultProfile, GetDefaultProfile, ChangeProfilePassword, GetProfileTable, ProcessNetworkProfile, GetLastError

References mapi_context::ldb_ctx, mapi_profile_add_string_attr(), mapi_context::mem_ctx, OC_PROFILE_NOPASSWORD, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS CreateProfileStore ( const char *  profiledb,
const char *  ldif_path 
)

Create a profile database

This function creates a new profile database, including doing an initial setup.

Parameters
profiledbthe absolute path to the profile database intended to be created
ldif_paththe absolute path to the LDIF information to use for initial setup.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_CALL_FAILED: profiledb or ldif_path is not set
  • MAPI_E_NOT_ENOUGH_RESOURCES: ldb subsystem initialization failed
  • MAPI_E_NO_ACCESS: connection or ldif add failed
See Also
GetLastError, mapi_profile_get_ldif_path

References OPENCHANGE_RETVAL_ERR, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS DeleteAttach ( mapi_object_t obj_message,
uint32_t  AttachmentID 
)

Delete an attachment from a message

This function deletes one attachment from a message. The attachment to be deleted is specified by its PR_ATTACH_NUM

Parameters
obj_messagethe message to operate on
AttachmentIDthe attachment number
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CreateMessage, GetAttachmentTable, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS DeleteFolder ( mapi_object_t obj_parent,
mapi_id_t  FolderId,
uint8_t  DeleteFolderFlags,
bool *  PartialCompletion 
)

Delete a folder

The function deletes a specified folder.

Parameters
obj_parentthe folder containing the folder to be deleted
FolderIdthe ID of the folder to delete
DeleteFolderFlagscontrol DeleteFolder operation behavior
PartialCompletionpointer on a boolean value which specify whether the operation was partially completed or not

Possible values for DeleteFolderFlags are:

  1. DEL_MESSAGES Delete all the messages in the folder
  2. DEL_FOLDERS Delete the subfolder and all of its subfolders
  3. DELETE_HARD_DELETE Hard delete the folder
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenFolder, CreateFolder, EmptyFolder, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS DeleteMessage ( mapi_object_t obj_folder,
mapi_id_t id_messages,
uint32_t  cn_messages 
)

Delete one or more messages

This function deletes one or more messages based on their ids from a specified folder.

Parameters
obj_folderthe folder to delete messages from
id_messagesthe list of ids
cn_messagesthe number of messages in the id list.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenFolder, CreateMessage, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS DeleteProfile ( struct mapi_context mapi_ctx,
const char *  profile 
)

Delete a profile from the MAPI profile database

Parameters
mapi_ctxpointer to the MAPI context
profilethe name of the profile to delete
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized. The MAPI subsystem must be initialized (using MAPIInitialize) prior to creating a profile.
  • MAPI_E_NOT_FOUND: The profile was not found in the database.
See Also
CreateProfile, ChangeProfilePassword, GetProfileTable, GetProfileAttr, ProcessNetworkProfile, GetLastError

References mapi_context::ldb_ctx, mapi_context::mem_ctx, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS DeletePropertiesNoReplicate ( mapi_object_t obj,
struct SPropTagArray *  proptags 
)

Deletes property values from an object without invoking replication.

Parameters
objthe object to remove properties from
proptagsthe properties to remove from the given object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
DeleteProps

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS DeleteProps ( mapi_object_t obj,
struct SPropTagArray *  proptags 
)

Delete one or more properties from an object

Parameters
objthe object to remove properties from
proptagsthe properties to remove from the given object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetProps, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS DispatchNotifications ( struct mapi_session session)

Force notification of pending events

This function force the server to send any pending notificaion and process them. These MAPI notifications are next compared to the registered ones and the callback specified in Subscribe() called if it matches.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
RegisterNotification, Subscribe, Unsubscribe, GetLastError

References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction_null(), mapi_session::notify_ctx, OPENCHANGE_RETVAL_IF, and ProcessNotification().

enum MAPISTATUS DuplicateProfile ( struct mapi_context mapi_ctx,
const char *  profile_src,
const char *  profile_dst,
const char *  username 
)

Duplicate an existing profile.

The username specified in parameter is used to customize the new profile. This function should only be used in environments where users are within the same administrative group, storage group, server etc. Otherwise this will create an invalid profile and may cause unpredictable results.

Parameters
mapi_ctxpointer to the MAPI context
profile_srcthe source profile to duplicate from
profile_dstthe destination profile to duplicate to
usernamethe username to replace within the destination profile
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References CopyProfile(), mapi_provider::ctx, GetLastError(), GetProfileAttr(), mapi_session::mapi_ctx, mapi_errstr(), mapi_profile_delete_string_attr(), mapi_profile_modify_string_attr(), MAPIFreeBuffer(), MapiLogonProvider(), mapi_context::mem_ctx, mapi_session::nspi, nspi_GetMatches(), nspi_GetSpecialTable(), OPENCHANGE_RETVAL_IF, OpenProfile(), PR_ANR_UNICODE, PR_EMAIL_ADDRESS, PROVIDER_ID_NSPI, RES_PROPERTY, mapi_context::session, and set_SPropTagArray().

enum MAPISTATUS EmptyFolder ( mapi_object_t obj_folder)

Empty the contents of a folder

This function empties (clears) the contents of a specified folder.

Parameters
obj_folderthe folder to empty
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenFolder, CreateFolder, DeleteFolder, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

struct emsmdb_info* emsmdb_get_info ( struct mapi_session session)

Retrieves the EMSMDB context server information structure

Parameters
sessionpointer to the MAPI session context
Returns
the server info structure on success, otherwise NULL

References mapi_provider::ctx, and mapi_session::emsmdb.

void emsmdb_get_SRowSet ( TALLOC_CTX *  mem_ctx,
struct SRowSet *  rowset,
struct SPropTagArray *  proptags,
DATA_BLOB *  content 
)

Get a SRowSet from a DATA blob

Parameters
mem_ctxpointer on the memory context
rowsetpointer on the returned SRowSe
proptagspointer on a list of property tags to lookup
contentpointer on the DATA blob content
Returns
MAPI_E_SUCCESS on success
Note
TODO: this doesn't yet handle the TypedPropertyValue and FlaggedPropertyValueWithTypeSpecified variants

References free_emsmdb_property(), PT_ERROR, pull_emsmdb_property(), and set_SPropValue().

Referenced by ExpandRow(), FindRow(), and QueryRows().

NTSTATUS emsmdb_transaction ( struct emsmdb_context emsmdb_ctx,
TALLOC_CTX *  mem_ctx,
struct mapi_request *  req,
struct mapi_response **  repl 
)

Make a EMSMDB transaction.

Parameters
emsmdb_ctxpointer to the EMSMDB connection context
mem_ctxpointer to the memory context
reqpointer to the MAPI request to send
replpointer on pointer to the MAPI reply returned by the server
Returns
NT_STATUS_OK on success, otherwise NT status error

References emsmdb_context::cache_count, emsmdb_context::cache_requests, emsmdb_context::cache_size, emsmdb_context::handle, emsmdb_context::max_data, emsmdb_context::mem_ctx, emsmdb_context::rpc_connection, and emsmdb_context::setup.

Referenced by emsmdb_transaction_wrapper().

NTSTATUS emsmdb_transaction_ext2 ( struct emsmdb_context emsmdb_ctx,
TALLOC_CTX *  mem_ctx,
struct mapi_request *  req,
struct mapi_response **  repl 
)

Make a EMSMDB EXT2 transaction.

Parameters
emsmdb_ctxpointer to the EMSMDB connection context
mem_ctxpointer to the memory context
reqpointer to the MAPI request to send
replpointer on pointer to the MAPI reply returned by the server
Returns
NT_STATUS_OK on success, otherwise NT status error

References emsmdb_context::handle, and emsmdb_context::rpc_connection.

Referenced by emsmdb_transaction_wrapper().

NTSTATUS emsmdb_transaction_null ( struct emsmdb_context emsmdb_ctx,
struct mapi_response **  res 
)

Send an empty MAPI packet - useful to keep connection up or force notifications.

Parameters
emsmdb_ctxpointer to the EMSMDB connection context
respointer on pointer to a MAPI response structure
Returns
NT_STATUS_OK on success, otherwise NT status error

References emsmdb_context::handle, MAPI_STATUS_IS_OK, emsmdb_context::max_data, emsmdb_context::mem_ctx, and emsmdb_context::rpc_connection.

Referenced by DispatchNotifications(), and MonitorNotification().

NTSTATUS emsmdb_transaction_wrapper ( struct mapi_session ,
TALLOC_CTX *  ,
struct mapi_request *  ,
struct mapi_response **   
)

References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), emsmdb_transaction_ext2(), mapi_profile::exchange_version, and mapi_session::profile.

Referenced by Abort(), AbortSubmit(), AddressTypes(), CloneStream(), CollapseRow(), CommitStream(), CopyFolder(), CopyProps(), CopyTo(), CopyToStream(), CreateAttach(), CreateBookmark(), CreateFolder(), CreateMessage(), DeleteAttach(), DeleteFolder(), DeleteMessage(), DeletePropertiesNoReplicate(), DeleteProps(), EmptyFolder(), ExpandRow(), FindRow(), FreeBookmark(), FXCopyFolder(), FXCopyMessages(), FXCopyProperties(), FXCopyTo(), FXDestConfigure(), FXGetBuffer(), FXPutBuffer(), GetAttachmentTable(), GetCollapseState(), GetContentsTable(), GetHierarchyTable(), GetIdFromLongTermId(), GetIDsFromNames(), GetLocalReplicaIds(), GetLongTermIdFromId(), GetMessageStatus(), GetNamesFromIDs(), GetOwningServers(), GetPermissionsTable(), GetPropList(), GetProps(), GetPropsAll(), GetReceiveFolder(), GetReceiveFolderTable(), GetRulesTable(), GetSearchCriteria(), GetStatus(), GetStoreState(), GetStreamSize(), GetTransportFolder(), GetValidAttach(), HardDeleteMessage(), HardDeleteMessagesAndSubfolders(), ICSSyncConfigure(), ICSSyncGetTransferState(), ICSSyncOpenCollector(), ICSSyncUploadStateBegin(), ICSSyncUploadStateContinue(), ICSSyncUploadStateEnd(), LockRegionStream(), ModifyPermissions(), ModifyRecipients(), MoveCopyMessages(), MoveFolder(), OpenAttach(), OpenEmbeddedMessage(), OpenFolder(), OpenMessage(), OpenPublicFolder(), OpenPublicFolderByName(), OpenStream(), OpenUserMailbox(), OptionsData(), PublicFolderIsGhosted(), QueryColumns(), QueryNamedProperties(), QueryPosition(), QueryRows(), ReadRecipients(), ReadStream(), Release(), ReloadCachedInformation(), RemoveAllRecipients(), Reset(), Restrict(), SaveChangesAttachment(), SaveChangesMessage(), SeekRow(), SeekRowApprox(), SeekRowBookmark(), SeekStream(), SetCollapseState(), SetColumns(), SetLocalReplicaMidsetDeleted(), SetMessageReadFlag(), SetMessageStatus(), SetPropertiesNoReplicate(), SetProps(), SetReadFlags(), SetReceiveFolder(), SetSearchCriteria(), SetSpooler(), SetStreamSize(), SetSyncNotificationGuid(), SortTable(), SpoolerLockMessage(), SubmitMessage(), Subscribe(), SyncOpenAdvisor(), TellVersion(), TransportNewMail(), TransportSend(), UnlockRegionStream(), WriteAndCommitStream(), and WriteStream().

enum MAPISTATUS EntryIDFromSourceIDForMessage ( TALLOC_CTX *  mem_ctx,
mapi_object_t obj_store,
mapi_object_t obj_folder,
mapi_object_t obj_message,
struct SBinary_short *  entryID 
)
uint64_t exchange_globcnt ( uint64_t  globcnt)

Inverts the bytes of a globcnt, such as for the ids returned by Exchange

Referenced by IDSET_dump(), IDSET_includes_eid(), and IDSET_includes_guid_glob().

enum MAPISTATUS ExpandRow ( mapi_object_t obj_table,
uint64_t  categoryId,
uint16_t  maxRows,
struct SRowSet *  rowData,
uint32_t *  expandedRowCount 
)

Expand a collapsed row in a table

After a contents table has been sorted and categorized using SortTable, rows can be expanded and collapsed (using ExpandRow and CollapseRow repectively).

Parameters
obj_tablethe table we are collapsing the category in.
categoryIdthe row identification for the heading row for the category being expanded.
maxRowsthe maximum number of rows to retrieve (can be zero)
rowData(result) the data rows under this category heading
expandedRowCount(result) the number of rows that were added to the table when the row was expanded

You obtain the categoryId argument from the PR_INST_ID property of the heading row for the category that is being collapsed.

The maxRows argument specifies the upper limit on how many rows to return (as rowData) when the category is expanded. The expandedRowCount argument returns the number of rows that were added to the table. As an example, consider a collapsed category with 8 entries. If you set maxRows to 3, then rowData will contain the data for the first three rows, and expandedRowCount will be set to 8. If you now use QueryRows(), you can read the 5 additional rows. If you'd specified maxRows as 8 (or more), rowData would have contained all 8 rows and expandedRowCount still would have been 8.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table, rowData or rowCount are NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CollapseRow

References emsmdb_get_SRowSet(), emsmdb_transaction_wrapper(), mapi_session::mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, mapi_object::private_data, and mapi_obj_table::proptags.

const void* find_mapi_SPropValue_data ( struct mapi_SPropValue_array *  ,
uint32_t   
)
const void* find_PropertyValue_data ( struct PropertyRow_r *  ,
uint32_t   
)
const void* find_SPropValue_data ( struct SRow *  ,
uint32_t   
)
enum MAPISTATUS FindProfileAttr ( struct mapi_profile profile,
const char *  attribute,
const char *  value 
)

Search the value of an attribute within a given profile

Parameters
profilepointer to the MAPI profile
attributepointer to the attribute name
valuepointer to the attribute value
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References mapi_context::ldb_ctx, mapi_profile::mapi_ctx, OPENCHANGE_RETVAL_IF, and mapi_profile::profname.

enum MAPISTATUS FindRow ( mapi_object_t obj_table,
struct mapi_SRestriction *  res,
enum BOOKMARK  bkOrigin,
enum FindRow_ulFlags  ulFlags,
struct SRowSet *  SRowSet 
)

Find the next row in a table that matches specific search criteria

Parameters
obj_tablethe table we are searching in
respointer on search criterias
bkOriginbookmark identifying the row where FindRow should begin
ulFlagscontrols the direction of the search
SRowSetthe resulting row

bkOrigin can either take the value of a bookmark created with CreateBookmark or any of the default values:

  • BOOKMARK_BEGINNING
  • BOOKMARK_CURRENT
  • BOOKMARK_END

ulFlags can be set either to DIR_FORWARD (0x0) or DIR_BACKWARD (0x1).

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_INVALID_BOOKMARK: the bookmark specified is invalid or beyond the last row requested.
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CreateBookmark

References emsmdb_get_SRowSet(), emsmdb_transaction_wrapper(), get_mapi_SRestriction_size(), mapi_session::mapi_ctx, mapi_object_bookmark_find(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, mapi_object::private_data, and mapi_obj_table::proptags.

Referenced by GetUserFreeBusyData().

enum MAPISTATUS FreeBookmark ( mapi_object_t obj_table,
uint32_t  bkPosition 
)

Release the resources associated with a bookmark

Parameters
obj_tablethe table the bookmark is associated to
bkPositionthe bookmark to be freed
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_INVALID_BOOKMARK: The bookmark specified is invalid or beyond the last row requested
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CreateBookmark

References mapi_obj_bookmark::bin, mapi_obj_table::bk_last, mapi_obj_table::bookmark, emsmdb_transaction_wrapper(), mapi_obj_bookmark::index, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), MAPIFreeBuffer(), mapi_obj_bookmark::next, OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

enum MAPISTATUS FXCopyFolder ( mapi_object_t obj,
uint8_t  copyFlags,
uint8_t  sendOptions,
mapi_object_t obj_source_context 
)

Prepare a server for Fast Transfer transmission of a folder hierachy

This function is used to configure a server for a fast-transfer folder hierachy send operation. This could be the origin server in a server->client->server copy, or for a server to client download.

This operation copies the folder object, and any sub-objects (including folder properties and messages). It can optionally copy sub-folders, depending on copyFlags.

Parameters
objthe source object for the operation (folder)
copyFlagsflags that change the copy behaviour (see below)
sendOptionsflags that change the format of the transfer (see FXCopyMessages)
obj_source_contextthe fast transfer source context for future ROPs

copyflags can be zero or more of the following:

  • FastTransferCopyFolder_CopySubfolders to recursively copy any sub-folders and contained messages
  • FastTransferCopyFolder_NoGhostedContent to omit any ghosted content when copying public folders
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS FXCopyMessages ( mapi_object_t obj,
mapi_id_array_t message_ids,
uint8_t  copyFlags,
uint8_t  sendOptions,
mapi_object_t obj_source_context 
)

Prepare a server for Fast Transfer transmission of a list of messages

This function is used to configure a server for a fast-transfer message send operation. This could be the origin server in a server->client->server copy, or for a server to client download.

This operation copies the message objects, and any sub-objects (including attachments and embedded messages).

Parameters
objthe source object for the operation (folder)
message_idsthe message IDs for the messages to copy.
copyFlagsflags that change the copy behaviour (see below)
sendOptionsflags that change the format of the transfer (see below)
obj_source_contextthe fast transfer source context for future ROPs

copyflags can be zero or more of the following:

  • FastTransferCopyMessage_Move - configure output for move
  • FastTransferCopyMessage_BestBody - output message bodies in original format (if not set, output in RTF)
  • FastTransferCopyMessage_SendEntryId - include message and change identification in the output stream

sendOptions can be zero or more of the following:

  • FastTransfer_Unicode - enable Unicode output
  • FastTransfer_UseCpid (not normally used directly - implied by ForUpload)
  • FastTransfer_ForUpload - (enable Unicode, and advise the server that transfer is server->client->server)
  • FastTransfer_RecoverMode - advise the server that the client supports recovery mode
  • FastTransfer_ForceUnicode - force Unicode output
  • FastTransfer_PartialItem - used for synchronisation download

If the FastTransfer_ForUpload is set, the next call must be TellVersion()

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References mapi_id_array::count, emsmdb_transaction_wrapper(), mapi_id_array_get(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS FXCopyProperties ( mapi_object_t obj,
uint8_t  level,
uint32_t  copyFlags,
uint8_t  sendOptions,
struct SPropTagArray *  properties,
mapi_object_t obj_source_context 
)

Prepare a server for Fast Transfer transmission of the properties of a folder, message or attachment

This function is used to configure a server for a fast-transfer download of properties. This could be the origin server in a server->client->server copy, or for a server to client download.

This operation copies the specified properties of the source object. It can optionally copy properties of sub-objects, depending on Level.

Parameters
objthe source object for the operation (folder, message or attachment)
levelwhether to copy properties of sub-objects of folders or messages (set to 0) or not (set to any other value)
copyFlagsflags that change the copy behaviour (see below)
sendOptionsflags that change the format of the transfer (see FXCopyMessages)
propertiesthe list of properties to transfer
obj_source_contextthe fast transfer source context for future ROPs

copyflags may be the following:

  • FastTransferCopyProperties_Move to configure as part of a move operation

Be careful in setting level to something other than zero. In particular, if level is non-zero for a message, then the list of recipients, and any attachments or embedded messages, will not be transferred.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS FXCopyTo ( mapi_object_t obj,
uint8_t  level,
uint32_t  copyFlags,
uint8_t  sendOptions,
struct SPropTagArray *  excludes,
mapi_object_t obj_source_context 
)

Prepare a server for Fast Transfer transmission of a folder, message or attachment

This function is used to configure a server for a fast-transfer download of a folder, message or attachment. This could be the origin server in a server->client->server copy, or for a server to client download.

This operation copies the source object, potentially omitting some properties. It can optionally copy sub-objects, depending on Level.

Parameters
objthe source object for the operation (folder, message or attachment)
levelwhether to copy sub-objects of folders or messages (set to 0) or not (set to any other value)
copyFlagsflags that change the copy behaviour (see below)
sendOptionsflags that change the format of the transfer (see FXCopyMessages)
excludesthe list of properties to exclude from the transfer
obj_source_contextthe fast transfer source context for future ROPs

copyflags can be zero or more of the following:

  • FastTransferCopyTo_Move to configure as part of a move operation
  • FastTransferCopyTo_BestBody to use original format for message bodies (if not set, use RTF instead)

Be careful in setting level to something other than zero. In particular, if level is non-zero for a message, then the list of recipients, and any attachments or embedded messages, will not be transferred.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS FXDestConfigure ( mapi_object_t obj,
enum FastTransferDestConfig_SourceOperation  sourceOperation,
mapi_object_t obj_destination_context 
)

Prepare a server for Fast Transfer receive

This function is used to configure a server for fast-transfer receive operation. This could be the target server in a server->client->server copy, or for a client->server upload.

Parameters
objthe target object for the upload (folder, message or attachment)
sourceOperationthe type of transfer (one of FastTransferDest_CopyTo, FastTransferDest_CopyProperties,FastTransferDest_CopyMessages or FastTransferDest_CopyFolder)
obj_destination_contextthe fast transfer context for future ROPs.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS FXGetBuffer ( mapi_object_t obj_source_context,
uint16_t  maxSize,
enum TransferStatus *  transferStatus,
uint16_t *  progressStepCount,
uint16_t *  totalStepCount,
DATA_BLOB *  blob 
)

Get data from source fast transfer object.

Fast transfers are done in blocks, each block transfered over a call to FXGetBuffer. If the block is small, it will fit into a single call, and the transferStatus will indicate completion. However larger transfers will require multiple calls.

Parameters
obj_source_contextthe source object (from FXCopyTo, FXCopyProperties, FXCopyFolder or FXCopyMessages)
maxSizethe maximum size (pass 0 to indicate maximum available size)
transferStatusresult of the transfer
progressStepCountthe approximate number of steps (of totalStepCount) completed
totalStepCountthe approximate number of steps (total)
blobthis part of the transfer
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

struct fx_parser_context* fxparser_init ( TALLOC_CTX *  mem_ctx,
void *  priv 
)
void fxparser_set_delprop_callback ( struct fx_parser_context parser,
fxparser_delprop_callback_t  delprop_callback 
)

set a callback function for delete properties output

References fx_parser_context::op_delprop.

void fxparser_set_marker_callback ( struct fx_parser_context parser,
fxparser_marker_callback_t  marker_callback 
)

set a callback function for marker output

References fx_parser_context::op_marker.

void fxparser_set_namedprop_callback ( struct fx_parser_context parser,
fxparser_namedprop_callback_t  namedprop_callback 
)

set a callback function for named properties output

References fx_parser_context::op_namedprop.

void fxparser_set_property_callback ( struct fx_parser_context parser,
fxparser_property_callback_t  property_callback 
)

set a callback function for property output

References fx_parser_context::op_property.

enum MAPISTATUS FXPutBuffer ( mapi_object_t obj_dest_context,
DATA_BLOB *  blob,
uint16_t *  usedSize 
)

Send data to a destination fast transfer object.

Fast transfers are done in blocks, each block transfered over a call to FXGetBuffer. If the block is small, it will fit into a single call, and the transferStatus will indicate completion. However larger transfers will require multiple calls.

Parameters
obj_dest_contextthe destination object (from FXDestConfigure)
blobthis part of the transfer
usedSizehow many bytes of this part of the transfer that were used (only less than the total if an error occurred)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

struct Binary_r* generate_recipient_entryid ( TALLOC_CTX *  ,
const char *   
)

References guid_delete_dash().

struct AddressBookEntryId* get_AddressBookEntryId ( TALLOC_CTX *  mem_ctx,
struct Binary_r *  bin 
)

Retrieve a AddressBookEntryId structure from a binary blob

Parameters
mem_ctxpointer to the memory context
binpointer to the Binary_r structure with raw AddressBookEntryId data
Returns
Allocated AddressBookEntryId structure on success, otherwise NULL
Note
Developers must free the allocated AddressBookEntryId when finished.
struct AppointmentRecurrencePattern* get_AppointmentRecurrencePattern ( TALLOC_CTX *  mem_ctx,
struct Binary_r *   
)
struct FolderEntryId* get_FolderEntryId ( TALLOC_CTX *  mem_ctx,
struct Binary_r *  bin 
)

Retrieve a FolderEntryId structure from a binary blob

Parameters
mem_ctxpointer to the memory context
binpointer to the Binary_r structure with raw FolderEntryId data
Returns
Allocated FolderEntryId structure on success, otherwise NULL
Note
Developers must free the allocated FolderEntryId when finished.
struct GlobalObjectId* get_GlobalObjectId ( TALLOC_CTX *  mem_ctx,
struct Binary_r *  bin 
)

Retrieve a GlobalObjectId structure from a binary blob

Parameters
mem_ctxpointer to the memory context
binpointer to the Binary_r structure with raw GlobalObjectId data
Returns
Allocated GlobalObjectId structure on success, otherwise NULL
Note
Developers must free the allocated GlobalObjectId when finished.
const char* get_importance ( uint32_t  )
int get_interfaces_oc ( struct iface_struct *  ,
int   
)
uint32_t get_mapi_property_size ( struct mapi_SPropValue *  )
enum MAPISTATUS get_mapi_SPropValue_array_date_timeval ( struct timeval *  ,
struct mapi_SPropValue_array *  ,
uint32_t   
)
const void* get_mapi_SPropValue_data ( struct mapi_SPropValue *  )
enum MAPISTATUS get_mapi_SPropValue_date_timeval ( struct timeval *  t,
struct SPropValue   
)

References get_SPropValue_data().

struct MessageEntryId* get_MessageEntryId ( TALLOC_CTX *  mem_ctx,
struct Binary_r *  bin 
)

Retrieve a MessageEntryId structure from a binary blob

Parameters
mem_ctxpointer to the memory context
binpointer to the Binary_r structure with raw MessageEntryId data
Returns
Allocated MessageEntryId structure on success, otherwise NULL
Note
Developers must free the allocated MessageEntryId when finished.
const char* get_namedid_name ( uint32_t  proptag)
uint16_t get_namedid_type ( uint16_t  untypedtag)
uint32_t get_namedid_value ( const char *  propname)
uint16_t get_property_type ( uint16_t  untypedtag)

References PT_ERROR, and PT_STRING8.

const void* get_PropertyValue ( struct PropertyValue_r *  ,
enum  MAPITAGS 
)
struct PropertyValue_r* get_PropertyValue_PropertyRow ( struct PropertyRow_r *  ,
enum  MAPITAGS 
)
struct PropertyValue_r* get_PropertyValue_PropertyRowSet ( struct PropertyRowSet_r *  ,
enum  MAPITAGS 
)
const void* get_PropertyValue_PropertyRowSet_data ( struct PropertyRowSet_r *  ,
uint32_t   
)
const char* get_proptag_name ( uint32_t  )
uint32_t get_proptag_value ( const char *  )
struct PtypServerId* get_PtypServerId ( TALLOC_CTX *  mem_ctx,
struct Binary_r *  bin 
)

Retrieve a PtypServerId structure from a binary blob

Parameters
mem_ctxpointer to the memory context
binpointer to the Binary_r structure with raw PtypServerId data
Returns
Allocated PtypServerId structure on success, otherwise NULL
Note
Developers must free the allocated PtypServerId when finished.
struct RecurrencePattern* get_RecurrencePattern ( TALLOC_CTX *  mem_ctx,
struct Binary_r *  bin 
)

Retrieve a RecurrencePattern structure from a binary blob

Parameters
mem_ctxpointer to the memory context
binpointer to the Binary_r structure with non-mapped reccurrence data
Returns
Allocated RecurrencePattern structure on success, otherwise NULL
Note
Developers must free the allocated RecurrencePattern when finished.
const void* get_SPropValue ( struct SPropValue *  ,
enum  MAPITAGS 
)
struct SPropValue* get_SPropValue_SRow ( struct SRow *  ,
uint32_t   
)
const void* get_SPropValue_SRow_data ( struct SRow *  ,
uint32_t   
)
struct SPropValue* get_SPropValue_SRowSet ( struct SRowSet *  ,
uint32_t   
)
const void* get_SPropValue_SRowSet_data ( struct SRowSet *  ,
uint32_t   
)
const char* get_task_status ( uint32_t  )
struct TimeZoneStruct* get_TimeZoneStruct ( TALLOC_CTX *  mem_ctx,
struct Binary_r *  bin 
)

Retrieve a TimeZoneStruct structure from a binary blob

Parameters
mem_ctxpointer to the memory context
binpointer to the Binary_r structure with raw TimeZoneStruct data
Returns
Allocated TimeZoneStruct structure on success, otherwise NULL
Note
Developers must free the allocated TimeZoneStruct when finished.
const char* get_TypedString ( struct TypedString *  tstring)

Return the effective value used in a TypedString structure.

Parameters
tstringpointer to TypedString structure
Returns
pointer to a valid string on success, otherwise NULL

Referenced by OpenMessage().

enum MAPISTATUS GetABRecipientInfo ( struct mapi_session session,
const char *  username,
struct SPropTagArray *  pPropTags,
struct PropertyRowSet_r **  ppRowSet 
)

Retrieve Address Book information for a given recipient

Parameters
sessionpointer to the MAPI session context
usernamepointer to the username to retrieve information from
pPropTagspointer to the property tags array to lookup
ppRowSetpointer on pointer to the results

Note that if pPropTags is NULL, then GetABNameInfo will fetch the following default property tags:

  1. PR_ADDRTYPE_UNICODE
  2. PR_EMAIL_ADDRESS_UNICODE
  3. PR_DISPLAY_NAME_UNICODE
  4. PR_OBJECT_TYPE
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  1. MAPI_E_NOT_INITIALIZED if MAPI subsystem is not initialized
  2. MAPI_E_SESSION_LIMIT if the NSPI session is unavailable
  3. MAPI_E_INVALID_PARAMETER if a function parameter is invalid
  4. MAPI_E_NOT_FOUND if the username to lookup doesn't match any records
See Also
nspi_DNToMId, nspi_GetProps

References mapi_provider::ctx, get_PropertyValue_PropertyRowSet_data(), MAPI_RESOLVED, MAPI_UNICODE, MAPIFreeBuffer(), nspi_context::mem_ctx, mapi_session::nspi, nspi_DNToMId(), nspi_GetProps(), OPENCHANGE_RETVAL_IF, PR_7BIT_DISPLAY_NAME_UNICODE, PR_ADDRTYPE_UNICODE, PR_DISPLAY_NAME_UNICODE, PR_DISPLAY_TYPE, PR_EMAIL_ADDRESS_UNICODE, PR_ENTRYID, PR_OBJECT_TYPE, PR_SEARCH_KEY, PR_SEND_INTERNET_ENCODING, PR_SEND_RICH_INFO, PR_SMTP_ADDRESS_UNICODE, PR_TRANSMITTABLE_DISPLAY_NAME_UNICODE, mapi_session::profile, ResolveNames(), and set_SPropTagArray().

Referenced by GetUserFreeBusyData().

enum MAPISTATUS GetAttachmentTable ( mapi_object_t obj_message,
mapi_object_t obj_table 
)

Retrieve the attachment table for a message

Parameters
obj_messagethe message
obj_tablethe attachment table for the message
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CreateMessage, OpenMessage, CreateAttach, OpenAttach, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetBestBody ( mapi_object_t obj_message,
uint8_t *  format 
)

Implement the BestBody algorithm and return the best body content type for a given message.

Parameters
obj_messagethe message we find the best body for
formatthe format - see below.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND. If MAPI_E_NOT_FOUND is returned then format is set to 0x0 (undefined). If MAPI_E_SUCCESS is returned, then format can have one of the following values:
  • olEditorText: format is plain text
  • olEditorHTML: format is HTML
  • olEditorRTF: format is RTF

References find_SPropValue_data(), GetProps(), mapi_session::mapi_ctx, mapi_object_get_session(), MAPIFreeBuffer(), mapi_context::mem_ctx, olEditorHTML, olEditorRTF, olEditorText, OPENCHANGE_RETVAL_ERR, OPENCHANGE_RETVAL_IF, PR_BODY_ERROR, PR_BODY_HTML_ERROR, PR_BODY_UNICODE, PR_HTML, PR_RTF_COMPRESSED, PR_RTF_COMPRESSED_ERROR, PR_RTF_IN_SYNC, and set_SPropTagArray().

enum MAPISTATUS GetCollapseState ( mapi_object_t obj_table,
uint64_t  rowId,
uint32_t  rowInstanceNumber,
struct SBinary_short *  CollapseState 
)

Get the Collapse State of a Table

After a contents table has been sorted and categorized using SortTable, rows can be expanded and collapsed (using ExpandRow() and CollapseRow() repectively). You can save the state of the table using this function, and restore it using SetCollapseState.

Parameters
obj_tablethe table we are retrieving the state from
rowIdthe row number for the cursor
rowInstanceNumberthe instance number for the cursor
CollapseState(result) the returned table Collapse State

You obtain the row number and row instance number arguments from the PR_INST_ID and PR_INST_NUM properties of the row you want to use as the cursor.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table or CollapseState are null
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetCollapseState

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetContentsTable ( mapi_object_t obj_container,
mapi_object_t obj_table,
uint8_t  TableFlags,
uint32_t *  RowCount 
)

Returns a pointer to a container's table object

This function takes a pointer to a container object and returns a pointer to its associated contents

Parameters
obj_containerthe object to get the contents of
obj_tablethe resulting table containing the container's contents.
TableFlagsflags controlling the type of table
RowCountthe number of rows in the hierarchy table

TableFlags possible values:

  • TableFlags_Associated (0x2): Get the contents table for "Folder Associated Information" messages, rather than normal messages.
  • TableFlags_DeferredErrors (0x8): The call response can return immediately, possibly before the call execution is complete and in this case the ReturnValue as well the RowCount fields in the return buffer might not be accurate. Only retval reporting failure can be considered valid in this case.
  • TableFlags_NoNotifications (0x10): Disables all notifications on .this Table object.
  • TableFlags_SoftDeletes (0x20): Enables the client to get a list of the soft deleted folders.
  • TableFlags_UseUnicode (0x40): Requests that the columns that contain string data be returned in Unicode format.
  • TableFlags_SuppressNotifications (0x80): Suppresses notifications generated by this client’s actions on this Table object.

Developers can either set RowCount to a valid pointer on uint32_t or set it to NULL. In this last case, GetHierarchyTable won't return any value to the calling function.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenFolder, GetHierarchyTable, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), mapi_object_table_init(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by GetUserFreeBusyData().

enum MAPISTATUS GetDefaultFolder ( mapi_object_t obj_store,
uint64_t *  folder,
const uint32_t  id 
)

Retrieves the folder id for the specified default folder in a mailbox store

Parameters
obj_storethe store to search
idthe type of folder to search for
folderthe resulting folder reference

The following types of folders are supported:

  • olFolderTopInformationStore
  • olFolderDeletedItems
  • olFolderOutbox
  • olFolderSentMail
  • olFolderInbox
  • olFolderCommonView
  • olFolderCalendar
  • olFolderContacts
  • olFolderJournal
  • olFolderNotes
  • olFolderTasks
  • olFolderDrafts
  • olFolderReminders
  • olFolderFinder

Note that this function will cache FID values for common accessed folders such as calendar, contact, journal, note, task and drafts until the store object got released.

Returns
MAPI_E_SUCCESS on success, otherwise a failure code (MAPISTATUS) indicating the error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized.
  • MAPI_E_INVALID_PARAMETER: obj_store is undefined
  • MAPI_E_NOT_FOUND: The specified folder could not be found or is not yet supported.
See Also
MAPIInitialize, OpenMsgStore, GetLastError
Examples:
fetchappointment.c, and fetchmail.c.

References mapi_obj_store::fid_calendar, mapi_obj_store::fid_common_views, mapi_obj_store::fid_contact, mapi_obj_store::fid_deleted_items, mapi_obj_store::fid_drafts, mapi_obj_store::fid_inbox, mapi_obj_store::fid_journal, mapi_obj_store::fid_mailbox_root, mapi_obj_store::fid_note, mapi_obj_store::fid_outbox, mapi_obj_store::fid_search, mapi_obj_store::fid_sent_items, mapi_obj_store::fid_task, mapi_obj_store::fid_top_information_store, olFolderCalendar, olFolderCommonView, olFolderContacts, olFolderDeletedItems, olFolderDrafts, olFolderFinder, olFolderInbox, olFolderJournal, olFolderMailboxRoot, olFolderNotes, olFolderOutbox, olFolderSentMail, olFolderTasks, olFolderTopInformationStore, OPENCHANGE_RETVAL_ERR, OPENCHANGE_RETVAL_IF, mapi_object::private_data, PrivateFolderWithoutCachedFids, and mapi_obj_store::store_type.

enum MAPISTATUS GetDefaultProfile ( struct mapi_context mapi_ctx,
char **  profname 
)

Get the default profile from the database

Parameters
mapi_ctxpointer to the MAPI context
profnamethe result of the function (name of the default profile)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_NOT_FOUND: The profile was not found in the database
On success GetDefaultProfile profname string is allocated. It is up to the developer to free it when not needed anymore.
See Also
SetDefaultProfile, GetProfileTable, GetLastError

References get_SPropValue_SRow(), GetProfileTable(), mapi_context::mem_ctx, OPENCHANGE_RETVAL_ERR, OPENCHANGE_RETVAL_IF, PR_DEFAULT_PROFILE, and PR_DISPLAY_NAME.

enum MAPISTATUS GetDefaultPublicFolder ( mapi_object_t obj_store,
uint64_t *  folder,
const uint32_t  id 
)

Retrieve the folder id for the specified default folder in a public folder store

Parameters
obj_storethe store to search
idthe type of folder to search for
folderthe resulting folder reference

The following types of folders are supported:

  • olFolderPublicRoot - the parent (directly or indirectly) for the folders below
  • olFolderPublicIPMSubtree - Interpersonal Messages (IPM) folders
  • olFolderPublicNonIPMSubtree - Non-interpersonal message folders
  • olFolderPublicEFormsRoot - EForms Registry Root Folder
  • olFolderPublicFreeBusyRoot - Free/busy root folder
  • olFolderPublicOfflineAB - Offline address book root folder
  • olFolderPublicEFormsRegistry - EForms Registry for the users locale
  • olFolderPublicLocalFreeBusy - Site local free/busy folders
  • olFolderPublicLocalOfflineAB - Site local Offline address book
  • olFolderPublicNNTPArticle - NNTP article index folder
Returns
MAPI_E_SUCCESS on success, otherwise a failure code (MAPISTATUS) indicating the error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized.
  • MAPI_E_INVALID_PARAMETER: obj_store is undefined
  • MAPI_E_NOT_FOUND: The specified folder could not be found or is not yet supported.
See Also
MAPIInitialize, OpenPublicFolder, GetLastError

References olFolderPublicEFormsRegistry, olFolderPublicEFormsRoot, olFolderPublicFreeBusyRoot, olFolderPublicIPMSubtree, olFolderPublicLocalFreeBusy, olFolderPublicLocalOfflineAB, olFolderPublicNNTPArticle, olFolderPublicNonIPMSubtree, olFolderPublicOfflineAB, olFolderPublicRoot, OPENCHANGE_RETVAL_ERR, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

Referenced by GetUserFreeBusyData().

enum MAPISTATUS GetFIDFromEntryID ( uint16_t  cb,
uint8_t *  lpb,
uint64_t  parent_fid,
uint64_t *  fid 
)

Create a FID from an EntryID

Parameters
cbcount of lpb bytes
lpbpointer on an array of bytes
parent_fidthe parent folder identifier
fidpointer to the returned fid
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_INVALID_PARAMETER

References OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetFolderItemsCount ( mapi_object_t obj_folder,
uint32_t *  unread,
uint32_t *  total 
)

Retrieves the total and unread number of items for a specified folder.

Parameters
obj_folderthe folder to get item counts for
unreadthe number of items in the folder (result)
totalthe number of items in the folder, including unread items (result)
Returns
MAPI_E_SUCCESS on success, otherwise a failure code (MAPISTATUS) indicating the error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized.
  • MAPI_E_INVALID_PARAMETER: obj_folder is undefined
  • MAPI_E_NOT_FOUND: The specified folder could not be found or is not yet supported.
See Also
MAPIInitialize, OpenFolder, GetLastError

References GetProps(), mapi_object_get_session(), MAPIFreeBuffer(), OPENCHANGE_RETVAL_IF, PR_CONTENT_COUNT, PR_CONTENT_UNREAD, and set_SPropTagArray().

int GetFreeBusyYear ( const uint32_t *  publish_start)

Return the year associated with the FreeBusy start range

Parameters
publish_startpointer to the publish start integer
Returns
a valid year on success, otherwise 0

Referenced by IsFreeBusyConflict().

enum MAPISTATUS GetGALTable ( struct mapi_session session,
struct SPropTagArray *  SPropTagArray,
struct PropertyRowSet_r **  rowsetp,
uint32_t  count,
uint8_t  ulFlags 
)

Retrieve the global address list

The Global Address List is the full list of email addresses (and other account-type things, such as "rooms" and distribution lists) accessible on the server. A user will usually have access to both a personal address book, and to the Global Address List. Public Address Book is another name for Global Address List.

You access the Global Address List by setting the list of things that you want to retrieve from the Global Address List as property names in the SPropTagArray argument, and then calling this function. The results are returned in SRowSet.

You can get a convenient output of the results using mapidump_PAB_entry() for each row returned.

Parameters
sessionpointer to the MAPI session context
SPropTagArraypointer to an array of MAPI properties we want to fetch
SRowSetpointer to the rows of the table returned
countthe number of rows we want to fetch
ulFlagsspecify the table cursor location

Possible value for ulFlags:

  1. TABLE_START: Fetch rows from the beginning of the table
  2. TABLE_CUR: Fetch rows from current table location

The Global Address List may be quite large (tens of thousands of entries in a large deployment), so you usually call this function with ulFlags set to TABLE_START the first time, and then subsequent calls will be made with TABLE_CUR to progress through the table.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  1. MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  2. MAPI_E_SESSION_LIMIT: No session has been opened on the provider
  3. MAPI_E_INVALID_PARAMETER: if a function parameter is invalid
  4. MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
MapiLogonEx, MapiLogonProvider, mapidump_PAB_entry

References mapi_provider::ctx, nspi_context::mem_ctx, mapi_session::nspi, nspi_QueryRows(), OPENCHANGE_RETVAL_IF, nspi_context::pStat, and TABLE_START.

enum MAPISTATUS GetGALTableCount ( struct mapi_session session,
uint32_t *  totalRecs 
)

Retrieve the total number of records in the global address list

The Global Address List is the full list of email addresses (and other account-type things, such as "rooms" and distribution lists) accessible on the server. A user will usually have access to both a personal address book, and to the Global Address List. Public Address Book is another name for Global Address List.

Parameters
sessionpointer to the MAPI session context
totalRecspointers to the total number of records in the global address list returned
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  1. MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  2. MAPI_E_SESSION_LIMIT: No session has been opened on the provider
  3. MAPI_E_INVALID_PARAMETER: if a function parameter is invalid
  4. MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References mapi_provider::ctx, nspi_context::mem_ctx, mapi_session::nspi, nspi_QueryRows(), OPENCHANGE_RETVAL_IF, and nspi_context::pStat.

enum MAPISTATUS GetHierarchyTable ( mapi_object_t obj_container,
mapi_object_t obj_table,
uint8_t  TableFlags,
uint32_t *  RowCount 
)

Returns a pointer to a container's table object

This function takes a pointer to a container object and returns a pointer to its associated hierarchy table

Parameters
obj_containerthe object to get the contents of
obj_tablethe resulting table containing the container's hierarchy
TableFlagsflags controlling the type of table
RowCountthe number of rows in the hierarchy table

TableFlags possible values:

  • TableFlags_Depth (0x4): Fills the hierarchy table with containers from all levels. If this flag is not set, the hierarchy table contains only the container's immediate child containers.
  • TableFlags_DeferredErrors (0x8): The call response can return immediately, possibly before the call execution is complete and in this case the ReturnValue as well the RowCount fields in the return buffer might not be accurate. Only retval reporting failure can be considered valid in this case.
  • TableFlags_NoNotifications (0x10): Disables all notifications on .this Table object.
  • TableFlags_SoftDeletes (0x20): Enables the client to get a list of the soft deleted folders.
  • TableFlags_UseUnicode (0x40): Requests that the columns that contain string data be returned in Unicode format.
  • TableFlags_SuppressNotifications (0x80): Suppresses notifications generated by this client’s actions on this Table object.

Developers can either set RowCount to a valid pointer on uint32_t or set it to NULL. In this last case, GetHierarchyTable won't return any value to the calling function.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenFolder, GetContentsTable, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), mapi_object_table_init(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by GetUserFreeBusyData().

enum MAPISTATUS GetIdFromLongTermId ( mapi_object_t obj,
struct LongTermId  long_term_id,
mapi_id_t id 
)

Convert an Long Term Id into an Id

The function looks up the Id for a specified Long Term Id value.

Parameters
objthe object to look up on
long_term_idthe id to look up
idthe id returned by the server
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj is null
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetLongTermIdFromId

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetIDsFromNames ( mapi_object_t obj,
uint16_t  count,
struct MAPINAMEID *  nameid,
uint32_t  ulFlags,
struct SPropTagArray **  proptags 
)

Provides the property identifiers that correspond to one or more property names.

Parameters
objthe object we are retrieving the identifiers from
countcount of property names pointed to by the nameid parameter.
nameidpointer to an array of property names
ulFlagsindicates how the property identifiers should be returned
proptagspointer to a pointer to an array of property tags containing existing or newly assigned property identifiers. Property types in this array are set to PT_NULL.

ulFlags can be set to:

  • 0 retrieves named properties from the server
  • MAPI_CREATE create the named properties if they don't exist on the server
Note
count and nameid parameter can automatically be built using the mapi_nameid API.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetNamesFromIds, QueryNamesFromIDs, mapi_nameid_new

References emsmdb_transaction_wrapper(), get_utf8_utf16_conv_length(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and PT_UNSPECIFIED.

Referenced by GetProps(), mapi_nameid_GetIDsFromNames(), SetPropertiesNoReplicate(), and SetProps().

enum MAPISTATUS GetLastError ( void  )

Returns the latest error code.

This function returns the error code set by a previous function call.

Note
Calls to this function may not work reliably in multi-threaded or multisession code. We suggest you capture the return value of the call, and check that instead.

Referenced by DuplicateProfile(), mapi_nameid_GetIDsFromNames(), OpenMsgStore(), and WrapCompressedRTFStream().

enum MAPISTATUS GetLoadparmContext ( struct mapi_context mapi_ctx,
struct loadparm_context **  lp_ctx 
)

Retrieve the MAPI loadparm context for specified MAPI context

Parameters
mapi_ctxpointer to the MAPI context
lp_ctxpointer to a pointer to the loadparm context that the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_INITIALIZED or MAPI_E_INVALID_PARAMETER

References mapi_context::lp_ctx, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetLocalReplicaIds ( mapi_object_t obj_store,
uint32_t  IdCount,
struct GUID *  ReplGuid,
uint8_t  GlobalCount[6] 
)

Reserves a range of IDs to be used by a local replica

Parameters
obj_storepointer on the store MAPI object
IdCountID range length to reserve
ReplGuidpointer to the GUID structure returned by the server
GlobalCountbyte array that specifies the first allocated field
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetLongTermIdFromId ( mapi_object_t obj,
mapi_id_t  id,
struct LongTermId *  long_term_id 
)

Convert an ID to a Long Term Id

The function looks up the Long Term Id for a specified ID value.

Parameters
objthe object to look up on
idthe id to look up
long_term_idthe long term ID returned from the server
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj is null
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetIdFromLongTermId

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetMessageStatus ( mapi_object_t obj_folder,
mapi_id_t  msgid,
uint32_t *  ulStatus 
)

Obtain the status associated with a message

This function obtains the status associated with a message in the given folder.

Parameters
obj_folderthe folder where the message is located
msgidthe message ID
ulStatusthe message status
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetNamesFromIDs ( mapi_object_t obj,
enum MAPITAGS  ulPropTag,
uint16_t *  count,
struct MAPINAMEID **  nameid 
)

Provides the property names that correspond to one or more property identifiers.

Parameters
objthe object we are retrieving the names from
ulPropTagthe mapped property tag
countcount of property names pointed to by the nameid parameter returned by the server
nameidpointer to a pointer to property names returned by the server

ulPropTag must be a property with type set to PT_NULL

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetIDsFromNames, QueryNamesFromIDs

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by mapi_SPropValue_array_named().

enum MAPISTATUS GetOutboxFolder ( mapi_object_t obj_store,
mapi_id_t outbox_id 
)

Retrieves the sending folder (OUTBOX) for a given store

This function obtains the folder that was established as the destination for outgoing messages of a specified message class.

This function does not result in any network traffic.

Parameters
obj_storethe store to get the outbox folder for
outbox_idthe resulting folder identification
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
MAPIInitialize, OpenMsgStore, GetLastError, GetDefaultFolder

References OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

enum MAPISTATUS GetOwningServers ( mapi_object_t obj_store,
mapi_object_t obj_folder,
uint16_t *  OwningServersCount,
uint16_t *  CheapServersCount,
char **  OwningServers 
)

Get the list of servers that host replicas of a given public folder.

Parameters
obj_storethe public folder store object
obj_folderthe folder object we search replica for
OwningServersCountnumber of OwningServers
CheapServersCountnumber of low-cost servers
OwningServerspointer on the list of NULL terminated ASCII string representing replica servers
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
ecNoReplicaAvailable (0x469) can be returned if no replica is available for the folder.

Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:

  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetPermissionsTable ( mapi_object_t obj_container,
uint8_t  flags,
mapi_object_t obj_table 
)

Returns a pointer to the permission's table object.

This function takes a pointer to a container object and returns a pointer to its associated permission table

Parameters
obj_containerthe object to get the contents of
flagsany special flags to pass
obj_tablethe resulting table containing the container's permissions
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

The only meaningful value for flags is IncludeFreeBusy (0x02). This should be set when getting permissions on the Calendar folder when using Exchange 2007 and later. It should not be set in other situations.

Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
ModifyPermissions

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), mapi_object_table_init(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by ModifyUserPermission(), and RemoveUserPermission().

enum MAPISTATUS GetProfileAttr ( struct mapi_profile profile,
const char *  attribute,
unsigned int *  count,
char ***  value 
)

Retrieve attribute values from a profile

This function retrieves all the attribute values from the given profile. The number of results is stored in count and values are stored in an allocated string array in the value parameter that needs to be free'd using MAPIFreeBuffer().

Parameters
profilethe name of the profile to retrieve attributes from
attributethe attribute(s) to search for
countthe number of results
valuethe resulting values
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: Either profile or attribute was not set properly
  • MAPI_E_NOT_FOUND: The profile was not found in the database
See Also
SetDefaultProfile, GetDefaultProfile, MAPIFreeBuffer, GetProfileTable, GetLastError

References mapi_context::ldb_ctx, mapi_profile::mapi_ctx, OPENCHANGE_RETVAL_IF, and mapi_profile::profname.

Referenced by DuplicateProfile().

enum MAPISTATUS GetProfileTable ( struct mapi_context mapi_ctx,
struct SRowSet *  proftable 
)

Retrieve the profile table

This function retrieves the profile table. Two fields are returned:

  • PR_DISPLAY_NAME: The profile name stored as a UTF8 string
  • PR_DEFAULT_PROFILE: Whether the profile is the default one(1) or not(0), stored as an integer
Parameters
mapi_ctxpointer to the MAPI context
proftablethe result of the call
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_NOT_FOUND: The profile was not found in the database
See Also
SetDefaultProfile, GetLastError

References mapi_context::ldb_ctx, mapi_context::mem_ctx, OPENCHANGE_RETVAL_IF, PR_DEFAULT_PROFILE, and PR_DISPLAY_NAME.

Referenced by GetDefaultProfile(), and RenameProfile().

enum MAPISTATUS GetPropList ( mapi_object_t obj,
struct SPropTagArray *  proptags 
)

Retrieve all the properties associated with a given object

Parameters
objthe object to retrieve properties for
proptagsthe resulting list of properties associated with the object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

    The developer MUST provide an allocated SPropTagArray structure to the function.

See Also
GetProps, GetPropsAll, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetProps ( mapi_object_t obj,
uint32_t  flags,
struct SPropTagArray *  SPropTagArray,
struct SPropValue **  lpProps,
uint32_t *  PropCount 
)

Returns values of one or more properties for an object

The function takes a pointer on the object obj, a MAPITAGS array specified in mapitags, and the count of properties. The function returns associated values within the SPropValue values pointer.

The array of MAPI property tags can be filled with both known and named properties.

Parameters
objthe object to get properties on
flagsFlags for behaviour; can be bit-OR of MAPI_UNICODE and MAPI_PROPS_SKIP_NAMEDID_CHECK constants
SPropTagArrayan array of MAPI property tags
lpPropsthe result of the query
PropCountthe count of property tags
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj or SPropTagArray are null, or the session context could not be obtained
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetProps, GetPropList, GetPropsAll, DeleteProps, GetLastError

References mapi_nameid::count, emsmdb_get_SPropValue(), emsmdb_transaction_wrapper(), GetIDsFromNames(), mapi_session::mapi_ctx, mapi_nameid_lookup_SPropTagArray(), mapi_nameid_map_SPropTagArray(), mapi_nameid_new(), mapi_nameid_unmap_SPropTagArray(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), MAPI_PROPS_SKIP_NAMEDID_CHECK, MAPI_UNICODE, MAPIFreeBuffer(), mapi_nameid::nameid, OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by EntryIDFromSourceIDForMessage(), GetBestBody(), GetFolderItemsCount(), and GetUserFreeBusyData().

enum MAPISTATUS GetPropsAll ( mapi_object_t obj,
uint32_t  flags,
struct mapi_SPropValue_array *  properties 
)

Retrieve all properties and values associated with an object

This function returns all the properties and and associated values for a given object.

Parameters
objthe object to get the properties for
flagsFlags for behaviour; can be a MAPI_UNICODE constant
propertiesthe properties / values for the object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetProps, GetPropList, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), MAPI_UNICODE, OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetReceiveFolder ( mapi_object_t obj_store,
mapi_id_t id_folder,
const char *  MessageClass 
)

Gets the receive folder for incoming messages of a particular message class.

This function obtains the folder that was established as the destination for incoming messages of a specified message class, or the default receive folder for the message store.

Parameters
obj_storethe store to get the receiver folder for
id_folderthe resulting folder identification
MessageClasswhich message class to find the receivefolder for
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
MAPIInitialize, OpenMsgStore, GetLastError, SetReceiveFolder, GetReceiveFolderTable

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetReceiveFolderTable ( mapi_object_t obj_store,
struct SRowSet *  SRowSet 
)

Retrieve the receive folder table which includes all the information about the receive folders for the message store

Parameters
obj_storethe message store object
SRowSetpointer on a SRowSet structure with GetReceiveFolderTable results.

Developers are required to call MAPIFreeBuffer(SRowSet.aRow) when they don't need the folder table data anymore.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetReceiveFolder, SetReceiveFolder

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, PR_FID, PR_LAST_MODIFICATION_TIME, and PR_MESSAGE_CLASS.

enum MAPISTATUS GetRecipientTable ( mapi_object_t obj_message,
struct SRowSet *  SRowSet,
struct SPropTagArray *  SPropTagArray 
)

Returns the message recipient table

Parameters
obj_messagethe message to receive recipients from
SRowSetpointer to the recipient table
SPropTagArraypointer to the array of properties listed in the recipient table
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
See Also
OpenMessage

References OPENCHANGE_RETVAL_IF, mapi_object::private_data, mapi_obj_message::SPropTagArray, and mapi_obj_message::SRowSet.

enum MAPISTATUS GetRulesTable ( mapi_object_t obj_folder,
mapi_object_t obj_table,
uint8_t  TableFlags 
)

Gets the rules table of a folder

Parameters
obj_folderthe folder we want to retrieve the rules table from
obj_tablethe rules table
TableFlagsbitmask associated to the rules table

Possible values for TableFlags:

  • RulesTableFlags_Unicode (0x40): Set if the client is requesting that string values in the table to be returned as Unicode strings.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), mapi_object_table_init(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetSearchCriteria ( mapi_object_t obj_container,
struct mapi_SRestriction *  res,
uint32_t *  SearchFlags,
uint16_t *  FolderIdCount,
uint64_t **  FolderIds 
)

Obtains the search criteria for a container

Parameters
obj_containerthe object we retrieve search criteria from
respointer to a mapi_SRestriction structure defining the search criteria
SearchFlagsbitmask of flags that controls how the search is performed
FolderIdCountnumber of FolderIds entries
FolderIdspointer to a list of identifiers representing containers included in the search
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetSearchCriteria

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetStatus ( mapi_object_t obj_table,
uint8_t *  TableStatus 
)

Get the status of a table

Parameters
obj_tablethe table we are retrieving the status from
TableStatusthe table status result

TableStatus can either hold:

  • TBLSTAT_COMPLETE (0x0)
  • TBLSTAT_SORTING (0x9)
  • TBLSTAT_SORT_ERROR (0xA)
  • TBLSTAT_SETTING_COLS (0xB)
  • TBLSTAT_SETCOL_ERROR (0xD)
  • TBLSTAT_RESTRICTING (0xE)
  • TBLSTAT_RESTRICT_ERROR (0xF)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_INVALID_BOOKMARK: the bookmark specified is invalid or beyond the last row requested.
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetColumns, Restrict, FindRow, GetHierarchyTable, GetContentsTable

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetStoreState ( mapi_object_t obj_store,
uint32_t *  StoreState 
)

Gets the current store state for the logged in user

This operation must be performed against a user store (not against a Public Folder store). The StoreState will have the STORE_HAS_SEARCHES flag set if there are any active search folders. There are (currently) no other flags in the StoreState.

Parameters
obj_storethe store object
StoreStatepointer to the store state returned by the server
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_store or StoreState are not valid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetStreamSize ( mapi_object_t obj_stream,
uint32_t *  StreamSize 
)

Gets the size of a stream

Parameters
obj_streamthe stream object we retrieve size from
StreamSizepointer on the stream size
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_stream is not initialized, or there was a problem obtaining the session context
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenStream, ReadStream

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetTransportFolder ( mapi_object_t obj_store,
mapi_id_t FolderId 
)

Retrieves the folder ID of the temporary transport folder.

Parameters
obj_storethe server object
FolderIdpointer on the returning Folder identifier
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS GetUserFreeBusyData ( mapi_object_t obj_store,
const char *  recipient,
struct SRow *  pSRow 
)

Retrieve FreeBusy data associated with the specified recipient

Parameters
obj_storepointer to the public folder MAPI object
recipientname of the recipient to fetch freebusy data
pSRowpointer to the returned properties
Note
The function returns a SRow structure with the following property tags:
  1. PR_NORMALIZED_SUBJECT
  2. PR_FREEBUSY_RANGE_TIMESTAMP
  3. PR_FREEBUSY_PUBLISH_START
  4. PR_FREEBUSY_PUBLISH_END
  5. PR_SCHDINFO_MONTHS_MERGED
  6. PR_SCHDINFO_FREEBUSY_MERGED
  7. PR_SCHDINFO_MONTHS_TENTATIVE
  8. PR_SCHDINFO_FREEBUSY_TENTATIVE
  9. PR_SCHDINFO_MONTHS_BUSY
  10. PR_SCHDINFO_FREEBUSY_BUSY
  11. PR_SCHDINFO_MONTHS_OOF
  12. PR_SCHDINFO_FREEBUSY_OOF
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References FindRow(), FREEBUSY_FOLDER, FREEBUSY_USER, get_PropertyValue_PropertyRowSet_data(), get_SPropValue_SRowSet_data(), GetABRecipientInfo(), GetContentsTable(), GetDefaultPublicFolder(), GetHierarchyTable(), GetProps(), mapi_object_get_session(), mapi_object_init(), mapi_object_release(), MAPIFreeBuffer(), olFolderPublicFreeBusyRoot, OPENCHANGE_RETVAL_IF, OpenFolder(), OpenMessage(), ORG, ORG_UNIT, PR_ADDRBOOK_MID, PR_DISPLAY_NAME, PR_EMAIL_ADDRESS_UNICODE, PR_FID, PR_FREEBUSY_PUBLISH_END, PR_FREEBUSY_PUBLISH_START, PR_FREEBUSY_RANGE_TIMESTAMP, PR_INSTANCE_NUM, PR_MID, PR_NORMALIZED_SUBJECT, PR_SCHDINFO_FREEBUSY_BUSY, PR_SCHDINFO_FREEBUSY_MERGED, PR_SCHDINFO_FREEBUSY_OOF, PR_SCHDINFO_FREEBUSY_TENTATIVE, PR_SCHDINFO_MONTHS_BUSY, PR_SCHDINFO_MONTHS_MERGED, PR_SCHDINFO_MONTHS_OOF, PR_SCHDINFO_MONTHS_TENTATIVE, RES_PROPERTY, set_SPropTagArray(), SetColumns(), SortTable(), and x500_get_dn_element().

Referenced by IsFreeBusyConflict().

enum MAPISTATUS GetValidAttach ( mapi_object_t obj_message,
uint16_t *  NumAttachments,
uint32_t **  AttachmentIds 
)

Get the valid attachment IDs for a message

This function returns the list of valid attachment IDs for a message. You can then use these IDs with the OpenAttach and DeleteAttach functions.

Parameters
obj_messagethe message to operate on
NumAttachmentsthe number of attachments for the message
AttachmentIdsarray of attachment Ids

The AttachmentIds array has NumAttachments elements.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: a parameter is incorrect (e.g. null pointer)
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenAttach, DeleteAttach

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

struct globset_range* GLOBSET_parse ( TALLOC_CTX *  mem_ctx,
DATA_BLOB  buffer,
uint32_t *  countP,
uint32_t *  byte_countP 
)

deserialize a GLOBSET following the format described in [OXCFXICS - 2.2.2.5]

References globset_range::next.

Referenced by IDSET_parse().

char* guid_delete_dash ( TALLOC_CTX *  ,
const char *   
)
enum MAPISTATUS HardDeleteMessage ( mapi_object_t obj_folder,
mapi_id_t id_messages,
uint16_t  cn_messages 
)

Hard delete one or more messages

This function hard deletes one or more messages based on their ids from a specified folder.

Parameters
obj_folderthe folder to hard delete messages from
id_messagesthe list of ids
cn_messagesthe number of messages in the id list.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: the parent folder was not valid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenFolder, CreateMessage, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS HardDeleteMessagesAndSubfolders ( mapi_object_t obj_folder)

Hard delete the contents of a folder, including subfolders

This function empties (clears) the contents of a specified folder.

Parameters
obj_folderthe folder to empty
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_folder is not valid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
DeleteFolder, EmptyFolder

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS ICSSyncConfigure ( mapi_object_t obj,
enum SynchronizationType  sync_type,
uint8_t  send_options,
uint16_t  sync_flags,
uint32_t  sync_extraflags,
DATA_BLOB  restriction,
struct SPropTagArray *  property_tags,
mapi_object_t obj_sync_context 
)

Prepare a server for ICS download

This function is used to configure a server for ICS (Incremental Change Synchronization) download. You use the synchronization context handle for other ICS and Fast Transfer operations.

Parameters
objthe target object for the upload (folder)
sync_typethe type of synchronization that will be performed (just folder contents, or whole folder hierachy)
send_optionsflags that change the format of the transfer (see FXCopyMessages)
sync_flagsflags that change the behavior of the transfer (see below)
sync_extraflagsadditional flags that change the behavior of the transfer (see below)
restrictiona Restriction structure to limit downloads (only for sync_type == SynchronizationType_Content)
property_tagsthe properties to exclude (or include, if SynchronizationFlag_OnlySpecifiedProperties flag is set) in the download
obj_sync_contextthe resulting synchronization context handle

sync_flags can be zero or more of the following:

  • SynchronizationFlag_Unicode to use Unicode format (must match in send_options)
  • SynchronizationFlag_NoDeletions - whether to download changes about message deletion
  • SynchronizationFlag_IgnoreNoLongerInScope - whether to download changes for messages that have gone out of scope.
  • SynchronizationFlag_ReadState - server to download changes to read state
  • SynchronizationFlag_FAI server to download changes to FAI messages
  • SynchronizationFlag_Normal - server to download changes to normal messages
  • SynchronizationFlag_OnlySpecifiedProperties - set means to include only properties that are listed in property_tags, not-set means to exclude properties that are listed in property_tags
  • SynchronizationFlag_NoForeignIdentifiers - ignore persisted values (usually want this set)
  • SynchronizationFlag_BestBody - format for outputting message bodies (set means original format, not-set means output in RTF)
  • SynchronizationFlag_IgnoreSpecifiedOnFAI - ignore property_tags restrictions for FAI messages
  • SynchronizationFlag_Progress - whether to output progress information.
Note
SynchronizationFlag_IgnoreNoLongerInScope, SynchronizationFlag_ReadState, SynchronizationFlag_FAI, SynchronizationFlag_Normal, SynchronizationFlag_OnlySpecifiedProperties, SynchronizationFlag_BestBody and SynchronizationFlag_IgnoreSpecifiedOnFAI are only valid if the synchronization type is SynchronizationType_Content.

sync_extraflags can be zero or more of the following:

  • SynchronizationExtraFlag_Eid - whether the server includes the PR_FID / PR_MID in the download
  • SynchronizationExtraFlag_MessageSize - whether the server includes the PR_MESSAGE_SIZE property in the download (only for sync_type == SynchronizationType_Content)
  • SynchronizationExtraFlag_Cn - whether the server includes the PR_CHANGE_NUM property in the download.
  • SynchronizationExtraFlag_OrderByDeliveryTime - whether the server sends messages sorted by delivery time (only for sync_type == SynchronizationType_Content)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS ICSSyncGetTransferState ( mapi_object_t obj,
mapi_object_t obj_sync_context 
)

obtain an object to get the sync transfer state

Parameters
objthe source object
obj_sync_contextthe synchronization transfer state object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS ICSSyncOpenCollector ( mapi_object_t folder,
bool  isContentsCollector,
mapi_object_t obj_collector 
)

Prepare a folder for ICS upload

Parameters
folderthe folder for the collector creation
isContentsCollectortrue for contents collector, false for hierachy collector
obj_collectorpointer to the resulting ICS collector
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS ICSSyncUploadStateBegin ( mapi_object_t obj_sync_context,
enum StateProperty  state_property,
uint32_t  length 
)

Initialize an ICS Initial State upload.

This is one of three operations (along with ICSSyncUploadStateContinue and ICSSyncUploadStateEnd) used to send the initial state for an ICS download to the server.

Parameters
obj_sync_contextthe synchronization context (from ICSSyncConfigure)
state_propertythe type of ICS state that will be uploaded (see below)
lengththe length (in bytes) of the ICS state that will be uploaded

state_property can be one of the following:

  • PidTagIdsetGiven
  • PidTagCnsetSeen
  • PidTagCnsetSeenFAI
  • PidTagCnsetRead
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS ICSSyncUploadStateContinue ( mapi_object_t obj_sync_context,
DATA_BLOB  state 
)

Send data for an ICS Initial State upload.

This is one of three operations (along with ICSSyncUploadStateBegin and ICSSyncUploadStateEnd) used to send the initial state for an ICS download to the server.

Parameters
obj_sync_contextthe synchronization context (from ICSSyncConfigure)
statethe state data for this part of the upload
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS ICSSyncUploadStateEnd ( mapi_object_t obj_sync_context)

Signal completion of an ICS Initial State upload.

This is one of three operations (along with ICSSyncUploadStateBegin and ICSSyncUploadStateContinue) used to send the initial state for an ICS download to the server.

Parameters
obj_sync_contextthe synchronization context (from ICSSyncConfigure)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

void IDSET_dump ( const struct idset idset,
const char *  label 
)
bool IDSET_includes_eid ( const struct idset idset,
uint64_t  eid 
)

tests the presence of a specific id in the ranges of a ReplID-based idset structure

References exchange_globcnt(), globset_range::high, idset::id, idset::idbased, globset_range::low, idset::next, globset_range::next, idset::ranges, and idset::repl.

bool IDSET_includes_guid_glob ( const struct idset idset,
struct GUID *  replica_guid,
uint64_t  id 
)

tests the presence of a specific id in the ranges of a ReplGUID-based idset structure

References exchange_globcnt(), idset::guid, globset_range::high, idset::idbased, globset_range::low, idset::next, globset_range::next, idset::ranges, and idset::repl.

struct idset* IDSET_merge_idsets ( TALLOC_CTX *  mem_ctx,
const struct idset left,
const struct idset right 
)
struct idset* IDSET_parse ( TALLOC_CTX *  mem_ctx,
DATA_BLOB  buffer,
bool  idbased 
)

deserialize an IDSET following the format described in [OXCFXICS - 2.2.2.4]

References GLOBSET_parse(), idset::guid, idset::id, IDSET_dump(), idset::next, idset::range_count, idset::ranges, and idset::repl.

struct Binary_r* IDSET_serialize ( TALLOC_CTX *  mem_ctx,
const struct idset idset 
)

serialize an idset structure in a struct SBinary_r

References idset::guid, idset::id, idset::idbased, idset::next, globset_range::next, idset::ranges, and idset::repl.

Referenced by ndr_push_idset().

enum MAPISTATUS IsFreeBusyConflict ( mapi_object_t obj_store,
struct FILETIME *  date,
bool *  conflict 
)

Check if a date conflicts with existing FreeBusy Busy/Out Of Office events

Parameters
obj_storepointer to the public folder MAPI object
datepointer to the date to check
conflictpointer to the returned boolean value
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References find_SPropValue_data(), GetFreeBusyYear(), GetUserFreeBusyData(), mapi_object_get_session(), OPENCHANGE_RETVAL_IF, PR_FREEBUSY_PUBLISH_START, PR_SCHDINFO_FREEBUSY_MERGED, PR_SCHDINFO_MONTHS_MERGED, mapi_session::profile, and mapi_profile::username.

bool IsMailboxFolder ( mapi_object_t obj_store,
uint64_t  fid,
uint32_t *  olFolder 
)

Check if a given folder identifier matches with a system/default one and optionally returns the olFolder type

Parameters
obj_storepointer to the store object
fidreference to the folder identifier to check
olFolderpointer to the returned olFolder
Returns
true on success, otherwise false

References mapi_obj_store::fid_calendar, mapi_obj_store::fid_common_views, mapi_obj_store::fid_contact, mapi_obj_store::fid_deleted_items, mapi_obj_store::fid_drafts, mapi_obj_store::fid_inbox, mapi_obj_store::fid_journal, mapi_obj_store::fid_note, mapi_obj_store::fid_outbox, mapi_obj_store::fid_pf_EFormsRegistry, mapi_obj_store::fid_pf_EFormsRegistryRoot, mapi_obj_store::fid_pf_FreeBusyRoot, mapi_obj_store::fid_pf_ipm_subtree, mapi_obj_store::fid_pf_LocalSiteFreeBusy, mapi_obj_store::fid_pf_LocalSiteOfflineAB, mapi_obj_store::fid_pf_NNTPArticle, mapi_obj_store::fid_pf_non_ipm_subtree, mapi_obj_store::fid_pf_OfflineAB, mapi_obj_store::fid_pf_public_root, mapi_obj_store::fid_search, mapi_obj_store::fid_sent_items, mapi_obj_store::fid_task, mapi_obj_store::fid_top_information_store, olFolderCalendar, olFolderCommonView, olFolderContacts, olFolderDeletedItems, olFolderDrafts, olFolderFinder, olFolderInbox, olFolderJournal, olFolderNotes, olFolderOutbox, olFolderPublicEFormsRegistry, olFolderPublicEFormsRoot, olFolderPublicFreeBusyRoot, olFolderPublicIPMSubtree, olFolderPublicLocalFreeBusy, olFolderPublicLocalOfflineAB, olFolderPublicNNTPArticle, olFolderPublicNonIPMSubtree, olFolderPublicOfflineAB, olFolderPublicRoot, olFolderSentMail, olFolderTasks, olFolderTopInformationStore, mapi_object::private_data, PrivateFolderWithoutCachedFids, and mapi_obj_store::store_type.

enum MAPISTATUS LoadProfile ( struct mapi_context mapi_ctx,
struct mapi_profile profile 
)

Load a MAPI Profile and sets its credentials

This function loads a named MAPI profile and sets the MAPI session credentials.

Parameters
mapi_ctxpointer to the MAPI context
profilepointer to the MAPI profile
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: The profile parameter is not initialized
  • MAPI_E_NOT_ENOUGH_RESOURCES: MAPI subsystem failed to allocate the necessary resources to perform the operation
See Also
OpenProfile, GetLastError

References mapi_profile::credentials, mapi_profile::domain, mapi_profile::kerberos, mapi_context::lp_ctx, OPENCHANGE_RETVAL_IF, mapi_profile::password, mapi_profile::realm, mapi_context::session, mapi_profile::username, and mapi_profile::workstation.

Referenced by MapiLogonProvider().

enum MAPISTATUS LockRegionStream ( mapi_object_t obj_stream,
uint64_t  RegionOffset,
uint64_t  RegionSize,
uint32_t  LockFlags 
)

Lock a range of bytes within the stream

Parameters
obj_streamthe stream object
RegionOffsetstarting point for the range
RegionSizelength of the range
LockFlagstype of locking to apply

Setting LockFlags to 0x00000001 will provide a write lock (i.e. one writer, any number of readers). Setting LockFlags to any other value will provide a read-write lock (one reader/writer, no other readers or writers).

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_stream is not valid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
UnlockRegionStream

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS Logoff ( mapi_object_t obj_store)

Logoff an Exchange store

This function uninitializes the MAPI session associated to the object.

Parameters
obj_storepointer to the store object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

References mapi_session::mapi_ctx, mapi_object_get_session(), mapi_object_release(), MAPIFreeBuffer(), mapi_session::next, OPENCHANGE_RETVAL_IF, and mapi_context::session.

void mapi_copy_spropvalues ( TALLOC_CTX *  mem_ctx,
struct SPropValue *  source_values,
struct SPropValue *  dest_values,
uint32_t  count 
)

Convenience function to copy an array of struct SPropValue or a part thereof into another array, by duplicating and properly parenting pointer data. The destination array is considered to be preallocated.

References MV_FLAG, PT_BINARY, PT_STRING8, and PT_UNICODE.

void mapi_errstr ( const char *  ,
enum  MAPISTATUS 
)
uint32_t mapi_get_cpid_from_language ( const char *  language)

Return codepage associated to specified language

Parameters
languageThe language string to lookup
Returns
non-zero codepage on success, otherwise 0
uint32_t mapi_get_cpid_from_lcid ( uint32_t  lcid)

Returns codepage for a given LCID (Locale ID)

Parameters
lcidthe locale ID to lookup
Returns
non-zero codepage on success, otherwise 0 if only unicode is supported for this language
uint32_t mapi_get_cpid_from_locale ( const char *  locale)

Return codepage associated to specified locale

Parameters
localeThe locale string to lookup
Returns
non-zero codepage on success, otherwise 0
const char* mapi_get_errstr ( enum  MAPISTATUS)
char** mapi_get_language_from_group ( TALLOC_CTX *  mem_ctx,
uint32_t  group 
)

Returns List of languages for a given Language Group

Parameters
mem_ctxpointer to the memory context
groupthe locale group to lookup
Returns
Array of languages string on success, otherwise NULL
const char* mapi_get_language_from_lcid ( uint32_t  lcid)

Returns Language for a given Locale ID

Parameters
lcidthe locale ID to lookup
Returns
language string on success, otherwise NULL
const char* mapi_get_language_from_locale ( const char *  locale)

Returns Language for a given Locale

Parameters
localethe language string to lookup
Returns
Language string on success, otherwise NULL
uint32_t mapi_get_lcid_from_language ( const char *  language)

Returns LCID (Locale ID) for a given language

Parameters
languagethe language string to lookup
Returns
non-zero LCID on success, otherwise 0
uint32_t mapi_get_lcid_from_locale ( const char *  locale)

Returns LCID (Locale ID) for a given locale

Parameters
localethe locale string to lookup
Returns
non-zero LCID on success, otherwise 0
const char* mapi_get_locale_from_language ( const char *  language)

Returns Locale for a given language

Parameters
languagethe language string to lookup
Returns
Locale string on success, otherwise NULL
const char* mapi_get_locale_from_lcid ( uint32_t  lcid)

Returns Locale for a given Locale ID

Parameters
lcidthe locale ID to lookup
Returns
locale string on success, otherwise NULL
char* mapi_get_system_locale ( void  )

Returns current locale used by the system

Returns
pointer to locale string on success, otherwise NULL
enum MAPISTATUS mapi_id_array_add_id ( mapi_id_array_t id,
mapi_id_t  fid 
)

Add a container ID to the list given its container ID

Parameters
idpointer to a mapi_id_array structure
fidthe container ID
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: The mapi_id_array_t is uninitialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
mapi_id_array_add_obj

References mapi_container_list::id, mapi_id_array::lpContainerList, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS mapi_id_array_add_obj ( mapi_id_array_t id,
mapi_object_t obj 
)

Add a container ID to the list given its mapi_object_t

Parameters
idpointer to a mapi_id_array structure
objpointer on the mapi object we retrieve the container ID from
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: The mapi_id_array_t is uninitialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
mapi_id_array_add_id

References mapi_container_list::id, mapi_id_array::lpContainerList, mapi_object_get_id(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS mapi_id_array_del_id ( mapi_id_array_t id,
mapi_id_t  fid 
)

Delete a container ID from the list given its container ID

Parameters
idpointer to a mapi_id_array structure
fidthe container ID
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: The mapi_id_array_t is uninitialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
mapi_id_array_add_id

References mapi_id_array::count, mapi_container_list::id, mapi_id_array::lpContainerList, mapi_container_list::next, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS mapi_id_array_del_obj ( mapi_id_array_t id,
mapi_object_t obj 
)

Delete a container ID from the list given its mapi_object_t

Parameters
idpointer to a mapi_id_array structure
objpointer on the mapi object we retrieve the container ID from
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: The mapi_id_array_t is uninitialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
mapi_id_array_add_id

References mapi_id_array::count, mapi_container_list::id, mapi_id_array::lpContainerList, mapi_object_get_id(), mapi_container_list::next, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS mapi_id_array_get ( TALLOC_CTX *  mem_ctx,
mapi_id_array_t id,
mapi_id_t **  ContainerList 
)

Retrieve the ContainerList and store it within a uint64_t array.

Parameters
mem_ctxallocated talloc pointer
idpointer to a mapi_id_array structure
ContainerListpointer on a pointer of uint64_t values
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: The mapi_id_array_t is uninitialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetSearchCriteria

References mapi_id_array::count, mapi_container_list::id, mapi_id_array::lpContainerList, mapi_container_list::next, and OPENCHANGE_RETVAL_IF.

Referenced by FXCopyMessages(), MoveCopyMessages(), and SetSearchCriteria().

enum MAPISTATUS mapi_id_array_init ( TALLOC_CTX *  mem_ctx,
mapi_id_array_t id 
)

Initialize a mapi_id_array structure

Parameters
mem_ctxpointer to the talloc context
idpointer to a mapi_id_array structure
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: The mapi_id_array_t is uninitialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
mapi_id_array_release

References OPENCHANGE_RETVAL_IF.

enum MAPISTATUS mapi_id_array_release ( mapi_id_array_t id)

Uninitialize a mapi_id_array structure

Parameters
idpointer to a mapi_id_array structure
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: The mapi_id_array_t is uninitialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
mapi_id_array_init

References mapi_id_array::lpContainerList, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS mapi_nameid_canonical_add ( struct mapi_nameid mapi_nameid,
uint32_t  proptag 
)

Add a mapi_nameid entry given its canonical property tag

Parameters
mapi_nameidthe structure where results are stored
proptagthe canonical property tag we are searching
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZE: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the parameters was not set properly
  • MAPI_E_NOT_FOUND: the entry intended to be added was not found
See Also
mapi_nameid_new

References mapi_nameid::count, mapi_nameid::entries, get_utf8_utf16_conv_length(), mapi_nameid_tags::lid, mapi_nameid_tags::Name, mapi_nameid::nameid, mapi_nameid_tags::OLEGUID, and OPENCHANGE_RETVAL_IF.

Referenced by mapi_nameid_lookup_SPropTagArray(), and mapi_nameid_lookup_SPropValue().

enum MAPISTATUS mapi_nameid_custom_lid_add ( struct mapi_nameid mapi_nameid,
uint16_t  lid,
uint16_t  propType,
const char *  OLEGUID 
)

Register and add a custom MNID_ID named property given its lid, proptype and OLEGUID.

Parameters
mapi_nameidthe structure where results are stored
lidthe light ID of the name property (used by MNID_ID named props only)
propTypethe named property type
OLEGUIDthe property set this entry belongs to
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the parameter was no set properly
See Also
mapi_nameid_new, mapi_nameid_lid_add

References mapi_nameid::count, mapi_nameid::entries, mapi_nameid_tags::lid, mapi_nameid::nameid, mapi_nameid_tags::OLEGUID, OPENCHANGE_RETVAL_IF, mapi_nameid_tags::propType, and mapi_nameid_tags::ulKind.

enum MAPISTATUS mapi_nameid_custom_string_add ( struct mapi_nameid mapi_nameid,
const char *  Name,
uint16_t  propType,
const char *  OLEGUID 
)

Register and add a custom MNID_STRING named property given its string, proptype and OLEGUID.

Parameters
mapi_nameidthe structure where results are stored
Namethe property name (used by MNID_STRING named props only)
propTypethe named property type
OLEGUIDthe property set this entry belongs to
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the parameter was not set properly.
See Also
mapi_nameid_new, mapi_nameid_string_add

References mapi_nameid::count, mapi_nameid::entries, get_utf8_utf16_conv_length(), mapi_nameid_tags::Name, mapi_nameid::nameid, mapi_nameid_tags::OLEGUID, OPENCHANGE_RETVAL_IF, mapi_nameid_tags::propType, and mapi_nameid_tags::ulKind.

enum MAPISTATUS mapi_nameid_GetIDsFromNames ( struct mapi_nameid mapi_nameid,
mapi_object_t obj,
struct SPropTagArray *  SPropTagArray 
)

Lookup named properties (MNID_STRING) and return their mapped proptags

This convenient function calls GetIDsFromNames() and returns property tags with their real property type.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameters was not set properly
See Also
GetIDsFromNames, mapi_nameid_SPropTagArray

References mapi_nameid::count, mapi_nameid::entries, GetIDsFromNames(), GetLastError(), mapi_nameid::nameid, OPENCHANGE_RETVAL_IF, and mapi_nameid_tags::propType.

enum MAPISTATUS mapi_nameid_lid_add ( struct mapi_nameid mapi_nameid,
uint16_t  lid,
const char *  OLEGUID 
)

Add a mapi_nameid entry given its lid and OLEGUID (MNID_ID)

Parameters
mapi_nameidthe structure where results are stored
lidthe light ID of the name property (used by MNID_ID named props only)
OLEGUIDthe property set this entry belongs to
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the parameters was not set properly
  • MAPI_E_NOT_FOUND: the entry intended to be added was not found
See Also
mapi_nameid_new

References mapi_nameid::count, mapi_nameid::entries, get_utf8_utf16_conv_length(), mapi_nameid_tags::lid, mapi_nameid_tags::Name, mapi_nameid::nameid, mapi_nameid_tags::OLEGUID, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS mapi_nameid_lid_lookup ( uint16_t  lid,
const char *  OLEGUID,
uint16_t *  propType 
)

Search for a given lid,OLEGUID couple and return the associated propType.

Parameters
lidthe named property light ID
OLEGUIDthe named property GUID for this entry
propTypepointer on returned named property type
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameter was not set properly.
  • MAPI_E_NOT_FOUND: no named property found

References mapi_nameid_tags::OLEGUID, OPENCHANGE_RETVAL_ERR, OPENCHANGE_RETVAL_IF, and mapi_nameid_tags::propType.

enum MAPISTATUS mapi_nameid_lid_lookup_canonical ( uint16_t  lid,
const char *  OLEGUID,
uint32_t *  propTag 
)

Search for a given lid,OLEGUID couple and return the associated canonical propTag.

Parameters
lidthe named property light ID
OLEGUIDthe named property GUID for this entry
propTagpointer on returned named canonical property tag
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameter was not set properly.
  • MAPI_E_NOT_FOUND: no named property found

References mapi_nameid_tags::OLEGUID, OPENCHANGE_RETVAL_ERR, OPENCHANGE_RETVAL_IF, and mapi_nameid_tags::proptag.

enum MAPISTATUS mapi_nameid_lookup_SPropTagArray ( struct mapi_nameid nameid,
struct SPropTagArray *  SPropTagArray 
)

Loop over SPropTagArray and look for canonical named property tags we can add to the nameid structure.

Parameters
nameidthe structure where results are stored
SPropTagArraythe array of property tags where to look for canonical named property tags.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameters was not set properly
  • MAPI_E_NOT_FOUND: no named property found
See Also
GetIDsFromNames

References mapi_nameid_canonical_add(), mapi_nameid_property_lookup(), and OPENCHANGE_RETVAL_IF.

Referenced by GetProps().

enum MAPISTATUS mapi_nameid_lookup_SPropValue ( struct mapi_nameid mapi_nameid,
struct SPropValue *  lpProps,
unsigned long  PropCount 
)

Loop over lpProps and look for canonical named property tags we can add to the nameid structure.

Parameters
mapi_nameidthe structure where results are stored
lpPropspointer on a SPropValue structure with the property tags where to look for canonical named property tags
PropCountcount of lpProps elemense
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameters was not set properly
  • MAPI_E_NOT_FOUND: no named property found
See Also
GetIDsFromNames

References mapi_nameid_canonical_add(), and OPENCHANGE_RETVAL_IF.

Referenced by SetPropertiesNoReplicate(), and SetProps().

enum MAPISTATUS mapi_nameid_map_SPropTagArray ( struct mapi_nameid mapi_nameid,
struct SPropTagArray *  SPropTagArray,
struct SPropTagArray *  SPropTagArray2 
)

Replace named property tags in SPropTagArray with the property ID Exchange expects and stored in SPropTagArray2.

Parameters
mapi_nameidthe structure where results are stored
SPropTagArraythe array of property tags with original property tags
SPropTagArray2the array of named property tags resolved with GetIDsFromNames
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameters was not set properly
See Also
GetIDsFromNames

References mapi_nameid::count, mapi_nameid::entries, OPENCHANGE_RETVAL_IF, mapi_nameid_tags::position, mapi_nameid_tags::proptag, and mapi_nameid_tags::propType.

Referenced by GetProps().

enum MAPISTATUS mapi_nameid_map_SPropValue ( struct mapi_nameid mapi_nameid,
struct SPropValue *  lpProps,
uint32_t  PropCount,
struct SPropTagArray *  SPropTagArray 
)

Replace named property tags in the SPropValue array with the property ID Exchange expects and stored in SPropTagArray.

Parameters
mapi_nameidthe structure where results are stored
lpPropspointer on a SPropValue structure with property tags and values
PropCountcount of lpProps elements
SPropTagArraythe array of named property tags resolved with GetIDsFromNames
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameters was not set properly
See Also
GetIDsFromNames

References mapi_nameid::count, mapi_nameid::entries, OPENCHANGE_RETVAL_IF, mapi_nameid_tags::position, mapi_nameid_tags::proptag, and mapi_nameid_tags::propType.

Referenced by SetPropertiesNoReplicate(), and SetProps().

struct mapi_nameid* mapi_nameid_new ( TALLOC_CTX *  mem_ctx)

Create a new mapi_nameid structure

Parameters
mem_ctxmemory context to use for allocation
Returns
a pointer to an allocated mapi_nameid structure on success, otherwise NULL
See Also
GetIDsFromNames

References mapi_nameid::count, mapi_nameid::entries, and mapi_nameid::nameid.

Referenced by GetProps(), SetPropertiesNoReplicate(), and SetProps().

enum MAPISTATUS mapi_nameid_OOM_add ( struct mapi_nameid mapi_nameid,
const char *  OOM,
const char *  OLEGUID 
)

Add a mapi_nameid entry given its OOM and OLEGUID (MNID_ID|MNID_STRING)

Parameters
mapi_nameidthe structure where results are stored
OOMthe Outlook Object Model matching string
OLEGUIDthe property set this entry belongs to
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the parameters was not set properly
  • MAPI_E_NOT_FOUND: the entry intended to be added was not found
See Also
mapi_nameid_new

References mapi_nameid::count, mapi_nameid::entries, get_utf8_utf16_conv_length(), mapi_nameid_tags::lid, mapi_nameid_tags::Name, mapi_nameid::nameid, mapi_nameid_tags::OLEGUID, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS mapi_nameid_OOM_lookup ( const char *  OOM,
const char *  OLEGUID,
uint16_t *  propType 
)

Search for a given OOM,OLEGUID couple and return the associated propType.

Parameters
OOMThe Outlook Object Model
OLEGUIDthe named property GUID for this entry
propTypepointer on returned named property type
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameter was not set properly.
  • MAPI_E_NOT_FOUND: no named property found

References mapi_nameid_tags::OLEGUID, OPENCHANGE_RETVAL_ERR, OPENCHANGE_RETVAL_IF, and mapi_nameid_tags::propType.

enum MAPISTATUS mapi_nameid_property_lookup ( uint32_t  proptag)

Search for a given referenced unmapped named property and return whether it was found or not.

Parameters
proptagthe unmapped property tag to lookup
Returns
MAPI_E_SUCCESS on success otherwise MAPI_E_NOT_FOUND

References mapi_nameid_tags::proptag.

Referenced by mapi_nameid_lookup_SPropTagArray().

enum MAPISTATUS mapi_nameid_SPropTagArray ( struct mapi_nameid mapi_nameid,
struct SPropTagArray *  SPropTagArray 
)

set SPropTagArray ulPropTag property types from mapi_nameid returned by GetIDsFromNames()

Parameters
mapi_nameidthe structure where results are stored
SPropTagArraythe array of property tags returned by previous call to GetIDsFromNames()
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameters was not set properly
See Also
GetIDsFromNames

References mapi_nameid::count, mapi_nameid::entries, OPENCHANGE_RETVAL_IF, and mapi_nameid_tags::propType.

enum MAPISTATUS mapi_nameid_string_add ( struct mapi_nameid mapi_nameid,
const char *  Name,
const char *  OLEGUID 
)

Add a mapi_nameid entry given its Name and OLEGUID (MNID_STRING)

Parameters
mapi_nameidthe structure where results are stored
Namethe property name (used by MNID_STRING named props only)
OLEGUIDthe property set this entry belongs to
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the parameters was not set properly
  • MAPI_E_NOT_FOUND: the entry intended to be added was not found
See Also
mapi_nameid_new

References mapi_nameid::count, mapi_nameid::entries, get_utf8_utf16_conv_length(), mapi_nameid_tags::lid, mapi_nameid_tags::Name, mapi_nameid::nameid, mapi_nameid_tags::OLEGUID, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS mapi_nameid_string_lookup ( const char *  Name,
const char *  OLEGUID,
uint16_t *  propType 
)

Search for a given Name,OLEGUID couple and return the associated propType.

Parameters
Namethe named property name
OLEGUIDthe named property GUID for this entry
propTypepointer on returned named property type
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameter was not set properly.
  • MAPI_E_NOT_FOUND: no named property found

References mapi_nameid_tags::OLEGUID, OPENCHANGE_RETVAL_ERR, OPENCHANGE_RETVAL_IF, and mapi_nameid_tags::propType.

enum MAPISTATUS mapi_nameid_string_lookup_canonical ( const char *  Name,
const char *  OLEGUID,
uint32_t *  propTag 
)

Search for a given Name,OLEGUID couple and return the associated canonical propTag.

Parameters
Namethe named property name
OLEGUIDthe named property GUID for this entry
propTagpointer on returned named canonical property tag
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameter was not set properly.
  • MAPI_E_NOT_FOUND: no named property found

References mapi_nameid_tags::OLEGUID, OPENCHANGE_RETVAL_ERR, OPENCHANGE_RETVAL_IF, and mapi_nameid_tags::proptag.

enum MAPISTATUS mapi_nameid_unmap_SPropTagArray ( struct mapi_nameid mapi_nameid,
struct SPropTagArray *  SPropTagArray 
)

Restore the original SPropTagArray array with the property tags saved in the mapi_nameid structure.

Parameters
mapi_nameidthe structure where results are stored
SPropTagArraythe array of property tags with original property tags
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameters was not set properly
See Also
GetIDsFromNames

References mapi_nameid::count, mapi_nameid::entries, OPENCHANGE_RETVAL_IF, mapi_nameid_tags::position, and mapi_nameid_tags::proptag.

Referenced by GetProps().

enum MAPISTATUS mapi_nameid_unmap_SPropValue ( struct mapi_nameid mapi_nameid,
struct SPropValue *  lpProps,
uint32_t  PropCount 
)

Restore the original SPropValue array with the property tags saved in the mapi_nameid structure.

Parameters
mapi_nameidthe structure where results are stored
lpPropsthe array of SPropValue structures with original property tags
PropCountcount of lpProps elements
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: one of the parameters was not set properly
See Also
GetIDsFromNames

References mapi_nameid::count, mapi_nameid::entries, OPENCHANGE_RETVAL_IF, mapi_nameid_tags::position, and mapi_nameid_tags::proptag.

Referenced by SetPropertiesNoReplicate(), and SetProps().

enum MAPISTATUS mapi_object_bookmark_debug ( mapi_object_t obj_table)

Dump bookmarks associated to a MAPI object table

Parameters
obj_tablepointer on the MAPI object table
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References mapi_obj_bookmark::bin, mapi_obj_table::bookmark, mapi_obj_bookmark::index, mapi_obj_bookmark::next, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

enum MAPISTATUS mapi_object_bookmark_get_count ( mapi_object_t obj_table,
uint32_t *  count 
)

Retrieve the number of bookmarks stored in a MAPI object table

Parameters
obj_tablepointer to the MAPI object table
countpointer to the number of bookmarks to return
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References mapi_obj_table::bk_last, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

enum MAPISTATUS mapi_object_copy ( mapi_object_t dst,
mapi_object_t src 
)

Copy MAPI object

This function copies mapi_object data from source to destination.

Parameters
dstpointer on the destination MAPI object
srcpointer on the source MAPI object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_INITIALIZED

References mapi_object::handle, mapi_object::id, mapi_object::logon_id, OPENCHANGE_RETVAL_IF, mapi_object::private_data, and mapi_object::session.

void mapi_object_debug ( mapi_object_t obj)

Dump a MAPI object (for debugging)

Parameters
objpointer on the MAPI object to dump out

References mapi_object::handle, and mapi_object::id.

mapi_id_t mapi_object_get_id ( mapi_object_t obj)

Retrieve an object ID for a given MAPI object

Parameters
objpointer on the MAPI object to get the ID for
Returns
the object ID, or 0xFFFFFFFFFFFFFFFF if the object does not exist

References mapi_object::id.

Referenced by AbortSubmit(), CopyFolder(), CreateMessage(), GetOwningServers(), mapi_id_array_add_obj(), mapi_id_array_del_obj(), MoveFolder(), PublicFolderIsGhosted(), SetReceiveFolder(), SpoolerLockMessage(), Subscribe(), and TransportNewMail().

enum MAPISTATUS mapi_object_get_logon_id ( mapi_object_t obj,
uint8_t *  logon_id 
)

Retrieve the logon id for a given MAPI object

Parameters
objpointer to the object to retrieve the logon id from
logon_idpointer to a variable to store the logon id
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References mapi_object::logon_id.

Referenced by Abort(), AbortSubmit(), AddressTypes(), CloneStream(), CollapseRow(), CommitStream(), CopyFolder(), CopyProps(), CopyTo(), CopyToStream(), CreateAttach(), CreateBookmark(), CreateFolder(), CreateMessage(), DeleteAttach(), DeleteFolder(), DeleteMessage(), DeletePropertiesNoReplicate(), DeleteProps(), EmptyFolder(), ExpandRow(), FindRow(), FreeBookmark(), FXCopyFolder(), FXCopyMessages(), FXCopyProperties(), FXCopyTo(), FXDestConfigure(), FXGetBuffer(), FXPutBuffer(), GetAttachmentTable(), GetCollapseState(), GetContentsTable(), GetHierarchyTable(), GetIdFromLongTermId(), GetIDsFromNames(), GetLocalReplicaIds(), GetLongTermIdFromId(), GetMessageStatus(), GetNamesFromIDs(), GetOwningServers(), GetPermissionsTable(), GetPropList(), GetProps(), GetPropsAll(), GetReceiveFolder(), GetReceiveFolderTable(), GetRulesTable(), GetSearchCriteria(), GetStatus(), GetStoreState(), GetStreamSize(), GetTransportFolder(), GetValidAttach(), HardDeleteMessage(), HardDeleteMessagesAndSubfolders(), ICSSyncConfigure(), ICSSyncGetTransferState(), ICSSyncOpenCollector(), ICSSyncUploadStateBegin(), ICSSyncUploadStateContinue(), ICSSyncUploadStateEnd(), LockRegionStream(), ModifyPermissions(), ModifyRecipients(), MoveCopyMessages(), MoveFolder(), OpenAttach(), OpenEmbeddedMessage(), OpenFolder(), OpenMessage(), OpenPublicFolderByName(), OpenStream(), OptionsData(), PublicFolderIsGhosted(), QueryColumns(), QueryNamedProperties(), QueryPosition(), QueryRows(), ReadRecipients(), ReadStream(), Release(), ReloadCachedInformation(), RemoveAllRecipients(), Reset(), Restrict(), SaveChangesAttachment(), SaveChangesMessage(), SeekRow(), SeekRowApprox(), SeekRowBookmark(), SeekStream(), SetCollapseState(), SetColumns(), SetLocalReplicaMidsetDeleted(), SetMessageReadFlag(), SetMessageStatus(), SetPropertiesNoReplicate(), SetProps(), SetReadFlags(), SetReceiveFolder(), SetSearchCriteria(), SetSpooler(), SetStreamSize(), SetSyncNotificationGuid(), SortTable(), SpoolerLockMessage(), SubmitMessage(), Subscribe(), SyncOpenAdvisor(), TellVersion(), TransportNewMail(), TransportSend(), UnlockRegionStream(), WriteAndCommitStream(), and WriteStream().

struct mapi_session* mapi_object_get_session ( mapi_object_t obj)

Retrieve the session associated to the MAPI object

Parameters
objthe object to get the session for
Returns
pointer on a MAPI session on success, otherwise NULL

References mapi_object::session.

Referenced by Abort(), AbortSubmit(), AddressTypes(), AddUserPermission(), CloneStream(), CollapseRow(), CommitStream(), CopyFolder(), CopyProps(), CopyTo(), CopyToStream(), CreateAttach(), CreateBookmark(), CreateFolder(), CreateMessage(), DeleteAttach(), DeleteFolder(), DeleteMessage(), DeletePropertiesNoReplicate(), DeleteProps(), EmptyFolder(), ExpandRow(), FindRow(), FreeBookmark(), FXCopyFolder(), FXCopyMessages(), FXCopyProperties(), FXCopyTo(), FXDestConfigure(), FXGetBuffer(), FXPutBuffer(), GetAttachmentTable(), GetBestBody(), GetCollapseState(), GetContentsTable(), GetFolderItemsCount(), GetHierarchyTable(), GetIdFromLongTermId(), GetIDsFromNames(), GetLocalReplicaIds(), GetLongTermIdFromId(), GetMessageStatus(), GetNamesFromIDs(), GetOwningServers(), GetPermissionsTable(), GetPropList(), GetProps(), GetPropsAll(), GetReceiveFolder(), GetReceiveFolderTable(), GetRulesTable(), GetSearchCriteria(), GetStatus(), GetStoreState(), GetStreamSize(), GetTransportFolder(), GetUserFreeBusyData(), GetValidAttach(), HardDeleteMessage(), HardDeleteMessagesAndSubfolders(), ICSSyncConfigure(), ICSSyncGetTransferState(), ICSSyncOpenCollector(), ICSSyncUploadStateBegin(), ICSSyncUploadStateContinue(), ICSSyncUploadStateEnd(), IsFreeBusyConflict(), LockRegionStream(), Logoff(), mapi_SPropValue_array_named(), ModifyPermissions(), ModifyRecipients(), ModifyUserPermission(), MoveCopyMessages(), MoveFolder(), OpenAttach(), OpenEmbeddedMessage(), OpenFolder(), OpenMessage(), OpenPublicFolderByName(), OpenStream(), OptionsData(), PublicFolderIsGhosted(), QueryColumns(), QueryNamedProperties(), QueryPosition(), QueryRows(), ReadRecipients(), ReadStream(), Release(), ReloadCachedInformation(), RemoveAllRecipients(), RemoveUserPermission(), Reset(), Restrict(), SaveChangesAttachment(), SaveChangesMessage(), SeekRow(), SeekRowApprox(), SeekRowBookmark(), SeekStream(), SetCollapseState(), SetColumns(), SetLocalReplicaMidsetDeleted(), SetMessageReadFlag(), SetMessageStatus(), SetPropertiesNoReplicate(), SetProps(), SetReadFlags(), SetReceiveFolder(), SetSearchCriteria(), SetSpooler(), SetStreamSize(), SetSyncNotificationGuid(), SortTable(), SpoolerLockMessage(), SubmitMessage(), Subscribe(), SyncOpenAdvisor(), TellVersion(), TransportNewMail(), TransportSend(), UnlockRegionStream(), WrapCompressedRTFStream(), WriteAndCommitStream(), and WriteStream().

enum MAPISTATUS mapi_object_init ( mapi_object_t obj)

Initialize MAPI object

This function is required to be called before any manipulation of this MAPI object.

Parameters
objthe object to initialize
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized.
See Also
mapi_object_release
Examples:
fetchappointment.c, and fetchmail.c.

Referenced by CreateFolder(), GetUserFreeBusyData(), ModifyUserPermission(), RemoveUserPermission(), and Subscribe().

void mapi_object_release ( mapi_object_t obj)

Release MAPI object

This function is required to be called when this MAPI object is no longer required.

Parameters
objpointer on the MAPI object to release
See Also
mapi_object_initialize, Release
Examples:
fetchappointment.c, and fetchmail.c.

References mapi_object::handle, INVALID_HANDLE_VALUE, mapi_object::logon_id, mapi_session::logon_ids, mapi_object::private_data, Release(), mapi_object::session, and mapi_object::store.

Referenced by GetUserFreeBusyData(), Logoff(), ModifyUserPermission(), and RemoveUserPermission().

void mapi_object_set_logon_store ( mapi_object_t obj)

Mark a MAPI object as a store object

Parameters
objpointer to the object to set the store boolean for

References mapi_object::store.

Referenced by OpenPublicFolder(), and OpenUserMailbox().

enum MAPISTATUS mapi_profile_add_string_attr ( struct mapi_context mapi_ctx,
const char *  profile,
const char *  attr,
const char *  value 
)

Add an attribute to the profile

Parameters
mapi_ctxpointer to the MAPI context
profilepointer to the profile name
attrthe name of the atribute
valuethe value of the attribute

References mapi_context::ldb_ctx, mapi_context::mem_ctx, and OPENCHANGE_RETVAL_IF.

Referenced by CreateProfile(), and ProcessNetworkProfile().

enum MAPISTATUS mapi_profile_delete_string_attr ( struct mapi_context mapi_ctx,
const char *  profname,
const char *  attr,
const char *  value 
)

Delete an attribute

Parameters
mapi_ctxpointer to the MAPI context
profnamethe name of the profile
attrthe name of the attribute
valuethe value of the attribute

References mapi_context::ldb_ctx, mapi_context::mem_ctx, and OPENCHANGE_RETVAL_IF.

Referenced by DuplicateProfile().

const char* mapi_profile_get_ldif_path ( void  )

Get default ldif_path

This function returns the path for the default LDIF files.

See Also
CreateProfileStore
enum MAPISTATUS mapi_profile_modify_string_attr ( struct mapi_context mapi_ctx,
const char *  profname,
const char *  attr,
const char *  value 
)

Modify an attribute

Parameters
mapi_ctxpointer to the MAPI context
profnamethe name of the profile
attrthe name of the attribute
valuethe value of the attribute

References mapi_context::ldb_ctx, mapi_context::mem_ctx, and OPENCHANGE_RETVAL_IF.

Referenced by ChangeProfilePassword(), DuplicateProfile(), and SetDefaultProfile().

void mapi_SPropValue_array_named ( mapi_object_t ,
struct mapi_SPropValue_array *   
)
bool mapi_verify_cpid ( uint32_t  cpid)

Verify if the specified codepage is valid

Parameters
cpidthe codepage to lookup
Returns
0 on success, otherwise 1
enum MAPISTATUS MAPIAllocateBuffer ( struct mapi_context mapi_ctx,
uint32_t  size,
void **  ptr 
)

Allocate memory using the MAPI memory context

Parameters
mapi_ctxpointer to the MAPI context
sizethe number of bytes to allocate
ptrpointer to the allocated byte region
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_SESSION_LIMIT: No session has been opened on the provider
  • MAPI_E_NOT_ENOUGH_RESOURCES: MAPI subsystem failed to allocate the necessary resources to operate properly
  • MAPI_E_INVALID_PARAMER: size is not set properly.
See Also
MAPIFreeBuffer, GetLastError

References mapi_context::mem_ctx, and OPENCHANGE_RETVAL_IF.

void mapidump_appointment ( struct mapi_SPropValue_array *  properties,
const char *  id 
)

This function dumps the properties relating to an appointment to standard output

The expected way to obtain the properties array is to use OpenMessage() to obtain the appointment object, then to use GetPropsAll() to obtain all the properties.

Parameters
propertiesarray of appointment properties
ididentification to display for the appointment (can be NULL)
See Also
mapidump_message, mapidump_contact, mapidump_task, mapidump_note
Examples:
fetchappointment.c.

References find_mapi_SPropValue_data(), get_task_status(), mapidump_date(), PidLidBusyStatus, PidLidContacts, PidLidLocation, PidLidPrivate, PidLidTimeZoneDescription, PR_CONVERSATION_TOPIC, PR_END_DATE, and PR_START_DATE.

void mapidump_contact ( struct mapi_SPropValue_array *  properties,
const char *  id 
)

This function dumps the properties relating to a contact (address book entry) to standard output

The expected way to obtain the properties array is to use OpenMessage() to obtain the contact object, then to use GetPropsAll() to obtain all the properties.

Parameters
propertiesarray of contact properties
ididentification to display for the contact (can be NULL)
See Also
mapidump_message, mapidump_appointment, mapidump_task, mapidump_note

References find_mapi_SPropValue_data(), PidLidEmail1OriginalDisplayName, PidLidFileUnder, PR_BUSINESS_FAX_NUMBER, PR_BUSINESS_HOME_PAGE, PR_COMPANY_NAME, PR_CONVERSATION_TOPIC, PR_COUNTRY, PR_DEPARTMENT_NAME, PR_DISPLAY_NAME, PR_GIVEN_NAME, PR_HOME_TELEPHONE_NUMBER, PR_LOCALITY, PR_MOBILE_TELEPHONE_NUMBER, PR_OFFICE_TELEPHONE_NUMBER, PR_POSTAL_ADDRESS, PR_STATE_OR_PROVINCE, PR_STREET_ADDRESS, PR_SURNAME, and PR_TITLE.

void mapidump_date ( struct mapi_SPropValue_array *  ,
uint32_t  ,
const char *   
)
void mapidump_date_SPropValue ( struct SPropValue  lpProp,
const char *  label,
const char *  sep 
)

This function dumps a property containing a date / time to standard output

If the property does not contain a PT_SYSTIME type value, then no output will occur.

Parameters
lpPropthe property to dump
labelthe label to display prior to the time (e.g. the property tag)
sepa separator / spacer to insert in front of the label
Note
Prior to OpenChange 0.9, this function took 2 arguments, assuming a default separator of a tab. You can get the old behaviour by using "\t" for sep.

References get_SPropValue_data().

Referenced by mapidump_SPropValue().

void mapidump_foldercopied ( struct FolderMoveCopyNotification *  ,
const char *   
)
void mapidump_foldercreated ( struct FolderCreatedNotification *  ,
const char *   
)

References mapidump_tags().

void mapidump_folderdeleted ( struct FolderDeletedNotification *  ,
const char *   
)
void mapidump_foldermoved ( struct FolderMoveCopyNotification *  ,
const char *   
)

Referenced by mapidump_foldercopied().

void mapidump_freebusy_date ( uint32_t  ,
const char *   
)
void mapidump_freebusy_event ( struct Binary_r *  ,
uint32_t  ,
uint32_t  ,
const char *   
)
const char* mapidump_freebusy_month ( uint32_t  ,
uint32_t   
)

Referenced by mapidump_freebusy_event().

uint32_t mapidump_freebusy_year ( uint32_t  ,
uint32_t   
)

Referenced by mapidump_freebusy_event().

void mapidump_languages_list ( void  )

print the list of languages OpenChange supports

References mapi_get_language_list().

void mapidump_message ( struct mapi_SPropValue_array *  properties,
const char *  id,
mapi_object_t obj_msg 
)

This function dumps the properties relating to an email message to standard output

The expected way to obtain the properties array is to use OpenMessage() to obtain the message object, then to use GetPropsAll() to obtain all the properties.

Parameters
propertiesarray of message properties
ididentification to display for the message (can be NULL)
obj_msgpointer to the message MAPI object (can be NULL)
See Also
mapidump_appointment, mapidump_contact, mapidump_task, mapidump_note
Examples:
fetchmail.c.

References find_mapi_SPropValue_data(), mapidump_message_summary(), PR_BODY, PR_BODY_UNICODE, PR_CONVERSATION_TOPIC, PR_CONVERSATION_TOPIC_UNICODE, PR_DISPLAY_BCC, PR_DISPLAY_BCC_UNICODE, PR_DISPLAY_CC, PR_DISPLAY_CC_UNICODE, PR_DISPLAY_TO, PR_DISPLAY_TO_UNICODE, PR_HASATTACH, PR_HTML, PR_INTERNET_MESSAGE_ID, PR_INTERNET_MESSAGE_ID_UNICODE, PR_MESSAGE_CODEPAGE, PR_SENT_REPRESENTING_NAME, and PR_SENT_REPRESENTING_NAME_UNICODE.

void mapidump_message_summary ( mapi_object_t obj_message)

This function dumps message information retrieved from OpenMessage call. It provides a quick method to print message summaries with information such as subject and recipients.

Parameters
obj_messagepointer to the MAPI message object to use

References find_SPropValue_data(), mapi_obj_message::NormalizedSubject, PR_RECIPIENT_TYPE, PR_SMTP_ADDRESS, PR_SMTP_ADDRESS_UNICODE, mapi_object::private_data, mapi_obj_message::SRowSet, and mapi_obj_message::SubjectPrefix.

Referenced by mapidump_message().

void mapidump_messagecopied ( struct MessageMoveCopyNotification *  ,
const char *   
)
void mapidump_messagecreated ( struct MessageCreatedNotification *  ,
const char *   
)

References mapidump_tags().

Referenced by mapidump_messagemodified().

void mapidump_messagedeleted ( struct MessageDeletedNotification *  ,
const char *   
)
void mapidump_messagemodified ( struct MessageModifiedNotification *  ,
const char *   
)
void mapidump_messagemoved ( struct MessageMoveCopyNotification *  ,
const char *   
)

Referenced by mapidump_messagecopied().

void mapidump_msgflags ( uint32_t  ,
const char *   
)

References mdump_msgflags::flag.

Referenced by mapidump_newmail().

void mapidump_newmail ( struct NewMailNotification *  ,
const char *   
)

References mapidump_msgflags().

void mapidump_note ( struct mapi_SPropValue_array *  properties,
const char *  id 
)

This function dumps the properties relating to a note to standard output

The expected way to obtain the properties array is to use OpenMessage() to obtain the note object, then to use GetPropsAll() to obtain all the properties.

Parameters
propertiesarray of note properties
ididentification to display for the note (can be NULL)
See Also
mapidump_message, mapidump_appointment, mapidump_contact, mapidump_task

References find_mapi_SPropValue_data(), mapidump_date(), PR_BODY, PR_BODY_HTML, PR_CLIENT_SUBMIT_TIME, and PR_CONVERSATION_TOPIC.

void mapidump_PAB_entry ( struct PropertyRow_r *  aRow)

Output a row of the public address book.

Parameters
aRowone row of the public address book (Global Address List)

This function is usually used with GetGALTable, which can obtain several rows at once - you'll need to iterate over the rows.

The SRow is assumed to contain entries for PR_ADDRTYPE_UNICODE, PR_DISPLAY_NAME_UNICODE, PR_EMAIL_ADDRESS_UNICODE and PR_ACCOUNT_UNICODE.

References find_PropertyValue_data(), PR_ACCOUNT_UNICODE, PR_ADDRTYPE_UNICODE, PR_DISPLAY_NAME_UNICODE, and PR_EMAIL_ADDRESS_UNICODE.

void mapidump_Recipients ( const char **  ,
struct SRowSet *  ,
struct PropertyTagArray_r *  flaglist 
)
void mapidump_SPropTagArray ( struct SPropTagArray *  )

References get_proptag_name().

void mapidump_SPropValue ( struct SPropValue  lpProp,
const char *  sep 
)

Output one property tag and value.

Parameters
lpPropthe property to print
sepa separator / spacer to insert in front of the label

References get_proptag_name(), get_SPropValue_data(), mapidump_date_SPropValue(), OC_ASSERT, PT_BINARY, PT_BOOLEAN, PT_CLSID, PT_DOUBLE, PT_ERROR, PT_I8, PT_LONG, PT_MV_BINARY, PT_MV_LONG, PT_MV_STRING8, PT_MV_UNICODE, PT_OBJECT, PT_SHORT, PT_STRING8, PT_SVREID, PT_SYSTIME, and PT_UNICODE.

Referenced by mapidump_SRow().

void mapidump_SRow ( struct SRow *  ,
const char *   
)
void mapidump_SRowSet ( struct SRowSet *  ,
const char *   
)

References mapidump_SRow().

void mapidump_tags ( enum MAPITAGS *  ,
uint16_t  ,
const char *   
)
void mapidump_task ( struct mapi_SPropValue_array *  properties,
const char *  id 
)

This function dumps the properties relating to a task (to-do list entry) to standard output

The expected way to obtain the properties array is to use OpenMessage() to obtain the task object, then to use GetPropsAll() to obtain all the properties.

Parameters
propertiesarray of task properties
ididentification to display for the task (can be NULL)
See Also
mapidump_message, mapidump_appointment, mapidump_contact, mapidump_note

References find_mapi_SPropValue_data(), get_importance(), get_task_status(), mapidump_date(), olTaskComplete, PidLidContacts, PidLidPercentComplete, PidLidPrivate, PidLidTaskDateCompleted, PidLidTaskDueDate, PidLidTaskStartDate, PidLidTaskStatus, PR_BODY, PR_CONVERSATION_TOPIC, and PR_IMPORTANCE.

enum MAPISTATUS MAPIFreeBuffer ( void *  ptr)

Free allocated memory

This function frees memory previously allocated with MAPIAllocateBuffer.

Parameters
ptrmemory region to free
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMER: ptr is not set properly.
See Also
MAPIAllocateBuffer, GetLastError

References OPENCHANGE_RETVAL_IF.

Referenced by AddUserPermission(), DuplicateProfile(), EntryIDFromSourceIDForMessage(), FreeBookmark(), GetABRecipientInfo(), GetBestBody(), GetFolderItemsCount(), GetProps(), GetUserFreeBusyData(), Logoff(), ModifyUserPermission(), ProcessNetworkProfile(), RemoveUserPermission(), SetPropertiesNoReplicate(), and SetProps().

enum MAPISTATUS MAPIInitialize ( struct mapi_context **  _mapi_ctx,
const char *  profiledb 
)

Initialize mapi context structure

This function inititalizes the MAPI subsystem and open the profile database pointed by profiledb .

Parameters
_mapi_ctxpointer to the MAPI context
profiledbprofile database path
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_NOT_ENOUGH_RESOURCES: MAPI subsystem failed to allocate the necessary resources to operate properly
  • MAPI_E_NOT_FOUND: No suitable profile database was found in the path pointed by profiledb
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
MAPIUninitialize

References mapi_context::dumpdata, mapi_context::ldb_ctx, mapi_context::lp_ctx, mapi_context::mem_ctx, OPENCHANGE_RETVAL_IF, OpenProfileStore(), and mapi_context::session.

enum MAPISTATUS MapiLogonEx ( struct mapi_context mapi_ctx,
struct mapi_session **  session,
const char *  profname,
const char *  password 
)

Create a full MAPI session

Open providers stored in the profile and return a pointer on a IMAPISession object.

Parameters
mapi_ctxpointer to the MAPI context
sessionpointer to a pointer to a MAPI session object
profnameprofile name to use
passwordpassword to use for the profile

password should be set to NULL if the password has been stored in the profile.

Returns
MAPI_E_SUCCESS on success otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_NOT_ENOUGH_RESOURCES: MAPI subsystem failed to allocate the necessary resources to operate properly
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
MAPIInitialize, OpenProfile, MapiLogonProvider

References MapiLogonProvider(), PROVIDER_ID_EMSMDB, and PROVIDER_ID_NSPI.

enum MAPISTATUS MapiLogonProvider ( struct mapi_context mapi_ctx,
struct mapi_session **  session,
const char *  profname,
const char *  password,
enum PROVIDER_ID  provider 
)

Initialize a session on the specified provider

Parameters
mapi_ctxpointer to the MAPI context
sessionpointer to a pointer to a MAPI session object
profnameprofile name
passwordprofile password
providerprovider we want to establish a connection on

password should be set to NULL if the password has been stored in the profile.

Supported providers are:

  • PROVIDER_ID_NSPI: Address Book provider
  • PROVIDER_ID_EMSMDB: MAPI Store provider
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_NOT_ENOUGH_RESOURCES: MAPI subsystem failed to allocate the necessary resources to operate properly
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
MapiLogonEx, OpenProfile, LoadProfile

References mapi_session::emsmdb, emsmdb_disconnect_dtor(), LoadProfile(), Logon(), mapi_session::logon_ids, mapi_session::mapi_ctx, mapi_context::mem_ctx, mapi_session::next, mapi_session::nspi, nspi_disconnect_dtor(), OPENCHANGE_RETVAL_IF, OpenProfile(), mapi_session::profile, PROVIDER_ID_EMSMDB, PROVIDER_ID_NSPI, and mapi_context::session.

Referenced by DuplicateProfile(), and MapiLogonEx().

void MAPIUninitialize ( struct mapi_context mapi_ctx)

Uninitialize MAPI subsystem

Parameters
mapi_ctxpointer to the MAPI context

This function uninitializes the MAPI context and destroy recursively the whole mapi session and associated objects hierarchy

See Also
MAPIInitialize, GetLastError

References mapi_notify_ctx::fd, mapi_context::mem_ctx, mapi_session::notify_ctx, and mapi_context::session.

enum MAPISTATUS ModifyPermissions ( mapi_object_t obj_table,
uint8_t  flags,
struct mapi_PermissionsData *  permsdata 
)

Modify the entries of a permission table

This function takes a pointer to a table object, a list of entries to modify and alter the permission table of its associated container. This function can be used to add, modify or remove permissions.

Parameters
obj_tablethe table containing the container's permissions
flagsany special flags to use
permsdatathe list of permissions table entries to modify

Possible values for flags:

  • 0x02 for IncludeFreeBusy. This should be set when modifying permissions on the Calendar folder when using Exchange 2007 and later. It should not be set in other situations.
  • 0x01 for ReplaceRows. This means "remove all current permissions and use this set instead", so the permsdata must consist of ROW_ADD operations.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetPermissionsTable, AddUserPermission, ModifyUserPermission, RemoveUserPermission

References emsmdb_transaction_wrapper(), get_mapi_property_size(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by AddUserPermission(), ModifyUserPermission(), and RemoveUserPermission().

enum MAPISTATUS ModifyRecipients ( mapi_object_t obj_message,
struct SRowSet *  SRowSet 
)

Adds, deletes or modifies message recipients

Parameters
obj_messagethe message to change the recipients for
SRowSetthe recipients to add
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

When using this function, take care to ensure that the properties that are present on the first row in the rowset are also present in all the following rows. If any are missing, this function will suffer NDR errors. This includes making sure that any string properties are present in the same encoding (e.g. if you use PR_SMTP_ADDRESS_UNICODE on the first row, don't provide PR_SMTP_ADDRESS on subsequent rows).

Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
Bug:
ModifyRecipients can only add recipients.
See Also
CreateMessage, ResolveNames, SetRecipientType, GetLastError

References cast_mapi_SPropValue(), emsmdb_transaction_wrapper(), find_SPropValue_data(), get_MAPITAGS_SRow(), get_utf8_utf16_conv_length(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_recipients_RecipientFlags(), MAPITAGS_delete_entries(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, PR_7BIT_DISPLAY_NAME, PR_7BIT_DISPLAY_NAME_UNICODE, PR_ADDRTYPE, PR_ADDRTYPE_ERROR, PR_ADDRTYPE_UNICODE, PR_DISPLAY_NAME, PR_DISPLAY_NAME_ERROR, PR_DISPLAY_NAME_UNICODE, PR_EMAIL_ADDRESS, PR_EMAIL_ADDRESS_UNICODE, PR_ENTRYID, PR_GIVEN_NAME, PR_GIVEN_NAME_ERROR, PR_GIVEN_NAME_UNICODE, PR_RECIPIENT_TYPE, PR_SEND_INTERNET_ENCODING, PR_SEND_INTERNET_ENCODING_ERROR, PR_SEND_RICH_INFO, PR_SEND_RICH_INFO_ERROR, PR_SMTP_ADDRESS, PR_SMTP_ADDRESS_UNICODE, PR_TRANSMITTABLE_DISPLAY_NAME, and PR_TRANSMITTABLE_DISPLAY_NAME_UNICODE.

enum MAPISTATUS ModifyUserPermission ( mapi_object_t obj_folder,
const char *  username,
enum ACLRIGHTS  role 
)

Modify permissions for a user on a given folder

Parameters
obj_folderthe folder to modify permissions for
usernamethe Exchange username to modify permissions for
rolethe permission mask value (see AddUserPermission)
Returns
MAPI_E_SUCCESS on success, otherwise a failure code (MAPISTATUS) indicating the error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized.
  • MAPI_E_INVALID_PARAMETER: username is NULL
  • MAPI_E_NOT_FOUND: couldn't find or change permissions for the given user
See Also
AddUserPermission, ResolveNames, GetPermissionsTable, ModifyPermissions

References find_PropertyValue_data(), get_SPropValue_SRow(), GetPermissionsTable(), mapi_object_get_session(), mapi_object_init(), mapi_object_release(), MAPI_RESOLVED, MAPIFreeBuffer(), ModifyPermissions(), OPENCHANGE_RETVAL_IF, PR_DISPLAY_NAME, PR_ENTRYID, PR_MEMBER_ID, PR_MEMBER_NAME, PR_MEMBER_RIGHTS, QueryPosition(), QueryRows(), ResolveNames(), set_SPropTagArray(), and SetColumns().

enum MAPISTATUS MonitorNotification ( struct mapi_session session,
void *  private_data,
struct mapi_notify_continue_callback_data cb_data 
)

Wait for notifications and process them

This function waits for notifications on the UDP port and generates the traffic needed to receive MAPI notifications. These MAPI notifications are next compared to the registered ones and the callback specified in Subscribe() called if it matches.

The function takes a callback in cb_data to check if it should continue to process notifications. Timeval in cb_data can be used to control the behavior of select.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
RegisterNotification, Subscribe, Unsubscribe, GetLastError
Note
This code is experimental. The current implementation is non-threaded, only supports fnevNewmail and fnevCreatedObject notifications and will block your process until you send a signal.

References mapi_notify_continue_callback_data::callback, mapi_provider::ctx, mapi_notify_continue_callback_data::data, mapi_session::emsmdb, emsmdb_transaction_null(), mapi_notify_ctx::fd, mapi_session::notify_ctx, OPENCHANGE_RETVAL_IF, ProcessNotification(), and mapi_notify_continue_callback_data::tv.

enum MAPISTATUS MoveCopyMessages ( mapi_object_t obj_src,
mapi_object_t obj_dst,
mapi_id_array_t message_id,
bool  WantCopy 
)

Copy or Move a message from a folder to another

Parameters
obj_srcThe source folder
obj_dstThe destination folder
message_idpointer to container object for message ids.
WantCopyboolean value, defines whether the operation is a copy or a move

Possible values for WantCopy:

  1. 0: Move
  2. 1: Copy
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenFolder, GetLastError

References mapi_id_array::count, emsmdb_transaction_wrapper(), mapi_id_array_get(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS MoveFolder ( mapi_object_t obj_folder,
mapi_object_t obj_src,
mapi_object_t obj_dst,
char *  NewFolderName,
bool  UseUnicode 
)

Moves a folder

Parameters
obj_folderthe folder to move
obj_srcsource object where the folder to move is stored
obj_dstdestination object where the folder will be moved
NewFolderNamethe new folder name in the destination folder
UseUnicodewhether the folder name is unicode encoded or not
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenFolder, CopyFolder

References emsmdb_transaction_wrapper(), get_utf8_utf16_conv_length(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

void ndr_push_idset ( struct ndr_push *  ndr,
struct idset idset 
)

push an idset on an ndr stream

References IDSET_serialize().

__BEGIN_DECLS struct nspi_context* nspi_bind ( TALLOC_CTX *  parent_ctx,
struct dcerpc_pipe *  p,
struct cli_credentials *  cred,
uint32_t  codepage,
uint32_t  language,
uint32_t  method 
)

Initiates a session between a client and the NSPI server.

Parameters
parent_ctxpointer to the memory context
ppointer to the DCERPC pipe
credpointer to the user credentials
codepagethe code to set in the STAT structure
languagethe language to set in the STAT structure
methodthe method to set in the STAT structure
Returns
Allocated pointer to a nspi_context structure on success, otherwise NULL

References nspi_context::cred, nspi_context::handle, nspi_context::mem_ctx, nspi_context::pStat, nspi_context::rpc_connection, and nspi_context::version.

Referenced by Logon().

enum MAPISTATUS nspi_CompareMIds ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
uint32_t  MId1,
uint32_t  MId2,
uint32_t *  plResult 
)

Compares the position in an address book container of two objects identified by MId and returns the value of the comparison

Parameters
nspi_ctxpointer to the NSPI connection context
mem_ctxpointer to the memory context
MId1the first MId to compare
MId2the second MId to compare
plResultpointer to the value of the comparison
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

enum MAPISTATUS nspi_DNToMId ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
struct StringsArray_r *  pNames,
struct PropertyTagArray_r **  ppMIds 
)

Maps a set of DN to a set of MId

Parameters
nspi_ctxpointer to the NSPI connection context
mem_ctxpointer to the memory context
pNamespointer to a StringsArray_r structure with the DN to map
ppMIdspointer on pointer to the returned list of MIds
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References nspi_context::handle, OPENCHANGE_RETVAL_IF, and nspi_context::rpc_connection.

Referenced by GetABRecipientInfo(), and ProcessNetworkProfile().

enum MAPISTATUS nspi_GetIDsFromNames ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
bool  VerifyNames,
uint32_t  cNames,
struct PropertyName_r *  ppNames,
struct SPropTagArray **  ppPropTags 
)

Retrieve the Property IDs associated with property names from the NSPI server.

Parameters
nspi_ctxpointer on the NSPI connection context
mem_ctxpointer to the memoty context
VerifyNamesboolean value defining whether the NSPI server must verify that all client specified names are recognized by the server
cNamescount of PropertyName_r entries
ppNamespointer to a PropertyName_r structure with the list of property tags supplied by the client
ppPropTagspointer on pointer to the list of proptags returned by the server
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References nspi_context::handle, OPENCHANGE_RETVAL_IF, and nspi_context::rpc_connection.

enum MAPISTATUS nspi_GetMatches ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
struct SPropTagArray *  pPropTags,
struct Restriction_r *  Filter,
uint32_t  ulRequested,
struct PropertyRowSet_r **  ppRows,
struct PropertyTagArray_r **  ppOutMIds 
)

Returns an explicit table.

Parameters
nspi_ctxpointer to the NSPI connection context
mem_ctxpointer to the memory context
pPropTagspointer to an array of property tags of columns
Filterpointer to the Restriction to apply to the table
ulRequestedThe upper limit for returned rows
ppRowspointer to pointer to a SRowSet structure holding the rows returned by the server
ppOutMIdspointer to pointer to a list of MId that comprise a restricted address book container
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error. If the resulting table rows count will be greater than ulRequested, then an error MAPI_E_TABLE_TOO_BIG is returned. Note, this error can be also returned when server limits for table size are exceeded.

References nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

Referenced by DuplicateProfile(), and ProcessNetworkProfile().

enum MAPISTATUS nspi_GetNamesFromIDs ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
struct FlatUID_r *  lpGuid,
struct SPropTagArray *  pPropTags,
struct SPropTagArray **  ppReturnedPropTags,
struct PropertyNameSet_r **  ppNames 
)

Returns a list of property names for a set of proptags

Parameters
nspi_ctxpointer on the NSPI connection text
mem_ctxpointer to the memory context
lpGuidthe property set about which the client is requesting information
pPropTagspointer to the proptags list
ppReturnedPropTagspointer on pointer to the list of all the proptags in the property set specified in lpGuid
ppNamespointer on pointer to the list of property names returned by the server
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References nspi_context::handle, OPENCHANGE_RETVAL_IF, and nspi_context::rpc_connection.

enum MAPISTATUS nspi_GetPropList ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
bool  WantObject,
uint32_t  dwMId,
struct SPropTagArray **  ppPropTags 
)

Returns a list of all the properties that have values on the specified object

Parameters
nspi_ctxpointer to the NSPI connection context
mem_ctxpointer to the memory context
WantObjectboolean value defining whether we want the server to include properties with the type set to PT_OBJECT
dwMIdthe MId of the specified object
ppPropTagspointer on pointer to the list of property tags associated to the object.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

enum MAPISTATUS nspi_GetProps ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
struct SPropTagArray *  pPropTags,
struct PropertyTagArray_r *  MId,
struct PropertyRowSet_r **  SRowSet 
)

Returns an address book row containing a set of the properties and values that exists on an object

Parameters
nspi_ctxpointer to the NSPI connection context
mem_ctxpointer to the memory context
pPropTagspointer to the list of property tags that the client wants to be returned
MIdpointer to the MId of the record
SRowSetpointer on pointer to the row returned by the server
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

Referenced by GetABRecipientInfo(), and ProcessNetworkProfile().

enum MAPISTATUS nspi_GetSpecialTable ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
uint32_t  Type,
struct PropertyRowSet_r **  ppRows 
)

Returns the rows of a special table to the client. The special table can be a Hierarchy Table or an Address Creation Table

Parameters
nspi_ctxpointer to the NSPI connection context
mem_ctxpointer to the memory context
Typebitmap of flags defining the type of the special table
ppRowspointer on pointer to the rows returned by the server

Possible values for Type:

  1. NspiAddressCreationTemplates to access an Address Creation Table
  2. NspiUnicodeStrings for strings to be returned in Unicode

If NspiAddressCreationTemplates is not set, then NspiGetSpecialTable will automatically fetch the Hierarchy Table.

If NspiAddressCreationTemplates is set, then NspiUnicodeStrings is ignored.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, nspi_context::rpc_connection, and nspi_context::version.

Referenced by DuplicateProfile(), and ProcessNetworkProfile().

enum MAPISTATUS nspi_GetTemplateInfo ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
uint32_t  dwFlags,
uint32_t  ulType,
char *  pDN,
struct PropertyRow_r **  ppData 
)

Returns information about template objects in the address book.

Parameters
nspi_ctxpointer to the NSPI memory context
mem_ctxpointer to the memory context
dwFlagsset of bit flags
ulTypespecifies the display type of the template
pDNthe DN of the template requested
ppDatapointer on pointer to the data requested

Possible values for dwFlags:

  1. TI_TEMPLATE to return the template
  2. TI_SCRIPT to return the script associated to the template
  3. TI_EMT to return the e-mail type associated to the template
  4. TI_HELPFILE_NAME to return the help file associated to the template
  5. TI_HELPFILE_CONTENTS to return the contents of the help file associated to the template
    Returns
    MAPI_E_SUCCESS on success, otherwise MAPI error.

References nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

enum MAPISTATUS nspi_ModLinkAtt ( struct nspi_context nspi_ctx,
bool  Delete,
uint32_t  ulPropTag,
uint32_t  MId,
struct BinaryArray_r *  lpEntryIds 
)

Modifies the values of a specific property of a specific row in the address book. This function only applies only to rows that support the PT_OBJECT Property Type.

Parameters
nspi_ctxpointer to the NSPI connection context
Deleteboolean value defining whether the server must remove all values specified by the input parameter lpEntryIDs from the property specified by ulPropTag
ulPropTagproperty tag of the property the client wishes to modify
MIdthe MId of the address book object
lpEntryIdsarray of BinaryArray_r structures intended to be modified or deleted
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References nspi_context::handle, nspi_context::mem_ctx, OPENCHANGE_RETVAL_IF, PT_OBJECT, and nspi_context::rpc_connection.

enum MAPISTATUS nspi_ModProps ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
uint32_t  MId,
struct SPropTagArray *  pPropTags,
struct PropertyRow_r *  pRow 
)

Modify the properties of an object in the address book

Parameters
nspi_ctxpointer to the NSPI connection context
mem_ctxpointer to the memory context
MIdthe MId of the address book object
pPropTagspointer to the list of properties to be modified on the object
pRowContains an address book row
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

enum MAPISTATUS nspi_QueryColumns ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
bool  WantUnicode,
struct SPropTagArray **  ppColumns 
)

Returns a list of all the properties the NSPI server is aware off.

Parameters
nspi_ctxpointer to the NSPI connection context
mem_ctxpointer to the memory context
WantUnicodewhether we want UNICODE properties or not
ppColumnspointer on pointer to a property tag array
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References nspi_context::handle, OPENCHANGE_RETVAL_IF, and nspi_context::rpc_connection.

enum MAPISTATUS nspi_QueryRows ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
struct SPropTagArray *  pPropTags,
struct PropertyTagArray_r *  MIds,
uint32_t  count,
struct PropertyRowSet_r **  ppRows 
)

Returns a number of Rows from a specified table.

Parameters
nspi_ctxpointer to the NSPI connection context
mem_ctxpointer to the memory context
pPropTagspointer to the list of proptags that the client requires to be returned for each row.
MIdspointer to a list of values representing an Explicit table
countthe number of rows requested
ppRowspointer on pointer to the the rows returned by the server
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

Referenced by GetGALTable(), GetGALTableCount(), and ProcessNetworkProfile().

enum MAPISTATUS nspi_ResolveNames ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
const char **  usernames,
struct SPropTagArray *  pPropTags,
struct PropertyRowSet_r ***  pppRows,
struct PropertyTagArray_r ***  pppMIds 
)

Takes a set of string values in an 8-bit character set and performs ANR on those strings

Parameters
nspi_ctxpointer on the NSPI connection context
mem_ctxpointer to the memory context
usernamespointer on pointer to the list of values we want to perform ANR on
pPropTagspointer on the property tags list we want for each row returned
pppRowspointer on pointer on pointer to the rows returned by the server
pppMIdspointer on pointer on pointer to the MIds matching the array of strings
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

Referenced by ResolveNames().

enum MAPISTATUS nspi_ResolveNamesW ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
const char **  usernames,
struct SPropTagArray *  pPropTags,
struct PropertyRowSet_r ***  pppRows,
struct PropertyTagArray_r ***  pppMIds 
)

Takes a set of string values in the Unicode character set and performs ambiguous name resolution (ANR) on those strings

Parameters
nspi_ctxpointer on the NSPI connection context
mem_ctxpointer to the memory context
usernamespointer on pointer to the list of values we want to perform ANR on
pPropTagspointer on the property tags list we want for each row returned
pppRowspointer on pointer on pointer to the rows returned by the server
pppMIdspointer on pointer on pointer to the MIds matching the array of strings
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

Referenced by ResolveNames().

enum MAPISTATUS nspi_ResortRestriction ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
enum TableSortOrders  SortType,
struct PropertyTagArray_r *  pInMIds,
struct PropertyTagArray_r **  ppMIds 
)

Applies a sort order to the objects in a restricted address book container

Parameters
nspi_ctxpointer to the NSPI connection context
mem_ctxpointer to the memory context
SortTypethe table sort order to use
pInMIdspointer on a list of MIds that comprise a restricted address book container
ppMIdspointer on pointer to the returned list of MIds that comprise a restricted address book container.

SortType can take the following values:

  1. SortTypeDisplayName
  2. SortTypePhoneticDisplayName
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

enum MAPISTATUS nspi_SeekEntries ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
enum TableSortOrders  SortType,
struct PropertyValue_r *  pTarget,
struct SPropTagArray *  pPropTags,
struct PropertyTagArray_r *  pMIds,
struct PropertyRowSet_r **  pRows 
)

Searches for and sets the logical position in a specific table to the first entry greater than or equal to a specified value. Optionally, it might also return information about rows in the table.

Parameters
nspi_ctxpointer to the NSPI connection context
mem_ctxpointer to the memory context
SortTypethe table sort order to use
pTargetPropertyValue_r struct holding the value being sought
pPropTagspointer to an array of property tags of columns that the client wants to be returned for each row returned.
pMIdspointer to a list of Mid that comprise a restricted address book container
pRowspointer to pointer to a SRowSet structure holding the rows returned by the server

SortType can take the following values:

  1. SortTypeDisplayName
  2. SortTypePhoneticDisplayName

If pTarget property tag is not set accordingly to SortType, the function returns MAPI_E_INVALID_PARAMETER. Possible values are:

  1. SortType set to SortTypeDisplayName and pTarget property tag set to PR_DISPLAY_NAME or PR_DISPLAY_UNICODE
  2. SortType set to SortTypePhoneticDisplayName and pTarget property tag set to PR_EMS_AB_PHONETIC_DISPLAY_NAME or PR_EMS_AB_PHONETIC_DISPLAY_NAME_UNICODE
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References nspi_context::handle, OPENCHANGE_RETVAL_IF, PR_DISPLAY_NAME, PR_DISPLAY_NAME_UNICODE, PR_EMS_AB_PHONETIC_DISPLAY_NAME, PR_EMS_AB_PHONETIC_DISPLAY_NAME_UNICODE, nspi_context::pStat, and nspi_context::rpc_connection.

enum MAPISTATUS nspi_unbind ( struct nspi_context nspi_ctx)

Destroys the context handle

Parameters
nspi_ctxpointer to the NSPI connection context
Returns
return 1 on success or 2 if the input context is NULL

References nspi_context::handle, MAPI_STATUS_IS_OK, nspi_context::mem_ctx, OPENCHANGE_RETVAL_IF, and nspi_context::rpc_connection.

Referenced by nspi_disconnect_dtor().

enum MAPISTATUS nspi_UpdateStat ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
uint32_t *  plDelta 
)

Updates the STAT block representing position in a table to reflect positioning changes requested by the client.

Parameters
nspi_ctxpointer to the NSPI connection context
mem_ctxpointer to the memory context
plDeltapointer to an unsigned long indicating movement within the address book container specified by the input parameter pStat.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

enum MAPISTATUS OpenAttach ( mapi_object_t obj_message,
uint32_t  AttachmentID,
mapi_object_t obj_attach 
)

Open an attachment to a message

This function opens one attachment from a message. The attachment to be opened is specified by its PR_ATTACH_NUM.

Parameters
obj_messagethe message to operate on
AttachmentIDthe attachment number
obj_attachthe resulting attachment object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CreateMessage, CreateAttach, GetAttachmentTable, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS OpenEmbeddedMessage ( mapi_object_t obj_attach,
mapi_object_t obj_embeddedmsg,
enum OpenEmbeddedMessage_OpenModeFlags  ulFlags 
)

Opens an embedded message object and retrieves a MAPI object that can be used to get or set properties on the embedded message.

This function essentially takes an attachment and gives you back a message.

Parameters
obj_attachthe attachment object
obj_embeddedmsgthe embedded message
ulFlagsaccess rights on the embedded message

Possible ulFlags values:

  • 0x0: read only access
  • 0x1: Read / Write access
  • 0x2: Create
... assume we have a message - obj_message ...
// Initialise the attachment object
mapi_object_init(&obj_attach);
// Create an attachment to the message
retval = CreateAttach(&obj_message, &obj_attach);
... check the return value ...
// use SetProps() to set the attachment up, noting the special PR_ATTACHM_METHOD property
attach[0].ulPropTag = PR_ATTACH_METHOD;
attach[0].value.l = ATTACH_EMBEDDED_MSG;
attach[1].ulPropTag = PR_RENDERING_POSITION;
attach[1].value.l = 0;
retval = SetProps(&obj_attach, 0, attach, 2);
... check the return value ...
// Initialise the embedded message object
mapi_object_init(&obj_embeddedmsg);
retval = OpenEmbeddedMessage(&obj_attach, &obj_embeddedmsg, MAPI_CREATE);
... check the return value ...
// Fill in the embedded message properties, just like any other message (e.g. resulting from CreateMessage())
// Save the changes to the embedded message
retval = SaveChangesMessage(&obj_message, &obj_embeddedmsg, KeepOpenReadOnly);
... check the return value ...
// Save the changes to the attachment
retval = SaveChangesAttachment(&obj_message, &obj_attach, KeepOpenReadOnly);
... check the return value ...
// Save the changes to the original message
retval = SaveChangesMessage(&obj_folder, &obj_message, KeepOpenReadOnly);
... check the return value ...
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_store is undefined
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
Note
Developers may also call GetLastError() to retrieve the last MAPI error code.
See Also
CreateAttach, OpenMessage, GetLastError

References mapi_obj_message::cValues, emsmdb_get_SRow(), emsmdb_transaction_wrapper(), mapi_session::mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, PR_INTERNET_CPID, PR_RECIPIENT_TYPE, mapi_object::private_data, mapi_obj_message::SPropTagArray, SPropTagArray_add(), SRow_addprop(), and mapi_obj_message::SRowSet.

enum MAPISTATUS OpenFolder ( mapi_object_t obj_store,
mapi_id_t  id_folder,
mapi_object_t obj_folder 
)

Open a folder from the store

Parameters
obj_storethe store to open a folder in (i.e. the parent)
id_folderthe folder identifier
obj_folderthe resulting open folder
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
MAPIInitialize, OpenMsgStore, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_id(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by GetUserFreeBusyData().

enum MAPISTATUS OpenMessage ( mapi_object_t obj_store,
mapi_id_t  id_folder,
mapi_id_t  id_message,
mapi_object_t obj_message,
uint8_t  ulFlags 
)

Opens a specific message and retrieves a MAPI object that can be used to get or set message properties.

This function opens a specific message defined by a combination of object store, folder ID, and message ID and which read/write access is defined by ulFlags.

Parameters
obj_storethe store to read from
id_folderthe folder ID
id_messagethe message ID
obj_messagethe resulting message object
ulFlagsPossible ulFlags values:
  • 0x0: read only access
  • 0x1: ReadWrite
  • 0x3: Create
  • 0x4: OpenSoftDeleted
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_store is undefined
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
MAPIInitialize, GetLastError

References mapi_obj_message::cValues, emsmdb_get_SRow(), emsmdb_transaction_wrapper(), get_TypedString(), mapi_session::mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), mapi_obj_message::NormalizedSubject, OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, PR_INTERNET_CPID, PR_RECIPIENT_TYPE, mapi_object::private_data, mapi_obj_message::SPropTagArray, SPropTagArray_add(), SRow_addprop(), mapi_obj_message::SRowSet, and mapi_obj_message::SubjectPrefix.

Referenced by GetUserFreeBusyData().

enum MAPISTATUS OpenMsgStore ( struct mapi_session session,
mapi_object_t obj_store 
)

Open the Message Store

This function opens the main message store. This allows access to the normal user folders.

Parameters
sessionpointer to the MAPI session context
obj_storethe result of opening the store
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
MAPIInitialize which is required before opening the store
GetLastError to check the result of a failed call, if necessary
OpenPublicFolder if you need access to the public folders

References GetLastError(), OPENCHANGE_RETVAL_IF, OpenUserMailbox(), mapi_session::profile, and mapi_profile::username.

enum MAPISTATUS OpenProfile ( struct mapi_context mapi_ctx,
struct mapi_profile profile,
const char *  profname,
const char *  password 
)

Load a profile from the database

This function opens a named profile from the database, and fills the mapi_profile structure with common profile information.

Parameters
mapi_ctxpointer to the MAPI context
profilethe resulting profile
profnamethe name of the profile to open
passwordthe password to use with the profile
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
profile must be talloced because it used as talloc subcontext for data members. Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_ENOUGH_RESOURCES: ldb subsystem initialization failed
  • MAPI_E_NOT_FOUND: the profile was not found in the profile database
  • MAPI_E_COLLISION: profname matched more than one entry
See Also
MAPIInitialize, GetLastError

References mapi_context::ldb_ctx, mapi_profile::mapi_ctx, and OPENCHANGE_RETVAL_IF.

Referenced by DuplicateProfile(), and MapiLogonProvider().

enum MAPISTATUS OpenPublicFolder ( struct mapi_session session,
mapi_object_t obj_store 
)

Open the Public Folder store

This function opens the public folder store. This allows access to the public folders.

Parameters
obj_storethe result of opening the store
sessionpointer to the MAPI session context
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
MAPIInitialize which is required before opening the store
GetLastError to check the result of a failed call, if necessary
OpenMsgStore if you need access to the message store folders

References emsmdb_transaction_wrapper(), mapi_obj_store::fid_pf_EFormsRegistry, mapi_obj_store::fid_pf_EFormsRegistryRoot, mapi_obj_store::fid_pf_FreeBusyRoot, mapi_obj_store::fid_pf_ipm_subtree, mapi_obj_store::fid_pf_LocalSiteFreeBusy, mapi_obj_store::fid_pf_LocalSiteOfflineAB, mapi_obj_store::fid_pf_NNTPArticle, mapi_obj_store::fid_pf_non_ipm_subtree, mapi_obj_store::fid_pf_OfflineAB, mapi_obj_store::fid_pf_public_root, GetNewLogonId(), mapi_obj_store::guid, mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_logon_store(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, mapi_object::private_data, mapi_session::profile, PublicFolder, and mapi_obj_store::store_type.

enum MAPISTATUS OpenPublicFolderByName ( mapi_object_t obj_folder,
mapi_object_t obj_child,
const char *  name 
)

Open a NNTP Public Folder given its name

Parameters
obj_folderthe parent folder
obj_childthe resulting open folder
namethe folder name
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenPublicFolder

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS OpenStream ( mapi_object_t obj_related,
enum MAPITAGS  PropertyTag,
enum OpenStream_OpenModeFlags  OpenModeFlags,
mapi_object_t obj_stream 
)

Open a stream

This function opens a stream on the property prop set in obj_related with access flags set to access_flags and returns an object obj_stream.

Parameters
obj_relatedthe object to open.
PropertyTagthe property name for the object to create a stream for.
OpenModeFlagssets the access mode for the stream and is one of the following values: 0x0: ReadOnly 0x1: ReadWrite 0x2: Create 0x3: BestAccess
obj_streamthe resulting stream object.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: A problem occurred obtaining the session context
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
Note
Developers may also call GetLastError() to retrieve the last MAPI error code.
See Also
ReadStream, WriteStream, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS OpenUserMailbox ( struct mapi_session session,
const char *  username,
mapi_object_t obj_store 
)

Open another user mailbox

This function opens the main message store. This allows access to the normal user folders.

Parameters
sessionpointer to the MAPI session context
usernamename of the user's mailbox to open
obj_storethe result of opening the store
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
MAPIInitialize which is required before opening the store
GetLastError to check the result of a failed call, if necessary
OpenPublicFolder if you need access to the public folders

References emsmdb_transaction_wrapper(), mapi_obj_store::fid_common_views, mapi_obj_store::fid_deferred_actions, mapi_obj_store::fid_deleted_items, mapi_obj_store::fid_inbox, mapi_obj_store::fid_mailbox_root, mapi_obj_store::fid_outbox, mapi_obj_store::fid_schedule, mapi_obj_store::fid_search, mapi_obj_store::fid_sent_items, mapi_obj_store::fid_shortcuts, mapi_obj_store::fid_spooler_queue, mapi_obj_store::fid_top_information_store, mapi_obj_store::fid_views, GetNewLogonId(), mapi_obj_store::guid, mapi_profile::mailbox, mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_logon_store(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_CALL_IF, OPENCHANGE_RETVAL_IF, mapi_profile::org, mapi_profile::ou, mapi_object::private_data, PrivateFolderWithoutCachedFids, mapi_session::profile, and mapi_obj_store::store_type.

Referenced by OpenMsgStore().

enum MAPISTATUS OptionsData ( mapi_object_t obj_store,
const char *  addrtype,
uint8_t **  OptionsData,
uint16_t *  OptionsLength,
uint8_t **  HelpFile,
uint16_t *  HelpFileLength,
const char **  HelpFileName 
)

Returns options information for the types of recipients that the transport provider handles.

Parameters
[in]obj_storethe object to get recipients types from
[in]addrtypestring name of the address type to get options for
[out]OptionsDatathe options data for this addrtype
[out]OptionsLengthlength of the OptionsData array
[out]HelpFilethe help file data for this addrtype (often empty)
[out]HelpFileLengthlength of the HelpFile array
[out]HelpFileNamethe name of the help file (often null)

The caller is responsible for talloc_free()ing the OptionsData array.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_store is not initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS ProcessNetworkProfile ( struct mapi_session session,
const char *  username,
mapi_profile_callback_t  callback,
const void *  private_data 
)

Process a full and automated MAPI profile creation

This function process a full and automated MAPI profile creation using the username pattern passed as a parameter. The functions takes a callback parameter which will be called when the username checked matches several usernames. Private data needed by the callback can be supplied using the private_data pointer.

typedef int (*mapi_callback_t) callback(struct SRowSet *, void *private_data);

The callback returns the SRow element index within the SRowSet structure. If the user cancels the operation the callback return value should be SRowSet->cRows or more.

Parameters
sessionthe session context
usernamethe username for the network profile
callbackfunction pointer callback function
private_datacontext data that will be provided to the callback
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized. The MAPI subsystem must be initialized (using MAPIInitialize) prior to creating a profile.
  • MAPI_E_END_OF_SESSION: The NSPI session has not been initialized
  • MAPI_E_CANCEL_USER: The user has aborted the operation
  • MAPI_E_INVALID_PARAMETER: The profile parameter was not set properly.
  • MAPI_E_NOT_FOUND: One of the mandatory field was not found during the profile creation process.
See Also
OpenProfileStore, MAPILogonProvider, GetLastError

References nspi_context::cred, mapi_provider::ctx, get_PropertyValue_PropertyRowSet(), mapi_session::mapi_ctx, mapi_profile_add_string_attr(), MAPIFreeBuffer(), mapi_session::nspi, nspi_DNToMId(), nspi_GetMatches(), nspi_GetProps(), nspi_GetSpecialTable(), nspi_QueryRows(), OPENCHANGE_RETVAL_IF, nspi_context::org, ORG, nspi_context::org_unit, ORG_UNIT, PR_ACCOUNT, PR_ADDRTYPE, PR_ANR_UNICODE, PR_ATTACH_NUM, PR_COMPANY_NAME, PR_DISPLAY_NAME, PR_DISPLAY_TYPE, PR_EMAIL_ADDRESS, PR_EMS_AB_HOME_MDB, PR_EMS_AB_NETWORK_ADDRESS, PR_EMS_AB_PROXY_ADDRESSES, PR_ENTRYID, PR_INSTANCE_KEY, PR_OBJECT_TYPE, PR_OFFICE_LOCATION, PR_OFFICE_TELEPHONE_NUMBER, PR_PROFILE_HOME_SERVER_ADDRS, PR_TITLE, mapi_session::profile, mapi_profile::profname, nspi_context::pStat, RES_PROPERTY, SERVER_DN, nspi_context::servername, set_SPropTagArray(), x500_get_dn_element(), and x500_get_servername().

enum MAPISTATUS PropertyRow_addprop ( struct PropertyRow_r *  aRow,
struct PropertyValue_r  propValue 
)

add a PropertyValue_r structure to a PropertyRow_r array

Parameters
aRowpointer to the PropertyRow_r array where propValue should be appended
propValuethe PropertyValue_r structure to add to aRow
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_INVALID_PARAMETER.

References get_PropertyValue_data(), OPENCHANGE_RETVAL_IF, and set_PropertyValue().

uint32_t PropertyRowSet_propcpy ( TALLOC_CTX *  mem_ctx,
struct PropertyRowSet_r *  RowSet,
struct PropertyValue_r  value 
)

Append a PropertyValue_r structure to given PropertyRowSet_r

Parameters
mem_ctxpointer to the memory context
RowSetpointer to the PropertyRowSet_r array to update
valuethe PropertyValue_r to append within SRowSet
Returns
0 on success, otherwise 1

References set_PropertyValue().

enum MAPISTATUS PublicFolderIsGhosted ( mapi_object_t obj_store,
mapi_object_t obj_folder,
bool *  IsGhosted 
)

Determine if a public folder is ghosted.

This function returns whether a public folder is ghosted or not.

Parameters
obj_storethe store of the public folder
obj_folderthe folder we are querying for ghost
IsGhostedpointer on the boolean value returned
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS QueryColumns ( mapi_object_t obj_table,
struct SPropTagArray *  cols 
)

Retrieves the set of columns defined in the current table view

Parameters
obj_tablethe table we are retrieving columns from
colspointer to an array of property tags
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetColumns, QueryRows

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

enum MAPISTATUS QueryNamedProperties ( mapi_object_t obj,
uint8_t  queryFlags,
struct GUID *  guid,
uint16_t *  count,
uint16_t **  propID,
struct MAPINAMEID **  nameid 
)

Provides the property names that correspond to one or more property identifiers.

Parameters
objthe object to obtain the properties for
queryFlagsA set of flags that can restrict the type of properties
guida pointer to the GUID for the property set to fetch (null for all property sets.
countcount of property names pointed to by the nameid and propID parameters returned by the server
propIDpointer to an array of property IDs returned by the server
nameidpointer to an array of property names returned by the server
Note
queryFlags can be NoStrings (0x1) or NoIds (0x2), neither or both. NoStrings will produce only ID properties, NoIds will produce only named properties, and both will result in no output.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
See Also
GetNamesFromIDs

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS QueryPosition ( mapi_object_t obj_table,
uint32_t *  Numerator,
uint32_t *  Denominator 
)

Returns the approximate cursor position

Parameters
obj_tablepointer to the table's object
Numeratorpointer to the numerator of the fraction identifying the table position
Denominatorpointer to the denominator of the fraction identifying the table position
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
QueryRows

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by ModifyUserPermission(), and RemoveUserPermission().

enum MAPISTATUS QueryRows ( mapi_object_t obj_table,
uint16_t  row_count,
enum QueryRowsFlags  flags,
struct SRowSet *  rowSet 
)

Returns a RowSet with the properties returned by the server

Parameters
obj_tablethe table we are requesting properties from
row_countthe maximum number of rows to retrieve
flagsflags to use for the query
rowSetthe results

flags possible values:

  • TBL_ADVANCE: index automatically increased from last rowcount
  • TBL_NOADVANCE: should be used for a single QueryRows call
  • TBL_ENABLEPACKEDBUFFERS: (not yet implemented)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetColumns, QueryPosition, QueryColumns, SeekRow

References emsmdb_get_SRowSet(), emsmdb_transaction_wrapper(), mapi_session::mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, mapi_object::private_data, and mapi_obj_table::proptags.

Referenced by ModifyUserPermission(), and RemoveUserPermission().

struct idset* RAWIDSET_convert_to_idset ( TALLOC_CTX *  ,
const struct rawidset  
)
struct rawidset* RAWIDSET_make ( TALLOC_CTX *  ,
bool  ,
bool   
)
void RAWIDSET_push_guid_glob ( struct rawidset ,
const struct GUID *  ,
uint64_t   
)
enum MAPISTATUS ReadRecipients ( mapi_object_t obj_message,
uint32_t  RowId,
uint8_t *  RowCount,
struct ReadRecipientRow **  RecipientRows 
)

Read Recipients from a message

Parameters
obj_messagethe message we want to read recipients from
RowIdthe row index we start reading recipients from
RowCountpointer on the number of recipients
RecipientRowspointer on the recipients array
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
ModifyRecipients, RemoveAllRecipients, GetRecipientTable, OpenMessage

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS ReadStream ( mapi_object_t obj_stream,
unsigned char *  buf_data,
uint16_t  ByteCount,
uint16_t *  ByteRead 
)

Read buffer from a stream

This function reads from an open data stream. It will read up to ByteCount bytes from the stream, and return the data in data_buf. ByteRead is set to the number of bytes actually read.

Parameters
obj_streamthe opened stream object
buf_datathe buffer where data read from the stream will be stored
ByteCountthe number of bytes requested to be read from the stream
ByteReadthe number of bytes read from the stream
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: A problem occurred obtaining the session context
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
Note
Developers may also call GetLastError() to retrieve the last MAPI error code.
The data size intended to be read from the stream shouldn't extend a maximum size each time you call ReadStream. This size depends on Exchange server version. However 0x1000 is known to be a reliable read size value.
See Also
OpenStream, WriteStream, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by WrapCompressedRTFStream().

enum MAPISTATUS RegisterAsyncNotification ( struct mapi_session session,
uint32_t *  resultFlag 
)

Create an asynchronous notification

This function initializes the notification subsystem and configures the server to send notifications. Note that this call will block.

Parameters
sessionthe session context to register for notifications on.
resultFlagthe result of the operation (true if there was anything returned)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
RegisterNotification

References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_async_waitex(), emsmdb_context::mem_ctx, notifications::next, mapi_notify_ctx::notifications, mapi_session::notify_ctx, OPENCHANGE_RETVAL_IF, and notifications::prev.

enum MAPISTATUS RegisterNotification ( struct mapi_session session)

Initialize the notification subsystem

This function initializes the notification subsystem, binds a local UDP port to receive Exchange (server side) notifications and configures the server to send notifications on this port.

Parameters
sessionthe session context to register for notifications on.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
RegisterAsyncNotification, Subscribe, Unsubscribe, MonitorNotification, GetLastError

References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_bind_notification(), emsmdb_register_notification(), mapi_session::mapi_ctx, emsmdb_context::mem_ctx, mapi_session::notify_ctx, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS Release ( mapi_object_t obj)

Release an object on the server

The function releases the object obj on the server.

Parameters
objthe object to release
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by mapi_object_release(), and Unsubscribe().

enum MAPISTATUS ReloadCachedInformation ( mapi_object_t obj_message)

Retrieve the message properties for an already open message.

This function is very similar to OpenMessage, but works on an already open message object.

Parameters
obj_messagethe message object to retrieve the properties for.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_store is undefined
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenMessage

References mapi_obj_message::cValues, emsmdb_get_SRow(), emsmdb_transaction_wrapper(), mapi_session::mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, PR_INTERNET_CPID, PR_RECIPIENT_TYPE, mapi_object::private_data, mapi_obj_message::SPropTagArray, SPropTagArray_add(), SRow_addprop(), and mapi_obj_message::SRowSet.

enum MAPISTATUS RemoveAllRecipients ( mapi_object_t obj_message)

Deletes all recipients from a message

Parameters
obj_messagethe message we want to remove all recipients from
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
ModifyRecipients, ReadRecipients

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS RemoveUserPermission ( mapi_object_t obj_folder,
const char *  username 
)

Remove permissions for a user on a given folder

Parameters
obj_folderthe folder to remove permission from
usernamethe Exchange username to remove permissions for
Returns
MAPI_E_SUCCESS on success, otherwise a failure code (MAPISTATUS) indicating the error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized.
  • MAPI_E_INVALID_PARAMETER: username or obj_folder are NULL
  • MAPI_E_NOT_FOUND: couldn't find or remove permissions for the given user
See Also
ResolveNames, GetPermissionsTable, ModifyPermissions

References find_PropertyValue_data(), get_SPropValue_SRow(), GetPermissionsTable(), mapi_object_get_session(), mapi_object_init(), mapi_object_release(), MAPI_RESOLVED, MAPIFreeBuffer(), ModifyPermissions(), OPENCHANGE_RETVAL_IF, PR_DISPLAY_NAME, PR_ENTRYID, PR_MEMBER_ID, PR_MEMBER_NAME, PR_MEMBER_RIGHTS, QueryPosition(), QueryRows(), ResolveNames(), set_SPropTagArray(), and SetColumns().

enum MAPISTATUS RenameProfile ( struct mapi_context mapi_ctx,
const char *  old_profile,
const char *  profile 
)

Rename a profile

Parameters
mapi_ctxpointer to the MAPI context
old_profileold profile name
profilenew profile name
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

References get_SPropValue_SRow(), GetProfileTable(), mapi_context::ldb_ctx, nspi_context::mem_ctx, mapi_context::mem_ctx, OPENCHANGE_RETVAL_IF, and PR_DISPLAY_NAME.

enum MAPISTATUS Reset ( mapi_object_t obj_table)

Removes all filters that are currently on a table

Parameters
obj_tablethe table object to reset
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
Restrict

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS ResolveNames ( struct mapi_session session,
const char **  usernames,
struct SPropTagArray *  props,
struct PropertyRowSet_r **  rowset,
struct PropertyTagArray_r **  flaglist,
uint32_t  flags 
)

Resolve user names against the Windows Address Book Provider

Parameters
sessionpointer to the MAPI session context
usernameslist of user names to resolve
rowsetresulting list of user details
propsresulting list of resolved names
flaglistresulting list of resolution status (see below)
flagsif set to MAPI_UNICODE then UNICODE MAPITAGS can be used, otherwise only UTF8 encoded fields may be returned.

Possible flaglist values are:

  1. MAPI_UNRESOLVED: could not be resolved
  2. MAPI_AMBIGUOUS: resolution match more than one entry
  3. MAPI_RESOLVED: resolution matched a single entry
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  1. MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  2. MAPI_E_SESSION_LIMIT: No session has been opened on the provider
  3. MAPI_E_NOT_ENOUGH_RESOURCES: MAPI subsystem failed to allocate the necessary resources to operate properly
  4. MAPI_E_NOT_FOUND: No suitable profile database was found in the path pointed by profiledb
  5. MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

    It is the developer responsibility to call MAPIFreeBuffer on rowset and flaglist once they have finished to use them.

See Also
MAPILogonProvider, GetLastError

References mapi_provider::ctx, MAPI_UNICODE, nspi_context::mem_ctx, mapi_session::nspi, nspi_ResolveNames(), nspi_ResolveNamesW(), and OPENCHANGE_RETVAL_IF.

Referenced by AddUserPermission(), GetABRecipientInfo(), ModifyUserPermission(), and RemoveUserPermission().

enum MAPISTATUS Restrict ( mapi_object_t obj_table,
struct mapi_SRestriction *  res,
uint8_t *  TableStatus 
)

Applies a filter to a table, reducing the row set to only those rows matching the specified criteria.

Parameters
obj_tablethe object we are filtering
resthe filters we want to apply
TableStatusthe table status result

TableStatus can either hold:

  • TBLSTAT_COMPLETE (0x0)
  • TBLSTAT_SORTING (0x9)
  • TBLSTAT_SORT_ERROR (0xA)
  • TBLSTAT_SETTING_COLS (0xB)
  • TBLSTAT_SETCOL_ERROR (0xD)
  • TBLSTAT_RESTRICTING (0xE)
  • TBLSTAT_RESTRICT_ERROR (0xF)

Unlike MAPI, you don't pass a null restriction argument to remove the current restrictions. Use Reset() instead.

TableStatus should be set to NULL if you don't want to retrieve the status of the table.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
QueryRows, Reset

References emsmdb_transaction_wrapper(), get_mapi_SRestriction_size(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS RfrGetFQDNFromLegacyDN ( struct mapi_context mapi_ctx,
struct mapi_session session,
const char **  serverFQDN 
)

Returns the FQDN of the NSPI server corresponding to a DN

Parameters
mapi_ctxpointer to the MAPI context
sessionpointer to the MAPI session context
serverFQDNpointer to the server FQDN string (return value)
Returns
MAPI_E_SUCCESS on success, otherwise a MAPI error and serverFQDN content set to NULL.

References mapi_profile::credentials, mapi_profile::homemdb, mapi_context::lp_ctx, OPENCHANGE_RETVAL_IF, mapi_session::profile, RfrGetFQDNFromLegacyDN(), and mapi_profile::server.

Referenced by RfrGetFQDNFromLegacyDN().

enum MAPISTATUS RfrGetNewDSA ( struct mapi_context mapi_ctx,
struct mapi_session session,
const char *  server,
const char *  userDN,
char **  dsa 
)

Returns the name of an NSPI server

Parameters
mapi_ctxpointer to the MAPI context
sessionpointer to the MAPI session context
serverthe Exchange server address (IP or FQDN)
userDNoptional user mailbox DN
dsapointer to a new dsa (return value), containing a valid allocated string on success, otherwise NULL
Returns
MAPI_E_SUCCESS on success, otherwise a MAPI error and serverFQDN content set to NULL.
Note
The string returned can either be RfrGetNewDSA one on success, or a copy of the server's argument one on failure. If no server string is provided, NULL is returned.

It is up to the developer to free the returned string when not needed anymore.

References mapi_profile::credentials, mapi_context::lp_ctx, mapi_session::profile, RfrGetNewDSA(), and mapi_context::session.

Referenced by Logon(), and RfrGetNewDSA().

enum MAPISTATUS SaveChangesAttachment ( mapi_object_t obj_parent,
mapi_object_t obj_child,
enum SaveFlags  flags 
)

Makes permanent any changes made to an attachment since the last save operation.

Parameters
obj_parentthe parent of the object to save changes for
obj_childthe object to save changes for
flagsthe access flags to set on the saved object

Possible flags:

  • KeepOpenReadOnly
  • KeepOpenReadWrite
  • ForceSave
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetProps, ModifyRecipients, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SaveChangesMessage ( mapi_object_t parent,
mapi_object_t obj_message,
uint8_t  SaveFlags 
)

Saves all changes to the message

Parameters
parentthe parent object for the message
obj_messagethe message to save
SaveFlagsspecify how the save operation behaves

Possible value for SaveFlags:

  1. KeepReadOnly Keep the Message object open with read-only access
  2. KeepOpenReadWrite Keep the Message object open with read-write access
  3. ForceSave Commit the changes and keep the message object open with read-write access
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetProps, ModifyRecipients, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_id(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SeekRow ( mapi_object_t obj_table,
enum BOOKMARK  origin,
int32_t  offset,
uint32_t *  row 
)

Move the table cursor at a specific location

Parameters
obj_tablethe table we are moving cursor on
originthe table position where we start to seek
offseta particular offset in the table
rowthe position of the seeked row is returned in rows

origin possible values:

  • BOOKMARK_BEGINNING: Beginning of the table
  • BOOKMARK_CURRENT: Current position in the table
  • BOKMARK_END: End of the table
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetColumns, QueryRows

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SeekRowApprox ( mapi_object_t obj_table,
uint32_t  ulNumerator,
uint32_t  ulDenominator 
)

Moves the cursor to an approximate fractional position in the table

Parameters
obj_tablethe table we are moving cursor on
ulNumeratornumerator of the fraction representing the table position.
ulDenominatordenominator of the fraction representing the table position
  • If ulDenominator is NULL, then SeekRowApprox returns MAPI_E_INVALID_PARAMETER.
  • If ulNumerator is NULL, then SeekRowApprox moves the cursor to the beginning of the table. In such situation, SeekRowApprox call is similar to SeekRow with BOOKMARK_BEGINNING
  • If ulNumerator and ulDenominator have the same value, then SeekRowApprox moves the cursor to the end of the table. In such situation, SeekRowApprox call is similar to SeekRow with BOOKMARK_END
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SeekRow, SeekRowBookmark

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SeekRowBookmark ( mapi_object_t obj_table,
uint32_t  lpbkPosition,
uint32_t  RowCount,
uint32_t *  row 
)

Move the table cursor at a specific location given a bookmark

Parameters
obj_tablethe table we are moving cursor on
lpbkPositionthe bookmarked position
RowCounta relative number of rows to the bookmark
rowthe position of the seeked row is returned in rows
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_E_INVALID_BOOKMARK: The bookmark specified is invalid or beyond the last row requested
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CreateBookmark, FreeBookmark

References emsmdb_transaction_wrapper(), mapi_object_bookmark_find(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SeekStream ( mapi_object_t obj_stream,
uint8_t  Origin,
uint64_t  Offset,
uint64_t *  NewPosition 
)

Seek a specific position within the stream

Parameters
obj_streamthe stream object
Originorigin location for the seek operation
Offsetthe seek offset
NewPositionpointer on the new position after the operation

Origin can either take one of the following values:

0x0 The new seek pointer is an offset relative to the beginning of the stream. 0x1 The new seek pointer is an offset relative to the current seek pointer location. 0x2 The new seek pointer is an offset relative to the end of the stream.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_stream is not valid, Origin is out of limits, or NewPosition is null.
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenStream, ReadStream

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

struct Binary_r* set_AppointmentRecurrencePattern ( TALLOC_CTX *  mem_ctx,
const struct AppointmentRecurrencePattern *   
)
size_t set_AppointmentRecurrencePattern_size ( const struct AppointmentRecurrencePattern *  )
enum MAPISTATUS set_default_error_SPropValue_SRow ( struct SRow *  ,
enum  MAPITAGS,
void *   
)
size_t set_ExceptionInfo_size ( const struct ExceptionInfo *  )
size_t set_ExtendedException_size ( uint32_t  ,
enum  OverrideFlags,
const struct ExtendedException *   
)
bool set_mapi_SPropValue ( TALLOC_CTX *  ,
struct mapi_SPropValue *  ,
const void *   
)
bool set_mapi_SPropValue_proptag ( TALLOC_CTX *  ,
struct mapi_SPropValue *  ,
uint32_t  ,
const void *   
)

References set_mapi_SPropValue().

Referenced by add_mapi_SPropValue().

struct Binary_r* set_RecurrencePattern ( TALLOC_CTX *  ,
const struct RecurrencePattern *   
)
size_t set_RecurrencePattern_size ( const struct RecurrencePattern *  )
struct SPropTagArray* set_SPropTagArray ( TALLOC_CTX *  mem_ctx,
uint32_t  PropCount,
  ... 
)

Create a property tag array

Parameters
mem_ctxtalloc memory context to use for allocation
PropCountthe number of properties in the array

The varargs (the third and subsequent arguments) are the property tags to make up the array. So the normal way to use this to create an array of two tags is like:

struct SPropTagArray *array
Examples:
fetchappointment.c, and fetchmail.c.

Referenced by AddUserPermission(), DuplicateProfile(), EntryIDFromSourceIDForMessage(), GetABRecipientInfo(), GetBestBody(), GetFolderItemsCount(), GetUserFreeBusyData(), ModifyUserPermission(), ProcessNetworkProfile(), and RemoveUserPermission().

bool set_SPropValue_proptag ( struct SPropValue *  ,
enum  MAPITAGS,
const void *   
)
bool set_SPropValue_proptag_date_timeval ( struct SPropValue *  ,
enum  MAPITAGS,
const struct timeval *   
)
struct Binary_r* set_TimeZoneDefinition ( TALLOC_CTX *  ,
const struct TimeZoneDefinition *   
)
struct Binary_r* set_TimeZoneStruct ( TALLOC_CTX *  ,
const struct TimeZoneStruct *   
)
enum MAPISTATUS SetCollapseState ( mapi_object_t obj_table,
struct SBinary_short *  CollapseState 
)

Set the Collapse State of a Table

After a contents table has been sorted and categorized using SortTable, rows can be expanded and collapsed (using ExpandRow() and CollapseRow() repectively). You can save the state of the table using GetCollapseState, and restore it using this function.

Parameters
obj_tablethe table we are restoring the state for
CollapseStatethe Collapse State to restore
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table or CollapseState are null
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetCollapseState

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

enum MAPISTATUS SetColumns ( mapi_object_t obj_table,
struct SPropTagArray *  properties 
)

Defines the particular properties and order of properties to appear as columns in the table.

Parameters
obj_tablethe table the function is setting columns for
propertiesthe properties intended to be set
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table is NULL
  • MAPI_W_ERROR_RETURNED: Problem encountered while trying to set one or more properties
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
QueryRows, QueryColumns, SeekRow, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, mapi_object::private_data, and mapi_obj_table::proptags.

Referenced by GetUserFreeBusyData(), ModifyUserPermission(), and RemoveUserPermission().

enum MAPISTATUS SetDefaultProfile ( struct mapi_context mapi_ctx,
const char *  profname 
)

Set a default profile for the database

Parameters
mapi_ctxpointer to the MAPI context
profnamethe name of the profile to make the default profile
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: The profile parameter was not set properly.
  • MAPI_E_NOT_FOUND: The profile was not found in the database
See Also
GetDefaultProfile, GetProfileTable, GetLastError

References mapi_context::ldb_ctx, mapi_profile_modify_string_attr(), mapi_context::mem_ctx, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetLocalReplicaMidsetDeleted ( mapi_object_t obj_folder,
const struct GUID  ReplGuid,
const uint8_t  GlobalCountLow[6],
const uint8_t  GlobalCountHigh[6] 
)

Mark a range of Message Ids as deleted / unused

This function allows the client to specify that a specific range of message identifiers will never be used on a particular folder. This allows the server to make optimisations for message identifier sets during incremental change synchronisation operations.

Parameters
obj_folderpointer to the folder MAPI object
ReplGuidthe GUID for the MIDSET
GlobalCountLowlower end of the range to be marked as deleted
GlobalCountHighupper end of the range to be marked as deleted
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetMAPIDebugLevel ( struct mapi_context mapi_ctx,
uint32_t  level 
)

Set MAPI debug level

Parameters
mapi_ctxpointer to the MAPI context
levelthe debug level to set
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: the function parameter is invalid

References mapi_context::lp_ctx, mapi_context::mem_ctx, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetMAPIDumpData ( struct mapi_context mapi_ctx,
bool  status 
)

Enable MAPI network trace output

Parameters
mapi_ctxpointer to the MAPI context
statusthe status

possible status values/behavior:

  1. true: Network traces are displayed on stdout
  2. false: Network traces are not displayed on stdout
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_INITIALIZED

References mapi_context::dumpdata, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetMessageReadFlag ( mapi_object_t obj_folder,
mapi_object_t obj_child,
uint8_t  flags 
)

Clear or set the MSGFLAG_READ flag for a given message

This function clears or sets the MSGFLAG_READ flag in the PR_MESSAGE_FLAGS property of a given message.

Parameters
obj_folderthe folder to operate in
obj_childthe message to set flags on
flagsthe new flags (MSGFLAG_READ) value
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenMessage, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetMessageStatus ( mapi_object_t obj_folder,
mapi_id_t  msgid,
uint32_t  ulNewStatus,
uint32_t  ulNewStatusMask,
uint32_t *  ulOldStatus 
)

Set the status associated with a message

This function sets the status associated with a message in the given folder.

Parameters
obj_folderthe folder where the message is located
msgidthe message ID
ulNewStatusthe new status to be assigned
ulNewStatusMaskbitmask of flags hat is applied to the new status indicating the flags to be set
ulOldStatuspointer on the previous status of the message

ulNewStatusMask possible values:

  • MSGSTATUS_DELMARKED: the message is marked for deletion
  • MSGSTATUS_HIDDEN: the message is not to be displayed
  • MSGSTATUS_HIGHLIGHTED: the message is to be displayed highlighted
  • MSGSTATUS_REMOTE_DELETE: the message has been marked for deletion on the remote message store without downloading to the local client.
  • MSGSTATUS_REMOTE_DOWNLOAD: the message has been marked for downloading from the remote message store to the local client.
  • MSGSTATUS_TAGGED: The message has been tagged for a client-defined purpose.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetPropertiesNoReplicate ( mapi_object_t obj,
uint32_t  flags,
struct SPropValue *  lpProps,
unsigned long  PropCount 
)

Set one or more properties on a given object without invoking replication.

This function sets one or more properties on a specified object. It is the same as SetProps, except if the object is a folder, where this function does not result in folder properties being replicated.

Parameters
objthe object to set properties on
flagsFlags for behaviour; can be MAPI_PROPS_SKIP_NAMEDID_CHECK
lpPropsthe list of properties to set
PropCountthe number of properties
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj is not valid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetProps, DeletePropertiesNoReplicate

References cast_mapi_SPropValue(), mapi_nameid::count, emsmdb_transaction_wrapper(), GetIDsFromNames(), mapi_nameid_lookup_SPropValue(), mapi_nameid_map_SPropValue(), mapi_nameid_new(), mapi_nameid_unmap_SPropValue(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), MAPI_PROPS_SKIP_NAMEDID_CHECK, MAPIFreeBuffer(), mapi_nameid::nameid, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetProps ( mapi_object_t obj,
uint32_t  flags,
struct SPropValue *  lpProps,
unsigned long  PropCount 
)

Set one or more properties on a given object

This function sets one or more properties on a specified object.

Parameters
objthe object to set properties on
flagsFlags for behaviour; can be MAPI_PROPS_SKIP_NAMEDID_CHECK
lpPropsthe list of properties to set
PropCountthe number of properties
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetProps, GetPropList, GetPropsAll, DeleteProps, GetLastError

References cast_mapi_SPropValue(), mapi_nameid::count, emsmdb_transaction_wrapper(), GetIDsFromNames(), mapi_nameid_lookup_SPropValue(), mapi_nameid_map_SPropValue(), mapi_nameid_new(), mapi_nameid_unmap_SPropValue(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), MAPI_PROPS_SKIP_NAMEDID_CHECK, MAPIFreeBuffer(), mapi_nameid::nameid, OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetReadFlags ( mapi_object_t obj_folder,
uint8_t  ReadFlags,
uint16_t  MessageIdCount,
uint64_t *  MessageIds 
)

Set the Read Flags on one or more messages

Parameters
obj_folderthe folder containing the messages to change
ReadFlagsa bitmap of flags controlling the changes to PR_PROPERTY_FLAGS
MessageIdCountthe number of messages in the MessageIds array
MessageIdsan array of message ids to set Read flags for

Note that the obj_folder argument is the object corresponding to the folder containing the messages (e.g. the result of CreateFolder() or OpenFolder(). It is not the content table of that folder (unlike SetMessageReadFlag().)

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetMessageReadFlags for a slightly different version, working on a single message

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetReceiveFolder ( mapi_object_t obj_store,
mapi_object_t obj_folder,
const char *  lpszMessageClass 
)

Sets a folder as the destination for incoming messages of a particular message class.

Parameters
obj_storethe store to set the receive folder for
obj_folderthe destination folder
lpszMessageClassthe message class the folder will receive
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetReceiveFolder, GetReceiveFolderTable

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetRecipientType ( struct SRow *  aRow,
enum ulRecipClass  RecipClass 
)

Set the type of a recipient

The function sets the recipient type (RecipClass) in the aRow parameter. ResolveNames should be used to fill the SRow structure.

Parameters
aRowthe row to set
RecipClassthe type of recipient to set on the specified row
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: The aRow parameter was not set properly.
See Also
ResolveNames, ModifyRecipients, GetLastError

References OPENCHANGE_RETVAL_IF, PR_RECIPIENT_TYPE, and SRow_addprop().

enum MAPISTATUS SetSearchCriteria ( mapi_object_t obj_container,
struct mapi_SRestriction *  res,
uint32_t  SearchFlags,
mapi_id_array_t lpContainerList 
)

Establishes search criteria for the container

Parameters
obj_containerthe object we apply search criteria to
respointer to a mapi_SRestriction structure defining the search criteria
SearchFlagsbitmask of flags that controls how the search is performed
lpContainerListpointer to a list of identifiers representing containers to be included in the search

SearchFlags can take the following values:

  • BACKGROUND_SEARCH: Search run at normal priority relative to other searches. This flag is mutually exclusive with the FOREGROUND_SEARCH one.
  • FOREGROUND_SEARCH: Search run at high priority relative to other searches. This flag is mutually exclusive with the BACKGROUND_SEARCH one.
  • RECURSIVE_SEARCH: The search should include the containers specified in the lpContainerList parameter and all of their child container. This flag is mutually exclusive with the SHALLOW_SEARCH one.
  • RESTART_SEARCH: The search should be initiated, if this is the first call to SetSearchCriteria, or restarted, if the search is inactive. This flag is mutually exclusive with the STOP_SEARCH flag.
  • SHALLOW_SEARCH: The search should only look in the containers specified in the lpContainerList parameter for matching entries. This flag is mutually exclusive with the RECURSIVE_SEARCH one.
  • STOP_SEARCH: The search should be aborted. This flag is mutually exclusive with the RESTART_SEARCH one.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: One or more parameters were invalid (usually null pointer)
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetSearchCriteria

References mapi_id_array::count, emsmdb_transaction_wrapper(), get_mapi_SRestriction_size(), mapi_id_array_get(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetSpooler ( mapi_object_t obj_store)

Informs the server that the client intends to act as a mail spooler.

Parameters
obj_store,:the object server store object
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_store is not initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SpoolerLockMessage

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetStreamSize ( mapi_object_t obj_stream,
uint64_t  SizeStream 
)

Set the stream size

Parameters
obj_streamthe stream object
SizeStreamthe size of the stream
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_stream is not valid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
OpenStream, GetStreamSize

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SetSyncNotificationGuid ( mapi_object_t obj_advisor,
const struct GUID  Guid 
)

Assign a notification GUID to an ICS Advisor object

This function allows the client to set a specific GUID to an ICS advistor object (as returned from SyncOpenAdvisor). This operation is not supported on Exchange 2010.

Parameters
obj_advisorpointer to the ICS Advisor object
Guidthe GUID for the notification
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS ShutDown ( struct mapi_profile profile)

Release a profile

This function releases the credentials associated with the profile.

Parameters
profilethe profile to release.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: The profile parameter was not set or not valid

References mapi_profile::credentials, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SortTable ( mapi_object_t obj_table,
struct SSortOrderSet *  lpSortCriteria 
)

Order the rows of the table based on a criteria

Parameters
obj_tablethe table we are ordering rows on
lpSortCriteriapointer on sort criterias to apply
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_table or lpSortCriteria is NULL
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by GetUserFreeBusyData().

enum MAPISTATUS SpoolerLockMessage ( mapi_object_t obj_store,
mapi_object_t obj_message,
enum LockState  lockstate 
)

Locks the specified message for spooling.

Parameters
obj_storethe store object
obj_messagethe message object we want to lock
lockstatethe lock state

Possible values for the lock state:

  1. LockState_1stLock (0x0): Mark the message as locked
  2. LockState_1stUnlock (0x1): Mark the message as unlocked
  3. LockState_1stFinished (0x2): Mark the message as ready for processing by the server
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_store is not initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
SetSPooler

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SPropTagArray_add ( TALLOC_CTX *  mem_ctx,
struct SPropTagArray *  SPropTagArray,
enum MAPITAGS  aulPropTag 
)

Add a property tag to an existing properties array

Parameters
mem_ctxtalloc memory context to use for allocation
SPropTagArrayexisting properties array to add to
aulPropTagthe property tag to add
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: SPropTagArray parameter is not correctly set

References OPENCHANGE_RETVAL_IF.

Referenced by OpenEmbeddedMessage(), OpenMessage(), and ReloadCachedInformation().

enum MAPISTATUS SPropTagArray_delete ( TALLOC_CTX *  mem_ctx,
struct SPropTagArray *  SPropTagArray,
uint32_t  aulPropTag 
)

Delete a property tag from an existing properties array

Parameters
mem_ctxtalloc memory context to use for allocation
SPropTagArrayexisting properties array to remove from
aulPropTagthe property tag to remove
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: SPropTagArray parameter is not correctly set

References OPENCHANGE_RETVAL_IF.

enum MAPISTATUS SPropTagArray_find ( struct SPropTagArray  ,
enum  MAPITAGS,
uint32_t *   
)
enum MAPISTATUS SRow_addprop ( struct SRow *  aRow,
struct SPropValue  spropvalue 
)

add a SPropValue structure to a SRow array

Parameters
aRowpointer to the SRow array where spropvalue should be appended
spropvaluereference to the SPropValue structure to add to aRow
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_INVALID_PARAMETER.

References get_SPropValue_data(), OPENCHANGE_RETVAL_IF, and set_SPropValue().

Referenced by OpenEmbeddedMessage(), OpenMessage(), ReloadCachedInformation(), and SetRecipientType().

uint32_t SRowSet_propcpy ( TALLOC_CTX *  mem_ctx,
struct SRowSet *  SRowSet,
struct SPropValue  spropvalue 
)

Append a SPropValue structure to given SRowSet

Parameters
mem_ctxpointer to the memory context
SRowSetpointer to the SRowSet array to update
spropvaluethe SPropValue to append within SRowSet
Returns
0 on success, otherwise 1

References set_SPropValue().

enum MAPISTATUS SubmitMessage ( mapi_object_t obj_message)

Saves all changes to the message and marks it as ready for sending.

This function saves all changes made to a message and marks it ready to be sent.

Parameters
obj_messagethe message to mark complete
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
CreateMessage, SetProps, ModifyRecipients, SetRecipientType, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS Subscribe ( mapi_object_t obj,
uint32_t *  connection,
uint16_t  NotificationFlags,
bool  WholeStore,
mapi_notify_callback_t  notify_callback,
void *  private_data 
)

Register an object to receive notifications

This function registers notifications on the Exchange server for an object. The function holds the notifications intended to be monitored in as a bitmask.

Parameters
objthe object to get notifications for
connectionconnection identifier for callback function
NotificationFlagsmask for events to provide notifications for (see below)
WholeStorewhether the scope for this notification is whole database
notify_callbacknotification callback function.
private_datathe data to be passed at the callback function when invoked

The Notification Flags can take the following values:

  • fnevCriticalError
  • fnevNewMail
  • fnevObjectCreated
  • fnevObjectDeleted
  • fnevObjectModified
  • fnevObjectMoved
  • fnevObjectCopied
  • fnevSearchComplete
  • fnevTableModified
  • fnevStatusObjectModified
  • fnevReservedForMapi
  • fnevExtended
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
RegisterNotification, Unsubscribe, MonitorNotification, GetLastError

References notifications::callback, emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_init(), mapi_object_set_handle(), mapi_object_set_session(), notifications::NotificationFlags, mapi_notify_ctx::notifications, mapi_session::notify_ctx, notifications::obj_notif, OPENCHANGE_RETVAL_IF, notifications::parentID, notifications::private_data, and notifications::ulConnection.

enum MAPISTATUS SyncOpenAdvisor ( mapi_object_t obj,
mapi_object_t obj_notifier 
)

Obtain an ICS notification object

This function is used to obtain a server object handle for an ICS notification operation (RegisterSyncNotifications or SetSyncNotificationGuid). This operation is not supported on Exchange 2010.

Parameters
objthe logon object for which notifications are desired
obj_notifierthe notifier object for future ROPs.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.

The caller should release the returned notifier object when it is no longer required, using the mapi_object_release function.

Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS TellVersion ( mapi_object_t obj_store,
uint16_t  version[3] 
)

Advise a server of the "other server" version

This function is used to set up a fast server-client-server transfer.

Parameters
obj_storepointer to the store MAPI object
versionthe server version
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one of the function parameter is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS TransportNewMail ( mapi_object_t obj_store,
mapi_object_t obj_folder,
mapi_object_t obj_msg,
const char *  MessageClass,
uint32_t  MessageFlags 
)

Notify the store of a new message to be processed

Parameters
obj_storethe store that the message is in (logon object)
obj_folderthe folder that the message is in
obj_msgthe message to be processed
MessageClassthe message class of the message to be processed
MessageFlagsthe message flags on the message
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: one the parameters is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
GetReceiveFolder, GetReceiveFolderTable

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS TransportSend ( mapi_object_t obj_message,
struct mapi_SPropValue_array *  lpProps 
)
enum MAPISTATUS uncompress_rtf ( TALLOC_CTX *  ,
uint8_t *  ,
uint32_t  ,
DATA_BLOB *   
)
enum MAPISTATUS UnlockRegionStream ( mapi_object_t obj_stream,
uint64_t  RegionOffset,
uint64_t  RegionSize,
uint32_t  LockFlags 
)

Unlock a range of bytes within the stream

Parameters
obj_streamthe stream object
RegionOffsetstarting point for the range
RegionSizelength of the range
LockFlagstype of locking

LockFlags used in unlocking must match the LockFlags used in locking.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_stream is not valid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
UnlockRegionStream

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS Unsubscribe ( struct mapi_session session,
uint32_t  ulConnection 
)

Unregister notifications on a given object.

Cancel any notification registrations associated with the notify object. This function unregisters notifications on the Exchange server for the object specified with its connection number ulConnection. The function will releases the notification on the Exchange server and remove the entry from the internal notifications list.

The function takes a callback to execute when such notification occurs and returns the ulConnection identifier we can use in further management.

Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See Also
RegisterNotification, Subscribe, MonitorNotification, GetLastError

References notifications::next, mapi_notify_ctx::notifications, mapi_session::notify_ctx, notifications::obj_notif, OPENCHANGE_RETVAL_IF, Release(), and notifications::ulConnection.

enum MAPISTATUS WrapCompressedRTFStream ( mapi_object_t obj_stream,
DATA_BLOB *  rtf 
)

creates a DATA_BLOB in uncompressed Rich Text Format (RTF) from the compressed format used in the PR_RTF_COMPRESSED property opened in the stream.

Parameters
obj_streamstream object with RTF stream content
rtfthe output blob with uncompressed content
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_stream is not a valid pointer
  • MAPI_E_CORRUPT_DATA: a problem was encountered while decompressing the RTF compressed data
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
Note
Developers may also call GetLastError() to retrieve the last MAPI error code.
rtf->data needs to be freed with MAPIFreeBuffer
See Also
OpenStream

References GetLastError(), mapi_session::mapi_ctx, mapi_object_get_session(), mapi_context::mem_ctx, OPENCHANGE_RETVAL_IF, ReadStream(), and uncompress_rtf().

enum MAPISTATUS WriteAndCommitStream ( mapi_object_t obj_stream,
DATA_BLOB *  blob,
uint16_t *  WrittenSize 
)

Write and commit a buffer to the stream

This function writes and commits the contents of a DATA_BLOB to the stream obj_stream.

Parameters
obj_streamthe opened stream object
blobthe DATA_BLOB to write to the stream
WrittenSizethe actual number of bytes written to the stream
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: A problem occurred obtaining the session context, or the stream or blob were null.
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
  • MAPI_E_TOO_BIG: the data blob was too large to process
The data size intended to be written to the stream should not exceed a maximum size each time you call WriteStream. This size depends on Exchange server version. However 0x1000 is known to be a reliable write size value.
See Also
WriteStream, CommitStream

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

enum MAPISTATUS WriteStream ( mapi_object_t obj_stream,
DATA_BLOB *  blob,
uint16_t *  WrittenSize 
)

Write buffer to the stream

This function writes the stream specified as a DATA_BLOB in data to the stream obj_stream.

Parameters
obj_streamthe opened stream object
blobthe DATA_BLOB to write to the stream
WrittenSizethe actual number of bytes written to the stream
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: A problem occurred obtaining the session context, or blob was null.
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
  • MAPI_E_TOO_BIG: the data blob was too large to process
The data size intended to be written to the stream should not exceed a maximum size each time you call WriteStream. This size depends on Exchange server version. However 0x1000 is known to be a reliable write size value.
See Also
OpenStream, ReadStream, GetLastError

References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

char* x500_get_dn_element ( TALLOC_CTX *  mem_ctx,
const char *  dn,
const char *  element 
)

Extract a DN element from a given DN

Parameters
mem_ctxpointer to the memory context
dnpointer to a valid DN
elementpointer to the substring where extraction should start
Returns
pointer to an allocated substring on success, otherwise NULL

Referenced by GetUserFreeBusyData(), and ProcessNetworkProfile().

char* x500_get_servername ( const char *  )

Retrieve the servername from a string We should definitively find a better way to handle this.

References SERVERNAME.

Referenced by ProcessNetworkProfile().

char* x500_truncate_dn_last_elements ( TALLOC_CTX *  mem_ctx,
const char *  dn,
uint32_t  elcount 
)

Truncate a DN element

Parameters
mem_ctxpointer to the memory context
dnpointer to a valid DN
elcountthe number of elements to remove from the end of the DN
Returns
pointer to an allocated substring on success, otherwise NULL

Creative Commons License
Creative Commons Attribution icon Creative Commons Share Alike icon
This content is licensed under the Creative Commons
Attribution ShareAlike License v. 3.0:
http://creativecommons.org/licenses/by-sa/3.0/