]> git.proxmox.com Git - mirror_edk2.git/blob - EdkNt32Pkg/Include/Protocol/WinNtThunk.h
Add IPF support in Base IO Lib, and related change in fpd file
[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 size_t Count,
794 LPCWSTR String,
795 ...
796 );
797
798 typedef
799 WINUSERAPI
800 HWND
801 (WINAPI *WinNtGetDesktopWindow) (
802 VOID
803 );
804
805 typedef
806 WINUSERAPI
807 HWND
808 (WINAPI *WinNtGetForegroundWindow) (
809 VOID
810 );
811
812 typedef
813 WINUSERAPI
814 HWND
815 (WINAPI *WinNtCreateWindowEx) (
816 DWORD dwExStyle,
817 LPCTSTR lpClassName,
818 LPCTSTR lpWindowName,
819 DWORD dwStyle,
820 INT32 x,
821 INT32 y,
822 INT32 nWidth,
823 INT32 nHeight,
824 HWND hWndParent,
825 HMENU hMenu,
826 HINSTANCE hInstance,
827 LPVOID *lpParam
828 );
829
830 typedef
831 WINUSERAPI
832 BOOL
833 (WINAPI *WinNtUpdateWindow) (
834 HWND hWnd
835 );
836
837 typedef
838 WINUSERAPI
839 BOOL
840 (WINAPI *WinNtShowWindow) (
841 HWND hWnd,
842 INT32 nCmdShow
843 );
844
845 typedef
846 WINGDIAPI
847 BOOL
848 (WINAPI *WinNtDestroyWindow) (
849 HWND hWnd
850 );
851
852 typedef
853 WINUSERAPI
854 HDC
855 (WINAPI *WinNtGetWindowDC) (
856 HWND hWnd
857 );
858
859 typedef
860 WINUSERAPI
861 BOOL
862 (WINAPI *WinNtGetClientRect) (
863 HWND hWnd,
864 LPRECT lpRect
865 );
866
867 typedef
868 WINUSERAPI
869 BOOL
870 (WINAPI *WinNtAdjustWindowRect) (
871 LPRECT lpRect,
872 DWORD dwStyle,
873 BOOL bMenu
874 );
875
876 typedef
877 WINGDIAPI
878 INT32
879 (WINAPI *WinNtSetDIBitsToDevice) (
880 HDC,
881 INT32,
882 INT32,
883 DWORD,
884 DWORD,
885 INT32,
886 INT32,
887 UINT,
888 UINT,
889 CONST VOID *,
890 CONST BITMAPINFO *,
891 UINT
892 );
893
894 typedef
895 WINGDIAPI
896 BOOL
897 (WINAPI *WinNtBitBlt) (
898 HDC,
899 INT32,
900 INT32,
901 INT32,
902 INT32,
903 HDC,
904 INT32,
905 INT32,
906 DWORD
907 );
908
909 typedef
910 WINUSERAPI
911 BOOL
912 (WINAPI *WinNtInvalidateRect) (
913 HWND hWnd,
914 CONST RECT *lpRect,
915 BOOL bErase
916 );
917
918 typedef
919 WINUSERAPI
920 HDC
921 (WINAPI *WinNtGetDC) (
922 HWND hWnd
923 );
924
925 typedef
926 WINUSERAPI
927 INT32
928 (WINAPI *WinNtReleaseDC) (
929 HWND hWnd,
930 HDC hDC
931 );
932
933 typedef
934 WINUSERAPI
935 ATOM
936 (WINAPI *WinNtRegisterClassEx) (
937 CONST WNDCLASSEX *
938 );
939
940 typedef
941 WINUSERAPI
942 BOOL
943 (WINAPI *WinNtUnregisterClass) (
944 LPCTSTR lpClassName,
945 HINSTANCE hInstance
946 );
947
948 typedef
949 WINUSERAPI
950 HDC
951 (WINAPI *WinNtBeginPaint) (
952 HWND hWnd,
953 LPPAINTSTRUCT lpPaint
954 );
955
956 typedef
957 WINUSERAPI
958 BOOL
959 (WINAPI *WinNtEndPaint) (
960 HWND hWnd,
961 CONST PAINTSTRUCT *lpPaint
962 );
963
964 typedef
965 WINUSERAPI
966 VOID
967 (WINAPI *WinNtPostQuitMessage) (
968 INT32 nExitCode
969 );
970
971 typedef
972 WINUSERAPI
973 LRESULT
974 (WINAPI *WinNtDefWindowProc) (
975 HWND hWnd,
976 UINT Msg,
977 WPARAM wParam,
978 LPARAM lParam
979 );
980
981 typedef
982 WINUSERAPI
983 HICON
984 (WINAPI *WinNtLoadIcon) (
985 HINSTANCE hInstance,
986 LPCTSTR lpIconName
987 );
988
989 typedef
990 WINUSERAPI
991 HCURSOR
992 (WINAPI *WinNtLoadCursor) (
993 HINSTANCE hInstance,
994 LPCTSTR lpCursorName
995 );
996
997 typedef
998 WINGDIAPI
999 HGDIOBJ
1000 (WINAPI *WinNtGetStockObject) (
1001 INT32
1002 );
1003
1004 typedef
1005 WINGDIAPI
1006 BOOL
1007 (WINAPI *WinNtSetViewportOrgEx) (
1008 HDC,
1009 INT32,
1010 INT32,
1011 LPPOINT
1012 );
1013
1014 typedef
1015 WINGDIAPI
1016 BOOL
1017 (WINAPI *WinNtSetWindowOrgEx) (
1018 HDC,
1019 INT32,
1020 INT32,
1021 LPPOINT
1022 );
1023 typedef
1024 WINGDIAPI
1025 BOOL
1026 (WINAPI *WinNtMoveWindow) (
1027 HWND,
1028 INT32,
1029 INT32,
1030 INT32,
1031 INT32,
1032 BOOL
1033 );
1034
1035 typedef
1036 WINGDIAPI
1037 BOOL
1038 (WINAPI *WinNtGetWindowRect) (
1039 HWND,
1040 LPRECT
1041 );
1042
1043 typedef
1044 WINUSERAPI
1045 BOOL
1046 (WINAPI *WinNtGetMessage) (
1047 LPMSG lpMsg,
1048 HWND hWnd,
1049 UINT wMsgFilterMin,
1050 UINT wMsgFilterMax
1051 );
1052
1053 typedef
1054 WINUSERAPI
1055 BOOL
1056 (WINAPI *WinNtTranslateMessage) (
1057 CONST MSG *lpMsg
1058 );
1059
1060 typedef
1061 WINUSERAPI
1062 BOOL
1063 (WINAPI *WinNtDispatchMessage) (
1064 CONST MSG *lpMsg
1065 );
1066
1067 typedef
1068 WINUSERAPI
1069 HANDLE
1070 (WINAPI *WinNtGetProcessHeap) ();
1071
1072 typedef
1073 WINUSERAPI
1074 LPVOID
1075 (WINAPI *WinNtHeapAlloc) (
1076 HANDLE hHeap,
1077 DWORD dwFlags,
1078 SIZE_T dwBytes
1079 );
1080
1081 typedef
1082 WINUSERAPI
1083 BOOL
1084 (WINAPI *WinNtHeapFree) (
1085 HANDLE hHeap,
1086 DWORD dwFlags,
1087 LPVOID lpMem
1088 );
1089
1090 typedef
1091 WINBASEAPI
1092 BOOL
1093 (WINAPI *WinNtFreeLibrary) (
1094 HANDLE ModHandle
1095 );
1096 //
1097 //
1098 //
1099
1100 #define EFI_WIN_NT_THUNK_PROTOCOL_SIGNATURE EFI_SIGNATURE_32 ('N', 'T', 'T', 'T')
1101
1102 typedef struct {
1103 UINT64 Signature;
1104
1105 //
1106 // Win32 Process APIs
1107 //
1108 WinNtGetProcAddress GetProcAddress;
1109 WinNtGetTickCount GetTickCount;
1110 WinNtLoadLibraryEx LoadLibraryEx;
1111 WinNtFreeLibrary FreeLibrary;
1112
1113 WinNtSetPriorityClass SetPriorityClass;
1114 WinNtSetThreadPriority SetThreadPriority;
1115 WinNtSleep Sleep;
1116
1117 WinNtSuspendThread SuspendThread;
1118 WinNtGetCurrentThread GetCurrentThread;
1119 WinNtGetCurrentThreadId GetCurrentThreadId;
1120 WinNtGetCurrentProcess GetCurrentProcess;
1121 WinNtCreateThread CreateThread;
1122 WinNtTerminateThread TerminateThread;
1123 WinNtSendMessage SendMessage;
1124 WinNtExitThread ExitThread;
1125 WinNtResumeThread ResumeThread;
1126 WinNtDuplicateHandle DuplicateHandle;
1127
1128 //
1129 // Wint32 Mutex primitive
1130 //
1131 WinNtInitializeCriticalSection InitializeCriticalSection;
1132 WinNtEnterCriticalSection EnterCriticalSection;
1133 WinNtLeaveCriticalSection LeaveCriticalSection;
1134 WinNtDeleteCriticalSection DeleteCriticalSection;
1135 WinNtTlsAlloc TlsAlloc;
1136 WinNtTlsFree TlsFree;
1137 WinNtTlsSetValue TlsSetValue;
1138 WinNtTlsGetValue TlsGetValue;
1139 WinNtCreateSemaphore CreateSemaphore;
1140 WinNtWaitForSingleObject WaitForSingleObject;
1141 WinNtReleaseSemaphore ReleaseSemaphore;
1142
1143 //
1144 // Win32 Console APIs
1145 //
1146 WinNtCreateConsoleScreenBuffer CreateConsoleScreenBuffer;
1147 WinNtFillConsoleOutputAttribute FillConsoleOutputAttribute;
1148 WinNtFillConsoleOutputCharacter FillConsoleOutputCharacter;
1149 WinNtGetConsoleCursorInfo GetConsoleCursorInfo;
1150 WinNtGetNumberOfConsoleInputEvents GetNumberOfConsoleInputEvents;
1151 WinNtPeekConsoleInput PeekConsoleInput;
1152 WinNtScrollConsoleScreenBuffer ScrollConsoleScreenBuffer;
1153 WinNtReadConsoleInput ReadConsoleInput;
1154
1155 WinNtSetConsoleActiveScreenBuffer SetConsoleActiveScreenBuffer;
1156 WinNtSetConsoleCursorInfo SetConsoleCursorInfo;
1157 WinNtSetConsoleCursorPosition SetConsoleCursorPosition;
1158 WinNtSetConsoleScreenBufferSize SetConsoleScreenBufferSize;
1159 WinNtSetConsoleTitleW SetConsoleTitleW;
1160 WinNtWriteConsoleInput WriteConsoleInput;
1161 WinNtWriteConsoleOutput WriteConsoleOutput;
1162
1163 //
1164 // Win32 File APIs
1165 //
1166 WinNtCreateFile CreateFile;
1167 WinNtDeviceIoControl DeviceIoControl;
1168 WinNtCreateDirectory CreateDirectory;
1169 WinNtRemoveDirectory RemoveDirectory;
1170 WinNtGetFileAttributes GetFileAttributes;
1171 WinNtSetFileAttributes SetFileAttributes;
1172 WinNtCreateFileMapping CreateFileMapping;
1173 WinNtCloseHandle CloseHandle;
1174 WinNtDeleteFile DeleteFile;
1175 WinNtFindFirstFile FindFirstFile;
1176 WinNtFindNextFile FindNextFile;
1177 WinNtFindClose FindClose;
1178 WinNtFlushFileBuffers FlushFileBuffers;
1179 WinNtGetEnvironmentVariable GetEnvironmentVariable;
1180 WinNtGetLastError GetLastError;
1181 WinNtSetErrorMode SetErrorMode;
1182 WinNtGetStdHandle GetStdHandle;
1183 WinNtMapViewOfFileEx MapViewOfFileEx;
1184 WinNtReadFile ReadFile;
1185 WinNtSetEndOfFile SetEndOfFile;
1186 WinNtSetFilePointer SetFilePointer;
1187 WinNtWriteFile WriteFile;
1188 WinNtGetFileInformationByHandle GetFileInformationByHandle;
1189 WinNtGetDiskFreeSpace GetDiskFreeSpace;
1190 WinNtGetDiskFreeSpaceEx GetDiskFreeSpaceEx;
1191 WinNtMoveFile MoveFile;
1192 WinNtSetFileTime SetFileTime;
1193 WinNtSystemTimeToFileTime SystemTimeToFileTime;
1194
1195 //
1196 // Win32 Time APIs
1197 //
1198 WinNtFileTimeToLocalFileTime FileTimeToLocalFileTime;
1199 WinNtFileTimeToSystemTime FileTimeToSystemTime;
1200 WinNtGetSystemTime GetSystemTime;
1201 WinNtSetSystemTime SetSystemTime;
1202 WinNtGetLocalTime GetLocalTime;
1203 WinNtSetLocalTime SetLocalTime;
1204 WinNtGetTimeZoneInformation GetTimeZoneInformation;
1205 WinNtSetTimeZoneInformation SetTimeZoneInformation;
1206 WinNttimeSetEvent timeSetEvent;
1207 WinNttimeKillEvent timeKillEvent;
1208
1209 //
1210 // Win32 Serial APIs
1211 //
1212 WinNtClearCommError ClearCommError;
1213 WinNtEscapeCommFunction EscapeCommFunction;
1214 WinNtGetCommModemStatus GetCommModemStatus;
1215 WinNtGetCommState GetCommState;
1216 WinNtSetCommState SetCommState;
1217 WinNtPurgeComm PurgeComm;
1218 WinNtSetCommTimeouts SetCommTimeouts;
1219
1220 WinNtExitProcess ExitProcess;
1221
1222 WinNtSprintf SPrintf;
1223
1224 WinNtGetDesktopWindow GetDesktopWindow;
1225 WinNtGetForegroundWindow GetForegroundWindow;
1226 WinNtCreateWindowEx CreateWindowEx;
1227 WinNtShowWindow ShowWindow;
1228 WinNtUpdateWindow UpdateWindow;
1229 WinNtDestroyWindow DestroyWindow;
1230 WinNtInvalidateRect InvalidateRect;
1231 WinNtGetWindowDC GetWindowDC;
1232 WinNtGetClientRect GetClientRect;
1233 WinNtAdjustWindowRect AdjustWindowRect;
1234 WinNtSetDIBitsToDevice SetDIBitsToDevice;
1235 WinNtBitBlt BitBlt;
1236 WinNtGetDC GetDC;
1237 WinNtReleaseDC ReleaseDC;
1238 WinNtRegisterClassEx RegisterClassEx;
1239 WinNtUnregisterClass UnregisterClass;
1240
1241 WinNtBeginPaint BeginPaint;
1242 WinNtEndPaint EndPaint;
1243 WinNtPostQuitMessage PostQuitMessage;
1244 WinNtDefWindowProc DefWindowProc;
1245 WinNtLoadIcon LoadIcon;
1246 WinNtLoadCursor LoadCursor;
1247 WinNtGetStockObject GetStockObject;
1248 WinNtSetViewportOrgEx SetViewportOrgEx;
1249 WinNtSetWindowOrgEx SetWindowOrgEx;
1250 WinNtMoveWindow MoveWindow;
1251 WinNtGetWindowRect GetWindowRect;
1252
1253 WinNtGetMessage GetMessage;
1254 WinNtTranslateMessage TranslateMessage;
1255 WinNtDispatchMessage DispatchMessage;
1256
1257 WinNtGetProcessHeap GetProcessHeap;
1258 WinNtHeapAlloc HeapAlloc;
1259 WinNtHeapFree HeapFree;
1260
1261 } EFI_WIN_NT_THUNK_PROTOCOL;
1262
1263 extern EFI_GUID gEfiWinNtThunkProtocolGuid;
1264
1265 #endif