]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.c
Nt32Pkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Nt32Pkg / WinNtOemHookStatusCodeHandlerDxe / WinNtOemHookStatusCodeHandlerDxe.c
1 /** @file
2 OEM hook status code handler driver which produces general handler and hook it
3 onto the DXE status code router.
4
5 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 //
11 // The package level header files this module uses
12 //
13 #include <WinNtDxe.h>
14
15 //
16 // The protocols, PPI and GUID defintions for this module
17 //
18 #include <Protocol/ReportStatusCodeHandler.h>
19
20 //
21 // The Library classes this module consumes
22 //
23 #include <Library/DebugLib.h>
24 #include <Library/UefiDriverEntryPoint.h>
25 #include <Library/UefiBootServicesTableLib.h>
26 #include <Library/OemHookStatusCodeLib.h>
27
28 /**
29 Entry point of OEM hook status code handler driver.
30
31 This function is the entry point of this OEM hook status code handler driver.
32 It initializes registers OEM status code handler.
33
34 @param ImageHandle The firmware allocated handle for the EFI image.
35 @param SystemTable A pointer to the EFI System Table.
36
37 @retval EFI_SUCCESS The entry point is executed successfully.
38
39 **/
40 EFI_STATUS
41 EFIAPI
42 WinNtOemHookStatusCodeHandlerDxeEntry (
43 IN EFI_HANDLE ImageHandle,
44 IN EFI_SYSTEM_TABLE *SystemTable
45 )
46 {
47 EFI_STATUS Status;
48 EFI_RSC_HANDLER_PROTOCOL *RscHandlerProtocol;
49
50 Status = gBS->LocateProtocol (
51 &gEfiRscHandlerProtocolGuid,
52 NULL,
53 (VOID **) &RscHandlerProtocol
54 );
55 ASSERT_EFI_ERROR (Status);
56
57 OemHookStatusCodeInitialize ();
58
59 RscHandlerProtocol->Register (OemHookStatusCodeReport, TPL_HIGH_LEVEL);
60
61 return EFI_SUCCESS;
62 }