-
March 29th, 2009, 10:03 AM
#1
Using an API Function -> SetupDiGetClassDevs ?
Hi.
I'm using SetupDiGetClassDevs function in my App.
This is my snippet code , but it's wrong
and this Exception is occurring .
Code:
[DllImport("setupapi.dll", CharSet = CharSet.Auto)]
static extern IntPtr SetupDiGetClassDevs(
ref Guid ClassGuid,
IntPtr Enumerator,
IntPtr hwndParent,
int Flags
);
static Guid DiskGUID = new Guid("GUID_DEVINTERFACE_DISK");
static void Main(string[] args)
{
IntPtr h = SetupDiGetClassDevs(ref DiskGUID, IntPtr.Zero, IntPtr.Zero, 1);
//Console.WriteLine(h);
Console.ReadKey();
}
Would you guide me how I can use it ?
Thanks
-
March 29th, 2009, 12:28 PM
#2
Re: Using an API Function -> SetupDiGetClassDevs ?
The problem is with
Code:
static Guid DiskGUID = new Guid("GUID_DEVINTERFACE_DISK");
Find out the actual GUID and put that into the string.
Darwen.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|