提交 ccedcdc6 编写于 作者: M Marvin Häuser

OcMiscLib: Align LoadedImage with Shell behaviour for no arguments

上级 d3be085e
......@@ -55,6 +55,7 @@ OpenCore Changelog
- Improved OpenCanopy pointer acceleration
- Added more precise control on `AppleEvent` protocol properties and features
- Added dynamic keyboard protocol installation on CrScreenshotDxe
- Support starting UEFI tools with argument support (e.g. `ControlMsrE2`) without arguments from picker
#### v0.6.7
- Fixed ocvalidate return code to be non-zero when issues are found
......
......@@ -27,6 +27,8 @@ GetArguments (
OUT CHAR16 ***Argv
)
{
STATIC CHAR16 *StArgv[2] = { L"Self", NULL };
EFI_STATUS Status;
EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters;
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
......@@ -47,11 +49,17 @@ GetArguments (
&gEfiLoadedImageProtocolGuid,
(VOID **) &LoadedImage
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_WARN, "OCM: LoadedImage cannot be located - %r\n", Status));
}
if (EFI_ERROR (Status) || LoadedImage->LoadOptions == NULL) {
return EFI_NOT_FOUND;
*Argc = 1;
*Argv = StArgv;
return EFI_SUCCESS;
}
STATIC CHAR16 *StArgv[2] = { L"Self", NULL };
StArgv[1] = LoadedImage->LoadOptions;
*Argc = ARRAY_SIZE (StArgv);
*Argv = StArgv;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册