Ejemplo n.º 1
0
        private static DeviceInfoData[] GetDeviceInfoData(SafeDeviceInfoSetHandle handle)
        {
            List <DeviceInfoData> data = new List <DeviceInfoData>();
            DeviceInfoData        did  = new DeviceInfoData();
            int didSize = Marshal.SizeOf(did);

            did.Size = didSize;
            int index = 0;

            while (NativeMethods.SetupDiEnumDeviceInfo(handle, index, ref did))
            {
                data.Add(did);
                index += 1;
                did    = new DeviceInfoData
                {
                    Size = didSize
                };
            }
            return(data.ToArray());
        }
Ejemplo n.º 2
0
 public static extern bool SetupDiEnumDeviceInfo(SafeDeviceInfoSetHandle deviceInfoSet, int memberIndex, ref DeviceInfoData deviceInfoData);
Ejemplo n.º 3
0
 public static extern bool SetupDiSetClassInstallParams(SafeDeviceInfoSetHandle deviceInfoSet, [In()]
                                                        ref DeviceInfoData deviceInfoData, [In()]
                                                        ref PropertyChangeParameters classInstallParams, int classInstallParamsSize);
Ejemplo n.º 4
0
 public static extern bool SetupDiCallClassInstaller(DiFunction installFunction, SafeDeviceInfoSetHandle deviceInfoSet, [In()] ref DeviceInfoData deviceInfoData);