Functions for operating on Streams on MAPI objects. More...
Functions | |
_PUBLIC_ enum MAPISTATUS | CloneStream (mapi_object_t *obj_src, mapi_object_t *obj_dst) |
_PUBLIC_ enum MAPISTATUS | CommitStream (mapi_object_t *obj_stream) |
_PUBLIC_ enum MAPISTATUS | CopyToStream (mapi_object_t *obj_src, mapi_object_t *obj_dst, uint64_t ByteCount, uint64_t *ReadByteCount, uint64_t *WrittenByteCount) |
_PUBLIC_ enum MAPISTATUS | GetStreamSize (mapi_object_t *obj_stream, uint32_t *StreamSize) |
_PUBLIC_ enum MAPISTATUS | LockRegionStream (mapi_object_t *obj_stream, uint64_t RegionOffset, uint64_t RegionSize, uint32_t LockFlags) |
_PUBLIC_ enum MAPISTATUS | OpenStream (mapi_object_t *obj_related, enum MAPITAGS PropertyTag, enum OpenStream_OpenModeFlags OpenModeFlags, mapi_object_t *obj_stream) |
_PUBLIC_ enum MAPISTATUS | ReadStream (mapi_object_t *obj_stream, unsigned char *buf_data, uint16_t ByteCount, uint16_t *ByteRead) |
_PUBLIC_ enum MAPISTATUS | SeekStream (mapi_object_t *obj_stream, uint8_t Origin, uint64_t Offset, uint64_t *NewPosition) |
_PUBLIC_ enum MAPISTATUS | SetStreamSize (mapi_object_t *obj_stream, uint64_t SizeStream) |
_PUBLIC_ enum MAPISTATUS | UnlockRegionStream (mapi_object_t *obj_stream, uint64_t RegionOffset, uint64_t RegionSize, uint32_t LockFlags) |
_PUBLIC_ enum MAPISTATUS | WriteAndCommitStream (mapi_object_t *obj_stream, DATA_BLOB *blob, uint16_t *WrittenSize) |
_PUBLIC_ enum MAPISTATUS | WriteStream (mapi_object_t *obj_stream, DATA_BLOB *blob, uint16_t *WrittenSize) |
Functions for operating on Streams on MAPI objects.
_PUBLIC_ enum MAPISTATUS CloneStream | ( | mapi_object_t * | obj_src, |
mapi_object_t * | obj_dst | ||
) |
Clone a source stream to another stream
obj_src | the source stream object |
obj_dst | the destination stream object |
References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), and OPENCHANGE_RETVAL_IF.
_PUBLIC_ enum MAPISTATUS CommitStream | ( | mapi_object_t * | obj_stream) |
Commits stream operations
obj_stream | the stream object to commit |
References emsmdb_transaction_wrapper(), 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
obj_src | the source stream object |
obj_dst | the destination stream object |
ByteCount | the number of bytes to copy |
ReadByteCount | pointer on the number of bytes read from the source object |
WrittenByteCount | pointer on the number of bytes written to the destination object |
References emsmdb_transaction_wrapper(), 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
obj_stream | the stream object we retrieve size from |
StreamSize | pointer on the stream size |
References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
_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
obj_stream | the stream object |
RegionOffset | starting point for the range |
RegionSize | length of the range |
LockFlags | type 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).
References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), 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.
obj_related | the object to open. |
PropertyTag | the property name for the object to create a stream for. |
OpenModeFlags | sets the access mode for the stream and is one of the following values: 0x0: ReadOnly 0x1: ReadWrite 0x2: Create 0x3: BestAccess |
obj_stream | the resulting stream object. |
References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
_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.
obj_stream | the opened stream object |
buf_data | the buffer where data read from the stream will be stored |
ByteCount | the number of bytes requested to be read from the stream |
ByteRead | the number of bytes read from the stream |
References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
Referenced by WrapCompressedRTFStream().
_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
obj_stream | the stream object |
Origin | origin location for the seek operation |
Offset | the seek offset |
NewPosition | pointer 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.
References emsmdb_transaction_wrapper(), 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
obj_stream | the stream object |
SizeStream | the size of the stream |
References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
_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
obj_stream | the stream object |
RegionOffset | starting point for the range |
RegionSize | length of the range |
LockFlags | type of locking |
LockFlags used in unlocking must match the LockFlags used in locking.
References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.
_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.
obj_stream | the opened stream object |
blob | the DATA_BLOB to write to the stream |
WrittenSize | the actual number of bytes written to the stream |
References emsmdb_transaction_wrapper(), 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.
obj_stream | the opened stream object |
blob | the DATA_BLOB to write to the stream |
WrittenSize | the actual number of bytes written to the stream |
References emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.
![]() ![]() ![]() |
This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/ |