## IKsPropertySet Interface

The IKsPropertySet interface enables you to set and retrieve device properties.

When to Implement

Implement this interface on any pin to expose its properties and to enable its properties to be changed.

When to Use

Use this interface in your application or filter to access device properties.

Methods in Vtable Order

IUnknown methods | Description
QueryInterface | Returns pointers to supported interfaces.
AddRef | Increments the reference count.
Release | Decrements the reference count.

IKsPropertySet methods | Description
Set | Sets a property identified by a property set GUID and a property ID.
Get | Retrieves a property identified by a property set GUID and a property ID.
QuerySupported | Determines whether an object supports a property set.

###

IKsPropertySet::Get

IKsPropertySet Interface

Retrieves a property identified by a property set GUID and a property ID.

HRESULT Get(
REFGUID guidPropSet,
DWORD dwPropID,
LPVOID pInstanceData,
DWORD cbInstanceData,
LPVOID pPropData,
DWORD cbPropData,
DWORD *pcbReturned
);

##### Parameters

guidPropSet
  [in] Property set GUID.
dwPropID
  [in] Identifier of the property within the property set.
pInstanceData
  [out, size_is(cbInstanceData)] Pointer to instance data for the property.
cbInstanceData
  [in] Number of bytes in the buffer to which pInstanceData points.
pPropData
  [out, size_is(cbPropData)] Pointer to the retrieved buffer, which contains the value of the property.
cbPropData
  [in] Number of bytes in the buffer to which pPropData points.
pcbReturned
  [out] Pointer to the number of bytes returned in the buffer to which pPropData points.

##### Return Values

Returns an HRESULT value that depends on the implementation of the interface.

The current DirectShow implementation returns E_PROP_SET_UNSUPPORTED if the property set is not supported or E_PROP_ID_UNSUPPORTED if the property ID is not supported for the specified property set.

##### Remarks

To retrieve a property, allocate a buffer which this method will then fill in. To determine the necessary buffer size, specify NULL for pPropData and zero (0) for cbPropData. This method returns the necessary buffer size in pcbReturned.

###

IKsPropertySet::QuerySupported

IKsPropertySet Interface

Determines whether an object supports a property set.

HRESULT QuerySupported(
REFGUID guidPropSet,
DWORD dwPropID,
DWORD *pTypeSupport
);

##### Parameters

guidPropSet
  [in] Property set GUID.
dwPropID
  [in] Identifier of the property within the property set.
pTypeSupport
  [out] Pointer to a value in which to store flags indicating the support provided by the driver. Supported flags include the following:

  Value | Meaning
  KSPROPERTY_SUPPORT_GET | You can retrieve the property by calling the IKsPropertySet::Get method.
  KSPROPERTY_SUPPORT_SET | You can change the property by calling IKsPropertySet::Set.

##### Return Values

Returns an HRESULT value that depends on the implementation of the interface.

The return values for the current DirectShow implementation include the following:

Value | Meaning
E_NOTIMPL | Property set is not supported.
E_PROP_ID_UNSUPPORTED | Property ID is not supported for the specified property set.
E_PROP_SET_UNSUPPORTED | Property set is not supported.
S_OK | Specified property set and property ID combination is supported.

###

IKsPropertySet::Set

IKsPropertySet Interface

Sets a property identified by a property set GUID and a property ID.

HRESULT Set(
REFGUID guidPropSet,
DWORD dwPropID,
LPVOID pInstanceData,
DWORD cbInstanceData,
LPVOID pPropData,
DWORD cbPropData
);

##### Parameters

guidPropSet
  [in] Property set GUID.
dwPropID
  [in] Identifier of the property within the property set.
pInstanceData
  [out, size_is(cbInstanceData)] Pointer to instance data for the property.
cbInstanceData
  [in] Number of bytes in the buffer to which pInstanceData points.
pPropData
  [out, size_is(cbPropData)] Pointer to the retrieved buffer, which contains the value of the property.
cbPropData
  [in] Number of bytes in the buffer to which pPropData points.

##### Return Values

Returns an HRESULT value that depends on the implementation of the interface.

The current DirectShow implementation returns E_PROP_SET_UNSUPPORTED if the property set is not supported or E_PROP_ID_UNSUPPORTED if the property ID is not supported for the specified property set.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.