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 { |