mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[WIN32K]
Fix reference counting in PDEVOBJ_pSurface. Fixes failed assertions on newer MSVC builds. svn path=/trunk/; revision=65536
This commit is contained in:
parent
7dc70b785f
commit
685e2218f0
1 changed files with 7 additions and 9 deletions
|
@ -212,21 +212,19 @@ PDEVOBJ_pSurface(
|
||||||
{
|
{
|
||||||
HSURF hsurf;
|
HSURF hsurf;
|
||||||
|
|
||||||
/* Check if we already have a surface */
|
/* Check if there is no surface for this PDEV yet */
|
||||||
if (ppdev->pSurface)
|
if (ppdev->pSurface == NULL)
|
||||||
{
|
|
||||||
/* Increment reference count */
|
|
||||||
GDIOBJ_vReferenceObjectByPointer(&ppdev->pSurface->BaseObject);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
/* Call the drivers DrvEnableSurface */
|
/* Call the drivers DrvEnableSurface */
|
||||||
hsurf = ppdev->pldev->pfn.EnableSurface(ppdev->dhpdev);
|
hsurf = ppdev->pldev->pfn.EnableSurface(ppdev->dhpdev);
|
||||||
|
|
||||||
/* Lock the surface */
|
/* Get a reference to the surface */
|
||||||
ppdev->pSurface = SURFACE_ShareLockSurface(hsurf);
|
ppdev->pSurface = SURFACE_ShareLockSurface(hsurf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Increment reference count */
|
||||||
|
GDIOBJ_vReferenceObjectByPointer(&ppdev->pSurface->BaseObject);
|
||||||
|
|
||||||
DPRINT("PDEVOBJ_pSurface() returning %p\n", ppdev->pSurface);
|
DPRINT("PDEVOBJ_pSurface() returning %p\n", ppdev->pSurface);
|
||||||
return ppdev->pSurface;
|
return ppdev->pSurface;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue