mirror of
https://github.com/reactos/reactos.git
synced 2025-05-29 05:58:13 +00:00
some fixes on on gdi handles
svn path=/trunk/; revision=6120
This commit is contained in:
parent
3ed28b6e6f
commit
3fd1dcd5e0
4 changed files with 42 additions and 21 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: windc.c,v 1.23 2003/09/09 09:39:21 gvg Exp $
|
/* $Id: windc.c,v 1.24 2003/09/24 16:01:32 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -132,6 +132,9 @@ PDCE FASTCALL DceAllocDCE(HWND hWnd, DCE_TYPE Type)
|
||||||
DCE* Dce;
|
DCE* Dce;
|
||||||
|
|
||||||
DceHandle = DCEOBJ_AllocDCE();
|
DceHandle = DCEOBJ_AllocDCE();
|
||||||
|
if(!DceHandle)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
Dce = DCEOBJ_LockDCE(DceHandle);
|
Dce = DCEOBJ_LockDCE(DceHandle);
|
||||||
Dce->hDC = NtGdiCreateDC(L"DISPLAY", NULL, NULL, NULL);
|
Dce->hDC = NtGdiCreateDC(L"DISPLAY", NULL, NULL, NULL);
|
||||||
Dce->hwndCurrent = hWnd;
|
Dce->hwndCurrent = hWnd;
|
||||||
|
@ -171,6 +174,9 @@ DceSetDrawable(PWINDOW_OBJECT WindowObject, HDC hDC, ULONG Flags,
|
||||||
BOOL SetClipOrigin)
|
BOOL SetClipOrigin)
|
||||||
{
|
{
|
||||||
DC *dc = DC_LockDc(hDC);
|
DC *dc = DC_LockDc(hDC);
|
||||||
|
if(!dc)
|
||||||
|
return;
|
||||||
|
|
||||||
if (WindowObject == NULL)
|
if (WindowObject == NULL)
|
||||||
{
|
{
|
||||||
dc->w.DCOrgX = 0;
|
dc->w.DCOrgX = 0;
|
||||||
|
@ -342,8 +348,9 @@ NtUserGetDCEx(HWND hWnd, HANDLE ClipRegion, ULONG Flags)
|
||||||
DbgBreakPoint();
|
DbgBreakPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == Dce && NULL != Window)
|
if (NULL == Dce)
|
||||||
{
|
{
|
||||||
|
if(NULL != Window)
|
||||||
IntReleaseWindowObject(Window);
|
IntReleaseWindowObject(Window);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
@ -366,6 +373,7 @@ NtUserGetDCEx(HWND hWnd, HANDLE ClipRegion, ULONG Flags)
|
||||||
if (NULL != ClipRegion)
|
if (NULL != ClipRegion)
|
||||||
{
|
{
|
||||||
Dce->hClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
|
Dce->hClipRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
|
||||||
|
if(Dce->hClipRgn)
|
||||||
NtGdiCombineRgn(Dce->hClipRgn, ClipRegion, NULL, RGN_COPY);
|
NtGdiCombineRgn(Dce->hClipRgn, ClipRegion, NULL, RGN_COPY);
|
||||||
NtGdiDeleteObject(ClipRegion);
|
NtGdiDeleteObject(ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: cliprgn.c,v 1.24 2003/09/09 09:39:21 gvg Exp $ */
|
/* $Id: cliprgn.c,v 1.25 2003/09/24 16:01:32 weiden Exp $ */
|
||||||
|
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -58,7 +58,10 @@ CLIPPING_UpdateGCRegion(DC* Dc)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Combined = NtGdiCreateRectRgn(0, 0, 0, 0);
|
Combined = NtGdiCreateRectRgn(0, 0, 0, 0);
|
||||||
ASSERT(NULL != Combined);
|
if(!Combined)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Dc->w.hClipRgn == NULL)
|
if (Dc->w.hClipRgn == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
/*
|
/*
|
||||||
* GDIOBJ.C - GDI object manipulation routines
|
* GDIOBJ.C - GDI object manipulation routines
|
||||||
*
|
*
|
||||||
* $Id: gdiobj.c,v 1.42 2003/09/23 18:04:42 gvg Exp $
|
* $Id: gdiobj.c,v 1.43 2003/09/24 16:01:32 weiden Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -223,8 +223,16 @@ HGDIOBJ FASTCALL
|
||||||
GDIOBJ_AllocObj(WORD Size, DWORD ObjectType, GDICLEANUPPROC CleanupProc)
|
GDIOBJ_AllocObj(WORD Size, DWORD ObjectType, GDICLEANUPPROC CleanupProc)
|
||||||
{
|
{
|
||||||
PGDIOBJHDR newObject;
|
PGDIOBJHDR newObject;
|
||||||
|
WORD Index;
|
||||||
|
|
||||||
DPRINT("GDIOBJ_AllocObj: size: %d, type: 0x%08x\n", Size, ObjectType);
|
Index = GDIOBJ_iGetNextOpenHandleIndex ();
|
||||||
|
if (0 == Index)
|
||||||
|
{
|
||||||
|
DPRINT1("Out of GDI handles\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
DPRINT("GDIOBJ_AllocObj: handle: %d, size: %d, type: 0x%08x\n", Index, Size, ObjectType);
|
||||||
newObject = ExAllocatePool(PagedPool, Size + sizeof (GDIOBJHDR));
|
newObject = ExAllocatePool(PagedPool, Size + sizeof (GDIOBJHDR));
|
||||||
if (newObject == NULL)
|
if (newObject == NULL)
|
||||||
{
|
{
|
||||||
|
@ -233,14 +241,7 @@ GDIOBJ_AllocObj(WORD Size, DWORD ObjectType, GDICLEANUPPROC CleanupProc)
|
||||||
}
|
}
|
||||||
RtlZeroMemory (newObject, Size + sizeof(GDIOBJHDR));
|
RtlZeroMemory (newObject, Size + sizeof(GDIOBJHDR));
|
||||||
|
|
||||||
newObject->wTableIndex = GDIOBJ_iGetNextOpenHandleIndex ();
|
newObject->wTableIndex = Index;
|
||||||
DPRINT("GDIOBJ_AllocObj: object handle %d\n", newObject->wTableIndex );
|
|
||||||
if (0 == newObject->wTableIndex)
|
|
||||||
{
|
|
||||||
DPRINT1("Out of GDI handles\n");
|
|
||||||
ExFreePool(newObject);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
newObject->dwCount = 0;
|
newObject->dwCount = 0;
|
||||||
newObject->hProcessId = PsGetCurrentProcessId ();
|
newObject->hProcessId = PsGetCurrentProcessId ();
|
||||||
|
@ -248,9 +249,9 @@ GDIOBJ_AllocObj(WORD Size, DWORD ObjectType, GDICLEANUPPROC CleanupProc)
|
||||||
newObject->Magic = GDI_TYPE_TO_MAGIC(ObjectType);
|
newObject->Magic = GDI_TYPE_TO_MAGIC(ObjectType);
|
||||||
newObject->lockfile = NULL;
|
newObject->lockfile = NULL;
|
||||||
newObject->lockline = 0;
|
newObject->lockline = 0;
|
||||||
HandleTable->Handles[newObject->wTableIndex] = newObject;
|
HandleTable->Handles[Index] = newObject;
|
||||||
|
|
||||||
return GDI_HANDLE_CREATE(newObject->wTableIndex, ObjectType);
|
return GDI_HANDLE_CREATE(Index, ObjectType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: text.c,v 1.51 2003/09/10 23:16:13 gvg Exp $ */
|
/* $Id: text.c,v 1.52 2003/09/24 16:01:32 weiden Exp $ */
|
||||||
|
|
||||||
|
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
|
@ -1032,7 +1032,7 @@ NtGdiTextOut(HDC hDC,
|
||||||
{
|
{
|
||||||
// Fixme: Call EngTextOut, which does the real work (calling DrvTextOut where appropriate)
|
// Fixme: Call EngTextOut, which does the real work (calling DrvTextOut where appropriate)
|
||||||
|
|
||||||
DC *dc = DC_LockDc(hDC);
|
DC *dc;
|
||||||
SURFOBJ *SurfObj;
|
SURFOBJ *SurfObj;
|
||||||
int error, glyph_index, n, i;
|
int error, glyph_index, n, i;
|
||||||
FT_Face face;
|
FT_Face face;
|
||||||
|
@ -1057,6 +1057,7 @@ NtGdiTextOut(HDC hDC,
|
||||||
PXLATEOBJ XlateObj;
|
PXLATEOBJ XlateObj;
|
||||||
ULONG Mode;
|
ULONG Mode;
|
||||||
|
|
||||||
|
dc = DC_LockDc(hDC);
|
||||||
if( !dc )
|
if( !dc )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
SurfObj = (SURFOBJ*)AccessUserObject((ULONG) dc->Surface);
|
SurfObj = (SURFOBJ*)AccessUserObject((ULONG) dc->Surface);
|
||||||
|
@ -1116,8 +1117,16 @@ NtGdiTextOut(HDC hDC,
|
||||||
if (OPAQUE == dc->w.backgroundMode)
|
if (OPAQUE == dc->w.backgroundMode)
|
||||||
{
|
{
|
||||||
hBrushBg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.backgroundColor));
|
hBrushBg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.backgroundColor));
|
||||||
|
if(hBrushBg)
|
||||||
|
{
|
||||||
BrushBg = BRUSHOBJ_LockBrush(hBrushBg);
|
BrushBg = BRUSHOBJ_LockBrush(hBrushBg);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EngDeleteXlate(XlateObj);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
}
|
||||||
EngDeleteXlate(XlateObj);
|
EngDeleteXlate(XlateObj);
|
||||||
|
|
||||||
SourcePoint.x = 0;
|
SourcePoint.x = 0;
|
||||||
|
|
Loading…
Reference in a new issue