git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1424 6f19259b...
[mirror_edk2.git] / EdkNt32Pkg / Library / Nt32OemHookStatusCodeLib / Nt32OemHookStatusCodeLib.c
Content-type: text/html git.proxmox.com Git - mirror_edk2.git/blame - EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c


500 - Internal Server Error

Malformed UTF-8 character (fatal) at (eval 8) line 1, <$fd> line 185.
CommitLineData
ba53dd4a 1/** @file\r
2 OEM hook status code library functions with no library constructor/destructor\r
3\r
4 Copyright (c) 2006, Intel Corporation\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13 Module Name: Nt32OemHookStatusCodeLib.c\r
14\r
15**/\r
16\r
17#include <stdio.h>\r
18\r
19//\r
20// Cache of WinNtThunk protocol \r
21// \r
22EFI_WIN_NT_THUNK_PROTOCOL *mWinNt;\r
23\r
24//\r
25// Cache of standard output handle . \r
26// \r
27HANDLE mStdOut;\r
28\r
29/**\r
30\r
31 Initialize OEM status code device .\r
32\r
be800da9 33 @return Always return EFI_SUCCESS.\r
34\r
ba53dd4a 35**/\r
be800da9 36EFI_SUCCESS\r
ba53dd4a 37EFIAPI\r
38OemHookStatusCodeInitialize (\r
39 VOID\r
40 )\r
41{\r
42 PEI_NT_THUNK_PPI *NtThunkPpi;\r
43 EFI_STATUS Status;\r
44\r
45 if (FeaturePcdGet (PcdNt32StatusCodeLibUseForPei)) {\r
46 //\r
47 // Locate NtThunkPpi for retrieving standard output handle\r
48 //\r
49 Status = PeiServicesLocatePpi (\r
50 &gPeiNtThunkPpiGuid,\r
51 0,\r
52 NULL,\r
53 (VOID **) &NtThunkPpi\r
54 );\r
55\r
56 ASSERT_EFI_ERROR (Status);\r
57\r
58 mWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *) NtThunkPpi->NtThunk ();\r
59 } else {\r
60 EFI_HOB_GUID_TYPE *GuidHob;\r
61\r
62 //\r
63 // Retrieve WinNtThunkProtocol from GUID'ed HOB\r
64 //\r
65 GuidHob = GetFirstGuidHob (&gEfiWinNtThunkProtocolGuid);\r
66 ASSERT (GuidHob != NULL);\r
67 mWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));\r
68 ASSERT (mWinNt != NULL);\r
69 }\r
70\r
71 //\r
72 // Cache standard output handle.\r
73 //\r
74 mStdOut = mWinNt->GetStdHandle (STD_OUTPUT_HANDLE);\r
75\r
be800da9 76 return EFI_SUCCESS;\r
ba53dd4a 77}\r
78\r
79/**\r
80 Report status code to OEM device.\r
81 \r
82