]> git.proxmox.com Git - mirror_edk2.git/blob - EdkNt32Pkg/Dxe/WinNtThunk/Bus/Console/Console.h
Initial import.
[mirror_edk2.git] / EdkNt32Pkg / Dxe / WinNtThunk / Bus / Console / Console.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 Console.h
15
16 Abstract:
17
18 Console based on Win32 APIs.
19
20 This file attaches a SimpleTextIn protocol to a previously open window.
21
22 The constructor for this protocol depends on an open window. Currently
23 the SimpleTextOut protocol creates a window when it's constructor is called.
24 Thus this code must run after the constructor for the SimpleTextOut
25 protocol
26
27 --*/
28
29 #ifndef _CONSOLE_H_
30 #define _CONSOLE_H_
31
32
33
34 #define WIN_NT_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE \
35 EFI_SIGNATURE_32('N','T','s','c')
36
37 typedef struct {
38 UINT64 Signature;
39
40 EFI_HANDLE Handle;
41
42 EFI_SIMPLE_TEXT_OUT_PROTOCOL SimpleTextOut;
43 EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutMode;
44
45 EFI_WIN_NT_IO_PROTOCOL *WinNtIo;
46 EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;
47
48 //
49 // SimpleTextOut Private Data including Win32 types.
50 //
51 HANDLE NtOutHandle;
52 HANDLE NtInHandle;
53
54 COORD MaxScreenSize;
55 COORD Possition;
56 WORD Attribute;
57 BOOLEAN CursorEnable;
58
59 EFI_SIMPLE_TEXT_IN_PROTOCOL SimpleTextIn;
60
61 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
62
63 } WIN_NT_SIMPLE_TEXT_PRIVATE_DATA;
64
65 #define WIN_NT_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS(a) \
66 CR(a, WIN_NT_SIMPLE_TEXT_PRIVATE_DATA, SimpleTextOut, WIN_NT_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE)
67
68 #define WIN_NT_SIMPLE_TEXT_IN_PRIVATE_DATA_FROM_THIS(a) \
69 CR(a, WIN_NT_SIMPLE_TEXT_PRIVATE_DATA, SimpleTextIn, WIN_NT_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE)
70
71 //
72 // Console Globale Variables
73 //
74 extern EFI_DRIVER_BINDING_PROTOCOL gWinNtConsoleDriverBinding;
75 extern EFI_COMPONENT_NAME_PROTOCOL gWinNtConsoleComponentName;
76
77 typedef struct {
78 UINTN ColumnsX;
79 UINTN RowsY;
80 } WIN_NT_SIMPLE_TEXT_OUT_MODE;
81
82 //
83 // Simple Text Out protocol member functions
84 //
85
86 STATIC
87 EFI_STATUS
88 EFIAPI
89 WinNtSimpleTextOutReset (
90 IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
91 IN BOOLEAN ExtendedVerification
92 )
93 /*++
94
95 Routine Description:
96
97 TODO: Add function description
98
99 Arguments:
100
101 This - TODO: add argument description
102 ExtendedVerification - TODO: add argument description
103
104 Returns:
105
106 TODO: add return values
107
108 --*/
109 ;
110
111 STATIC
112 EFI_STATUS
113 EFIAPI
114 WinNtSimpleTextOutOutputString (
115 IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
116 IN CHAR16 *String
117 )
118 /*++
119
120 Routine Description:
121
122 TODO: Add function description
123
124 Arguments:
125
126 This - TODO: add argument description
127 String - TODO: add argument description
128
129 Returns:
130
131 TODO: add return values
132
133 --*/
134 ;
135
136 STATIC
137 EFI_STATUS
138 EFIAPI
139 WinNtSimpleTextOutTestString (
140 IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
141 IN CHAR16 *String
142 )
143 /*++
144
145 Routine Description:
146
147 TODO: Add function description
148
149 Arguments:
150
151 This - TODO: add argument description
152 String - TODO: add argument description
153
154 Returns:
155
156 TODO: add return values
157
158 --*/
159 ;
160
161 STATIC
162 EFI_STATUS
163 EFIAPI
164 WinNtSimpleTextOutQueryMode (
165 IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
166 IN UINTN ModeNumber,
167 OUT UINTN *Columns,
168 OUT UINTN *Rows
169 )
170 /*++
171
172 Routine Description:
173
174 TODO: Add function description
175
176 Arguments:
177
178 This - TODO: add argument description
179 ModeNumber - TODO: add argument description
180 Columns - TODO: add argument description
181 Rows - TODO: add argument description
182
183 Returns:
184
185 TODO: add return values
186
187 --*/
188 ;
189
190 STATIC
191 EFI_STATUS
192 EFIAPI
193 WinNtSimpleTextOutSetMode (
194 IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
195 IN UINTN ModeNumber
196 )
197 /*++
198
199 Routine Description:
200
201 TODO: Add function description
202
203 Arguments:
204
205 This - TODO: add argument description
206 ModeNumber - TODO: add argument description
207
208 Returns:
209
210 TODO: add return values
211
212 --*/
213 ;
214
215 STATIC
216 EFI_STATUS
217 EFIAPI
218 WinNtSimpleTextOutSetAttribute (
219 IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
220 IN UINTN Attribute
221 )
222 /*++
223
224 Routine Description:
225
226 TODO: Add function description
227
228 Arguments:
229
230 This - TODO: add argument description
231 Attribute - TODO: add argument description
232
233 Returns:
234
235 TODO: add return values
236
237 --*/
238 ;
239
240 STATIC
241 EFI_STATUS
242 EFIAPI
243 WinNtSimpleTextOutClearScreen (
244 IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This
245 )
246 /*++
247
248 Routine Description:
249
250 TODO: Add function description
251
252 Arguments:
253
254 This - TODO: add argument description
255
256 Returns:
257
258 TODO: add return values
259
260 --*/
261 ;
262
263 STATIC
264 EFI_STATUS
265 EFIAPI
266 WinNtSimpleTextOutSetCursorPosition (
267 IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
268 IN UINTN Column,
269 IN UINTN Row
270 )
271 /*++
272
273 Routine Description:
274
275 TODO: Add function description
276
277 Arguments:
278
279 This - TODO: add argument description
280 Column - TODO: add argument description
281 Row - TODO: add argument description
282
283 Returns:
284
285 TODO: add return values
286
287 --*/
288 ;
289
290 STATIC
291 EFI_STATUS
292 EFIAPI
293 WinNtSimpleTextOutEnableCursor (
294 IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
295 IN BOOLEAN Enable
296 )
297 /*++
298
299 Routine Description:
300
301 TODO: Add function description
302
303 Arguments:
304
305 This - TODO: add argument description
306 Enable - TODO: add argument description
307
308 Returns:
309
310 TODO: add return values
311
312 --*/
313 ;
314
315 //
316 // Simple Text Out constructor and destructor.
317 //
318 EFI_STATUS
319 WinNtSimpleTextOutOpenWindow (
320 IN OUT WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private
321 )
322 /*++
323
324 Routine Description:
325
326 TODO: Add function description
327
328 Arguments:
329
330 Private - TODO: add argument description
331
332 Returns:
333
334 TODO: add return values
335
336 --*/
337 ;
338
339 EFI_STATUS
340 WinNtSimpleTextOutCloseWindow (
341 IN OUT WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Console
342 )
343 /*++
344
345 Routine Description:
346
347 TODO: Add function description
348
349 Arguments:
350
351 Console - TODO: add argument description
352
353 Returns:
354
355 TODO: add return values
356
357 --*/
358 ;
359
360 //
361 // Simple Text In protocol member functions.
362 //
363 STATIC
364 EFI_STATUS
365 EFIAPI
366 WinNtSimpleTextInReset (
367 IN EFI_SIMPLE_TEXT_IN_PROTOCOL *This,
368 IN BOOLEAN ExtendedVerification
369 )
370 /*++
371
372 Routine Description:
373
374 TODO: Add function description
375
376 Arguments:
377
378 This - TODO: add argument description
379 ExtendedVerification - TODO: add argument description
380
381 Returns:
382
383 TODO: add return values
384
385 --*/
386 ;
387
388 STATIC
389 EFI_STATUS
390 EFIAPI
391 WinNtSimpleTextInReadKeyStroke (
392 IN EFI_SIMPLE_TEXT_IN_PROTOCOL *This,
393 OUT EFI_INPUT_KEY *Key
394 )
395 /*++
396
397 Routine Description:
398
399 TODO: Add function description
400
401 Arguments:
402
403 This - TODO: add argument description
404 Key - TODO: add argument description
405
406 Returns:
407
408 TODO: add return values
409
410 --*/
411 ;
412
413 STATIC
414 VOID
415 EFIAPI
416 WinNtSimpleTextInWaitForKey (
417 IN EFI_EVENT Event,
418 IN VOID *Context
419 )
420 /*++
421
422 Routine Description:
423
424 TODO: Add function description
425
426 Arguments:
427
428 Event - TODO: add argument description
429 Context - TODO: add argument description
430
431 Returns:
432
433 TODO: add return values
434
435 --*/
436 ;
437
438 //
439 // Simple Text In constructor
440 //
441 EFI_STATUS
442 WinNtSimpleTextInAttachToWindow (
443 IN WIN_NT_SIMPLE_TEXT_PRIVATE_DATA *Private
444 )
445 /*++
446
447 Routine Description:
448
449 TODO: Add function description
450
451 Arguments:
452
453 Private - TODO: add argument description
454
455 Returns:
456
457 TODO: add return values
458
459 --*/
460 ;
461
462 //
463 // Main Entry Point
464 //
465 EFI_STATUS
466 EFIAPI
467 InitializeWinNtConsole (
468 IN EFI_HANDLE ImageHandle,
469 IN EFI_SYSTEM_TABLE *SystemTable
470 )
471 /*++
472
473 Routine Description:
474
475 TODO: Add function description
476
477 Arguments:
478
479 ImageHandle - TODO: add argument description
480 SystemTable - TODO: add argument description
481
482 Returns:
483
484 TODO: add return values
485
486 --*/
487 ;
488
489 EFI_STATUS
490 AppendDevicePathInstanceToVar (
491 IN CHAR16 *VariableName,
492 IN EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
493 )
494 /*++
495
496 Routine Description:
497
498 TODO: Add function description
499
500 Arguments:
501
502 VariableName - TODO: add argument description
503 DevicePathInstance - TODO: add argument description
504
505 Returns:
506
507 TODO: add return values
508
509 --*/
510 ;
511
512 #endif