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

Side by Side Diff: sandbox/win/src/interception.cc

Issue 10951038: Remove GetModuleHandleHelper(), which was only needed for Win2k (which we don't support). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sandbox/win/src/policy_broker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // For information about interceptions as a whole see 5 // For information about interceptions as a whole see
6 // http://dev.chromium.org/developers/design-documents/sandbox . 6 // http://dev.chromium.org/developers/design-documents/sandbox .
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "sandbox/win/src/interception.h" 10 #include "sandbox/win/src/interception.h"
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 HMODULE ntdll_base = ::GetModuleHandle(kNtdllName); 446 HMODULE ntdll_base = ::GetModuleHandle(kNtdllName);
447 if (!ntdll_base) 447 if (!ntdll_base)
448 return false; 448 return false;
449 449
450 base::win::PEImage ntdll_image(ntdll_base); 450 base::win::PEImage ntdll_image(ntdll_base);
451 451
452 // Bypass purify's interception. 452 // Bypass purify's interception.
453 wchar_t* loader_get = reinterpret_cast<wchar_t*>( 453 wchar_t* loader_get = reinterpret_cast<wchar_t*>(
454 ntdll_image.GetProcAddress("LdrGetDllHandle")); 454 ntdll_image.GetProcAddress("LdrGetDllHandle"));
455 if (loader_get) { 455 if (loader_get) {
456 if (!GetModuleHandleHelper(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | 456 if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
457 GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, 457 GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
458 loader_get, &ntdll_base)) 458 loader_get, &ntdll_base))
459 return false; 459 return false;
460 } 460 }
461 461
462 if (base::win::GetVersion() <= base::win::VERSION_VISTA) { 462 if (base::win::GetVersion() <= base::win::VERSION_VISTA) {
463 Wow64 WowHelper(child_, ntdll_base); 463 Wow64 WowHelper(child_, ntdll_base);
464 if (!WowHelper.WaitForNtdll()) 464 if (!WowHelper.WaitForNtdll())
465 return false; 465 return false;
466 } 466 }
467 467
468 char* interceptor_base = NULL; 468 char* interceptor_base = NULL;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 ::FreeLibrary(local_interceptor); 541 ::FreeLibrary(local_interceptor);
542 #endif 542 #endif
543 543
544 if (it != interceptions_.end()) 544 if (it != interceptions_.end())
545 return false; 545 return false;
546 546
547 return true; 547 return true;
548 } 548 }
549 549
550 } // namespace sandbox 550 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | sandbox/win/src/policy_broker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698