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