94 DPRINT1(
"EngFreeSectionMem failed for %p!\n", pvBits);
126 ULONG cBitsPixel, cjBits, cjObject;
146 if (pvBits && cjWidth)
163 DPRINT1(
"Overflow calculating size: cjWidth %lu, cy %lu\n",
169 if ((pvBits !=
NULL) && (cjBufSize != 0))
172 if (cjBufSize < cjBits)
174 DPRINT1(
"Buffer is too small, required: %lu, got %lu\n",
192 cjObject =
sizeof(
SURFACE) + cjBits;
201 if (cjObject <
sizeof(
SURFACE))
204 DPRINT1(
"Overflow calculating cjObject: cjBits %lu\n", cjBits);
218 pso->sizlBitmap.cx =
cx;
219 pso->sizlBitmap.cy =
cy;
224 pso->cjBits = cjBits;
233 pso->pvBits = pvBits;
238 pso->pvBits = EngAllocUserMem(cjBits, 0);
250 pso->pvBits = EngAllocSectionMem(&pvSection,
268 pso->pvBits = psurf + 1;
281 pso->pvScan0 =
pso->pvBits;
282 pso->lDelta = cjWidth;
327 DPRINT1(
"SURFACE_AllocSurface failed. (STYPE_BITMAP, sizl.cx=%ld, sizl.cy=%ld, iFormat=%lu, fl=%lu, lWidth=%ld, pvBits=0x%p)\n",
370 DPRINT1(
"SURFACE_AllocSurface failed. (STYPE_DEVBITMAP, sizl.cx=%ld, sizl.cy=%ld, iFormat=%lu)\n",
410 DPRINT1(
"SURFACE_AllocSurface failed. (STYPE_DEVICE, sizl.cx=%ld, sizl.cy=%ld, iFormat=%lu)\n",
456 psurf->
flags &= ~HOOK_FLAGS;
490 DPRINT1(
"Failed to reference surface %p\n", hsurf);
503 psurf->
flags &= ~HOOK_FLAGS;
515 pso->fjBitmap &= ~BMF_NOTSYSMEM;
519 psurf->
flags &= ~SHAREACCESS_SURFACE;
522 if ((pvScan0 !=
NULL) && (lDelta != 0))
525 pso->pvScan0 = pvScan0;
526 pso->lDelta = lDelta;
535 pso->cjBits = lDelta *
pso->sizlBitmap.cy;
536 pso->pvBits =
pso->pvScan0;
542 pso->cjBits = (-lDelta) *
pso->sizlBitmap.cy;
544 pso->fjBitmap &= ~BMF_TOPDOWN;
575 DPRINT1(
"Could not reference surface %p to delete\n", hsurf);
#define InterlockedIncrement
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
#define GDI_OBJECT_TYPE_BITMAP
static LPCSTR DWORD void * pvReserved
#define _Post_ptr_invalid_
#define GDI_OBJ_HMGR_PUBLIC
_Out_opt_ int _Out_opt_ int * cy
struct _PALETTE *const ppal
#define WIDTH_BYTES_ALIGN32(cx, bpp)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
VOID NTAPI EngUnmapSectionView(_In_ PVOID pvBits, _In_ ULONG cjOffset, _In_ HANDLE hSecure)
BOOL APIENTRY EngFreeSectionMem(_In_opt_ PVOID pvSection, _In_opt_ PVOID pvMappedBase)
BOOL APIENTRY FillSolid(SURFOBJ *pso, PRECTL pRect, ULONG iColor)
VOID APIENTRY EngUnlockSurface(_In_ _Post_ptr_invalid_ SURFOBJ *pso)
UCHAR gajBitsPerFormat[11]
BOOL APIENTRY EngEraseSurface(_In_ SURFOBJ *pso, _In_ RECTL *prcl, _In_ ULONG iColor)
SURFOBJ *APIENTRY NtGdiEngLockSurface(IN HSURF hsurf)
ULONG FASTCALL BitmapFormat(ULONG cBits, ULONG iCompression)
HBITMAP APIENTRY EngCreateDeviceBitmap(_In_ DHSURF dhsurf, _In_ SIZEL sizl, _In_ ULONG iFormat)
PSURFACE NTAPI SURFACE_AllocSurface(_In_ USHORT iType, _In_ ULONG cx, _In_ ULONG cy, _In_ ULONG iFormat, _In_ ULONG fjBitmap, _In_opt_ ULONG cjWidth, _In_opt_ ULONG cjBufSize, _In_opt_ PVOID pvBits)
HSURF APIENTRY EngCreateDeviceSurface(_In_ DHSURF dhsurf, _In_ SIZEL sizl, _In_ ULONG iFormat)
__kernel_entry NTSTATUS APIENTRY NtGdiEngUnlockSurface(_In_ SURFOBJ *pso)
BOOL APIENTRY EngModifySurface(_In_ HSURF hsurf, _In_ HDEV hdev, _In_ FLONG flHooks, _In_ FLONG flSurface, _In_ DHSURF dhsurf, _In_ PVOID pvScan0, _In_ LONG lDelta, _Reserved_ PVOID pvReserved)
VOID NTAPI SURFACE_vCleanup(PVOID ObjectBody)
SURFOBJ *APIENTRY EngLockSurface(_In_ HSURF hsurf)
#define SURFACE_ShareUnlockSurface(pBMObj)
FORCEINLINE VOID SURFACE_vSetPalette(_Inout_ PSURFACE psurf, _In_ PPALETTE ppal)
struct _SURFACE * PSURFACE
#define SURFACE_ShareLockSurface(hBMObj)
#define SURFACE_UnlockSurface(pBMObj)
VOID NTAPI GDIOBJ_vSetObjectOwner(POBJ pobj, ULONG ulNewOwner)
POBJ NTAPI GDIOBJ_AllocObjWithHandle(ULONG ObjectType, ULONG cjSize)
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
PPALETTE appalSurfaceDefault[11]
#define PALETTE_ShareLockPalette(hpal)
#define PALETTE_ShareUnlockPalette(ppal)
ENGAPI BOOL APIENTRY EngDeleteSurface(_In_ _Post_ptr_invalid_ HSURF hsurf)
_In_ HANDLE _In_ SURFOBJ * pso
ENGAPI HBITMAP APIENTRY EngCreateBitmap(_In_ SIZEL sizl, _In_ LONG lWidth, _In_ ULONG iFormat, _In_ FLONG fl, _In_opt_ PVOID pvBits)
#define MS_NOTSYSTEMMEMORY
ENGAPI VOID APIENTRY EngFreeUserMem(_Pre_notnull_ __drv_freesMem(UserMem) PVOID pv)
ENGAPI BOOL APIENTRY EngAssociateSurface(_In_ HSURF hsurf, _In_ HDEV hdev, _In_ FLONG flHooks)
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
_In_ ULONG _In_ CLIPOBJ _In_ RECTL * prcl
_In_ SIZEL _In_ ULONG iFormat