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