mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 05:00:27 +00:00
[WIN32K] - Formatting. No code changes.
svn path=/trunk/; revision=54641
This commit is contained in:
parent
be38b5da3b
commit
afac3095f0
1 changed files with 340 additions and 340 deletions
|
@ -29,46 +29,46 @@ GreGetTextExtentW(
|
|||
LPSIZE psize,
|
||||
UINT flOpts)
|
||||
{
|
||||
PDC pdc;
|
||||
PDC_ATTR pdcattr;
|
||||
BOOL Result;
|
||||
PTEXTOBJ TextObj;
|
||||
PDC pdc;
|
||||
PDC_ATTR pdcattr;
|
||||
BOOL Result;
|
||||
PTEXTOBJ TextObj;
|
||||
|
||||
if (!cwc)
|
||||
{
|
||||
psize->cx = 0;
|
||||
psize->cy = 0;
|
||||
return TRUE;
|
||||
}
|
||||
if (!cwc)
|
||||
{
|
||||
psize->cx = 0;
|
||||
psize->cy = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
pdc = DC_LockDc(hDC);
|
||||
if (!pdc)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
pdc = DC_LockDc(hDC);
|
||||
if (!pdc)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pdcattr = pdc->pdcattr;
|
||||
pdcattr = pdc->pdcattr;
|
||||
|
||||
TextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
if ( TextObj )
|
||||
{
|
||||
Result = TextIntGetTextExtentPoint( pdc,
|
||||
TextObj,
|
||||
lpwsz,
|
||||
cwc,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
psize,
|
||||
flOpts);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
Result = FALSE;
|
||||
TextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
if ( TextObj )
|
||||
{
|
||||
Result = TextIntGetTextExtentPoint( pdc,
|
||||
TextObj,
|
||||
lpwsz,
|
||||
cwc,
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
psize,
|
||||
flOpts);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
Result = FALSE;
|
||||
|
||||
DC_UnlockDc(pdc);
|
||||
return Result;
|
||||
DC_UnlockDc(pdc);
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,72 +89,72 @@ GreGetTextExtentExW(
|
|||
LPSIZE pSize,
|
||||
FLONG fl)
|
||||
{
|
||||
PDC pdc;
|
||||
PDC_ATTR pdcattr;
|
||||
BOOL Result;
|
||||
PTEXTOBJ TextObj;
|
||||
PDC pdc;
|
||||
PDC_ATTR pdcattr;
|
||||
BOOL Result;
|
||||
PTEXTOBJ TextObj;
|
||||
|
||||
if ( (!String && Count ) || !pSize )
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
if ( (!String && Count ) || !pSize )
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( !Count )
|
||||
{
|
||||
if ( Fit ) Fit = 0;
|
||||
return TRUE;
|
||||
}
|
||||
if ( !Count )
|
||||
{
|
||||
if ( Fit ) Fit = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
pdc = DC_LockDc(hDC);
|
||||
if (NULL == pdc)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
pdcattr = pdc->pdcattr;
|
||||
pdc = DC_LockDc(hDC);
|
||||
if (NULL == pdc)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
pdcattr = pdc->pdcattr;
|
||||
|
||||
TextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
if ( TextObj )
|
||||
{
|
||||
Result = TextIntGetTextExtentPoint( pdc,
|
||||
TextObj,
|
||||
String,
|
||||
Count,
|
||||
MaxExtent,
|
||||
(LPINT)Fit,
|
||||
(LPINT)Dx,
|
||||
pSize,
|
||||
fl);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
Result = FALSE;
|
||||
TextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
if ( TextObj )
|
||||
{
|
||||
Result = TextIntGetTextExtentPoint( pdc,
|
||||
TextObj,
|
||||
String,
|
||||
Count,
|
||||
MaxExtent,
|
||||
(LPINT)Fit,
|
||||
(LPINT)Dx,
|
||||
pSize,
|
||||
fl);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
Result = FALSE;
|
||||
|
||||
DC_UnlockDc(pdc);
|
||||
return Result;
|
||||
DC_UnlockDc(pdc);
|
||||
return Result;
|
||||
}
|
||||
|
||||
DWORD
|
||||
APIENTRY
|
||||
NtGdiGetCharSet(HDC hDC)
|
||||
{
|
||||
PDC Dc;
|
||||
PDC_ATTR pdcattr;
|
||||
DWORD cscp;
|
||||
// If here, update everything!
|
||||
Dc = DC_LockDc(hDC);
|
||||
if (!Dc)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
cscp = ftGdiGetTextCharsetInfo(Dc,NULL,0);
|
||||
pdcattr = Dc->pdcattr;
|
||||
pdcattr->iCS_CP = cscp;
|
||||
pdcattr->ulDirty_ &= ~DIRTY_CHARSET;
|
||||
DC_UnlockDc( Dc );
|
||||
return cscp;
|
||||
PDC Dc;
|
||||
PDC_ATTR pdcattr;
|
||||
DWORD cscp;
|
||||
// If here, update everything!
|
||||
Dc = DC_LockDc(hDC);
|
||||
if (!Dc)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
cscp = ftGdiGetTextCharsetInfo(Dc, NULL, 0);
|
||||
pdcattr = Dc->pdcattr;
|
||||
pdcattr->iCS_CP = cscp;
|
||||
pdcattr->ulDirty_ &= ~DIRTY_CHARSET;
|
||||
DC_UnlockDc( Dc );
|
||||
return cscp;
|
||||
}
|
||||
|
||||
BOOL
|
||||
|
@ -163,37 +163,37 @@ NtGdiGetRasterizerCaps(
|
|||
OUT LPRASTERIZER_STATUS praststat,
|
||||
IN ULONG cjBytes)
|
||||
{
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
RASTERIZER_STATUS rsSafe;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
RASTERIZER_STATUS rsSafe;
|
||||
|
||||
if (praststat && cjBytes)
|
||||
{
|
||||
if ( cjBytes >= sizeof(RASTERIZER_STATUS) ) cjBytes = sizeof(RASTERIZER_STATUS);
|
||||
if ( ftGdiGetRasterizerCaps(&rsSafe))
|
||||
{
|
||||
_SEH2_TRY
|
||||
if (praststat && cjBytes)
|
||||
{
|
||||
if ( cjBytes >= sizeof(RASTERIZER_STATUS) ) cjBytes = sizeof(RASTERIZER_STATUS);
|
||||
if ( ftGdiGetRasterizerCaps(&rsSafe))
|
||||
{
|
||||
ProbeForWrite( praststat,
|
||||
sizeof(RASTERIZER_STATUS),
|
||||
1);
|
||||
RtlCopyMemory(praststat, &rsSafe, cjBytes );
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = _SEH2_GetExceptionCode();
|
||||
}
|
||||
_SEH2_END;
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite( praststat,
|
||||
sizeof(RASTERIZER_STATUS),
|
||||
1);
|
||||
RtlCopyMemory(praststat, &rsSafe, cjBytes );
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = _SEH2_GetExceptionCode();
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
INT
|
||||
|
@ -203,49 +203,49 @@ NtGdiGetTextCharsetInfo(
|
|||
OUT OPTIONAL LPFONTSIGNATURE lpSig,
|
||||
IN DWORD dwFlags)
|
||||
{
|
||||
PDC Dc;
|
||||
INT Ret;
|
||||
FONTSIGNATURE fsSafe;
|
||||
PFONTSIGNATURE pfsSafe = &fsSafe;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
PDC Dc;
|
||||
INT Ret;
|
||||
FONTSIGNATURE fsSafe;
|
||||
PFONTSIGNATURE pfsSafe = &fsSafe;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
Dc = DC_LockDc(hdc);
|
||||
if (!Dc)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return DEFAULT_CHARSET;
|
||||
}
|
||||
Dc = DC_LockDc(hdc);
|
||||
if (!Dc)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return DEFAULT_CHARSET;
|
||||
}
|
||||
|
||||
if (!lpSig) pfsSafe = NULL;
|
||||
if (!lpSig) pfsSafe = NULL;
|
||||
|
||||
Ret = HIWORD(ftGdiGetTextCharsetInfo( Dc, pfsSafe, dwFlags));
|
||||
Ret = HIWORD(ftGdiGetTextCharsetInfo( Dc, pfsSafe, dwFlags));
|
||||
|
||||
if (lpSig)
|
||||
{
|
||||
if (Ret == DEFAULT_CHARSET)
|
||||
RtlZeroMemory(pfsSafe, sizeof(FONTSIGNATURE));
|
||||
if (lpSig)
|
||||
{
|
||||
if (Ret == DEFAULT_CHARSET)
|
||||
RtlZeroMemory(pfsSafe, sizeof(FONTSIGNATURE));
|
||||
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite( lpSig,
|
||||
sizeof(FONTSIGNATURE),
|
||||
1);
|
||||
RtlCopyMemory(lpSig, pfsSafe, sizeof(FONTSIGNATURE));
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = _SEH2_GetExceptionCode();
|
||||
}
|
||||
_SEH2_END;
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite( lpSig,
|
||||
sizeof(FONTSIGNATURE),
|
||||
1);
|
||||
RtlCopyMemory(lpSig, pfsSafe, sizeof(FONTSIGNATURE));
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = _SEH2_GetExceptionCode();
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return DEFAULT_CHARSET;
|
||||
}
|
||||
}
|
||||
DC_UnlockDc(Dc);
|
||||
return Ret;
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return DEFAULT_CHARSET;
|
||||
}
|
||||
}
|
||||
DC_UnlockDc(Dc);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -268,145 +268,145 @@ NtGdiGetTextExtentExW(
|
|||
IN FLONG fl
|
||||
)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR pdcattr;
|
||||
LPWSTR String;
|
||||
SIZE Size;
|
||||
NTSTATUS Status;
|
||||
BOOLEAN Result;
|
||||
INT Fit;
|
||||
LPINT Dx;
|
||||
PTEXTOBJ TextObj;
|
||||
PDC dc;
|
||||
PDC_ATTR pdcattr;
|
||||
LPWSTR String;
|
||||
SIZE Size;
|
||||
NTSTATUS Status;
|
||||
BOOLEAN Result;
|
||||
INT Fit;
|
||||
LPINT Dx;
|
||||
PTEXTOBJ TextObj;
|
||||
|
||||
/* FIXME: Handle fl */
|
||||
/* FIXME: Handle fl */
|
||||
|
||||
if (0 == Count)
|
||||
if (0 == Count)
|
||||
{
|
||||
Size.cx = 0;
|
||||
Size.cy = 0;
|
||||
Status = MmCopyToCaller(UnsafeSize, &Size, sizeof(SIZE));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
Size.cx = 0;
|
||||
Size.cy = 0;
|
||||
Status = MmCopyToCaller(UnsafeSize, &Size, sizeof(SIZE));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
String = ExAllocatePoolWithTag(PagedPool, Count * sizeof(WCHAR), GDITAG_TEXT);
|
||||
if (NULL == String)
|
||||
String = ExAllocatePoolWithTag(PagedPool, Count * sizeof(WCHAR), GDITAG_TEXT);
|
||||
if (NULL == String)
|
||||
{
|
||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (NULL != UnsafeDx)
|
||||
if (NULL != UnsafeDx)
|
||||
{
|
||||
Dx = ExAllocatePoolWithTag(PagedPool, Count * sizeof(INT), GDITAG_TEXT);
|
||||
if (NULL == Dx)
|
||||
{
|
||||
ExFreePoolWithTag(String, GDITAG_TEXT);
|
||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
Dx = ExAllocatePoolWithTag(PagedPool, Count * sizeof(INT), GDITAG_TEXT);
|
||||
if (NULL == Dx)
|
||||
{
|
||||
ExFreePoolWithTag(String, GDITAG_TEXT);
|
||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
Dx = NULL;
|
||||
Dx = NULL;
|
||||
}
|
||||
|
||||
Status = MmCopyFromCaller(String, UnsafeString, Count * sizeof(WCHAR));
|
||||
if (! NT_SUCCESS(Status))
|
||||
Status = MmCopyFromCaller(String, UnsafeString, Count * sizeof(WCHAR));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePoolWithTag(Dx, GDITAG_TEXT);
|
||||
}
|
||||
ExFreePoolWithTag(String, GDITAG_TEXT);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePoolWithTag(Dx, GDITAG_TEXT);
|
||||
}
|
||||
ExFreePoolWithTag(String, GDITAG_TEXT);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dc = DC_LockDc(hDC);
|
||||
if (NULL == dc)
|
||||
dc = DC_LockDc(hDC);
|
||||
if (NULL == dc)
|
||||
{
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePoolWithTag(Dx, GDITAG_TEXT);
|
||||
}
|
||||
ExFreePoolWithTag(String, GDITAG_TEXT);
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePoolWithTag(Dx, GDITAG_TEXT);
|
||||
}
|
||||
ExFreePoolWithTag(String, GDITAG_TEXT);
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
pdcattr = dc->pdcattr;
|
||||
TextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
if ( TextObj )
|
||||
{
|
||||
Result = TextIntGetTextExtentPoint( dc,
|
||||
TextObj,
|
||||
String,
|
||||
Count,
|
||||
MaxExtent,
|
||||
NULL == UnsafeFit ? NULL : &Fit,
|
||||
Dx,
|
||||
&Size,
|
||||
fl);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
Result = FALSE;
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
ExFreePoolWithTag(String, GDITAG_TEXT);
|
||||
if (! Result)
|
||||
pdcattr = dc->pdcattr;
|
||||
TextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
if ( TextObj )
|
||||
{
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePoolWithTag(Dx, GDITAG_TEXT);
|
||||
}
|
||||
return FALSE;
|
||||
Result = TextIntGetTextExtentPoint( dc,
|
||||
TextObj,
|
||||
String,
|
||||
Count,
|
||||
MaxExtent,
|
||||
NULL == UnsafeFit ? NULL : &Fit,
|
||||
Dx,
|
||||
&Size,
|
||||
fl);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
Result = FALSE;
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
ExFreePoolWithTag(String, GDITAG_TEXT);
|
||||
if (! Result)
|
||||
{
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePoolWithTag(Dx, GDITAG_TEXT);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (NULL != UnsafeFit)
|
||||
if (NULL != UnsafeFit)
|
||||
{
|
||||
Status = MmCopyToCaller(UnsafeFit, &Fit, sizeof(INT));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePoolWithTag(Dx, GDITAG_TEXT);
|
||||
}
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
Status = MmCopyToCaller(UnsafeFit, &Fit, sizeof(INT));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePoolWithTag(Dx, GDITAG_TEXT);
|
||||
}
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL != UnsafeDx)
|
||||
if (NULL != UnsafeDx)
|
||||
{
|
||||
Status = MmCopyToCaller(UnsafeDx, Dx, Count * sizeof(INT));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePoolWithTag(Dx, GDITAG_TEXT);
|
||||
}
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
Status = MmCopyToCaller(UnsafeDx, Dx, Count * sizeof(INT));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePoolWithTag(Dx, GDITAG_TEXT);
|
||||
}
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (NULL != Dx)
|
||||
if (NULL != Dx)
|
||||
{
|
||||
ExFreePoolWithTag(Dx,GDITAG_TEXT);
|
||||
ExFreePoolWithTag(Dx, GDITAG_TEXT);
|
||||
}
|
||||
|
||||
Status = MmCopyToCaller(UnsafeSize, &Size, sizeof(SIZE));
|
||||
if (! NT_SUCCESS(Status))
|
||||
Status = MmCopyToCaller(UnsafeSize, &Size, sizeof(SIZE));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -423,7 +423,7 @@ NtGdiGetTextExtent(HDC hdc,
|
|||
LPSIZE psize,
|
||||
UINT flOpts)
|
||||
{
|
||||
return NtGdiGetTextExtentExW(hdc, lpwsz, cwc, 0, NULL, NULL, psize, flOpts);
|
||||
return NtGdiGetTextExtentExW(hdc, lpwsz, cwc, 0, NULL, NULL, psize, flOpts);
|
||||
}
|
||||
|
||||
BOOL
|
||||
|
@ -432,23 +432,23 @@ NtGdiSetTextJustification(HDC hDC,
|
|||
int BreakExtra,
|
||||
int BreakCount)
|
||||
{
|
||||
PDC pDc;
|
||||
PDC_ATTR pdcattr;
|
||||
PDC pDc;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
pDc = DC_LockDc(hDC);
|
||||
if (!pDc)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
pDc = DC_LockDc(hDC);
|
||||
if (!pDc)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pdcattr = pDc->pdcattr;
|
||||
pdcattr = pDc->pdcattr;
|
||||
|
||||
pdcattr->lBreakExtra = BreakExtra;
|
||||
pdcattr->cBreak = BreakCount;
|
||||
pdcattr->lBreakExtra = BreakExtra;
|
||||
pdcattr->cBreak = BreakCount;
|
||||
|
||||
DC_UnlockDc(pDc);
|
||||
return TRUE;
|
||||
DC_UnlockDc(pDc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -462,53 +462,53 @@ NtGdiGetTextFaceW(
|
|||
IN BOOL bAliasName
|
||||
)
|
||||
{
|
||||
PDC Dc;
|
||||
PDC_ATTR pdcattr;
|
||||
HFONT hFont;
|
||||
PTEXTOBJ TextObj;
|
||||
NTSTATUS Status;
|
||||
INT fLen, ret;
|
||||
PDC Dc;
|
||||
PDC_ATTR pdcattr;
|
||||
HFONT hFont;
|
||||
PTEXTOBJ TextObj;
|
||||
NTSTATUS Status;
|
||||
INT fLen, ret;
|
||||
|
||||
/* FIXME: Handle bAliasName */
|
||||
/* FIXME: Handle bAliasName */
|
||||
|
||||
Dc = DC_LockDc(hDC);
|
||||
if (Dc == NULL)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
pdcattr = Dc->pdcattr;
|
||||
hFont = pdcattr->hlfntNew;
|
||||
DC_UnlockDc(Dc);
|
||||
Dc = DC_LockDc(hDC);
|
||||
if (Dc == NULL)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
pdcattr = Dc->pdcattr;
|
||||
hFont = pdcattr->hlfntNew;
|
||||
DC_UnlockDc(Dc);
|
||||
|
||||
TextObj = RealizeFontInit(hFont);
|
||||
ASSERT(TextObj != NULL);
|
||||
fLen = wcslen(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName) + 1;
|
||||
TextObj = RealizeFontInit(hFont);
|
||||
ASSERT(TextObj != NULL);
|
||||
fLen = wcslen(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName) + 1;
|
||||
|
||||
if (FaceName != NULL)
|
||||
{
|
||||
Count = min(Count, fLen);
|
||||
Status = MmCopyToCaller(FaceName, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName, Count * sizeof(WCHAR));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
SetLastNtError(Status);
|
||||
return 0;
|
||||
}
|
||||
/* Terminate if we copied only part of the font name */
|
||||
if (Count > 0 && Count < fLen)
|
||||
{
|
||||
FaceName[Count - 1] = '\0';
|
||||
}
|
||||
ret = Count;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = fLen;
|
||||
}
|
||||
if (FaceName != NULL)
|
||||
{
|
||||
Count = min(Count, fLen);
|
||||
Status = MmCopyToCaller(FaceName, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName, Count * sizeof(WCHAR));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
SetLastNtError(Status);
|
||||
return 0;
|
||||
}
|
||||
/* Terminate if we copied only part of the font name */
|
||||
if (Count > 0 && Count < fLen)
|
||||
{
|
||||
FaceName[Count - 1] = '\0';
|
||||
}
|
||||
ret = Count;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = fLen;
|
||||
}
|
||||
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
return ret;
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
return ret;
|
||||
}
|
||||
|
||||
W32KAPI
|
||||
|
@ -520,33 +520,33 @@ NtGdiGetTextMetricsW(
|
|||
IN ULONG cj
|
||||
)
|
||||
{
|
||||
TMW_INTERNAL Tmwi;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
TMW_INTERNAL Tmwi;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
if ( cj <= sizeof(TMW_INTERNAL) )
|
||||
{
|
||||
if (ftGdiGetTextMetricsW(hDC,&Tmwi))
|
||||
{
|
||||
_SEH2_TRY
|
||||
if ( cj <= sizeof(TMW_INTERNAL) )
|
||||
{
|
||||
if (ftGdiGetTextMetricsW(hDC, &Tmwi))
|
||||
{
|
||||
ProbeForWrite(pUnsafeTmwi, cj, 1);
|
||||
RtlCopyMemory(pUnsafeTmwi,&Tmwi,cj);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = _SEH2_GetExceptionCode();
|
||||
}
|
||||
_SEH2_END
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite(pUnsafeTmwi, cj, 1);
|
||||
RtlCopyMemory(pUnsafeTmwi, &Tmwi, cj);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = _SEH2_GetExceptionCode();
|
||||
}
|
||||
_SEH2_END
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue