Merge pull request #2240 from ergo720/xeloadsection_bug_fix

Make XeLoadSection return status_invalid_handle when it cannot find the requested section
This commit is contained in:
ergo720 2021-06-11 13:05:37 +02:00 committed by GitHub
commit addf4b42fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}