3 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
12 Since the SEC is the only windows program in our emulation we
13 must use a Tiano mechanism to export Win32 APIs to other modules.
14 This is the role of the EFI_WIN_NT_THUNK_PROTOCOL.
16 The mWinNtThunkTable exists so that a change to EFI_WIN_NT_THUNK_PROTOCOL
17 will cause an error in initializing the array if all the member functions
18 are not added. It looks like adding a element to end and not initializing
19 it may cause the table to be initaliized with the members at the end being
20 set to zero. This is bad as jumping to zero will case the NT32 to crash.
22 All the member functions in mWinNtThunkTable are Win32
23 API calls, so please reference Microsoft documentation.
26 gWinNt is a a public exported global that contains the initialized
34 // This pragma is needed for all the DLL entry points to be asigned to the array.
35 // if warning 4232 is not dissabled a warning will be generated as a DLL entry
36 // point could be modified dynamically. The SEC does not do that, so we must
37 // disable the warning so we can compile the SEC. The previous method was to
38 // asign each element in code. The disadvantage to that approach is it's harder
39 // to tell if all the elements have been initialized properly.
41 #pragma warning(disable : 4232)
42 #pragma warning(disable : 4996)
45 #pragma warning ( disable : 144 )
48 EFI_WIN_NT_THUNK_PROTOCOL mWinNtThunkTable
= {
49 EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE
,
67 InitializeCriticalSection
,
70 DeleteCriticalSection
,
78 CreateConsoleScreenBuffer
,
79 FillConsoleOutputAttribute
,
80 FillConsoleOutputCharacter
,
82 GetNumberOfConsoleInputEvents
,
84 ScrollConsoleScreenBuffer
,
86 SetConsoleActiveScreenBuffer
,
88 SetConsoleCursorPosition
,
89 SetConsoleScreenBufferSize
,
106 GetEnvironmentVariable
,
115 GetFileInformationByHandle
,
120 SystemTimeToFileTime
,
121 LocalFileTimeToFileTime
,
122 FileTimeToLocalFileTime
,
123 FileTimeToSystemTime
,
128 GetTimeZoneInformation
,
129 SetTimeZoneInformation
,
174 QueryPerformanceCounter
,
175 QueryPerformanceFrequency
178 #pragma warning(default : 4996)
179 #pragma warning(default : 4232)
181 EFI_WIN_NT_THUNK_PROTOCOL
*gWinNt
= &mWinNtThunkTable
;