libmapi/proto.h File Reference

Defines

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

Functions

_PUBLIC_ enum MAPISTATUS Abort (mapi_object_t *, uint8_t *)
_PUBLIC_ enum MAPISTATUS AbortSubmit (mapi_object_t *, mapi_object_t *obj_folder, mapi_object_t *)
_PUBLIC_ struct SPropValue * add_SPropValue (TALLOC_CTX *, struct SPropValue *, uint32_t *, uint32_t, const void *)
_PUBLIC_ enum MAPISTATUS AddressTypes (mapi_object_t *, uint16_t *lpcAdrType, struct mapi_LPSTR **)
_PUBLIC_ enum MAPISTATUS AddUserPermission (mapi_object_t *, const char *, enum ACLRIGHTS)
_PUBLIC_ uint32_t cast_mapi_SPropValue (struct mapi_SPropValue *, struct SPropValue *)
_PUBLIC_ uint32_t cast_SPropValue (struct mapi_SPropValue *, struct SPropValue *)
_PUBLIC_ enum MAPISTATUS ChangeProfilePassword (const char *, const char *old_password, const char *)
_PUBLIC_ enum MAPISTATUS CloneStream (mapi_object_t *, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS CollapseRow (mapi_object_t *, uint64_t, uint32_t *)
_PUBLIC_ enum MAPISTATUS CommitStream (mapi_object_t *)
_PUBLIC_ enum MAPISTATUS CopyFolder (mapi_object_t *, mapi_object_t *obj_src, mapi_object_t *obj_dst, char *NewFolderName, bool UseUnicode, bool)
_PUBLIC_ enum MAPISTATUS CopyProps (mapi_object_t *, mapi_object_t *obj_dst, struct SPropTagArray *tags, uint8_t copyFlags, uint16_t *problemCount, struct PropertyProblem **)
_PUBLIC_ enum MAPISTATUS CopyTo (mapi_object_t *, mapi_object_t *obj_dst, struct SPropTagArray *excludeTags, uint8_t copyFlags, uint16_t *problemCount, struct PropertyProblem **)
_PUBLIC_ enum MAPISTATUS CopyToStream (mapi_object_t *, mapi_object_t *, uint64_t ByteCount, uint64_t *ReadByteCount, uint64_t *)
_PUBLIC_ enum MAPISTATUS CreateAttach (mapi_object_t *, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS CreateBookmark (mapi_object_t *, uint32_t *)
_PUBLIC_ enum MAPISTATUS CreateFolder (mapi_object_t *, enum FOLDER_TYPE ulFolderType, const char *name, const char *comment, uint32_t ulFlags, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS CreateMessage (mapi_object_t *, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS CreateProfile (const char *, const char *, const char *, uint32_t)
_PUBLIC_ enum MAPISTATUS CreateProfileStore (const char *, const char *)
_PUBLIC_ enum MAPISTATUS DeleteAttach (mapi_object_t *, uint32_t)
_PUBLIC_ enum MAPISTATUS DeleteFolder (mapi_object_t *, mapi_id_t FolderId, uint8_t DeleteFolderFlags, bool *)
_PUBLIC_ enum MAPISTATUS DeleteMessage (mapi_object_t *, mapi_id_t *, uint32_t)
_PUBLIC_ enum MAPISTATUS DeleteProfile (const char *)
_PUBLIC_ enum MAPISTATUS DeletePropertiesNoReplicate (mapi_object_t *, struct SPropTagArray *)
_PUBLIC_ enum MAPISTATUS DeleteProps (mapi_object_t *, struct SPropTagArray *)
_PUBLIC_ enum MAPISTATUS DispatchNotifications (struct mapi_session *)
_PUBLIC_ enum MAPISTATUS EmptyFolder (mapi_object_t *)
_PUBLIC_ struct emsmdb_infoemsmdb_get_info (struct mapi_session *)
_PUBLIC_ void emsmdb_get_SRowSet (TALLOC_CTX *, struct loadparm_context *lp_ctx, struct SRowSet *rowset, struct SPropTagArray *proptags, DATA_BLOB *)
_PUBLIC_ NTSTATUS emsmdb_transaction (struct emsmdb_context *, TALLOC_CTX *mem_ctx, struct mapi_request *req, struct mapi_response **)
_PUBLIC_ NTSTATUS emsmdb_transaction_null (struct emsmdb_context *, struct mapi_response **)
_PUBLIC_ enum MAPISTATUS ExpandRow (mapi_object_t *, uint64_t, uint16_t maxRows, struct SRowSet *rowData, uint32_t *)
_PUBLIC_ const void * find_mapi_SPropValue_data (struct mapi_SPropValue_array *, uint32_t)
_PUBLIC_ const void * find_SPropValue_data (struct SRow *, uint32_t)
_PUBLIC_ enum MAPISTATUS FindProfileAttr (struct mapi_profile *, const char *, const char *)
_PUBLIC_ enum MAPISTATUS FindRow (mapi_object_t *, struct mapi_SRestriction *res, enum BOOKMARK bkOrigin, enum FindRow_ulFlags ulFlags, struct SRowSet *)
_PUBLIC_ enum MAPISTATUS FreeBookmark (mapi_object_t *, uint32_t)
_PUBLIC_ struct Binary_r * generate_recipient_entryid (TALLOC_CTX *, const char *)
_PUBLIC_ struct
AppointmentRecurrencePattern * 
get_AppointmentRecurrencePattern (TALLOC_CTX *, struct Binary_r *)
_PUBLIC_ struct GlobalObjectId * get_GlobalObjectId (TALLOC_CTX *, struct Binary_r *)
_PUBLIC_ const char * get_importance (uint32_t)
_PUBLIC_ int get_interfaces (struct iface_struct *, int)
_PUBLIC_ uint32_t get_mapi_property_size (struct mapi_SPropValue *)
_PUBLIC_ enum MAPISTATUS get_mapi_SPropValue_array_date_timeval (struct timeval *, struct mapi_SPropValue_array *properties, uint32_t)
_PUBLIC_ const void * get_mapi_SPropValue_data (struct mapi_SPropValue *)
_PUBLIC_ enum MAPISTATUS get_mapi_SPropValue_date_timeval (struct timeval *, struct SPropValue)
_PUBLIC_ const char * get_proptag_name (uint32_t)
_PUBLIC_ uint32_t get_proptag_value (const char *)
_PUBLIC_ struct RecurrencePattern * get_RecurrencePattern (TALLOC_CTX *, struct Binary_r *)
_PUBLIC_ const void * get_SPropValue (struct SPropValue *, uint32_t)
_PUBLIC_ const void * get_SPropValue_data (struct SPropValue *)
_PUBLIC_ struct SPropValue * get_SPropValue_SRow (struct SRow *, uint32_t)
_PUBLIC_ const void * get_SPropValue_SRow_data (struct SRow *, uint32_t)
_PUBLIC_ struct SPropValue * get_SPropValue_SRowSet (struct SRowSet *, uint32_t)
_PUBLIC_ const void * get_SPropValue_SRowSet_data (struct SRowSet *, uint32_t)
_PUBLIC_ const char * get_task_status (uint32_t)
_PUBLIC_ struct TimeZoneStruct * get_TimeZoneStruct (TALLOC_CTX *, struct Binary_r *)
_PUBLIC_ enum MAPISTATUS GetABRecipientInfo (struct mapi_session *, const char *username, struct SPropTagArray *pPropTags, struct SRowSet **)
_PUBLIC_ enum MAPISTATUS GetAttachmentTable (mapi_object_t *, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS GetBestBody (mapi_object_t *, uint8_t *)
_PUBLIC_ enum MAPISTATUS GetCollapseState (mapi_object_t *, uint64_t, uint32_t rowInstanceNumber, struct SBinary_short *)
_PUBLIC_ enum MAPISTATUS GetContentsTable (mapi_object_t *, mapi_object_t *, uint8_t, uint32_t *)
_PUBLIC_ enum MAPISTATUS GetDefaultFolder (mapi_object_t *, uint64_t *folder, const uint32_t)
_PUBLIC_ enum MAPISTATUS GetDefaultProfile (char **)
_PUBLIC_ enum MAPISTATUS GetDefaultPublicFolder (mapi_object_t *, uint64_t *folder, const uint32_t)
_PUBLIC_ enum MAPISTATUS GetFIDFromEntryID (uint16_t, uint8_t *lpb, uint64_t parent_fid, uint64_t *)
_PUBLIC_ enum MAPISTATUS GetFolderItemsCount (mapi_object_t *, uint32_t *unread, uint32_t *)
_PUBLIC_ int GetFreeBusyYear (const uint32_t *)
_PUBLIC_ enum MAPISTATUS GetGALTable (struct mapi_session *, struct SPropTagArray *SPropTagArray, struct SRowSet **SRowSet, uint32_t count, uint8_t)
_PUBLIC_ enum MAPISTATUS GetHierarchyTable (mapi_object_t *, mapi_object_t *, uint8_t, uint32_t *)
_PUBLIC_ enum MAPISTATUS GetIdFromLongTermId (mapi_object_t *, struct LongTermId, mapi_id_t *)
_PUBLIC_ enum MAPISTATUS GetIDsFromNames (mapi_object_t *, uint16_t count, struct MAPINAMEID *nameid, uint32_t ulFlags, struct SPropTagArray **)
_PUBLIC_ enum MAPISTATUS GetLastError (void)
_PUBLIC_ enum MAPISTATUS GetLoadparmContext (struct loadparm_context **)
_PUBLIC_ enum MAPISTATUS GetLocalReplicaIds (mapi_object_t *, uint32_t IdCount, struct GUID *ReplGuid, uint8_t GlobalCount[6])
_PUBLIC_ enum MAPISTATUS GetLongTermIdFromId (mapi_object_t *, mapi_id_t, struct LongTermId *)
_PUBLIC_ enum MAPISTATUS GetMessageStatus (mapi_object_t *, mapi_id_t msgid, uint32_t *)
_PUBLIC_ enum MAPISTATUS GetNamesFromIDs (mapi_object_t *, enum MAPITAGS ulPropTag, uint16_t *count, struct MAPINAMEID **)
_PUBLIC_ enum MAPISTATUS GetOutboxFolder (mapi_object_t *, mapi_id_t *)
_PUBLIC_ enum MAPISTATUS GetOwningServers (mapi_object_t *, mapi_object_t *obj_folder, uint16_t *OwningServersCount, uint16_t *CheapServersCount, char **)
_PUBLIC_ enum MAPISTATUS GetProfileAttr (struct mapi_profile *, const char *attribute, unsigned int *count, char ***)
_PUBLIC_ enum MAPISTATUS GetProfileTable (struct SRowSet *)
_PUBLIC_ enum MAPISTATUS GetPropList (mapi_object_t *, struct SPropTagArray *)
_PUBLIC_ enum MAPISTATUS GetProps (mapi_object_t *, struct SPropTagArray *SPropTagArray, struct SPropValue **, uint32_t *)
_PUBLIC_ enum MAPISTATUS GetPropsAll (mapi_object_t *, struct mapi_SPropValue_array *)
_PUBLIC_ enum MAPISTATUS GetReceiveFolder (mapi_object_t *, mapi_id_t *id_folder, const char *)
_PUBLIC_ enum MAPISTATUS GetReceiveFolderTable (mapi_object_t *, struct SRowSet *)
_PUBLIC_ enum MAPISTATUS GetRecipientTable (mapi_object_t *, struct SRowSet *SRowSet, struct SPropTagArray *)
_PUBLIC_ enum MAPISTATUS GetRulesTable (mapi_object_t *, mapi_object_t *obj_table, uint8_t)
_PUBLIC_ enum MAPISTATUS GetSearchCriteria (mapi_object_t *, struct mapi_SRestriction *res, uint32_t *SearchFlags, uint16_t *FolderIdCount, uint64_t **)
_PUBLIC_ enum MAPISTATUS GetStatus (mapi_object_t *, uint8_t *)
_PUBLIC_ enum MAPISTATUS GetStoreState (mapi_object_t *, uint32_t *)
_PUBLIC_ enum MAPISTATUS GetStreamSize (mapi_object_t *, uint32_t *)
_PUBLIC_ enum MAPISTATUS GetTable (mapi_object_t *, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS GetTransportFolder (mapi_object_t *, mapi_id_t *)
_PUBLIC_ enum MAPISTATUS GetUserFreeBusyData (mapi_object_t *, const char *recipient, struct SRow *)
_PUBLIC_ enum MAPISTATUS GetValidAttach (mapi_object_t *, uint16_t *, uint32_t **)
_PUBLIC_ char * guid_delete_dash (TALLOC_CTX *, const char *)
_PUBLIC_ enum MAPISTATUS HardDeleteMessage (mapi_object_t *, mapi_id_t *id_messages, uint16_t)
_PUBLIC_ enum MAPISTATUS HardDeleteMessagesAndSubfolders (mapi_object_t *)
_PUBLIC_ enum MAPISTATUS IsFreeBusyConflict (mapi_object_t *, struct FILETIME *date, bool *)
_PUBLIC_ bool IsMailboxFolder (mapi_object_t *, uint64_t fid, uint32_t *)
_PUBLIC_ bool lcid_get_locales (const char *)
_PUBLIC_ uint32_t lcid_lang2lcid (const char *)
_PUBLIC_ int lcid_lang2nb (const char *)
_PUBLIC_ const char * lcid_langcode2langtag (uint32_t)
_PUBLIC_ void lcid_print_group (void)
_PUBLIC_ bool lcid_print_groupmember (int)
_PUBLIC_ void lcid_print_languages (void)
_PUBLIC_ bool lcid_print_locale (uint32_t)
_PUBLIC_ bool lcid_valid_locale (uint32_t)
_PUBLIC_ enum MAPISTATUS LoadProfile (struct mapi_profile *)
_PUBLIC_ enum MAPISTATUS LockRegionStream (mapi_object_t *, uint64_t, uint64_t, uint32_t)
_PUBLIC_ enum MAPISTATUS Logoff (mapi_object_t *)
_PUBLIC_ void mapi_errstr (const char *, uint32_t)
_PUBLIC_ const char * mapi_get_errstr (uint32_t)
_PUBLIC_ enum MAPISTATUS mapi_id_array_add_id (mapi_id_array_t *, mapi_id_t)
_PUBLIC_ enum MAPISTATUS mapi_id_array_add_obj (mapi_id_array_t *, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS mapi_id_array_del_id (mapi_id_array_t *, mapi_id_t)
_PUBLIC_ enum MAPISTATUS mapi_id_array_del_obj (mapi_id_array_t *, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS mapi_id_array_get (TALLOC_CTX *, mapi_id_array_t *id, mapi_id_t **)
_PUBLIC_ enum MAPISTATUS mapi_id_array_init (mapi_id_array_t *)
_PUBLIC_ enum MAPISTATUS mapi_id_array_release (mapi_id_array_t *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_canonical_add (struct mapi_nameid *, uint32_t)
_PUBLIC_ enum MAPISTATUS mapi_nameid_custom_lid_add (struct mapi_nameid *, uint16_t lid, uint16_t propType, const char *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_custom_string_add (struct mapi_nameid *, const char *Name, uint16_t propType, const char *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_GetIDsFromNames (struct mapi_nameid *, mapi_object_t *obj, struct SPropTagArray *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_lid_add (struct mapi_nameid *, uint16_t, const char *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_lid_lookup (uint16_t, const char *, uint16_t *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_lookup_SPropTagArray (struct mapi_nameid *, struct SPropTagArray *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_lookup_SPropValue (struct mapi_nameid *, struct SPropValue *lpProps, unsigned long)
_PUBLIC_ enum MAPISTATUS mapi_nameid_map_SPropTagArray (struct mapi_nameid *, struct SPropTagArray *SPropTagArray, struct SPropTagArray *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_map_SPropValue (struct mapi_nameid *, struct SPropValue *lpProps, uint32_t PropCount, struct SPropTagArray *)
_PUBLIC_ struct mapi_nameidmapi_nameid_new (TALLOC_CTX *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_OOM_add (struct mapi_nameid *, const char *OOM, const char *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_OOM_lookup (const char *, const char *, uint16_t *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_SPropTagArray (struct mapi_nameid *, struct SPropTagArray *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_string_add (struct mapi_nameid *, const char *Name, const char *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_string_lookup (const char *, const char *OLEGUID, uint16_t *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_unmap_SPropTagArray (struct mapi_nameid *, struct SPropTagArray *)
_PUBLIC_ enum MAPISTATUS mapi_nameid_unmap_SPropValue (struct mapi_nameid *, struct SPropValue *lpProps, uint32_t)
_PUBLIC_ enum MAPISTATUS mapi_object_bookmark_debug (mapi_object_t *)
_PUBLIC_ enum MAPISTATUS mapi_object_bookmark_get_count (mapi_object_t *, uint32_t *)
_PUBLIC_ enum MAPISTATUS mapi_object_copy (mapi_object_t *, mapi_object_t *)
_PUBLIC_ void mapi_object_debug (mapi_object_t *)
_PUBLIC_ mapi_id_t mapi_object_get_id (mapi_object_t *)
_PUBLIC_ enum MAPISTATUS mapi_object_get_logon_id (mapi_object_t *, uint8_t *)
_PUBLIC_ struct mapi_sessionmapi_object_get_session (mapi_object_t *)
_PUBLIC_ enum MAPISTATUS mapi_object_init (mapi_object_t *)
_PUBLIC_ void mapi_object_release (mapi_object_t *)
_PUBLIC_ void mapi_object_set_logon_id (mapi_object_t *, uint8_t)
_PUBLIC_ void mapi_object_set_logon_store (mapi_object_t *)
_PUBLIC_ void mapi_object_set_session (mapi_object_t *, struct mapi_session *)
_PUBLIC_ enum MAPISTATUS mapi_profile_add_string_attr (const char *, const char *attr, const char *)
_PUBLIC_ enum MAPISTATUS mapi_profile_delete_string_attr (const char *, const char *attr, const char *)
_PUBLIC_ const char * mapi_profile_get_ldif_path (void)
_PUBLIC_ enum MAPISTATUS mapi_profile_modify_string_attr (const char *, const char *attr, const char *)
_PUBLIC_ void mapi_SPropValue_array_named (mapi_object_t *, struct mapi_SPropValue_array *)
_PUBLIC_ enum MAPISTATUS MAPIAllocateBuffer (uint32_t, void **)
_PUBLIC_ void mapidump_appointment (struct mapi_SPropValue_array *, const char *)
_PUBLIC_ void mapidump_contact (struct mapi_SPropValue_array *, const char *)
_PUBLIC_ void mapidump_date (struct mapi_SPropValue_array *, uint32_t, const char *)
_PUBLIC_ void mapidump_date_SPropValue (struct SPropValue, const char *, const char *)
_PUBLIC_ void mapidump_foldercopied (struct FolderMoveCopyNotification *, const char *)
_PUBLIC_ void mapidump_foldercreated (struct FolderCreatedNotification *, const char *)
_PUBLIC_ void mapidump_folderdeleted (struct FolderDeletedNotification *, const char *)
_PUBLIC_ void mapidump_foldermoved (struct FolderMoveCopyNotification *, const char *)
_PUBLIC_ void mapidump_freebusy_date (uint32_t, const char *)
_PUBLIC_ void mapidump_freebusy_event (struct Binary_r *, uint32_t, uint32_t, const char *)
_PUBLIC_ const char * mapidump_freebusy_month (uint32_t, uint32_t)
_PUBLIC_ uint32_t mapidump_freebusy_year (uint32_t, uint32_t)
_PUBLIC_ void mapidump_message (struct mapi_SPropValue_array *, const char *)
_PUBLIC_ void mapidump_messagecopied (struct MessageMoveCopyNotification *, const char *)
_PUBLIC_ void mapidump_messagecreated (struct MessageCreatedNotification *, const char *)
_PUBLIC_ void mapidump_messagedeleted (struct MessageDeletedNotification *, const char *)
_PUBLIC_ void mapidump_messagemodified (struct MessageModifiedNotification *, const char *)
_PUBLIC_ void mapidump_messagemoved (struct MessageMoveCopyNotification *, const char *)
_PUBLIC_ void mapidump_msgflags (uint32_t, const char *)
_PUBLIC_ void mapidump_newmail (struct NewMailNotification *, const char *)
_PUBLIC_ void mapidump_note (struct mapi_SPropValue_array *, const char *)
_PUBLIC_ void mapidump_PAB_entry (struct SRow *)
_PUBLIC_ void mapidump_Recipients (const char **, struct SRowSet *, struct SPropTagArray *)
_PUBLIC_ void mapidump_SPropTagArray (struct SPropTagArray *)
_PUBLIC_ void mapidump_SPropValue (struct SPropValue, const char *)
_PUBLIC_ void mapidump_SRow (struct SRow *, const char *)
_PUBLIC_ void mapidump_SRowSet (struct SRowSet *, const char *)
_PUBLIC_ void mapidump_tags (enum MAPITAGS *, uint16_t, const char *)
_PUBLIC_ void mapidump_task (struct mapi_SPropValue_array *, const char *)
_PUBLIC_ enum MAPISTATUS MAPIFreeBuffer (void *)
_PUBLIC_ enum MAPISTATUS MAPIInitialize (const char *)
_PUBLIC_ enum MAPISTATUS MapiLogonEx (struct mapi_session **, const char *, const char *)
_PUBLIC_ enum MAPISTATUS MapiLogonProvider (struct mapi_session **, const char *profname, const char *password, enum PROVIDER_ID)
_PUBLIC_ void MAPIUninitialize (void)
_PUBLIC_ enum MAPISTATUS ModifyRecipients (mapi_object_t *, struct SRowSet *)
_PUBLIC_ enum MAPISTATUS ModifyTable (mapi_object_t *, struct mapi_SRowList *)
_PUBLIC_ enum MAPISTATUS ModifyUserPermission (mapi_object_t *, const char *, enum ACLRIGHTS)
_PUBLIC_ enum MAPISTATUS MonitorNotification (struct mapi_session *, void *, struct mapi_notify_continue_callback_data *)
_PUBLIC_ enum MAPISTATUS MoveCopyMessages (mapi_object_t *, mapi_object_t *obj_dst, mapi_id_array_t *message_id, bool)
_PUBLIC_ enum MAPISTATUS MoveFolder (mapi_object_t *, mapi_object_t *obj_src, mapi_object_t *obj_dst, char *NewFolderName, bool)
__BEGIN_DECLS struct nspi_contextnspi_bind (TALLOC_CTX *, struct dcerpc_pipe *p, struct cli_credentials *cred, uint32_t codepage, uint32_t language, uint32_t)
_PUBLIC_ enum MAPISTATUS nspi_CompareMIds (struct nspi_context *, TALLOC_CTX *mem_ctx, uint32_t MId1, uint32_t MId2, uint32_t *)
_PUBLIC_ enum MAPISTATUS nspi_DNToMId (struct nspi_context *, TALLOC_CTX *mem_ctx, struct StringsArray_r *pNames, struct SPropTagArray **)
_PUBLIC_ enum MAPISTATUS nspi_GetIDsFromNames (struct nspi_context *, TALLOC_CTX *mem_ctx, bool VerifyNames, uint32_t cNames, struct PropertyName_r *ppNames, struct SPropTagArray **)
_PUBLIC_ enum MAPISTATUS nspi_GetMatches (struct nspi_context *, TALLOC_CTX *mem_ctx, struct SPropTagArray *pPropTags, struct Restriction_r *Filter, struct SRowSet **ppRows, struct SPropTagArray **)
_PUBLIC_ enum MAPISTATUS nspi_GetNamesFromIDs (struct nspi_context *, TALLOC_CTX *mem_ctx, struct FlatUID_r *lpGuid, struct SPropTagArray *pPropTags, struct SPropTagArray **ppReturnedPropTags, struct PropertyNameSet_r **)
_PUBLIC_ enum MAPISTATUS nspi_GetPropList (struct nspi_context *, TALLOC_CTX *mem_ctx, bool WantObject, uint32_t dwMId, struct SPropTagArray **)
_PUBLIC_ enum MAPISTATUS nspi_GetProps (struct nspi_context *, TALLOC_CTX *mem_ctx, struct SPropTagArray *pPropTags, struct SPropTagArray *MId, struct SRowSet **)
_PUBLIC_ enum MAPISTATUS nspi_GetSpecialTable (struct nspi_context *, TALLOC_CTX *mem_ctx, uint32_t Type, struct SRowSet **)
_PUBLIC_ enum MAPISTATUS nspi_GetTemplateInfo (struct nspi_context *, TALLOC_CTX *mem_ctx, uint32_t dwFlags, uint32_t ulType, char *pDN, struct SRow **)
_PUBLIC_ enum MAPISTATUS nspi_ModLinkAtt (struct nspi_context *, bool Delete, uint32_t ulPropTag, uint32_t MId, struct BinaryArray_r *)
_PUBLIC_ enum MAPISTATUS nspi_ModProps (struct nspi_context *, TALLOC_CTX *mem_ctx, uint32_t MId, struct SPropTagArray *pPropTags, struct SRow *)
_PUBLIC_ enum MAPISTATUS nspi_QueryColumns (struct nspi_context *, TALLOC_CTX *mem_ctx, bool WantUnicode, struct SPropTagArray **)
enum MAPISTATUS nspi_QueryRows (struct nspi_context *, TALLOC_CTX *mem_ctx, struct SPropTagArray *pPropTags, struct SPropTagArray *MIds, uint32_t count, struct SRowSet **)
_PUBLIC_ enum MAPISTATUS nspi_ResolveNames (struct nspi_context *, TALLOC_CTX *mem_ctx, const char **usernames, struct SPropTagArray *pPropTags, struct SRowSet ***pppRows, struct SPropTagArray ***)
_PUBLIC_ enum MAPISTATUS nspi_ResolveNamesW (struct nspi_context *, TALLOC_CTX *mem_ctx, const char **usernames, struct SPropTagArray *pPropTags, struct SRowSet ***pppRows, struct SPropTagArray ***)
_PUBLIC_ enum MAPISTATUS nspi_ResortRestriction (struct nspi_context *, TALLOC_CTX *mem_ctx, enum TableSortOrders SortType, struct SPropTagArray *pInMIds, struct SPropTagArray **)
_PUBLIC_ enum MAPISTATUS nspi_SeekEntries (struct nspi_context *, TALLOC_CTX *mem_ctx, enum TableSortOrders SortType, struct SPropValue *pTarget, struct SPropTagArray *pPropTags, struct SPropTagArray *pMIds, struct SRowSet **)
enum MAPISTATUS nspi_unbind (struct nspi_context *)
enum MAPISTATUS nspi_UpdateStat (struct nspi_context *, TALLOC_CTX *mem_ctx, uint32_t *)
_PUBLIC_ enum MAPISTATUS OpenAttach (mapi_object_t *, uint32_t, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS OpenEmbeddedMessage (mapi_object_t *, mapi_object_t *obj_embeddedmsg, enum OpenEmbeddedMessage_OpenModeFlags)
_PUBLIC_ enum MAPISTATUS OpenFolder (mapi_object_t *, mapi_id_t, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS OpenMessage (mapi_object_t *, mapi_id_t id_folder, mapi_id_t id_message, mapi_object_t *obj_message, uint8_t)
_PUBLIC_ enum MAPISTATUS OpenMsgStore (struct mapi_session *, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS OpenProfile (struct mapi_profile *, const char *, const char *)
_PUBLIC_ enum MAPISTATUS OpenPublicFolder (struct mapi_session *, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS OpenPublicFolderByName (mapi_object_t *, mapi_object_t *obj_child, const char *)
_PUBLIC_ enum MAPISTATUS OpenStream (mapi_object_t *, enum MAPITAGS, enum OpenStream_OpenModeFlags OpenModeFlags, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS OpenUserMailbox (struct mapi_session *, const char *username, mapi_object_t *)
_PUBLIC_ enum MAPISTATUS ProcessNetworkProfile (struct mapi_session *, const char *, mapi_profile_callback_t, const void *)
_PUBLIC_ enum MAPISTATUS PublicFolderIsGhosted (mapi_object_t *, mapi_object_t *obj_folder, bool *)
_PUBLIC_ enum MAPISTATUS QueryColumns (mapi_object_t *, struct SPropTagArray *)
_PUBLIC_ enum MAPISTATUS QueryNamedProperties (mapi_object_t *, uint8_t queryFlags, struct GUID *guid, uint16_t *count, uint16_t **propID, struct MAPINAMEID **)
_PUBLIC_ enum MAPISTATUS QueryPosition (mapi_object_t *, uint32_t *Numerator, uint32_t *)
_PUBLIC_ enum MAPISTATUS QueryRows (mapi_object_t *, uint16_t, enum QueryRowsFlags flags, struct SRowSet *)
_PUBLIC_ enum MAPISTATUS ReadRecipients (mapi_object_t *, uint32_t RowId, uint8_t *RowCount, struct ReadRecipientRow **)
_PUBLIC_ enum MAPISTATUS ReadStream (mapi_object_t *, unsigned char *, uint16_t, uint16_t *)
_PUBLIC_ enum MAPISTATUS RegisterNotification (uint16_t)
_PUBLIC_ enum MAPISTATUS Release (mapi_object_t *)
_PUBLIC_ enum MAPISTATUS ReloadCachedInformation (mapi_object_t *)
_PUBLIC_ enum MAPISTATUS RemoveAllRecipients (mapi_object_t *)
_PUBLIC_ enum MAPISTATUS RemoveUserPermission (mapi_object_t *, const char *)
_PUBLIC_ enum MAPISTATUS RenameProfile (const char *, const char *)
_PUBLIC_ enum MAPISTATUS Reset (mapi_object_t *)
_PUBLIC_ enum MAPISTATUS ResolveNames (struct mapi_session *, const char **usernames, struct SPropTagArray *props, struct SRowSet **rowset, struct SPropTagArray **flaglist, uint32_t)
_PUBLIC_ enum MAPISTATUS Restrict (mapi_object_t *, struct mapi_SRestriction *res, uint8_t *)
_PUBLIC_ enum MAPISTATUS RfrGetFQDNFromLegacyDN (struct mapi_session *, const char **)
_PUBLIC_ char * RfrGetNewDSA (struct mapi_session *, const char *server, const char *)
_PUBLIC_ enum MAPISTATUS SaveChangesAttachment (mapi_object_t *, mapi_object_t *obj_child, enum SaveFlags)
_PUBLIC_ enum MAPISTATUS SaveChangesMessage (mapi_object_t *, mapi_object_t *obj_message, uint8_t)
_PUBLIC_ enum MAPISTATUS SeekRow (mapi_object_t *, enum BOOKMARK origin, int32_t, uint32_t *)
_PUBLIC_ enum MAPISTATUS SeekRowApprox (mapi_object_t *, uint32_t ulNumerator, uint32_t)
_PUBLIC_ enum MAPISTATUS SeekRowBookmark (mapi_object_t *, uint32_t lpbkPosition, uint32_t RowCount, uint32_t *)
_PUBLIC_ enum MAPISTATUS SeekStream (mapi_object_t *, uint8_t, uint64_t, uint64_t *)
_PUBLIC_ enum MAPISTATUS set_default_error_SPropValue_SRow (struct SRow *, uint32_t, void *)
_PUBLIC_ struct SPropTagArray * set_SPropTagArray (TALLOC_CTX *, uint32_t,...)
_PUBLIC_ bool set_SPropValue (struct SPropValue *, const void *)
_PUBLIC_ bool set_SPropValue_proptag (struct SPropValue *, uint32_t, const void *)
_PUBLIC_ bool set_SPropValue_proptag_date_timeval (struct SPropValue *, uint32_t, const struct timeval *)
_PUBLIC_ enum MAPISTATUS SetCollapseState (mapi_object_t *, struct SBinary_short *)
_PUBLIC_ enum MAPISTATUS SetColumns (mapi_object_t *, struct SPropTagArray *)
_PUBLIC_ enum MAPISTATUS SetDefaultProfile (const char *)
_PUBLIC_ enum MAPISTATUS SetMAPIDebugLevel (uint32_t)
_PUBLIC_ enum MAPISTATUS SetMAPIDumpData (bool)
_PUBLIC_ enum MAPISTATUS SetMessageReadFlag (mapi_object_t *, mapi_object_t *obj_child, uint8_t)
_PUBLIC_ enum MAPISTATUS SetMessageStatus (mapi_object_t *, mapi_id_t msgid, uint32_t ulNewStatus, uint32_t ulNewStatusMask, uint32_t *)
_PUBLIC_ enum MAPISTATUS SetPropertiesNoReplicate (mapi_object_t *, struct SPropValue *lpProps, unsigned long)
_PUBLIC_ enum MAPISTATUS SetProps (mapi_object_t *, struct SPropValue *, unsigned long)
_PUBLIC_ enum MAPISTATUS SetReadFlags (mapi_object_t *, uint8_t ReadFlags, uint16_t MessageIdCount, uint64_t *)
_PUBLIC_ enum MAPISTATUS SetReceiveFolder (mapi_object_t *, mapi_object_t *obj_folder, const char *)
_PUBLIC_ enum MAPISTATUS SetRecipientType (struct SRow *, enum ulRecipClass)
_PUBLIC_ enum MAPISTATUS SetSearchCriteria (mapi_object_t *, struct mapi_SRestriction *res, uint32_t SearchFlags, mapi_id_array_t *)
_PUBLIC_ enum MAPISTATUS SetSpooler (mapi_object_t *)
_PUBLIC_ enum MAPISTATUS SetStreamSize (mapi_object_t *, uint64_t)
_PUBLIC_ enum MAPISTATUS ShutDown (struct mapi_profile *)
_PUBLIC_ enum MAPISTATUS SortTable (mapi_object_t *, struct SSortOrderSet *)
_PUBLIC_ enum MAPISTATUS SpoolerLockMessage (mapi_object_t *, mapi_object_t *obj_message, enum LockState)
_PUBLIC_ enum MAPISTATUS SPropTagArray_add (TALLOC_CTX *, struct SPropTagArray *SPropTagArray, uint32_t)
_PUBLIC_ enum MAPISTATUS SRow_addprop (struct SRow *, struct SPropValue)
_PUBLIC_ uint32_t SRowSet_propcpy (TALLOC_CTX *, struct SRowSet *, struct SPropValue)
_PUBLIC_ enum MAPISTATUS SubmitMessage (mapi_object_t *)
_PUBLIC_ enum MAPISTATUS Subscribe (mapi_object_t *, uint32_t *, uint16_t NotificationFlags, bool WholeStore, mapi_notify_callback_t notify_callback, void *)
_PUBLIC_ enum MAPISTATUS TransportNewMail (mapi_object_t *, mapi_object_t *, const char *, uint32_t)
_PUBLIC_ enum MAPISTATUS TransportSend (mapi_object_t *, struct mapi_SPropValue_array *)
_PUBLIC_ enum MAPISTATUS uncompress_rtf (TALLOC_CTX *, uint8_t *rtfcomp, uint32_t in_size, DATA_BLOB *)
_PUBLIC_ enum MAPISTATUS UnlockRegionStream (mapi_object_t *, uint64_t, uint64_t, uint32_t)
_PUBLIC_ enum MAPISTATUS Unsubscribe (struct mapi_session *, uint32_t)
_PUBLIC_ bool valid_codepage (uint32_t)
_PUBLIC_ char * windows_to_utf8 (TALLOC_CTX *, const char *)
_PUBLIC_ enum MAPISTATUS WrapCompressedRTFStream (mapi_object_t *, DATA_BLOB *)
_PUBLIC_ enum MAPISTATUS WriteAndCommitStream (mapi_object_t *, DATA_BLOB *, uint16_t *)
_PUBLIC_ enum MAPISTATUS WriteStream (mapi_object_t *, DATA_BLOB *, uint16_t *)
_PUBLIC_ char * x500_get_dn_element (TALLOC_CTX *, const char *, const char *)
_PUBLIC_ char * x500_get_servername (const char *)
 Retrieve the servername from a string We should definitively find a better way to handle this.
_PUBLIC_ char * x500_truncate_dn_last_elements (TALLOC_CTX *, const char *, uint32_t)

Define Documentation

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

Function Documentation

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ struct SPropValue* add_SPropValue ( TALLOC_CTX *  ,
struct SPropValue *  ,
uint32_t *  ,
uint32_t  ,
const void *   
) [read]
_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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, ModifyTable

References cast_mapi_SPropValue(), global_mapi_ctx, mapi_object_get_session(), MAPI_RESOLVED, MAPIFreeBuffer(), ModifyTable(), OPENCHANGE_RETVAL_IF, PR_DISPLAY_NAME, PR_ENTRYID, PR_MEMBER_RIGHTS, ResolveNames(), and set_SPropTagArray().

_PUBLIC_ uint32_t cast_mapi_SPropValue ( struct mapi_SPropValue *  ,
struct SPropValue *   
)
_PUBLIC_ uint32_t cast_SPropValue ( struct mapi_SPropValue *  ,
struct SPropValue *   
)
_PUBLIC_ enum MAPISTATUS ChangeProfilePassword ( const char *  profile,
const char *  old_password,
const char *  password 
)

Change the profile password of an existing MAPI profile

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

References mapi_profile_modify_string_attr(), and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS CreateBookmark ( mapi_object_t obj_table,
uint32_t *  lpbkPosition 
)

Marks the table current position

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

References mapi_obj_bookmark::bin, mapi_obj_table::bk_last, mapi_obj_table::bookmark, mapi_provider::ctx, DLIST_ADD, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_obj_bookmark::index, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_init(), mapi_object_set_handle(), mapi_object_set_id(), mapi_object_set_logon_id(), mapi_object_set_session(), MAPI_UNICODE, OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS CreateProfile ( 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:
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 global_mapi_ctx, mapi_ctx::ldb_ctx, mapi_profile_add_string_attr(), OC_PROFILE_NOPASSWORD, and OPENCHANGE_RETVAL_IF.

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

Create a profile database

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

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

References OPENCHANGE_RETVAL_ERR, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS DeleteProfile ( const char *  profile)

Delete a profile from the MAPI profile database

Parameters:
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 global_mapi_ctx, mapi_ctx::ldb_ctx, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS DispatchNotifications ( struct mapi_session session)

Force notification of pending events

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

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

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

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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_provider::ctx, mapi_session::emsmdb, and global_mapi_ctx.

_PUBLIC_ 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 free_emsmdb_property(), PT_ERROR, pull_emsmdb_property(), and set_SPropValue().

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

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

Make a EMSMDB transaction.

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

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

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

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

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

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

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

Referenced by DispatchNotifications(), and MonitorNotification().

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_get_SRowSet(), emsmdb_transaction(), global_mapi_ctx, mapi_ctx::lp_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

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

Search the value of an attribute within a given profile

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

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_get_SRowSet(), emsmdb_transaction(), get_mapi_SRestriction_size(), global_mapi_ctx, mapi_ctx::lp_ctx, mapi_object_bookmark_find(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

Referenced by GetUserFreeBusyData().

_PUBLIC_ enum MAPISTATUS FreeBookmark ( mapi_object_t obj_table,
uint32_t  bkPosition 
)

Release the resources associated with a bookmark

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

References mapi_obj_bookmark::bin, mapi_obj_table::bk_last, mapi_obj_table::bookmark, mapi_provider::ctx, DLIST_REMOVE, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_obj_bookmark::index, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), MAPIFreeBuffer(), mapi_obj_bookmark::next, OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

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

References guid_delete_dash().

_PUBLIC_ struct AppointmentRecurrencePattern* get_AppointmentRecurrencePattern ( TALLOC_CTX *  ,
struct Binary_r *   
) [read]
_PUBLIC_ 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.
_PUBLIC_ const char* get_importance ( uint32_t  )
_PUBLIC_ int get_interfaces ( struct iface_struct *  ,
int   
)
_PUBLIC_ uint32_t get_mapi_property_size ( struct mapi_SPropValue *  )
_PUBLIC_ enum MAPISTATUS get_mapi_SPropValue_array_date_timeval ( struct timeval *  ,
struct mapi_SPropValue_array *  properties,
uint32_t   
)
_PUBLIC_ const void* get_mapi_SPropValue_data ( struct mapi_SPropValue *  )
_PUBLIC_ enum MAPISTATUS get_mapi_SPropValue_date_timeval ( struct timeval *  ,
struct SPropValue   
)

References get_SPropValue_data().

_PUBLIC_ const char* get_proptag_name ( uint32_t  )
_PUBLIC_ uint32_t get_proptag_value ( const char *  )
_PUBLIC_ 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.
_PUBLIC_ const void* get_SPropValue ( struct SPropValue *  ,
uint32_t   
)
_PUBLIC_ struct SPropValue* get_SPropValue_SRow ( struct SRow *  ,
uint32_t   
) [read]
_PUBLIC_ const void* get_SPropValue_SRow_data ( struct SRow *  ,
uint32_t   
)
_PUBLIC_ struct SPropValue* get_SPropValue_SRowSet ( struct SRowSet *  ,
uint32_t   
) [read]
_PUBLIC_ const void* get_SPropValue_SRowSet_data ( struct SRowSet *  ,
uint32_t   
)
_PUBLIC_ const char* get_task_status ( uint32_t  )
_PUBLIC_ 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.
_PUBLIC_ 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 mapi_provider::ctx, get_SPropValue_SRowSet_data(), global_mapi_ctx, MAPI_RESOLVED, MAPI_UNICODE, MAPIFreeBuffer(), nspi_context::mem_ctx, mapi_session::nspi, nspi_DNToMId(), nspi_GetProps(), OPENCHANGE_RETVAL_IF, PR_7BIT_DISPLAY_NAME_UNICODE, PR_ADDRTYPE_UNICODE, PR_DISPLAY_NAME_UNICODE, PR_DISPLAY_TYPE, PR_EMAIL_ADDRESS_UNICODE, PR_ENTRYID, PR_OBJECT_TYPE, PR_SEARCH_KEY, PR_SEND_INTERNET_ENCODING, PR_SEND_RICH_INFO, PR_SMTP_ADDRESS_UNICODE, PR_TRANSMITTABLE_DISPLAY_NAME_UNICODE, mapi_session::profile, ResolveNames(), and set_SPropTagArray().

Referenced by GetUserFreeBusyData().

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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.

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
Parameters:
obj_messagethe message we find the best body for
formatthe format - see above.

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

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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_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, GetHierarchyTable, GetLastError

References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), mapi_object_table_init(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by GetUserFreeBusyData().

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

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

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

The following types of folders are supported:

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

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

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

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

_PUBLIC_ enum MAPISTATUS GetDefaultProfile ( char **  profname)

Get the default profile from the database

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

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

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

Referenced by GetUserFreeBusyData().

_PUBLIC_ 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.

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

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

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

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

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

_PUBLIC_ enum MAPISTATUS GetGALTable ( struct mapi_session session,
struct SPropTagArray *  SPropTagArray,
struct SRowSet **  SRowSet,
uint32_t  count,
uint8_t  ulFlags 
)

Retrieve the global address list

Parameters:
sessionpointer to the MAPI session context
SPropTagArraypointer on an array of MAPI properties we want to fetch
SRowSetpointer on the rows 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
Returns:
MAPI_E_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

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

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), mapi_object_table_init(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by GetUserFreeBusyData().

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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:
GetIDsFromNames, QueryNamesFromIDs, mapi_nameid_new

References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and PT_UNSPECIFIED.

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

_PUBLIC_ enum MAPISTATUS GetLastError ( void  )

Returns the latest error code.

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

Note:
Calls to the function won't work in multi-threaded or multisession code.

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

_PUBLIC_ enum MAPISTATUS GetLoadparmContext ( struct loadparm_context **  lp_ctx)

Retrieve the global MAPI loadparm context

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

References mapi_ctx::lp_ctx, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 parameter is invalid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by mapi_SPropValue_array_named().

_PUBLIC_ 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 global_mapi_ctx, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 global_mapi_ctx, mapi_ctx::ldb_ctx, OPENCHANGE_RETVAL_IF, and mapi_profile::profname.

_PUBLIC_ enum MAPISTATUS GetProfileTable ( 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:
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 global_mapi_ctx, mapi_ctx::ldb_ctx, mapi_ctx::mem_ctx, OPENCHANGE_RETVAL_IF, PR_DEFAULT_PROFILE, and PR_DISPLAY_NAME.

Referenced by GetDefaultProfile(), and RenameProfile().

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS GetProps ( mapi_object_t obj,
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
SPropTagArrayan array of MAPI property tags
lpPropsthe result of the query
PropCountthe count of property tags
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj or SPropTagArray are null, or the session context could not be obtained
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See also:
SetProps, GetPropList, GetPropsAll, DeleteProps, GetLastError

References mapi_nameid::count, mapi_provider::ctx, mapi_session::emsmdb, emsmdb_get_SPropValue(), emsmdb_transaction(), GetIDsFromNames(), global_mapi_ctx, mapi_ctx::lp_ctx, mapi_nameid_lookup_SPropTagArray(), mapi_nameid_map_SPropTagArray(), mapi_nameid_new(), mapi_nameid_unmap_SPropTagArray(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), MAPIFreeBuffer(), mapi_nameid::nameid, OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

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

_PUBLIC_ enum MAPISTATUS GetPropsAll ( mapi_object_t obj,
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
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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, PR_FID, PR_LAST_MODIFICATION_TIME, and PR_MESSAGE_CLASS.

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

Returns the message recipient table

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

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

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), mapi_object_table_init(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS GetTable ( mapi_object_t obj_container,
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
obj_tablethe resulting table containing the container's permissions
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note:
Developers may also call GetLastError() 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:
ModifyTable

References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), mapi_object_table_init(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by ModifyUserPermission(), and RemoveUserPermission().

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

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

Referenced by IsFreeBusyConflict().

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ char* guid_delete_dash ( TALLOC_CTX *  ,
const char *   
)
_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

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

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

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

References find_SPropValue_data(), GetFreeBusyYear(), GetUserFreeBusyData(), global_mapi_ctx, mapi_object_get_session(), OPENCHANGE_RETVAL_IF, PR_FREEBUSY_ALL_EVENTS, PR_FREEBUSY_ALL_MONTHS, PR_FREEBUSY_START_RANGE, mapi_session::profile, and mapi_profile::username.

_PUBLIC_ bool IsMailboxFolder ( mapi_object_t obj_store,
uint64_t  fid,
uint32_t *  olFolder 
)
_PUBLIC_ bool lcid_get_locales ( const char *  )
_PUBLIC_ uint32_t lcid_lang2lcid ( const char *  )
_PUBLIC_ int lcid_lang2nb ( const char *  )
_PUBLIC_ const char* lcid_langcode2langtag ( uint32_t  )
_PUBLIC_ void lcid_print_group ( void  )
_PUBLIC_ bool lcid_print_groupmember ( int  )
_PUBLIC_ void lcid_print_languages ( void  )
_PUBLIC_ bool lcid_print_locale ( uint32_t  )
_PUBLIC_ bool lcid_valid_locale ( uint32_t  )
_PUBLIC_ enum MAPISTATUS LoadProfile ( 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.

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

References mapi_profile::credentials, mapi_profile::domain, global_mapi_ctx, OPENCHANGE_RETVAL_IF, mapi_profile::password, mapi_profile::realm, mapi_ctx::session, mapi_profile::username, and mapi_profile::workstation.

Referenced by MapiLogonProvider().

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 DLIST_REMOVE, global_mapi_ctx, mapi_object_get_session(), mapi_object_release(), mapi_session::next, OPENCHANGE_RETVAL_IF, and mapi_ctx::session.

_PUBLIC_ void mapi_errstr ( const char *  ,
uint32_t   
)

Referenced by emsmdb_connect().

_PUBLIC_ const char* mapi_get_errstr ( uint32_t  )
_PUBLIC_ 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 DLIST_ADD, global_mapi_ctx, mapi_container_list::id, mapi_id_array::lpContainerList, and OPENCHANGE_RETVAL_IF.

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

_PUBLIC_ enum MAPISTATUS mapi_id_array_del_id ( mapi_id_array_t id,
mapi_id_t  fid 
)

Delete a container ID from the list given its container ID

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

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

_PUBLIC_ enum MAPISTATUS mapi_id_array_del_obj ( mapi_id_array_t id,
mapi_object_t obj 
)

Delete a container ID from the list given its mapi_object_t

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

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

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

Retrieve the ContainerList and store it within a uint64_t array.

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

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

Referenced by MoveCopyMessages(), and SetSearchCriteria().

_PUBLIC_ enum MAPISTATUS mapi_id_array_init ( mapi_id_array_t id)

Initialize 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_release

References global_mapi_ctx, mapi_ctx::mem_ctx, and OPENCHANGE_RETVAL_IF.

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

_PUBLIC_ enum MAPISTATUS mapi_nameid_canonical_add ( struct mapi_nameid mapi_nameid,
uint32_t  proptag 
)

Add a mapi_nameid entry given its canonical property tag

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

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

Referenced by mapi_nameid_lookup_SPropTagArray(), and mapi_nameid_lookup_SPropValue().

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

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

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

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

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

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

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

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

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

Lookup named properties (MNID_STRING) and return their mapped proptags

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

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

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

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

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

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

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

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

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

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

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

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

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

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

References mapi_nameid_canonical_add(), and OPENCHANGE_RETVAL_IF.

Referenced by GetProps().

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

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

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

References mapi_nameid_canonical_add(), and OPENCHANGE_RETVAL_IF.

Referenced by SetPropertiesNoReplicate(), and SetProps().

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

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

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

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

Referenced by GetProps().

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

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

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

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

Referenced by SetPropertiesNoReplicate(), and SetProps().

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Referenced by GetProps().

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

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

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

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

Referenced by SetPropertiesNoReplicate(), and SetProps().

_PUBLIC_ enum MAPISTATUS mapi_object_bookmark_debug ( mapi_object_t obj_table)

Dump bookmarks associated to a MAPI object table

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

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

_PUBLIC_ enum MAPISTATUS mapi_object_bookmark_get_count ( mapi_object_t obj_table,
uint32_t *  count 
)

Retrieve the number of bookmarks stored in a MAPI object table

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

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

_PUBLIC_ enum MAPISTATUS mapi_object_copy ( mapi_object_t dst,
mapi_object_t src 
)

Copy MAPI object

This function copies mapi_object data from source to destination.

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

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

_PUBLIC_ 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.

_PUBLIC_ 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 -1 if the object does not exist

References mapi_object::id.

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

_PUBLIC_ enum MAPISTATUS mapi_object_get_logon_id ( mapi_object_t obj,
uint8_t *  logon_id 
)

Retrieve the logon id for a given MAPI object

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

References mapi_object::logon_id.

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

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

_PUBLIC_ 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

References global_mapi_ctx, and OPENCHANGE_RETVAL_IF.

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

_PUBLIC_ 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

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

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

_PUBLIC_ void mapi_object_set_logon_id ( mapi_object_t obj,
uint8_t  logon_id 
)

Set the logon id for a given MAPI object

Parameters:
objpointer to the object to set the logon id for
logon_idthe logon identifier to associate to the MAPI object

References mapi_object::logon_id.

Referenced by CloneStream(), CreateAttach(), CreateFolder(), CreateMessage(), GetAttachmentTable(), GetContentsTable(), GetHierarchyTable(), GetRulesTable(), GetTable(), OpenAttach(), OpenEmbeddedMessage(), OpenFolder(), OpenMessage(), OpenPublicFolder(), OpenPublicFolderByName(), OpenStream(), and OpenUserMailbox().

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

_PUBLIC_ void mapi_object_set_session ( mapi_object_t obj,
struct mapi_session session 
)

Set the session for a given MAPI object

Parameters:
objpointer on the object to set the session for
sessionpointer on the MAPI session to associate to the MAPI object

References mapi_object::session.

Referenced by CloneStream(), CreateAttach(), CreateFolder(), CreateMessage(), GetAttachmentTable(), GetContentsTable(), GetHierarchyTable(), GetRulesTable(), GetTable(), OpenAttach(), OpenEmbeddedMessage(), OpenFolder(), OpenMessage(), OpenPublicFolder(), OpenPublicFolderByName(), OpenStream(), OpenUserMailbox(), and Subscribe().

_PUBLIC_ enum MAPISTATUS mapi_profile_add_string_attr ( const char *  profile,
const char *  attr,
const char *  value 
)

Add an attribute to the profile

References global_mapi_ctx, mapi_ctx::ldb_ctx, and OPENCHANGE_RETVAL_IF.

Referenced by CreateProfile(), and ProcessNetworkProfile().

_PUBLIC_ enum MAPISTATUS mapi_profile_delete_string_attr ( const char *  profname,
const char *  attr,
const char *  value 
)

Delete an attribute

References global_mapi_ctx, mapi_ctx::ldb_ctx, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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
_PUBLIC_ enum MAPISTATUS mapi_profile_modify_string_attr ( const char *  profname,
const char *  attr,
const char *  value 
)

Modify an attribute

References global_mapi_ctx, mapi_ctx::ldb_ctx, and OPENCHANGE_RETVAL_IF.

Referenced by ChangeProfilePassword(), and SetDefaultProfile().

_PUBLIC_ void mapi_SPropValue_array_named ( mapi_object_t ,
struct mapi_SPropValue_array *   
)

References GetNamesFromIDs(), and PT_NULL.

_PUBLIC_ enum MAPISTATUS MAPIAllocateBuffer ( uint32_t  size,
void **  ptr 
)

Allocate memory using the MAPI memory context

Parameters:
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 global_mapi_ctx, mapi_ctx::mem_ctx, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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

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

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

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

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

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

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

_PUBLIC_ void mapidump_date ( struct mapi_SPropValue_array *  ,
uint32_t  ,
const char *   
)
_PUBLIC_ 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().

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

References mapidump_tags().

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

Referenced by mapidump_foldercopied().

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

Referenced by mapidump_freebusy_event().

_PUBLIC_ uint32_t mapidump_freebusy_year ( uint32_t  ,
uint32_t   
)

Referenced by mapidump_freebusy_event().

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

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)
See also:
mapidump_appointment, mapidump_contact, mapidump_task, mapidump_note

References find_mapi_SPropValue_data(), PR_BODY, PR_BODY_UNICODE, PR_CONVERSATION_TOPIC, PR_DISPLAY_BCC, PR_DISPLAY_CC, PR_DISPLAY_TO, PR_HASATTACH, PR_HTML, PR_INTERNET_MESSAGE_ID, PR_MESSAGE_CODEPAGE, and PR_SENT_REPRESENTING_NAME.

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

References mapidump_tags().

Referenced by mapidump_messagemodified().

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

Referenced by mapidump_messagecopied().

_PUBLIC_ void mapidump_msgflags ( uint32_t  ,
const char *   
)

References mdump_msgflags::flag.

Referenced by mapidump_newmail().

_PUBLIC_ void mapidump_newmail ( struct NewMailNotification *  ,
const char *   
)

References mapidump_msgflags().

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

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

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

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

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

_PUBLIC_ void mapidump_PAB_entry ( struct SRow *  )
_PUBLIC_ void mapidump_Recipients ( const char **  ,
struct SRowSet *  ,
struct SPropTagArray *   
)
_PUBLIC_ void mapidump_SPropTagArray ( struct SPropTagArray *  )

References get_proptag_name().

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

References mapidump_SRow().

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

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

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

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

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

_PUBLIC_ enum MAPISTATUS MAPIFreeBuffer ( void *  ptr)

Free allocated memory

This function frees memory previously allocated with MAPIAllocateBuffer.

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

References OPENCHANGE_RETVAL_IF.

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

_PUBLIC_ enum MAPISTATUS MAPIInitialize ( const char *  profiledb)

Initialize mapi context global structure

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

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

_PUBLIC_ enum MAPISTATUS MapiLogonEx ( 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:
sessionpointer to a pointer to a MAPI session object
profnameprofile name to use
passwordpassword to use for the profile

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

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

References MapiLogonProvider(), PROVIDER_ID_EMSMDB, and PROVIDER_ID_NSPI.

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

Initialize a session on the specified provider

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

Referenced by MapiLogonEx().

_PUBLIC_ void MAPIUninitialize ( void  )

Uninitialize MAPI subsystem

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

See also:
MAPIInitialize, GetLastError

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

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

References cast_mapi_SPropValue(), mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), find_SPropValue_data(), get_MAPITAGS_SRow(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_recipients_RecipientFlags(), MAPITAGS_delete_entries(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, PR_7BIT_DISPLAY_NAME, PR_7BIT_DISPLAY_NAME_UNICODE, PR_ADDRTYPE, PR_ADDRTYPE_ERROR, PR_ADDRTYPE_UNICODE, PR_DISPLAY_NAME, PR_DISPLAY_NAME_ERROR, PR_DISPLAY_NAME_UNICODE, PR_EMAIL_ADDRESS, PR_EMAIL_ADDRESS_UNICODE, PR_ENTRYID, PR_GIVEN_NAME, PR_GIVEN_NAME_ERROR, PR_GIVEN_NAME_UNICODE, PR_RECIPIENT_TYPE, PR_SEND_INTERNET_ENCODING, PR_SEND_INTERNET_ENCODING_ERROR, PR_SMTP_ADDRESS, PR_SMTP_ADDRESS_UNICODE, PR_TRANSMITTABLE_DISPLAY_NAME, and PR_TRANSMITTABLE_DISPLAY_NAME_UNICODE.

_PUBLIC_ enum MAPISTATUS ModifyTable ( mapi_object_t obj_table,
struct mapi_SRowList *  rowList 
)

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
rowListthe list of table entries to modify
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note:
Developers may also call GetLastError() 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:
GetTable, AddUserPermission, ModifyUserPermission, RemoveUserPermission

References mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), get_mapi_property_size(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

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

_PUBLIC_ 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 we add permission for
usernamethe Exchange username we 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, GetTable, ModifyTable

References find_SPropValue_data(), get_SPropValue_SRow(), GetTable(), global_mapi_ctx, mapi_object_get_session(), mapi_object_init(), mapi_object_release(), MAPI_RESOLVED, MAPIFreeBuffer(), ModifyTable(), OPENCHANGE_RETVAL_IF, PR_DISPLAY_NAME, PR_ENTRYID, PR_MEMBER_ID, PR_MEMBER_NAME, PR_MEMBER_RIGHTS, QueryPosition(), QueryRows(), ResolveNames(), set_SPropTagArray(), and SetColumns().

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

Wait for notifications and process them

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

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

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

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

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

Copy or Move a message from a folder to another

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

Possible values for WantCopy:

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

References mapi_id_array::count, mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_id_array_get(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

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

Referenced by Logon().

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

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

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

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

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

Maps a set of DN to a set of MId

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

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

Referenced by GetABRecipientInfo(), and ProcessNetworkProfile().

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

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

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

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

_PUBLIC_ enum MAPISTATUS nspi_GetMatches ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
struct SPropTagArray *  pPropTags,
struct Restriction_r *  Filter,
struct SRowSet **  ppRows,
struct SPropTagArray **  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 nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

Referenced by ProcessNetworkProfile().

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

Returns a list of property names for a set of proptags

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

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

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

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

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

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

_PUBLIC_ enum MAPISTATUS nspi_GetProps ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
struct SPropTagArray *  pPropTags,
struct SPropTagArray *  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 nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

Referenced by GetABRecipientInfo(), and ProcessNetworkProfile().

_PUBLIC_ 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 nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, nspi_context::rpc_connection, and nspi_context::version.

Referenced by ProcessNetworkProfile().

_PUBLIC_ 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 nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

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

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

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

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

_PUBLIC_ 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 nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

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

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

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

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

enum MAPISTATUS nspi_QueryRows ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
struct SPropTagArray *  pPropTags,
struct SPropTagArray *  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 nspi_context::handle, OPENCHANGE_RETVAL_IF, nspi_context::pStat, and nspi_context::rpc_connection.

Referenced by GetGALTable(), and ProcessNetworkProfile().

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

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

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

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

Referenced by ResolveNames().

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

Takes a set of string values in the Unicode character set and performs ANR on those strings

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

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

Referenced by ResolveNames().

_PUBLIC_ enum MAPISTATUS nspi_ResortRestriction ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
enum TableSortOrders  SortType,
struct SPropTagArray *  pInMIds,
struct SPropTagArray **  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 addess book container
ppMIdspointer on pointer to the returned list of MIds that comprise a restricted addess book container.

SortType can take the following values:

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

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

_PUBLIC_ enum MAPISTATUS nspi_SeekEntries ( struct nspi_context nspi_ctx,
TALLOC_CTX *  mem_ctx,
enum TableSortOrders  SortType,
struct SPropValue *  pTarget,
struct SPropTagArray *  pPropTags,
struct SPropTagArray *  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 nspi_context::handle, OPENCHANGE_RETVAL_IF, PR_DISPLAY_NAME, PR_DISPLAY_NAME_UNICODE, PR_EMS_AB_PHONETIC_DISPLAY_NAME, PR_EMS_AB_PHONETIC_DISPLAY_NAME_UNICODE, nspi_context::pStat, and nspi_context::rpc_connection.

enum MAPISTATUS nspi_unbind ( struct nspi_context nspi_ctx)

Destroys the context handle

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

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

Referenced by nspi_disconnect_dtor().

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

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

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

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

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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, attach, 2);
        ... check the return value ...

        // Initialise the embedded message object
        mapi_object_init(&obj_embeddedmsg);
        retval = OpenEmbeddedMessage(&obj_attach, &obj_embeddedmsg, MAPI_CREATE);
        ... check the return value ...

        // Fill in the embedded message properties, just like any other message (e.g. resulting from CreateMessage())

        // Save the changes to the embedded message
        retval = SaveChangesMessage(&obj_message, &obj_embeddedmsg, KeepOpenReadOnly);
        ... check the return value ...

        // Save the changes to the attachment
        retval = SaveChangesAttachment(&obj_message, &obj_attach, KeepOpenReadOnly);
        ... check the return value ...

        // Save the changes to the original message
        retval = SaveChangesMessage(&obj_folder, &obj_message, KeepOpenReadOnly);
        ... check the return value ...
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_store is undefined
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code.
See also:
CreateAttach, OpenMessage, GetLastError

References mapi_provider::ctx, mapi_obj_message::cValues, mapi_session::emsmdb, emsmdb_get_SRow(), emsmdb_transaction(), global_mapi_ctx, mapi_ctx::lp_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, PR_INTERNET_CPID, PR_RECIPIENT_TYPE, mapi_object::private_data, SPropTagArray_add(), SRow_addprop(), and mapi_obj_message::SRowSet.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_id(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by GetUserFreeBusyData().

_PUBLIC_ 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
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_store is undefined
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See also:
MAPIInitialize, GetLastError

References mapi_provider::ctx, mapi_obj_message::cValues, mapi_session::emsmdb, emsmdb_get_SRow(), emsmdb_transaction(), global_mapi_ctx, mapi_ctx::lp_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, PR_INTERNET_CPID, PR_RECIPIENT_TYPE, mapi_object::private_data, SPropTagArray_add(), SRow_addprop(), and mapi_obj_message::SRowSet.

Referenced by GetUserFreeBusyData().

_PUBLIC_ enum MAPISTATUS OpenMsgStore ( struct mapi_session session,
mapi_object_t obj_store 
)

Open the Message Store

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

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

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

_PUBLIC_ enum MAPISTATUS OpenProfile ( 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:
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 global_mapi_ctx, mapi_ctx::ldb_ctx, OPENCHANGE_RETVAL_IF, and mapi_ctx::session.

Referenced by MapiLogonProvider().

_PUBLIC_ 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 mapi_obj_store::cached_mailbox_fid, mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), mapi_obj_store::fid_pf_EFormsRegistry, mapi_obj_store::fid_pf_EFormsRegistryRoot, mapi_obj_store::fid_pf_FreeBusyRoot, mapi_obj_store::fid_pf_ipm_subtree, mapi_obj_store::fid_pf_LocalSiteFreeBusy, mapi_obj_store::fid_pf_LocalSiteOfflineAB, mapi_obj_store::fid_pf_NNTPArticle, mapi_obj_store::fid_pf_non_ipm_subtree, mapi_obj_store::fid_pf_OfflineAB, mapi_obj_store::fid_pf_public_root, GetNewLogonId(), global_mapi_ctx, mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_logon_store(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, mapi_object::private_data, and mapi_session::profile.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 occured 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_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

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

Referenced by OpenMsgStore().

_PUBLIC_ enum MAPISTATUS ProcessNetworkProfile ( struct mapi_session session,
const char *  username,
mapi_profile_callback_t  callback,
const void *  private_data 
)

Process a full and automated MAPI profile creation

This function process a full and automated MAPI profile creation using the username pattern passed as a parameter. The functions takes a callback parameter which will be called when the username checked matches several usernames. Private data needed by the callback can be supplied using the private_data pointer.

   typedef int (*mapi_callback_t) callback(struct SRowSet *, void *private_data);

The callback returns the SRow element index within the SRowSet structure. If the user cancels the operation the callback return value should be SRowSet->cRows or more.

Parameters:
sessionthe session context
usernamethe username for the network profile
callbackfunction pointer callback function
private_datacontext data that will be provided to the callback
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized. The MAPI subsystem must be initialized (using MAPIInitialize) prior to creating a profile.
  • MAPI_E_END_OF_SESSION: The NSPI session has not been initialized
  • MAPI_E_CANCEL_USER: The user has aborted the operation
  • MAPI_E_INVALID_PARAMETER: The profile parameter was not set properly.
  • MAPI_E_NOT_FOUND: One of the mandatory field was not found during the profile creation process.
See also:
OpenProfileStore, MAPILogonProvider, GetLastError

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

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by ModifyUserPermission(), and RemoveUserPermission().

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_get_SRowSet(), emsmdb_transaction(), global_mapi_ctx, mapi_ctx::lp_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

Referenced by ModifyUserPermission(), and RemoveUserPermission().

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 occured 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_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by WrapCompressedRTFStream().

_PUBLIC_ enum MAPISTATUS RegisterNotification ( 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:
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:
Subscribe, Unsubscribe, MonitorNotification, GetLastError

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

_PUBLIC_ 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_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by mapi_object_release(), and Unsubscribe().

_PUBLIC_ enum MAPISTATUS ReloadCachedInformation ( mapi_object_t obj_message)

Retrieve the message properties for an already open message.

This function is very similar to OpenMessage, but works on an already open message object.

Parameters:
obj_messagethe message object to retrieve the properties for.
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_store is undefined
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See also:
OpenMessage

References mapi_provider::ctx, mapi_obj_message::cValues, mapi_session::emsmdb, emsmdb_get_SRow(), emsmdb_transaction(), global_mapi_ctx, mapi_ctx::lp_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, PR_INTERNET_CPID, PR_RECIPIENT_TYPE, mapi_object::private_data, SPropTagArray_add(), SRow_addprop(), and mapi_obj_message::SRowSet.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS RemoveUserPermission ( mapi_object_t obj_folder,
const char *  username 
)

Remove permissions for a user on a given folder

Parameters:
obj_folderthe folder we add permission for
usernamethe Exchange username we 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, GetTable, ModifyTable

References find_SPropValue_data(), get_SPropValue_SRow(), GetTable(), global_mapi_ctx, mapi_object_get_session(), mapi_object_init(), mapi_object_release(), MAPI_RESOLVED, MAPIFreeBuffer(), ModifyTable(), OPENCHANGE_RETVAL_IF, PR_DISPLAY_NAME, PR_ENTRYID, PR_MEMBER_ID, PR_MEMBER_NAME, PR_MEMBER_RIGHTS, QueryPosition(), QueryRows(), ResolveNames(), set_SPropTagArray(), and SetColumns().

_PUBLIC_ enum MAPISTATUS RenameProfile ( const char *  old_profile,
const char *  profile 
)

Rename a profile

Parameters:
old_profileold profile name
profilenew profile name
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.

References get_SPropValue_SRow(), GetProfileTable(), global_mapi_ctx, mapi_ctx::ldb_ctx, mapi_ctx::mem_ctx, OPENCHANGE_RETVAL_IF, and PR_DISPLAY_NAME.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS ResolveNames ( struct mapi_session session,
const char **  usernames,
struct SPropTagArray *  props,
struct SRowSet **  rowset,
struct SPropTagArray **  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 responsability to call MAPIFreeBuffer on rowset and flaglist once they have finished to use them.

See also:
MAPILogonProvider, GetLastError

References mapi_provider::ctx, global_mapi_ctx, MAPI_UNICODE, nspi_context::mem_ctx, mapi_session::nspi, nspi_ResolveNames(), nspi_ResolveNamesW(), and OPENCHANGE_RETVAL_IF.

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

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), get_mapi_SRestriction_size(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS RfrGetFQDNFromLegacyDN ( struct mapi_session session,
const char **  serverFQDN 
)

Returns the FQDN of the NSPI server corresponding to a DN

Parameters:
sessionpointer to the MAPI session context
serverFQDNpointer to the server FQDN string (return value)
Returns:
MAPI_E_SUCCESS on success, otherwise a MAPI error and serverFQDN content set to NULL.

References mapi_profile::credentials, global_mapi_ctx, mapi_profile::homemdb, mapi_ctx::lp_ctx, OPENCHANGE_RETVAL_IF, mapi_session::profile, RfrGetFQDNFromLegacyDN(), and mapi_profile::server.

Referenced by RfrGetFQDNFromLegacyDN().

_PUBLIC_ char* RfrGetNewDSA ( struct mapi_session session,
const char *  server,
const char *  userDN 
)

Returns the name of an NSPI server

Parameters:
sessionpointer to the MAPI session context
serverthe Exchange server address (IP or FQDN)
userDNoptional user mailbox DN
Returns:
a valid allocated string on success, otherwise NULL.
Note:
The string returned can either be RfrGetNewDSA one on success, or a copy of the server's argument one on failure. If no server string is provided, NULL is returned.

It is up to the developer to free the returned string when not needed anymore.

References mapi_profile::credentials, global_mapi_ctx, mapi_ctx::lp_ctx, mapi_session::profile, RfrGetNewDSA(), and mapi_ctx::session.

Referenced by Logon(), and RfrGetNewDSA().

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_id(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_bookmark_find(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS set_default_error_SPropValue_SRow ( struct SRow *  ,
uint32_t  ,
void *   
)
_PUBLIC_ 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);

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

_PUBLIC_ bool set_SPropValue_proptag ( struct SPropValue *  ,
uint32_t  ,
const void *   
)
_PUBLIC_ bool set_SPropValue_proptag_date_timeval ( struct SPropValue *  ,
uint32_t  ,
const struct timeval *   
)
_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, mapi_object::private_data, and mapi_obj_table::proptags.

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

_PUBLIC_ enum MAPISTATUS SetDefaultProfile ( const char *  profname)

Set a default profile for the database

Parameters:
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 global_mapi_ctx, mapi_ctx::ldb_ctx, mapi_profile_modify_string_attr(), and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS SetMAPIDebugLevel ( uint32_t  level)

Set MAPI debug level

Parameters:
levelthe debug level to set
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: the function parameter is invalid

References mapi_ctx::lp_ctx, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS SetMAPIDumpData ( bool  status)

Enable MAPI network trace output

Parameters:
statusthe status

possible status values/behavior:

  1. true: Network traces are displayed on stdout
  2. false: Network traces are not displayed on stdout
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_INITIALIZED

References mapi_ctx::dumpdata, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS SetPropertiesNoReplicate ( mapi_object_t obj,
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
lpPropsthe list of properties to set
PropCountthe number of properties
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj is not valid
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See also:
SetProps, DeletePropertiesNoReplicate

References cast_mapi_SPropValue(), mapi_nameid::count, mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), GetIDsFromNames(), global_mapi_ctx, mapi_nameid_lookup_SPropValue(), mapi_nameid_map_SPropValue(), mapi_nameid_new(), mapi_nameid_unmap_SPropValue(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), MAPIFreeBuffer(), mapi_nameid::nameid, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS SetProps ( mapi_object_t obj,
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
lpPropsthe list of properties to set
PropCountthe number of properties
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See also:
GetProps, GetPropList, GetPropsAll, DeleteProps, GetLastError

References cast_mapi_SPropValue(), mapi_nameid::count, mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), GetIDsFromNames(), global_mapi_ctx, mapi_nameid_lookup_SPropValue(), mapi_nameid_map_SPropValue(), mapi_nameid_new(), mapi_nameid_unmap_SPropValue(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), MAPIFreeBuffer(), mapi_nameid::nameid, OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS SetRecipientType ( struct SRow *  aRow,
enum ulRecipClass  RecipClass 
)

Set the type of a recipient

The function sets the recipient type (RecipClass) in the aRow parameter. ResolveNames should be used to fill the SRow structure.

Parameters:
aRowthe row to set
RecipClassthe type of recipient to set on the specified row
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: The aRow parameter was not set properly.
See also:
ResolveNames, ModifyRecipients, GetLastError

References OPENCHANGE_RETVAL_IF, PR_RECIPIENT_TYPE, and SRow_addprop().

_PUBLIC_ enum MAPISTATUS SetSearchCriteria ( mapi_object_t obj_container,
struct mapi_SRestriction *  res,
uint32_t  SearchFlags,
mapi_id_array_t lpContainerList 
)

Etablishes search criteria for the container

Parameters:
obj_containerthe object we apply search criteria on
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_CALL_FAILED: A network problem was encountered during the transaction
See also:
GetSearchCriteria

References mapi_id_array::count, mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), get_mapi_SRestriction_size(), global_mapi_ctx, mapi_id_array_get(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS ShutDown ( struct mapi_profile profile)

Release a profile

This function releases the credentials associated with the profile.

Parameters:
profilethe profile to release.
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_INVALID_PARAMETER: The profile parameter was not set or not valid

References mapi_profile::credentials, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

Referenced by GetUserFreeBusyData().

_PUBLIC_ enum MAPISTATUS SpoolerLockMessage ( mapi_object_t ,
mapi_object_t obj_message,
enum  LockState 
)
_PUBLIC_ enum MAPISTATUS SPropTagArray_add ( TALLOC_CTX *  mem_ctx,
struct SPropTagArray *  SPropTagArray,
uint32_t  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().

_PUBLIC_ enum MAPISTATUS SRow_addprop ( struct SRow *  ,
struct SPropValue   
)
_PUBLIC_ uint32_t SRowSet_propcpy ( TALLOC_CTX *  ,
struct SRowSet *  ,
struct SPropValue   
)
_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 callabck function
NotificationFlagsmask for events to provide notifications for (see below)
WholeStorewhether the scope for this notification is whole database
notify_callbacknotification callback function.
private_datathe data to be passed at the callback function when invoked

The Notification Flags can take the following values:

  • fnevCriticalError
  • fnevNewMail
  • fnevObjectCreated
  • fnevObjectDeleted
  • fnevObjectModified
  • fnevObjectMoved
  • fnevObjectCopied
  • fnevSearchComplete
  • fnevTableModified
  • fnevStatusObjectModified
  • fnevReservedForMapi
  • fnevExtended
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error.
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
See also:
RegisterNotification, Unsubscribe, MonitorNotification, GetLastError

References notifications::callback, mapi_provider::ctx, DLIST_ADD, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_init(), mapi_object_set_handle(), mapi_object_set_session(), notifications::NotificationFlags, mapi_notify_ctx::notifications, mapi_session::notify_ctx, notifications::obj_notif, OPENCHANGE_RETVAL_IF, notifications::parentID, notifications::private_data, and notifications::ulConnection.

_PUBLIC_ enum MAPISTATUS TransportNewMail ( 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_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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS TransportSend ( mapi_object_t obj_message,
struct mapi_SPropValue_array *  lpProps 
)
_PUBLIC_ enum MAPISTATUS uncompress_rtf ( TALLOC_CTX *  ,
uint8_t *  rtfcomp,
uint32_t  in_size,
DATA_BLOB *   
)
_PUBLIC_ 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

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

_PUBLIC_ bool valid_codepage ( uint32_t  )
_PUBLIC_ char* windows_to_utf8 ( TALLOC_CTX *  ,
const char *   
)

References yyparse_utf8().

_PUBLIC_ enum MAPISTATUS WrapCompressedRTFStream ( mapi_object_t obj_stream,
DATA_BLOB *  rtf 
)

creates a DATA_BLOB in uncompressed Rich Text Format (RTF) from the compressed format used in the PR_RTF_COMPRESSED property opened in the stream.

Parameters:
obj_streamstream object with RTF stream content
rtfthe output blob with uncompressed content
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_stream is not a valid pointer
  • MAPI_E_CORRUPT_DATA: a problem was encountered while decompressing the RTF compressed data
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code.
rtf->data needs to be freed with MAPIFreeBuffer
See also:
OpenStream

References GetLastError(), global_mapi_ctx, mapi_ctx::mem_ctx, OPENCHANGE_RETVAL_IF, ReadStream(), and uncompress_rtf().

_PUBLIC_ 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 occured 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 mapi_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.

_PUBLIC_ 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 occured 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_provider::ctx, mapi_session::emsmdb, emsmdb_transaction(), global_mapi_ctx, mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

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

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

_PUBLIC_ 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/