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

Side by Side Diff: base/process_util_win.cc

Issue 3105: Enforce Terminate on Heap Corruption in most of our executable on Windows XP ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 | « base/process_util_posix.cc ('k') | base/run_all_unittests.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #include "base/process_util.h" 5 #include "base/process_util.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <winternl.h> 8 #include <winternl.h>
9 #include <psapi.h> 9 #include <psapi.h>
10 10
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 // Don't bother with the result code. It may fails on heaps that have the 587 // Don't bother with the result code. It may fails on heaps that have the
588 // HEAP_NO_SERIALIZE flag. This is expected and not a problem at all. 588 // HEAP_NO_SERIALIZE flag. This is expected and not a problem at all.
589 heap_set(heaps[i], 589 heap_set(heaps[i],
590 HeapCompatibilityInformation, 590 HeapCompatibilityInformation,
591 &lfh_flag, 591 &lfh_flag,
592 sizeof(lfh_flag)); 592 sizeof(lfh_flag));
593 } 593 }
594 return true; 594 return true;
595 } 595 }
596 596
597 void EnableTerminationOnHeapCorruption() {
598 // Ignore the result code. Supported on XP SP3 and Vista.
599 HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
600 }
601
597 void RaiseProcessToHighPriority() { 602 void RaiseProcessToHighPriority() {
598 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); 603 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
599 } 604 }
600 605
601 } // namespace process_util 606 } // namespace process_util
OLDNEW
« no previous file with comments | « base/process_util_posix.cc ('k') | base/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698