Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IMMDevice::OpenPropertyStore method

The OpenPropertyStore method retrieves an interface to the device's property store.

Syntax


HRESULT OpenPropertyStore(
  [in]   DWORD stgmAccess,
  [out]  IPropertyStore **ppProperties
);

Parameters

stgmAccess [in]

The storage-access mode. This parameter specifies whether to open the property store in read mode, write mode, or read/write mode. Set this parameter to one of the following STGM constants:

STGM_READ

STGM_WRITE

STGM_READWRITE

The method permits a client running as an administrator to open a store for read-only, write-only, or read/write access. A client that is not running as an administrator is restricted to read-only access. For more information about STGM constants, see the Windows SDK documentation.

ppProperties [out]

Pointer to a pointer variable into which the method writes the address of the IPropertyStore interface of the device's property store. Through this method, the caller obtains a counted reference to the interface. The caller is responsible for releasing the interface, when it is no longer needed, by calling the interface's Release method. If the OpenPropertyStore call fails, *ppProperties is NULL. For more information about IPropertyStore, see the Windows SDK documentation.

Return value

If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.

Return codeDescription
E_INVALIDARG

Parameter stgmAccess is not a valid access mode.

E_POINTER

Parameter ppProperties is NULL.

E_OUTOFMEMORY

Out of memory.

 

Remarks

In general, the properties in the device's property store are read-only for clients that do not perform administrative, system, or service functions.

For code examples that call the OpenPropertyStore method, see the following topics:

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Mmdeviceapi.h

See also

IMMDevice Interface

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.