Skip to content

Commit

Permalink
DevicesHandler::toggleNic(): remove variable by calling GetLastError(…
Browse files Browse the repository at this point in the history
…) directly

The value returned by GetLastError() was only used one time, there is no need to store it in a variable.
  • Loading branch information
davidebeatrici committed Oct 12, 2019
1 parent e790387 commit 867a989
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions DevicesHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ bool DevicesHandler::toggleNic(const unsigned long &index, const Action &action)
}

if (!SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, handle, &deviceInfoData)) {
const DWORD err = GetLastError();

std::cout << "DevicesHandler::toggleNic(): SetupDiCallClassInstaller() failed with error: " << err << std::endl;
std::cout << "DevicesHandler::toggleNic(): SetupDiCallClassInstaller() failed with error: " << GetLastError() << std::endl;

// Clear parameters, otherwise the device remains in an inconsistent state (e.g. with the enabled icon even if disabled).
SetupDiSetClassInstallParams(handle, &deviceInfoData, nullptr, 0);
Expand Down

0 comments on commit 867a989

Please sign in to comment.