PSCreatePropertyStoreFromObject function (propsys.h)

Accepts the IUnknown interface of an object that supports IPropertyStore or IPropertySetStorage. If the object supports IPropertySetStorage, it is wrapped so that it supports IPropertyStore.

Syntax

PSSTDAPI PSCreatePropertyStoreFromObject(
  [in]  IUnknown *punk,
  [in]  DWORD    grfMode,
  [in]  REFIID   riid,
  [out] void     **ppv
);

Parameters

[in] punk

Type: IUnknown*

A pointer to an interface that supports either IPropertyStore or IPropertySetStorage.

[in] grfMode

Type: DWORD

Specifies the access mode to use. One of these values:

STGM_READ

Open for reading.

STGM_READWRITE

Open for reading and writing.

[in] riid

Type: REFIID

Reference to the requested IID.

[out] ppv

Type: void**

When this function returns successfully, contains the address of a pointer to an interface guaranteed to support IPropertyStore.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

If the object pointed to by punk already supports IPropertyStore, no wrapper is created and the punk is returned unaltered.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2, Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 with SP1 [desktop apps only]
Target Platform Windows
Header propsys.h
Library Propsys.lib
DLL Propsys.dll (version 6.0 or later)
Redistributable Windows Desktop Search (WDS) 3.0

See also

PSCreatePropertyStoreFromPropertySetStorage