Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than setupapi, prefix the name with the module name and a period.
SetupDiClassGuidsFromName (setupapi)
.
C# Signature:
[DllImport("setupapi.dll", SetLastError=true)]
static extern TODO SetupDiClassGuidsFromName(TODO);
VB Signature:
<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
User-Defined Types:
None.
Alternative Managed API:
Do you know one? Please contribute it!
Notes:
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.
Tips & Tricks:
Please add some!
Sample Code:
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)
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).