]> git.proxmox.com Git - mirror_edk2.git/blame - Nt32Pkg/Sec/WinNtThunk.c
Update the copyright notice format
[mirror_edk2.git] / Nt32Pkg / Sec / WinNtThunk.c
CommitLineData
6ae81428 1/**@file\r
2e19fd0f 2\r
8f2a5f80
HT
3Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
2e19fd0f 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 WinNtThunk.c\r
15\r
16Abstract:\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
45// to tell if all the elements have been initailized properly.\r
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 54EFI_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
127 FileTimeToLocalFileTime,\r
128 FileTimeToSystemTime,\r
129 GetSystemTime,\r
130 SetSystemTime,\r
131 GetLocalTime,\r
132 SetLocalTime,\r
133 GetTimeZoneInformation,\r
134 SetTimeZoneInformation,\r
135 timeSetEvent,\r
136 timeKillEvent,\r
137 ClearCommError,\r
138 EscapeCommFunction,\r
139 GetCommModemStatus,\r
140 GetCommState,\r
141 SetCommState,\r
142 PurgeComm,\r
143 SetCommTimeouts,\r
144 ExitProcess,\r
145 _snwprintf,\r
146 GetDesktopWindow,\r
147 GetForegroundWindow,\r
148 CreateWindowEx,\r
149 ShowWindow,\r
150 UpdateWindow,\r
151 DestroyWindow,\r
152 InvalidateRect,\r
153 GetWindowDC,\r
154 GetClientRect,\r
155 AdjustWindowRect,\r
156 SetDIBitsToDevice,\r
157 BitBlt,\r
158 GetDC,\r
159 ReleaseDC,\r
160 RegisterClassEx,\r
161 UnregisterClass,\r
162 BeginPaint,\r
163 EndPaint,\r
164 PostQuitMessage,\r
165 DefWindowProc,\r
166 LoadIcon,\r
167 LoadCursor,\r
168 GetStockObject,\r
169 SetViewportOrgEx,\r
170 SetWindowOrgEx,\r
171 MoveWindow,\r
172 GetWindowRect,\r
173 GetMessage,\r
174 TranslateMessage,\r
175 DispatchMessage,\r
176 GetProcessHeap,\r
177 HeapAlloc,\r
178 HeapFree\r
179};\r
180\r
181#pragma warning(default : 4996)\r
182#pragma warning(default : 4232)\r
183\r
184EFI_WIN_NT_THUNK_PROTOCOL *gWinNt = &mWinNtThunkTable;\r