*
* $Id$
*/
+
#include <w32k.h>
+#define NDEBUG
+#include <debug.h>
+
static const USHORT HatchBrushes[NB_HATCH_STYLES][8] =
{
{0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00}, /* HS_HORIZONTAL */
return 0;
}
- hPattern = NtGdiCreateBitmap(8, 8, 1, 1, HatchBrushes[Style]);
+ hPattern = NtGdiCreateBitmap(8, 8, 1, 1, (LPBYTE)HatchBrushes[Style]);
if (hPattern == NULL)
{
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
DestRect.bottom = YLeft + dc->w.DCOrgY + 1;
}
+ IntLPtoDP(dc, (LPPOINT)&DestRect, 2);
+
BrushOrigin.x = BrushObj->ptOrigin.x + dc->w.DCOrgX;
BrushOrigin.y = BrushObj->ptOrigin.y + dc->w.DCOrgY;
IntGdiInitBrushInstance(&BrushInst, BrushObj, dc->XlateBrush);
ret = IntEngBitBlt(
- BitmapObj,
+ &BitmapObj->SurfObj,
NULL,
NULL,
dc->CombinedClip,
HBRUSH STDCALL
NtGdiCreateDIBBrush(
- CONST BITMAPINFO *BitmapInfoAndData,
- UINT ColorSpec,
- UINT BitmapInfoSize,
- CONST VOID *PackedDIB)
+ IN PVOID BitmapInfoAndData,
+ IN FLONG ColorSpec,
+ IN UINT BitmapInfoSize,
+ IN BOOL b8X8,
+ IN BOOL bPen,
+ IN PVOID PackedDIB)
{
BITMAPINFO *SafeBitmapInfoAndData;
- NTSTATUS Status;
+ NTSTATUS Status = STATUS_SUCCESS;
HBRUSH hBrush;
SafeBitmapInfoAndData = EngAllocMem(0, BitmapInfoSize, 0);
return NULL;
}
- Status = MmCopyFromCaller(SafeBitmapInfoAndData, BitmapInfoAndData,
- BitmapInfoSize);
+ _SEH_TRY
+ {
+ ProbeForRead(BitmapInfoAndData,
+ BitmapInfoSize,
+ 1);
+ RtlCopyMemory(SafeBitmapInfoAndData,
+ BitmapInfoAndData,
+ BitmapInfoSize);
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+
if (!NT_SUCCESS(Status))
{
+ EngFreeMem(SafeBitmapInfoAndData);
SetLastNtError(Status);
return 0;
}
}
HBRUSH STDCALL
-NtGdiCreateHatchBrush(
- INT Style,
- COLORREF Color)
+NtGdiCreateHatchBrushInternal(
+ ULONG Style,
+ COLORREF Color,
+ BOOL bPen)
{
return IntGdiCreateHatchBrush(Style, Color);
}
HBRUSH STDCALL
-NtGdiCreatePatternBrush(
- HBITMAP hBitmap)
+NtGdiCreatePatternBrushInternal(
+ HBITMAP hBitmap,
+ BOOL bPen,
+ BOOL b8x8)
{
return IntGdiCreatePatternBrush(hBitmap);
}
HBRUSH STDCALL
-NtGdiCreateSolidBrush(COLORREF Color)
+NtGdiCreateSolidBrush(COLORREF Color,
+ IN OPTIONAL HBRUSH hbr)
{
return IntGdiCreateSolidBrush(Color);
}
if (Point != NULL)
{
- NTSTATUS Status;
+ NTSTATUS Status = STATUS_SUCCESS;
POINT SafePoint;
SafePoint.x = dc->w.brushOrgX;
SafePoint.y = dc->w.brushOrgY;
- Status = MmCopyToCaller(Point, &SafePoint, sizeof(POINT));
+ _SEH_TRY
+ {
+ ProbeForWrite(Point,
+ sizeof(POINT),
+ 1);
+ *Point = SafePoint;
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+
if(!NT_SUCCESS(Status))
{
DC_UnlockDc(dc);
NtGdiPolyPatBlt(
HDC hDC,
DWORD dwRop,
- PPATRECT pRects,
- INT cRects,
- ULONG Reserved)
+ IN PPOLYPATBLT pRects,
+ IN DWORD cRects,
+ IN DWORD Mode)
{
PPATRECT rb = NULL;
- NTSTATUS Status;
+ NTSTATUS Status = STATUS_SUCCESS;
BOOL Ret;
if (cRects > 0)
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
- Status = MmCopyFromCaller(rb, pRects, sizeof(PATRECT) * cRects);
+ _SEH_TRY
+ {
+ ProbeForRead(pRects,
+ cRects * sizeof(PATRECT),
+ 1);
+ RtlCopyMemory(rb,
+ pRects,
+ cRects * sizeof(PATRECT));
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+
if (!NT_SUCCESS(Status))
{
ExFreePool(rb);
}
}
- Ret = IntGdiPolyPatBlt(hDC, dwRop, pRects, cRects, Reserved);
+ Ret = IntGdiPolyPatBlt(hDC, dwRop, (PPATRECT)pRects, cRects, Mode);
if (cRects > 0)
ExFreePool(rb);