Skip to content

Commit

Permalink
Update Devcon.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
nefarius committed Aug 21, 2024
1 parent 2311a7f commit 113c685
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Devcon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@ std::expected<void, Win32Error> nefarius::devcon::InfDefaultInstall(

InstallHinfSectionW(nullptr, nullptr, pszDest, 0);

DWORD win32Error = GetLastError();

DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourDetach((void**)&real_MessageBoxW, DetourMessageBoxW); // NOLINT(clang-diagnostic-microsoft-cast)
Expand All @@ -659,7 +661,7 @@ std::expected<void, Win32Error> nefarius::devcon::InfDefaultInstall(
if (g_MbCalled)
{
g_MbCalled = FALSE;
return std::unexpected(Win32Error(ERROR_PNP_REBOOT_REQUIRED, "InstallHinfSectionW"));
return std::unexpected(Win32Error(win32Error, "InstallHinfSectionW"));
}
}

Expand Down

0 comments on commit 113c685

Please sign in to comment.