]>
Commit | Line | Data |
---|---|---|
6ae81428 | 1 | /**@file\r |
2e19fd0f | 2 | \r |
831ff057 | 3 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r |
8f2a5f80 | 4 | This program and the accompanying materials \r |
2e19fd0f | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | WinNtThunk.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Since the SEC is the only windows program in our emulation we \r | |
19 | must use a Tiano mechanism to export Win32 APIs to other modules.\r | |
20 | This is the role of the EFI_WIN_NT_THUNK_PROTOCOL.\r | |
21 | \r | |
22 | The mWinNtThunkTable exists so that a change to EFI_WIN_NT_THUNK_PROTOCOL\r | |
23 | will cause an error in initializing the array if all the member functions\r | |
24 | are not added. It looks like adding a element to end and not initializing\r | |
25 | it may cause the table to be initaliized with the members at the end being\r | |
26 | set to zero. This is bad as jumping to zero will case the NT32 to crash.\r | |
27 | \r | |
28 | All the member functions in mWinNtThunkTable are Win32\r | |
29 | API calls, so please reference Microsoft documentation. \r | |
30 | \r | |
31 | \r | |
32 | gWinNt is a a public exported global that contains the initialized\r | |
33 | data.\r | |
34 | \r | |
6ae81428 | 35 | **/\r |
2e19fd0f | 36 | \r |
37 | #include "SecMain.h"\r | |
38 | \r | |
39 | //\r | |
40 | // This pragma is needed for all the DLL entry points to be asigned to the array.\r | |
41 | // if warning 4232 is not dissabled a warning will be generated as a DLL entry\r | |
42 | // point could be modified dynamically. The SEC does not do that, so we must\r | |
43 | // disable the warning so we can compile the SEC. The previous method was to\r | |
44 | // asign each element in code. The disadvantage to that approach is it's harder\r | |
8aa9d680 | 45 | // to tell if all the elements have been initialized properly.\r |
2e19fd0f | 46 | //\r |
47 | #pragma warning(disable : 4232)\r | |
48 | #pragma warning(disable : 4996)\r | |
49 | \r | |
0b94e319 | 50 | #if __INTEL_COMPILER\r |
51 | #pragma warning ( disable : 144 ) \r | |
52 | #endif\r | |
53 | \r | |
2e19fd0f | 54 | EFI_WIN_NT_THUNK_PROTOCOL mWinNtThunkTable = {\r |
55 | EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE,\r | |
56 | GetProcAddress,\r | |
57 | GetTickCount,\r | |
58 | LoadLibraryEx,\r | |
59 | FreeLibrary,\r | |
60 | SetPriorityClass,\r | |
61 | SetThreadPriority,\r | |
62 | Sleep,\r | |
63 | SuspendThread,\r | |
64 | GetCurrentThread,\r | |
65 | GetCurrentThreadId,\r | |
66 | GetCurrentProcess,\r | |
67 | CreateThread,\r | |
68 | TerminateThread,\r | |
69 | SendMessage,\r | |
70 | ExitThread,\r | |
71 | ResumeThread,\r | |
72 | DuplicateHandle,\r | |
73 | InitializeCriticalSection,\r | |
74 | EnterCriticalSection,\r | |
75 | LeaveCriticalSection,\r | |
76 | DeleteCriticalSection,\r | |
77 | TlsAlloc,\r | |
78 | TlsFree,\r | |
79 | TlsSetValue,\r | |
80 | TlsGetValue,\r | |
81 | CreateSemaphore,\r | |
82 | WaitForSingleObject,\r | |
83 | ReleaseSemaphore,\r | |
84 | CreateConsoleScreenBuffer,\r | |
85 | FillConsoleOutputAttribute,\r | |
86 | FillConsoleOutputCharacter,\r | |
87 | GetConsoleCursorInfo,\r | |
88 | GetNumberOfConsoleInputEvents,\r | |
89 | PeekConsoleInput,\r | |
90 | ScrollConsoleScreenBuffer,\r | |
91 | ReadConsoleInput,\r | |
92 | SetConsoleActiveScreenBuffer,\r | |
93 | SetConsoleCursorInfo,\r | |
94 | SetConsoleCursorPosition,\r | |
95 | SetConsoleScreenBufferSize,\r | |
96 | SetConsoleTitleW,\r | |
97 | WriteConsoleInput,\r | |
98 | WriteConsoleOutput,\r | |
99 | CreateFile,\r | |
100 | DeviceIoControl,\r | |
101 | CreateDirectory,\r | |
102 | RemoveDirectory,\r | |
103 | GetFileAttributes,\r | |
104 | SetFileAttributes,\r | |
105 | CreateFileMapping,\r | |
106 | CloseHandle,\r | |
107 | DeleteFile,\r | |
108 | FindFirstFile,\r | |
109 | FindNextFile,\r | |
110 | FindClose,\r | |
111 | FlushFileBuffers,\r | |
112 | GetEnvironmentVariable,\r | |
113 | GetLastError,\r | |
114 | SetErrorMode,\r | |
115 | GetStdHandle,\r | |
116 | MapViewOfFileEx,\r | |
117 | ReadFile,\r | |
118 | SetEndOfFile,\r | |
119 | SetFilePointer,\r | |
120 | WriteFile,\r | |
121 | GetFileInformationByHandle,\r | |
122 | GetDiskFreeSpace,\r | |
123 | GetDiskFreeSpaceEx,\r | |
124 | MoveFile,\r | |
125 | SetFileTime,\r | |
126 | SystemTimeToFileTime,\r | |
f515069c | 127 | LocalFileTimeToFileTime,\r |
2e19fd0f | 128 | FileTimeToLocalFileTime,\r |
129 | FileTimeToSystemTime,\r | |
130 | GetSystemTime,\r | |
131 | SetSystemTime,\r | |
132 | GetLocalTime,\r | |
133 | SetLocalTime,\r | |
134 | GetTimeZoneInformation,\r | |
135 | SetTimeZoneInformation,\r | |
136 | timeSetEvent,\r | |
137 | timeKillEvent,\r | |
138 | ClearCommError,\r | |
139 | EscapeCommFunction,\r | |
140 | GetCommModemStatus,\r | |
141 | GetCommState,\r | |
142 | SetCommState,\r | |
143 | PurgeComm,\r | |
144 | SetCommTimeouts,\r | |
145 | ExitProcess,\r | |
146 | _snwprintf,\r | |
147 | GetDesktopWindow,\r | |
148 | GetForegroundWindow,\r | |
149 | CreateWindowEx,\r | |
150 | ShowWindow,\r | |
151 | UpdateWindow,\r | |
152 | DestroyWindow,\r | |
153 | InvalidateRect,\r | |
154 | GetWindowDC,\r | |
155 | GetClientRect,\r | |
156 | AdjustWindowRect,\r | |
157 | SetDIBitsToDevice,\r | |
158 | BitBlt,\r | |
159 | GetDC,\r | |
160 | ReleaseDC,\r | |
161 | RegisterClassEx,\r | |
162 | UnregisterClass,\r | |
163 | BeginPaint,\r | |
164 | EndPaint,\r | |
165 | PostQuitMessage,\r | |
166 | DefWindowProc,\r | |
167 | LoadIcon,\r | |
168 | LoadCursor,\r | |
169 | GetStockObject,\r | |
170 | SetViewportOrgEx,\r | |
171 | SetWindowOrgEx,\r | |
172 | MoveWindow,\r | |
173 | GetWindowRect,\r | |
174 | GetMessage,\r | |
175 | TranslateMessage,\r | |
176 | DispatchMessage,\r | |
177 | GetProcessHeap,\r | |
178 | HeapAlloc,\r | |
831ff057 | 179 | HeapFree,\r |
180 | QueryPerformanceCounter,\r | |
181 | QueryPerformanceFrequency\r | |
2e19fd0f | 182 | };\r |
183 | \r | |
184 | #pragma warning(default : 4996)\r | |
185 | #pragma warning(default : 4232)\r | |
186 | \r | |
187 | EFI_WIN_NT_THUNK_PROTOCOL *gWinNt = &mWinNtThunkTable;\r |