878ddf1f |
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 | #include "WinNtThunk.h"\r |
30 | \r |
31 | //\r |
32 | // WinNtThunk Device Path Protocol Instance\r |
33 | //\r |
34 | static WIN_NT_THUNK_DEVICE_PATH mWinNtThunkDevicePath = {\r |
35 | {\r |
36 | HARDWARE_DEVICE_PATH,\r |
37 | HW_VENDOR_DP,\r |
38 | (UINT8) (sizeof (VENDOR_DEVICE_PATH)),\r |
39 | (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),\r |
40 | EFI_WIN_NT_THUNK_PROTOCOL_GUID,\r |
41 | },\r |
42 | {\r |
43 | END_DEVICE_PATH_TYPE,\r |
44 | END_ENTIRE_DEVICE_PATH_SUBTYPE,\r |
45 | END_DEVICE_PATH_LENGTH,\r |
46 | 0\r |
47 | }\r |
48 | };\r |
49 | \r |
50 | \r |
51 | EFI_STATUS\r |
52 | EFIAPI\r |
53 | InitializeWinNtThunk (\r |
54 | IN EFI_HANDLE ImageHandle,\r |
55 | IN EFI_SYSTEM_TABLE *SystemTable\r |
56 | )\r |
57 | /*++\r |
58 | \r |
59 | Routine Description:\r |
60 | Install WinNtThunk Protocol and it's associated Device Path protocol\r |
61 | \r |
62 | Arguments:\r |
63 | (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r |
64 | \r |
65 | Returns:\r |
66 | EFI_SUCEESS - WinNtThunk protocol is added or error status from \r |
67 | gBS->InstallMultiProtocolInterfaces().\r |
68 | \r |
69 | --*/\r |
70 | // TODO: ImageHandle - add argument and description to function comment\r |
71 | // TODO: SystemTable - add argument and description to function comment\r |
72 | {\r |
73 | EFI_STATUS Status;\r |
74 | EFI_HANDLE ControllerHandle;\r |
75 | \r |
76 | ControllerHandle = NULL;\r |
77 | Status = gBS->InstallMultipleProtocolInterfaces (\r |
78 | &ControllerHandle,\r |
79 | &gEfiWinNtThunkProtocolGuid,\r |
80 | gWinNt,\r |
81 | &gEfiDevicePathProtocolGuid,\r |
82 | &mWinNtThunkDevicePath,\r |
83 | NULL\r |
84 | );\r |
85 | \r |
86 | return Status;\r |
87 | }\r |