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