IKsPropertySet Interface

 

 

' ***************************************************************************************
' IKsPropertySet Interface
' The IKsPropertySet interface allows drivers to provide extended capabilities that can be
' used without API extensions. DirectSound supports this interface for accessing
' properties of sound drivers.
' The IKsPropertySet interface is part of the WDM KS (Win32® driver model kernel streaming)
' architecture.
' Note   The declaration of this interface in Dsound.h is different from that in Ksproxy.h
' and Strmif.h. If your project includes Ksproxy.h or Strmif.h but you wish to use the
' DirectSound implementation, be sure to include Dsound.h first. Failing to do so may
' cause your application to stop responding when a method of IKsPropertySet is called.
' To retrieve this interface, call the QueryInterface method of any interface on a
' DirectSound buffer.
' ***************************************************************************************

' ***************************************************************************************
'DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
'{
'    // IUnknown methods
'  0.  STDMETHOD(QueryInterface)   (THIS_ REFIID, LPVOID *) PURE;
'  1.  STDMETHOD_(ULONG,AddRef)    (THIS) PURE;
'  2.  STDMETHOD_(ULONG,Release)   (THIS) PURE;

'    // IKsPropertySet methods
'  3.  STDMETHOD(Get)              (THIS_ REFGUID rguidPropSet, ULONG ulId, LPVOID pInstanceData, ULONG ulInstanceLength,
'                                         LPVOID pPropertyData, ULONG ulDataLength, PULONG pulBytesReturned) PURE;
'  4.  STDMETHOD(Set)              (THIS_ REFGUID rguidPropSet, ULONG ulId, LPVOID pInstanceData, ULONG ulInstanceLength,
'                                         LPVOID pPropertyData, ULONG ulDataLength) PURE;
'  5.  STDMETHOD(QuerySupport)     (THIS_ REFGUID rguidPropSet, ULONG ulId, PULONG pulTypeSupport) PURE;
'};
' ***************************************************************************************

' ***************************************************************************************
' Get
' The Get method retrieves data for an item in a property set.
' HRESULT Get(
'   REFGUID rguidPropSet,
'   ULONG ulId,
'   LPVOID pInstanceData,
'   ULONG ulInstanceLength,
'   LPVOID pPropertyData,
'   ULONG ulDataLength,
'   PULONG pulBytesReturned
' );
' ***************************************************************************************
FUNCTION IKsPropertySet_Get ALIAS "IKsPropertySet_Get" ( _
    BYVAL pthis AS DWORD PTR, BYREF rguidPropSet AS GUID, BYVAL ulId AS DWORD, _
    BYVAL pInstanceData AS DWORD, BYVAL ulInstanceLength AS DWORD, BYVAL pPropertyData AS DWORD, _
    BYVAL ulDataLength AS DWORD, BYREF pulBytesReturned AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[3] USING IKsPropertySet_Get(pthis, rguidPropSet, ulId, pInstanceData, ulInstanceLength, pPropertyData, ulDataLength, pulBytesReturned) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' Set
' The Set method sets the value of a property in a property set.
' HRESULT Set(
'   REFGUID rguidPropSet,
'   ULONG ulId,
'   LPVOID pInstanceData,
'   ULONG ulInstanceLength,
'   LPVOID pPropertyData,
'   ULONG ulDataLength
' );
' ***************************************************************************************
FUNCTION IKsPropertySet_Set ALIAS "IKsPropertySet_Set" ( _
    BYVAL pthis AS DWORD PTR, BYREF rguidPropSet AS GUID, BYVAL ulId AS DWORD, _
    BYVAL pInstanceData AS DWORD, BYVAL ulInstanceLength AS DWORD, BYVAL pPropertyData AS DWORD, _
    BYVAL ulDataLength AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[4] USING IKsPropertySet_Set(pthis, rguidPropSet, ulId, pInstanceData, ulInstanceLength, pPropertyData, ulDataLength) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************

' ***************************************************************************************
' QuerySupport
' The QuerySupport method ascertains whether a property in a property set is supported on
' the port or device.
' HRESULT QuerySupport(
'   REFGUID rguidPropSet,
'   ULONG ulId,
'   PULONG pulTypeSupport
' );
' ***************************************************************************************
FUNCTION IKsPropertySet_QuerySupport ALIAS "IKsPropertySet_QuerySupport" ( _
    BYVAL pthis AS DWORD PTR, BYREF rguidPropSet AS GUID, BYVAL ulId AS DWORD, _
    BYREF pulTypeSupport AS DWORD) EXPORT AS LONG

    LOCAL HRESULT AS LONG
    IF pthis = %NULL THEN FUNCTION = %E_POINTER : EXIT FUNCTION
    CALL DWORD @@pthis[5] USING IKsPropertySet_QuerySupport(pthis, rguidPropSet, ulId, pulTypeSupport) TO HRESULT
    FUNCTION = HRESULT

END FUNCTION
' ***************************************************************************************
 

 

Page last updated on Wednesday, 15 March 2006 01:18:52 +0100