mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcMiscLib: Align LoadedImage with Shell behaviour for no arguments
This commit is contained in:
parent
d3be085e0f
commit
ccedcdc672
@ -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) || LoadedImage->LoadOptions == NULL) {
|
||||
return EFI_NOT_FOUND;
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_WARN, "OCM: LoadedImage cannot be located - %r\n", Status));
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status) || LoadedImage->LoadOptions == NULL) {
|
||||
*Argc = 1;
|
||||
*Argv = StArgv;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
STATIC CHAR16 *StArgv[2] = { L"Self", NULL };
|
||||
StArgv[1] = LoadedImage->LoadOptions;
|
||||
*Argc = ARRAY_SIZE (StArgv);
|
||||
*Argv = StArgv;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user