Allow BlGetXtLoaderProtocol() routine to store loader protocol in a specified variable
Alle Prüfungen waren erfolgreich
ci/woodpecker/push/build Pipeline was successful

Dieser Commit ist enthalten in:
Rafal Kupiec 2022-10-18 15:44:21 +02:00
Ursprung 96a848b498
Commit f8a120a24c
Signiert von: belliash
GPG-Schlüssel-ID: 4E829243E0CFE6B4
3 geänderte Dateien mit 13 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -18,7 +18,7 @@
* @since XT 1.0
*/
EFI_STATUS
BlGetXtLoaderProtocol()
BlGetXtLoaderProtocol(PXT_BOOT_LOADER_PROTOCOL *LdrProtocol)
{
EFI_GUID Guid = XT_BOOT_LOADER_PROTOCOL_GUID;
PEFI_HANDLE Handles = NULL;
@ -41,7 +41,7 @@ BlGetXtLoaderProtocol()
for(Index = 0; Index < Count; Index++)
{
/* Try to open protocol */
Status = EfiSystemTable->BootServices->OpenProtocol(Handles[Index], &Guid, (PVOID*)&EfiXtLdrProtocol,
Status = EfiSystemTable->BootServices->OpenProtocol(Handles[Index], &Guid, (PVOID*)LdrProtocol,
EfiImageHandle, NULL, EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL);
/* Check if successfully opened the loader protocol */
@ -57,7 +57,7 @@ BlGetXtLoaderProtocol()
EfiSystemTable->BootServices->FreePool(Handles);
/* Make sure the loaded protocol has been found */
if(EfiXtLdrProtocol == NULL)
if(*LdrProtocol == NULL)
{
/* Protocol not found */
return STATUS_EFI_NOT_FOUND;

Datei anzeigen

@ -17,6 +17,6 @@
EXTERN PXT_BOOT_LOADER_PROTOCOL EfiXtLdrProtocol;
EFI_STATUS
BlGetXtLoaderProtocol();
BlGetXtLoaderProtocol(PXT_BOOT_LOADER_PROTOCOL *LdrProtocol);
#endif /* __XTLDR_BLMOD_H */

Datei anzeigen

@ -36,14 +36,20 @@ EFI_STATUS
BlXtLoaderModuleMain(EFI_HANDLE ImageHandle,
PEFI_SYSTEM_TABLE SystemTable)
{
EFI_STATUS Status;
/* Set the system table and image handle */
EfiImageHandle = ImageHandle;
EfiSystemTable = SystemTable;
/* Open the XTLDR protocol */
BlGetXtLoaderProtocol();
Status = BlGetXtLoaderProtocol(&EfiXtLdrProtocol);
if(Status != STATUS_EFI_SUCCESS)
{
/* Failed to open loader protocol */
return STATUS_EFI_PROTOCOL_ERROR;
}
/* Print message and return success */
EfiXtLdrProtocol->EfiPrint(L"XTLDR dummy module initialized\n");
/* Return success */
return STATUS_EFI_SUCCESS;
}