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
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 Since the SEC is the only windows program in our emulation we
19 must use a Tiano mechanism to export Win32 APIs to other modules.
20 This is the role of the EFI_WIN_NT_THUNK_PROTOCOL.
22 The mWinNtThunkTable exists so that a change to EFI_WIN_NT_THUNK_PROTOCOL
23 will cause an error in initializing the array if all the member functions
24 are not added. It looks like adding a element to end and not initializing
25 it may cause the table to be initaliized with the members at the end being
26 set to zero. This is bad as jumping to zero will case the NT32 to crash.
28 All the member functions in mWinNtThunkTable are Win32
29 API calls, so please reference Microsoft documentation.
32 gWinNt is a a public exported global that contains the initialized
40 // This pragma is needed for all the DLL entry points to be asigned to the array.
41 // if warning 4232 is not dissabled a warning will be generated as a DLL entry
42 // point could be modified dynamically. The SEC does not do that, so we must
43 // disable the warning so we can compile the SEC. The previous method was to
44 // asign each element in code. The disadvantage to that approach is it's harder
45 // to tell if all the elements have been initailized properly.
47 #pragma warning(disable : 4232)
48 #pragma warning(disable : 4996)
51 #pragma warning ( disable : 144 )
54 EFI_WIN_NT_THUNK_PROTOCOL mWinNtThunkTable
= {
55 EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE
,
73 InitializeCriticalSection
,
76 DeleteCriticalSection
,
84 CreateConsoleScreenBuffer
,
85 FillConsoleOutputAttribute
,
86 FillConsoleOutputCharacter
,
88 GetNumberOfConsoleInputEvents
,
90 ScrollConsoleScreenBuffer
,
92 SetConsoleActiveScreenBuffer
,
94 SetConsoleCursorPosition
,
95 SetConsoleScreenBufferSize
,
112 GetEnvironmentVariable
,
121 GetFileInformationByHandle
,
126 SystemTimeToFileTime
,
127 FileTimeToLocalFileTime
,
128 FileTimeToSystemTime
,
133 GetTimeZoneInformation
,
134 SetTimeZoneInformation
,
181 #pragma warning(default : 4996)
182 #pragma warning(default : 4232)
184 EFI_WIN_NT_THUNK_PROTOCOL
*gWinNt
= &mWinNtThunkTable
;