summaryrefslogtreecommitdiffstats
path: root/sandbox/src
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 14:47:24 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 14:47:24 +0000
commit00a5deb323664044ecc235a8867a1a32b237b2bd (patch)
treea4344976c11edd34110253e32b92011eb177bb72 /sandbox/src
parent831f73ee3cd2aa9ab6ba30b9d3c2819d8df8f42a (diff)
downloadchromium_src-00a5deb323664044ecc235a8867a1a32b237b2bd.zip
chromium_src-00a5deb323664044ecc235a8867a1a32b237b2bd.tar.gz
chromium_src-00a5deb323664044ecc235a8867a1a32b237b2bd.tar.bz2
Add more checks to be able to isolate why chrome cannot
do a GetProcAddress of NtCreateFile. TEST:Nothing to test BUG:11789 Review URL: http://codereview.chromium.org/113659 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16599 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src')
-rw-r--r--sandbox/src/win_utils.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/sandbox/src/win_utils.cc b/sandbox/src/win_utils.cc
index aa13bda..ace9127 100644
--- a/sandbox/src/win_utils.cc
+++ b/sandbox/src/win_utils.cc
@@ -213,5 +213,26 @@ void ResolveNTFunctionPtr(const char* name, void* ptr) {
*function_ptr = ::GetProcAddress(ntdll, name);
(*function_map)[name] = *function_ptr;
- DCHECK(*function_ptr);
+ DCHECK(*function_ptr) << "Failed to resolve NTDLL function";
+
+ if (!*function_ptr) {
+ // If we return NULL, we are going to crash. Unfortunately, this happens.
+ // See bug 11789.
+ // Maybe our module handle is not valid anymore?
+ HMODULE ntdll2 = ::GetModuleHandle(sandbox::kNtdllName);
+ *function_ptr = ::GetProcAddress(ntdll2, name);
+ (*function_map)[name] = *function_ptr;
+
+ // TODO(nsylvain): Remove this check after we are done troubleshooting.
+ CHECK(ntdll2) << "Fatal error: NTLL module is NULL";
+ CHECK(*function_ptr) << "Fatal error: Failed to resolve NTDLL function";
+
+ // If we are here, it means that getting the new module handle worked. This
+ // is not really expected. We want to receive some reports from users, so
+ // we will crash anyway.
+ // TODO(nsylvain): Remove this check after we are done troubleshooting.
+ CHECK(ntdll) << "Fatal Error: NTDLL module was NULL.";
+ CHECK(ntdll == ntdll2) << "Fatal Error: NTDLL module has been moved.";
+ CHECK(false) << "Fatal Error: GetProcAddress Inconsistency";
+ }
}