From 91c2811559ecbc74802634a95585d54f43f45a4b Mon Sep 17 00:00:00 2001 From: emoose Date: Wed, 15 Jan 2020 00:27:29 +0000 Subject: [PATCH] [XAM/User] Only set buffer_size if it's too small CoD4 calls this with a huge 0x4000 buffer, and then if the buffer_size returned is any smaller it asserts & stops running... Need to check if this is actually how it should work, but this should help get some CoD4 running --- src/xenia/kernel/xam/xam_user.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xenia/kernel/xam/xam_user.cc b/src/xenia/kernel/xam/xam_user.cc index fbd12af5e..9d49200b2 100644 --- a/src/xenia/kernel/xam/xam_user.cc +++ b/src/xenia/kernel/xam/xam_user.cc @@ -286,7 +286,9 @@ dword_result_t XamUserReadProfileSettings( } uint32_t buffer_size = static_cast(*buffer_size_ptr); - *buffer_size_ptr = size_needed; + if (buffer_size < size_needed) { + *buffer_size_ptr = size_needed; + } if (!buffer_ptr || buffer_size < size_needed) { if (overlapped_ptr) {