summaryrefslogtreecommitdiffstats
path: root/sandbox/src/win_utils.cc
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 02:13:28 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 02:13:28 +0000
commit3715e03ac3aa0ec733129d1035ee6ccc1d1828d1 (patch)
tree1475fe54b80d7c89dd4924789236b01cd68b1b66 /sandbox/src/win_utils.cc
parenta0bf3a29728220f931c45cec0a1fceab1e452ef6 (diff)
downloadchromium_src-3715e03ac3aa0ec733129d1035ee6ccc1d1828d1.zip
chromium_src-3715e03ac3aa0ec733129d1035ee6ccc1d1828d1.tar.gz
chromium_src-3715e03ac3aa0ec733129d1035ee6ccc1d1828d1.tar.bz2
Change again the way we do ResolveNTFunctionPtr
- This version is different from last two TEST=chrome should start and you can browse BUG=11789 Review URL: http://codereview.chromium.org/246026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src/win_utils.cc')
-rw-r--r--sandbox/src/win_utils.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/sandbox/src/win_utils.cc b/sandbox/src/win_utils.cc
index c20caf9..d42ec51 100644
--- a/sandbox/src/win_utils.cc
+++ b/sandbox/src/win_utils.cc
@@ -197,12 +197,16 @@ bool GetPathFromHandle(HANDLE handle, std::wstring* path) {
}; // namespace sandbox
-// TODO(cpu): Revert this change to use a map to speed up the function once
-// this has been deployed in the dev channel for a week. See bug 11789.
+// TODO(cpu): This is not the final code we want here but we are yet
+// to understand what is going on. See bug 11789.
void ResolveNTFunctionPtr(const char* name, void* ptr) {
static HMODULE ntdll = ::GetModuleHandle(sandbox::kNtdllName);
FARPROC* function_ptr = reinterpret_cast<FARPROC*>(ptr);
*function_ptr = ::GetProcAddress(ntdll, name);
- CHECK(*function_ptr) << "Failed to resolve NTDLL function";
+ if (*function_ptr)
+ return;
+ // We have data that re-trying helps.
+ *function_ptr = ::GetProcAddress(ntdll, name);
+ CHECK(*function_ptr);
}