IDirectWriterLock::WaitForWriteAccess

[This is preliminary documentation and subject to change.]

Obtains exclusive write access to a storage object.

HRESULT WaitForWriteAccess(
  DWORD dwTimeout  //Specifies a timeout for blocking
);
 

Parameter

dwTimeout
[in] Specifies the time in milliseconds that this method blocks while waiting to obtain exclusive write access to the storage object. If dwTimeout is zero, the method does not block waiting for exclusive access for writing. The INFINITE timeout defined in the Platform SDK is allowed for dwTimeout.

Return Values

S_OK
The caller has successfully obtained exclusive write access to the storage.
S_FALSE
This method was called again without an intervening call to IDirectWriterLock::ReleaseWriteAccess.
STG_E_INUSE
The specified timeout expired without obtaining exclusive write access.

Remarks

When a storage is opened in direct mode (STGM_DIRECT) with the STGM_READWRITE|STGM_SHARE_DENY_WRITE, you can call this method to obtain exclusive write access to the storage.

This method returns immediately if no readers have the storage open. If the storage is still open for reading, this method blocks for the specified dwTimeout or until the current readers close the storage.

QuickInfo

  Windows NT: Use version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in objidl.h.

See Also

IDirectWriterLock::ReleaseWriteAccess, IDirectWriterLock::HaveWriteAccess