]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
4b1e1121 HT |
3 | Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
3eb9473e | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | WinNtLib.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Setup gWinNt global \r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #include "Efi2WinNT.h"\r | |
23 | #include "EfiWinNtLib.h"\r | |
24 | #include "EfiDriverLib.h"\r | |
25 | #include "EfiHobLib.h"\r | |
26 | #include EFI_GUID_DEFINITION (Hob)\r | |
27 | \r | |
28 | EFI_WIN_NT_THUNK_PROTOCOL *gWinNt;\r | |
29 | \r | |
30 | EFI_GUID mEfiHobListGuid = EFI_HOB_LIST_GUID;\r | |
31 | \r | |
32 | EFI_STATUS\r | |
33 | EfiInitializeWinNtDriverLib (\r | |
34 | IN EFI_HANDLE ImageHandle,\r | |
35 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
36 | )\r | |
37 | /*++\r | |
38 | \r | |
39 | Routine Description:\r | |
40 | \r | |
41 | Intialize gWinNt and initialize debug console. \r | |
42 | \r | |
43 | Arguments:\r | |
44 | \r | |
45 | (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r | |
46 | \r | |
47 | Returns: \r | |
48 | \r | |
49 | None\r | |
50 | \r | |
51 | --*/\r | |
52 | // TODO: ImageHandle - add argument and description to function comment\r | |
53 | // TODO: SystemTable - add argument and description to function comment\r | |
54 | // TODO: EFI_NOT_FOUND - add return value to function comment\r | |
55 | // TODO: EFI_NOT_FOUND - add return value to function comment\r | |
56 | // TODO: EFI_SUCCESS - add return value to function comment\r | |
57 | {\r | |
58 | EFI_STATUS Status;\r | |
59 | VOID *HobList;\r | |
60 | VOID *Pointer;\r | |
61 | \r | |
62 | Status = EfiLibGetSystemConfigurationTable (&mEfiHobListGuid, &HobList);\r | |
63 | if (EFI_ERROR (Status)) {\r | |
64 | return EFI_NOT_FOUND;\r | |
65 | }\r | |
66 | \r | |
67 | ASSERT (NULL != HobList);\r | |
68 | Status = GetNextGuidHob (&HobList, &gEfiWinNtThunkProtocolGuid, &Pointer, NULL);\r | |
69 | if (EFI_ERROR (Status)) {\r | |
70 | return EFI_NOT_FOUND;\r | |
71 | }\r | |
72 | \r | |
73 | gWinNt = (VOID *) (*(UINTN *) (Pointer));\r | |
74 | return EFI_SUCCESS;\r | |
75 | }\r |