diff --git a/reactos/subsystems/win32/win32k/ntuser/cursoricon.c b/reactos/subsystems/win32/win32k/ntuser/cursoricon.c index 45643f2f09d..feec477175c 100644 --- a/reactos/subsystems/win32/win32k/ntuser/cursoricon.c +++ b/reactos/subsystems/win32/win32k/ntuser/cursoricon.c @@ -523,7 +523,7 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PW32PROCESS Win32Process) 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 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PW32PROCESS Win32Process) { RemoveEntryList(&CurIcon->ListEntry); IntDestroyCurIconObject(WinSta, CurIcon, TRUE); + CurIcon = NULL; break; } } @@ -539,7 +540,10 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PW32PROCESS Win32Process) // UserDereferenceObject(Object); } - + if (CurIcon) + { + UserDereferenceObject(CurIcon); + } } ObDereferenceObject(WinSta); diff --git a/reactos/subsystems/win32/win32k/ntuser/painting.c b/reactos/subsystems/win32/win32k/ntuser/painting.c index abf37b486f5..3b213e85f0e 100644 --- a/reactos/subsystems/win32/win32k/ntuser/painting.c +++ b/reactos/subsystems/win32/win32k/ntuser/painting.c @@ -696,6 +696,8 @@ IntGetPaintMessage(HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, 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; } diff --git a/reactos/subsystems/win32/win32k/ntuser/windc.c b/reactos/subsystems/win32/win32k/ntuser/windc.c index c6cd0842b48..74366ae2f44 100644 --- a/reactos/subsystems/win32/win32k/ntuser/windc.c +++ b/reactos/subsystems/win32/win32k/ntuser/windc.c @@ -506,6 +506,13 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags) 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 @@ DceFreeDCE(PDCE pdce, BOOLEAN Force) } if (!Hit) IntGdiDeleteDC(pdce->hDC, TRUE); - + if (pdce->hClipRgn && ! (pdce->DCXFlags & DCX_KEEPCLIPRGN)) { NtGdiDeleteObject(pdce->hClipRgn); @@ -762,7 +769,7 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window) } while (pDCE != FirstDce); } -HDC +HDC FASTCALL IntGetDC(PWINDOW_OBJECT Window) { @@ -811,7 +818,7 @@ UserReleaseDC(PWINDOW_OBJECT Window, HDC hDc, BOOL EndPaint) KeEnterCriticalRegion(); do { - if (dce->hDC == hDc) + if (dce->hDC == hDc) { Hit = TRUE; break; @@ -821,7 +828,7 @@ UserReleaseDC(PWINDOW_OBJECT Window, HDC hDc, BOOL EndPaint) } while (dce != FirstDce ); KeLeaveCriticalRegion(); - + if ( Hit && (dce->DCXFlags & DCX_DCEBUSY)) { nRet = DceReleaseDC(dce, EndPaint); diff --git a/reactos/subsystems/win32/win32k/objects/gdiobj.c b/reactos/subsystems/win32/win32k/objects/gdiobj.c index 4711c482c2e..070b2f9e3e0 100644 --- a/reactos/subsystems/win32/win32k/objects/gdiobj.c +++ b/reactos/subsystems/win32/win32k/objects/gdiobj.c @@ -330,7 +330,10 @@ LockErrorDebugOutput(HGDIOBJ hObj, PGDI_TABLE_ENTRY Entry, LPSTR Function) 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 @@ GDIOBJ_LockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ExpectedType) * 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 @@ GDIOBJ_ShareLockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD Expected * locking type mismatches. */ LockErrorDebugOutput(hObj, Entry, "GDIOBJ_ShareLockObj"); - -#ifdef GDI_DEBUG - DPRINT1("-> called from:\n"); - KeRosDumpStackFrames(NULL, 20); -#endif } /* Unlock the handle table entry. */