Share via


IDSFBus::GUID Property

The GUID property returns a GUID that uniquely identifies the bus simulator.

This property is read-only.

Syntax

HRESULT get_GUID(
  [out, retval]  BSTR *pbstrGuid
);

Property Value

A pointer to the caller's BSTR variable. If this property successfully returns, this variable will be set to a BSTR value that points to the GUID value that is represented as a string in registry format (for example, "{00000000-1111-2222-3333-444444444444}"). The caller must free the returned string by calling the SysFreeString OLE automation API function. For more information about SysFreeString, see the MSDN Library.

Error Codes

GUID returns S_OK if the bus GUID is returned successfully or E_POINTER if the pbstrGuid parameter is not a valid pointer.

This property can also return many standard COM return values.

Examples

The following VBScript example shows how to search for a USB 2.0 controller simulator by using its bus GUID.

const IID_IDSFBus   = "{E927C266-5364-449E-AE52-D6A782AFDA9C}"
const IID_ISoftEHCI = "{E99BC1D0-088B-4bd2-AE94-6DA3F2861FA2}"

Dim Bus : Set Bus = FindUSBBus(IID_IDSFBus)

Private Function FindUSBBus(SearchObjectGUID)
 
    Dim Bus    : Set Bus = Nothing
    Dim Dev    : Set Dev = Nothing
    Dim DSF    : Set DSF = CreateObject("DSF.DSF")

    For Each Dev in DSF.Devices
        If Dev.HasObject SearchObjectGUID) Then
            Set Bus = Dev.Object(SearchObjectGUID)
            If Not Bus Is Nothing Then
                If Bus.GUID = IID_ISoftEHCI Then
                    Exit For
                Else
                    Set Bus = Nothing
                End If
            End If
        End If
    Next

    Set FindUSBBus = Bus

End Function

Requirements

Header

DSFif.h

See Also

IDSFBus

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010