- Patch by Stefan Ginsberg (stefan__100__ AT hotmail DOT com): Removed NtGdiStretchDIBits and NtGdiAddFontResource. Replaced with correct API.

svn path=/trunk/; revision=32391
This commit is contained in:
James Tabor 2008-02-16 18:14:36 +00:00
parent 8776390d01
commit d04bc15143
7 changed files with 39 additions and 113 deletions

View file

@ -42,8 +42,8 @@ StretchDIBits(HDC hdc,
{ {
/* FIXME share memory */ /* FIXME share memory */
return NtGdiStretchDIBits(hdc, XDest, YDest, nDestWidth, nDestHeight, XSrc, YSrc, return NtGdiStretchDIBitsInternal(hdc, XDest, YDest, nDestWidth, nDestHeight, XSrc, YSrc,
nSrcWidth, nSrcHeight, lpBits, lpBitsInfo, iUsage, dwRop); nSrcWidth, nSrcHeight, (LPBYTE)lpBits, (LPBITMAPINFO)lpBitsInfo, (DWORD)iUsage, dwRop, 0, 0, NULL);
} }
/* /*

View file

@ -215,19 +215,14 @@ EudcUnloadLinkW(LPCWSTR pBaseFaceName,LPCWSTR pEudcFontPath)
*/ */
int int
STDCALL STDCALL
GdiAddFontResourceW(LPCWSTR lpszFilename,FLONG fl,DESIGNVECTOR *pdv) GdiAddFontResourceW(
LPCWSTR lpszFilename,
FLONG fl,
DESIGNVECTOR *pdv)
{ {
UNICODE_STRING Filename; return NtGdiAddFontResourceW((PWSTR)lpszFilename, 0, 0, fl, 0, pdv);
//UNIMPLEMENTED;
//SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
//return 0;
/* FIXME handle fl parameter */
RtlInitUnicodeString(&Filename, lpszFilename);
return NtGdiAddFontResource ( &Filename, fl );
} }
/* /*
* @implemented * @implemented
*/ */

View file

@ -59,14 +59,6 @@ NtGdiGetFontFamilyInfo(
DWORD Size DWORD Size
); );
/* Use NtGdiAddFontResourceW */
int
STDCALL
NtGdiAddFontResource(PUNICODE_STRING Filename,
DWORD fl);
/* Use NtGdiCreateDIBitmapInternal */ /* Use NtGdiCreateDIBitmapInternal */
HBITMAP HBITMAP
STDCALL STDCALL
@ -170,25 +162,6 @@ NtGdiSetWindowOrgEx (
LPPOINT Point LPPOINT Point
); );
/* Use NtGdiStretchDIBitsInternal. */
INT
STDCALL
NtGdiStretchDIBits (
HDC hDC,
INT XDest,
INT YDest,
INT DestWidth,
INT DestHeight,
INT XSrc,
INT YSrc,
INT SrcWidth,
INT SrcHeight,
CONST VOID * Bits,
CONST BITMAPINFO * BitsInfo,
UINT Usage,
DWORD ROP
);
#endif /* WIN32K_NTGDI_BAD_INCLUDED */ #endif /* WIN32K_NTGDI_BAD_INCLUDED */

View file

@ -722,19 +722,25 @@ cleanup:
return Result; return Result;
} }
INT STDCALL NtGdiStretchDIBits(HDC hDC, INT
INT XDest, APIENTRY
INT YDest, NtGdiStretchDIBitsInternal(
INT DestWidth, HDC hDC,
INT DestHeight, INT XDest,
INT XSrc, INT YDest,
INT YSrc, INT DestWidth,
INT SrcWidth, INT DestHeight,
INT SrcHeight, INT XSrc,
CONST VOID *Bits, INT YSrc,
CONST BITMAPINFO *BitsInfo, INT SrcWidth,
UINT Usage, INT SrcHeight,
DWORD ROP) LPBYTE Bits,
LPBITMAPINFO BitsInfo,
DWORD Usage,
DWORD ROP,
UINT cjMaxInfo,
UINT cjMaxBits,
HANDLE hcmXform)
{ {
HBITMAP hBitmap, hOldBitmap; HBITMAP hBitmap, hOldBitmap;
HDC hdcMem; HDC hdcMem;
@ -771,7 +777,7 @@ INT STDCALL NtGdiStretchDIBits(HDC hDC,
} }
NtGdiSetDIBits(hdcMem, hBitmap, 0, BitsInfo->bmiHeader.biHeight, Bits, NtGdiSetDIBits(hdcMem, hBitmap, 0, BitsInfo->bmiHeader.biHeight, Bits,
BitsInfo, Usage); BitsInfo, (UINT)Usage);
/* Origin for DIBitmap may be bottom left (positive biHeight) or top /* Origin for DIBitmap may be bottom left (positive biHeight) or top
left (negative biHeight) */ left (negative biHeight) */

View file

@ -436,22 +436,23 @@ IntGetFontRenderMode(LOGFONTW *logfont)
return FT_RENDER_MODE_NORMAL; return FT_RENDER_MODE_NORMAL;
} }
int INT
STDCALL APIENTRY
NtGdiAddFontResource(PUNICODE_STRING Filename, DWORD fl) NtGdiAddFontResourceW(
IN WCHAR *pwszFiles,
IN ULONG cwc,
IN ULONG cFiles,
IN FLONG fl,
IN DWORD dwPidTid,
IN OPTIONAL DESIGNVECTOR *pdv)
{ {
UNICODE_STRING SafeFileName; UNICODE_STRING SafeFileName;
PWSTR src; PWSTR src;
NTSTATUS Status; NTSTATUS Status;
int Ret; int Ret;
/* Copy the UNICODE_STRING structure */ /* FIXME - Protect with SEH? */
Status = MmCopyFromCaller(&SafeFileName, Filename, sizeof(UNICODE_STRING)); RtlInitUnicodeString(&SafeFileName, pwszFiles);
if(!NT_SUCCESS(Status))
{
SetLastNtError(Status);
return 0;
}
/* Reserve for prepending '\??\' */ /* Reserve for prepending '\??\' */
SafeFileName.Length += 4 * sizeof(WCHAR); SafeFileName.Length += 4 * sizeof(WCHAR);
@ -476,7 +477,7 @@ NtGdiAddFontResource(PUNICODE_STRING Filename, DWORD fl)
return 0; return 0;
} }
Ret = IntGdiAddFontResource(&SafeFileName, fl); Ret = IntGdiAddFontResource(&SafeFileName, (DWORD)fl);
ExFreePool(SafeFileName.Buffer); ExFreePool(SafeFileName.Buffer);
return Ret; return Ret;

View file

@ -1558,26 +1558,6 @@ NtGdiFONTOBJ_cGetGlyphs(IN FONTOBJ *FontObj,
return 0; return 0;
} }
/*
* @unimplemented
*/
INT
APIENTRY
NtGdiAddFontResourceW(
IN WCHAR *pwszFiles,
IN ULONG cwc,
IN ULONG cFiles,
IN FLONG f,
IN DWORD dwPidTid,
IN OPTIONAL DESIGNVECTOR *pdv)
{
UNIMPLEMENTED;
return 0;
}
/* /*
* @unimplemented * @unimplemented
*/ */
@ -2981,33 +2961,6 @@ NtGdiSetMagicColors(
return FALSE; return FALSE;
} }
/*
* @unimplemented
*/
INT
APIENTRY
NtGdiStretchDIBitsInternal(
IN HDC hdc,
IN INT xDst,
IN INT yDst,
IN INT cxDst,
IN INT cyDst,
IN INT xSrc,
IN INT ySrc,
IN INT cxSrc,
IN INT cySrc,
IN OPTIONAL LPBYTE pjInit,
IN LPBITMAPINFO pbmi,
IN DWORD dwUsage,
IN DWORD dwRop4,
IN UINT cjMaxInfo,
IN UINT cjMaxBits,
IN HANDLE hcmXform)
{
UNIMPLEMENTED;
return 0;
}
/* /*
* @unimplemented * @unimplemented
*/ */

View file

@ -679,7 +679,6 @@ NtGdiSetViewportExtEx 4
NtGdiSetViewportOrgEx 4 NtGdiSetViewportOrgEx 4
NtGdiSetWindowExtEx 4 NtGdiSetWindowExtEx 4
NtGdiSetWindowOrgEx 4 NtGdiSetWindowOrgEx 4
NtGdiStretchDIBits 13
NtUserAcquireOrReleaseInputOwnership 1 NtUserAcquireOrReleaseInputOwnership 1
NtUserBuildMenuItemList 4 NtUserBuildMenuItemList 4
NtUserCreateCursorIconHandle 2 NtUserCreateCursorIconHandle 2
@ -719,7 +718,6 @@ NtUserSendMessageCallback 6
NtUserSendMessageTimeout 8 NtUserSendMessageTimeout 8
NtUserSendNotifyMessage 4 NtUserSendNotifyMessage 4
NtUserSetScrollBarInfo 3 NtUserSetScrollBarInfo 3
NtGdiAddFontResource 2
NtGdiCreateDIBitmap 6 NtGdiCreateDIBitmap 6
NtGdiGetAspectRatioFilterEx 2 NtGdiGetAspectRatioFilterEx 2
NtGdiGetFontFamilyInfo 4 NtGdiGetFontFamilyInfo 4