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

Unified Diff: sandbox/win/src/process_thread_interception.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 | « chrome/browser/password_manager/password_manager_util_win.cc ('k') | sandbox/win/src/restricted_token.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/process_thread_interception.cc
diff --git a/sandbox/win/src/process_thread_interception.cc b/sandbox/win/src/process_thread_interception.cc
index e6c8c2e9180c91b96164791b67de1081998b2be4..2d459b6786ac646919bad9087387db84eb540cc0 100644
--- a/sandbox/win/src/process_thread_interception.cc
+++ b/sandbox/win/src/process_thread_interception.cc
@@ -279,6 +279,8 @@ BOOL WINAPI TargetCreateProcessW(CreateProcessWFunction orig_CreateProcessW,
if (!SandboxFactory::GetTargetServices()->GetState()->InitCalled())
return FALSE;
+ // Don't call GetLastError before InitCalled() succeeds because kernel32 may
+ // not be mapped yet.
DWORD original_error = ::GetLastError();
do {
@@ -338,6 +340,8 @@ BOOL WINAPI TargetCreateProcessA(CreateProcessAFunction orig_CreateProcessA,
if (!SandboxFactory::GetTargetServices()->GetState()->InitCalled())
return FALSE;
+ // Don't call GetLastError before InitCalled() succeeds because kernel32 may
+ // not be mapped yet.
DWORD original_error = ::GetLastError();
do {
« no previous file with comments | « chrome/browser/password_manager/password_manager_util_win.cc ('k') | sandbox/win/src/restricted_token.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698