3 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
4 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
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.
18 This file produces the graphics abstration of GOP. It is called by
19 WinNtGopDriver.c file which deals with the UEFI 2.0 driver model.
20 This file just does graphics.
27 DWORD mTlsIndex
= TLS_OUT_OF_INDEXES
;
28 DWORD mTlsIndexUseCount
= 0; // lets us know when we can free mTlsIndex.
31 WinNtGopConvertParamToEfiKeyShiftState (
32 IN GRAPHICS_PRIVATE_DATA
*Private
,
40 // BUGBUG: Only GetAsyncKeyState() and GetKeyState() can distinguish
41 // left and right Ctrl, and Shift key.
42 // Neither of the two is defined in EFI_WIN_NT_THUNK_PROTOCOL.
43 // Therefor, we can not set the correct Shift state here.
46 if ((*lParam
& GOP_EXTENDED_KEY
) == GOP_EXTENDED_KEY
) {
47 Private
->RightShift
= Flag
;
49 Private
->LeftShift
= Flag
;
54 Private
->LeftShift
= Flag
;
58 Private
->RightShift
= Flag
;
62 if ((*lParam
& GOP_EXTENDED_KEY
) == GOP_EXTENDED_KEY
) {
63 Private
->RightCtrl
= Flag
;
65 Private
->LeftCtrl
= Flag
;
70 Private
->LeftCtrl
= Flag
;
74 Private
->RightCtrl
= Flag
;
78 Private
->LeftLogo
= Flag
;
82 Private
->RightLogo
= Flag
;
89 // BUGBUG: PrintScreen/SysRq can not trigger WM_KEYDOWN message,
90 // so SySReq shift state is not supported here.
93 Private
->SysReq
= Flag
;
99 if ((*lParam
& GOP_EXTENDED_KEY
) == GOP_EXTENDED_KEY
) {
100 Private
->RightAlt
= Flag
;
102 Private
->LeftAlt
= Flag
;
112 WinNtGopConvertParamToEfiKey (
113 IN GRAPHICS_PRIVATE_DATA
*Private
,
116 IN EFI_INPUT_KEY
*Key
122 case VK_HOME
: Key
->ScanCode
= SCAN_HOME
; Flag
= TRUE
; break;
123 case VK_END
: Key
->ScanCode
= SCAN_END
; Flag
= TRUE
; break;
124 case VK_LEFT
: Key
->ScanCode
= SCAN_LEFT
; Flag
= TRUE
; break;
125 case VK_RIGHT
: Key
->ScanCode
= SCAN_RIGHT
; Flag
= TRUE
; break;
126 case VK_UP
: Key
->ScanCode
= SCAN_UP
; Flag
= TRUE
; break;
127 case VK_DOWN
: Key
->ScanCode
= SCAN_DOWN
; Flag
= TRUE
; break;
128 case VK_DELETE
: Key
->ScanCode
= SCAN_DELETE
; Flag
= TRUE
; break;
129 case VK_INSERT
: Key
->ScanCode
= SCAN_INSERT
; Flag
= TRUE
; break;
130 case VK_PRIOR
: Key
->ScanCode
= SCAN_PAGE_UP
; Flag
= TRUE
; break;
131 case VK_NEXT
: Key
->ScanCode
= SCAN_PAGE_DOWN
; Flag
= TRUE
; break;
132 case VK_ESCAPE
: Key
->ScanCode
= SCAN_ESC
; Flag
= TRUE
; break;
134 case VK_F1
: Key
->ScanCode
= SCAN_F1
; Flag
= TRUE
; break;
135 case VK_F2
: Key
->ScanCode
= SCAN_F2
; Flag
= TRUE
; break;
136 case VK_F3
: Key
->ScanCode
= SCAN_F3
; Flag
= TRUE
; break;
137 case VK_F4
: Key
->ScanCode
= SCAN_F4
; Flag
= TRUE
; break;
138 case VK_F5
: Key
->ScanCode
= SCAN_F5
; Flag
= TRUE
; break;
139 case VK_F6
: Key
->ScanCode
= SCAN_F6
; Flag
= TRUE
; break;
140 case VK_F7
: Key
->ScanCode
= SCAN_F7
; Flag
= TRUE
; break;
141 case VK_F8
: Key
->ScanCode
= SCAN_F8
; Flag
= TRUE
; break;
142 case VK_F9
: Key
->ScanCode
= SCAN_F9
; Flag
= TRUE
; break;
143 case VK_F11
: Key
->ScanCode
= SCAN_F11
; Flag
= TRUE
; break;
144 case VK_F12
: Key
->ScanCode
= SCAN_F12
; Flag
= TRUE
; break;
146 case VK_F13
: Key
->ScanCode
= SCAN_F13
; Flag
= TRUE
; break;
147 case VK_F14
: Key
->ScanCode
= SCAN_F14
; Flag
= TRUE
; break;
148 case VK_F15
: Key
->ScanCode
= SCAN_F15
; Flag
= TRUE
; break;
149 case VK_F16
: Key
->ScanCode
= SCAN_F16
; Flag
= TRUE
; break;
150 case VK_F17
: Key
->ScanCode
= SCAN_F17
; Flag
= TRUE
; break;
151 case VK_F18
: Key
->ScanCode
= SCAN_F18
; Flag
= TRUE
; break;
152 case VK_F19
: Key
->ScanCode
= SCAN_F19
; Flag
= TRUE
; break;
153 case VK_F20
: Key
->ScanCode
= SCAN_F20
; Flag
= TRUE
; break;
154 case VK_F21
: Key
->ScanCode
= SCAN_F21
; Flag
= TRUE
; break;
155 case VK_F22
: Key
->ScanCode
= SCAN_F22
; Flag
= TRUE
; break;
156 case VK_F23
: Key
->ScanCode
= SCAN_F23
; Flag
= TRUE
; break;
157 case VK_F24
: Key
->ScanCode
= SCAN_F24
; Flag
= TRUE
; break;
158 case VK_PAUSE
: Key
->ScanCode
= SCAN_PAUSE
; Flag
= TRUE
; break;
164 Private
->NumLock
= (BOOLEAN
)(!Private
->NumLock
);
168 Private
->ScrollLock
= (BOOLEAN
)(!Private
->ScrollLock
);
172 Private
->CapsLock
= (BOOLEAN
)(!Private
->CapsLock
);
177 return (WinNtGopConvertParamToEfiKeyShiftState (Private
, wParam
, lParam
, TRUE
)) == TRUE
? TRUE
: Flag
;
182 // GOP Protocol Member Functions
186 Change the resolution and resize of the window
191 IN EMU_GRAPHICS_WINDOW_PROTOCOL
*GraphicsIo
,
196 RETURN_STATUS RStatus
;
197 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION Info
;
198 GRAPHICS_PRIVATE_DATA
*Private
;
200 BITMAPV4HEADER
*VirtualScreenInfo
;
201 FRAME_BUFFER_CONFIGURE
*FrameBufferConfigure
;
202 UINTN FrameBufferConfigureSize
;
204 Private
= GRAPHICS_PRIVATE_DATA_FROM_THIS (GraphicsIo
);
207 // Allocate DIB frame buffer directly from NT for performance enhancement
208 // This buffer is the virtual screen/frame buffer.
210 VirtualScreenInfo
= HeapAlloc (
213 Width
* Height
* sizeof (RGBQUAD
) + sizeof (BITMAPV4HEADER
)
215 if (VirtualScreenInfo
== NULL
) {
216 return EFI_OUT_OF_RESOURCES
;
220 // Update the virtual screen info data structure
221 // Use negative Height to make sure screen/buffer are using the same coordinate.
223 VirtualScreenInfo
->bV4Size
= sizeof (BITMAPV4HEADER
);
224 VirtualScreenInfo
->bV4Width
= Width
;
225 VirtualScreenInfo
->bV4Height
= -(LONG
)Height
;
226 VirtualScreenInfo
->bV4Planes
= 1;
227 VirtualScreenInfo
->bV4BitCount
= 32;
231 VirtualScreenInfo
->bV4V4Compression
= BI_RGB
;
233 Info
.HorizontalResolution
= Width
;
234 Info
.VerticalResolution
= Height
;
235 Info
.PixelFormat
= PixelBlueGreenRedReserved8BitPerColor
;
236 Info
.PixelsPerScanLine
= Width
;
237 FrameBufferConfigureSize
= 0;
238 RStatus
= FrameBufferBltConfigure (VirtualScreenInfo
+ 1, &Info
, NULL
, &FrameBufferConfigureSize
);
239 ASSERT (RStatus
== EFI_BUFFER_TOO_SMALL
);
240 FrameBufferConfigure
= AllocatePool (FrameBufferConfigureSize
);
241 if (FrameBufferConfigure
== NULL
) {
242 HeapFree (GetProcessHeap (), 0, VirtualScreenInfo
);
243 return EFI_OUT_OF_RESOURCES
;
245 RStatus
= FrameBufferBltConfigure (VirtualScreenInfo
+ 1, &Info
, FrameBufferConfigure
, &FrameBufferConfigureSize
);
246 ASSERT_RETURN_ERROR (RStatus
);
249 if (Private
->FrameBufferConfigure
!= NULL
) {
250 FreePool (Private
->FrameBufferConfigure
);
252 Private
->FrameBufferConfigure
= FrameBufferConfigure
;
255 // Free the old buffer. We do not save the content of the old buffer since the
256 // screen is to be cleared anyway. Clearing the screen is required by the EFI spec.
257 // See UEFI spec -EFI_GRAPHICS_OUTPUT_PROTOCOL.SetMode()
259 if (Private
->VirtualScreenInfo
!= NULL
) {
260 HeapFree (GetProcessHeap (), 0, Private
->VirtualScreenInfo
);
262 Private
->VirtualScreenInfo
= VirtualScreenInfo
;
264 Private
->Width
= Width
;
265 Private
->Height
= Height
;
268 // Use the AdjuctWindowRect fuction to calculate the real width and height
269 // of the new window including the border and caption
274 Rect
.bottom
= Height
;
276 AdjustWindowRect (&Rect
, WS_OVERLAPPEDWINDOW
, 0);
278 Width
= Rect
.right
- Rect
.left
;
279 Height
= Rect
.bottom
- Rect
.top
;
282 // Retrieve the original window position information
284 GetWindowRect (Private
->WindowHandle
, &Rect
);
287 // Adjust the window size
289 MoveWindow (Private
->WindowHandle
, Rect
.left
, Rect
.top
, (INT32
)Width
, (INT32
)Height
, TRUE
);
295 Blt pixels from the rectangle (Width X Height) formed by the BltBuffer
296 onto the graphics screen starting a location (X, Y). (0, 0) is defined as
297 the upper left hand side of the screen. (X, Y) can be outside of the
298 current screen geometry and the BltBuffer will be cliped when it is
299 displayed. X and Y can be negative or positive. If Width or Height is
300 bigger than the current video screen the image will be clipped.
302 @param This Protocol instance pointer.
303 @param X X location on graphics screen.
304 @param Y Y location on the graphics screen.
305 @param Width Width of BltBuffer.
306 @param Height Hight of BltBuffer
307 @param BltOperation Operation to perform on BltBuffer and video memory
308 @param BltBuffer Buffer containing data to blt into video buffer.
309 This buffer has a size of
310 Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
311 @param SourceX If the BltOperation is a EfiCopyBlt this is the
312 source of the copy. For other BLT operations this
313 argument is not used.
314 @param SourceX If the BltOperation is a EfiCopyBlt this is the
315 source of the copy. For other BLT operations this
316 argument is not used.
318 @retval EFI_SUCCESS The palette is updated with PaletteArray.
319 @retval EFI_INVALID_PARAMETER BltOperation is not valid.
320 @retval EFI_DEVICE_ERROR A hardware error occured writting to the video
324 // TODO: SourceY - add argument and description to function comment
325 // TODO: DestinationX - add argument and description to function comment
326 // TODO: DestinationY - add argument and description to function comment
327 // TODO: Delta - add argument and description to function comment
330 IN EMU_GRAPHICS_WINDOW_PROTOCOL
*GraphicsIo
,
331 IN EFI_UGA_PIXEL
*BltBuffer OPTIONAL
,
332 IN EFI_UGA_BLT_OPERATION BltOperation
,
333 IN EMU_GRAPHICS_WINDOWS__BLT_ARGS
*Args
336 RETURN_STATUS RStatus
;
337 GRAPHICS_PRIVATE_DATA
*Private
;
340 Private
= GRAPHICS_PRIVATE_DATA_FROM_THIS (GraphicsIo
);
341 RStatus
= FrameBufferBlt (
342 Private
->FrameBufferConfigure
,
345 Args
->SourceX
, Args
->SourceY
,
346 Args
->DestinationX
, Args
->DestinationY
,
347 Args
->Width
, Args
->Height
,
350 if (RETURN_ERROR (RStatus
)) {
351 return (EFI_STATUS
)RStatus
;
354 if (BltOperation
!= EfiBltVideoToBltBuffer
) {
356 // Mark the area we just blted as Invalid so WM_PAINT will update.
358 Rect
.left
= (LONG
)Args
->DestinationX
;
359 Rect
.top
= (LONG
)Args
->DestinationY
;
360 Rect
.right
= (LONG
)(Args
->DestinationX
+ Args
->Width
);
361 Rect
.bottom
= (LONG
)(Args
->DestinationY
+ Args
->Height
);
362 InvalidateRect (Private
->WindowHandle
, &Rect
, FALSE
);
365 // Send the WM_PAINT message to the thread that is drawing the window. We
366 // are in the main thread and the window drawing is in a child thread.
367 // There is a child thread per window. We have no CriticalSection or Mutex
368 // since we write the data and the other thread displays the data. While
369 // we may miss some data for a short period of time this is no different than
370 // a write combining on writes to a frame buffer.
373 UpdateWindow (Private
->WindowHandle
);
382 Win32 Windows event handler.
386 @return See Win32 Book
389 // TODO: hwnd - add argument and description to function comment
390 // TODO: iMsg - add argument and description to function comment
391 // TODO: wParam - add argument and description to function comment
392 // TODO: lParam - add argument and description to function comment
395 WinNtGopThreadWindowProc (
402 GRAPHICS_PRIVATE_DATA
*Private
;
404 PAINTSTRUCT PaintStruct
;
410 // Use mTlsIndex global to get a Thread Local Storage version of Private.
411 // This works since each Gop protocol has a unique Private data instance and
415 Private
= TlsGetValue (mTlsIndex
);
416 ASSERT (NULL
!= Private
);
420 Handle
= BeginPaint (hwnd
, &PaintStruct
);
423 Handle
, // Destination Device Context
424 0, // Destination X - 0
425 0, // Destination Y - 0
426 Private
->Width
, // Width
427 Private
->Height
, // Height
430 0, // DIB Start Scan Line
431 Private
->Height
, // Number of scan lines
432 Private
->VirtualScreenInfo
+ 1, // Address of array of DIB bits
433 (BITMAPINFO
*) Private
->VirtualScreenInfo
, // Address of structure with bitmap info
434 DIB_RGB_COLORS
// RGB or palette indexes
437 EndPaint (hwnd
, &PaintStruct
);
441 // F10 and the ALT key do not create a WM_KEYDOWN message, thus this special case
442 // WM_SYSKEYDOWN is posted when F10 is pressed or
443 // holds down ALT key and then presses another key.
448 Key
.UnicodeChar
= CHAR_NULL
;
451 Key
.ScanCode
= SCAN_F10
;
452 Key
.UnicodeChar
= CHAR_NULL
;
453 GopPrivateAddKey (Private
, Key
);
458 // If ALT or ALT + modifier key is pressed.
460 if (WinNtGopConvertParamToEfiKey (Private
, &wParam
, &lParam
, &Key
)) {
461 if (Key
.ScanCode
!= 0){
463 // If ALT is pressed with other ScanCode.
464 // Always revers the left Alt for simple.
466 Private
->LeftAlt
= TRUE
;
468 GopPrivateAddKey (Private
, Key
);
470 // When Alt is released there is no windoes message, so
471 // clean it after using it.
473 Private
->RightAlt
= FALSE
;
474 Private
->LeftAlt
= FALSE
;
481 // The ESC key also generate WM_CHAR.
483 if (wParam
== 0x1B) {
487 if (AltIsPress
== TRUE
) {
489 // If AltIsPress is true that means the Alt key is pressed.
491 Private
->LeftAlt
= TRUE
;
493 for (Index
= 0; Index
< (lParam
& 0xffff); Index
++) {
495 Key
.UnicodeChar
= (CHAR16
) wParam
;
496 Key
.ScanCode
= SCAN_NULL
;
497 GopPrivateAddKey (Private
, Key
);
500 if (AltIsPress
== TRUE
) {
502 // When Alt is released there is no windoes message, so
503 // clean it after using it.
505 Private
->LeftAlt
= FALSE
;
506 Private
->RightAlt
= FALSE
;
512 // ALT is pressed with another key released
514 WinNtGopConvertParamToEfiKeyShiftState (Private
, &wParam
, &lParam
, FALSE
);
518 Key
.ScanCode
= SCAN_NULL
;
519 Key
.UnicodeChar
= CHAR_NULL
;
521 // A value key press will cause a WM_KEYDOWN first, then cause a WM_CHAR
522 // So if there is no modifier key updated, skip the WM_KEYDOWN even.
524 if (WinNtGopConvertParamToEfiKey (Private
, &wParam
, &lParam
, &Key
)) {
526 // Support the partial keystroke, add all keydown event into the queue.
528 GopPrivateAddKey (Private
, Key
);
533 WinNtGopConvertParamToEfiKeyShiftState (Private
, &wParam
, &lParam
, FALSE
);
538 // This close message is issued by user, core is not aware of this,
539 // so don't release the window display resource, just hide the window.
541 ShowWindow (Private
->WindowHandle
, SW_HIDE
);
545 DestroyWindow (hwnd
);
548 HeapFree (GetProcessHeap (), 0, Private
->VirtualScreenInfo
);
556 return DefWindowProc (hwnd
, iMsg
, wParam
, lParam
);
561 This thread simulates the end of WinMain () aplication. Each Winow nededs
562 to process it's events. The messages are dispatched to
563 WinNtGopThreadWindowProc ().
564 Be very careful sine WinNtGopThreadWinMain () and WinNtGopThreadWindowProc ()
565 are running in a seperate thread. We have to do this to process the events.
567 @param lpParameter Handle of window to manage.
569 @return if a WM_QUIT message is returned exit.
574 WinNtGopThreadWinMain (
579 GRAPHICS_PRIVATE_DATA
*Private
;
582 Private
= (GRAPHICS_PRIVATE_DATA
*) lpParameter
;
583 ASSERT (NULL
!= Private
);
586 // Since each thread has unique private data, save the private data in Thread
587 // Local Storage slot. Then the shared global mTlsIndex can be used to get
588 // thread specific context.
590 TlsSetValue (mTlsIndex
, Private
);
592 Private
->ThreadId
= GetCurrentThreadId ();
594 Private
->WindowsClass
.cbSize
= sizeof (WNDCLASSEX
);
595 Private
->WindowsClass
.style
= CS_HREDRAW
| CS_VREDRAW
| CS_OWNDC
;
596 Private
->WindowsClass
.lpfnWndProc
= WinNtGopThreadWindowProc
;
597 Private
->WindowsClass
.cbClsExtra
= 0;
598 Private
->WindowsClass
.cbWndExtra
= 0;
599 Private
->WindowsClass
.hInstance
= NULL
;
600 Private
->WindowsClass
.hIcon
= LoadIcon (NULL
, IDI_APPLICATION
);
601 Private
->WindowsClass
.hCursor
= LoadCursor (NULL
, IDC_ARROW
);
602 Private
->WindowsClass
.hbrBackground
= (HBRUSH
)(UINTN
)COLOR_WINDOW
;
603 Private
->WindowsClass
.lpszMenuName
= NULL
;
604 Private
->WindowsClass
.lpszClassName
= WIN_NT_GOP_CLASS_NAME
;
605 Private
->WindowsClass
.hIconSm
= LoadIcon (NULL
, IDI_APPLICATION
);
608 // Use 100 x 100 as initial Window size.
610 Private
->Width
= 100;
611 Private
->Height
= 100;
615 // This call will fail after the first time, but thats O.K. since we only need
616 // WIN_NT_GOP_CLASS_NAME to exist to create the window.
618 RegisterClassEx (&Private
->WindowsClass
);
621 // Setting Rect values to allow for the AdjustWindowRect to provide
622 // us the correct sizes for the client area when doing the CreateWindowEx
625 Rect
.bottom
= Private
->Height
;
627 Rect
.right
= Private
->Width
;
629 AdjustWindowRect (&Rect
, WS_OVERLAPPEDWINDOW
, 0);
631 Private
->WindowHandle
= CreateWindowEx (
633 WIN_NT_GOP_CLASS_NAME
,
638 Rect
.right
- Rect
.left
,
639 Rect
.bottom
- Rect
.top
,
647 // The reset of this thread is the standard winows program. We need a sperate
648 // thread since we must process the message loop to make windows act like
652 ShowWindow (Private
->WindowHandle
, SW_SHOW
);
653 UpdateWindow (Private
->WindowHandle
);
656 // Let the main thread get some work done
658 ReleaseSemaphore (Private
->ThreadInited
, 1, NULL
);
661 // This is the message loop that all Windows programs need.
663 while (GetMessage (&Message
, Private
->WindowHandle
, 0, 0)) {
664 TranslateMessage (&Message
);
665 DispatchMessage (&Message
);
668 return (DWORD
)Message
.wParam
;
673 TODO: Add function description
675 @param Private TODO: add argument description
676 @param HorizontalResolution TODO: add argument description
677 @param VerticalResolution TODO: add argument description
678 @param ColorDepth TODO: add argument description
679 @param RefreshRate TODO: add argument description
681 @return TODO: add return values
686 WinNtGraphicsWindowOpen (
687 IN EMU_IO_THUNK_PROTOCOL
*This
691 GRAPHICS_PRIVATE_DATA
*Private
;
693 Private
= AllocateZeroPool (sizeof (*Private
));
695 GopPrivateCreateQ (Private
, &Private
->QueueForRead
);
697 Private
->GraphicsWindowIo
.Size
= WinNtWndSize
;
698 Private
->GraphicsWindowIo
.CheckKey
= WinNtWndCheckKey
;
699 Private
->GraphicsWindowIo
.GetKey
= WinNtWndGetKey
;
700 Private
->GraphicsWindowIo
.KeySetState
= WinNtWndKeySetState
;
701 Private
->GraphicsWindowIo
.RegisterKeyNotify
= WinNtWndRegisterKeyNotify
;
702 Private
->GraphicsWindowIo
.Blt
= WinNtWndBlt
;
703 Private
->GraphicsWindowIo
.CheckPointer
= WinNtWndCheckPointer
;
704 Private
->GraphicsWindowIo
.GetPointerState
= WinNtWndGetPointerState
;
706 Private
->WindowName
= This
->ConfigString
;
708 // Initialize a Thread Local Storge variable slot. We use TLS to get the
709 // correct Private data instance into the windows thread.
711 if (mTlsIndex
== TLS_OUT_OF_INDEXES
) {
712 ASSERT (0 == mTlsIndexUseCount
);
713 mTlsIndex
= TlsAlloc ();
717 // always increase the use count!
721 Private
->ThreadInited
= CreateSemaphore (NULL
, 0, 1, NULL
);
722 Private
->ThreadHandle
= CreateThread (
725 WinNtGopThreadWinMain
,
732 // The other thread has entered the windows message loop so we can
733 // continue our initialization.
735 WaitForSingleObject (Private
->ThreadInited
, INFINITE
);
736 CloseHandle (Private
->ThreadInited
);
738 This
->Private
= Private
;
739 This
->Interface
= &Private
->GraphicsWindowIo
;
746 WinNtGraphicsWindowClose (
747 IN EMU_IO_THUNK_PROTOCOL
*This
750 GRAPHICS_PRIVATE_DATA
*Private
;
752 Private
= (GRAPHICS_PRIVATE_DATA
*)This
->Private
;
755 // BugBug: Shutdown GOP Hardware and any child devices.
757 SendMessage (Private
->WindowHandle
, WM_DESTROY
, 0, 0);
758 CloseHandle (Private
->ThreadHandle
);
763 // The callback function for another window could still be called,
764 // so we need to make sure there are no more users of mTlsIndex.
766 if (0 == mTlsIndexUseCount
) {
767 ASSERT (TLS_OUT_OF_INDEXES
!= mTlsIndex
);
770 mTlsIndex
= TLS_OUT_OF_INDEXES
;
773 Private
->WindowsClass
.lpszClassName
,
774 Private
->WindowsClass
.hInstance
779 GopPrivateDestroyQ (Private
, &Private
->QueueForRead
);
784 EMU_IO_THUNK_PROTOCOL mWinNtWndThunkIo
= {
785 &gEmuGraphicsWindowProtocolGuid
,
789 WinNtGraphicsWindowOpen
,
790 WinNtGraphicsWindowClose
,