basic NT4 DirectDraw implemet and it is untested
- NtGdiDdGetBltStatus
- NtGdiDdGetFlipStatus
- NtGdiDdSetOverlayPosition
Write some code for NtGdiDdDestroySurface and NtGdiDdCreateSurface, we
got now basic all nt4 api implemet and unstested for directdraw in the
kernel
Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c
Modified: trunk/reactos/subsys/win32k/ntddraw/stubs.c
_____
Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c
--- trunk/reactos/subsys/win32k/ntddraw/ddraw.c 2005-10-07 22:20:50 UTC
(rev 18316)
+++ trunk/reactos/subsys/win32k/ntddraw/ddraw.c 2005-10-07 22:50:26 UTC
(rev 18317)
@@ -236,7 +236,7 @@
)
{
DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED;
- /* DD_CREATESURFACEDATA surf; */
+
PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal,
GDI_OBJECT_TYPE_DIRECTDRAW);
if (pDirectDraw == NULL)
@@ -245,11 +245,8 @@
if (!(pDirectDraw->DD.dwFlags & DDHAL_CB32_CANCREATESURFACE))
ddRVal = DDHAL_DRIVER_NOTHANDLED;
else
- {
- UNIMPLEMENTED;
- /*
- ddRVal = pDirectDraw->DD.CreateSurface(&surf);
- */
+ {
+ ddRVal = pDirectDraw->DD.CreateSurface(puCreateSurfaceData);
}
GDIOBJ_UnlockObjByPtr(pDirectDraw);
@@ -338,9 +335,18 @@
ddRVal = DDHAL_DRIVER_NOTHANDLED;
else
{
- /* DD_DESTROYSURFACEDATA DestroySurf; */
- UNIMPLEMENTED;
- /* ddRVal = pDirectDraw->Surf.DestroySurface(DestroySurf); */
+ DD_DESTROYSURFACEDATA DestroySurf;
+
+ /* FIXME
+ * bRealDestroy
+ * are we doing right ??
+ */
+ DestroySurf.lpDD = &pDirectDraw->Global;
+
+ DestroySurf.lpDDSurface = hSurface; // ?
+ DestroySurf.DestroySurface = pDirectDraw->Surf.DestroySurface;
+
+ ddRVal = pDirectDraw->Surf.DestroySurface(&DestroySurf);
}
GDIOBJ_UnlockObjByPtr(pDirectDraw);
@@ -474,7 +480,46 @@
return ddRVal;
}
+DWORD STDCALL NtGdiDdGetBltStatus(
+ HANDLE hSurface,
+ PDD_GETBLTSTATUSDATA puGetBltStatusData
+)
+{
+ DWORD ddRVal;
+ PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface,
GDI_OBJECT_TYPE_DIRECTDRAW);
+ if (pDirectDraw == NULL)
+ return DDHAL_DRIVER_NOTHANDLED;
+
+ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_GETBLTSTATUS))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ ddRVal = pDirectDraw->Surf.GetBltStatus(puGetBltStatusData);
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
+DWORD STDCALL NtGdiDdGetFlipStatus(
+ HANDLE hSurface,
+ PDD_GETFLIPSTATUSDATA puGetFlipStatusData
+)
+{
+ DWORD ddRVal;
+
+ PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface,
GDI_OBJECT_TYPE_DIRECTDRAW);
+ if (pDirectDraw == NULL)
+ return DDHAL_DRIVER_NOTHANDLED;
+
+ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_GETFLIPSTATUS))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ ddRVal = pDirectDraw->Surf.GetFlipStatus(puGetFlipStatusData);
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
DWORD STDCALL NtGdiDdUpdateOverlay(
HANDLE hSurfaceDestination,
HANDLE hSurfaceSource,
@@ -496,8 +541,28 @@
return ddRVal;
}
+DWORD STDCALL NtGdiDdSetOverlayPosition(
+ HANDLE hSurfaceSource,
+ HANDLE hSurfaceDestination,
+ PDD_SETOVERLAYPOSITIONDATA puSetOverlayPositionData
+)
+{
+ DWORD ddRVal;
+ PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceDestination,
GDI_OBJECT_TYPE_DIRECTDRAW);
+ if (pDirectDraw == NULL)
+ return DDHAL_DRIVER_NOTHANDLED;
+ if (!(pDirectDraw->Surf.dwFlags &
DDHAL_SURFCB32_SETOVERLAYPOSITION))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ ddRVal =
pDirectDraw->Surf.SetOverlayPosition(puSetOverlayPositionData);
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
+
/***********************************************************************
*/
/* SURFACE OBJECT
*/
/***********************************************************************
*/
_____
Modified: trunk/reactos/subsys/win32k/ntddraw/stubs.c
--- trunk/reactos/subsys/win32k/ntddraw/stubs.c 2005-10-07 22:20:50 UTC
(rev 18316)
+++ trunk/reactos/subsys/win32k/ntddraw/stubs.c 2005-10-07 22:50:26 UTC
(rev 18317)
@@ -203,15 +203,7 @@
}
-DWORD STDCALL NtGdiDdGetBltStatus(
- HANDLE hSurface,
- PDD_GETBLTSTATUSDATA puGetBltStatusData
-)
-{
- UNIMPLEMENTED
- return 0;
-}
HDC STDCALL NtGdiDdGetDC(
HANDLE hSurface,
@@ -245,15 +237,7 @@
return 0;
}
-DWORD STDCALL NtGdiDdGetFlipStatus(
- HANDLE hSurface,
- PDD_GETFLIPSTATUSDATA puGetFlipStatusData
-)
-{
- UNIMPLEMENTED
- return 0;
-}
DWORD STDCALL NtGdiDdGetInternalMoCompInfo(
HANDLE hDirectDraw,
@@ -374,16 +358,7 @@
return 0;
}
-DWORD STDCALL NtGdiDdSetOverlayPosition(
- HANDLE hSurfaceSource,
- HANDLE hSurfaceDestination,
- PDD_SETOVERLAYPOSITIONDATA puSetOverlayPositionData
-)
-{
- UNIMPLEMENTED
- return 0;
-}
VOID STDCALL NtGdiDdUnattachSurface(
HANDLE hSurface,