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

Side by Side Diff: handler/win/crashy_test_program.cc

Issue 1405243002: Fix CRITICAL_SECTION test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 2 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
« no previous file with comments | « no previous file | snapshot/win/end_to_end_test.py » ('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 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 LOG(ERROR) << "SetHandler"; 110 LOG(ERROR) << "SetHandler";
111 return 1; 111 return 1;
112 } 112 }
113 if (!client.UseHandler()) { 113 if (!client.UseHandler()) {
114 LOG(ERROR) << "UseHandler"; 114 LOG(ERROR) << "UseHandler";
115 return 1; 115 return 1;
116 } 116 }
117 117
118 AllocateMemoryOfVariousProtections(); 118 AllocateMemoryOfVariousProtections();
119 119
120 CrashpadInitializeCriticalSectionEx( 120
121 &g_test_critical_section, 0, RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO); 121 DWORD cs_flags = 0;
122 EnterCriticalSection(&g_test_critical_section); 122
123 // We can only force the .DebugInfo critical section on Win 8 and later.
124 DWORD version = GetVersion();
125 DWORD major_version = LOBYTE(LOWORD(version));
126 DWORD minor_version = HIBYTE(LOWORD(version));
127 if (major_version >= 6 && minor_version >= 2)
Mark Mentovai 2015/10/16 03:36:44 This condition doesn’t seem quite right, it won’t
scottmg 2015/10/16 19:29:00 It happens to work because we're unmanifested, but
128 cs_flags = RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO;
129
130 if (CrashpadInitializeCriticalSectionEx(
131 &g_test_critical_section, 0, cs_flags)) {
132 EnterCriticalSection(&g_test_critical_section);
133 }
123 134
124 SomeCrashyFunction(); 135 SomeCrashyFunction();
125 136
126 return 0; 137 return 0;
127 } 138 }
128 139
129 } // namespace 140 } // namespace
130 } // namespace crashpad 141 } // namespace crashpad
131 142
132 int wmain(int argc, wchar_t* argv[]) { 143 int wmain(int argc, wchar_t* argv[]) {
133 return crashpad::ToolSupport::Wmain(argc, argv, crashpad::CrashyMain); 144 return crashpad::ToolSupport::Wmain(argc, argv, crashpad::CrashyMain);
134 } 145 }
OLDNEW
« no previous file with comments | « no previous file | snapshot/win/end_to_end_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698