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