mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 09:43:04 +00:00
Use SetDCOwnerEx, this will allow for gracefull errors when changing ownership of the DCs.
svn path=/trunk/; revision=33812
This commit is contained in:
parent
457aee023d
commit
8a24ff76e0
1 changed files with 4 additions and 10 deletions
|
@ -133,12 +133,8 @@ DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PDC dc = DC_LockDc ( pDce->hDC );
|
|
||||||
DPRINT("FREE DCATTR!!!! NOT DCE_WINDOW_DC!!!!! hDC-> %x\n", pDce->hDC);
|
DPRINT("FREE DCATTR!!!! NOT DCE_WINDOW_DC!!!!! hDC-> %x\n", pDce->hDC);
|
||||||
MmCopyFromCaller(&dc->Dc_Attr, dc->pDc_Attr, sizeof(DC_ATTR));
|
IntGdiSetDCOwnerEx( pDce->hDC, GDI_OBJ_HMGR_NONE, FALSE);
|
||||||
DC_UnlockDc( dc );
|
|
||||||
DC_FreeDcAttr(pDce->hDC); // Free the dcattr!
|
|
||||||
DC_SetOwnership(pDce->hDC, NULL); // This hDC is inaccessible!
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Type == DCE_CACHE_DC)
|
if (Type == DCE_CACHE_DC)
|
||||||
|
@ -262,8 +258,8 @@ DceReleaseDC(DCE* dce, BOOL EndPaint)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DPRINT("Exit!!!!! DCX_CACHE!!!!!! hDC-> %x \n", dce->hDC);
|
DPRINT("Exit!!!!! DCX_CACHE!!!!!! hDC-> %x \n", dce->hDC);
|
||||||
DC_FreeDcAttr(dce->hDC); // Free the dcattr.
|
if (!IntGdiSetDCOwnerEx( dce->hDC, GDI_OBJ_HMGR_NONE, FALSE))
|
||||||
DC_SetOwnership(dce->hDC, NULL); // Set hDC inaccessible mode.
|
return 0;
|
||||||
dce->pProcess = NULL; // Reset ownership.
|
dce->pProcess = NULL; // Reset ownership.
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -565,9 +561,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
|
||||||
{
|
{
|
||||||
DPRINT("ENTER!!!!!! DCX_CACHE!!!!!! hDC-> %x\n", Dce->hDC);
|
DPRINT("ENTER!!!!!! DCX_CACHE!!!!!! hDC-> %x\n", Dce->hDC);
|
||||||
// Need to set ownership so Sync dcattr will work.
|
// Need to set ownership so Sync dcattr will work.
|
||||||
DC_SetOwnership( Dce->hDC, PsGetCurrentProcess());
|
IntGdiSetDCOwnerEx( Dce->hDC, GDI_OBJ_HMGR_POWNED, FALSE);
|
||||||
DC_AllocateDcAttr( Dce->hDC ); // Allocate new dcattr
|
|
||||||
DCU_SynchDcAttrtoUser( Dce->hDC); // Copy data from dc to dcattr
|
|
||||||
Dce->pProcess = PsGetCurrentProcess(); // Set the temp owning process
|
Dce->pProcess = PsGetCurrentProcess(); // Set the temp owning process
|
||||||
}
|
}
|
||||||
return(Dce->hDC);
|
return(Dce->hDC);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue