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 |
ba53dd4a |
17 | //\r |
18 | // Cache of WinNtThunk protocol \r |
c84c226d |
19 | //\r |
20 | STATIC\r |
ba53dd4a |
21 | EFI_WIN_NT_THUNK_PROTOCOL *mWinNt;\r |
22 | \r |
23 | //\r |
24 | // Cache of standard output handle . \r |
c84c226d |
25 | //\r |
26 | STATIC\r |
ba53dd4a |
27 | HANDLE 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 |
c8557554 |
36 | EFI_STATUS\r |
ba53dd4a |
37 | EFIAPI\r |
38 | OemHookStatusCodeInitialize (\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 |
c84c226d |
50 | &gPeiNtThunkPpiGuid,\r |
51 | 0,\r |
52 | NULL,\r |
53 | (VOID **) &NtThunkPpi\r |
54 | );\r |
ba53dd4a |
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 | 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 6) line 1, <$fd> line 207.