mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 08:53:02 +00:00
fixed some error cases
svn path=/trunk/; revision=9207
This commit is contained in:
parent
e7d451e2fd
commit
aeef6123b6
1 changed files with 74 additions and 59 deletions
|
@ -22,7 +22,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.89 2004/04/09 20:03:20 navaraf Exp $ */
|
/* $Id: text.c,v 1.90 2004/04/23 21:35:59 weiden Exp $ */
|
||||||
|
|
||||||
|
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
|
@ -1515,7 +1515,10 @@ NtGdiExtTextOut(
|
||||||
|
|
||||||
dc = DC_LockDc(hDC);
|
dc = DC_LockDc(hDC);
|
||||||
if (!dc)
|
if (!dc)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != UnsafeDx)
|
if (NULL != UnsafeDx)
|
||||||
{
|
{
|
||||||
|
@ -2467,13 +2470,18 @@ NtGdiGetTextMetrics(HDC hDC,
|
||||||
TT_OS2 *pOS2;
|
TT_OS2 *pOS2;
|
||||||
ULONG Error;
|
ULONG Error;
|
||||||
|
|
||||||
dc = DC_LockDc(hDC);
|
if (NULL == tm)
|
||||||
if (NULL == dc || NULL == tm)
|
|
||||||
{
|
{
|
||||||
Status = STATUS_INVALID_PARAMETER;
|
SetLastWin32Error(STATUS_INVALID_PARAMETER);
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if(!(dc = DC_LockDc(hDC)))
|
||||||
{
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
TextObj = TEXTOBJ_LockText(dc->w.hFont);
|
TextObj = TEXTOBJ_LockText(dc->w.hFont);
|
||||||
if (NULL != TextObj)
|
if (NULL != TextObj)
|
||||||
{
|
{
|
||||||
|
@ -2524,9 +2532,14 @@ NtGdiGetTextMetrics(HDC hDC,
|
||||||
Status = STATUS_INVALID_HANDLE;
|
Status = STATUS_INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
DC_UnlockDc(hDC);
|
DC_UnlockDc(hDC);
|
||||||
|
|
||||||
|
if(!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NT_SUCCESS(Status);
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
|
@ -2564,7 +2577,8 @@ NtGdiSetTextAlign(HDC hDC,
|
||||||
dc = DC_LockDc(hDC);
|
dc = DC_LockDc(hDC);
|
||||||
if (!dc)
|
if (!dc)
|
||||||
{
|
{
|
||||||
return 0;
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
|
return GDI_ERROR;
|
||||||
}
|
}
|
||||||
prevAlign = dc->w.textAlign;
|
prevAlign = dc->w.textAlign;
|
||||||
dc->w.textAlign = Mode;
|
dc->w.textAlign = Mode;
|
||||||
|
@ -2583,7 +2597,8 @@ NtGdiSetTextColor(HDC hDC,
|
||||||
|
|
||||||
if (!dc)
|
if (!dc)
|
||||||
{
|
{
|
||||||
return 0x80000000;
|
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||||
|
return CLR_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
oldColor = dc->w.textColor;
|
oldColor = dc->w.textColor;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue