Home | History | Annotate | Download | only in WinNtOemHookStatusCodeHandlerDxe
      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   This program and the accompanying materials
      7   are licensed and made available under the terms and conditions of the BSD License
      8   which accompanies this distribution.  The full text of the license may be found at
      9   http://opensource.org/licenses/bsd-license.php
     10 
     11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     13 
     14 **/
     15 
     16 //
     17 // The package level header files this module uses
     18 //
     19 #include <WinNtDxe.h>
     20 
     21 //
     22 // The protocols, PPI and GUID defintions for this module
     23 //
     24 #include <Protocol/ReportStatusCodeHandler.h>
     25 
     26 //
     27 // The Library classes this module consumes
     28 //
     29 #include <Library/DebugLib.h>
     30 #include <Library/UefiDriverEntryPoint.h>
     31 #include <Library/UefiBootServicesTableLib.h>
     32 #include <Library/OemHookStatusCodeLib.h>
     33 
     34 /**
     35   Entry point of OEM hook status code handler driver.
     36 
     37   This function is the entry point of this OEM hook status code handler driver.
     38   It initializes registers OEM status code handler.
     39 
     40   @param  ImageHandle       The firmware allocated handle for the EFI image.
     41   @param  SystemTable       A pointer to the EFI System Table.
     42 
     43   @retval EFI_SUCCESS       The entry point is executed successfully.
     44 
     45 **/
     46 EFI_STATUS
     47 EFIAPI
     48 WinNtOemHookStatusCodeHandlerDxeEntry (
     49   IN EFI_HANDLE         ImageHandle,
     50   IN EFI_SYSTEM_TABLE   *SystemTable
     51   )
     52 {
     53   EFI_STATUS                Status;
     54   EFI_RSC_HANDLER_PROTOCOL  *RscHandlerProtocol;
     55 
     56   Status = gBS->LocateProtocol (
     57                   &gEfiRscHandlerProtocolGuid,
     58                   NULL,
     59                   (VOID **) &RscHandlerProtocol
     60                   );
     61   ASSERT_EFI_ERROR (Status);
     62 
     63   OemHookStatusCodeInitialize ();
     64 
     65   RscHandlerProtocol->Register (OemHookStatusCodeReport, TPL_HIGH_LEVEL);
     66 
     67   return EFI_SUCCESS;
     68 }
     69