ReactOS 0.4.17-dev-37-g0bfb40d
painting.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Win32k subsystem
4 * PURPOSE: Window painting function
5 * FILE: win32ss/user/ntuser/painting.c
6 * PROGRAMER: Filip Navara (xnavara@volny.cz)
7 */
8
9#include <win32k.h>
10DBG_DEFAULT_CHANNEL(UserPainting);
11
13 LPCWSTR lpString, UINT count);
14
15/* PRIVATE FUNCTIONS **********************************************************/
16
36{
37 PWND ParentWnd;
38
39 if (Child->ExStyle & WS_EX_REDIRECTED)
40 return TRUE;
41
42 ParentWnd = Child->spwndParent;
43 while (ParentWnd != NULL)
44 {
45 if (!(ParentWnd->style & WS_VISIBLE) ||
46 (ParentWnd->style & WS_MINIMIZE) ||
47 !RECTL_bIntersectRect(WindowRect, WindowRect, &ParentWnd->rcClient) )
48 {
49 return FALSE;
50 }
51
52 if (ParentWnd->ExStyle & WS_EX_REDIRECTED)
53 return TRUE;
54
55 ParentWnd = ParentWnd->spwndParent;
56 }
57
58 return TRUE;
59}
60
63{
64 RECTL ParentRect, Rect;
65 BOOL Start, Ret = TRUE;
66 PWND ParentWnd = Child;
67 PREGION Rgn = NULL;
68
69 if (ParentWnd->style & WS_CHILD)
70 {
71 do
72 ParentWnd = ParentWnd->spwndParent;
73 while (ParentWnd->style & WS_CHILD);
74 }
75
76 // No pending nonclient paints.
77 if (!(ParentWnd->state & WNDS_SYNCPAINTPENDING)) Recurse = FALSE;
78
79 Start = TRUE;
80 ParentWnd = Child->spwndParent;
81 while (ParentWnd)
82 {
83 if (ParentWnd->style & WS_CLIPCHILDREN)
84 break;
85
86 if (ParentWnd->hrgnUpdate != 0)
87 {
88 if (Recurse)
89 {
90 Ret = FALSE;
91 break;
92 }
93 // Start with child clipping.
94 if (Start)
95 {
96 Start = FALSE;
97
98 Rect = Child->rcWindow;
99
100 if (!IntIntersectWithParents(Child, &Rect)) break;
101
103
104 if (Child->hrgnClip)
105 {
106 PREGION RgnClip = REGION_LockRgn(Child->hrgnClip);
107 IntGdiCombineRgn(Rgn, Rgn, RgnClip, RGN_AND);
108 REGION_UnlockRgn(RgnClip);
109 }
110 }
111
112 ParentRect = ParentWnd->rcWindow;
113
114 if (!IntIntersectWithParents(ParentWnd, &ParentRect)) break;
115
116 IntInvalidateWindows( ParentWnd,
117 Rgn,
119 }
120 ParentWnd = ParentWnd->spwndParent;
121 }
122
123 if (Rgn) REGION_Delete(Rgn);
124
125 return Ret;
126}
127
128/*
129 Synchronize painting to the top-level windows of other threads.
130*/
133{
134 PTHREADINFO ptiCur, ptiWnd;
137 BOOL bSend = TRUE;
138
139 ptiWnd = Wnd->head.pti;
141 /*
142 Not the current thread, Wnd is in send Nonclient paint also in send erase background and it is visiable.
143 */
144 if ( Wnd->head.pti != ptiCur &&
145 Wnd->state & WNDS_SENDNCPAINT &&
147 Wnd->style & WS_VISIBLE)
148 {
149 // For testing, if you see this, break out the Champagne and have a party!
150 TRACE("SendSyncPaint Wnd in State!\n");
151 if (!IsListEmpty(&ptiWnd->SentMessagesListHead))
152 {
153 // Scan sent queue messages to see if we received sync paint messages.
156 do
157 {
158 TRACE("LOOP it\n");
159 if (Message->Msg.message == WM_SYNCPAINT &&
160 Message->Msg.hwnd == UserHMGetHandle(Wnd))
161 { // Already received so exit out.
162 ERR("SendSyncPaint Found one in the Sent Msg Queue!\n");
163 bSend = FALSE;
164 break;
165 }
166 Entry = Message->ListEntry.Flink;
168 }
169 while (Entry != &ptiWnd->SentMessagesListHead);
170 }
171 if (bSend)
172 {
173 TRACE("Sending WM_SYNCPAINT\n");
174 // This message has no parameters. But it does! Pass Flags along.
177 }
178 }
179
180 // Send to all the children if this is the desktop window.
181 if (UserIsDesktopWindow(Wnd))
182 {
183 if ( Flags & RDW_ALLCHILDREN ||
184 ( !(Flags & RDW_NOCHILDREN) && Wnd->style & WS_CLIPCHILDREN))
185 {
186 PWND spwndChild = Wnd->spwndChild;
187 while(spwndChild)
188 {
189 if ( spwndChild->style & WS_CHILD &&
190 spwndChild->head.pti != ptiCur)
191 {
192 spwndChild = spwndChild->spwndNext;
193 continue;
194 }
195 IntSendSyncPaint( spwndChild, Flags );
196 spwndChild = spwndChild->spwndNext;
197 }
198 }
199 }
200}
201
202/*
203 * @name IntCalcWindowRgn
204 *
205 * Get a window or client region.
206 */
207
208HRGN FASTCALL
210{
211 HRGN hRgnWindow;
212
213 if (Client)
214 {
215 hRgnWindow = NtGdiCreateRectRgn(
216 Wnd->rcClient.left,
217 Wnd->rcClient.top,
218 Wnd->rcClient.right,
219 Wnd->rcClient.bottom);
220 }
221 else
222 {
223 hRgnWindow = NtGdiCreateRectRgn(
224 Wnd->rcWindow.left,
225 Wnd->rcWindow.top,
226 Wnd->rcWindow.right,
227 Wnd->rcWindow.bottom);
228 }
229
230 if (Wnd->hrgnClip != NULL && !(Wnd->style & WS_MINIMIZE))
231 {
232 NtGdiOffsetRgn(hRgnWindow,
233 -Wnd->rcWindow.left,
234 -Wnd->rcWindow.top);
235 NtGdiCombineRgn(hRgnWindow, hRgnWindow, Wnd->hrgnClip, RGN_AND);
236 NtGdiOffsetRgn(hRgnWindow,
237 Wnd->rcWindow.left,
238 Wnd->rcWindow.top);
239 }
240
241 return hRgnWindow;
242}
243
244/*
245 * @name IntGetNCUpdateRgn
246 *
247 * Get non-client update region of a window and optionally validate it.
248 *
249 * @param Window
250 * Pointer to window to get the NC update region from.
251 * @param Validate
252 * Set to TRUE to force validating the NC update region.
253 *
254 * @return
255 * Handle to NC update region. The caller is responsible for deleting
256 * it.
257 */
258
259HRGN FASTCALL
261{
262 HRGN hRgnNonClient;
263 HRGN hRgnWindow;
264 UINT RgnType, NcType;
265 RECT update;
266
267 if (Window->hrgnUpdate != NULL &&
268 Window->hrgnUpdate != HRGN_WINDOW)
269 {
270 hRgnNonClient = IntCalcWindowRgn(Window, FALSE);
271
272 /*
273 * If region creation fails it's safe to fallback to whole
274 * window region.
275 */
276 if (hRgnNonClient == NULL)
277 {
278 return HRGN_WINDOW;
279 }
280
281 hRgnWindow = IntCalcWindowRgn(Window, TRUE);
282 if (hRgnWindow == NULL)
283 {
284 GreDeleteObject(hRgnNonClient);
285 return HRGN_WINDOW;
286 }
287
288 NcType = IntGdiGetRgnBox(hRgnNonClient, &update);
289
290 RgnType = NtGdiCombineRgn(hRgnNonClient, hRgnNonClient, hRgnWindow, RGN_DIFF);
291
292 if (RgnType == ERROR)
293 {
294 GreDeleteObject(hRgnWindow);
295 GreDeleteObject(hRgnNonClient);
296 return HRGN_WINDOW;
297 }
298 else if (RgnType == NULLREGION)
299 {
300 GreDeleteObject(hRgnWindow);
301 GreDeleteObject(hRgnNonClient);
302 Window->state &= ~WNDS_UPDATEDIRTY;
303 return NULL;
304 }
305
306 /*
307 * Remove the nonclient region from the standard update region if
308 * we were asked for it.
309 */
310
311 if (Validate)
312 {
313 if (NtGdiCombineRgn(Window->hrgnUpdate, Window->hrgnUpdate, hRgnWindow, RGN_AND) == NULLREGION)
314 {
316 GreDeleteObject(Window->hrgnUpdate);
317 Window->state &= ~WNDS_UPDATEDIRTY;
318 Window->hrgnUpdate = NULL;
319 if (!(Window->state & WNDS_INTERNALPAINT))
320 MsqDecPaintCountQueue(Window->head.pti);
321 }
322 }
323
324 /* check if update rgn contains complete nonclient area */
325 if (NcType == SIMPLEREGION)
326 {
327 RECT window;
329
330 if (IntEqualRect( &window, &update ))
331 {
332 GreDeleteObject(hRgnNonClient);
333 hRgnNonClient = HRGN_WINDOW;
334 }
335 }
336
337 GreDeleteObject(hRgnWindow);
338
339 return hRgnNonClient;
340 }
341 else
342 {
343 return Window->hrgnUpdate;
344 }
345}
346
349{
350 pWnd->state &= ~WNDS_SENDNCPAINT;
351
352 if ( pWnd == GetW32ThreadInfo()->MessageQueue->spwndActive &&
353 !(pWnd->state & WNDS_ACTIVEFRAME))
354 {
355 pWnd->state |= WNDS_ACTIVEFRAME;
356 pWnd->state &= ~WNDS_NONCPAINT;
358 }
359
361 {
362 pWnd->state2 &= ~WNDS2_FORCEFULLNCPAINTCLIPRGN;
364 }
365
367}
368
371{
372 pWnd = pWnd->spwndChild;
373 while (pWnd)
374 {
375 if ((pWnd->hrgnUpdate == NULL) && (pWnd->state & WNDS_SENDNCPAINT))
376 {
377 PWND Next;
379
380 /* Reference, IntSendNCPaint leaves win32k */
381 UserRefObjectCo(pWnd, &Ref);
383
384 /* Make sure to grab next one before dereferencing/freeing */
385 Next = pWnd->spwndNext;
386 UserDerefObjectCo(pWnd);
387 pWnd = Next;
388 }
389 else
390 {
391 pWnd = pWnd->spwndNext;
392 }
393 }
394}
395
396/*
397 * IntPaintWindows
398 *
399 * Internal function used by IntRedrawWindow.
400 */
401
404{
405 HDC hDC;
407 HRGN TempRegion = NULL;
408
409 Wnd->state &= ~WNDS_PAINTNOTPROCESSED;
410
411 if (Wnd->state & WNDS_SENDNCPAINT ||
413 {
414 if (!(Wnd->style & WS_VISIBLE))
415 {
417 return;
418 }
419 else
420 {
421 if (Wnd->hrgnUpdate == NULL)
422 {
424 }
425
426 if (Wnd->head.pti == PsGetCurrentThreadWin32Thread())
427 {
428 if (Wnd->state & WNDS_SENDNCPAINT)
429 {
430 TempRegion = IntGetNCUpdateRgn(Wnd, TRUE);
431
432 IntSendNCPaint(Wnd, TempRegion);
433
434 if (TempRegion > HRGN_WINDOW && GreIsHandleValid(TempRegion))
435 {
436 /* NOTE: The region can already be deleted! */
437 GreDeleteObject(TempRegion);
438 }
439 }
440
442 {
444 if (Wnd->hrgnUpdate)
445 {
446 hDC = UserGetDCEx( Wnd,
447 Wnd->hrgnUpdate,
449
450 if (Wnd->head.pti->ppi != pti->ppi)
451 {
452 ERR("Sending DC to another Process!!!\n");
453 }
454
456 // Kill the loop, so Clear before we send.
458 {
460 }
461 UserReleaseDC(Wnd, hDC, FALSE);
462 }
463 }
464 }
465
466 }
467 }
468
469 /*
470 * Check that the window is still valid at this point
471 */
472 if (!IntIsWindow(hWnd))
473 {
474 return;
475 }
476
477 /*
478 * Paint child windows.
479 */
480
481 if (!(Flags & RDW_NOCHILDREN) &&
482 !(Wnd->style & WS_MINIMIZE) &&
485 {
486 HWND *List, *phWnd;
488
489 if ((List = IntWinListChildren(Wnd)))
490 {
491 for (phWnd = List; *phWnd; ++phWnd)
492 {
493 if ((Wnd = UserGetWindowObject(*phWnd)) == NULL)
494 continue;
495
496 if (Wnd->head.pti != pti && Wnd->style & WS_CHILD)
497 continue;
498
499 if (Wnd->style & WS_VISIBLE)
500 {
502 UserRefObjectCo(Wnd, &Ref);
505 }
506 }
508 }
509 }
510}
511
512/*
513 * IntUpdateWindows
514 *
515 * Internal function used by IntRedrawWindow, simplecall.
516 */
517
520{
523
524 if ( Wnd->hrgnUpdate != NULL || Wnd->state & WNDS_INTERNALPAINT )
525 {
526 if (Wnd->hrgnUpdate)
527 {
528 if (!IntValidateParents(Wnd, Recurse))
529 {
530 return;
531 }
532 }
533
534 if (Wnd->state & WNDS_INTERNALPAINT)
535 {
536 Wnd->state &= ~WNDS_INTERNALPAINT;
537
538 if (Wnd->hrgnUpdate == NULL)
539 MsqDecPaintCountQueue(Wnd->head.pti);
540 }
541
543 Wnd->state &= ~WNDS_UPDATEDIRTY;
544
546
547 UserRefObjectCo(Wnd, &Ref);
549
550 if (Wnd->state & WNDS_PAINTNOTPROCESSED)
551 {
553 }
555 }
556
557 // Force flags as a toggle. Fixes msg:test_paint_messages:WmChildPaintNc.
558 Flags = (Flags & RDW_NOCHILDREN) ? RDW_NOCHILDREN : RDW_ALLCHILDREN; // All children is the default.
559
560 /*
561 * Update child windows.
562 */
563
564 if (!(Flags & RDW_NOCHILDREN) &&
567 {
568 PWND Child;
569
570 for (Child = Wnd->spwndChild; Child; Child = Child->spwndNext)
571 {
572 /* transparent window, check for non-transparent sibling to paint first, then skip it */
573 if ( Child->ExStyle & WS_EX_TRANSPARENT &&
574 ( Child->hrgnUpdate != NULL || Child->state & WNDS_INTERNALPAINT ) )
575 {
576 PWND Next = Child->spwndNext;
577 while (Next)
578 {
579 if ( Next->hrgnUpdate != NULL || Next->state & WNDS_INTERNALPAINT ) break;
580
581 Next = Next->spwndNext;
582 }
583
584 if (Next) continue;
585 }
586
587 if (Child->style & WS_VISIBLE)
588 {
590 UserRefObjectCo(Child, &Ref);
593 }
594 }
595 }
596}
597
600{
601 // If transparent and any sibling windows below needs to be painted, leave.
602 if (pWnd->ExStyle & WS_EX_TRANSPARENT)
603 {
604 PWND Next = pWnd->spwndNext;
605
606 while(Next)
607 {
608 if ( Next->head.pti == pWnd->head.pti &&
609 ( Next->hrgnUpdate != NULL || Next->state & WNDS_INTERNALPAINT) )
610 {
611 return;
612 }
613
614 Next = Next->spwndNext;
615 }
616 }
618}
619
622{
623 PWND Parent = pWnd;
624 // Find parent, if it needs to be painted, leave.
625 while(TRUE)
626 {
627 if ((Parent = Parent->spwndParent) == NULL) break;
628 if ( Parent->style & WS_CLIPCHILDREN ) break;
629 if ( Parent->hrgnUpdate != NULL || Parent->state & WNDS_INTERNALPAINT ) return;
630 }
631
632 IntSendSyncPaint(pWnd, Flags);
634}
635
636/*
637 * IntInvalidateWindows
638 *
639 * Internal function used by IntRedrawWindow, UserRedrawDesktop,
640 * co_WinPosSetWindowPos, co_UserRedrawWindow.
641 */
644{
645 INT RgnType = NULLREGION;
646 BOOL HadPaintMessage;
647
648 TRACE("IntInvalidateWindows start Rgn %p\n",Rgn);
649
650 if ( Rgn > PRGN_WINDOW )
651 {
652 /*
653 * If the nonclient is not to be redrawn, clip the region to the client
654 * rect
655 */
656 if ((Flags & RDW_INVALIDATE) != 0 && (Flags & RDW_FRAME) == 0)
657 {
658 PREGION RgnClient;
659
660 RgnClient = IntSysCreateRectpRgnIndirect(&Wnd->rcClient);
661 if (RgnClient)
662 {
663 RgnType = IntGdiCombineRgn(Rgn, Rgn, RgnClient, RGN_AND);
664 REGION_Delete(RgnClient);
665 }
666 }
667
668 /*
669 * Clip the given region with window rectangle (or region)
670 */
671
672 if (!Wnd->hrgnClip || (Wnd->style & WS_MINIMIZE))
673 {
675 if (RgnWindow)
676 {
677 RgnType = IntGdiCombineRgn(Rgn, Rgn, RgnWindow, RGN_AND);
678 REGION_Delete(RgnWindow);
679 }
680 }
681 else
682 {
683 PREGION RgnClip = REGION_LockRgn(Wnd->hrgnClip);
684 if (RgnClip)
685 {
687 -Wnd->rcWindow.left,
688 -Wnd->rcWindow.top);
689 RgnType = IntGdiCombineRgn(Rgn, Rgn, RgnClip, RGN_AND);
691 Wnd->rcWindow.left,
692 Wnd->rcWindow.top);
693 REGION_UnlockRgn(RgnClip);
694 }
695 }
696 }
697 else
698 {
699 RgnType = NULLREGION;
700 }
701
702 /* Nothing to paint, just return */
703 if ((RgnType == NULLREGION && (Flags & RDW_INVALIDATE)) || RgnType == ERROR)
704 {
705 return;
706 }
707
708 /*
709 * Save current state of pending updates
710 */
711
712 HadPaintMessage = IntIsWindowDirty(Wnd);
713
714 /*
715 * Update the region and flags
716 */
717
718 // The following flags are used to invalidate the window.
720 {
722 {
724 }
725
726 if (Flags & RDW_INVALIDATE )
727 {
728 PREGION RgnUpdate;
729
730 Wnd->state &= ~WNDS_NONCPAINT;
731
732 /* If not the same thread set it dirty. */
733 if (Wnd->head.pti != PsGetCurrentThreadWin32Thread())
734 {
735 Wnd->state |= WNDS_UPDATEDIRTY;
736 if (Wnd->state2 & WNDS2_WMPAINTSENT)
738 }
739
740 if (Flags & RDW_FRAME)
741 Wnd->state |= WNDS_SENDNCPAINT;
742
743 if (Flags & RDW_ERASE)
745
746 if (RgnType != NULLREGION && Rgn > PRGN_WINDOW)
747 {
748 if (Wnd->hrgnUpdate == NULL)
749 {
750 Wnd->hrgnUpdate = NtGdiCreateRectRgn(0, 0, 0, 0);
752 }
753
754 if (Wnd->hrgnUpdate != HRGN_WINDOW)
755 {
756 RgnUpdate = REGION_LockRgn(Wnd->hrgnUpdate);
757 if (RgnUpdate)
758 {
759 RgnType = IntGdiCombineRgn(RgnUpdate, RgnUpdate, Rgn, RGN_OR);
760 REGION_UnlockRgn(RgnUpdate);
761 if (RgnType == NULLREGION)
762 {
765 Wnd->hrgnUpdate = NULL;
766 }
767 }
768 }
769 }
770
771 Flags |= RDW_ERASE|RDW_FRAME; // For children.
772
773 }
774
775 if (!HadPaintMessage && IntIsWindowDirty(Wnd))
776 {
777 MsqIncPaintCountQueue(Wnd->head.pti);
778 }
779
780 } // The following flags are used to validate the window.
782 {
784 return;
785
787 {
788 Wnd->state &= ~WNDS_INTERNALPAINT;
789 }
790
791 if (Flags & RDW_VALIDATE)
792 {
793 if (Flags & RDW_NOFRAME)
794 Wnd->state &= ~WNDS_SENDNCPAINT;
795
796 if (Flags & RDW_NOERASE)
798
799 if (Wnd->hrgnUpdate > HRGN_WINDOW && RgnType != NULLREGION && Rgn > PRGN_WINDOW)
800 {
801 PREGION RgnUpdate = REGION_LockRgn(Wnd->hrgnUpdate);
802
803 if (RgnUpdate)
804 {
805 RgnType = IntGdiCombineRgn(RgnUpdate, RgnUpdate, Rgn, RGN_DIFF);
806 REGION_UnlockRgn(RgnUpdate);
807
808 if (RgnType == NULLREGION)
809 {
812 Wnd->hrgnUpdate = NULL;
813 }
814 }
815 }
816 // If update is null, do not erase.
817 if (Wnd->hrgnUpdate == NULL)
818 {
820 }
821 }
822
823 if (HadPaintMessage && !IntIsWindowDirty(Wnd))
824 {
825 MsqDecPaintCountQueue(Wnd->head.pti);
826 }
827 }
828
829 /*
830 * Process children if needed
831 */
832
833 if (!(Flags & RDW_NOCHILDREN) &&
834 !(Wnd->style & WS_MINIMIZE) &&
835 ((Flags & RDW_ALLCHILDREN) || !(Wnd->style & WS_CLIPCHILDREN)))
836 {
837 PWND Child;
838
839 for (Child = Wnd->spwndChild; Child; Child = Child->spwndNext)
840 {
841 if (Child->style & WS_VISIBLE)
842 {
843 /*
844 * Recursive call to update children hrgnUpdate
845 */
846 PREGION RgnTemp = IntSysCreateRectpRgn(0, 0, 0, 0);
847 if (RgnTemp)
848 {
849 if (Rgn > PRGN_WINDOW) IntGdiCombineRgn(RgnTemp, Rgn, 0, RGN_COPY);
850 IntInvalidateWindows(Child, ((Rgn > PRGN_WINDOW)?RgnTemp:Rgn), Flags);
851 REGION_Delete(RgnTemp);
852 }
853 }
854 }
855 }
856 TRACE("IntInvalidateWindows exit\n");
857}
858
859/*
860 * IntIsWindowDrawable
861 *
862 * Remarks
863 * Window is drawable when it is visible and all parents are not
864 * minimized.
865 */
866
869{
870 PWND WndObject;
871
872 for (WndObject = Wnd; WndObject != NULL; WndObject = WndObject->spwndParent)
873 {
874 if ( WndObject->state2 & WNDS2_INDESTROY ||
875 WndObject->state & WNDS_DESTROYED ||
876 !WndObject ||
877 !(WndObject->style & WS_VISIBLE) ||
878 ((WndObject->style & WS_MINIMIZE) && (WndObject != Wnd)))
879 {
880 return FALSE;
881 }
882 }
883
884 return TRUE;
885}
886
887/*
888 * IntRedrawWindow
889 *
890 * Internal version of NtUserRedrawWindow that takes WND as
891 * first parameter.
892 */
893
896 PWND Window,
897 const RECTL* UpdateRect,
898 PREGION UpdateRgn,
899 ULONG Flags)
900{
901 PREGION TmpRgn = NULL;
902 TRACE("co_UserRedrawWindow start Rgn %p\n",UpdateRgn);
903
904 /*
905 * Step 1.
906 * Validation of passed parameters.
907 */
908
910 {
911 return TRUE; // Just do nothing!!!
912 }
913
914 if (Window == NULL)
915 {
917 }
918
919 /*
920 * Step 2.
921 * Transform the parameters UpdateRgn and UpdateRect into
922 * a region hRgn specified in screen coordinates.
923 */
924
925 if (Flags & (RDW_INVALIDATE | RDW_VALIDATE)) // Both are OKAY!
926 {
927 /* We can't hold lock on GDI objects while doing roundtrips to user mode,
928 * so use a copy instead */
929 if (UpdateRgn)
930 {
931 TmpRgn = IntSysCreateRectpRgn(0, 0, 0, 0);
932
933 if (UpdateRgn > PRGN_WINDOW)
934 {
935 IntGdiCombineRgn(TmpRgn, UpdateRgn, NULL, RGN_COPY);
936 }
937
939 {
940 REGION_bOffsetRgn(TmpRgn, Window->rcClient.left, Window->rcClient.top);
941 }
942 }
943 else
944 {
945 if (UpdateRect != NULL)
946 {
948 {
950 }
951 else
952 {
953 TmpRgn = IntSysCreateRectpRgn(Window->rcClient.left + UpdateRect->left,
954 Window->rcClient.top + UpdateRect->top,
955 Window->rcClient.left + UpdateRect->right,
956 Window->rcClient.top + UpdateRect->bottom);
957 }
958 }
959 else
960 {
963 {
964 if (!RECTL_bIsEmptyRect(&Window->rcWindow))
965 TmpRgn = IntSysCreateRectpRgnIndirect(&Window->rcWindow);
966 }
967 else
968 {
969 if (!RECTL_bIsEmptyRect(&Window->rcClient))
970 TmpRgn = IntSysCreateRectpRgnIndirect(&Window->rcClient);
971 }
972 }
973 }
974 }
975
976 /* Fixes test RDW_INTERNALPAINT behavior */
977 if (TmpRgn == NULL)
978 {
979 TmpRgn = PRGN_WINDOW; // Need a region so the bits can be set!!!
980 }
981
982 /*
983 * Step 3.
984 * Adjust the window update region depending on hRgn and flags.
985 */
986
988 TmpRgn != NULL)
989 {
991 }
992
993 /*
994 * Step 4.
995 * Repaint and erase windows if needed.
996 */
997
998 if (Flags & RDW_UPDATENOW)
999 {
1001 }
1002 else if (Flags & RDW_ERASENOW)
1003 {
1004 if ((Flags & (RDW_NOCHILDREN|RDW_ALLCHILDREN)) == 0)
1006
1008 }
1009
1010 /*
1011 * Step 5.
1012 * Cleanup ;-)
1013 */
1014
1015 if (TmpRgn > PRGN_WINDOW)
1016 {
1017 REGION_Delete(TmpRgn);
1018 }
1019 TRACE("co_UserRedrawWindow exit\n");
1020
1021 return TRUE;
1022}
1023
1025PaintSuspendedWindow(PWND pwnd, HRGN hrgnOrig)
1026{
1027 if (pwnd->hrgnUpdate)
1028 {
1029 HDC hDC;
1031 HRGN hrgnTemp;
1032 RECT Rect;
1033 INT type;
1034 PREGION prgn;
1035
1036 if (pwnd->hrgnUpdate > HRGN_WINDOW)
1037 {
1038 hrgnTemp = NtGdiCreateRectRgn(0, 0, 0, 0);
1039 type = NtGdiCombineRgn( hrgnTemp, pwnd->hrgnUpdate, 0, RGN_COPY);
1040 if (type == ERROR)
1041 {
1042 GreDeleteObject(hrgnTemp);
1043 hrgnTemp = HRGN_WINDOW;
1044 }
1045 }
1046 else
1047 {
1048 hrgnTemp = GreCreateRectRgnIndirect(&pwnd->rcWindow);
1049 }
1050
1051 if ( hrgnOrig &&
1052 hrgnTemp > HRGN_WINDOW &&
1053 NtGdiCombineRgn(hrgnTemp, hrgnTemp, hrgnOrig, RGN_AND) == NULLREGION)
1054 {
1055 GreDeleteObject(hrgnTemp);
1056 return;
1057 }
1058
1060
1061 Rect = pwnd->rcWindow;
1062 RECTL_vOffsetRect(&Rect, -pwnd->rcWindow.left, -pwnd->rcWindow.top);
1063
1064 // Clear out client area!
1066
1067 NC_DoNCPaint(pwnd, hDC, Flags); // Redraw without MENUs.
1068
1069 UserReleaseDC(pwnd, hDC, FALSE);
1070
1071 prgn = REGION_LockRgn(hrgnTemp);
1073 REGION_UnlockRgn(prgn);
1074
1075 // Set updates for this window.
1077
1078 // DCX_KEEPCLIPRGN is set. Check it anyway.
1079 if (hrgnTemp > HRGN_WINDOW && GreIsHandleValid(hrgnTemp)) GreDeleteObject(hrgnTemp);
1080 }
1081}
1082
1085{
1086 PaintSuspendedWindow( pWnd, hRgn );
1087
1088 if (!(pWnd->style & WS_CLIPCHILDREN))
1089 return;
1090
1091 pWnd = pWnd->spwndChild; // invalidate children if any.
1092 while (pWnd)
1093 {
1094 UpdateTheadChildren( pWnd, hRgn );
1095 pWnd = pWnd->spwndNext;
1096 }
1097}
1098
1101{
1102 PWND pwndTemp;
1103
1104 for ( pwndTemp = pWnd;
1105 pwndTemp;
1106 pwndTemp = pwndTemp->spwndNext )
1107 {
1108 if (pwndTemp->head.pti == pti)
1109 {
1111 }
1112 else
1113 {
1114 if (IsThreadSuspended(pwndTemp->head.pti) || MsqIsHung(pwndTemp->head.pti, MSQ_HUNG))
1115 {
1116 UpdateTheadChildren(pwndTemp, hRgn);
1117 }
1118 else
1120 }
1121 }
1122}
1123
1126{
1127 return ( Wnd->style & WS_VISIBLE &&
1128 ( Wnd->hrgnUpdate != NULL ||
1129 Wnd->state & WNDS_INTERNALPAINT ) );
1130}
1131
1132/*
1133 Conditions to paint any window:
1134
1135 1. Update region is not null.
1136 2. Internal paint flag is set.
1137 3. Paint count is not zero.
1138
1139 */
1142{
1143 PWND hChild;
1144 PWND TempWindow;
1145
1146 for (; Window != NULL; Window = Window->spwndNext)
1147 {
1149 {
1151 {
1152 /* Make sure all non-transparent siblings are already drawn. */
1153 if (Window->ExStyle & WS_EX_TRANSPARENT)
1154 {
1155 for (TempWindow = Window->spwndNext; TempWindow != NULL;
1156 TempWindow = TempWindow->spwndNext)
1157 {
1158 if (!(TempWindow->ExStyle & WS_EX_TRANSPARENT) &&
1159 IntWndBelongsToThread(TempWindow, Thread) &&
1160 IntIsWindowDirty(TempWindow))
1161 {
1162 return TempWindow;
1163 }
1164 }
1165 }
1166 return Window;
1167 }
1168 }
1169 /* find a child of the specified window that needs repainting */
1170 if (Window->spwndChild)
1171 {
1173 if (hChild != NULL)
1174 return hChild;
1175 }
1176 }
1177 return Window;
1178}
1179
1180//
1181// Internal painting of windows.
1182//
1185{
1186 // Handle normal painting.
1188}
1189
1192 PWND Window,
1193 UINT MsgFilterMin,
1194 UINT MsgFilterMax,
1196 MSG *Message,
1197 BOOL Remove)
1198{
1199 PWND PaintWnd, StartWnd;
1200
1201 if ((MsgFilterMin != 0 || MsgFilterMax != 0) &&
1202 (MsgFilterMin > WM_PAINT || MsgFilterMax < WM_PAINT))
1203 return FALSE;
1204
1205 if (Thread->TIF_flags & TIF_SYSTEMTHREAD )
1206 {
1207 ERR("WM_PAINT is in a System Thread!\n");
1208 }
1209
1210 StartWnd = UserGetDesktopWindow();
1211 PaintWnd = IntFindWindowToRepaint(StartWnd, Thread);
1212
1213 Message->hwnd = PaintWnd ? UserHMGetHandle(PaintWnd) : NULL;
1214
1215 if (Message->hwnd == NULL && Thread->cPaintsReady)
1216 {
1217 // Find note in window.c:"PAINTING BUG".
1218 ERR("WARNING SOMETHING HAS GONE WRONG: Thread marked as containing dirty windows, but no dirty windows found! Counts %u\n",Thread->cPaintsReady);
1219 /* Hack to stop spamming the debug log ! */
1220 Thread->cPaintsReady = 0;
1221 return FALSE;
1222 }
1223
1224 if (Message->hwnd == NULL)
1225 return FALSE;
1226
1227 if (!(Window == NULL ||
1228 PaintWnd == Window ||
1229 IntIsChildWindow(Window, PaintWnd))) /* check that it is a child of the specified parent */
1230 return FALSE;
1231
1232 if (PaintWnd->state & WNDS_INTERNALPAINT)
1233 {
1234 PaintWnd->state &= ~WNDS_INTERNALPAINT;
1235 if (!PaintWnd->hrgnUpdate)
1237 }
1238 PaintWnd->state2 &= ~WNDS2_STARTPAINT;
1239 PaintWnd->state &= ~WNDS_UPDATEDIRTY;
1240
1241 Window = PaintWnd;
1242 while (Window && !UserIsDesktopWindow(Window))
1243 {
1244 // Role back and check for clip children, do not set if any.
1245 if (Window->spwndParent && !(Window->spwndParent->style & WS_CLIPCHILDREN))
1246 {
1247 PaintWnd->state2 |= WNDS2_WMPAINTSENT;
1248 }
1249 Window = Window->spwndParent;
1250 }
1251
1252 Message->wParam = Message->lParam = 0;
1253 Message->message = WM_PAINT;
1254 return TRUE;
1255}
1256
1257BOOL
1260 PWND pwnd,
1261 HDC hdcBlt,
1262 UINT nFlags)
1263{
1264 HDC hdcSrc;
1265 INT cx, cy, xSrc, ySrc;
1266
1267 if ( nFlags & PW_CLIENTONLY)
1268 {
1269 cx = pwnd->rcClient.right - pwnd->rcClient.left;
1270 cy = pwnd->rcClient.bottom - pwnd->rcClient.top;
1271 xSrc = pwnd->rcClient.left - pwnd->rcWindow.left;
1272 ySrc = pwnd->rcClient.top - pwnd->rcWindow.top;
1273 }
1274 else
1275 {
1276 cx = pwnd->rcWindow.right - pwnd->rcWindow.left;
1277 cy = pwnd->rcWindow.bottom - pwnd->rcWindow.top;
1278 xSrc = 0;
1279 ySrc = 0;
1280 }
1281
1282 // TODO: Setup Redirection for Print.
1283 return FALSE;
1284
1285 /* Update the window just incase. */
1287
1289 /* Print window to printer context. */
1290 NtGdiBitBlt( hdcBlt,
1291 0,
1292 0,
1293 cx,
1294 cy,
1295 hdcSrc,
1296 xSrc,
1297 ySrc,
1298 SRCCOPY,
1300 0);
1301
1302 UserReleaseDC( pwnd, hdcSrc, FALSE);
1303
1304 // TODO: Release Redirection from Print.
1305
1306 return TRUE;
1307}
1308
1309BOOL
1311IntFlashWindowEx(PWND pWnd, PFLASHWINFO pfwi)
1312{
1313 DWORD_PTR FlashState;
1314 UINT uCount = pfwi->uCount;
1315 BOOL Activate = FALSE, Ret = FALSE;
1316
1317 ASSERT(pfwi);
1318
1319 FlashState = (DWORD_PTR)UserGetProp(pWnd, AtomFlashWndState, TRUE);
1320
1321 if (FlashState == FLASHW_FINISHED)
1322 {
1323 // Cycle has finished, kill timer and set this to Stop.
1324 FlashState |= FLASHW_KILLSYSTIMER;
1325 pfwi->dwFlags = FLASHW_STOP;
1326 }
1327 else
1328 {
1329 if (FlashState)
1330 {
1331 if (pfwi->dwFlags == FLASHW_SYSTIMER)
1332 {
1333 // Called from system timer, restore flags, counts and state.
1334 pfwi->dwFlags = LOWORD(FlashState);
1335 uCount = HIWORD(FlashState);
1336 FlashState = MAKELONG(LOWORD(FlashState),0);
1337 }
1338 else
1339 {
1340 // Clean out the trash! Fix SeaMonkey crash after restart.
1341 FlashState = 0;
1342 }
1343 }
1344
1345 if (FlashState == 0)
1346 { // First time in cycle, setup flash state.
1347 if ( pWnd->state & WNDS_ACTIVEFRAME ||
1348 (pfwi->dwFlags & FLASHW_CAPTION && pWnd->style & (WS_BORDER|WS_DLGFRAME)))
1349 {
1350 FlashState = FLASHW_STARTED|FLASHW_ACTIVE;
1351 }
1352 }
1353
1354 // Set previous window state.
1355 Ret = !!(FlashState & FLASHW_ACTIVE);
1356
1357 if ( (pfwi->dwFlags & FLASHW_TIMERNOFG) == FLASHW_TIMERNOFG &&
1358 gpqForeground == pWnd->head.pti->MessageQueue )
1359 {
1360 // Flashing until foreground, set this to Stop.
1361 pfwi->dwFlags = FLASHW_STOP;
1362 }
1363 }
1364
1365 // Toggle activate flag.
1366 if ( pfwi->dwFlags == FLASHW_STOP )
1367 {
1368 if (gpqForeground && gpqForeground->spwndActive == pWnd)
1369 Activate = TRUE;
1370 else
1371 Activate = FALSE;
1372 }
1373 else
1374 {
1375 Activate = (FlashState & FLASHW_ACTIVE) == 0;
1376 }
1377
1378 if ( pfwi->dwFlags == FLASHW_STOP || pfwi->dwFlags & FLASHW_CAPTION )
1379 {
1380 co_IntSendMessage(UserHMGetHandle(pWnd), WM_NCACTIVATE, Activate, 0);
1381 }
1382
1383 // FIXME: Check for a Stop Sign here.
1384 if ( pfwi->dwFlags & FLASHW_TRAY )
1385 {
1386 // Need some shell work here too.
1387 TRACE("FIXME: Flash window no Tray support!\n");
1388 }
1389
1390 if ( pfwi->dwFlags == FLASHW_STOP )
1391 {
1392 if (FlashState & FLASHW_KILLSYSTIMER)
1393 {
1395 }
1396
1398 }
1399 else
1400 { // Have a count and started, set timer.
1401 if ( uCount )
1402 {
1403 FlashState |= FLASHW_COUNT;
1404
1405 if (!(Activate ^ !!(FlashState & FLASHW_STARTED)))
1406 uCount--;
1407
1408 if (!(FlashState & FLASHW_KILLSYSTIMER))
1409 pfwi->dwFlags |= FLASHW_TIMER;
1410 }
1411
1412 if (pfwi->dwFlags & FLASHW_TIMER)
1413 {
1414 FlashState |= FLASHW_KILLSYSTIMER;
1415
1416 IntSetTimer( pWnd,
1418 pfwi->dwTimeout ? pfwi->dwTimeout : gpsi->dtCaretBlink,
1420 TMRF_SYSTEM );
1421 }
1422
1423 if (FlashState & FLASHW_COUNT && uCount == 0)
1424 {
1425 // Keep spinning? Nothing else to do.
1426 FlashState = FLASHW_FINISHED;
1427 }
1428 else
1429 {
1430 // Save state and flags so this can be restored next time through.
1431 FlashState ^= (FlashState ^ -!!(Activate)) & FLASHW_ACTIVE;
1432 FlashState ^= (FlashState ^ pfwi->dwFlags) & (FLASHW_MASK & ~FLASHW_TIMER);
1433 }
1434 FlashState = MAKELONG(LOWORD(FlashState),uCount);
1435 UserSetProp(pWnd, AtomFlashWndState, (HANDLE)FlashState, TRUE);
1436 }
1437 return Ret;
1438}
1439
1442{
1443 RECT Rect;
1444 INT type;
1445 BOOL Erase = FALSE;
1446
1448
1449 Window->state2 |= WNDS2_STARTPAINT;
1450 Window->state &= ~WNDS_PAINTNOTPROCESSED;
1451
1452 if (Window->state & WNDS_SENDNCPAINT)
1453 {
1454 HRGN hRgn;
1455 // Application can keep update dirty.
1456 do
1457 {
1458 Window->state &= ~WNDS_UPDATEDIRTY;
1462 {
1463 /* NOTE: The region can already be deleted! */
1465 }
1466 }
1467 while(Window->state & WNDS_UPDATEDIRTY);
1468 }
1469 else
1470 {
1471 Window->state &= ~WNDS_UPDATEDIRTY;
1472 }
1473
1474 RtlZeroMemory(Ps, sizeof(PAINTSTRUCT));
1475
1476 if (Window->state2 & WNDS2_ENDPAINTINVALIDATE)
1477 {
1478 ERR("BP: Another thread invalidated this window\n");
1479 }
1480
1481 Ps->hdc = UserGetDCEx( Window,
1482 Window->hrgnUpdate,
1484 if (!Ps->hdc)
1485 {
1486 return NULL;
1487 }
1488
1489 // If set, always clear flags out due to the conditions later on for sending the message.
1490 if (Window->state & WNDS_SENDERASEBACKGROUND)
1491 {
1493 Erase = TRUE;
1494 }
1495
1496 if (Window->hrgnUpdate != NULL)
1497 {
1498 MsqDecPaintCountQueue(Window->head.pti);
1500 /* The region is part of the dc now and belongs to the process! */
1501 Window->hrgnUpdate = NULL;
1502 }
1503 else
1504 {
1505 if (Window->state & WNDS_INTERNALPAINT)
1506 MsqDecPaintCountQueue(Window->head.pti);
1507 }
1508
1509 type = GdiGetClipBox(Ps->hdc, &Ps->rcPaint);
1510
1512
1513 Window->state &= ~WNDS_INTERNALPAINT;
1514
1515 if ( Erase && // Set to erase,
1516 type != NULLREGION && // don't erase if the clip box is empty,
1517 (!(Window->pcls->style & CS_PARENTDC) || // not parent dc or
1518 RECTL_bIntersectRect( &Rect, &Rect, &Ps->rcPaint) ) ) // intersecting.
1519 {
1521 if ( Ps->fErase )
1522 {
1524 }
1525 }
1526 else
1527 {
1528 Ps->fErase = FALSE;
1529 }
1530
1532
1533 return Ps->hdc;
1534}
1535
1538{
1539 HDC hdc = NULL;
1540
1541 hdc = Ps->hdc;
1542
1543 UserReleaseDC(Wnd, hdc, TRUE);
1544
1546 {
1547 ERR("EP: Another thread invalidated this window\n");
1548 Wnd->state2 &= ~WNDS2_ENDPAINTINVALIDATE;
1549 }
1550
1552
1553 co_UserShowCaret(Wnd);
1554
1555 return TRUE;
1556}
1557
1560 PWND pWnd,
1561 HDC hDC,
1562 HBRUSH hBrush)
1563{
1564 RECT Rect, Rect1;
1565 INT type;
1566
1567 if (!pWndParent)
1568 pWndParent = pWnd;
1569
1570 type = GdiGetClipBox(hDC, &Rect);
1571
1572 IntGetClientRect(pWnd, &Rect1);
1573
1574 if ( type != NULLREGION && // Clip box is not empty,
1575 (!(pWnd->pcls->style & CS_PARENTDC) || // not parent dc or
1576 RECTL_bIntersectRect( &Rect, &Rect, &Rect1) ) ) // intersecting.
1577 {
1578 POINT ppt;
1579 INT x = 0, y = 0;
1580
1581 if (!UserIsDesktopWindow(pWndParent))
1582 {
1583 x = pWndParent->rcClient.left - pWnd->rcClient.left;
1584 y = pWndParent->rcClient.top - pWnd->rcClient.top;
1585 }
1586
1587 GreSetBrushOrg(hDC, x, y, &ppt);
1588
1589 if ( hBrush < (HBRUSH)CTLCOLOR_MAX )
1590 hBrush = GetControlColor( pWndParent, pWnd, hDC, HandleToUlong(hBrush) + WM_CTLCOLORMSGBOX);
1591
1592 FillRect(hDC, &Rect, hBrush);
1593
1594 GreSetBrushOrg(hDC, ppt.x, ppt.y, NULL);
1595
1596 return TRUE;
1597 }
1598 else
1599 return FALSE;
1600}
1601
1602/* PUBLIC FUNCTIONS ***********************************************************/
1603
1604/*
1605 * NtUserBeginPaint
1606 *
1607 * Status
1608 * @implemented
1609 */
1610
1613{
1614 PWND Window;
1615 PAINTSTRUCT Ps;
1617 HDC hDC;
1619 HDC Ret = NULL;
1620
1621 TRACE("Enter NtUserBeginPaint\n");
1623
1625 {
1626 goto Cleanup; // Return NULL
1627 }
1628
1629 UserRefObjectCo(Window, &Ref);
1630
1631 hDC = IntBeginPaint(Window, &Ps);
1632
1633 Status = MmCopyToCaller(UnsafePs, &Ps, sizeof(PAINTSTRUCT));
1634 if (! NT_SUCCESS(Status))
1635 {
1637 goto Cleanup; // Return NULL
1638 }
1639
1640 Ret = hDC;
1641
1642Cleanup:
1644
1645 TRACE("Leave NtUserBeginPaint, ret=%p\n", Ret);
1646 UserLeave();
1647 return Ret;
1648}
1649
1650/*
1651 * NtUserEndPaint
1652 *
1653 * Status
1654 * @implemented
1655 */
1656
1659{
1661 PWND Window;
1662 PAINTSTRUCT Ps;
1664 BOOL Ret = FALSE;
1665
1666 TRACE("Enter NtUserEndPaint\n");
1668
1670 {
1671 goto Cleanup; // Return FALSE
1672 }
1673
1674 UserRefObjectCo(Window, &Ref); // Here for the exception.
1675
1676 _SEH2_TRY
1677 {
1678 ProbeForRead(pUnsafePs, sizeof(*pUnsafePs), 1);
1679 RtlCopyMemory(&Ps, pUnsafePs, sizeof(PAINTSTRUCT));
1680 }
1682 {
1684 }
1685 _SEH2_END
1686 if (!NT_SUCCESS(Status))
1687 {
1688 goto Cleanup; // Return FALSE
1689 }
1690
1691 Ret = IntEndPaint(Window, &Ps);
1692
1693Cleanup:
1695
1696 TRACE("Leave NtUserEndPaint, ret=%i\n", Ret);
1697 UserLeave();
1698 return Ret;
1699}
1700
1701/*
1702 * FillWindow: Called from User; Dialog, Edit and ListBox procs during a WM_ERASEBKGND.
1703 */
1704/*
1705 * @implemented
1706 */
1709 HWND hWnd,
1710 HDC hDC,
1711 HBRUSH hBrush)
1712{
1713 BOOL ret = FALSE;
1714 PWND pWnd, pWndParent = NULL;
1716
1717 TRACE("Enter NtUserFillWindow\n");
1719
1720 if (!hDC)
1721 {
1722 goto Exit;
1723 }
1724
1725 if (!(pWnd = UserGetWindowObject(hWnd)))
1726 {
1727 goto Exit;
1728 }
1729
1730 if (hWndParent && !(pWndParent = UserGetWindowObject(hWndParent)))
1731 {
1732 goto Exit;
1733 }
1734
1735 UserRefObjectCo(pWnd, &Ref);
1736 ret = IntFillWindow( pWndParent, pWnd, hDC, hBrush );
1737 UserDerefObjectCo(pWnd);
1738
1739Exit:
1740 TRACE("Leave NtUserFillWindow, ret=%i\n",ret);
1741 UserLeave();
1742 return ret;
1743}
1744
1745/*
1746 * @implemented
1747 */
1749NtUserFlashWindowEx(IN PFLASHWINFO pfwi)
1750{
1751 PWND pWnd;
1752 FLASHWINFO finfo = {0};
1753 BOOL Ret = FALSE;
1754
1756
1757 _SEH2_TRY
1758 {
1759 ProbeForRead(pfwi, sizeof(FLASHWINFO), 1);
1760 RtlCopyMemory(&finfo, pfwi, sizeof(FLASHWINFO));
1761 }
1763 {
1765 _SEH2_YIELD(goto Exit);
1766 }
1767 _SEH2_END
1768
1769 if (!( pWnd = ValidateHwndNoErr(finfo.hwnd)) ||
1770 finfo.cbSize != sizeof(FLASHWINFO) ||
1771 finfo.dwFlags & ~(FLASHW_ALL|FLASHW_TIMER|FLASHW_TIMERNOFG) )
1772 {
1774 goto Exit;
1775 }
1776
1777 Ret = IntFlashWindowEx(pWnd, &finfo);
1778
1779Exit:
1780 UserLeave();
1781 return Ret;
1782}
1783
1784/*
1785 GetUpdateRgn, this fails the same as the old one.
1786 */
1789{
1790 int RegionType;
1791 BOOL Type;
1792 RECTL Rect;
1793
1795
1796 if (bErase)
1797 {
1799 UserRefObjectCo(Window, &Ref);
1802 }
1803
1804 Window->state &= ~WNDS_UPDATEDIRTY;
1805
1806 if (Window->hrgnUpdate == NULL)
1807 {
1808 NtGdiSetRectRgn(hRgn, 0, 0, 0, 0);
1809 return NULLREGION;
1810 }
1811
1812 Rect = Window->rcClient;
1814
1815 if (Window->hrgnUpdate == HRGN_WINDOW)
1816 {
1817 // Trap it out.
1818 ERR("GURn: Caller is passing Window Region 1\n");
1819 if (!Type)
1820 {
1821 NtGdiSetRectRgn(hRgn, 0, 0, 0, 0);
1822 return NULLREGION;
1823 }
1824
1826
1828 {
1830 -Window->rcClient.left,
1831 -Window->rcClient.top);
1832 }
1834 }
1835 else
1836 {
1837 HRGN hrgnTemp = GreCreateRectRgnIndirect(&Rect);
1838
1839 RegionType = NtGdiCombineRgn(hRgn, hrgnTemp, Window->hrgnUpdate, RGN_AND);
1840
1842 {
1843 if (hrgnTemp) GreDeleteObject(hrgnTemp);
1844 NtGdiSetRectRgn(hRgn, 0, 0, 0, 0);
1845 return RegionType;
1846 }
1847
1849 {
1851 -Window->rcClient.left,
1852 -Window->rcClient.top);
1853 }
1854 if (hrgnTemp) GreDeleteObject(hrgnTemp);
1855 }
1856 return RegionType;
1857}
1858
1861{
1863 BOOL Ret = TRUE;
1864
1865 if (bErase)
1866 {
1868 UserRefObjectCo(Window, &Ref);
1871 }
1872
1873 Window->state &= ~WNDS_UPDATEDIRTY;
1874
1875 if (Window->hrgnUpdate == NULL)
1876 {
1877 pRect->left = pRect->top = pRect->right = pRect->bottom = 0;
1878 Ret = FALSE;
1879 }
1880 else
1881 {
1882 /* Get the update region bounding box. */
1883 if (Window->hrgnUpdate == HRGN_WINDOW)
1884 {
1885 *pRect = Window->rcClient;
1886 ERR("GURt: Caller is retrieving Window Region 1\n");
1887 }
1888 else
1889 {
1890 RegionType = IntGdiGetRgnBox(Window->hrgnUpdate, pRect);
1891
1893 RECTL_bIntersectRect(pRect, pRect, &Window->rcClient);
1894 }
1895
1896 if (IntIntersectWithParents(Window, pRect))
1897 {
1899 {
1900 RECTL_vOffsetRect(pRect,
1901 -Window->rcClient.left,
1902 -Window->rcClient.top);
1903 }
1904 if (Window->pcls->style & CS_OWNDC)
1905 {
1906 HDC hdc;
1907 //DWORD layout;
1909 //layout = NtGdiSetLayout(hdc, -1, 0);
1910 //IntMapWindowPoints( 0, Window, (LPPOINT)pRect, 2 );
1911 GreDPtoLP( hdc, (LPPOINT)pRect, 2 );
1912 //NtGdiSetLayout(hdc, -1, layout);
1914 }
1915 }
1916 else
1917 {
1918 pRect->left = pRect->top = pRect->right = pRect->bottom = 0;
1919 }
1920 }
1921 return Ret;
1922}
1923
1924/*
1925 * NtUserGetUpdateRgn
1926 *
1927 * Status
1928 * @implemented
1929 */
1930
1933{
1934 PWND Window;
1935 INT ret = ERROR;
1936
1937 TRACE("Enter NtUserGetUpdateRgn\n");
1939
1941 if (Window)
1942 {
1943 ret = co_UserGetUpdateRgn(Window, hRgn, bErase);
1944 }
1945
1946 TRACE("Leave NtUserGetUpdateRgn, ret=%i\n", ret);
1947 UserLeave();
1948 return ret;
1949}
1950
1951/*
1952 * NtUserGetUpdateRect
1953 *
1954 * Status
1955 * @implemented
1956 */
1957
1960{
1961 PWND Window;
1962 RECTL Rect;
1964 BOOL Ret = FALSE;
1965
1966 TRACE("Enter NtUserGetUpdateRect\n");
1968
1970 {
1971 goto Exit; // Return FALSE
1972 }
1973
1974 Ret = co_UserGetUpdateRect(Window, &Rect, bErase);
1975
1976 if (UnsafeRect != NULL)
1977 {
1978 Status = MmCopyToCaller(UnsafeRect, &Rect, sizeof(RECTL));
1979 if (!NT_SUCCESS(Status))
1980 {
1982 Ret = FALSE;
1983 }
1984 }
1985
1986Exit:
1987 TRACE("Leave NtUserGetUpdateRect, ret=%i\n", Ret);
1988 UserLeave();
1989 return Ret;
1990}
1991
1992/*
1993 * NtUserRedrawWindow
1994 *
1995 * Status
1996 * @implemented
1997 */
1998
2001 HWND hWnd,
2002 CONST RECT *lprcUpdate,
2003 HRGN hrgnUpdate,
2004 UINT flags)
2005{
2006 RECTL SafeUpdateRect;
2007 PWND Wnd;
2008 BOOL Ret = FALSE;
2011 PREGION RgnUpdate = NULL;
2012
2013 TRACE("Enter NtUserRedrawWindow\n");
2015
2017 {
2018 goto Exit; // Return FALSE
2019 }
2020
2021 if (lprcUpdate)
2022 {
2023 _SEH2_TRY
2024 {
2025 ProbeForRead(lprcUpdate, sizeof(RECTL), 1);
2026 RtlCopyMemory(&SafeUpdateRect, lprcUpdate, sizeof(RECTL));
2027 }
2029 {
2031 }
2032 _SEH2_END
2033 if (!NT_SUCCESS(Status))
2034 {
2036 goto Exit; // Return FALSE
2037 }
2038 }
2039
2043 {
2044 /* RedrawWindow fails only in case that flags are invalid */
2046 goto Exit; // Return FALSE
2047 }
2048
2049 /* We can't hold lock on GDI objects while doing roundtrips to user mode,
2050 * so it will be copied.
2051 */
2052 if (hrgnUpdate > HRGN_WINDOW)
2053 {
2054 RgnUpdate = REGION_LockRgn(hrgnUpdate);
2055 if (!RgnUpdate)
2056 {
2058 goto Exit; // Return FALSE
2059 }
2060 REGION_UnlockRgn(RgnUpdate);
2061 }
2062 else if (hrgnUpdate == HRGN_WINDOW) // Trap it out.
2063 {
2064 ERR("NTRW: Caller is passing Window Region 1\n");
2065 }
2066
2067 UserRefObjectCo(Wnd, &Ref);
2068
2069 Ret = co_UserRedrawWindow( Wnd,
2070 lprcUpdate ? &SafeUpdateRect : NULL,
2071 RgnUpdate,
2072 flags);
2073
2074 UserDerefObjectCo(Wnd);
2075
2076Exit:
2077 TRACE("Leave NtUserRedrawWindow, ret=%i\n", Ret);
2078 UserLeave();
2079 return Ret;
2080}
2081
2082BOOL
2084 PWND pWnd,
2085 HDC hDc,
2086 const PUNICODE_STRING Text,
2087 const RECTL *lpRc,
2088 UINT uFlags,
2089 HFONT hFont)
2090{
2091 HFONT hOldFont = NULL;
2092 COLORREF OldTextColor;
2093 NONCLIENTMETRICSW nclm;
2095 BOOLEAN bDeleteFont = FALSE;
2096 SIZE Size;
2097 BOOL Ret = TRUE;
2098 ULONG fit = 0, Length;
2099 RECTL r = *lpRc;
2100
2101 TRACE("UserDrawCaptionText: %wZ\n", Text);
2102
2103 nclm.cbSize = sizeof(nclm);
2104 if (!UserSystemParametersInfo(SPI_GETNONCLIENTMETRICS, nclm.cbSize, &nclm, 0))
2105 {
2106 ERR("UserSystemParametersInfo() failed!\n");
2107 return FALSE;
2108 }
2109
2110 if (!hFont)
2111 {
2112 if(uFlags & DC_SMALLCAP)
2113 Status = TextIntCreateFontIndirect(&nclm.lfSmCaptionFont, &hFont);
2114 else
2115 Status = TextIntCreateFontIndirect(&nclm.lfCaptionFont, &hFont);
2116
2117 if(!NT_SUCCESS(Status))
2118 {
2119 ERR("TextIntCreateFontIndirect() failed! Status: 0x%x\n", Status);
2120 return FALSE;
2121 }
2122
2123 bDeleteFont = TRUE;
2124 }
2125
2127
2128 hOldFont = NtGdiSelectFont(hDc, hFont);
2129
2130 if(uFlags & DC_INBUTTON)
2131 OldTextColor = IntGdiSetTextColor(hDc, IntGetSysColor(COLOR_BTNTEXT));
2132 else
2133 OldTextColor = IntGdiSetTextColor(hDc,
2135
2136 // Adjust for system menu.
2137 if (pWnd && pWnd->style & WS_SYSMENU)
2138 {
2139 r.right -= UserGetSystemMetrics(SM_CYCAPTION) - 1;
2140 if ((pWnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX)) && !(pWnd->ExStyle & WS_EX_TOOLWINDOW))
2141 {
2142 r.right -= UserGetSystemMetrics(SM_CXSIZE) + 1;
2143 r.right -= UserGetSystemMetrics(SM_CXSIZE) + 1;
2144 }
2145 }
2146
2147 GreGetTextExtentExW(hDc, Text->Buffer, Text->Length/sizeof(WCHAR), r.right - r.left, &fit, 0, &Size, 0);
2148
2149 Length = (Text->Length/sizeof(WCHAR) == fit ? fit : fit+1);
2150
2151 if (Text->Length/sizeof(WCHAR) > Length)
2152 {
2153 Ret = FALSE;
2154 }
2155
2156 if (Ret)
2157 { // Faster while in setup.
2158 UserExtTextOutW( hDc,
2159 lpRc->left,
2160 lpRc->top + (lpRc->bottom - lpRc->top - Size.cy) / 2, // DT_SINGLELINE && DT_VCENTER
2162 (RECTL *)lpRc,
2163 Text->Buffer,
2164 Length);
2165 }
2166 else
2167 {
2168 DrawTextW( hDc,
2169 Text->Buffer,
2170 Text->Length/sizeof(WCHAR),
2171 (RECTL *)&r,
2173 }
2174
2175 IntGdiSetTextColor(hDc, OldTextColor);
2176
2177 if (hOldFont)
2178 NtGdiSelectFont(hDc, hOldFont);
2179
2180 if (bDeleteFont)
2182
2183 return Ret;
2184}
2185
2186//
2187// This draws Buttons, Icons and Text...
2188//
2190 PWND pWnd,
2191 HDC hDc,
2192 RECTL *lpRc,
2193 HFONT hFont,
2194 HICON hIcon,
2195 const PUNICODE_STRING Str,
2196 UINT uFlags)
2197{
2198 BOOL Ret = FALSE;
2199 HBRUSH hBgBrush, hOldBrush = NULL;
2200 RECTL Rect = *lpRc;
2201 BOOL HasIcon;
2202
2204
2205 /* Determine whether the icon needs to be displayed */
2206 if (!hIcon && pWnd != NULL)
2207 {
2208 HasIcon = (uFlags & DC_ICON) && !(uFlags & DC_SMALLCAP) &&
2209 (pWnd->style & WS_SYSMENU) && !(pWnd->ExStyle & WS_EX_TOOLWINDOW);
2210 }
2211 else
2212 HasIcon = (hIcon != NULL);
2213
2214 // Draw the caption background
2215 if((uFlags & DC_GRADIENT) && !(uFlags & DC_INBUTTON))
2216 {
2217 static GRADIENT_RECT gcap = {0, 1};
2218 TRIVERTEX Vertices[2];
2219 COLORREF Colors[2];
2220
2223
2226
2227 Vertices[0].x = Rect.left;
2228 Vertices[0].y = Rect.top;
2229 Vertices[0].Red = (WORD)Colors[0]<<8;
2230 Vertices[0].Green = (WORD)Colors[0] & 0xFF00;
2231 Vertices[0].Blue = (WORD)(Colors[0]>>8) & 0xFF00;
2232 Vertices[0].Alpha = 0;
2233
2234 Vertices[1].x = Rect.right;
2235 Vertices[1].y = Rect.bottom;
2236 Vertices[1].Red = (WORD)Colors[1]<<8;
2237 Vertices[1].Green = (WORD)Colors[1] & 0xFF00;
2238 Vertices[1].Blue = (WORD)(Colors[1]>>8) & 0xFF00;
2239 Vertices[1].Alpha = 0;
2240
2241 if(!GreGradientFill(hDc, Vertices, 2, &gcap, 1, GRADIENT_FILL_RECT_H))
2242 {
2243 ERR("GreGradientFill() failed!\n");
2244 goto cleanup;
2245 }
2246 }
2247 else
2248 {
2249 if(uFlags & DC_INBUTTON)
2251 else if(uFlags & DC_ACTIVE)
2253 else
2255
2256 hOldBrush = NtGdiSelectBrush(hDc, hBgBrush);
2257
2258 if(!hOldBrush)
2259 {
2260 ERR("NtGdiSelectBrush() failed!\n");
2261 goto cleanup;
2262 }
2263
2264 if(!NtGdiPatBlt(hDc, Rect.left, Rect.top,
2265 Rect.right - Rect.left,
2266 Rect.bottom - Rect.top,
2267 PATCOPY))
2268 {
2269 ERR("NtGdiPatBlt() failed!\n");
2270 goto cleanup;
2271 }
2272 }
2273
2274 /* Draw icon */
2275 if (HasIcon)
2276 {
2277 PCURICON_OBJECT pIcon = NULL;
2278
2279 if (hIcon)
2280 {
2281 pIcon = UserGetCurIconObject(hIcon);
2282 }
2283 else if (pWnd)
2284 {
2285 pIcon = NC_IconForWindow(pWnd);
2286 // FIXME: NC_IconForWindow should reference it for us */
2287 if (pIcon)
2288 UserReferenceObject(pIcon);
2289 }
2290
2291 if (pIcon)
2292 {
2295 LONG x = Rect.left - cx/2 + 1 + (Rect.bottom - Rect.top)/2; // this is really what Window does
2296 LONG y = (Rect.top + Rect.bottom - cy)/2; // center
2297 UserDrawIconEx(hDc, x, y, pIcon, cx, cy, 0, NULL, DI_NORMAL);
2298 UserDereferenceObject(pIcon);
2299 }
2300 else
2301 {
2302 HasIcon = FALSE;
2303 }
2304 }
2305
2306 if (HasIcon)
2307 Rect.left += Rect.bottom - Rect.top;
2308
2309 if((uFlags & DC_TEXT))
2310 {
2311 BOOL Set = FALSE;
2312 Rect.left += 2;
2313
2314 if (Str)
2315 Set = UserDrawCaptionText(pWnd, hDc, Str, &Rect, uFlags, hFont);
2316 else if (pWnd != NULL) // FIXME: Windows does not do that
2317 {
2318 UNICODE_STRING ustr;
2319 ustr.Buffer = pWnd->strName.Buffer; // FIXME: LARGE_STRING truncated!
2320 ustr.Length = (USHORT)min(pWnd->strName.Length, MAXUSHORT);
2322 Set = UserDrawCaptionText(pWnd, hDc, &ustr, &Rect, uFlags, hFont);
2323 }
2324 if (pWnd)
2325 {
2326 if (Set)
2327 pWnd->state2 &= ~WNDS2_CAPTIONTEXTTRUNCATED;
2328 else
2330 }
2331 }
2332
2333 Ret = TRUE;
2334
2335cleanup:
2336 if (hOldBrush) NtGdiSelectBrush(hDc, hOldBrush);
2337
2338 return Ret;
2339}
2340
2341INT
2344{
2345 HWND hWnd, hWndDesktop;
2346 DWORD Ret;
2347
2349 if (Ret) // There was a change.
2350 {
2352 if (hWnd) // Send broadcast if dc is associated with a window.
2353 { // FYI: Thread locked in CallOneParam.
2354 hWndDesktop = IntGetDesktopWindow();
2355 if ( hWndDesktop != hWnd )
2356 {
2357 PWND pWnd = UserGetWindowObject(hWndDesktop);
2358 ERR("RealizePalette Desktop.\n");
2359 hdc = UserGetWindowDC(pWnd);
2361 UserReleaseDC(pWnd,hdc,FALSE);
2362 }
2364 }
2365 }
2366 return Ret;
2367}
2368
2369BOOL
2372 HWND hWnd,
2373 HDC hDC,
2374 LPCRECT lpRc,
2375 HFONT hFont,
2376 HICON hIcon,
2377 const PUNICODE_STRING str,
2378 UINT uFlags)
2379{
2380 PWND pWnd = NULL;
2381 UNICODE_STRING SafeStr = {0};
2383 RECTL SafeRect;
2384 BOOL Ret;
2385
2387
2388 if (hWnd != NULL)
2389 {
2390 if(!(pWnd = UserGetWindowObject(hWnd)))
2391 {
2392 UserLeave();
2393 return FALSE;
2394 }
2395 }
2396
2397 _SEH2_TRY
2398 {
2399 ProbeForRead(lpRc, sizeof(RECTL), sizeof(ULONG));
2400 RtlCopyMemory(&SafeRect, lpRc, sizeof(RECTL));
2401 if (str != NULL)
2402 {
2403 SafeStr = ProbeForReadUnicodeString(str);
2404 if (SafeStr.Length != 0)
2405 {
2406 ProbeForRead( SafeStr.Buffer,
2407 SafeStr.Length,
2408 sizeof(WCHAR));
2409 }
2410 }
2411 }
2413 {
2415 }
2416 _SEH2_END;
2417
2418 if (Status != STATUS_SUCCESS)
2419 {
2421 UserLeave();
2422 return FALSE;
2423 }
2424
2425 if (str != NULL)
2426 Ret = UserDrawCaption(pWnd, hDC, &SafeRect, hFont, hIcon, &SafeStr, uFlags);
2427 else
2428 {
2429 if ( RECTL_bIsEmptyRect(&SafeRect) && hFont == 0 && hIcon == 0 )
2430 {
2431 Ret = TRUE;
2433 {
2434 ERR("NC Caption Mode\n");
2436 goto Exit;
2437 }
2438 else if (uFlags & DC_DRAWFRAMEMD)
2439 {
2440 ERR("NC Paint Mode\n");
2441 NC_DoNCPaint(pWnd, hDC, uFlags); // Update Menus too!
2442 goto Exit;
2443 }
2444 }
2445 Ret = UserDrawCaption(pWnd, hDC, &SafeRect, hFont, hIcon, NULL, uFlags);
2446 }
2447Exit:
2448 UserLeave();
2449 return Ret;
2450}
2451
2452BOOL
2455 HDC hDC,
2456 LPCRECT lpRc,
2457 UINT uFlags)
2458{
2459 return NtUserDrawCaptionTemp(hWnd, hDC, lpRc, 0, 0, NULL, uFlags);
2460}
2461
2464{
2465 POINT pt;
2466 RECT rc;
2467
2468 if (Window->hrgnUpdate)
2469 {
2470 if (Window->hrgnUpdate == HRGN_WINDOW)
2471 {
2472 return NtGdiIntersectClipRect(hDC, 0, 0, 0, 0);
2473 }
2474 else
2475 {
2476 INT ret = ERROR;
2477 HRGN hrgn = NtGdiCreateRectRgn(0,0,0,0);
2478
2479 if ( hrgn && GreGetDCPoint( hDC, GdiGetDCOrg, &pt) )
2480 {
2482 {
2483 NtGdiOffsetRgn(hrgn, pt.x, pt.y);
2484 }
2485 else
2486 {
2487 HRGN hrgnScreen;
2489 hrgnScreen = NtGdiCreateRectRgn(0,0,0,0);
2490 NtGdiCombineRgn(hrgnScreen, hrgnScreen, pm->hrgnMonitor, RGN_OR);
2491
2492 NtGdiCombineRgn(hrgn, hrgnScreen, NULL, RGN_COPY);
2493
2494 GreDeleteObject(hrgnScreen);
2495 }
2496
2497 NtGdiCombineRgn(hrgn, hrgn, Window->hrgnUpdate, RGN_DIFF);
2498
2499 NtGdiOffsetRgn(hrgn, -pt.x, -pt.y);
2500
2502
2504 }
2505 return ret;
2506 }
2507 }
2508 else
2509 {
2510 return GdiGetClipBox( hDC, &rc);
2511 }
2512}
2513
2514INT
2517 HDC hDC,
2518 HWND hWnd)
2519{
2520 INT ret = ERROR;
2521 PWND pWnd;
2522
2523 TRACE("Enter NtUserExcludeUpdateRgn\n");
2525
2526 pWnd = UserGetWindowObject(hWnd);
2527
2528 if (hDC && pWnd)
2530
2531 TRACE("Leave NtUserExcludeUpdateRgn, ret=%i\n", ret);
2532
2533 UserLeave();
2534 return ret;
2535}
2536
2537BOOL
2540 HWND hWnd,
2541 CONST RECT *lpUnsafeRect,
2542 BOOL bErase)
2543{
2544 UINT flags = RDW_INVALIDATE | (bErase ? RDW_ERASE : 0);
2545 if (!hWnd)
2546 {
2548 lpUnsafeRect = NULL;
2549 }
2550 return NtUserRedrawWindow(hWnd, lpUnsafeRect, NULL, flags);
2551}
2552
2553BOOL
2556 HWND hWnd,
2557 HRGN hRgn,
2558 BOOL bErase)
2559{
2560 if (!hWnd)
2561 {
2563 return FALSE;
2564 }
2565 return NtUserRedrawWindow(hWnd, NULL, hRgn, RDW_INVALIDATE | (bErase? RDW_ERASE : 0));
2566}
2567
2568BOOL
2571 HWND hwnd,
2572 HDC hdcBlt,
2573 UINT nFlags)
2574{
2575 PWND Window;
2576 BOOL Ret = FALSE;
2577
2579
2580 if (hwnd)
2581 {
2582 if (!(Window = UserGetWindowObject(hwnd)) ||
2584 {
2585 goto Exit;
2586 }
2587
2588 if ( Window )
2589 {
2590 /* Validate flags and check it as a mask for 0 or 1. */
2591 if ( (nFlags & PW_CLIENTONLY) == nFlags)
2592 Ret = IntPrintWindow( Window, hdcBlt, nFlags);
2593 else
2595 }
2596 }
2597Exit:
2598 UserLeave();
2599 return Ret;
2600}
2601
2602/* ValidateRect gets redirected to NtUserValidateRect:
2603 https://blog.csdn.net/ntdll/article/details/509299 */
2604BOOL
2607 HWND hWnd,
2608 const RECT *lpRect)
2609{
2611 if (!hWnd)
2612 {
2614 lpRect = NULL;
2615 }
2616 return NtUserRedrawWindow(hWnd, lpRect, NULL, flags);
2617}
2618
2619/* EOF */
static HDC hDC
Definition: 3dtext.c:33
#define DCX_USESTYLE
Definition: GetDCEx.c:10
static HRGN hrgn
Type
Definition: Type.h:7
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
unsigned char BOOLEAN
Definition: actypes.h:127
Colors
Definition: ansiprsr.h:4
HWND hWnd
Definition: settings.c:17
LONG NTSTATUS
Definition: precomp.h:26
HFONT hFont
Definition: main.c:53
#define ERR(fmt,...)
Definition: precomp.h:57
#define HandleToUlong(h)
Definition: basetsd.h:73
#define DBG_DEFAULT_CHANNEL(ch)
Definition: debug.h:106
UINT FASTCALL IntGdiRealizePalette(HDC)
Definition: palette.c:740
char * Text
Definition: combotst.c:136
BOOL FASTCALL GreDPtoLP(HDC, LPPOINT, INT)
Definition: dcutil.c:7
#define DC_ACTIVE
Definition: dc21x4.h:120
COLORREF FASTCALL IntGdiSetTextColor(HDC hDC, COLORREF color)
Definition: dcutil.c:172
INT FASTCALL IntGdiSetBkMode(HDC hDC, INT backgroundMode)
Definition: dcutil.c:124
BOOL FASTCALL GreSetBrushOrg(HDC, INT, INT, LPPOINT)
Definition: dcutil.c:231
HWND FASTCALL IntWindowFromDC(HDC hDc)
Definition: windc.c:894
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define UserIsMessageWindow(pWnd)
Definition: desktop.h:197
#define UserIsDesktopWindow(pWnd)
Definition: desktop.h:194
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define APIENTRY
Definition: api.h:79
UINT uFlags
Definition: api.c:59
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
static void cleanup(void)
Definition: main.c:1335
static const WCHAR Message[]
Definition: register.c:74
static const WCHAR Cleanup[]
Definition: register.c:80
#define pt(x, y)
Definition: drawing.c:79
void Erase(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG radius)
Definition: drawing.cpp:115
return ret
Definition: mutex.c:146
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define ERROR(name)
Definition: error_private.h:53
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL NTAPI GreGradientFill(HDC hdc, PTRIVERTEX pVertex, ULONG nVertex, PVOID pMesh, ULONG nMesh, ULONG ulMode)
Definition: fillshap.c:951
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
PUSER_MESSAGE_QUEUE gpqForeground
Definition: focus.c:13
NTSTATUS FASTCALL TextIntCreateFontIndirect(CONST LPLOGFONTW lf, HFONT *NewFont)
Definition: freetype.c:2612
return pTarget Start()
RegionType
Status
Definition: gdiplustypes.h:25
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLbitfield flags
Definition: glext.h:7161
PSERVERINFO gpsi
Definition: imm.c:18
#define WNDS2_FORCEFULLNCPAINTCLIPRGN
Definition: ntuser.h:664
#define WNDS2_ENDPAINTINVALIDATE
Definition: ntuser.h:642
#define WNDS_ACTIVEFRAME
Definition: ntuser.h:611
#define WNDS_SYNCPAINTPENDING
Definition: ntuser.h:628
#define WNDS_DESTROYED
Definition: ntuser.h:636
#define WNDS_SENDNCPAINT
Definition: ntuser.h:616
#define UserHMGetHandle(obj)
Definition: ntuser.h:230
#define WNDS_INTERNALPAINT
Definition: ntuser.h:617
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:806
#define WNDS2_CAPTIONTEXTTRUNCATED
Definition: ntuser.h:666
#define WNDS2_WMPAINTSENT
Definition: ntuser.h:641
#define WNDS_ERASEBACKGROUND
Definition: ntuser.h:615
#define WNDS_UPDATEDIRTY
Definition: ntuser.h:618
#define WNDS2_INDESTROY
Definition: ntuser.h:648
#define TIF_SYSTEMTHREAD
Definition: ntuser.h:265
#define WNDS_PAINTNOTPROCESSED
Definition: ntuser.h:627
#define WNDS2_STARTPAINT
Definition: ntuser.h:643
#define HRGN_WINDOW
Definition: ntuser.h:361
#define WNDS_SENDERASEBACKGROUND
Definition: ntuser.h:614
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
HGDIOBJ FASTCALL IntGetSysColorBrush(INT Object)
Definition: stockobj.c:317
DWORD FASTCALL IntGetSysColor(INT nIndex)
Definition: stockobj.c:323
static LPMONITOREX pm
Definition: localmon.c:45
UINT_PTR WPARAM
Definition: minwindef.h:174
#define MmCopyToCaller(x, y, z)
Definition: mmcopy.h:19
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define CLIPRGN
Definition: precomp.h:18
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static HICON
Definition: imagelist.c:80
static HTREEITEM hChild
Definition: treeview.c:383
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static HRGN hRgn
Definition: mapping.c:33
static IHTMLWindow2 * window
Definition: events.c:77
#define min(a, b)
Definition: monoChain.cc:55
HICON hIcon
Definition: msconfig.c:44
VOID FASTCALL MsqDecPaintCountQueue(PTHREADINFO pti)
Definition: msgqueue.c:508
VOID FASTCALL MsqIncPaintCountQueue(PTHREADINFO pti)
Definition: msgqueue.c:501
BOOL FASTCALL IsThreadSuspended(PTHREADINFO pti)
Definition: msgqueue.c:2180
BOOL FASTCALL MsqIsHung(PTHREADINFO pti, DWORD TimeOut)
Definition: msgqueue.c:2149
#define MSQ_HUNG
Definition: msgqueue.h:3
unsigned int UINT
Definition: ndis.h:50
#define FASTCALL
Definition: nt_native.h:50
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
BOOL APIENTRY GreGetDCPoint(HDC hDC, UINT iPoint, PPOINTL Point)
Definition: coord.c:1291
__kernel_entry W32KAPI INT APIENTRY NtGdiCombineRgn(_In_ HRGN hrgnDst, _In_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ INT iMode)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiSetRectRgn(_In_ HRGN hrgn, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
Definition: region.c:4048
__kernel_entry W32KAPI BOOL APIENTRY NtGdiBitBlt(_In_ HDC hdcDst, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ DWORD rop4, _In_ DWORD crBackColor, _In_ FLONG fl)
__kernel_entry W32KAPI HBRUSH APIENTRY NtGdiSelectBrush(_In_ HDC hdc, _In_ HBRUSH hbrush)
__kernel_entry W32KAPI HRGN APIENTRY NtGdiCreateRectRgn(_In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
__kernel_entry W32KAPI INT APIENTRY NtGdiExtSelectClipRgn(_In_ HDC hdc, _In_opt_ HRGN hrgn, _In_ INT iMode)
__kernel_entry W32KAPI INT APIENTRY NtGdiIntersectClipRect(_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
Definition: cliprgn.c:488
__kernel_entry W32KAPI INT APIENTRY NtGdiGetRandomRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ INT iRgn)
__kernel_entry W32KAPI BOOL APIENTRY NtGdiPatBlt(_In_ HDC hdcDest, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_ DWORD dwRop)
Definition: bitblt.c:988
__kernel_entry W32KAPI INT APIENTRY NtGdiOffsetRgn(_In_ HRGN hrgn, _In_ INT cx, _In_ INT cy)
Definition: region.c:3961
__kernel_entry W32KAPI HFONT APIENTRY NtGdiSelectFont(_In_ HDC hdc, _In_ HFONT hf)
Definition: dcobjs.c:597
#define GDI_OBJ_HMGR_POWNED
Definition: ntgdihdl.h:117
#define GDI_OBJ_HMGR_PUBLIC
Definition: ntgdihdl.h:116
@ GdiGetDCOrg
Definition: ntgdityp.h:80
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
BOOL FASTCALL IntGetWindowRect(PWND Wnd, RECTL *Rect)
Definition: winpos.c:121
ATOM AtomFlashWndState
Definition: ntuser.c:22
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:255
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:247
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:43
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
static BOOL Set
Definition: pageheap.c:10
#define FLASHW_FINISHED
Definition: painting.h:5
#define FLASHW_STARTED
Definition: painting.h:6
#define FLASHW_COUNT
Definition: painting.h:7
#define FLASHW_ACTIVE
Definition: painting.h:9
#define RDW_NOUPDATEDIRTY
Definition: painting.h:16
#define FLASHW_SYSTIMER
Definition: painting.h:4
#define RDW_CLIPCHILDREN
Definition: painting.h:15
#define FLASHW_MASK
Definition: painting.h:3
#define PRGN_WINDOW
Definition: painting.h:12
#define FLASHW_KILLSYSTIMER
Definition: painting.h:8
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define CONST
Definition: pedump.c:81
#define WS_MAXIMIZEBOX
Definition: pedump.c:632
#define WS_SYSMENU
Definition: pedump.c:629
short WCHAR
Definition: pedump.c:58
#define WS_BORDER
Definition: pedump.c:625
#define WS_MINIMIZE
Definition: pedump.c:622
#define WS_VISIBLE
Definition: pedump.c:620
long LONG
Definition: pedump.c:60
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_EX_TRANSPARENT
Definition: pedump.c:649
unsigned short USHORT
Definition: pedump.c:61
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define WS_MINIMIZEBOX
Definition: pedump.c:631
HANDLE FASTCALL UserRemoveProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:204
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:104
#define _SEH2_END
Definition: pseh2_64.h:194
#define _SEH2_TRY
Definition: pseh2_64.h:93
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:207
#define GreCreateRectRgnIndirect(prc)
Definition: region.h:96
#define GreSetRectRgnIndirect(hRgn, prc)
Definition: region.h:99
#define IntSysCreateRectpRgnIndirect(prc)
Definition: region.h:93
const WCHAR * str
#define ProbeForReadUnicodeString(Ptr)
Definition: probe.h:77
Entry
Definition: section.c:5210
#define STATUS_SUCCESS
Definition: shellext.h:65
STDMETHOD() Next(THIS_ ULONG celt, IAssociationElement *pElement, ULONG *pceltFetched) PURE
static void Exit(void)
Definition: sock.c:1330
#define TRACE(s)
Definition: solgame.cpp:4
Definition: client.c:28
long bottom
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
Definition: window.c:28
UINT style
Definition: ntuser.h:580
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
Definition: region.h:8
PPROCESSINFO ppi
Definition: win32.h:88
LIST_ENTRY SentMessagesListHead
Definition: win32.h:100
COLOR16 Red
Definition: wingdi.h:3232
LONG y
Definition: wingdi.h:3231
COLOR16 Green
Definition: wingdi.h:3233
COLOR16 Alpha
Definition: wingdi.h:3235
COLOR16 Blue
Definition: wingdi.h:3234
LONG x
Definition: wingdi.h:3230
USHORT MaximumLength
Definition: env_spec_w32.h:370
Definition: object.h:4
Definition: ntuser.h:694
DWORD ExStyle
Definition: ntuser.h:704
HRGN hrgnClip
Definition: ntuser.h:733
PCLS pcls
Definition: ntuser.h:720
THRDESKHEAD head
Definition: ntuser.h:695
DWORD style
Definition: ntuser.h:706
DWORD state2
Definition: ntuser.h:702
struct _WND * spwndChild
Definition: ntuser.h:714
RECT rcClient
Definition: ntuser.h:717
HRGN hrgnUpdate
Definition: ntuser.h:721
LARGE_UNICODE_STRING strName
Definition: ntuser.h:736
DWORD state
Definition: ntuser.h:701
struct _WND * spwndNext
Definition: ntuser.h:711
RECT rcWindow
Definition: ntuser.h:716
struct _WND * spwndParent
Definition: ntuser.h:713
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
static int UpdateRect(TreeListData *pData, unsigned uItem, unsigned uSub)
Definition: treelist.c:1529
#define DWORD_PTR
Definition: treelist.c:76
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint32_t DWORD_PTR
Definition: typedefs.h:65
int32_t INT
Definition: typedefs.h:58
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define MAXUSHORT
Definition: typedefs.h:83
#define IN
Definition: typedefs.h:39
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define HIWORD(l)
Definition: typedefs.h:247
#define DC_NOSENDMSG
Definition: undocuser.h:149
#define DCX_KEEPCLIPRGN
Definition: undocuser.h:69
#define DC_DRAWCAPTIONMD
Definition: undocuser.h:152
#define WS_EX_REDIRECTED
Definition: undocuser.h:27
#define DC_DRAWFRAMEMD
Definition: undocuser.h:154
VOID FASTCALL IntSendChildNCPaint(PWND pWnd)
Definition: painting.c:370
BOOL FASTCALL IntPrintWindow(PWND pwnd, HDC hdcBlt, UINT nFlags)
Definition: painting.c:1259
INT FASTCALL UserRealizePalette(HDC hdc)
Definition: painting.c:2343
BOOL FASTCALL IntFillWindow(PWND pWndParent, PWND pWnd, HDC hDC, HBRUSH hBrush)
Definition: painting.c:1559
VOID FASTCALL IntSendSyncPaint(PWND Wnd, ULONG Flags)
Definition: painting.c:132
INT APIENTRY NtUserGetUpdateRgn(HWND hWnd, HRGN hRgn, BOOL bErase)
Definition: painting.c:1932
BOOL FASTCALL IntIsWindowDrawable(PWND Wnd)
Definition: painting.c:868
VOID FASTCALL PaintSuspendedWindow(PWND pwnd, HRGN hrgnOrig)
Definition: painting.c:1025
VOID FASTCALL IntPaintWindow(PWND Window)
Definition: painting.c:1184
VOID FASTCALL UpdateTheadChildren(PWND pWnd, HRGN hRgn)
Definition: painting.c:1084
VOID FASTCALL UserSyncAndPaintWindows(PWND pWnd, ULONG Flags)
Definition: painting.c:621
INT FASTCALL co_UserExcludeUpdateRgn(HDC hDC, PWND Window)
Definition: painting.c:2463
BOOL UserDrawCaptionText(PWND pWnd, HDC hDc, const PUNICODE_STRING Text, const RECTL *lpRc, UINT uFlags, HFONT hFont)
Definition: painting.c:2083
HRGN FASTCALL IntGetNCUpdateRgn(PWND Window, BOOL Validate)
Definition: painting.c:260
BOOL FASTCALL IntFlashWindowEx(PWND pWnd, PFLASHWINFO pfwi)
Definition: painting.c:1311
BOOL FASTCALL IntValidateParents(PWND Child, BOOL Recurse)
Definition: painting.c:62
VOID FASTCALL UserUpdateWindows(PWND pWnd, ULONG Flags)
Definition: painting.c:599
BOOL UserDrawCaption(PWND pWnd, HDC hDc, RECTL *lpRc, HFONT hFont, HICON hIcon, const PUNICODE_STRING Str, UINT uFlags)
Definition: painting.c:2189
BOOL APIENTRY NtUserDrawCaptionTemp(HWND hWnd, HDC hDC, LPCRECT lpRc, HFONT hFont, HICON hIcon, const PUNICODE_STRING str, UINT uFlags)
Definition: painting.c:2371
VOID FASTCALL IntSendNCPaint(PWND pWnd, HRGN hRgn)
Definition: painting.c:348
VOID FASTCALL co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
Definition: painting.c:403
HDC FASTCALL IntBeginPaint(PWND Window, PPAINTSTRUCT Ps)
Definition: painting.c:1441
BOOL FASTCALL IntIntersectWithParents(PWND Child, RECTL *WindowRect)
Definition: painting.c:35
BOOL FASTCALL co_UserRedrawWindow(PWND Window, const RECTL *UpdateRect, PREGION UpdateRgn, ULONG Flags)
Definition: painting.c:895
BOOL APIENTRY NtUserDrawCaption(HWND hWnd, HDC hDC, LPCRECT lpRc, UINT uFlags)
Definition: painting.c:2454
PWND FASTCALL IntFindWindowToRepaint(PWND Window, PTHREADINFO Thread)
Definition: painting.c:1141
VOID FASTCALL UpdateThreadWindows(PWND pWnd, PTHREADINFO pti, HRGN hRgn)
Definition: painting.c:1100
BOOL APIENTRY NtUserPrintWindow(HWND hwnd, HDC hdcBlt, UINT nFlags)
Definition: painting.c:2570
BOOL FASTCALL IntEndPaint(PWND Wnd, PPAINTSTRUCT Ps)
Definition: painting.c:1537
BOOL APIENTRY NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate, UINT flags)
Definition: painting.c:2000
VOID FASTCALL co_IntUpdateWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
Definition: painting.c:519
BOOL UserExtTextOutW(HDC hdc, INT x, INT y, UINT flags, PRECTL lprc, LPCWSTR lpString, UINT count)
BOOL APIENTRY NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
Definition: painting.c:1959
HRGN FASTCALL IntCalcWindowRgn(PWND Wnd, BOOL Client)
Definition: painting.c:209
BOOL FASTCALL IntIsWindowDirty(PWND Wnd)
Definition: painting.c:1125
BOOL FASTCALL IntGetPaintMessage(PWND Window, UINT MsgFilterMin, UINT MsgFilterMax, PTHREADINFO Thread, MSG *Message, BOOL Remove)
Definition: painting.c:1191
BOOL APIENTRY NtUserFlashWindowEx(IN PFLASHWINFO pfwi)
Definition: painting.c:1749
BOOL APIENTRY NtUserInvalidateRgn(HWND hWnd, HRGN hRgn, BOOL bErase)
Definition: painting.c:2555
INT APIENTRY NtUserExcludeUpdateRgn(HDC hDC, HWND hWnd)
Definition: painting.c:2516
BOOL FASTCALL co_UserGetUpdateRect(PWND Window, PRECT pRect, BOOL bErase)
Definition: painting.c:1860
INT FASTCALL co_UserGetUpdateRgn(PWND Window, HRGN hRgn, BOOL bErase)
Definition: painting.c:1788
HDC APIENTRY NtUserBeginPaint(HWND hWnd, PAINTSTRUCT *UnsafePs)
Definition: painting.c:1612
BOOL APIENTRY NtUserValidateRect(HWND hWnd, const RECT *lpRect)
Definition: painting.c:2606
BOOL APIENTRY NtUserInvalidateRect(HWND hWnd, CONST RECT *lpUnsafeRect, BOOL bErase)
Definition: painting.c:2539
VOID FASTCALL IntInvalidateWindows(PWND Wnd, PREGION Rgn, ULONG Flags)
Definition: painting.c:643
BOOL APIENTRY NtUserFillWindow(HWND hWndParent, HWND hWnd, HDC hDC, HBRUSH hBrush)
Definition: painting.c:1708
BOOL APIENTRY NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT *pUnsafePs)
Definition: painting.c:1658
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:123
HDC FASTCALL UserGetWindowDC(PWND Wnd)
Definition: windc.c:947
#define ASSERT_REFS_CO(_obj_)
Definition: userfuncs.h:13
INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
Definition: windc.c:918
HDC FASTCALL UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:30
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1165
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
Definition: gdiobj.c:1153
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
Definition: rect.c:81
BOOL FASTCALL RECTL_bIntersectRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:55
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
Definition: rect.h:44
FORCEINLINE VOID RECTL_vOffsetRect(_Inout_ RECTL *prcl, _In_ INT cx, _In_ INT cy)
Definition: rect.h:31
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2449
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2358
BOOL FASTCALL IntGdiSetRegionOwner(HRGN hRgn, DWORD OwnerMask)
Definition: region.c:2459
INT APIENTRY IntGdiGetRgnBox(HRGN hRgn, PRECTL pRect)
Definition: region.c:2561
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2373
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2407
BOOL FASTCALL REGION_bOffsetRgn(_Inout_ PREGION prgn, _In_ INT cx, _In_ INT cy)
Definition: region.c:2707
INT FASTCALL IntGdiCombineRgn(PREGION prgnDest, PREGION prgnSrc1, PREGION prgnSrc2, INT iCombineMode)
Definition: region.c:2487
BOOL FASTCALL GreGetTextExtentExW(_In_ HDC hDC, _In_ PCWCH String, _In_ ULONG Count, _In_ ULONG MaxExtent, _Out_opt_ PULONG Fit, _Out_writes_to_opt_(Count, *Fit) PULONG Dx, _Out_ PSIZE pSize, _In_ FLONG fl)
Definition: text.c:133
#define ValidateHwndNoErr(hwnd)
Definition: precomp.h:97
BOOL FASTCALL co_UserHideCaret(PWND Window OPTIONAL)
Definition: caret.c:224
BOOL FASTCALL co_UserShowCaret(PWND Window OPTIONAL)
Definition: caret.c:259
PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon)
Definition: cursoricon.c:200
BOOL UserDrawIconEx(HDC hDc, INT xLeft, INT yTop, PCURICON_OBJECT pIcon, INT cxWidth, INT cyHeight, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags)
Definition: cursoricon.c:1691
PWND FASTCALL UserGetDesktopWindow(VOID)
Definition: desktop.c:1402
HWND FASTCALL IntGetDesktopWindow(VOID)
Definition: desktop.c:1391
BOOL FASTCALL IntPaintDesktop(HDC hDC)
Definition: desktop.c:1849
LRESULT FASTCALL co_IntSendMessageNoWait(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1763
BOOL FASTCALL UserSendNotifyMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2090
LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1495
LONG NTAPI UserGetSystemMetrics(ULONG Index)
Definition: metric.c:209
HBRUSH FASTCALL GetControlColor(PWND pwndParent, PWND pwnd, HDC hdc, UINT CtlMsg)
Definition: misc.c:153
PMONITOR NTAPI UserGetPrimaryMonitor(VOID)
Definition: monitor.c:102
PCURICON_OBJECT FASTCALL NC_IconForWindow(PWND pWnd)
Definition: nonclient.c:736
VOID UserDrawCaptionBar(PWND pWnd, HDC hDC, INT Flags)
Definition: nonclient.c:955
LRESULT NC_DoNCPaint(PWND pWnd, HDC hDC, INT Flags)
Definition: nonclient.c:1097
BOOL FASTCALL UserDereferenceObject(PVOID Object)
Definition: object.c:643
VOID FASTCALL UserReferenceObject(PVOID obj)
Definition: object.c:730
HANDLE FASTCALL UserGetProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
Definition: prop.c:46
BOOL FASTCALL UserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: sysparams.c:2123
#define USERTAG_WINDOWLIST
Definition: tags.h:298
VOID CALLBACK SystemTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
Definition: timer.c:286
BOOL FASTCALL IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
Definition: timer.c:579
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type)
Definition: timer.c:182
#define TMRF_SYSTEM
Definition: timer.h:20
#define ID_EVENT_SYSTIMER_FLASHWIN
Definition: timer.h:28
HWND *FASTCALL IntWinListChildren(PWND Window)
Definition: window.c:275
BOOL FASTCALL IntIsWindow(HWND hWnd)
Definition: window.c:177
BOOL FASTCALL IntIsChildWindow(PWND Parent, PWND BaseWindow)
Definition: window.c:929
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:21
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
DWORD COLORREF
Definition: windef.h:100
VOID FASTCALL IntGetClientRect(PWND WindowObject, RECTL *Rect)
Definition: winpos.c:92
#define IntWndBelongsToThread(WndObj, W32Thread)
Definition: window.h:32
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:1226
#define ERROR_INVALID_FLAGS
Definition: winerror.h:907
#define RGN_DIFF
Definition: wingdi.h:358
#define NULLREGION
Definition: wingdi.h:361
#define DI_NORMAL
Definition: wingdi.h:72
#define TRANSPARENT
Definition: wingdi.h:950
#define RGN_COPY
Definition: wingdi.h:357
#define RGN_AND
Definition: wingdi.h:356
#define CLR_INVALID
Definition: wingdi.h:883
#define SRCCOPY
Definition: wingdi.h:333
#define ETO_CLIPPED
Definition: wingdi.h:648
#define PATCOPY
Definition: wingdi.h:335
#define SIMPLEREGION
Definition: wingdi.h:362
#define RGN_OR
Definition: wingdi.h:359
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
FORCEINLINE BOOL IntEqualRect(RECTL *lprc1, RECTL *lprc2)
Definition: winpos.h:48
#define WM_PAINT
Definition: winuser.h:1648
#define WM_ERASEBKGND
Definition: winuser.h:1653
#define DT_NOPREFIX
Definition: winuser.h:537
#define COLOR_BTNTEXT
Definition: winuser.h:944
#define COLOR_INACTIVECAPTIONTEXT
Definition: winuser.h:945
#define DC_INBUTTON
Definition: winuser.h:431
#define COLOR_WINDOW
Definition: winuser.h:929
#define DCX_CACHE
Definition: winuser.h:2150
#define COLOR_GRADIENTINACTIVECAPTION
Definition: winuser.h:956
#define DCX_WINDOW
Definition: winuser.h:2149
#define DT_END_ELLIPSIS
Definition: winuser.h:529
#define WM_SYNCPAINT
Definition: winuser.h:1718
#define HWND_BROADCAST
Definition: winuser.h:1215
#define DT_SINGLELINE
Definition: winuser.h:540
#define WM_PALETTECHANGED
Definition: winuser.h:1905
#define COLOR_ACTIVECAPTION
Definition: winuser.h:926
#define RDW_NOINTERNALPAINT
Definition: winuser.h:1228
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define SM_CYSMICON
Definition: winuser.h:1024
#define COLOR_INACTIVECAPTION
Definition: winuser.h:927
#define RDW_UPDATENOW
Definition: winuser.h:1231
#define RDW_ERASE
Definition: winuser.h:1222
#define RDW_NOCHILDREN
Definition: winuser.h:1233
#define COLOR_GRADIENTACTIVECAPTION
Definition: winuser.h:955
#define SM_CXSIZE
Definition: winuser.h:1002
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1794
#define DC_NC
Definition: winuser.h:440
#define SM_CXSMICON
Definition: winuser.h:1023
#define DT_LEFT
Definition: winuser.h:534
#define DCX_INTERSECTRGN
Definition: winuser.h:2158
#define WM_NCACTIVATE
Definition: winuser.h:1716
#define RDW_ALLCHILDREN
Definition: winuser.h:1232
#define RDW_ERASENOW
Definition: winuser.h:1230
#define RDW_FRAME
Definition: winuser.h:1223
#define DC_TEXT
Definition: winuser.h:430
#define DT_VCENTER
Definition: winuser.h:543
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4620
#define CS_OWNDC
Definition: winuser.h:663
#define DC_ICON
Definition: winuser.h:429
#define RDW_NOFRAME
Definition: winuser.h:1227
#define DC_SMALLCAP
Definition: winuser.h:428
#define CTLCOLOR_MAX
Definition: winuser.h:969
#define RDW_INTERNALPAINT
Definition: winuser.h:1224
#define RDW_NOERASE
Definition: winuser.h:1226
#define COLOR_CAPTIONTEXT
Definition: winuser.h:933
#define CS_PARENTDC
Definition: winuser.h:664
#define RDW_VALIDATE
Definition: winuser.h:1229
#define SM_CYCAPTION
Definition: winuser.h:974
#define RDW_INVALIDATE
Definition: winuser.h:1225
#define WM_NCPAINT
Definition: winuser.h:1715
#define COLOR_3DFACE
Definition: winuser.h:940
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ BOOLEAN Remove
Definition: psfuncs.h:111
static HDC hdcSrc
Definition: xlate.c:32