Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1445)

Unified Diff: sandbox/win/tools/launcher/launcher.cc

Issue 1337223002: Fixes to possible GetLastError bugs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed some sandbox changes Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/win/src/restricted_token_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/tools/launcher/launcher.cc
diff --git a/sandbox/win/tools/launcher/launcher.cc b/sandbox/win/tools/launcher/launcher.cc
index 4f39822ec48f81ead9d51327948064367539db68..a037702a43ca5a7b9444fd174dfb6f62bcbb73a4 100644
--- a/sandbox/win/tools/launcher/launcher.cc
+++ b/sandbox/win/tools/launcher/launcher.cc
@@ -102,17 +102,19 @@ DWORD StartRestrictedProcessInJob(wchar_t* command_line,
{
HANDLE temp_thread = process_info.thread_handle();
if (!::SetThreadToken(&temp_thread, impersonation_token.Get())) {
+ auto last_error = ::GetLastError();
::TerminateProcess(process_info.process_handle(),
0); // exit code
- return ::GetLastError();
+ return last_error;
}
}
err_code = job.AssignProcessToJob(process_info.process_handle());
if (ERROR_SUCCESS != err_code) {
+ auto last_error = ::GetLastError();
::TerminateProcess(process_info.process_handle(),
0); // exit code
- return ::GetLastError();
+ return last_error;
}
// Start the application
« no previous file with comments | « sandbox/win/src/restricted_token_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698