Implemented ExLoadedImageName

This commit is contained in:
Gliniak
2020-10-11 17:37:22 +02:00
committed by Rick Gibbed
parent bf8138a886
commit f6f524b814
3 changed files with 23 additions and 0 deletions

View File

@@ -316,6 +316,17 @@ void KernelState::SetExecutableModule(object_ref<UserModule> module) {
*variable_ptr = executable_module_->hmodule_ptr();
}
// Setup the kernel's ExLoadedImageName field
export_entry = processor()->export_resolver()->GetExportByOrdinal(
"xboxkrnl.exe", ordinals::ExLoadedImageName);
if (export_entry) {
char* variable_ptr =
memory()->TranslateVirtual<char*>(export_entry->variable_ptr);
xe::string_util::copy_truncating(
variable_ptr, executable_module_->path(),
xboxkrnl::XboxkrnlModule::kExLoadedImageNameSize);
}
// Spin up deferred dispatch worker.
// TODO(benvanik): move someplace more appropriate (out of ctor, but around
// here).