public bool Send(IPortableDevice device) { device.SendCommand(0, this.values, out this.result); int error = 0; result.GetErrorValue(ref WPD.PROPERTY_COMMON_HRESULT, out error); switch ((HResult)error) { case HResult.S_OK: return(true); case HResult.E_NOT_IMPLEMENTED: Debug.WriteLine("Command not implemented!"); return(false); default: throw new Exception($"Error {error:X}"); } }