- Allow NtGdiDeleteObjectApp to delete a permanent DC, as windows does it.
This is not exactly what windows does, but no one should use a DeletedDC'ed DC anyway.
Fixes "No! You Naughty Application" debug spam and some wine tests

svn path=/branches/reactos-yarotows/; revision=47131
This commit is contained in:
Jérôme Gardou 2010-05-08 16:41:41 +00:00
parent 9e7867ddde
commit 0a68d5e2e4

View file

@ -801,11 +801,28 @@ IntGdiDeleteDC(HDC hDC, BOOL Force)
if (!Force)
{
/* Windows permits NtGdiDeleteObjectApp to delete a permanent DC
* For some reason, it's still a valid handle, pointing to some kernel data.
* Not sure if this is a bug, a feature, some cache stuff... Who knows?
* See NtGdiDeleteObjectApp test for details */
if (DCToDelete->fs & DC_FLAG_PERMANENT)
{
DPRINT1("No! You Naughty Application!\n");
DC_UnlockDc(DCToDelete);
return UserReleaseDC(NULL, hDC, FALSE);
if(UserReleaseDC(NULL, hDC, FALSE))
{
/* ReactOs feature : call UserReleaseDC
* I don't think windows does it.
* Still, complain, no one should ever call DeleteDC
* on a window DC */
DPRINT1("No, you naughty application!\n");
return TRUE;
}
else
{
/* This is not a window owned DC.
* Force its deletion */
return IntGdiDeleteDC(hDC, TRUE);
}
}
}