コード例 #1
0
        public HidAttributes GetAttributes(SafeFileHandle handle)
        {
            if (handle == null)
            {
                throw new ArgumentNullException($"{nameof(handle)} is null");
            }

            var deviceAttributes = new HidAttributes();
            var result           = NativeMethods.HidD_GetAttributes(handle, deviceAttributes);

            if (!result)
            {
                throw new GetHidAttributesException($"Could not get attribute by this {nameof(handle)}: {handle}");
            }

            return(deviceAttributes);
        }
コード例 #2
0
 internal static extern bool HidD_GetAttributes(SafeFileHandle hidDeviceObject, HidAttributes attributes);