OLD | NEW |
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 bool IsProcessWow64(HANDLE process_handle) { | 52 bool IsProcessWow64(HANDLE process_handle) { |
53 static const auto is_wow64_process = | 53 static const auto is_wow64_process = |
54 GET_FUNCTION(L"kernel32.dll", ::IsWow64Process); | 54 GET_FUNCTION(L"kernel32.dll", ::IsWow64Process); |
55 if (!is_wow64_process) | 55 if (!is_wow64_process) |
56 return false; | 56 return false; |
57 BOOL is_wow64; | 57 BOOL is_wow64; |
58 if (!is_wow64_process(process_handle, &is_wow64)) { | 58 if (!is_wow64_process(process_handle, &is_wow64)) { |
59 PLOG(ERROR) << "IsWow64Process"; | 59 PLOG(ERROR) << "IsWow64Process"; |
60 return false; | 60 return false; |
61 } | 61 } |
62 return is_wow64; | 62 return !!is_wow64; |
63 } | 63 } |
64 | 64 |
65 template <class T> | 65 template <class T> |
66 bool ReadUnicodeString(HANDLE process, | 66 bool ReadUnicodeString(HANDLE process, |
67 const process_types::UNICODE_STRING<T>& us, | 67 const process_types::UNICODE_STRING<T>& us, |
68 std::wstring* result) { | 68 std::wstring* result) { |
69 if (us.Length == 0) { | 69 if (us.Length == 0) { |
70 result->clear(); | 70 result->clear(); |
71 return true; | 71 return true; |
72 } | 72 } |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 } else { | 683 } else { |
684 result.push_back(as_ranges[i]); | 684 result.push_back(as_ranges[i]); |
685 } | 685 } |
686 DCHECK(result.back().IsValid()); | 686 DCHECK(result.back().IsValid()); |
687 } | 687 } |
688 | 688 |
689 return result; | 689 return result; |
690 } | 690 } |
691 | 691 |
692 } // namespace crashpad | 692 } // namespace crashpad |
OLD | NEW |