Thanks I just copied it over to a new form, but I now have another question.
Given the following:
Code:
[DllImport("setupapi.dll", CharSet=CharSet.Auto, SetLastError = true)]
public static extern Boolean SetupDiEnumDeviceInterfaces(IntPtr hDevInfo, ref SP_DEVINFO_DATA devInfo,
ref Guid interfaceClassGuid, UInt32 memberIndex,
ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData);
why is:
Code:
result = SetupDiEnumDeviceInterfaces(deviceInfoSet, 0, ref tGuid, MemberIndex, ref tDevInterfaceData);
not valid. I can't seem to pass null or zero to argument 2.
the type in argument 2 is defined as:
Code:
[StructLayout(LayoutKind.Sequential)]
public struct SP_DEVINFO_DATA
{
public uint cbSize;
public Guid ClassGuid;
public uint DevInst;
public ulong Reserved;
}