summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHyper <james_peter_wong@hotmail.com>2017-01-07 02:21:22 +1300
committerSebastian Valle <subv2112@gmail.com>2017-01-06 08:21:22 -0500
commitf0199a17f6cee85bd9e88501c0961f001c396687 (patch)
tree6e5d57f4e8de2b76289d4ed7b16685a001a16982 /src
parent1c792389e677ac458696af1903812b5cdc400eab (diff)
Kernel: Fix SharedMemory objects always returning error when addr = 0 (#2404)
Closes #2400
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/svc.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 855f3af82..843d697ec 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -897,7 +897,11 @@ static ResultCode CreateMemoryBlock(Kernel::Handle* out_handle, u32 addr, u32 si
return ResultCode(ErrorDescription::InvalidCombination, ErrorModule::OS,
ErrorSummary::InvalidArgument, ErrorLevel::Usage);
- if (addr < Memory::PROCESS_IMAGE_VADDR || addr + size > Memory::SHARED_MEMORY_VADDR_END) {
+ // TODO(Subv): Processes with memory type APPLICATION are not allowed
+ // to create memory blocks with addr = 0, any attempts to do so
+ // should return error 0xD92007EA.
+ if ((addr < Memory::PROCESS_IMAGE_VADDR || addr + size > Memory::SHARED_MEMORY_VADDR_END) &&
+ addr != 0) {
return ResultCode(ErrorDescription::InvalidAddress, ErrorModule::OS,
ErrorSummary::InvalidArgument, ErrorLevel::Usage);
}