# HG changeset patch # User taiki # Date 1396009799 -32400 # Node ID b4db4b6c8d00e9620ecaa46fdc7f0f3cb36ed51c # Parent 7047eac9c44e46b131a29046d75e7bbbed3033fc can open protocol and close protocol diff -r 7047eac9c44e -r b4db4b6c8d00 bootx64.c --- 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; }