2 * COPYRIGHT: See COPYING.ARM in the top level directory
3 * PROJECT: ReactOS UEFI Boot Manager
4 * FILE: boot/environ/app/efiemu.c
5 * PURPOSE: UEFI Entrypoint for Boot Manager
6 * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
9 /* INCLUDES ******************************************************************/
13 /* FUNCTIONS *****************************************************************/
16 * @name EfiInitCreateInputParametersEx
18 * The EfiInitCreateInputParametersEx routine converts UEFI entrypoint
19 * parameters to the ones expected by Windows Boot Applications
22 * UEFI Image Handle for the current loaded application.
25 * Pointer to the UEFI System Table.
27 * @return A PBOOT_APPLICATION_PARAMETER_BLOCK structure containing the data
28 * from UEFI, translated to the Boot Library-compatible format.
31 PBOOT_APPLICATION_PARAMETER_BLOCK
32 EfiInitCreateInputParametersEx (
33 _In_ EFI_HANDLE ImageHandle
,
34 _In_ EFI_SYSTEM_TABLE
*SystemTable
37 DBG_UNREFERENCED_PARAMETER(ImageHandle
);
38 DBG_UNREFERENCED_PARAMETER(SystemTable
);
40 /* Not yet implemented */
47 * The EfiEntry routine implements the UEFI entrypoint for the application.
50 * UEFI Image Handle for the current loaded application.
53 * Pointer to the UEFI System Table.
55 * @return EFI_SUCCESS if the image was loaded correctly, relevant error code
61 _In_ EFI_HANDLE ImageHandle
,
62 _In_ EFI_SYSTEM_TABLE
*SystemTable
66 PBOOT_APPLICATION_PARAMETER_BLOCK BootParameters
;
68 /* Temporary debugging string */
69 SystemTable
->ConOut
->OutputString(SystemTable
->ConsoleOutHandle
, L
"Hello from EFI\n");
71 /* Convert EFI parameters to Windows Boot Application parameters */
72 BootParameters
= EfiInitCreateInputParametersEx(ImageHandle
, SystemTable
);
73 if (BootParameters
!= NULL
)
75 /* Conversion was good -- call the Boot Manager Entrypoint */
76 SystemTable
->ConOut
->OutputString(SystemTable
->ConsoleOutHandle
, L
"EFI input OK!\n");
77 Status
= BmMain(BootParameters
);
81 /* Conversion failed, bail out */
82 SystemTable
->ConOut
->OutputString(SystemTable
->ConsoleOutHandle
, L
"EFI input failed\n");
83 Status
= STATUS_INVALID_PARAMETER
;
86 /* Convert the NT status code to an EFI code */
87 return EfiGetEfiStatusCode(Status
);