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 |
c84c226d |
21 | //\r |
22 | STATIC\r |
ba53dd4a |
23 | EFI_WIN_NT_THUNK_PROTOCOL *mWinNt;\r |
24 | \r |
25 | //\r |
26 | // Cache of standard output handle . \r |
c84c226d |
27 | //\r |
28 | STATIC\r |
ba53dd4a |
29 | HANDLE mStdOut;\r |
30 | \r |
31 | /**\r |
32 | \r |
33 | Initialize OEM status code device .\r |
34 | \r |
be800da9 |
35 | @return Always return EFI_SUCCESS.\r |
36 | \r |
ba53dd4a |
37 | **/\r |
c8557554 |
38 | EFI_STATUS\r |
ba53dd4a |
39 | EFIAPI\r |
40 | OemHookStatusCodeInitialize (\r |
41 | VOID\r |
42 | )\r |
43 | {\r |
44 | PEI_NT_THUNK_PPI *NtThunkPpi;\r |
45 | EFI_STATUS Status;\r |
46 | \r |
47 | if (FeaturePcdGet (PcdNt32StatusCodeLibUseForPei)) {\r |
48 | //\r |
49 | // Locate NtThunkPpi for retrieving standard output handle\r |
50 | //\r |
51 | Status = PeiServicesLocatePpi (\r |
c84c226d |
52 | &gPeiNtThunkPpiGuid,\r |
53 | 0,\r |
54 | NULL,\r |
55 | (VOID **) &NtThunkPpi\r |
56 | );\r |
ba53dd4a |
57 | \r |
58 | ASSERT_EFI_ERROR (Status);\r |
59 | \r |
60 | mWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *) NtThunkPpi->NtThunk ();\r |
61 | } else {\r |
62 | EFI_HOB_GUID_TYPE *GuidHob;\r |
63 | \r |
64 | //\r |
65 | // Retrieve WinNtThunkProtocol from GUID'ed HOB\r |
66 | //\r |
67 | GuidHob = GetFirstGuidHob (&gEfiWinNtThunkProtocolGuid);\r |
68 | ASSERT (GuidHob != NULL);\r |
69 | mWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));\r |
70 | ASSERT (mWinNt != NULL);\r |
71 | }\r |
72 | \r |
73 | //\r |
74 | // Cache standard output handle.\r |
75 | //\r |
76 | mStdOut = mWinNt->GetStdHandle (STD_OUTPUT_HANDLE);\r |
77 | \r |
be800da9 |
78 | return EFI_SUCCESS;\r |
ba53dd4a |
79 | }\r |
80 | \r |
81 | /**\r |
82 | Report status code to OEM device.\r |
83 | \r |
84 | 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 211.