Mercurial > hg > Members > taiki > EFITest
changeset 8:b4db4b6c8d00
can open protocol and close protocol
author | taiki |
---|---|
date | Fri, 28 Mar 2014 21:29:59 +0900 |
parents | 7047eac9c44e |
children | d6a8d676a1ac |
files | bootx64.c |
diffstat | 1 files changed, 36 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/bootx64.c Wed Mar 26 22:15:52 2014 +0900 +++ b/bootx64.c Fri Mar 28 21:29:59 2014 +0900 @@ -6,9 +6,44 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *systab) { + EFI_LOADED_IMAGE *loadedImage; + InitializeLib(image, systab); - Print(L"Test start.\n"); + uefi_call_wrapper(systab->ConOut->Reset, 2, systab->ConOut, FALSE); + + Print(L"---- start ----\n"); + + EFI_STATUS status; + + Print(L"Open Protocol\n"); + status = uefi_call_wrapper( + BS->OpenProtocol, + 6, + image, + &LoadedImageProtocol, + (void **)&loadedImage, + image, + NULL, + EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL); + + if (EFI_ERROR(status)) { + Print(L"OpenProtocol is %r\n", status); + } + + Print(L"Close Protocol\n"); + status = uefi_call_wrapper( + BS->CloseProtocol, + 4, + image, + &LoadedImageProtocol, + image, + NULL); + + if (EFI_ERROR(status)) { + Print(L"CloseProtocol is %r\n", status); + } + return EFI_SUCCESS; }