+++ /dev/null
-/**@file\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
- WinNtThunk.c\r
-\r
-Abstract:\r
-\r
- Since the SEC is the only windows program in our emulation we \r
- must use a Tiano mechanism to export Win32 APIs to other modules.\r
- This is the role of the EFI_WIN_NT_THUNK_PROTOCOL.\r
-\r
- The mWinNtThunkTable exists so that a change to EFI_WIN_NT_THUNK_PROTOCOL\r
- will cause an error in initializing the array if all the member functions\r
- are not added. It looks like adding a element to end and not initializing\r
- it may cause the table to be initaliized with the members at the end being\r
- set to zero. This is bad as jumping to zero will case the NT32 to crash.\r
- \r
- All the member functions in mWinNtThunkTable are Win32\r
- API calls, so please reference Microsoft documentation. \r
-\r
-\r
- gWinNt is a a public exported global that contains the initialized\r
- data.\r
-\r
-**/\r
-\r
-#include "SecMain.h"\r
-\r
-//\r
-// This pragma is needed for all the DLL entry points to be asigned to the array.\r
-// if warning 4232 is not dissabled a warning will be generated as a DLL entry\r
-// point could be modified dynamically. The SEC does not do that, so we must\r
-// disable the warning so we can compile the SEC. The previous method was to\r
-// asign each element in code. The disadvantage to that approach is it's harder\r
-// to tell if all the elements have been initialized properly.\r
-//\r
-#pragma warning(disable : 4232)\r
-#pragma warning(disable : 4996)\r
-\r
-#if __INTEL_COMPILER\r
-#pragma warning ( disable : 144 ) \r
-#endif\r
-\r
-EFI_WIN_NT_THUNK_PROTOCOL mWinNtThunkTable = {\r
- EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE,\r
- GetProcAddress,\r
- GetTickCount,\r
- LoadLibraryEx,\r
- FreeLibrary,\r
- SetPriorityClass,\r
- SetThreadPriority,\r
- Sleep,\r
- SuspendThread,\r
- GetCurrentThread,\r
- GetCurrentThreadId,\r
- GetCurrentProcess,\r
- CreateThread,\r
- TerminateThread,\r
- SendMessage,\r
- ExitThread,\r
- ResumeThread,\r
- DuplicateHandle,\r
- InitializeCriticalSection,\r
- EnterCriticalSection,\r
- LeaveCriticalSection,\r
- DeleteCriticalSection,\r
- TlsAlloc,\r
- TlsFree,\r
- TlsSetValue,\r
- TlsGetValue,\r
- CreateSemaphore,\r
- WaitForSingleObject,\r
- ReleaseSemaphore,\r
- CreateConsoleScreenBuffer,\r
- FillConsoleOutputAttribute,\r
- FillConsoleOutputCharacter,\r
- GetConsoleCursorInfo,\r
- GetNumberOfConsoleInputEvents,\r
- PeekConsoleInput,\r
- ScrollConsoleScreenBuffer,\r
- ReadConsoleInput,\r
- SetConsoleActiveScreenBuffer,\r
- SetConsoleCursorInfo,\r
- SetConsoleCursorPosition,\r
- SetConsoleScreenBufferSize,\r
- SetConsoleTitleW,\r
- WriteConsoleInput,\r
- WriteConsoleOutput,\r
- CreateFile,\r
- DeviceIoControl,\r
- CreateDirectory,\r
- RemoveDirectory,\r
- GetFileAttributes,\r
- SetFileAttributes,\r
- CreateFileMapping,\r
- CloseHandle,\r
- DeleteFile,\r
- FindFirstFile,\r
- FindNextFile,\r
- FindClose,\r
- FlushFileBuffers,\r
- GetEnvironmentVariable,\r
- GetLastError,\r
- SetErrorMode,\r
- GetStdHandle,\r
- MapViewOfFileEx,\r
- ReadFile,\r
- SetEndOfFile,\r
- SetFilePointer,\r
- WriteFile,\r
- GetFileInformationByHandle,\r
- GetDiskFreeSpace,\r
- GetDiskFreeSpaceEx,\r
- MoveFile,\r
- SetFileTime,\r
- SystemTimeToFileTime,\r
- LocalFileTimeToFileTime,\r
- FileTimeToLocalFileTime,\r
- FileTimeToSystemTime,\r
- GetSystemTime,\r
- SetSystemTime,\r
- GetLocalTime,\r
- SetLocalTime,\r
- GetTimeZoneInformation,\r
- SetTimeZoneInformation,\r
- timeSetEvent,\r
- timeKillEvent,\r
- ClearCommError,\r
- EscapeCommFunction,\r
- GetCommModemStatus,\r
- GetCommState,\r
- SetCommState,\r
- PurgeComm,\r
- SetCommTimeouts,\r
- ExitProcess,\r
- _snwprintf,\r
- GetDesktopWindow,\r
- GetForegroundWindow,\r
- CreateWindowEx,\r
- ShowWindow,\r
- UpdateWindow,\r
- DestroyWindow,\r
- InvalidateRect,\r
- GetWindowDC,\r
- GetClientRect,\r
- AdjustWindowRect,\r
- SetDIBitsToDevice,\r
- BitBlt,\r
- GetDC,\r
- ReleaseDC,\r
- RegisterClassEx,\r
- UnregisterClass,\r
- BeginPaint,\r
- EndPaint,\r
- PostQuitMessage,\r
- DefWindowProc,\r
- LoadIcon,\r
- LoadCursor,\r
- GetStockObject,\r
- SetViewportOrgEx,\r
- SetWindowOrgEx,\r
- MoveWindow,\r
- GetWindowRect,\r
- GetMessage,\r
- TranslateMessage,\r
- DispatchMessage,\r
- GetProcessHeap,\r
- HeapAlloc,\r
- HeapFree,\r
- QueryPerformanceCounter,\r
- QueryPerformanceFrequency\r
-};\r
-\r
-#pragma warning(default : 4996)\r
-#pragma warning(default : 4232)\r
-\r
-EFI_WIN_NT_THUNK_PROTOCOL *gWinNt = &mWinNtThunkTable;\r