Commit a60144ee authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

user32: Disable cached DCs once they are released.

parent 0805b0d5
......@@ -476,7 +476,11 @@ static INT release_dc( HWND hwnd, HDC hdc, BOOL end_paint )
{
if (!(dce->flags & DCX_NORESETATTRS)) SetHookFlags( dce->hdc, DCHF_RESETDC );
if (end_paint || (dce->flags & DCX_CACHE)) delete_clip_rgn( dce );
if (dce->flags & DCX_CACHE) dce->count = 0;
if (dce->flags & DCX_CACHE)
{
dce->count = 0;
SetHookFlags( dce->hdc, DCHF_DISABLEDC );
}
ret = TRUE;
}
USER_Unlock();
......@@ -1007,8 +1011,11 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
if (!found && count >= DCE_CACHE_SIZE) found = dceUnused;
dce = found;
if (dce) dce->count = 1;
if (dce)
{
dce->count = 1;
SetHookFlags( dce->hdc, DCHF_ENABLEDC );
}
USER_Unlock();
/* if there's no dce empty or unused, allocate a new one */
......
......@@ -112,9 +112,9 @@ static void test_dc_attributes(void)
/* Released cache DCs are 'disabled' */
rop = SetROP2( old_hdc, R2_BLACK );
todo_wine ok( rop == 0, "got %d\n", rop );
ok( rop == 0, "got %d\n", rop );
rop = GetROP2( old_hdc );
todo_wine ok( rop == 0, "got %d\n", rop );
ok( rop == 0, "got %d\n", rop );
/* test own DC */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment