]>
Commit | Line | Data |
---|---|---|
869f8e34 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
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 | WinNtThunk.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Produce WinNtThunk protocol and it's associated device path and controller \r | |
19 | state protocols. WinNtThunk is to the NT emulation environment as \r | |
20 | PCI_ROOT_BRIGE is to real hardware. The WinNtBusDriver is the child of this\r | |
21 | driver.\r | |
22 | \r | |
23 | Since we are a root hardware abstraction we do not install a Driver Binding\r | |
24 | protocol on this handle. This driver can only support one one WinNtThunk protocol\r | |
25 | in the system, since the device path is hard coded.\r | |
26 | \r | |
27 | --*/\r | |
28 | \r | |
29 | //\r | |
30 | // Include common header file for this module.\r | |
31 | //\r | |
32 | #include "CommonHeader.h"\r | |
33 | \r | |
34 | #include "WinNtThunk.h"\r | |
35 | \r | |
36 | //\r | |
37 | // WinNtThunk Device Path Protocol Instance\r | |
38 | //\r | |
39 | static WIN_NT_THUNK_DEVICE_PATH mWinNtThunkDevicePath = {\r | |
40 | {\r | |
41 | HARDWARE_DEVICE_PATH,\r | |
42 | HW_VENDOR_DP,\r | |
43 | (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r | |
44 | (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),\r | |
45 | EFI_WIN_NT_THUNK_PROTOCOL_GUID,\r | |
46 | },\r | |
47 | {\r | |
48 | END_DEVICE_PATH_TYPE,\r | |
49 | END_ENTIRE_DEVICE_PATH_SUBTYPE,\r | |
50 | END_DEVICE_PATH_LENGTH,\r | |
51 | 0\r | |
52 | }\r | |
53 | };\r | |
54 | \r | |
55 | \r | |
56 | EFI_STATUS\r | |
57 | EFIAPI\r | |
58 | InitializeWinNtThunk (\r | |
59 | IN EFI_HANDLE ImageHandle,\r | |
60 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
61 | )\r | |
62 | /*++\r | |
63 | \r | |
64 | Routine Description:\r | |
65 | Install WinNtThunk Protocol and it's associated Device Path protocol\r | |
66 | \r | |
67 | Arguments:\r | |
68 | (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r | |
69 | \r | |
70 | Returns:\r | |
71 | EFI_SUCEESS - WinNtThunk protocol is added or error status from \r | |
72 | gBS->InstallMultiProtocolInterfaces().\r | |
73 | \r | |
74 | --*/\r | |
75 | // TODO: ImageHandle - add argument and description to function comment\r | |
76 | // TODO: SystemTable - add argument and description to function comment\r | |
77 | {\r | |
78 | EFI_STATUS Status;\r | |
79 | EFI_HANDLE ControllerHandle;\r | |
80 | \r | |
81 | ControllerHandle = NULL;\r | |
82 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
83 | &ControllerHandle,\r | |
84 | &gEfiWinNtThunkProtocolGuid,\r | |
85 | gWinNt,\r | |
86 | &gEfiDevicePathProtocolGuid,\r | |
87 | &mWinNtThunkDevicePath,\r | |
88 | NULL\r | |
89 | );\r | |
90 | \r | |
91 | return Status;\r | |
92 | }\r |