HidLibrary.NativeMethods.SetupDiGetDeviceProperty C# (CSharp) Метод

SetupDiGetDeviceProperty() приватный Метод

private SetupDiGetDeviceProperty ( IntPtr deviceInfo, SP_DEVINFO_DATA &deviceInfoData, DEVPROPKEY &propkey, ulong &propertyDataType, byte propertyBuffer, int propertyBufferSize, int &requiredSize, uint flags ) : bool
deviceInfo System.IntPtr
deviceInfoData SP_DEVINFO_DATA
propkey DEVPROPKEY
propertyDataType ulong
propertyBuffer byte
propertyBufferSize int
requiredSize int
flags uint
Результат bool
        public static extern bool SetupDiGetDeviceProperty(IntPtr deviceInfo, ref SP_DEVINFO_DATA deviceInfoData, ref DEVPROPKEY propkey, ref ulong propertyDataType, byte[] propertyBuffer, int propertyBufferSize, ref int requiredSize, uint flags);

Usage Example

Пример #1
0
        private static string GetBusReportedDeviceDescription(IntPtr deviceInfoSet, ref NativeMethods.SP_DEVINFO_DATA devinfoData)
        {
            var descriptionBuffer = new byte[1024];

            if (Environment.OSVersion.Version.Major > 5)
            {
                ulong propertyType = 0;
                var   requiredSize = 0;

                var _continue = NativeMethods.SetupDiGetDeviceProperty(deviceInfoSet,
                                                                       ref devinfoData,
                                                                       ref NativeMethods.DEVPKEY_Device_BusReportedDeviceDesc,
                                                                       ref propertyType,
                                                                       descriptionBuffer,
                                                                       descriptionBuffer.Length,
                                                                       ref requiredSize,
                                                                       0);

                if (_continue)
                {
                    return(descriptionBuffer.ToUTF16String());
                }
            }
            return(null);
        }
All Usage Examples Of HidLibrary.NativeMethods::SetupDiGetDeviceProperty