diff --git a/reactos/win32ss/gdi/eng/engwindow.c b/reactos/win32ss/gdi/eng/engwindow.c index 86560c9770d..b3eecd2abc9 100644 --- a/reactos/win32ss/gdi/eng/engwindow.c +++ b/reactos/win32ss/gdi/eng/engwindow.c @@ -96,6 +96,7 @@ IntEngWndUpdateClipObj( /* Update the WNDOBJ */ Clip->WndObj.rclClient = Window->rcClient; + Clip->WndObj.coClient.iUniq++; return TRUE; } @@ -111,12 +112,6 @@ IntEngWindowChanged( { XCLIPOBJ *Clip; - /* - * This function is broken because AtomWndObj conflicts with - * properties set from user mode using SetPropW - */ - return; - ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL); Clip = UserGetProp(Window, AtomWndObj); @@ -126,7 +121,7 @@ IntEngWindowChanged( } ASSERT(Clip->Hwnd == Window->head.h); - if (Clip->WndObj.pvConsumer != NULL) + // if (Clip->WndObj.pvConsumer != NULL) { /* Update the WNDOBJ */ switch (flChanged) @@ -173,6 +168,11 @@ EngCreateWnd( TRACE("EngCreateWnd: pso = 0x%p, hwnd = 0x%p, pfn = 0x%p, fl = 0x%lx, pixfmt = %d\n", pso, hWnd, pfn, fl, iPixelFormat); + if (fl & (WO_RGN_WINDOW | WO_RGN_DESKTOP_COORD | WO_RGN_UPDATE_ALL)) + { + FIXME("Unsupported flags: 0x%lx\n", fl & ~(WO_RGN_CLIENT_DELTA | WO_RGN_CLIENT | WO_RGN_SURFACE_DELTA | WO_RGN_SURFACE)); + } + calledFromUser = UserIsEntered(); if (!calledFromUser) { UserEnterShared(); @@ -209,7 +209,12 @@ EngCreateWnd( /* Fill internal object */ Clip->Hwnd = hWnd; Clip->ChangeProc = pfn; - Clip->Flags = fl; + /* Keep track of relevant flags */ + Clip->Flags = fl & (WO_RGN_CLIENT_DELTA | WO_RGN_CLIENT | WO_RGN_SURFACE_DELTA | WO_RGN_SURFACE | WO_DRAW_NOTIFY); + if (fl & WO_SPRITE_NOTIFY) + Clip->Flags |= WOC_SPRITE_OVERLAP | WOC_SPRITE_NO_OVERLAP; + /* Those should always be sent */ + Clip->Flags |= WOC_CHANGED | WOC_DELETE; Clip->PixelFormat = iPixelFormat; /* associate object with window */ @@ -259,8 +264,8 @@ EngDeleteWnd( { /* Remove object from window */ IntRemoveProp(Window, AtomWndObj); - --gcountPWO; } + --gcountPWO; if (!calledFromUser) { UserLeave(); diff --git a/reactos/win32ss/gdi/ntgdi/dclife.c b/reactos/win32ss/gdi/ntgdi/dclife.c index 67ce491a2ab..9dce67611e2 100644 --- a/reactos/win32ss/gdi/ntgdi/dclife.c +++ b/reactos/win32ss/gdi/ntgdi/dclife.c @@ -318,7 +318,7 @@ DC_vInitDc( /* Other stuff */ pdc->hdcNext = NULL; pdc->hdcPrev = NULL; - pdc->ipfdDevMax = 0x0000ffff; + pdc->ipfdDevMax = 0; pdc->ulCopyCount = -1; pdc->ptlDoBanding.x = 0; pdc->ptlDoBanding.y = 0; diff --git a/reactos/win32ss/gdi/ntgdi/wingl.c b/reactos/win32ss/gdi/ntgdi/wingl.c index 7225b5d71c2..39dabbce8c4 100644 --- a/reactos/win32ss/gdi/ntgdi/wingl.c +++ b/reactos/win32ss/gdi/ntgdi/wingl.c @@ -62,7 +62,19 @@ NtGdiDescribePixelFormat( } if (!pdc->ipfdDevMax) - IntGetipfdDevMax(pdc); + { + if (!IntGetipfdDevMax(pdc)) + { + /* EngSetLastError ? */ + goto Exit; + } + } + + if (!ppfd) + { + Ret = pdc->ipfdDevMax; + goto Exit; + } if ((ipfd < 1) || (ipfd > pdc->ipfdDevMax)) { diff --git a/reactos/win32ss/user/ntuser/ntuser.c b/reactos/win32ss/user/ntuser/ntuser.c index f496e420a15..7b3a4bc5666 100644 --- a/reactos/win32ss/user/ntuser/ntuser.c +++ b/reactos/win32ss/user/ntuser/ntuser.c @@ -49,7 +49,12 @@ InitUserAtoms(VOID) gpsi->atomFrostedWindowProp = IntAddGlobalAtom(L"SysFrostedWindow", TRUE); - AtomWndObj = IntAddGlobalAtom(L"SysWNDO", TRUE); + /* + * FIXME: AddPropW uses the global kernel atom table, thus leading to conflicts if we use + * the win32k atom table for this ones. What is the right thing to do ? + */ + // AtomWndObj = IntAddGlobalAtom(L"SysWNDO", TRUE); + NtAddAtom(L"SysWNDO", 14, &AtomWndObj); AtomLayer = IntAddGlobalAtom(L"SysLayer", TRUE); AtomFlashWndState = IntAddGlobalAtom(L"FlashWState", TRUE); diff --git a/reactos/win32ss/user/ntuser/windc.c b/reactos/win32ss/user/ntuser/windc.c index 5ff495c9950..0e712672731 100644 --- a/reactos/win32ss/user/ntuser/windc.c +++ b/reactos/win32ss/user/ntuser/windc.c @@ -276,11 +276,9 @@ noparent: Dce->DCXFlags &= ~DCX_DCEDIRTY; GdiSelectVisRgn(Dce->hDC, RgnVisible); - - if (VerifyWnd(Window)) // Window maybe dead by this time before finishing the DCE release. - { - IntEngWindowChanged(Window, WOC_RGN_CLIENT); - } + /* Tell GDI driver */ + if (Window) + IntEngWindowChanged(Window, WOC_RGN_CLIENT); if (RgnVisible != NULL) { @@ -935,12 +933,6 @@ DceResetActiveDCEs(PWND Window) DceUpdateVisRgn(pDCE, CurrentWindow, pDCE->DCXFlags); IntGdiSetHookFlags(pDCE->hDC, DCHF_VALIDATEVISRGN); - - if (Window->head.h != pDCE->hwndCurrent) - { -// IntEngWindowChanged(CurrentWindow, WOC_RGN_CLIENT); -// UserDerefObject(CurrentWindow); - } } pLE = pDCE->List.Flink; pDCE = CONTAINING_RECORD(pLE, DCE, List);