mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-20 18:05:11 -04:00
loader: Use result definitions instead of magic numbers
This commit is contained in:
parent
2678735f73
commit
db19fa0f7f
12 changed files with 96 additions and 92 deletions
|
@ -16,6 +16,7 @@
|
|||
|
||||
#pragma once
|
||||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
class MapUtils {
|
||||
public:
|
||||
|
@ -103,7 +104,7 @@ struct MappedCodeMemory {
|
|||
Result Open(Handle process_h, bool is_64_bit_address_space, u64 address, u64 size) {
|
||||
Result rc;
|
||||
if (this->IsActive()) {
|
||||
return 0x19009;
|
||||
return ResultLoaderInternalError;
|
||||
}
|
||||
|
||||
this->process_handle = process_h;
|
||||
|
@ -119,7 +120,7 @@ struct MappedCodeMemory {
|
|||
Result OpenAtAddress(Handle process_h, u64 address, u64 size, u64 target_code_memory_address) {
|
||||
Result rc;
|
||||
if (this->IsActive()) {
|
||||
return 0x19009;
|
||||
return ResultLoaderInternalError;
|
||||
}
|
||||
this->process_handle = process_h;
|
||||
this->base_address = address;
|
||||
|
@ -137,7 +138,7 @@ struct MappedCodeMemory {
|
|||
Result rc;
|
||||
u64 try_address;
|
||||
if (this->IsMapped()) {
|
||||
return 0x19009;
|
||||
return ResultLoaderInternalError;
|
||||
}
|
||||
if (R_FAILED(rc = MapUtils::LocateSpaceForMap(&try_address, size))) {
|
||||
return rc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue