[wdmaudiodev] Checking if a driver supports a property or not.

  • From: Lokesh Patakolusu <lokeshp@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Mon, 1 Jun 2009 07:37:44 -0400

Hi evrybody,

I am using the following code to check if the driver supports property or
not.But it failed
at the createinstance call.Pls let me know if i am doing something wrong
here .Also pls
let me know if  there is any other way to check on vista if a driver
supports
property or not.

LPCLASSFACTORY     pClassFactory        = NULL;

    LPKSPROPERTYSET    pKsPropertySet       = NULL;

      HINSTANCE          hLibDsound           = NULL;

    LPFNGETCLASSOBJECT pfnDllGetClassObject = NULL;

    typedef HRESULT (STDAPICALLTYPE *LPFNDLLGETCLASSOBJECT)(REFCLSID,
REFIID, LPVOID *);



    HRESULT            hr                   = S_OK;

      PULONG pultype;





      // Load dsound.dll

    hLibDsound = LoadLibraryW( L"dsound.dll" );



    if( hLibDsound )

    {

            // Find DllGetClassObject

        pfnDllGetClassObject = (LPFNDLLGETCLASSOBJECT)GetProcAddress(
hLibDsound, "DllGetClassObject" );



            if( pfnDllGetClassObject )

        {

            // Create a class factory object

            hr = pfnDllGetClassObject( CLSID_DirectSound, IID_IClassFactory,
(LPVOID *)&pClassFactory );



                  if( SUCCEEDED(hr) )

            {

      hr = pClassFactory->CreateInstance( NULL, IID_IKsPropertySet, (LPVOID
*)&pKsPropertySet );

               //Fails here returning E_NOINTERFACE .



      if( pKsPropertySet )

    {

            hr =
pKsPropertySet->QuerySupport(KSPROPSETID_RtAudio,KSPROPERTY_RTAUDIO_BUFFER,pultype);

      }

                  }

            }

      }
Thanks and Regards
Lokesh

Other related posts: