]>
Commit | Line | Data |
---|---|---|
c9fc89a3 | 1 | /** @file\r |
2 | \r | |
402e4a9d | 3 | Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r |
8f2a5f80 | 4 | This program and the accompanying materials\r |
c9fc89a3 | 5 | are licensed and made available under the terms and conditions of the BSD License\r |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | WinNtGop.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Private data for the Gop driver that is bound to the WinNt Thunk protocol\r | |
19 | \r | |
20 | \r | |
21 | **/\r | |
22 | \r | |
23 | #ifndef _WIN_NT_GOP_H_\r | |
24 | #define _WIN_NT_GOP_H_\r | |
25 | \r | |
c9fc89a3 | 26 | \r |
62cf113f | 27 | #include <Uefi.h>\r |
28 | #include <WinNtDxe.h>\r | |
29 | \r | |
30 | #include <Guid/EventGroup.h>\r | |
31 | #include <Protocol/WinNtIo.h>\r | |
32 | #include <Protocol/ComponentName.h>\r | |
33 | #include <Protocol/SimpleTextIn.h>\r | |
34 | #include <Protocol/SimpleTextInEx.h>\r | |
35 | #include <Protocol/DriverBinding.h>\r | |
36 | #include <Protocol/GraphicsOutput.h>\r | |
37 | \r | |
38 | #include <Library/DebugLib.h>\r | |
39 | #include <Library/BaseLib.h>\r | |
40 | #include <Library/UefiDriverEntryPoint.h>\r | |
41 | #include <Library/UefiLib.h>\r | |
42 | #include <Library/BaseMemoryLib.h>\r | |
43 | #include <Library/UefiBootServicesTableLib.h>\r | |
44 | #include <Library/MemoryAllocationLib.h>\r | |
c9fc89a3 | 45 | \r |
46 | //\r | |
62cf113f | 47 | // WM_SYSKEYDOWN/WM_SYSKEYUP Notification\r |
48 | // lParam\r | |
df7499fc | 49 | // bit 24: Specifies whether the key is an extended key,\r |
50 | // such as the right-hand ALT and CTRL keys that appear on\r | |
51 | // an enhanced 101- or 102-key keyboard.\r | |
62cf113f | 52 | // The value is 1 if it is an extended key; otherwise, it is 0.\r |
df7499fc | 53 | // bit 29:Specifies the context code.\r |
54 | // The value is 1 if the ALT key is down while the key is pressed/released;\r | |
55 | // it is 0 if the WM_SYSKEYDOWN message is posted to the active window\r | |
62cf113f | 56 | // because no window has the keyboard focus.\r |
57 | #define GOP_EXTENDED_KEY (0x1 << 24)\r | |
58 | #define GOP_ALT_KEY_PRESSED (0x1 << 29)\r | |
59 | \r | |
66fe7146 | 60 | #define KEYBOARD_TIMER_INTERVAL 200000 // 0.02s\r |
c9fc89a3 | 61 | \r |
62 | #define MAX_Q 256\r | |
63 | \r | |
64 | typedef struct {\r | |
66fe7146 RN |
65 | UINTN Front;\r |
66 | UINTN Rear;\r | |
67 | EFI_KEY_DATA Q[MAX_Q];\r | |
68 | CRITICAL_SECTION Cs;\r | |
c9fc89a3 | 69 | } GOP_QUEUE_FIXED;\r |
70 | \r | |
71 | #define WIN_NT_GOP_CLASS_NAME L"WinNtGopWindow"\r | |
72 | \r | |
99e1dd89 | 73 | #define GOP_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('S', 'g', 'o', 'N')\r |
c9fc89a3 | 74 | \r |
99e1dd89 | 75 | #define WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE SIGNATURE_32 ('W', 'g', 'S', 'n')\r |
62cf113f | 76 | \r |
77 | typedef struct _WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY {\r | |
78 | UINTN Signature;\r | |
62cf113f | 79 | EFI_KEY_DATA KeyData;\r |
80 | EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn;\r | |
81 | LIST_ENTRY NotifyEntry;\r | |
82 | } WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY;\r | |
83 | \r | |
c9fc89a3 | 84 | #define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff\r |
85 | \r | |
86 | typedef struct {\r | |
87 | UINT32 HorizontalResolution;\r | |
88 | UINT32 VerticalResolution;\r | |
89 | UINT32 ColorDepth;\r | |
90 | UINT32 RefreshRate;\r | |
91 | } GOP_MODE_DATA;\r | |
92 | \r | |
93 | typedef struct {\r | |
94 | UINT64 Signature;\r | |
95 | \r | |
96 | EFI_HANDLE Handle;\r | |
97 | EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput;\r | |
98 | EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn;\r | |
99 | \r | |
100 | EFI_WIN_NT_THUNK_PROTOCOL *WinNtThunk;\r | |
101 | \r | |
102 | EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r | |
103 | \r | |
104 | //\r | |
105 | // GOP Private Data for QueryMode ()\r | |
106 | //\r | |
107 | GOP_MODE_DATA *ModeData;\r | |
108 | \r | |
109 | //\r | |
110 | // GOP Private Data knowing when to start hardware\r | |
111 | //\r | |
112 | BOOLEAN HardwareNeedsStarting;\r | |
113 | \r | |
114 | CHAR16 *WindowName;\r | |
115 | CHAR16 Buffer[160];\r | |
116 | \r | |
117 | HANDLE ThreadInited; // Semaphore\r | |
118 | HANDLE ThreadHandle; // Thread\r | |
119 | DWORD ThreadId;\r | |
120 | \r | |
121 | HWND WindowHandle;\r | |
122 | WNDCLASSEX WindowsClass;\r | |
123 | \r | |
124 | //\r | |
125 | // This screen is used to redraw the scree when windows events happen. It's\r | |
126 | // updated in the main thread and displayed in the windows thread.\r | |
127 | //\r | |
128 | BITMAPV4HEADER *VirtualScreenInfo;\r | |
129 | RGBQUAD *VirtualScreen;\r | |
130 | \r | |
131 | EFI_GRAPHICS_OUTPUT_BLT_PIXEL *FillLine;\r | |
132 | \r | |
133 | //\r | |
df7499fc | 134 | // Keyboard Queue used by Simple Text In.\r |
66fe7146 RN |
135 | // QueueForRead: WinProc thread adds, and main thread removes.\r |
136 | // QueueForNotify: WinProc thread adds, and timer thread removes.\r | |
c9fc89a3 | 137 | //\r |
66fe7146 RN |
138 | GOP_QUEUE_FIXED QueueForRead;\r |
139 | GOP_QUEUE_FIXED QueueForNotify;\r | |
c9fc89a3 | 140 | \r |
62cf113f | 141 | EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleTextInEx;\r |
142 | EFI_KEY_STATE KeyState;\r | |
143 | LIST_ENTRY NotifyList;\r | |
144 | BOOLEAN LeftShift;\r | |
df7499fc | 145 | BOOLEAN RightShift;\r |
62cf113f | 146 | BOOLEAN LeftAlt;\r |
147 | BOOLEAN RightAlt;\r | |
148 | BOOLEAN LeftCtrl;\r | |
149 | BOOLEAN RightCtrl;\r | |
150 | BOOLEAN LeftLogo;\r | |
151 | BOOLEAN RightLogo;\r | |
152 | BOOLEAN Menu;\r | |
df7499fc | 153 | BOOLEAN SysReq;\r |
62cf113f | 154 | BOOLEAN NumLock;\r |
155 | BOOLEAN ScrollLock;\r | |
66fe7146 | 156 | BOOLEAN CapsLock;\r |
df7499fc | 157 | BOOLEAN IsPartialKeySupport;\r |
66fe7146 | 158 | EFI_EVENT TimerEvent;\r |
c9fc89a3 | 159 | } GOP_PRIVATE_DATA;\r |
160 | \r | |
161 | #define GOP_PRIVATE_DATA_FROM_THIS(a) \\r | |
162 | CR(a, GOP_PRIVATE_DATA, GraphicsOutput, GOP_PRIVATE_DATA_SIGNATURE)\r | |
163 | \r | |
164 | #define GOP_PRIVATE_DATA_FROM_TEXT_IN_THIS(a) \\r | |
165 | CR(a, GOP_PRIVATE_DATA, SimpleTextIn, GOP_PRIVATE_DATA_SIGNATURE)\r | |
166 | \r | |
62cf113f | 167 | #define GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS(a) \\r |
168 | CR(a, GOP_PRIVATE_DATA, SimpleTextInEx, GOP_PRIVATE_DATA_SIGNATURE)\r | |
169 | \r | |
c9fc89a3 | 170 | //\r |
171 | // Global Protocol Variables\r | |
172 | //\r | |
e6e53c97 | 173 | extern EFI_DRIVER_BINDING_PROTOCOL gWinNtGopDriverBinding;\r |
174 | extern EFI_COMPONENT_NAME_PROTOCOL gWinNtGopComponentName;\r | |
175 | extern EFI_COMPONENT_NAME2_PROTOCOL gWinNtGopComponentName2;\r | |
c9fc89a3 | 176 | \r |
62cf113f | 177 | \r |
c9fc89a3 | 178 | //\r |
179 | // Gop Hardware abstraction internal worker functions\r | |
180 | //\r | |
181 | \r | |
182 | /**\r | |
183 | TODO: Add function description\r | |
184 | \r | |
185 | @param WinNtIo TODO: add argument description\r | |
186 | \r | |
187 | @return TODO: add return values\r | |
188 | \r | |
189 | **/\r | |
190 | EFI_STATUS\r | |
191 | WinNtGopSupported (\r | |
192 | IN EFI_WIN_NT_IO_PROTOCOL *WinNtIo\r | |
ed66e1bc | 193 | );\r |
c9fc89a3 | 194 | \r |
195 | \r | |
196 | /**\r | |
197 | TODO: Add function description\r | |
198 | \r | |
199 | @param Private TODO: add argument description\r | |
200 | \r | |
201 | @return TODO: add return values\r | |
202 | \r | |
203 | **/\r | |
204 | EFI_STATUS\r | |
205 | WinNtGopConstructor (\r | |
206 | IN GOP_PRIVATE_DATA *Private\r | |
ed66e1bc | 207 | );\r |
c9fc89a3 | 208 | \r |
209 | \r | |
210 | /**\r | |
211 | TODO: Add function description\r | |
212 | \r | |
213 | @param Private TODO: add argument description\r | |
214 | \r | |
215 | @return TODO: add return values\r | |
216 | \r | |
217 | **/\r | |
218 | EFI_STATUS\r | |
219 | WinNtGopDestructor (\r | |
220 | IN GOP_PRIVATE_DATA *Private\r | |
ed66e1bc | 221 | );\r |
c9fc89a3 | 222 | \r |
223 | //\r | |
8a7d75b0 | 224 | // UEFI 2.0 driver model prototypes for Win NT GOP\r |
c9fc89a3 | 225 | //\r |
226 | \r | |
227 | \r | |
228 | /**\r | |
229 | TODO: Add function description\r | |
230 | \r | |
231 | @param ImageHandle TODO: add argument description\r | |
232 | @param SystemTable TODO: add argument description\r | |
233 | \r | |
234 | @return TODO: add return values\r | |
235 | \r | |
236 | **/\r | |
237 | EFI_STATUS\r | |
238 | EFIAPI\r | |
239 | WinNtGopInitialize (\r | |
240 | IN EFI_HANDLE ImageHandle,\r | |
241 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
ed66e1bc | 242 | );\r |
c9fc89a3 | 243 | \r |
244 | \r | |
245 | /**\r | |
246 | TODO: Add function description\r | |
247 | \r | |
248 | @param This TODO: add argument description\r | |
249 | @param Handle TODO: add argument description\r | |
250 | @param RemainingDevicePath TODO: add argument description\r | |
251 | \r | |
252 | @return TODO: add return values\r | |
253 | \r | |
254 | **/\r | |
255 | EFI_STATUS\r | |
256 | EFIAPI\r | |
257 | WinNtGopDriverBindingSupported (\r | |
258 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
259 | IN EFI_HANDLE Handle,\r | |
260 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
ed66e1bc | 261 | );\r |
c9fc89a3 | 262 | \r |
263 | \r | |
264 | /**\r | |
265 | TODO: Add function description\r | |
266 | \r | |
267 | @param This TODO: add argument description\r | |
268 | @param Handle TODO: add argument description\r | |
269 | @param RemainingDevicePath TODO: add argument description\r | |
270 | \r | |
271 | @return TODO: add return values\r | |
272 | \r | |
273 | **/\r | |
274 | EFI_STATUS\r | |
275 | EFIAPI\r | |
276 | WinNtGopDriverBindingStart (\r | |
277 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
278 | IN EFI_HANDLE Handle,\r | |
279 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
ed66e1bc | 280 | );\r |
c9fc89a3 | 281 | \r |
282 | \r | |
283 | /**\r | |
284 | TODO: Add function description\r | |
285 | \r | |
286 | @param This TODO: add argument description\r | |
287 | @param Handle TODO: add argument description\r | |
288 | @param NumberOfChildren TODO: add argument description\r | |
289 | @param ChildHandleBuffer TODO: add argument description\r | |
290 | \r | |
291 | @return TODO: add return values\r | |
292 | \r | |
293 | **/\r | |
294 | EFI_STATUS\r | |
295 | EFIAPI\r | |
296 | WinNtGopDriverBindingStop (\r | |
297 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
298 | IN EFI_HANDLE Handle,\r | |
299 | IN UINTN NumberOfChildren,\r | |
300 | IN EFI_HANDLE *ChildHandleBuffer\r | |
ed66e1bc | 301 | );\r |
c9fc89a3 | 302 | \r |
303 | \r | |
304 | /**\r | |
305 | TODO: Add function description\r | |
306 | \r | |
307 | @param Private TODO: add argument description\r | |
308 | @param Key TODO: add argument description\r | |
309 | \r | |
310 | @return TODO: add return values\r | |
311 | \r | |
312 | **/\r | |
313 | EFI_STATUS\r | |
66fe7146 | 314 | GopPrivateAddKey (\r |
c9fc89a3 | 315 | IN GOP_PRIVATE_DATA *Private,\r |
316 | IN EFI_INPUT_KEY Key\r | |
ed66e1bc | 317 | );\r |
c9fc89a3 | 318 | \r |
319 | \r | |
320 | /**\r | |
321 | TODO: Add function description\r | |
322 | \r | |
323 | @param Private TODO: add argument description\r | |
324 | \r | |
325 | @return TODO: add return values\r | |
326 | \r | |
327 | **/\r | |
328 | EFI_STATUS\r | |
329 | WinNtGopInitializeSimpleTextInForWindow (\r | |
330 | IN GOP_PRIVATE_DATA *Private\r | |
ed66e1bc | 331 | );\r |
c9fc89a3 | 332 | \r |
333 | \r | |
334 | /**\r | |
335 | TODO: Add function description\r | |
336 | \r | |
337 | @param Private TODO: add argument description\r | |
338 | \r | |
339 | @return TODO: add return values\r | |
340 | \r | |
341 | **/\r | |
342 | EFI_STATUS\r | |
343 | WinNtGopDestroySimpleTextInForWindow (\r | |
344 | IN GOP_PRIVATE_DATA *Private\r | |
ed66e1bc | 345 | );\r |
c9fc89a3 | 346 | \r |
347 | \r | |
c9fc89a3 | 348 | \r |
349 | #endif\r |