mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Failed to release DC
svn path=/trunk/; revision=5497
This commit is contained in:
parent
3d7fc85f62
commit
0d95af3a22
1 changed files with 29 additions and 14 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: text.c,v 1.39 2003/08/09 12:03:10 gvg Exp $ */
|
/* $Id: text.c,v 1.40 2003/08/09 21:14:01 gvg Exp $ */
|
||||||
|
|
||||||
|
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
|
@ -531,7 +531,7 @@ W32kGetTextCharsetInfo(HDC hDC,
|
||||||
|
|
||||||
static BOOL
|
static BOOL
|
||||||
FASTCALL
|
FASTCALL
|
||||||
TextIntGetTextExtentPoint(PDC dc,
|
TextIntGetTextExtentPoint(PTEXTOBJ TextObj,
|
||||||
LPCWSTR String,
|
LPCWSTR String,
|
||||||
int Count,
|
int Count,
|
||||||
int MaxExtent,
|
int MaxExtent,
|
||||||
|
@ -539,7 +539,6 @@ TextIntGetTextExtentPoint(PDC dc,
|
||||||
LPINT Dx,
|
LPINT Dx,
|
||||||
LPSIZE Size)
|
LPSIZE Size)
|
||||||
{
|
{
|
||||||
PTEXTOBJ TextObj;
|
|
||||||
PFONTGDI FontGDI;
|
PFONTGDI FontGDI;
|
||||||
FT_Face face;
|
FT_Face face;
|
||||||
FT_GlyphSlot glyph;
|
FT_GlyphSlot glyph;
|
||||||
|
@ -548,7 +547,6 @@ TextIntGetTextExtentPoint(PDC dc,
|
||||||
FT_CharMap charmap, found = NULL;
|
FT_CharMap charmap, found = NULL;
|
||||||
BOOL use_kerning;
|
BOOL use_kerning;
|
||||||
|
|
||||||
TextObj = TEXTOBJ_LockText(dc->w.hFont);
|
|
||||||
GetFontObjectsFromTextObj(TextObj, NULL, NULL, &FontGDI);
|
GetFontObjectsFromTextObj(TextObj, NULL, NULL, &FontGDI);
|
||||||
face = FontGDI->face;
|
face = FontGDI->face;
|
||||||
if (NULL != Fit)
|
if (NULL != Fit)
|
||||||
|
@ -644,8 +642,6 @@ TextIntGetTextExtentPoint(PDC dc,
|
||||||
String++;
|
String++;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEXTOBJ_UnlockText(dc->w.hFont);
|
|
||||||
|
|
||||||
Size->cx = TotalWidth;
|
Size->cx = TotalWidth;
|
||||||
Size->cy = MaxHeight;
|
Size->cy = MaxHeight;
|
||||||
|
|
||||||
|
@ -669,14 +665,8 @@ W32kGetTextExtentExPoint(HDC hDC,
|
||||||
BOOLEAN Result;
|
BOOLEAN Result;
|
||||||
INT Fit;
|
INT Fit;
|
||||||
LPINT Dx;
|
LPINT Dx;
|
||||||
|
PTEXTOBJ TextObj;
|
||||||
|
|
||||||
dc = DC_HandleToPtr(hDC);
|
|
||||||
|
|
||||||
if (NULL == dc)
|
|
||||||
{
|
|
||||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (Count < 0)
|
if (Count < 0)
|
||||||
{
|
{
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
|
@ -729,8 +719,22 @@ W32kGetTextExtentExPoint(HDC hDC,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result = TextIntGetTextExtentPoint(dc, String, Count, MaxExtent,
|
dc = DC_HandleToPtr(hDC);
|
||||||
|
if (NULL == dc)
|
||||||
|
{
|
||||||
|
if (NULL != Dx)
|
||||||
|
{
|
||||||
|
ExFreePool(Dx);
|
||||||
|
}
|
||||||
|
ExFreePool(String);
|
||||||
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
TextObj = TEXTOBJ_LockText(dc->w.hFont);
|
||||||
|
DC_ReleasePtr(hDC);
|
||||||
|
Result = TextIntGetTextExtentPoint(TextObj, String, Count, MaxExtent,
|
||||||
NULL == UnsafeFit ? NULL : &Fit, Dx, &Size);
|
NULL == UnsafeFit ? NULL : &Fit, Dx, &Size);
|
||||||
|
TEXTOBJ_UnlockText(dc->w.hFont);
|
||||||
|
|
||||||
ExFreePool(String);
|
ExFreePool(String);
|
||||||
if (! Result)
|
if (! Result)
|
||||||
|
@ -806,6 +810,7 @@ W32kGetTextExtentPoint32(HDC hDC,
|
||||||
SIZE Size;
|
SIZE Size;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
BOOLEAN Result;
|
BOOLEAN Result;
|
||||||
|
PTEXTOBJ TextObj;
|
||||||
|
|
||||||
dc = DC_HandleToPtr(hDC);
|
dc = DC_HandleToPtr(hDC);
|
||||||
|
|
||||||
|
@ -847,7 +852,17 @@ W32kGetTextExtentPoint32(HDC hDC,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dc = DC_HandleToPtr(hDC);
|
||||||
|
if (NULL == dc)
|
||||||
|
{
|
||||||
|
ExFreePool(String);
|
||||||
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
TextObj = TEXTOBJ_LockText(dc->w.hFont);
|
||||||
|
DC_ReleasePtr(hDC);
|
||||||
Result = TextIntGetTextExtentPoint(dc, String, Count, 0, NULL, NULL, &Size);
|
Result = TextIntGetTextExtentPoint(dc, String, Count, 0, NULL, NULL, &Size);
|
||||||
|
TEXTOBJ_UnlockText(dc->w.hFont);
|
||||||
|
|
||||||
ExFreePool(String);
|
ExFreePool(String);
|
||||||
if (! Result)
|
if (! Result)
|
||||||
|
|
Loading…
Reference in a new issue