UsbDkHelper: make CDriverAccess::ResetDevice return void

Return value is not needed, function
throws exception in case of error

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
This commit is contained in:
Dmitry Fleytman 2014-03-10 14:04:23 +02:00
parent 0f4406c1ed
commit c4e8d29e50
3 changed files with 4 additions and 5 deletions

View file

@ -80,7 +80,7 @@ void UsbDkDriverAccess::ReleaseDeviceList(PUSB_DK_DEVICE_ID DevicesArray)
}
//------------------------------------------------------------------------------------------------
bool UsbDkDriverAccess::ResetDevice(USB_DK_DEVICE_ID &DeviceID)
void UsbDkDriverAccess::ResetDevice(USB_DK_DEVICE_ID &DeviceID)
{
DWORD bytesReturned;
if (!DeviceIoControl(m_hDriver,
@ -94,7 +94,5 @@ bool UsbDkDriverAccess::ResetDevice(USB_DK_DEVICE_ID &DeviceID)
{
throw UsbDkDriverAccessException(TEXT("Reset device failed"));
}
return true;
}
//------------------------------------------------------------------------------------------------

View file

@ -23,7 +23,7 @@ public:
void GetDevicesList(PUSB_DK_DEVICE_ID &DevicesArray, ULONG &NumberDevice);
static void ReleaseDeviceList(PUSB_DK_DEVICE_ID DevicesArray);
bool ResetDevice(USB_DK_DEVICE_ID &DeviceID);
void ResetDevice(USB_DK_DEVICE_ID &DeviceID);
private:
HANDLE m_hDriver;

View file

@ -81,7 +81,8 @@ BOOL ResetDevice(PUSB_DK_DEVICE_ID DeviceID)
try
{
UsbDkDriverAccess driver;
return driver.ResetDevice(*DeviceID);
driver.ResetDevice(*DeviceID);
return TRUE;
}
catch (const exception &e)
{