StgOpenPropStg function
The StgOpenPropStg function opens a specified property set in a specified storage or stream object. The property set supplies the system-provided, stand-alone implementation of the IPropertyStorage interface.
Syntax
HRESULT StgOpenPropStg( _In_ IUnknown *pUnk, _In_ REFFMTID fmtid, _In_ DWORD grfFlags, _In_ DWORD dwReserved, _Out_ IPropertyStorage **ppPropStg );
Parameters
- pUnk [in]
-
The interface pointer for IUnknown interface on the storage or stream object that contains the requested property set object.
- fmtid [in]
-
The FMTID of the property set to be opened.
- grfFlags [in]
-
The values from PROPSETFLAG Constants.
- dwReserved [in]
-
Reserved for future use; must be zero.
- ppPropStg [out]
-
A pointer to an IPropertyStorage* pointer variable that receives the interface pointer to the requested property set.
Return value
This function supports the standard return values E_INVALIDARG and E_UNEXPECTED, in addition to the following:
- S_OK
-
The property set was opened.
- STG_E_FILENOTFOUND
-
A property set was not found in the specified object (pUnk).
- STG_E_ACCESSDENIED
-
The requested access to the property storage object has been denied, or the property set is corrupted.
- STG_E_INVALIDHEADER
-
The property set is corrupted.
- STG_E_INSUFFICIENTMEMORY
-
There is not enough memory to perform this operation.
- STG_E_INVALIDFLAG
-
A flag in the grfMode or grfFlags parameter was not valid.
- STG_E_INVALIDPARAMETER
-
A parameter is not valid.
Remarks
StgOpenPropStg opens the requested property set and supplies the system-provided, stand-alone implementation of the IPropertyStorage interface. The requested property set is contained in the storage or stream object specified by pUnk. The value of the grfFlags parameter indicates whether pUnk specifies a storage or stream object. For example, if PROPSETFLAG_NONSIMPLE is set, then pUnk can be queried for an IStorage interface on a storage object.
In either case, this function calls pUnk->AddRef for the storage or stream object containing the property set. The caller must release the object when no longer required.
This function is similar to the IPropertySetStorage::Open method. However, StgOpenPropStg adds the pUnk and grfFlags parameters, including the PROPSETFLAG_UNBUFFERED value for the grfFlags parameter. Use this function instead of the Open method if you have an IStorage interface that does not support the IPropertySetStorage interface, or if you want to use the PROPSETFLAG_UNBUFFERED value. For more information about using PROPSETFLAG_UNBUFFERED, see PROPSETFLAG Constants.
The grfFlags parameter is a combination of values taken from PROPSETFLAG Constants. The new enumeration value PROPSETFLAG_UNBUFFERED is supported. For more information, see PROPSETFLAG Constants.
This function is exported out of the redistributable iprop.dll, which is included in Windows NT 4.0 with Service Pack 2 (SP2) and available as a redistributable in Windows 95 and later. In Windows 2000, it is exported out of Ole32.dll. It can also be exported out of iprop.dll in Windows 2000, but the call gets forwarded to ole32.dll.
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps | Windows Store apps] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- IPropertySetStorage-Stand-alone Implementation
- IPropertyStorage-Stand-alone Implementation
- IPropertySetStorage
- IPropertyStorage
- PROPSETFLAG Constants
- StgCreatePropSetStg
- StgCreatePropStg