efi_loader: avoid using HandleProtocol in helloworld.efi

HandleProtocol() is deprecated and leaves an OpenedProtocolInformation
behind. Use OpenProtocol(GET_PROTOCOL) instead.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Heinrich Schuchardt 2023-04-04 07:17:48 +02:00
parent 5eed4a1ed7
commit ff6ce8da97

View file

@ -197,8 +197,10 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle,
print_config_tables(); print_config_tables();
/* Get the loaded image protocol */ /* Get the loaded image protocol */
ret = boottime->handle_protocol(handle, &loaded_image_guid, ret = boottime->open_protocol(handle, &loaded_image_guid,
(void **)&loaded_image); (void **)&loaded_image, NULL, NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (ret != EFI_SUCCESS) { if (ret != EFI_SUCCESS) {
con_out->output_string con_out->output_string
(con_out, u"Cannot open loaded image protocol\r\n"); (con_out, u"Cannot open loaded image protocol\r\n");
@ -219,9 +221,10 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle,
(con_out, u"Missing device handle\r\n"); (con_out, u"Missing device handle\r\n");
goto out; goto out;
} }
ret = boottime->handle_protocol(loaded_image->device_handle, ret = boottime->open_protocol(loaded_image->device_handle,
&device_path_guid, &device_path_guid,
(void **)&device_path); (void **)&device_path, NULL, NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (ret != EFI_SUCCESS) { if (ret != EFI_SUCCESS) {
con_out->output_string con_out->output_string
(con_out, u"Missing device path for device handle\r\n"); (con_out, u"Missing device path for device handle\r\n");