Author: khornicek
Date: Wed Dec 2 13:55:44 2009
New Revision: 44360
URL:
http://svn.reactos.org/svn/reactos?rev=44360&view=rev
Log:
- add EngCreateDeviceSurface, one step closer to working VBox video driver
Modified:
branches/arwinss/reactos/subsystems/win32/win32k/eng/engsurf.c
Modified: branches/arwinss/reactos/subsystems/win32/win32k/eng/engsurf.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/eng/engsurf.c [iso-8859-1]
(original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/eng/engsurf.c [iso-8859-1] Wed Dec 2
13:55:44 2009
@@ -232,8 +232,47 @@
IN SIZEL Size,
IN ULONG Format)
{
- UNIMPLEMENTED;
- return NULL;
+ HSURF hSurf;
+ SURFOBJ *pso;
+ PSURFACE pSurf;
+
+ pSurf = (PSURFACE)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BITMAP);
+
+ if (!pSurf)
+ {
+ return 0;
+ }
+
+ hSurf = pSurf->BaseObject.hHmgr;
+ GDIOBJ_SetOwnership(hSurf, NULL);
+
+ pSurf->pBitsLock = ExAllocatePoolWithTag(NonPagedPool,
+ sizeof(FAST_MUTEX),
+ TAG_SURFOBJ);
+
+ if (!pSurf->pBitsLock)
+ {
+ SURFACE_Unlock(pSurf);
+ GDIOBJ_FreeObjByHandle(hSurf, GDI_OBJECT_TYPE_BITMAP);
+ return 0;
+ }
+
+ ExInitializeFastMutex(pSurf->pBitsLock);
+
+ pso = &pSurf->SurfObj;
+ pso->dhsurf = dhSurf;
+ pso->hsurf = hSurf;
+ pso->sizlBitmap = Size;
+ pso->iBitmapFormat = Format;
+ pso->lDelta = DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(Format));
+ pso->iType = STYPE_DEVICE;
+ pso->iUniq = 0;
+
+ pSurf->flHooks = 0;
+
+ SURFACE_Unlock(pSurf);
+
+ return hSurf;
}
BOOL