5.2.1 IADsStream

All Stream objects support the COM interface IADsStream. The interface definition is as follows:

[ object, uuid(IID_IADsStream), oleautomation, dual ]

interface IADsStream: IDispatch

{

// Methods.

HRESULT OpenStream([in]long lMode,

[out, retval]Istream **ppStm);

};

Method

Remark

OpenStream

Returns a COM Stream object opened in the specified mode. Stream objects returned by OpenStream must support the Read, Write, and Seek methods. The following additional methods are defined by COM and can be implemented at the provider's discretion:

Clone clones the Istream

Commit commits changes in STGM_TRANSACTED mode

CopyTo copies byte range from current stream to another stream

LockRegion locks a byte range in a stream

Revert discards changes in STGM_TRANSACTED mode

SetSize explicitly sets the size of the stream (in bytes)

Stat returns a STATSTG struct for this stream (see COM doc)

UnlockRegion unlocks a byte range locked by LockRegion

The lMode parameter indicates the desired access to the stream. Active Directory providers must support the following COM-defined modes:

STGM_DIRECT 0x00000000L

STGM_READ 0x00000000L

STGM_WRITE 0x00000001L

and may support any of the following additional modes at the provider's discretion.

STGM_READWRITE 0x00000002L

STGM_SHARE_DENY_NONE 0x00000040L

STGM_SHARE_DENY_READ 0x00000030L

STGM_SHARE_DENY_WRITE 0x00000020L

STGM_SHARE_EXCLUSIVE 0x00000010L

STGM_TRANSACTED 0x00010000L

STGM_SIMPLE 0x08000000L

STGM_PRIORITY 0x00040000L

STGM_DELETEONRELEASE 0x04000000L

STGM_CREATE 0x00001000L

STGM_CONVERT 0x00020000L

STGM_FAILIFTHERE 0x00000000L

STGM_NOSCRATCH 0x00100000L