return status_invalid_handle when it cannot find the requested section

This commit is contained in:
ergo720 2021-06-11 12:17:41 +02:00
parent f1e54be515
commit c4d75368a5
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);
}