libmapi/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/mapi_nameid.h"
#include "libmapi/mapidefs.h"
#include "libmapi/mapicode.h"
#include "libmapi/socket/netif.h"
#include "libmapi/property_tags.h"
#include "libmapi/property_altnames.h"

Defines

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

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 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 *)
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 loadparm_context *, 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 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_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.
struct fx_parser_contextfxparser_init (TALLOC_CTX *, void *)
void 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.
struct Binary_r * generate_recipient_entryid (TALLOC_CTX *, const char *)
struct
AppointmentRecurrencePattern * 
get_AppointmentRecurrencePattern (TALLOC_CTX *mem_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)
const char * get_proptag_name (uint32_t)
uint32_t get_proptag_value (const char *)
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 SRowSet **)
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 SRowSet **, 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 **)
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.
enum MAPISTATUS ICSSyncUploadStateContinue (mapi_object_t *, DATA_BLOB)
 Send data for an ICS Initial State upload.
enum MAPISTATUS ICSSyncUploadStateEnd (mapi_object_t *)
 Signal completion of an ICS Initial State upload.
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_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 (struct mapi_context *, 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_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_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 SRow *)
 Output a row of the public address book.
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.
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)
__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 *, struct SRowSet **, 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 SRowSet **)
enum MAPISTATUS nspi_GetSpecialTable (struct nspi_context *, TALLOC_CTX *, uint32_t, struct SRowSet **)
enum MAPISTATUS nspi_GetTemplateInfo (struct nspi_context *, TALLOC_CTX *, uint32_t, uint32_t, char *, struct SRow **)
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 SRow *)
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 SRowSet **)
enum MAPISTATUS nspi_ResolveNames (struct nspi_context *, TALLOC_CTX *, const char **, struct SPropTagArray *, struct SRowSet ***, struct PropertyTagArray_r ***)
enum MAPISTATUS nspi_ResolveNamesW (struct nspi_context *, TALLOC_CTX *, const char **, struct SPropTagArray *, struct SRowSet ***, 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 SPropValue *, struct SPropTagArray *, struct PropertyTagArray_r *pMIds, struct SRowSet **)
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 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 *)
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 *, uint16_t)
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 SRowSet **, 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 *)
enum MAPISTATUS set_default_error_SPropValue_SRow (struct SRow *, enum MAPITAGS, void *)
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 *)
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 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.
char * x500_truncate_dn_last_elements (TALLOC_CTX *, const char *, uint32_t)

Define Documentation

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

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

struct SPropValue* add_SPropValue ( TALLOC_CTX *  ,
struct SPropValue *  ,
uint32_t *  ,
enum  MAPITAGS,
const void *   
) [read]
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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, set_SPropTagArray(), PR_ENTRYID, PR_DISPLAY_NAME, ResolveNames(), mapi_object_get_session(), MAPIFreeBuffer(), MAPI_RESOLVED, cast_mapi_SPropValue(), PR_MEMBER_RIGHTS, and ModifyPermissions().

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 PT_BOOLEAN, PT_I2, PT_LONG, PT_DOUBLE, PT_I8, PT_STRING8, PT_UNICODE, get_utf8_utf16_conv_length(), PT_SYSTIME, PT_BINARY, PT_ERROR, PT_CLSID, PT_SVREID, PT_MV_STRING8, PT_MV_UNICODE, PT_MV_BINARY, and PT_MV_LONG.

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

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 PT_BOOLEAN, PT_I2, PT_LONG, PT_DOUBLE, PT_I8, PT_STRING8, PT_UNICODE, get_utf8_utf16_conv_length(), PT_SYSTIME, PT_CLSID, PT_SVREID, PT_BINARY, PT_ERROR, PT_MV_LONG, PT_MV_STRING8, PT_MV_UNICODE, PT_MV_CLSID, and PT_MV_BINARY.

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 OPENCHANGE_RETVAL_IF, and mapi_profile_modify_string_attr().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), mapi_object_set_handle(), mapi_object_set_session(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 mapi_object_get_session(), OPENCHANGE_RETVAL_IF, mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_id(), get_utf8_utf16_conv_length(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, and mapi_context::ldb_ctx.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object::private_data, mapi_obj_table::bookmark, mapi_obj_table::bk_last, mapi_obj_bookmark::index, and mapi_obj_bookmark::bin.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), MAPI_UNICODE, get_utf8_utf16_conv_length(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_init(), mapi_object_set_session(), mapi_object_set_handle(), mapi_object_set_id(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_context::ldb_ctx, mapi_profile_add_string_attr(), and OC_PROFILE_NOPASSWORD.

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_IF, and OPENCHANGE_RETVAL_ERR.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, and mapi_context::ldb_ctx.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_session::notify_ctx, emsmdb_transaction_null(), mapi_session::emsmdb, mapi_provider::ctx, 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 OPENCHANGE_RETVAL_IF, CopyProfile(), OpenProfile(), GetProfileAttr(), and mapi_profile_modify_string_attr().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

struct emsmdb_info* emsmdb_get_info ( struct mapi_session session) [read]

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_session::emsmdb, and mapi_provider::ctx.

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

Get a SRowSet from a DATA blob

Parameters:
mem_ctxpointer on the memory context
lp_ctxpointer on the loadparm 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 PT_ERROR, pull_emsmdb_property(), set_SPropValue(), and free_emsmdb_property().

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

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::handle, emsmdb_context::max_data, emsmdb_context::mem_ctx, emsmdb_context::cache_count, emsmdb_context::cache_requests, emsmdb_context::cache_size, 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::mem_ctx, emsmdb_context::handle, emsmdb_context::max_data, emsmdb_context::rpc_connection, and MAPI_STATUS_IS_OK.

Referenced by DispatchNotifications(), and MonitorNotification().

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

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

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

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_session::mapi_ctx, mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object::private_data, emsmdb_get_SRowSet(), and mapi_context::lp_ctx.

const void* find_mapi_SPropValue_data ( struct mapi_SPropValue_array *  ,
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 OPENCHANGE_RETVAL_IF, mapi_profile::mapi_ctx, mapi_context::ldb_ctx, 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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_session::mapi_ctx, mapi_object_get_logon_id(), mapi_object_bookmark_find(), get_mapi_SRestriction_size(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object::private_data, emsmdb_get_SRowSet(), and mapi_context::lp_ctx.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object::private_data, mapi_obj_table::bk_last, mapi_obj_table::bookmark, mapi_object_get_logon_id(), mapi_obj_bookmark::index, mapi_obj_bookmark::bin, mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, MAPIFreeBuffer(), and mapi_obj_bookmark::next.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_id_array::count, mapi_id_array_get(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

struct fx_parser_context* fxparser_init ( TALLOC_CTX *  mem_ctx,
void *  priv 
) [read]
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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

struct Binary_r* generate_recipient_entryid ( TALLOC_CTX *  ,
const char *   
) [read]

References guid_delete_dash().

struct AppointmentRecurrencePattern* get_AppointmentRecurrencePattern ( TALLOC_CTX *  mem_ctx,
struct Binary_r *   
) [read]
struct GlobalObjectId* get_GlobalObjectId ( TALLOC_CTX *  mem_ctx,
struct Binary_r *  bin 
) [read]

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().

const char* get_proptag_name ( uint32_t  )
uint32_t get_proptag_value ( const char *  )
struct RecurrencePattern* get_RecurrencePattern ( TALLOC_CTX *  mem_ctx,
struct Binary_r *  bin 
) [read]

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   
) [read]
const void* get_SPropValue_SRow_data ( struct SRow *  ,
uint32_t   
)
struct SPropValue* get_SPropValue_SRowSet ( struct SRowSet *  ,
uint32_t   
) [read]
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 
) [read]

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 SRowSet **  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 nspi_context::mem_ctx, OPENCHANGE_RETVAL_IF, mapi_session::profile, mapi_session::nspi, mapi_provider::ctx, set_SPropTagArray(), PR_ENTRYID, PR_DISPLAY_NAME_UNICODE, PR_ADDRTYPE_UNICODE, PR_OBJECT_TYPE, PR_DISPLAY_TYPE, PR_EMAIL_ADDRESS_UNICODE, PR_SEND_INTERNET_ENCODING, PR_SEND_RICH_INFO, PR_SEARCH_KEY, PR_TRANSMITTABLE_DISPLAY_NAME_UNICODE, PR_7BIT_DISPLAY_NAME_UNICODE, PR_SMTP_ADDRESS_UNICODE, ResolveNames(), MAPI_UNICODE, MAPIFreeBuffer(), MAPI_RESOLVED, get_SPropValue_SRowSet_data(), nspi_DNToMId(), and nspi_GetProps().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_session::mapi_ctx, set_SPropTagArray(), mapi_context::mem_ctx, PR_BODY, PR_RTF_COMPRESSED, PR_HTML, PR_RTF_IN_SYNC, GetProps(), MAPIFreeBuffer(), OPENCHANGE_RETVAL_ERR, find_SPropValue_data(), PR_BODY_ERROR, PR_RTF_COMPRESSED_ERROR, PR_BODY_HTML_ERROR, olEditorText, olEditorRTF, and olEditorHTML.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), and mapi_object_table_init().

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

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 OPENCHANGE_RETVAL_IF, GetProfileTable(), get_SPropValue_SRow(), PR_DEFAULT_PROFILE, PR_DISPLAY_NAME, mapi_context::mem_ctx, and OPENCHANGE_RETVAL_ERR.

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 OPENCHANGE_RETVAL_IF, olFolderPublicRoot, mapi_object::private_data, olFolderPublicIPMSubtree, olFolderPublicNonIPMSubtree, olFolderPublicEFormsRoot, olFolderPublicFreeBusyRoot, olFolderPublicOfflineAB, olFolderPublicEFormsRegistry, olFolderPublicLocalFreeBusy, olFolderPublicLocalOfflineAB, olFolderPublicNNTPArticle, and OPENCHANGE_RETVAL_ERR.

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 OPENCHANGE_RETVAL_IF, set_SPropTagArray(), PR_CONTENT_UNREAD, PR_CONTENT_COUNT, GetProps(), and MAPIFreeBuffer().

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 SRowSet **  SRowSet,
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 nspi_context::mem_ctx, OPENCHANGE_RETVAL_IF, mapi_session::nspi, mapi_provider::ctx, TABLE_START, nspi_context::pStat, and nspi_QueryRows().

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 nspi_context::mem_ctx, OPENCHANGE_RETVAL_IF, mapi_session::nspi, mapi_provider::ctx, nspi_context::pStat, and nspi_QueryRows().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), and mapi_object_table_init().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), get_utf8_utf16_conv_length(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, and PT_UNSPECIFIED.

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

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 OpenMsgStore(), WrapCompressedRTFStream(), and mapi_nameid_GetIDsFromNames().

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 OPENCHANGE_RETVAL_IF, and mapi_context::lp_ctx.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), and mapi_object_table_init().

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 OPENCHANGE_RETVAL_IF, mapi_profile::mapi_ctx, mapi_context::ldb_ctx, 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 OPENCHANGE_RETVAL_IF, mapi_context::ldb_ctx, mapi_context::mem_ctx, PR_DISPLAY_NAME, and PR_DEFAULT_PROFILE.

Referenced by RenameProfile(), and GetDefaultProfile().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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::nameid, OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_session::mapi_ctx, mapi_object_get_logon_id(), mapi_nameid_new(), MAPI_PROPS_SKIP_NAMEDID_CHECK, mapi_nameid_lookup_SPropTagArray(), GetIDsFromNames(), mapi_nameid::count, mapi_nameid_map_SPropTagArray(), MAPIFreeBuffer(), MAPI_UNICODE, mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_nameid_unmap_SPropTagArray(), emsmdb_get_SPropValue(), and mapi_context::lp_ctx.

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

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), MAPI_UNICODE, mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, PR_FID, PR_MESSAGE_CLASS, and PR_LAST_MODIFICATION_TIME.

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 mapi_object::private_data, OPENCHANGE_RETVAL_IF, mapi_obj_message::SRowSet, and mapi_obj_message::SPropTagArray.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), and mapi_object_table_init().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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_LAST_MODIFIED
  3. PR_FREEBUSY_START_RANGE
  4. PR_FREEBUSY_END_RANGE
  5. PR_FREEBUSY_ALL_MONTHS
  6. PR_FREEBUSY_ALL_EVENTS
  7. PR_FREEBUSY_TENTATIVE_MONTHS
  8. PR_FREEBUSY_TENTATIVE_EVENTS
  9. PR_FREEBUSY_BUSY_MONTHS
  10. PR_FREEBUSY_BUSY_EVENTS
  11. PR_FREEBUSY_OOF_MONTHS
  12. PR_FREEBUSY_OOF_EVENTS
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error

References OPENCHANGE_RETVAL_IF, mapi_object_get_session(), GetABRecipientInfo(), get_SPropValue_SRowSet_data(), PR_EMAIL_ADDRESS_UNICODE, x500_get_dn_element(), ORG, ORG_UNIT, MAPIFreeBuffer(), FREEBUSY_USER, FREEBUSY_FOLDER, GetDefaultPublicFolder(), olFolderPublicFreeBusyRoot, mapi_object_init(), OpenFolder(), GetHierarchyTable(), set_SPropTagArray(), PR_FID, PR_DISPLAY_NAME, SetColumns(), RES_PROPERTY, FindRow(), GetContentsTable(), PR_MID, PR_ADDRBOOK_MID, PR_INSTANCE_NUM, PR_NORMALIZED_SUBJECT, SortTable(), OpenMessage(), PR_FREEBUSY_LAST_MODIFIED, PR_FREEBUSY_START_RANGE, PR_FREEBUSY_END_RANGE, PR_FREEBUSY_ALL_MONTHS, PR_FREEBUSY_ALL_EVENTS, PR_FREEBUSY_TENTATIVE_MONTHS, PR_FREEBUSY_TENTATIVE_EVENTS, PR_FREEBUSY_BUSY_MONTHS, PR_FREEBUSY_BUSY_EVENTS, PR_FREEBUSY_OOF_MONTHS, PR_FREEBUSY_OOF_EVENTS, GetProps(), and mapi_object_release().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), GetUserFreeBusyData(), mapi_session::profile, mapi_profile::username, find_SPropValue_data(), PR_FREEBUSY_START_RANGE, PR_FREEBUSY_ALL_MONTHS, PR_FREEBUSY_ALL_EVENTS, and GetFreeBusyYear().

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

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 OPENCHANGE_RETVAL_IF, mapi_context::session, mapi_context::mem_ctx, mapi_profile::credentials, mapi_context::lp_ctx, mapi_profile::workstation, mapi_profile::realm, mapi_profile::domain, mapi_profile::kerberos, mapi_profile::username, and mapi_profile::password.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

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_object_get_session(), OPENCHANGE_RETVAL_IF, mapi_session::mapi_ctx, mapi_context::session, mapi_session::next, mapi_object_release(), and MAPIFreeBuffer().

void mapi_errstr ( const char *  ,
enum  MAPISTATUS 
)
Examples:
mapi_sample1.c.

Referenced by emsmdb_connect(), and emsmdb_connect_ex().

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 OPENCHANGE_RETVAL_IF, mapi_id_array::lpContainerList, and mapi_container_list::id.

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 OPENCHANGE_RETVAL_IF, mapi_id_array::lpContainerList, mapi_container_list::id, and mapi_object_get_id().

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 OPENCHANGE_RETVAL_IF, mapi_id_array::count, mapi_id_array::lpContainerList, mapi_container_list::id, and mapi_container_list::next.

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 OPENCHANGE_RETVAL_IF, mapi_id_array::count, mapi_id_array::lpContainerList, mapi_object_get_id(), mapi_container_list::id, and mapi_container_list::next.

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 OPENCHANGE_RETVAL_IF, mapi_id_array::lpContainerList, mapi_id_array::count, mapi_container_list::id, and mapi_container_list::next.

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

enum MAPISTATUS mapi_id_array_init ( struct mapi_context mapi_ctx,
mapi_id_array_t id 
)

Initialize a mapi_id_array structure

Parameters:
mapi_ctxpointer to the MAPI 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, and mapi_context::mem_ctx.

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 OPENCHANGE_RETVAL_IF, and mapi_id_array::lpContainerList.

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, OPENCHANGE_RETVAL_IF, mapi_nameid_tags::OLEGUID, mapi_nameid::nameid, mapi_nameid::entries, mapi_nameid_tags::lid, mapi_nameid_tags::Name, and get_utf8_utf16_conv_length().

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, OPENCHANGE_RETVAL_IF, mapi_nameid::nameid, mapi_nameid::entries, mapi_nameid_tags::lid, mapi_nameid_tags::propType, mapi_nameid_tags::ulKind, and mapi_nameid_tags::OLEGUID.

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, OPENCHANGE_RETVAL_IF, mapi_nameid::nameid, mapi_nameid::entries, mapi_nameid_tags::Name, mapi_nameid_tags::propType, mapi_nameid_tags::ulKind, mapi_nameid_tags::OLEGUID, and get_utf8_utf16_conv_length().

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 OPENCHANGE_RETVAL_IF, GetIDsFromNames(), mapi_nameid::count, mapi_nameid::nameid, GetLastError(), mapi_nameid::entries, 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, OPENCHANGE_RETVAL_IF, mapi_nameid_tags::OLEGUID, mapi_nameid::nameid, mapi_nameid::entries, mapi_nameid_tags::lid, mapi_nameid_tags::Name, and get_utf8_utf16_conv_length().

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 OPENCHANGE_RETVAL_IF, mapi_nameid_tags::OLEGUID, mapi_nameid_tags::propType, and OPENCHANGE_RETVAL_ERR.

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 OPENCHANGE_RETVAL_IF, mapi_nameid_property_lookup(), and mapi_nameid_canonical_add().

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 OPENCHANGE_RETVAL_IF, and mapi_nameid_canonical_add().

Referenced by SetProps(), and SetPropertiesNoReplicate().

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 OPENCHANGE_RETVAL_IF, mapi_nameid::count, mapi_nameid::entries, mapi_nameid_tags::proptag, mapi_nameid_tags::propType, and mapi_nameid_tags::position.

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 OPENCHANGE_RETVAL_IF, mapi_nameid::count, mapi_nameid::entries, mapi_nameid_tags::proptag, mapi_nameid_tags::propType, and mapi_nameid_tags::position.

Referenced by SetProps(), and SetPropertiesNoReplicate().

struct mapi_nameid* mapi_nameid_new ( TALLOC_CTX *  mem_ctx) [read]

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::nameid, mapi_nameid::entries, and mapi_nameid::count.

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

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, OPENCHANGE_RETVAL_IF, mapi_nameid_tags::OLEGUID, mapi_nameid::nameid, mapi_nameid::entries, mapi_nameid_tags::lid, mapi_nameid_tags::Name, and get_utf8_utf16_conv_length().

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 OPENCHANGE_RETVAL_IF, mapi_nameid_tags::OLEGUID, mapi_nameid_tags::propType, and OPENCHANGE_RETVAL_ERR.

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 OPENCHANGE_RETVAL_IF, mapi_nameid::count, mapi_nameid::entries, 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, OPENCHANGE_RETVAL_IF, mapi_nameid_tags::OLEGUID, mapi_nameid::nameid, mapi_nameid::entries, mapi_nameid_tags::lid, mapi_nameid_tags::Name, and get_utf8_utf16_conv_length().

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 OPENCHANGE_RETVAL_IF, mapi_nameid_tags::OLEGUID, mapi_nameid_tags::propType, and OPENCHANGE_RETVAL_ERR.

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 OPENCHANGE_RETVAL_IF, mapi_nameid::count, mapi_nameid::entries, 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 OPENCHANGE_RETVAL_IF, mapi_nameid::count, mapi_nameid::entries, mapi_nameid_tags::position, and mapi_nameid_tags::proptag.

Referenced by SetProps(), and SetPropertiesNoReplicate().

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_object::private_data, mapi_obj_table::bookmark, OPENCHANGE_RETVAL_IF, mapi_obj_bookmark::index, mapi_obj_bookmark::bin, and mapi_obj_bookmark::next.

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_object::private_data, OPENCHANGE_RETVAL_IF, and mapi_obj_table::bk_last.

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 OPENCHANGE_RETVAL_IF, mapi_object::id, mapi_object::handle, mapi_object::private_data, mapi_object::logon_id, 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 CreateMessage(), MoveFolder(), CopyFolder(), Subscribe(), AbortSubmit(), PublicFolderIsGhosted(), SetReceiveFolder(), GetOwningServers(), TransportNewMail(), SpoolerLockMessage(), mapi_id_array_add_obj(), and mapi_id_array_del_obj().

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

struct mapi_session* mapi_object_get_session ( mapi_object_t obj) [read]

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

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 GetUserFreeBusyData(), CreateFolder(), Subscribe(), ModifyUserPermission(), and RemoveUserPermission().

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, Release(), mapi_object::private_data, mapi_object::store, mapi_object::session, mapi_session::logon_ids, and mapi_object::logon_id.

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 OPENCHANGE_RETVAL_IF, and mapi_context::ldb_ctx.

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 OPENCHANGE_RETVAL_IF, and mapi_context::ldb_ctx.

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 OPENCHANGE_RETVAL_IF, and mapi_context::ldb_ctx.

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

void mapi_SPropValue_array_named ( mapi_object_t ,
struct mapi_SPropValue_array *   
)

References PT_NULL, and GetNamesFromIDs().

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 OPENCHANGE_RETVAL_IF, and mapi_context::mem_ctx.

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(), PidLidContacts, PR_CONVERSATION_TOPIC, PidLidTimeZoneDescription, PidLidLocation, PidLidBusyStatus, PidLidPrivate, mapidump_date(), PR_START_DATE, PR_END_DATE, and get_task_status().

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(), PidLidFileUnder, PR_CONVERSATION_TOPIC, PR_COMPANY_NAME, PR_TITLE, PR_DISPLAY_NAME, PR_GIVEN_NAME, PR_SURNAME, PR_DEPARTMENT_NAME, PidLidEmail1OriginalDisplayName, PR_OFFICE_TELEPHONE_NUMBER, PR_HOME_TELEPHONE_NUMBER, PR_MOBILE_TELEPHONE_NUMBER, PR_BUSINESS_FAX_NUMBER, PR_BUSINESS_HOME_PAGE, PR_POSTAL_ADDRESS, PR_STREET_ADDRESS, PR_LOCALITY, PR_STATE_OR_PROVINCE, and PR_COUNTRY.

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(), PR_INTERNET_MESSAGE_ID_UNICODE, PR_INTERNET_MESSAGE_ID, PR_CONVERSATION_TOPIC_UNICODE, PR_CONVERSATION_TOPIC, PR_BODY_UNICODE, PR_BODY, PR_HTML, PR_SENT_REPRESENTING_NAME_UNICODE, PR_SENT_REPRESENTING_NAME, PR_DISPLAY_TO_UNICODE, PR_DISPLAY_TO, PR_DISPLAY_CC_UNICODE, PR_DISPLAY_CC, PR_DISPLAY_BCC_UNICODE, PR_DISPLAY_BCC, PR_HASATTACH, PR_MESSAGE_CODEPAGE, and mapidump_message_summary().

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 mapi_object::private_data, mapi_obj_message::SubjectPrefix, mapi_obj_message::NormalizedSubject, mapi_obj_message::SRowSet, find_SPropValue_data(), PR_RECIPIENT_TYPE, PR_SMTP_ADDRESS_UNICODE, and PR_SMTP_ADDRESS.

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(), PR_CONVERSATION_TOPIC, PR_BODY, mapidump_date(), PR_CLIENT_SUBMIT_TIME, and PR_BODY_HTML.

void mapidump_PAB_entry ( struct SRow *  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_SPropValue_data(), PR_ADDRTYPE_UNICODE, PR_DISPLAY_NAME_UNICODE, PR_EMAIL_ADDRESS_UNICODE, and PR_ACCOUNT_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(), PT_SHORT, get_SPropValue_data(), PT_LONG, PT_OBJECT, PT_DOUBLE, PT_BOOLEAN, PT_I8, PT_STRING8, PT_UNICODE, PT_SYSTIME, mapidump_date_SPropValue(), PT_ERROR, PT_CLSID, PT_SVREID, PT_BINARY, PT_MV_LONG, PT_MV_STRING8, PT_MV_UNICODE, PT_MV_BINARY, and OC_ASSERT.

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(), PidLidContacts, PR_CONVERSATION_TOPIC, PR_BODY, PidLidPercentComplete, PidLidTaskStatus, PR_IMPORTANCE, PidLidPrivate, get_task_status(), olTaskComplete, mapidump_date(), PidLidTaskDateCompleted, get_importance(), PidLidTaskDueDate, and PidLidTaskStartDate.

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 GetUserFreeBusyData(), GetABRecipientInfo(), GetProps(), SetProps(), SetPropertiesNoReplicate(), FreeBookmark(), Logoff(), ProcessNetworkProfile(), GetFolderItemsCount(), AddUserPermission(), ModifyUserPermission(), RemoveUserPermission(), and GetBestBody().

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::mem_ctx, OPENCHANGE_RETVAL_IF, mapi_context::dumpdata, mapi_context::session, mapi_context::lp_ctx, OpenProfileStore(), and mapi_context::ldb_ctx.

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_NSPI, and PROVIDER_ID_EMSMDB.

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 OPENCHANGE_RETVAL_IF, mapi_context::session, mapi_context::mem_ctx, mapi_session::logon_ids, mapi_session::mapi_ctx, mapi_session::next, mapi_session::profile, OpenProfile(), LoadProfile(), PROVIDER_ID_EMSMDB, emsmdb_disconnect_dtor(), Logon(), mapi_session::emsmdb, PROVIDER_ID_NSPI, nspi_disconnect_dtor(), and mapi_session::nspi.

Referenced by 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_context::mem_ctx, mapi_context::session, mapi_session::notify_ctx, and mapi_notify_ctx::fd.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), get_mapi_property_size(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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

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 OPENCHANGE_RETVAL_IF, set_SPropTagArray(), PR_ENTRYID, PR_DISPLAY_NAME, ResolveNames(), mapi_object_get_session(), MAPIFreeBuffer(), MAPI_RESOLVED, find_SPropValue_data(), mapi_object_init(), GetPermissionsTable(), PR_MEMBER_RIGHTS, PR_MEMBER_ID, PR_MEMBER_NAME, SetColumns(), QueryPosition(), QueryRows(), get_SPropValue_SRow(), ModifyPermissions(), and mapi_object_release().

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 OPENCHANGE_RETVAL_IF, mapi_session::notify_ctx, mapi_notify_continue_callback_data::callback, mapi_notify_continue_callback_data::data, mapi_notify_continue_callback_data::tv, mapi_notify_ctx::fd, emsmdb_transaction_null(), mapi_session::emsmdb, mapi_provider::ctx, and ProcessNotification().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_id_array::count, mapi_id_array_get(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_id(), get_utf8_utf16_conv_length(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

__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 
) [read]

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::mem_ctx, nspi_context::rpc_connection, nspi_context::cred, nspi_context::version, and nspi_context::pStat.

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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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,
struct SRowSet **  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
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.

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

Referenced by 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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 SRowSet **  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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 SRowSet **  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 OPENCHANGE_RETVAL_IF, nspi_context::handle, nspi_context::pStat, nspi_context::version, and nspi_context::rpc_connection.

Referenced by ProcessNetworkProfile().

enum MAPISTATUS nspi_GetTemplateInfo ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
uint32_t  dwFlags,
uint32_t  ulType,
char *  pDN,
struct SRow **  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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 OPENCHANGE_RETVAL_IF, PT_OBJECT, nspi_context::handle, nspi_context::rpc_connection, and nspi_context::mem_ctx.

enum MAPISTATUS nspi_ModProps ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
uint32_t  MId,
struct SPropTagArray *  pPropTags,
struct SRow *  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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 SRowSet **  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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 SRowSet ***  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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 SRowSet ***  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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 SPropValue *  pTarget,
struct SPropTagArray *  pPropTags,
struct PropertyTagArray_r *  pMIds,
struct SRowSet **  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
pTargetSPropValue 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 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::handle, 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 OPENCHANGE_RETVAL_IF, nspi_context::handle, nspi_context::rpc_connection, nspi_context::mem_ctx, and MAPI_STATUS_IS_OK.

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 OPENCHANGE_RETVAL_IF, nspi_context::handle, 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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_session::mapi_ctx, mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_obj_message::cValues, mapi_obj_message::SRowSet, emsmdb_get_SRow(), mapi_context::lp_ctx, PR_RECIPIENT_TYPE, SRow_addprop(), PR_INTERNET_CPID, SPropTagArray_add(), and mapi_object::private_data.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_id(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_session::mapi_ctx, mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), get_TypedString(), mapi_obj_message::SubjectPrefix, mapi_obj_message::NormalizedSubject, mapi_obj_message::cValues, mapi_obj_message::SRowSet, emsmdb_get_SRow(), mapi_context::lp_ctx, PR_RECIPIENT_TYPE, SRow_addprop(), PR_INTERNET_CPID, SPropTagArray_add(), and mapi_object::private_data.

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 OPENCHANGE_RETVAL_IF, mapi_session::profile, OpenUserMailbox(), mapi_profile::username, and GetLastError().

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:
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 OPENCHANGE_RETVAL_IF, and mapi_context::ldb_ctx.

Referenced by MapiLogonProvider(), and DuplicateProfile().

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 OPENCHANGE_RETVAL_IF, mapi_session::profile, GetNewLogonId(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_logon_store(), mapi_object::private_data, mapi_obj_store::fid_pf_public_root, mapi_obj_store::fid_pf_ipm_subtree, mapi_obj_store::fid_pf_non_ipm_subtree, mapi_obj_store::fid_pf_EFormsRegistryRoot, mapi_obj_store::fid_pf_FreeBusyRoot, mapi_obj_store::fid_pf_OfflineAB, mapi_obj_store::fid_pf_EFormsRegistry, mapi_obj_store::fid_pf_LocalSiteFreeBusy, mapi_obj_store::fid_pf_LocalSiteOfflineAB, mapi_obj_store::fid_pf_NNTPArticle, mapi_obj_store::store_type, and PublicFolder.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 mapi_object_get_session(), OPENCHANGE_RETVAL_IF, mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_session::profile, GetNewLogonId(), mapi_profile::mailbox, mapi_profile::org, mapi_profile::ou, emsmdb_transaction_wrapper(), OPENCHANGE_RETVAL_CALL_IF, OPENCHANGE_CHECK_NOTIFICATION, mapi_object_set_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_logon_store(), mapi_object::private_data, mapi_obj_store::fid_mailbox_root, mapi_obj_store::fid_deferred_actions, mapi_obj_store::fid_spooler_queue, mapi_obj_store::fid_top_information_store, mapi_obj_store::fid_inbox, mapi_obj_store::fid_outbox, mapi_obj_store::fid_sent_items, mapi_obj_store::fid_deleted_items, mapi_obj_store::fid_common_views, mapi_obj_store::fid_schedule, mapi_obj_store::fid_search, mapi_obj_store::fid_views, mapi_obj_store::fid_shortcuts, mapi_obj_store::store_type, and PrivateFolderWithoutCachedFids.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

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 OPENCHANGE_RETVAL_IF, mapi_session::nspi, mapi_provider::ctx, mapi_session::mapi_ctx, mapi_session::profile, mapi_profile::profname, nspi_GetSpecialTable(), MAPIFreeBuffer(), set_SPropTagArray(), PR_DISPLAY_NAME, PR_OFFICE_TELEPHONE_NUMBER, PR_OFFICE_LOCATION, PR_TITLE, PR_COMPANY_NAME, PR_ACCOUNT, PR_ADDRTYPE, PR_ENTRYID, PR_OBJECT_TYPE, PR_DISPLAY_TYPE, PR_INSTANCE_KEY, PR_EMAIL_ADDRESS, nspi_context::cred, PR_ANR_UNICODE, RES_PROPERTY, nspi_GetMatches(), PR_EMS_AB_HOME_MDB, PR_ATTACH_NUM, PR_PROFILE_HOME_SERVER_ADDRS, PR_EMS_AB_PROXY_ADDRESSES, nspi_context::pStat, nspi_QueryRows(), get_SPropValue_SRowSet(), nspi_context::org, x500_get_dn_element(), ORG, nspi_context::org_unit, ORG_UNIT, mapi_profile_add_string_attr(), nspi_context::servername, x500_get_servername(), SERVER_DN, nspi_DNToMId(), PR_EMS_AB_NETWORK_ADDRESS, and nspi_GetProps().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, 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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_session::mapi_ctx, mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_object::private_data, emsmdb_get_SRowSet(), and mapi_context::lp_ctx.

Referenced by ModifyUserPermission(), and RemoveUserPermission().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 mapi_object_get_session(), OPENCHANGE_RETVAL_IF, mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_session::emsmdb, mapi_provider::ctx, mapi_session::notify_ctx, emsmdb_context::mem_ctx, mapi_notify_ctx::notifications, notifications::prev, notifications::next, and emsmdb_async_waitex().

enum MAPISTATUS RegisterNotification ( struct mapi_session session,
uint16_t  ulEventMask 
)

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.
ulEventMaskthe mask of events to provide notifications 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:
RegisterAsyncNotification, Subscribe, Unsubscribe, MonitorNotification, GetLastError

References emsmdb_context::mem_ctx, OPENCHANGE_RETVAL_IF, mapi_session::emsmdb, mapi_provider::ctx, mapi_session::mapi_ctx, mapi_session::notify_ctx, emsmdb_bind_notification(), and emsmdb_register_notification().

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 mapi_object_get_session(), OPENCHANGE_RETVAL_IF, mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

Referenced by Unsubscribe(), and mapi_object_release().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_session::mapi_ctx, mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, mapi_obj_message::cValues, mapi_obj_message::SRowSet, emsmdb_get_SRow(), mapi_context::lp_ctx, PR_RECIPIENT_TYPE, SRow_addprop(), PR_INTERNET_CPID, SPropTagArray_add(), and mapi_object::private_data.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, set_SPropTagArray(), PR_ENTRYID, PR_DISPLAY_NAME, ResolveNames(), mapi_object_get_session(), MAPIFreeBuffer(), MAPI_RESOLVED, find_SPropValue_data(), mapi_object_init(), GetPermissionsTable(), PR_MEMBER_RIGHTS, PR_MEMBER_ID, PR_MEMBER_NAME, SetColumns(), QueryPosition(), QueryRows(), get_SPropValue_SRow(), ModifyPermissions(), and mapi_object_release().

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 OPENCHANGE_RETVAL_IF, mapi_context::mem_ctx, GetProfileTable(), get_SPropValue_SRow(), PR_DISPLAY_NAME, and mapi_context::ldb_ctx.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

enum MAPISTATUS ResolveNames ( struct mapi_session session,
const char **  usernames,
struct SPropTagArray *  props,
struct SRowSet **  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 OPENCHANGE_RETVAL_IF, mapi_session::nspi, mapi_provider::ctx, MAPI_UNICODE, nspi_ResolveNamesW(), nspi_ResolveNames(), and nspi_context::mem_ctx.

Referenced by GetABRecipientInfo(), AddUserPermission(), 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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), get_mapi_SRestriction_size(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 RfrGetFQDNFromLegacyDN(), OPENCHANGE_RETVAL_IF, mapi_session::profile, mapi_profile::server, mapi_profile::credentials, mapi_context::lp_ctx, and mapi_profile::homemdb.

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 RfrGetNewDSA(), mapi_context::session, mapi_session::profile, mapi_profile::credentials, and mapi_context::lp_ctx.

Referenced by RfrGetNewDSA(), and Logon().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, and mapi_object_set_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_bookmark_find(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

enum MAPISTATUS set_default_error_SPropValue_SRow ( struct SRow *  ,
enum  MAPITAGS,
void *   
)
struct SPropTagArray* set_SPropTagArray ( TALLOC_CTX *  mem_ctx,
uint32_t  PropCount,
  ... 
) [read]

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
  array = set_SPropTagArray(mem_ctx, 2, PR_ENTRYID, PR_DISPLAY_NAME);
Examples:
fetchappointment.c, and fetchmail.c.

Referenced by GetUserFreeBusyData(), GetABRecipientInfo(), ProcessNetworkProfile(), GetFolderItemsCount(), AddUserPermission(), ModifyUserPermission(), RemoveUserPermission(), and GetBestBody().

bool set_SPropValue_proptag ( struct SPropValue *  ,
enum  MAPITAGS,
const void *   
)
bool set_SPropValue_proptag_date_timeval ( struct SPropValue *  ,
enum  MAPITAGS,
const struct timeval *   
)
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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, 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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, 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 OPENCHANGE_RETVAL_IF, mapi_context::ldb_ctx, and mapi_profile_modify_string_attr().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, and mapi_context::lp_ctx.

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 OPENCHANGE_RETVAL_IF, and mapi_context::dumpdata.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 mapi_nameid::nameid, OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_nameid_new(), MAPI_PROPS_SKIP_NAMEDID_CHECK, mapi_nameid_lookup_SPropValue(), GetIDsFromNames(), mapi_nameid::count, mapi_nameid_map_SPropValue(), MAPIFreeBuffer(), cast_mapi_SPropValue(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and mapi_nameid_unmap_SPropValue().

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 mapi_nameid::nameid, OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_nameid_new(), MAPI_PROPS_SKIP_NAMEDID_CHECK, mapi_nameid_lookup_SPropValue(), GetIDsFromNames(), mapi_nameid::count, mapi_nameid_map_SPropValue(), MAPIFreeBuffer(), cast_mapi_SPropValue(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), OPENCHANGE_CHECK_NOTIFICATION, and mapi_nameid_unmap_SPropValue().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 PidTagRecipientType, SRow_addprop(), and OPENCHANGE_RETVAL_IF.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), get_mapi_SRestriction_size(), mapi_id_array::count, mapi_id_array_get(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, and mapi_profile::credentials.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 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 OPENCHANGE_RETVAL_IF, set_SPropValue(), and get_SPropValue_data().

Referenced by SetRecipientType(), OpenEmbeddedMessage(), OpenMessage(), and ReloadCachedInformation().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_session::notify_ctx, mapi_object_get_logon_id(), mapi_object_get_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), notifications::ulConnection, notifications::parentID, mapi_object_init(), notifications::obj_notif, mapi_object_set_handle(), mapi_object_set_session(), notifications::NotificationFlags, notifications::callback, notifications::private_data, and mapi_notify_ctx::notifications.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), mapi_object_set_session(), mapi_object_set_handle(), and mapi_object_set_logon_id().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

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 OPENCHANGE_RETVAL_IF, mapi_session::notify_ctx, mapi_notify_ctx::notifications, notifications::ulConnection, Release(), notifications::obj_notif, and notifications::next.

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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_session::mapi_ctx, mapi_context::mem_ctx, ReadStream(), GetLastError(), 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 OPENCHANGE_RETVAL_IF, mapi_object_get_session(), mapi_object_get_logon_id(), mapi_object_get_handle(), and emsmdb_transaction_wrapper().

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 mapi_object_get_session(), OPENCHANGE_RETVAL_IF, mapi_object_get_logon_id(), mapi_object_get_handle(), emsmdb_transaction_wrapper(), and OPENCHANGE_CHECK_NOTIFICATION.

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/