mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 09:50:02 +00:00
Patch by Stefan100 stefan__100__ at hotmail.com. Remove NtGdiGetTextExtentPoint32, update all related.
svn path=/trunk/; revision=31846
This commit is contained in:
parent
6274286a77
commit
3f063e5fa2
4 changed files with 1 additions and 95 deletions
|
@ -271,7 +271,7 @@ GetTextExtentPoint32W(
|
|||
LPSIZE lpSize
|
||||
)
|
||||
{
|
||||
return NtGdiGetTextExtentPoint32(hdc, lpString, cbString, lpSize);
|
||||
return NtGdiGetTextExtent(hdc, (LPWSTR)lpString, cbString, lpSize, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -59,15 +59,6 @@ NtGdiGetFontFamilyInfo(
|
|||
DWORD Size
|
||||
);
|
||||
|
||||
/* The gdi32 call Should Use NtGdiGetTextExtent */
|
||||
BOOL
|
||||
NTAPI
|
||||
NtGdiGetTextExtentPoint32(
|
||||
HDC hDC,
|
||||
LPCWSTR String,
|
||||
int Count,
|
||||
LPSIZE
|
||||
);
|
||||
|
||||
/* Use NtGdiAddFontResourceW */
|
||||
int
|
||||
|
|
|
@ -3729,90 +3729,6 @@ NtGdiGetTextExtent(HDC hdc,
|
|||
return NtGdiGetTextExtentExW(hdc, lpwsz, cwc, 0, NULL, NULL, psize, 0);
|
||||
}
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
NtGdiGetTextExtentPoint32(HDC hDC,
|
||||
LPCWSTR UnsafeString,
|
||||
int Count,
|
||||
LPSIZE UnsafeSize)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
LPWSTR String;
|
||||
SIZE Size;
|
||||
NTSTATUS Status;
|
||||
BOOLEAN Result;
|
||||
PTEXTOBJ TextObj;
|
||||
|
||||
if (Count < 0)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
String = ExAllocatePool(PagedPool, Count * sizeof(WCHAR));
|
||||
if (NULL == String)
|
||||
{
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Status = MmCopyFromCaller(String, UnsafeString, Count * sizeof(WCHAR));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
ExFreePool(String);
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dc = DC_LockDc(hDC);
|
||||
if (NULL == dc)
|
||||
{
|
||||
ExFreePool(String);
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
TextObj = TEXTOBJ_LockText(Dc_Attr->hlfntNew);
|
||||
if ( TextObj != NULL )
|
||||
{
|
||||
Result = TextIntGetTextExtentPoint (
|
||||
dc, TextObj, String, Count, 0, NULL, NULL, &Size);
|
||||
TEXTOBJ_UnlockText(TextObj);
|
||||
}
|
||||
else
|
||||
Result = FALSE;
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
ExFreePool(String);
|
||||
if (! Result)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Status = MmCopyToCaller(UnsafeSize, &Size, sizeof(SIZE));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
W32KAPI
|
||||
INT
|
||||
APIENTRY
|
||||
|
|
|
@ -719,7 +719,6 @@ NtGdiAddFontResource 2
|
|||
NtGdiCreateDIBitmap 6
|
||||
NtGdiGetAspectRatioFilterEx 2
|
||||
NtGdiGetFontFamilyInfo 4
|
||||
NtGdiGetTextExtentPoint32 4
|
||||
NtGdiOffsetViewportOrgEx 4
|
||||
NtGdiOffsetWindowOrgEx 4
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue