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:
parent
0f4406c1ed
commit
c4e8d29e50
3 changed files with 4 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue