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

Side by Side Diff: util/win/process_info_test.cc

Issue 1408123006: Tidy up to enable C4800 on Windows (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 | « util/win/process_info.cc ('k') | no next file » | 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 bool IsProcessWow64(HANDLE process_handle) { 43 bool IsProcessWow64(HANDLE process_handle) {
44 static const auto is_wow64_process = 44 static const auto is_wow64_process =
45 GET_FUNCTION(L"kernel32.dll", ::IsWow64Process); 45 GET_FUNCTION(L"kernel32.dll", ::IsWow64Process);
46 if (!is_wow64_process) 46 if (!is_wow64_process)
47 return false; 47 return false;
48 BOOL is_wow64; 48 BOOL is_wow64;
49 if (!is_wow64_process(process_handle, &is_wow64)) { 49 if (!is_wow64_process(process_handle, &is_wow64)) {
50 PLOG(ERROR) << "IsWow64Process"; 50 PLOG(ERROR) << "IsWow64Process";
51 return false; 51 return false;
52 } 52 }
53 return is_wow64; 53 return !!is_wow64;
54 } 54 }
55 55
56 void VerifyAddressInInCodePage(const ProcessInfo& process_info, 56 void VerifyAddressInInCodePage(const ProcessInfo& process_info,
57 WinVMAddress code_address) { 57 WinVMAddress code_address) {
58 // Make sure the child code address is an code page address with the right 58 // Make sure the child code address is an code page address with the right
59 // information. 59 // information.
60 const std::vector<MEMORY_BASIC_INFORMATION64>& memory_info = 60 const std::vector<MEMORY_BASIC_INFORMATION64>& memory_info =
61 process_info.MemoryInfo(); 61 process_info.MemoryInfo();
62 bool found_region = false; 62 bool found_region = false;
63 for (const auto& mi : memory_info) { 63 for (const auto& mi : memory_info) {
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 EXPECT_TRUE( 633 EXPECT_TRUE(
634 info.LoggingRangeIsFullyReadable(CheckedRange<WinVMAddress, WinVMSize>( 634 info.LoggingRangeIsFullyReadable(CheckedRange<WinVMAddress, WinVMSize>(
635 reinterpret_cast<WinVMAddress>(safe_memory.get()), kAllocationSize))); 635 reinterpret_cast<WinVMAddress>(safe_memory.get()), kAllocationSize)));
636 EXPECT_FALSE(info.LoggingRangeIsFullyReadable( 636 EXPECT_FALSE(info.LoggingRangeIsFullyReadable(
637 CheckedRange<WinVMAddress, WinVMSize>(0, 1024))); 637 CheckedRange<WinVMAddress, WinVMSize>(0, 1024)));
638 } 638 }
639 639
640 } // namespace 640 } // namespace
641 } // namespace test 641 } // namespace test
642 } // namespace crashpad 642 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/win/process_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698