IDSF::ReadState Method

The ReadState method reads the stored public state of a driver.

Syntax

HRESULT ReadState(
  [in]           DSFStateType Type,
  [in]           BSTR Guid,
  [out, retval]  DSFPropertyBag **ppDSFPropertyBag
);

Parameters

  • Type [in]
    The type of state to read.

  • Guid [in]
    The GUID of the driver whose state is to be read.

  • ppDSFPropertyBag [out, retval]
    The property bag to contain the state.

Return Value

ReadState returns one of the following values:

Return code Description
S_OK

The public state was read correctly.

E_INVALIDARG

The Type parameter is not a valid DSFDefaultStateType value.

This method can also return many standard COM return values.

E_POINTER

The ppDSFPropertyBag parameter is not a valid pointer.

 

Remarks

The current release of DSF supports only DSFDefaultStateType as the state type.

Examples

The following C++ code example shows you how to read a driver's public state.

HRESULT CMyDevice::ReadSaveState(BSTR bstrGuid, IDSFPropretyBag *piDSFPropertyBag)
{
 DSFStateType Type  = DSFDefaultStateType;
      HRESULT         hr       = S_OK;

     //Read the saved state for this device
 hr = m_piDSFObject->ReadState(Type, bstrGuid, reinterpret_cast<DSFPropertyBag**>(&piDSFPropertyBag));

 return hr;
}

Requirements

Header

DSFif.h

See Also

IDSF

IDSF::WriteState

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010