[DllImport("setupapi.dll", SetLastError=true)]
static extern TODO SetupDiClassGuidsFromName(TODO);
<DllImport("setupapi.dll")> _
Private Shared Function SetupDiClassGuidsFromName( _
ByVal ClassName As StringBuilder, _
ByRef ClassGuids As Guid, _
ByVal ClassGuidSize As Integer, _
ByRef ClassGuidRequiredSize As Integer) As Boolean
End Function
None.
Do you know one? Please contribute it!
I am unsure if this declaration is correct. The one problem that I found is that the function asks for an Array of GUIDs. I couldn't get that to work, but just using one did work. I found that none of the device classes had more than one GUID so I figured this to be okay. Please correct if you know better.
Please add some!
Dim ClassName As New StringBuilder("net")
Dim ClassGuid As Guid
Dim GuidSize As Integer = 0
Dim GuidReqtSize As Integer
Dim intRtrn As Integer
intRtrn = SetupDiClassGuidsFromName(ClassName, ClassGuid, GuidSize, GuidReqtSize)
GuidSize = GuidReqtSize
intRtrn = SetupDiClassGuidsFromName(ClassName, ClassGuid, GuidSize, GuidReqtSize)
MsgBox(ClassGuid.ToString)