mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 19:21:38 +00:00
- Pass more bitmap cross tests, 16 bit is down to 52. I have more fixes that relate to that number, need more time to work on it. Fixed SEH abuse in CreateBitmap.
svn path=/trunk/; revision=37522
This commit is contained in:
parent
cc2c98c93f
commit
de77947079
4 changed files with 23 additions and 15 deletions
|
@ -362,6 +362,7 @@ IntCreateBitmap(IN SIZEL Size,
|
|||
{
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
BITMAPOBJ_FreeBitmapByHandle(NewBitmap);
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -185,12 +185,12 @@ typedef struct _GDIDEVICE
|
|||
|
||||
PVOID pvGammaRamp; // Gamma ramp pointer.
|
||||
|
||||
DHPDEV hPDev; // DHPDEV for device.
|
||||
|
||||
HSURF FillPatterns[HS_DDI_MAX];
|
||||
|
||||
ULONG DxDd_nCount;
|
||||
|
||||
DHPDEV hPDev; // DHPDEV for device.
|
||||
PVOID ppalSurf; // PEPALOBJ/PPALGDI for this device.
|
||||
DEVINFO DevInfo;
|
||||
GDIINFO GDIInfo;
|
||||
HSURF pSurface; // SURFACE for this device.
|
||||
|
|
|
@ -37,5 +37,7 @@ SHORT FASTCALL IntGdiGetLanguageID();
|
|||
ULONG FASTCALL IntSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
|
||||
DWORD STDCALL IntGetQueueStatus(BOOL ClearChanges);
|
||||
VOID FASTCALL IntUserManualGuiCheck(LONG Check);
|
||||
PVOID NTAPI HackSecureVirtualMemory(IN PVOID,IN SIZE_T,IN ULONG,OUT PVOID *);
|
||||
VOID NTAPI HackUnsecureVirtualMemory(IN PVOID);
|
||||
|
||||
#endif /* __WIN32K_MISC_H */
|
||||
|
|
|
@ -110,26 +110,25 @@ NtGdiCreateBitmap(
|
|||
UINT BitsPixel,
|
||||
IN OPTIONAL LPBYTE pUnsafeBits)
|
||||
{
|
||||
HBITMAP hBitmap;
|
||||
|
||||
_SEH_TRY
|
||||
if (pUnsafeBits)
|
||||
{
|
||||
if (pUnsafeBits)
|
||||
BOOL Hit = FALSE;
|
||||
UINT cjBits = BITMAPOBJ_GetWidthBytes(Width, BitsPixel) * abs(Height);
|
||||
|
||||
_SEH_TRY
|
||||
{
|
||||
UINT cjBits = BITMAPOBJ_GetWidthBytes(Width, BitsPixel) * abs(Height);
|
||||
ProbeForRead(pUnsafeBits, cjBits, 1);
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
Hit = TRUE;
|
||||
}
|
||||
_SEH_END
|
||||
|
||||
hBitmap = IntGdiCreateBitmap(Width, Height, Planes, BitsPixel, pUnsafeBits);
|
||||
|
||||
if (Hit) return 0;
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
hBitmap = 0;
|
||||
}
|
||||
_SEH_END
|
||||
|
||||
return hBitmap;
|
||||
return IntGdiCreateBitmap(Width, Height, Planes, BitsPixel, pUnsafeBits);
|
||||
}
|
||||
|
||||
BOOL INTERNAL_CALL
|
||||
|
@ -196,6 +195,12 @@ NtGdiCreateCompatibleBitmap(
|
|||
HBITMAP Bmp;
|
||||
PDC Dc;
|
||||
|
||||
if ( Width <= 0 || Height <= 0 || (Width * Height) > 0x3FFFFFFF )
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Dc = DC_LockDc(hDC);
|
||||
|
||||
DPRINT("NtGdiCreateCompatibleBitmap(%04x,%d,%d, bpp:%d) = \n", hDC, Width, Height, Dc->w.bitsPerPixel);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue