3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Produce WinNtThunk protocol and it's associated device path and controller
19 state protocols. WinNtThunk is to the NT emulation environment as
20 PCI_ROOT_BRIGE is to real hardware. The WinNtBusDriver is the child of this
23 Since we are a root hardware abstraction we do not install a Driver Binding
24 protocol on this handle. This driver can only support one one WinNtThunk protocol
25 in the system, since the device path is hard coded.
30 // The package level header files this module uses
35 // The protocols, PPI and GUID defintions for this module
37 #include <Protocol/WinNtThunk.h>
38 #include <Protocol/DevicePath.h>
40 // The Library classes this module consumes
42 #include <Library/UefiDriverEntryPoint.h>
43 #include <Library/WinNtLib.h>
44 #include <Library/UefiBootServicesTableLib.h>
45 #include <Library/DevicePathLib.h>
47 #include "WinNtThunk.h"
50 // WinNtThunk Device Path Protocol Instance
52 WIN_NT_THUNK_DEVICE_PATH mWinNtThunkDevicePath
= {
56 (UINT8
) (sizeof (VENDOR_DEVICE_PATH
)),
57 (UINT8
) ((sizeof (VENDOR_DEVICE_PATH
)) >> 8),
58 EFI_WIN_NT_THUNK_PROTOCOL_GUID
,
62 END_ENTIRE_DEVICE_PATH_SUBTYPE
,
63 END_DEVICE_PATH_LENGTH
,
71 InitializeWinNtThunk (
72 IN EFI_HANDLE ImageHandle
,
73 IN EFI_SYSTEM_TABLE
*SystemTable
78 Install WinNtThunk Protocol and it's associated Device Path protocol
81 (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
84 EFI_SUCEESS - WinNtThunk protocol is added or error status from
85 gBS->InstallMultiProtocolInterfaces().
88 // TODO: ImageHandle - add argument and description to function comment
89 // TODO: SystemTable - add argument and description to function comment
92 EFI_HANDLE ControllerHandle
;
94 ControllerHandle
= NULL
;
95 Status
= gBS
->InstallMultipleProtocolInterfaces (
97 &gEfiWinNtThunkProtocolGuid
,
99 &gEfiDevicePathProtocolGuid
,
100 &mWinNtThunkDevicePath
,