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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 is_64_bit_ = false; | 507 is_64_bit_ = false; |
508 } else { | 508 } else { |
509 // Otherwise, it's either 32 on 32, or 64 on 64. Use GetSystemInfo() to | 509 // Otherwise, it's either 32 on 32, or 64 on 64. Use GetSystemInfo() to |
510 // distinguish between these two cases. | 510 // distinguish between these two cases. |
511 SYSTEM_INFO system_info; | 511 SYSTEM_INFO system_info; |
512 GetSystemInfo(&system_info); | 512 GetSystemInfo(&system_info); |
513 is_64_bit_ = | 513 is_64_bit_ = |
514 system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64; | 514 system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64; |
515 } | 515 } |
516 | 516 |
517 #if ARCH_CPU_32_BITS | 517 #if defined(ARCH_CPU_32_BITS) |
518 if (is_64_bit_) { | 518 if (is_64_bit_) { |
519 LOG(ERROR) << "Reading x64 process from x86 process not supported"; | 519 LOG(ERROR) << "Reading x64 process from x86 process not supported"; |
520 return false; | 520 return false; |
521 } | 521 } |
522 #endif | 522 #endif // ARCH_CPU_32_BITS |
523 | 523 |
524 #if ARCH_CPU_64_BITS | 524 #if defined(ARCH_CPU_64_BITS) |
525 bool result = GetProcessBasicInformation<process_types::internal::Traits64>( | 525 bool result = GetProcessBasicInformation<process_types::internal::Traits64>( |
526 process, is_wow64_, this, &peb_address_, &peb_size_); | 526 process, is_wow64_, this, &peb_address_, &peb_size_); |
527 #else | 527 #else |
528 bool result = GetProcessBasicInformation<process_types::internal::Traits32>( | 528 bool result = GetProcessBasicInformation<process_types::internal::Traits32>( |
529 process, false, this, &peb_address_, &peb_size_); | 529 process, false, this, &peb_address_, &peb_size_); |
530 #endif // ARCH_CPU_64_BITS | 530 #endif // ARCH_CPU_64_BITS |
531 | 531 |
532 if (!result) { | 532 if (!result) { |
533 LOG(ERROR) << "GetProcessBasicInformation failed"; | 533 LOG(ERROR) << "GetProcessBasicInformation failed"; |
534 return false; | 534 return false; |
(...skipping 148 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 |