yuzu/src/core/hle/kernel
Lioncash d8deb39b83 svc: Handle memory writing explicitly within QueryProcessMemory
Moves the memory writes directly into QueryProcessMemory instead of
letting the wrapper function do it. It would be inaccurate to allow the
handler to do it because there's cases where memory shouldn't even be
written to. For example, if the given process handle is invalid.

HOWEVER, if the memory writing is within the wrapper, then we have no
control over if these memory writes occur, meaning in an error case, 68
bytes of memory randomly get trashed with zeroes, 64 of those being
written to wherever the memory info address points to, and the remaining
4 being written wherever the page info address points to.

One solution in this case would be to just conditionally check within
the handler itself, but this is kind of smelly, given the handler
shouldn't be performing conditional behavior itself, it's a behavior of
the managed function. In other words, if you remove the handler from the
equation entirely, does the function still retain its proper behavior?
In this case, no.

Now, we don't potentially trash memory from this function if an invalid
query is performed.
2018-12-12 15:43:31 -05:00
..
address_arbiter.cpp core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrs 2018-10-15 14:15:56 -04:00
address_arbiter.h kernel: Remove unnecessary includes 2018-07-31 10:15:17 -04:00
client_port.cpp Added forward define for ServerPort 2018-10-06 17:47:33 +10:00
client_port.h Added forward define for ServerPort 2018-10-06 17:47:33 +10:00
client_session.cpp kernel: Eliminate kernel global state 2018-08-28 22:31:51 -04:00
client_session.h kernel: Eliminate kernel global state 2018-08-28 22:31:51 -04:00
errors.h kernel/errors: Clean up error codes 2018-11-16 14:32:30 -05:00
handle_table.cpp kernel/handle_table: Amend reference to CTR-OS in Create() 2018-12-04 01:50:44 -05:00
handle_table.h kernel/svc: Implement the resource limit svcGetInfo option 2018-12-04 01:50:30 -05:00
hle_ipc.cpp hle_ipc: Refactor SleepClientThread to avoid ReadableEvent 2018-11-29 09:14:20 -05:00
hle_ipc.h hle_ipc: Refactor SleepClientThread to avoid ReadableEvent 2018-11-29 09:14:20 -05:00
kernel.cpp hle_ipc: Refactor SleepClientThread to avoid ReadableEvent 2018-11-29 09:14:20 -05:00
kernel.h kernel/event: Reference ReadableEvent from WritableEvent 2018-11-29 08:48:40 -05:00
mutex.cpp general: Remove unused boost inclusions where applicable 2018-10-30 00:09:46 -04:00
mutex.h kernel: Eliminate kernel global state 2018-08-28 22:31:51 -04:00
object.cpp kernel/process: Make Process a WaitObject 2018-12-04 20:14:59 -05:00
object.h kernel/object: Amend handle types to distinguish between readable and writable events 2018-12-04 02:20:47 -05:00
process.cpp vm_manager: Amend MemoryState enum members 2018-12-12 14:03:50 -05:00
process.h vm_manager: Amend MemoryState enum members 2018-12-12 14:03:50 -05:00
readable_event.cpp kernel/readable_event: Add member function for enforcing a strict reset contract 2018-12-04 20:14:55 -05:00
readable_event.h kernel/readable_event: Add member function for enforcing a strict reset contract 2018-12-04 20:14:55 -05:00
resource_limit.cpp kernel/resource_limit: Clean up interface 2018-11-19 18:16:39 -05:00
resource_limit.h svc: Implement svcGetResourceLimitLimitValue() 2018-11-26 21:12:13 -05:00
scheduler.cpp svc: Implement svcGetInfo command 0xF0000002 2018-10-26 12:49:11 -04:00
scheduler.h svc: Implement svcGetInfo command 0xF0000002 2018-10-26 12:49:11 -04:00
server_port.cpp kernel/server_port: Simplify emptiness check within ShouldWait() 2018-10-24 14:24:36 -04:00
server_port.h Ported #4296 from citra 2018-10-06 16:49:01 +10:00
server_session.cpp hle_ipc: Add member function for querying the existence of a domain header 2018-10-29 23:28:04 -04:00
server_session.h kernel: Eliminate kernel global state 2018-08-28 22:31:51 -04:00
session.cpp Format: Run the new clang format on everything 2018-01-20 16:45:11 -07:00
session.h kernel: Move object class to its own source files 2018-08-01 23:34:42 -04:00
shared_memory.cpp vm_manager: Make vma_map private 2018-12-06 15:02:17 -05:00
shared_memory.h kernel/shared_memory: Make Map() and Unmap() take the target process by reference rather than as a pointer 2018-11-19 09:20:29 -05:00
svc.cpp svc: Handle memory writing explicitly within QueryProcessMemory 2018-12-12 15:43:31 -05:00
svc.h vm_manager: Migrate MemoryInfo and PageInfo to vm_manager.h 2018-12-12 14:03:53 -05:00
svc_wrap.h svc: Handle memory writing explicitly within QueryProcessMemory 2018-12-12 15:43:31 -05:00
thread.cpp kernel/thread: Deduplicate scheduler switching code 2018-11-14 00:02:42 -05:00
thread.h kernel/thread: Deduplicate scheduler switching code 2018-11-14 00:02:42 -05:00
timer.cpp kernel: Eliminate kernel global state 2018-08-28 22:31:51 -04:00
timer.h kernel: Eliminate kernel global state 2018-08-28 22:31:51 -04:00
vm_manager.cpp vm_manager: Amend the returned values for invalid memory queries in QueryMemory() 2018-12-12 15:08:06 -05:00
vm_manager.h vm_manager: Correct ordering of last two struct members of MemoryInfo 2018-12-12 15:43:31 -05:00
wait_object.cpp kernel/thread: Make all instance variables private 2018-10-04 00:14:15 -04:00
wait_object.h kernel/object: Remove unnecessary std::move from DynamicObjectCast() 2018-09-28 02:17:57 -04:00
writable_event.cpp hle_ipc: Refactor SleepClientThread to avoid ReadableEvent 2018-11-29 09:14:20 -05:00
writable_event.h kernel/object: Amend handle types to distinguish between readable and writable events 2018-12-04 02:20:47 -05:00