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); }
internal static extern bool HidD_GetAttributes(SafeFileHandle hidDeviceObject, HidAttributes attributes);