Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Accessing member of deleted objects #688

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/windows/windriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ class Driver
if (err == ERROR_SERVICE_ALREADY_RUNNING) return true;

std::wcerr << "Starting MSR service failed with error " << err << " ";
const TCHAR * errorStr = _com_error(err).ErrorMessage();
const _com_error comError{ (int)err };
const TCHAR * errorStr = comError.ErrorMessage();
if (errorStr)
std::wcerr << errorStr << "\n";

Expand All @@ -120,7 +121,8 @@ class Driver
else
{
std::wcerr << "Opening service manager failed with error " << GetLastError() << " ";
const TCHAR * errorStr = _com_error(GetLastError()).ErrorMessage();
const _com_error comError{ (int)GetLastError() };
const TCHAR * errorStr = comError.ErrorMessage();
if (errorStr)
std::wcerr << errorStr << "\n";
}
Expand All @@ -130,7 +132,8 @@ class Driver
else
{
std::wcerr << "Opening service manager failed with error " << GetLastError() << " ";
const TCHAR * errorStr = _com_error(GetLastError()).ErrorMessage();
const _com_error comError{ (int)GetLastError() };
const TCHAR * errorStr = comError.ErrorMessage();
if (errorStr)
std::wcerr << errorStr << "\n";
}
Expand Down Expand Up @@ -169,7 +172,8 @@ class Driver
else
{
std::wcerr << "Opening service manager failed with error " << GetLastError() << " ";
const TCHAR * errorStr = _com_error(GetLastError()).ErrorMessage();
const _com_error comError{ (int)GetLastError() };
const TCHAR * errorStr = comError.ErrorMessage();
if (errorStr)
std::wcerr << errorStr;
}
Expand Down Expand Up @@ -197,7 +201,8 @@ class Driver
else
{
std::wcerr << "Opening service manager failed with error " << GetLastError() << " ";
const TCHAR * errorStr = _com_error(GetLastError()).ErrorMessage();
const _com_error comError{ (int)GetLastError() };
const TCHAR * errorStr = comError.ErrorMessage();
if (errorStr)
std::wcerr << errorStr;
}
Expand Down
Loading