Microsoft SDK for Java

OpenStorage

This method of the IStorage interface opens an existing storage object with the specified name in the specified access mode.

Syntax

public IStorage OpenStorage(String pwcsName, IStorage pstgPriority, int grfMode, String[] snbExclude, int reserved);

Return Value

S_OK -- The storage object was opened successfully.

E_PENDING -- Asynchronous storage only: Part or all the storage's data is currently unavailable.

STG_E_ACCESSDENIED -- Insufficient permissions to open storage object.

STG_E_FILENOTFOUND -- The storage object with the specified name does not exist.

STG_E_INSUFFICIENTMEMORY -- The storage object was not opened due to a lack of memory.

STG_E_INVALIDFLAG -- The value specified for the grfMode flag is not a valid STGM enumeration value.

STG_E_INVALIDFUNCTION -- The specified combination of grfMode flags is not supported.

STG_E_INVALIDNAME -- Invalid value for pwcsName.

STG_E_INVALIDPOINTER -- The pointer specified for the storage object was invalid.

STG_E_INVALIDPARAMETER -- One of the parameters was invalid.

STG_E_REVERTED -- The storage object has been invalidated by a revert operation above it in the transaction tree.

STG_E_TOOMANYOPENFILES -- The storage object was not created because there are too many open files.

STG_S_CONVERTED -- The existing stream with the specified name was replaced with a new storage object containing a single stream called CONTENTS. In direct mode, the new storage is immediately written to disk. In transacted mode, the new storage is written to a temporary storage in memory and later written to disk when it is committed.

Parameters

pwcsName [in] Points to a wide character string that contains the name of the storage object to open. It is ignored if pstgPriority is non-NULL.
pstgPriority [in] Must be NULL. A non-NULL value will return STG_E_INVALIDPARAMETER.
grfMode [in] Specifies the access mode to use when opening the storage object. For descriptions of the possible values, see the STGM enumeration values. Whatever other modes you may choose, you must at least specify STGM_SHARE_EXCLUSIVE when calling this method.
snbExclude [in] Must be NULL. A non-NULL value will return STG_E_INVALIDPARAMETER.
reserved [in] Reserved for future use; must be 0 (zero).

© 1999 Microsoft Corporation. All rights reserved. Terms of use.