From c4d75368a5ae92d91fbdabdc8e673ce169b681ed Mon Sep 17 00:00:00 2001 From: ergo720 <45463469+ergo720@users.noreply.github.com> Date: Fri, 11 Jun 2021 12:17:41 +0200 Subject: [PATCH] return status_invalid_handle when it cannot find the requested section --- src/core/kernel/exports/EmuKrnlXe.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/kernel/exports/EmuKrnlXe.cpp b/src/core/kernel/exports/EmuKrnlXe.cpp index 6f60c6d9e..978660fe0 100644 --- a/src/core/kernel/exports/EmuKrnlXe.cpp +++ b/src/core/kernel/exports/EmuKrnlXe.cpp @@ -64,7 +64,7 @@ XBSYSAPI EXPORTNUM(327) xbox::ntstatus_xt NTAPI xbox::XeLoadSection LOG_FUNC_ARG(Section) LOG_FUNC_END; - NTSTATUS ret = xbox::status_success; + NTSTATUS ret = status_success; void* sectionData = CxbxKrnl_Xbe->FindSection(Section); if (sectionData != nullptr) { @@ -97,6 +97,9 @@ XBSYSAPI EXPORTNUM(327) xbox::ntstatus_xt NTAPI xbox::XeLoadSection // Increment the reference count Section->SectionReferenceCount++; } + else { + ret = status_invalid_handle; + } RETURN(ret); }