loader: Use result definitions instead of magic numbers
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user