]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/WinNtThunkDxe/WinNtThunk.c
b803e41d5a00da2646329635cc1df43e8881938d
[mirror_edk2.git] / Nt32Pkg / WinNtThunkDxe / WinNtThunk.c
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. 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
8
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.
11
12 Module Name:
13
14 WinNtThunk.c
15
16 Abstract:
17
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
21 driver.
22
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.
26
27 --*/
28
29 //
30 // Include common header file for this module.
31 //
32 #include "CommonHeader.h"
33
34 #include "WinNtThunk.h"
35
36 //
37 // WinNtThunk Device Path Protocol Instance
38 //
39 static WIN_NT_THUNK_DEVICE_PATH mWinNtThunkDevicePath = {
40 {
41 HARDWARE_DEVICE_PATH,
42 HW_VENDOR_DP,
43 (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
44 (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8),
45 EFI_WIN_NT_THUNK_PROTOCOL_GUID,
46 },
47 {
48 END_DEVICE_PATH_TYPE,
49 END_ENTIRE_DEVICE_PATH_SUBTYPE,
50 END_DEVICE_PATH_LENGTH,
51 0
52 }
53 };
54
55
56 EFI_STATUS
57 EFIAPI
58 InitializeWinNtThunk (
59 IN EFI_HANDLE ImageHandle,
60 IN EFI_SYSTEM_TABLE *SystemTable
61 )
62 /*++
63
64 Routine Description:
65 Install WinNtThunk Protocol and it's associated Device Path protocol
66
67 Arguments:
68 (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
69
70 Returns:
71 EFI_SUCEESS - WinNtThunk protocol is added or error status from
72 gBS->InstallMultiProtocolInterfaces().
73
74 --*/
75 // TODO: ImageHandle - add argument and description to function comment
76 // TODO: SystemTable - add argument and description to function comment
77 {
78 EFI_STATUS Status;
79 EFI_HANDLE ControllerHandle;
80
81 ControllerHandle = NULL;
82 Status = gBS->InstallMultipleProtocolInterfaces (
83 &ControllerHandle,
84 &gEfiWinNtThunkProtocolGuid,
85 gWinNt,
86 &gEfiDevicePathProtocolGuid,
87 &mWinNtThunkDevicePath,
88 NULL
89 );
90
91 return Status;
92 }