Add the following Pcds declaration in EdkModulePkg.spd file. EdkModulePkg PeiVariable...
[mirror_edk2.git] / EdkNt32Pkg / Include / Protocol / WinNtThunk.h
1 /*++
2
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
8
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.
11
12 Module Name:
13
14 WinNtThunk.h
15
16 Abstract:
17
18 This protocol allows an EFI driver (DLL) in the NT emulation envirnment
19 to make Win32 API calls.
20
21 NEVER make a Win32 call directly, always make the call via this protocol.
22
23 There are no This pointers on the protocol member functions as they map
24 exactly into Win32 system calls.
25
26 YOU MUST include EfiWinNT.h in place of Efi.h to make this file compile.
27
28 --*/
29
30 #ifndef __WIN_NT_THUNK_H__
31 #define __WIN_NT_THUNK_H__
32
33 #define EFI_WIN_NT_THUNK_PROTOCOL_GUID \
34 { 0x58c518b1, 0x76f3, 0x11d4, { 0xbc, 0xea, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
35
36 typedef
37 WINBASEAPI
38 VOID
39 (WINAPI *WinNtSleep) (
40 DWORD Milliseconds
41 );
42
43 typedef
44 WINBASEAPI
45 DWORD
46 (WINAPI *WinNtSuspendThread) (
47 HANDLE hThread
48 );
49
50 typedef
51 WINBASEAPI
52 HANDLE
53 (WINAPI *WinNtGetCurrentThread) (
54 VOID
55 );
56
57 typedef
58 WINBASEAPI
59 DWORD
60 (WINAPI *WinNtGetCurrentThreadId) (
61 VOID
62 );
63
64 typedef
65 WINBASEAPI
66 HANDLE
67 (WINAPI *WinNtGetCurrentProcess) (
68 VOID
69 );
70
71 typedef
72 WINBASEAPI
73 HANDLE
74 (WINAPI *WinNtCreateThread) (
75 LPSECURITY_ATTRIBUTES lpThreadAttributes,
76 DWORD dwStackSize,
77 LPTHREAD_START_ROUTINE lpStartAddress,
78 LPVOID lpParameter,
79 DWORD dwCreationFlags,
80 LPDWORD lpThreadId
81 );
82
83 typedef
84 WINBASEAPI
85 BOOL
86 (WINAPI *WinNtTerminateThread) (
87 HANDLE hThread,
88 DWORD dwExitCode
89 );
90
91 typedef
92 WINBASEAPI
93 BOOL
94 (WINAPI *WinNtSendMessage) (
95 HWND hWnd,
96 UINT Msg,
97 WPARAM wParam,
98 LPARAM lParam
99 );
100
101 typedef
102 WINBASEAPI
103 VOID
104 (WINAPI *WinNtExitThread) (
105 DWORD dwExitCode
106 );
107
108 typedef
109 WINBASEAPI
110 DWORD
111 (WINAPI *WinNtResumeThread) (
112 HANDLE hThread
113 );
114
115 typedef
116 WINBASEAPI
117 BOOL
118 (WINAPI *WinNtSetThreadPriority) (
119 HANDLE hThread,
120 INTN nPriority
121 );
122
123 typedef
124 WINBASEAPI
125 VOID
126 (WINAPI *WinNtInitializeCriticalSection) (
127 LPCRITICAL_SECTION lpCriticalSection
128 );
129
130 typedef
131 WINBASEAPI
132 VOID
133 (WINAPI *WinNtDeleteCriticalSection) (
134 LPCRITICAL_SECTION lpCriticalSection
135 );
136
137 typedef
138 WINBASEAPI
139 VOID
140 (WINAPI *WinNtEnterCriticalSection) (
141 LPCRITICAL_SECTION lpCriticalSection
142 );
143
144 typedef
145 WINBASEAPI
146 VOID
147 (WINAPI *WinNtLeaveCriticalSection) (
148 LPCRITICAL_SECTION lpCriticalSection
149 );
150
151 typedef
152 WINBASEAPI
153 BOOL
154 (WINAPI *WinNtTlsAlloc) (
155 VOID
156 );
157
158 typedef
159 WINBASEAPI
160 LPVOID
161 (WINAPI *WinNtTlsGetValue) (
162 DWORD dwTlsIndex
163 );
164
165 typedef
166 WINBASEAPI
167 BOOL
168 (WINAPI *WinNtTlsSetValue) (
169 DWORD dwTlsIndex,
170 LPVOID lpTlsValue
171 );
172
173 typedef
174 WINBASEAPI
175 BOOL
176 (WINAPI *WinNtTlsFree) (
177 DWORD dwTlsIndex
178 );
179
180 typedef
181 WINBASEAPI
182 HANDLE
183 (WINAPI *WinNtCreateSemaphore) (
184 LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
185 LONG lInitialCount,
186 LONG lMaximumCount,
187 LPCWSTR lpName
188 );
189
190 typedef
191 WINBASEAPI
192 DWORD
193 (WINAPI *WinNtWaitForSingleObject) (
194 HANDLE hHandle,
195 DWORD dwMilliseconds
196 );
197
198 typedef
199 WINBASEAPI
200 BOOL
201 (WINAPI *WinNtReleaseSemaphore) (
202 HANDLE hSemaphore,
203 LONG lReleaseCount,
204 LPLONG lpPreviousCount
205 );
206
207 typedef
208 WINBASEAPI
209 BOOL
210 (WINAPI *WinNtDuplicateHandle) (
211 HANDLE hSourceProcessHandle,
212 HANDLE hSourceHandle,
213 HANDLE hTargetProcessHandle,
214 LPHANDLE lpTargetHandle,
215 DWORD dwDesiredAccess,
216 BOOL bInheritHandle,
217 DWORD dwOptions
218 );
219
220 typedef
221 WINBASEAPI
222 HANDLE
223 (WINAPI *WinNtCreateConsoleScreenBuffer) (
224 DWORD DesiredAccess,
225 DWORD ShareMode,
226 CONST SECURITY_ATTRIBUTES *SecurityAttributes,
227 DWORD Flags,
228 LPVOID ScreenBufferData
229 );
230
231 typedef
232 WINBASEAPI
233 BOOL
234 (WINAPI *WinNtSetConsoleScreenBufferSize) (
235 HANDLE ConsoleOutput,
236 COORD Size
237 );
238
239 typedef
240 WINBASEAPI
241 BOOL
242 (WINAPI *WinNtSetConsoleActiveScreenBuffer) (
243 HANDLE ConsoleOutput
244 );
245
246 typedef
247 WINBASEAPI
248 BOOL
249 (WINAPI *WinNtFillConsoleOutputAttribute) (
250 HANDLE ConsoleOutput,
251 WORD Attribute,
252 DWORD Length,
253 COORD WriteCoord,
254 LPDWORD NumberOfAttrsWritten
255 );
256
257 typedef
258 WINBASEAPI
259 BOOL
260 (WINAPI *WinNtFillConsoleOutputCharacter) (
261 HANDLE ConsoleOutput,
262 TCHAR Character,
263 DWORD Length,
264 COORD WriteCoord,
265 LPDWORD NumberOfCharsWritten
266 );
267
268 typedef
269 WINBASEAPI
270 BOOL
271 (WINAPI *WinNtWriteConsoleOutput) (
272 HANDLE ConsoleOutput,
273 CONST CHAR_INFO *Buffer,
274 COORD BufferSize,
275 COORD BufferCoord,
276 PSMALL_RECT WriteRegion
277 );
278
279 typedef
280 WINBASEAPI
281 BOOL
282 (WINAPI *WinNtScrollConsoleScreenBuffer) (
283 HANDLE ConsoleOutput,
284 CONST SMALL_RECT *ScrollRectangle,
285 CONST SMALL_RECT *ClipRectangle,
286 COORD DestinationOrigin,
287 CONST CHAR_INFO *Fill
288 );
289
290 typedef
291 WINBASEAPI
292 BOOL
293 (WINAPI *WinNtSetConsoleTitleW) (
294 LPCTSTR ConsoleTitle
295 );
296
297 typedef
298 WINBASEAPI
299 BOOL
300 (WINAPI *WinNtGetConsoleCursorInfo) (
301 HANDLE ConsoleOutput,
302 PCONSOLE_CURSOR_INFO ConsoleCursorInfo
303 );
304
305 typedef
306 WINBASEAPI
307 BOOL
308 (WINAPI *WinNtSetConsoleCursorInfo) (
309 HANDLE ConsoleOutput,
310 CONST CONSOLE_CURSOR_INFO *ConsoleCursorInfo
311 );
312
313 typedef
314 WINBASEAPI
315 BOOL
316 (WINAPI *WinNtSetPriorityClass) (
317 HANDLE Process,
318 DWORD PriorityClass
319 );
320
321 typedef
322 WINBASEAPI
323 BOOL
324 (WINAPI *WinNtWriteConsoleInput) (
325 HANDLE ConsoleInput,
326 CONST INPUT_RECORD *Buffer,
327 DWORD Legnth,
328 LPDWORD NumberOfEventsWritten
329 );
330
331 typedef
332 WINBASEAPI
333 BOOL
334 (WINAPI *WinNtGetNumberOfConsoleInputEvents) (
335 HANDLE ConsoleInput,
336 LPDWORD NumberOfEvents
337 );
338
339 typedef
340 WINBASEAPI
341 HANDLE
342 (WINAPI *WinNtGetStdHandle) (
343 DWORD StdHandle
344 );
345
346 typedef
347 WINBASEAPI
348 BOOL
349 (WINAPI *WinNtReadConsoleInput) (
350 HANDLE ConsoleInput,
351 PINPUT_RECORD Buffer,
352 DWORD Length,
353 LPDWORD NumberOfEventsRead
354 );
355
356 typedef
357 WINBASEAPI
358 BOOL
359 (WINAPI *WinNtPeekConsoleInput) (
360 HANDLE ConsoleInput,
361 PINPUT_RECORD Buffer,
362 DWORD Length,
363 LPDWORD NumberOfEventsRead
364 );
365
366 typedef
367 WINBASEAPI
368 BOOL
369 (WINAPI *WinNtSetConsoleCursorPosition) (
370 HANDLE ConsoleInput,
371 COORD CursorPosition
372 );
373
374 typedef
375 WINBASEAPI
376 HANDLE
377 (WINAPI *WinNtCreateFile) (
378 LPCWSTR FileName,
379 DWORD DesiredAccess,
380 DWORD SharedMode,
381 LPSECURITY_ATTRIBUTES SecurityAttributes,
382 DWORD CreationDisposition,
383 DWORD FlagsAndAttributes,
384 HANDLE TemplateFile
385 );
386
387 typedef
388 WINBASEAPI
389 BOOL
390 (WINAPI *WinNtDeviceIoControl) (
391 HANDLE DeviceHandle,
392 DWORD IoControlCode,
393 LPVOID InBuffer,
394 DWORD InBufferSize,
395 LPVOID OutBuffer,
396 DWORD OutBufferSize,
397 LPDWORD BytesReturned,
398 LPOVERLAPPED Overlapped
399 );
400
401 typedef
402 WINBASEAPI
403 BOOL
404 (WINAPI *WinNtCreateDirectory) (
405 LPCWSTR PathName,
406 LPSECURITY_ATTRIBUTES SecurityAttributes
407 );
408
409 typedef
410 WINBASEAPI
411 BOOL
412 (WINAPI *WinNtRemoveDirectory) (
413 LPCWSTR PathName
414 );
415
416 typedef
417 WINBASEAPI
418 DWORD
419 (WINAPI *WinNtGetFileAttributes) (
420 LPCWSTR FileName
421 );
422
423 typedef
424 WINBASEAPI
425 BOOL
426 (WINAPI *WinNtSetFileAttributes) (
427 LPCWSTR FileName,
428 DWORD FileAttributes
429 );
430
431 typedef
432 WINBASEAPI
433 HANDLE
434 (WINAPI *WinNtCreateFileMapping) (
435 HANDLE FileHandle,
436 LPSECURITY_ATTRIBUTES Attributes,
437 DWORD Protect,
438 DWORD MaximumSizeHigh,
439 DWORD MaximumSizeLow,
440 LPCTSTR Name
441 );
442
443 typedef
444 WINBASEAPI
445 LPVOID
446 (WINAPI *WinNtMapViewOfFileEx) (
447 HANDLE FileHandle,
448 DWORD DesiredAccess,
449 DWORD FileOffsetHigh,
450 DWORD FileOffsetLow,
451 DWORD NumberOfBytesToMap,
452 LPVOID BaseAddress
453 );
454
455 typedef
456 WINBASEAPI
457 DWORD
458 (WINAPI *WinNtGetEnvironmentVariable) (
459 LPCTSTR Name,
460 LPTSTR Buffer,
461 DWORD Size
462 );
463
464 typedef
465 WINBASEAPI
466 BOOL
467 (WINAPI *WinNtCloseHandle) (
468 HANDLE Object
469 );
470
471 typedef
472 WINBASEAPI
473 DWORD
474 (WINAPI *WinNtSetFilePointer) (
475 HANDLE FileHandle,
476 LONG DistanceToMove,
477 PLONG DistanceToHoveHigh,
478 DWORD MoveMethod
479 );
480
481 typedef
482 WINBASEAPI
483 BOOL
484 (WINAPI *WinNtSetEndOfFile) (
485 HANDLE FileHandle
486 );
487
488 typedef
489 WINBASEAPI
490 BOOL
491 (WINAPI *WinNtReadFile) (
492 HANDLE FileHandle,
493 LPVOID Buffer,
494 DWORD NumberOfBytesToRead,
495 LPDWORD NumberOfBytesRead,
496 LPOVERLAPPED Overlapped
497 );
498
499 typedef
500 WINBASEAPI
501 BOOL
502 (WINAPI *WinNtWriteFile) (
503 HANDLE FileHandle,
504 LPCVOID Buffer,
505 DWORD NumberOfBytesToWrite,
506 LPDWORD NumberOfBytesWritten,
507 LPOVERLAPPED Overlapped
508 );
509
510 typedef
511 WINBASEAPI
512 BOOL
513 (WINAPI *WinNtGetFileInformationByHandle) (
514 HANDLE FileHandle,
515 BY_HANDLE_FILE_INFORMATION *FileInfo
516 );
517
518 typedef
519 WINBASEAPI
520 BOOL
521 (WINAPI *WinNtGetDiskFreeSpace) (
522 LPCTSTR RootPathName,
523 LPDWORD SectorsPerCluster,
524 LPDWORD BytesPerSector,
525 LPDWORD NumberOfFreeClusters,
526 LPDWORD TotalNumberOfClusters
527 );
528
529 typedef
530 WINBASEAPI
531 BOOL
532 (WINAPI *WinNtGetDiskFreeSpaceEx) (
533 LPCTSTR DirectoryName,
534 PULARGE_INTEGER FreeBytesAvailable,
535 PULARGE_INTEGER TotalNumberOfBytes,
536 PULARGE_INTEGER TotoalNumberOfFreeBytes
537 );
538
539 typedef
540 WINBASEAPI
541 BOOL
542 (WINAPI *WinNtMoveFile) (
543 LPCTSTR ExistingFileName,
544 LPCTSTR NewFileName
545 );
546
547 typedef
548 WINBASEAPI
549 BOOL
550 (WINAPI *WinNtSetFileTime) (
551 HANDLE FileHandle,
552 FILETIME *CreationTime,
553 FILETIME *LastAccessTime,
554 FILETIME *LastWriteTime
555 );
556
557 typedef
558 WINBASEAPI
559 BOOL
560 (WINAPI *WinNtSystemTimeToFileTime) (
561 SYSTEMTIME * SystemTime,
562 FILETIME * FileTime
563 );
564
565 typedef
566 WINBASEAPI
567 BOOL
568 (WINAPI *WinNtDeleteFile) (
569 LPCTSTR FileName
570 );
571
572 typedef
573 WINBASEAPI
574 BOOL
575 (WINAPI *WinNtFlushFileBuffers) (
576 HANDLE
577 );
578
579 typedef
580 WINBASEAPI
581 DWORD
582 (WINAPI *WinNtGetLastError) (
583 VOID
584 );
585
586 typedef
587 WINBASEAPI
588 UINT
589 (WINAPI *WinNtSetErrorMode) (
590 UINT Mode
591 );
592
593 typedef
594 WINBASEAPI
595 DWORD
596 (WINAPI *WinNtGetTickCount) (
597 VOID
598 );
599
600 typedef
601 WINBASEAPI
602 HMODULE
603 (WINAPI *WinNtLoadLibraryEx) (
604 LPCTSTR LibFileName,
605 HANDLE FileHandle,
606 DWORD Flags
607 );
608
609 typedef
610 WINBASEAPI
611 FARPROC
612 (WINAPI *WinNtGetProcAddress) (
613 HMODULE Module,
614 LPCSTR ProcName
615 );
616
617 typedef
618 WINBASEAPI
619 DWORD
620 (WINAPI *WinNtGetTimeZoneInformation) (
621 LPTIME_ZONE_INFORMATION timeZoneInformation
622 );
623
624 typedef
625 WINBASEAPI
626 MMRESULT
627 (WINAPI *WinNttimeSetEvent) (
628 UINT uDelay,
629 UINT uResolution,
630 LPTIMECALLBACK lpTimeProc,
631 DWORD_PTR dwUser,
632 UINT fuEvent
633 );
634
635 typedef
636 WINBASEAPI
637 MMRESULT
638 (WINAPI *WinNttimeKillEvent) (
639 UINT uTimerID
640 );
641
642 typedef
643 WINBASEAPI
644 DWORD
645 (WINAPI *WinNtSetTimeZoneInformation) (
646 LPTIME_ZONE_INFORMATION timeZoneInformation
647 );
648
649 typedef
650 WINBASEAPI
651 VOID
652 (WINAPI *WinNtGetSystemTime) (
653 LPSYSTEMTIME SystemTime
654 );
655
656 typedef
657 WINBASEAPI
658 BOOL
659 (WINAPI *WinNtSetSystemTime) (
660 CONST SYSTEMTIME *SystemTime
661 );
662
663 typedef
664 WINBASEAPI
665 VOID
666 (WINAPI *WinNtGetLocalTime) (
667 LPSYSTEMTIME SystemTime
668 );
669
670 typedef
671 WINBASEAPI
672 BOOL
673 (WINAPI *WinNtSetLocalTime) (
674 CONST SYSTEMTIME *SystemTime
675 );
676
677 typedef
678 WINBASEAPI
679 BOOL
680 (WINAPI *WinNtFileTimeToLocalFileTime) (
681 CONST FILETIME *FileTime,
682 LPFILETIME LocalFileTime
683 );
684
685 typedef
686 WINBASEAPI
687 BOOL
688 (WINAPI *WinNtFileTimeToSystemTime) (
689 CONST FILETIME *FileTime,
690 LPSYSTEMTIME SystemTime
691 );
692
693 typedef
694 WINBASEAPI
695 HANDLE
696 (WINAPI *WinNtFindFirstFile) (
697 LPCTSTR FileName,
698 LPWIN32_FIND_DATA FindFileData
699 );
700
701 typedef
702 WINBASEAPI
703 BOOL
704 (WINAPI *WinNtFindNextFile) (
705 HANDLE FindFile,
706 LPWIN32_FIND_DATA FindFileData
707 );
708
709 typedef
710 WINBASEAPI
711 BOOL
712 (WINAPI *WinNtFindClose) (
713 HANDLE FindFile
714 );
715
716 typedef
717 WINBASEAPI
718 BOOL
719 (WINAPI *WinNtGetCommState) (
720 HANDLE FileHandle,
721 LPDCB DCB
722 );
723
724 typedef
725 WINBASEAPI
726 BOOL
727 (WINAPI *WinNtSetCommState) (
728 HANDLE FileHandle,
729 LPDCB DCB
730 );
731
732 typedef
733 WINBASEAPI
734 BOOL
735 (WINAPI *WinNtSetCommState) (
736 HANDLE FileHandle,
737 LPDCB DCB
738 );
739
740 typedef
741 WINBASEAPI
742 BOOL
743 (WINAPI *WinNtSetCommTimeouts) (
744 HANDLE FileHandle,
745 LPCOMMTIMEOUTS CommTimeouts
746 );
747
748 typedef
749 WINBASEAPI
750 VOID
751 (WINAPI *WinNtExitProcess) (
752 UINT uExitCode // exit code for all threads
753 );
754
755 typedef
756 WINBASEAPI
757 BOOL
758 (WINAPI *WinNtPurgeComm) (
759 HANDLE FileHandle,
760 DWORD Flags
761 );
762
763 typedef
764 WINBASEAPI
765 BOOL
766 (WINAPI *WinNtEscapeCommFunction) (
767 HANDLE FileHandle,
768 DWORD Func
769 );
770
771 typedef
772 WINBASEAPI
773 BOOL
774 (WINAPI *WinNtGetCommModemStatus) (
775 HANDLE FileHandle,
776 LPDWORD ModemStat
777 );
778
779 typedef
780 WINBASEAPI
781 BOOL
782 (WINAPI *WinNtClearCommError) (
783 HANDLE FileHandle,
784 LPDWORD Errors,
785 LPCOMSTAT Stat
786 );
787
788 typedef
789 WINUSERAPI
790 INT32
791 (WINAPIV *WinNtSprintf) (
792 LPWSTR Buffer,
793 LPCWSTR String,
794 ...
795 );
796
797 typedef
798 WINUSERAPI
799 HWND
800 (WINAPI *WinNtGetDesktopWindow) (
801 VOID
802 );
803
804 typedef
805 WINUSERAPI
806 HWND
807 (WINAPI *WinNtGetForegroundWindow) (
808 VOID
809 );
810
811 typedef
812 WINUSERAPI
813 HWND
814 (WINAPI *WinNtCreateWindowEx) (
815 DWORD dwExStyle,
816 LPCTSTR lpClassName,
817 LPCTSTR lpWindowName,
818 DWORD dwStyle,
819 INT32 x,
820 INT32 y,
821 INT32 nWidth,
822 INT32 nHeight,
823 HWND hWndParent,
824 HMENU hMenu,
825 HINSTANCE hInstance,
826 LPVOID *lpParam
827 );
828
829 typedef
830 WINUSERAPI
831 BOOL
832 (WINAPI *WinNtUpdateWindow) (
833 HWND hWnd
834 );
835
836 typedef
837 WINUSERAPI
838 BOOL
839 (WINAPI *WinNtShowWindow) (
840 HWND hWnd,
841 INT32 nCmdShow
842 );
843
844 typedef
845 WINGDIAPI
846 BOOL
847 (WINAPI *WinNtDestroyWindow) (
848 HWND hWnd
849 );
850
851 typedef
852 WINUSERAPI
853 HDC
854 (WINAPI *WinNtGetWindowDC) (
855 HWND hWnd
856 );
857
858 typedef
859 WINUSERAPI
860 BOOL
861 (WINAPI *WinNtGetClientRect) (
862 HWND hWnd,
863 LPRECT lpRect
864 );
865
866 typedef
867 WINUSERAPI
868 BOOL
869 (WINAPI *WinNtAdjustWindowRect) (
870 LPRECT lpRect,
871 DWORD dwStyle,
872 BOOL bMenu
873 );
874
875 typedef
876 WINGDIAPI
877 INT32
878 (WINAPI *WinNtSetDIBitsToDevice) (
879 HDC,
880 INT32,
881 INT32,
882 DWORD,
883 DWORD,
884 INT32,
885 INT32,
886 UINT,
887 UINT,
888 CONST VOID *,
889 CONST BITMAPINFO *,
890 UINT
891 );
892
893 typedef
894 WINGDIAPI
895 BOOL
896 (WINAPI *WinNtBitBlt) (
897 HDC,
898 INT32,
899 INT32,
900 INT32,
901 INT32,
902 HDC,
903 INT32,
904 INT32,
905 DWORD
906 );
907
908 typedef
909 WINUSERAPI
910 BOOL
911 (WINAPI *WinNtInvalidateRect) (
912 HWND hWnd,
913 CONST RECT *lpRect,
914 BOOL bErase
915 );
916
917 typedef
918 WINUSERAPI
919 HDC
920 (WINAPI *WinNtGetDC) (
921 HWND hWnd
922 );
923
924 typedef
925 WINUSERAPI
926 INT32
927 (WINAPI *WinNtReleaseDC) (
928 HWND hWnd,
929 HDC hDC
930 );
931
932 typedef
933 WINUSERAPI
934 ATOM
935 (WINAPI *WinNtRegisterClassEx) (
936 CONST WNDCLASSEX *
937 );
938
939 typedef
940 WINUSERAPI
941 BOOL
942 (WINAPI *WinNtUnregisterClass) (
943 LPCTSTR lpClassName,
944 HINSTANCE hInstance
945 );
946
947 typedef
948 WINUSERAPI
949 HDC
950 (WINAPI *WinNtBeginPaint) (
951 HWND hWnd,
952 LPPAINTSTRUCT lpPaint
953 );
954
955 typedef
956 WINUSERAPI
957 BOOL
958 (WINAPI *WinNtEndPaint) (
959 HWND hWnd,
960 CONST PAINTSTRUCT *lpPaint
961 );
962
963 typedef
964 WINUSERAPI
965 VOID
966 (WINAPI *WinNtPostQuitMessage) (
967 INT32 nExitCode
968 );
969
970 typedef
971 WINUSERAPI
972 LRESULT
973 (WINAPI *WinNtDefWindowProc) (
974 HWND hWnd,
975 UINT Msg,
976 WPARAM wParam,
977 LPARAM lParam
978 );
979
980 typedef
981 WINUSERAPI
982 HICON
983 (WINAPI *WinNtLoadIcon) (
984 HINSTANCE hInstance,
985 LPCTSTR lpIconName
986 );
987
988 typedef
989 WINUSERAPI
990 HCURSOR
991 (WINAPI *WinNtLoadCursor) (
992 HINSTANCE hInstance,
993 LPCTSTR lpCursorName
994 );
995
996 typedef
997 WINGDIAPI
998 HGDIOBJ
999 (WINAPI *WinNtGetStockObject) (
1000 INT32
1001 );
1002
1003 typedef
1004 WINGDIAPI
1005 BOOL
1006 (WINAPI *WinNtSetViewportOrgEx) (
1007 HDC,
1008 INT32,
1009 INT32,
1010 LPPOINT
1011 );
1012
1013 typedef
1014 WINGDIAPI
1015 BOOL
1016 (WINAPI *WinNtSetWindowOrgEx) (
1017 HDC,
1018 INT32,
1019 INT32,
1020 LPPOINT
1021 );
1022 typedef
1023 WINGDIAPI
1024 BOOL
1025 (WINAPI *WinNtMoveWindow) (
1026 HWND,
1027 INT32,
1028 INT32,
1029 INT32,
1030 INT32,
1031 BOOL
1032 );
1033
1034 typedef
1035 WINGDIAPI
1036 BOOL
1037 (WINAPI *WinNtGetWindowRect) (
1038 HWND,
1039 LPRECT
1040 );
1041
1042 typedef
1043 WINUSERAPI
1044 BOOL
1045 (WINAPI *WinNtGetMessage) (
1046 LPMSG lpMsg,
1047 HWND hWnd,
1048 UINT wMsgFilterMin,
1049 UINT wMsgFilterMax
1050 );
1051
1052 typedef
1053 WINUSERAPI
1054 BOOL
1055 (WINAPI *WinNtTranslateMessage) (
1056 CONST MSG *lpMsg
1057 );
1058
1059 typedef
1060 WINUSERAPI
1061 BOOL
1062 (WINAPI *WinNtDispatchMessage) (
1063 CONST MSG *lpMsg
1064 );
1065
1066 typedef
1067 WINUSERAPI
1068 HANDLE
1069 (WINAPI *WinNtGetProcessHeap) ();
1070
1071 typedef
1072 WINUSERAPI
1073 LPVOID
1074 (WINAPI *WinNtHeapAlloc) (
1075 HANDLE hHeap,
1076 DWORD dwFlags,
1077 SIZE_T dwBytes
1078 );
1079
1080 typedef
1081 WINUSERAPI
1082 BOOL
1083 (WINAPI *WinNtHeapFree) (
1084 HANDLE hHeap,
1085 DWORD dwFlags,
1086 LPVOID lpMem
1087 );
1088
1089 typedef
1090 WINBASEAPI
1091 BOOL
1092 (WINAPI *WinNtFreeLibrary) (
1093 HANDLE ModHandle
1094 );
1095 //
1096 //
1097 //
1098
1099 #define EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE EFI_SIGNATURE_32 ('N', 'T', 'T', 'T')
1100
1101 typedef struct {
1102 UINT64 Signature;
1103
1104 //
1105 // Win32 Process APIs
1106 //
1107 WinNtGetProcAddress GetProcAddress;
1108 WinNtGetTickCount GetTickCount;
1109 WinNtLoadLibraryEx LoadLibraryEx;
1110 WinNtFreeLibrary FreeLibrary;
1111
1112 WinNtSetPriorityClass SetPriorityClass;
1113 WinNtSetThreadPriority SetThreadPriority;
1114 WinNtSleep Sleep;
1115
1116 WinNtSuspendThread SuspendThread;
1117 WinNtGetCurrentThread GetCurrentThread;
1118 WinNtGetCurrentThreadId GetCurrentThreadId;
1119 WinNtGetCurrentProcess GetCurrentProcess;
1120 WinNtCreateThread CreateThread;
1121 WinNtTerminateThread TerminateThread;
1122 WinNtSendMessage SendMessage;
1123 WinNtExitThread ExitThread;
1124 WinNtResumeThread ResumeThread;
1125 WinNtDuplicateHandle DuplicateHandle;
1126
1127 //
1128 // Wint32 Mutex primitive
1129 //
1130 WinNtInitializeCriticalSection InitializeCriticalSection;
1131 WinNtEnterCriticalSection EnterCriticalSection;
1132 WinNtLeaveCriticalSection LeaveCriticalSection;
1133 WinNtDeleteCriticalSection DeleteCriticalSection;
1134 WinNtTlsAlloc TlsAlloc;
1135 WinNtTlsFree TlsFree;
1136 WinNtTlsSetValue TlsSetValue;
1137 WinNtTlsGetValue TlsGetValue;
1138 WinNtCreateSemaphore CreateSemaphore;
1139 WinNtWaitForSingleObject WaitForSingleObject;
1140 WinNtReleaseSemaphore ReleaseSemaphore;
1141
1142 //
1143 // Win32 Console APIs
1144 //
1145 WinNtCreateConsoleScreenBuffer CreateConsoleScreenBuffer;
1146 WinNtFillConsoleOutputAttribute FillConsoleOutputAttribute;
1147 WinNtFillConsoleOutputCharacter FillConsoleOutputCharacter;
1148 WinNtGetConsoleCursorInfo GetConsoleCursorInfo;
1149 WinNtGetNumberOfConsoleInputEvents GetNumberOfConsoleInputEvents;
1150 WinNtPeekConsoleInput PeekConsoleInput;
1151 WinNtScrollConsoleScreenBuffer ScrollConsoleScreenBuffer;
1152 WinNtReadConsoleInput ReadConsoleInput;
1153
1154 WinNtSetConsoleActiveScreenBuffer SetConsoleActiveScreenBuffer;
1155 WinNtSetConsoleCursorInfo SetConsoleCursorInfo;
1156 WinNtSetConsoleCursorPosition SetConsoleCursorPosition;
1157 WinNtSetConsoleScreenBufferSize SetConsoleScreenBufferSize;
1158 WinNtSetConsoleTitleW SetConsoleTitleW;
1159 WinNtWriteConsoleInput WriteConsoleInput;
1160 WinNtWriteConsoleOutput WriteConsoleOutput;
1161
1162 //
1163 // Win32 File APIs
1164 //
1165 WinNtCreateFile CreateFile;
1166 WinNtDeviceIoControl DeviceIoControl;
1167 WinNtCreateDirectory CreateDirectory;
1168 WinNtRemoveDirectory RemoveDirectory;
1169 WinNtGetFileAttributes GetFileAttributes;
1170 WinNtSetFileAttributes SetFileAttributes;
1171 WinNtCreateFileMapping CreateFileMapping;
1172 WinNtCloseHandle CloseHandle;
1173 WinNtDeleteFile DeleteFile;
1174 WinNtFindFirstFile FindFirstFile;
1175 WinNtFindNextFile FindNextFile;
1176 WinNtFindClose FindClose;
1177 WinNtFlushFileBuffers FlushFileBuffers;
1178 WinNtGetEnvironmentVariable GetEnvironmentVariable;
1179 WinNtGetLastError GetLastError;
1180 WinNtSetErrorMode SetErrorMode;
1181 WinNtGetStdHandle GetStdHandle;
1182 WinNtMapViewOfFileEx MapViewOfFileEx;
1183 WinNtReadFile ReadFile;
1184 WinNtSetEndOfFile SetEndOfFile;
1185 WinNtSetFilePointer SetFilePointer;
1186 WinNtWriteFile WriteFile;
1187 WinNtGetFileInformationByHandle GetFileInformationByHandle;
1188 WinNtGetDiskFreeSpace GetDiskFreeSpace;
1189 WinNtGetDiskFreeSpaceEx GetDiskFreeSpaceEx;
1190 WinNtMoveFile MoveFile;
1191 WinNtSetFileTime SetFileTime;
1192 WinNtSystemTimeToFileTime SystemTimeToFileTime;
1193
1194 //
1195 // Win32 Time APIs
1196 //
1197 WinNtFileTimeToLocalFileTime FileTimeToLocalFileTime;
1198 WinNtFileTimeToSystemTime FileTimeToSystemTime;
1199 WinNtGetSystemTime GetSystemTime;
1200 WinNtSetSystemTime SetSystemTime;
1201 WinNtGetLocalTime GetLocalTime;
1202 WinNtSetLocalTime SetLocalTime;
1203 WinNtGetTimeZoneInformation GetTimeZoneInformation;
1204 WinNtSetTimeZoneInformation SetTimeZoneInformation;
1205 WinNttimeSetEvent timeSetEvent;
1206 WinNttimeKillEvent timeKillEvent;
1207
1208 //
1209 // Win32 Serial APIs
1210 //
1211 WinNtClearCommError ClearCommError;
1212 WinNtEscapeCommFunction EscapeCommFunction;
1213 WinNtGetCommModemStatus GetCommModemStatus;
1214 WinNtGetCommState GetCommState;
1215 WinNtSetCommState SetCommState;
1216 WinNtPurgeComm PurgeComm;
1217 WinNtSetCommTimeouts SetCommTimeouts;
1218
1219 WinNtExitProcess ExitProcess;
1220
1221 WinNtSprintf SPrintf;
1222
1223 WinNtGetDesktopWindow GetDesktopWindow;
1224 WinNtGetForegroundWindow GetForegroundWindow;
1225 WinNtCreateWindowEx CreateWindowEx;
1226 WinNtShowWindow ShowWindow;
1227 WinNtUpdateWindow UpdateWindow;
1228 WinNtDestroyWindow DestroyWindow;
1229 WinNtInvalidateRect InvalidateRect;
1230 WinNtGetWindowDC GetWindowDC;
1231 WinNtGetClientRect GetClientRect;
1232 WinNtAdjustWindowRect AdjustWindowRect;
1233 WinNtSetDIBitsToDevice SetDIBitsToDevice;
1234 WinNtBitBlt BitBlt;
1235 WinNtGetDC GetDC;
1236 WinNtReleaseDC ReleaseDC;
1237 WinNtRegisterClassEx RegisterClassEx;
1238 WinNtUnregisterClass UnregisterClass;
1239
1240 WinNtBeginPaint BeginPaint;
1241 WinNtEndPaint EndPaint;
1242 WinNtPostQuitMessage PostQuitMessage;
1243 WinNtDefWindowProc DefWindowProc;
1244 WinNtLoadIcon LoadIcon;
1245 WinNtLoadCursor LoadCursor;
1246 WinNtGetStockObject GetStockObject;
1247 WinNtSetViewportOrgEx SetViewportOrgEx;
1248 WinNtSetWindowOrgEx SetWindowOrgEx;
1249 WinNtMoveWindow MoveWindow;
1250 WinNtGetWindowRect GetWindowRect;
1251
1252 WinNtGetMessage GetMessage;
1253 WinNtTranslateMessage TranslateMessage;
1254 WinNtDispatchMessage DispatchMessage;
1255
1256 WinNtGetProcessHeap GetProcessHeap;
1257 WinNtHeapAlloc HeapAlloc;
1258 WinNtHeapFree HeapFree;
1259
1260 } EFI_WIN_NT_THUNK_PROTOCOL;
1261
1262 extern EFI_GUID gEfiWinNtThunkProtocolGuid;
1263
1264 #endif