Author: tkreuzer Date: Mon Feb 25 04:32:17 2008 New Revision: 32473
URL: http://svn.reactos.org/svn/reactos?rev=32473&view=rev Log: - Reference CursorIcon before deleting it - IntGetPaintMessage: Set MessageQueue->PaintCount to 0, if no dirty Window is found. Stops spamming the debuglog, once is enough. - UserGetDCEx: Check if a dce's hDC is valid, if not warn and create a new one. With our current code those hDCs should never get deleted, but this is also a hack, on Windows you can delete them. - Don't dump the stack backtrace twice in GDIOBJ_Xxx functions
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c trunk/reactos/subsystems/win32/win32k/ntuser/painting.c trunk/reactos/subsystems/win32/win32k/ntuser/windc.c trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c Mon Feb 25 04:32:17 2008 @@ -523,7 +523,7 @@
LIST_FOR_EACH_SAFE(CurIcon, tmp, &gCurIconList, CURICON_OBJECT, ListEntry) { -// UserReferenceObject(CurIcon); + UserReferenceObject(CurIcon); // if(NT_SUCCESS(UserReferenceObjectByPointer(Object, otCursorIcon))) { LIST_FOR_EACH(ProcessData, &CurIcon->ProcessList, CURICON_PROCESS, ListEntry) @@ -532,6 +532,7 @@ { RemoveEntryList(&CurIcon->ListEntry); IntDestroyCurIconObject(WinSta, CurIcon, TRUE); + CurIcon = NULL; break; } } @@ -539,7 +540,10 @@ // UserDereferenceObject(Object); }
- + if (CurIcon) + { + UserDereferenceObject(CurIcon); + } }
ObDereferenceObject(WinSta);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/painting.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/painting.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/painting.c Mon Feb 25 04:32:17 2008 @@ -696,6 +696,8 @@ if (Message->hwnd == NULL) { DPRINT1("PAINTING BUG: Thread marked as containing dirty windows, but no dirty windows found!\n"); + /* Hack to stop spamming the debuglog ! */ + MessageQueue->PaintCount = 0; return FALSE; }
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c Mon Feb 25 04:32:17 2008 @@ -506,6 +506,13 @@ return(NULL); }
+ if (!GDIOBJ_ValidateHandle(Dce->hDC, GDI_OBJECT_TYPE_DC)) + { + DPRINT1("FIXME: Got DCE with invalid hDC!\n"); + Dce->hDC = DceCreateDisplayDC(); + /* FIXME: Handle error */ + } + Dce->hwndCurrent = (Window ? Window->hSelf : NULL); Dce->DCXFlags = Flags | DCX_DCEBUSY;
@@ -597,7 +604,7 @@ }
if (!Hit) IntGdiDeleteDC(pdce->hDC, TRUE); - + if (pdce->hClipRgn && ! (pdce->DCXFlags & DCX_KEEPCLIPRGN)) { NtGdiDeleteObject(pdce->hClipRgn); @@ -762,7 +769,7 @@ } while (pDCE != FirstDce); }
-HDC +HDC FASTCALL IntGetDC(PWINDOW_OBJECT Window) { @@ -811,7 +818,7 @@ KeEnterCriticalRegion(); do { - if (dce->hDC == hDc) + if (dce->hDC == hDc) { Hit = TRUE; break; @@ -821,7 +828,7 @@ } while (dce != FirstDce ); KeLeaveCriticalRegion(); - + if ( Hit && (dce->DCXFlags & DCX_DCEBUSY)) { nRet = DceReleaseDC(dce, EndPaint);
Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c Mon Feb 25 04:32:17 2008 @@ -330,7 +330,10 @@ DPRINT1("%s: Attempted to lock object 0x%x, something went wrong, typeinfo = 0x%x\n", Function, hObj, Entry->Type); } +#ifdef GDI_DEBUG + DPRINT1("-> called from:\n"); KeRosDumpStackFrames(NULL, 20); +#endif }
ULONG @@ -952,11 +955,6 @@ * locking type mismatches. */ LockErrorDebugOutput(hObj, Entry, "GDIOBJ_LockObj"); - -#ifdef GDI_DEBUG - DPRINT1("-> called from:\n"); - KeRosDumpStackFrames(NULL, 20); -#endif }
/* Unlock the handle table entry. */ @@ -1081,11 +1079,6 @@ * locking type mismatches. */ LockErrorDebugOutput(hObj, Entry, "GDIOBJ_ShareLockObj"); - -#ifdef GDI_DEBUG - DPRINT1("-> called from:\n"); - KeRosDumpStackFrames(NULL, 20); -#endif }
/* Unlock the handle table entry. */