mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 14:51:00 +00:00
- Add usermode checks to GetDIBits
- passes 21 out of 27 tests - Add GdiSetLastError to the lib instead of forwarding it straight to kernel32 svn path=/trunk/; revision=29200
This commit is contained in:
parent
b3c3c9ba5b
commit
c338775265
4 changed files with 47 additions and 14 deletions
|
@ -328,7 +328,7 @@ GdiReleaseLocalDC@4
|
|||
GdiResetDCEMF@8
|
||||
GdiSetAttrs@4
|
||||
GdiSetBatchLimit@4
|
||||
GdiSetLastError@4=SetLastError@4
|
||||
GdiSetLastError@4
|
||||
GdiSetPixelFormat@8=NtGdiSetPixelFormat@8
|
||||
GdiSetServerAttr@8
|
||||
GdiStartDocEMF@8
|
||||
|
|
|
@ -192,5 +192,9 @@ int
|
|||
STDCALL
|
||||
GdiAddFontResourceW(LPCWSTR lpszFilename,FLONG fl,DESIGNVECTOR *pdv);
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
GdiSetLastError( DWORD dwErrCode );
|
||||
|
||||
/* EOF */
|
||||
|
||||
|
|
|
@ -178,3 +178,13 @@ ExtEscape(
|
|||
{
|
||||
return NtGdiExtEscape(hDC, NULL, 0, nEscape, cbInput, (LPSTR)lpszInData, cbOutput, lpszOutData);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
VOID
|
||||
STDCALL
|
||||
GdiSetLastError(DWORD dwErrCode)
|
||||
{
|
||||
SetLastError(dwErrCode);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#include "precomp.h"
|
||||
|
||||
//#define NDEBUG
|
||||
//#include <debug.h>
|
||||
|
||||
/*
|
||||
* Return the full scan size for a bitmap.
|
||||
*
|
||||
|
@ -151,8 +154,6 @@ CreateCompatibleBitmap(
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
INT
|
||||
STDCALL
|
||||
GetDIBits(
|
||||
|
@ -162,16 +163,34 @@ GetDIBits(
|
|||
UINT cScanLines,
|
||||
LPVOID lpvBits,
|
||||
LPBITMAPINFO lpbmi,
|
||||
UINT uUsage
|
||||
)
|
||||
UINT uUsage)
|
||||
{
|
||||
return NtGdiGetDIBitsInternal(hDC,
|
||||
hbmp,
|
||||
uStartScan,
|
||||
cScanLines,
|
||||
lpvBits,
|
||||
lpbmi,
|
||||
uUsage,
|
||||
DIB_BitmapMaxBitsSize( lpbmi, cScanLines ),
|
||||
0);
|
||||
INT ret = 0;
|
||||
|
||||
if (hDC == NULL || !GdiIsHandleValid((HGDIOBJ)hDC))
|
||||
{
|
||||
GdiSetLastError(ERROR_INVALID_PARAMETER);
|
||||
}
|
||||
else if (lpbmi == NULL)
|
||||
{
|
||||
// XP doesn't run this check and results in a
|
||||
// crash in DIB_BitmapMaxBitsSize, we'll be more forgiving
|
||||
GdiSetLastError(ERROR_INVALID_PARAMETER);
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT cjBmpScanSize = DIB_BitmapMaxBitsSize(lpbmi, cScanLines);
|
||||
|
||||
ret = NtGdiGetDIBitsInternal(hDC,
|
||||
hbmp,
|
||||
uStartScan,
|
||||
cScanLines,
|
||||
lpvBits,
|
||||
lpbmi,
|
||||
uUsage,
|
||||
cjBmpScanSize,
|
||||
0);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue