Remove more stub from ntdraw and implement it, (untested) it is alot of
stub that have been implemet. fill DD_CALLBACKS right in
NtGdiDdCreateDirectDrawObject, and fix party the internal struct.
implemet follow but not tested
- NtGdiDdCreateSurface, NtGdiDdDestroySurface
some part it need fill the info right before it call on
DdCreateSurface
- NtGdiDdFlip done
- NtGdiDdGetScanLine done
- NtGdiDdSetColorKey done
- NtGdiDdUnlock done
- NtGdiDdUpdateOverlay done
- NtGdiDdSetExclusiveMode done (need setup the callback)
- NtGdiDdLock done
Modified: trunk/reactos/subsys/win32k/include/intddraw.h
Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c
Modified: trunk/reactos/subsys/win32k/ntddraw/stubs.c
_____
Modified: trunk/reactos/subsys/win32k/include/intddraw.h
--- trunk/reactos/subsys/win32k/include/intddraw.h 2005-10-07
20:15:10 UTC (rev 18312)
+++ trunk/reactos/subsys/win32k/include/intddraw.h 2005-10-07
20:27:52 UTC (rev 18313)
@@ -8,6 +8,7 @@
#define GDI_OBJECT_TYPE_DD_CLIPPER 0x00640000
#define GDI_OBJECT_TYPE_DD_MOTIONCOMP 0x00650000
+
typedef struct
{
DD_SURFACE_LOCAL Local;
@@ -22,38 +23,62 @@
{
DD_DIRECTDRAW_LOCAL Local;
DD_DIRECTDRAW_GLOBAL Global;
- // Drv callbacks
- PGD_GETDIRECTDRAWINFO DrvGetDirectDrawInfo;
- PGD_DISABLEDIRECTDRAW DrvDisableDirectDraw;
+ // Drv callbacks
+ PGD_GETDIRECTDRAWINFO DrvGetDirectDrawInfo;
+ PGD_DISABLEDIRECTDRAW DrvDisableDirectDraw;
+ PDD_GETDRIVERINFO DdGetDriverInfo;
+
// DD callbacks
- PDD_CREATESURFACE DdCreateSurface;
- PDD_SETCOLORKEY DdDrvSetColorKey; // ?????
- PDD_WAITFORVERTICALBLANK DdWaitForVerticalBlank;
- PDD_CANCREATESURFACE DdCanCreateSurface;
- PDD_CREATEPALETTE DdCreatePalette;
- PDD_GETSCANLINE DdGetScanLine;
- PDD_MAPMEMORY DdMapMemory;
+ DD_CALLBACKS DD;
+
// Surface callbacks
- PDD_SURFCB_DESTROYSURFACE DdDestroySurface;
- PDD_SURFCB_FLIP DdFlip;
- PDD_SURFCB_SETCLIPLIST DdSetClipList;
- PDD_SURFCB_LOCK DdLock;
- PDD_SURFCB_UNLOCK DdUnlock;
- PDD_SURFCB_BLT DdBlt;
- PDD_SURFCB_SETCOLORKEY DdSetColorKey;
- PDD_SURFCB_ADDATTACHEDSURFACE DdAddAttachedSurface;
- PDD_SURFCB_GETBLTSTATUS DdGetBltStatus;
- PDD_SURFCB_GETFLIPSTATUS DdGetFlipStatus;
- PDD_SURFCB_UPDATEOVERLAY DdUpdateOverlay;
- PDD_SURFCB_SETOVERLAYPOSITION DdSetOverlayPosition;
- PDD_SURFCB_SETPALETTE DdSetPalette;
- // Miscellaneous Callback Function
- PDD_GETAVAILDRIVERMEMORY DdGetAvailDriverMemory;
- // NT callbacks
- DD_FREEDRIVERMEMORYDATA DdFreeDriverMemory;
+ DD_SURFACECALLBACKS Surf;
+
// Palette callbacks
- PDD_PALCB_DESTROYPALETTE DdDestroyPalette;
- PDD_PALCB_SETENTRIES DdSetEntries;
+ DD_PALETTECALLBACKS Pal;
+
+ // Color Control Callback
+ PDD_COLORCB_COLORCONTROL DdControlColor;
+ // Miscellaneous Callback
+ PDD_GETAVAILDRIVERMEMORY DdGetAvailDriverMemory;
+ // Kernel Callback
+ PDD_KERNELCB_SYNCSURFACE DdSyncSurfaceData;
+ PDD_KERNELCB_SYNCVIDEOPORT DdSyncVideoPortData;
+ // NT-based Callback
+ PDD_FLIPTOGDISURFACE DdFlipToGDISurface;
+ PDD_FREEDRIVERMEMORY DdFreeDriverMemory;
+ PDD_SETEXCLUSIVEMODE DdSetExclusiveMode;
+ // Motion Compensation
+ PDD_MOCOMPCB_BEGINFRAME DdMoCompBeginFrame;
+ PDD_MOCOMPCB_CREATE DdMoCompCreate;
+ PDD_MOCOMPCB_DESTROY DdMoCompDestroy;
+ PDD_MOCOMPCB_ENDFRAME DdMoCompEndFrame;
+ PDD_MOCOMPCB_GETCOMPBUFFINFO DdMoCompGetBuffInfo;
+ PDD_MOCOMPCB_GETFORMATS DdMoCompGetFormats;
+ PDD_MOCOMPCB_GETGUIDS DdMoCompGetGuids;
+ PDD_MOCOMPCB_GETINTERNALINFO DdMoCompGetInternalInfo;
+ PDD_MOCOMPCB_QUERYSTATUS DdMoCompQueryStatus;
+ PDD_MOCOMPCB_RENDER DdMoCompRender;
+ // Video Port Callback
+ PDD_VPORTCB_CANCREATEVIDEOPORT DdVideoPortCanCreate;
+ PDD_VPORTCB_COLORCONTROL DdVideoPortColorControl;
+ PDD_VPORTCB_CREATEVIDEOPORT DdVideoPortCreate;
+ PDD_VPORTCB_DESTROYVPORT DdVideoPortDestroy;
+ PDD_VPORTCB_FLIP DdVideoPortFlip;
+ PDD_VPORTCB_GETBANDWIDTH DdVideoPortGetBandwidth;
+ PDD_VPORTCB_GETVPORTCONNECT DdVideoPortGetConnectInfo;
+ PDD_VPORTCB_GETFIELD DdVideoPortGetField;
+ PDD_VPORTCB_GETFLIPSTATUS DdVideoPortGetFlipStatus;
+ PDD_VPORTCB_GETINPUTFORMATS DdVideoPortGetInputFormats;
+ PDD_VPORTCB_GETLINE DdVideoPortGetLine;
+ PDD_VPORTCB_GETOUTPUTFORMATS DdVideoPortGetOutputFormats;
+ PDD_VPORTCB_GETSIGNALSTATUS DdVideoPortGetSignalStatus;
+ PDD_VPORTCB_UPDATE DdVideoPortUpdate;
+ PDD_VPORTCB_WAITFORSYNC DdVideoPortWaitForSync;
+ // Notify Callback
+ //LPDD_NOTIFYCALLBACK NotifyCallback
+
+
// D3D Device context callbacks
PD3DNTHAL_CONTEXTCREATECB D3dContextCreate;
PD3DNTHAL_CONTEXTDESTROYCB D3dContextDestroy;
@@ -63,6 +88,9 @@
PDD_SURFCB_DESTROYSURFACE DdDestroyD3DBuffer;
PDD_SURFCB_LOCK DdLockD3DBuffer;
PDD_SURFCB_UNLOCK DdUnlockD3DBuffer;
+
+
+
} DD_DIRECTDRAW, *PDD_DIRECTDRAW;
BOOL INTERNAL_CALL DD_Cleanup(PVOID pDD);
_____
Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c
--- trunk/reactos/subsys/win32k/ntddraw/ddraw.c 2005-10-07 20:15:10 UTC
(rev 18312)
+++ trunk/reactos/subsys/win32k/ntddraw/ddraw.c 2005-10-07 20:27:52 UTC
(rev 18313)
@@ -83,53 +83,67 @@
pDirectDraw->DrvGetDirectDrawInfo =
pDC->DriverFunctions.GetDirectDrawInfo;
pDirectDraw->DrvDisableDirectDraw =
pDC->DriverFunctions.DisableDirectDraw;
-
+
+ /* DD_CALLBACKS setup */
+ pDirectDraw->DD.dwFlags = callbacks.dwFlags;
+
+ /* DestroyDriver Unsuse in win2k or higher
*/
+ if (callbacks.dwFlags & DDHAL_CB32_DESTROYDRIVER)
+ pDirectDraw->DD.DestroyDriver = callbacks.DestroyDriver;
if (callbacks.dwFlags & DDHAL_CB32_CREATESURFACE)
- pDirectDraw->DdCreateSurface = callbacks.CreateSurface;
+ pDirectDraw->DD.CreateSurface = callbacks.CreateSurface;
if (callbacks.dwFlags & DDHAL_CB32_SETCOLORKEY)
- pDirectDraw->DdDrvSetColorKey = callbacks.SetColorKey;
+ pDirectDraw->DD.SetColorKey = callbacks.SetColorKey;
+ if (callbacks.dwFlags & DDHAL_CB32_SETMODE)
+ pDirectDraw->DD.SetMode = callbacks.SetMode;
if (callbacks.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)
- pDirectDraw->DdWaitForVerticalBlank =
callbacks.WaitForVerticalBlank;
+ pDirectDraw->DD.WaitForVerticalBlank =
callbacks.WaitForVerticalBlank;
if (callbacks.dwFlags & DDHAL_CB32_CANCREATESURFACE)
- pDirectDraw->DdCanCreateSurface =
callbacks.CanCreateSurface;
+ pDirectDraw->DD.CanCreateSurface =
callbacks.CanCreateSurface;
if (callbacks.dwFlags & DDHAL_CB32_CREATEPALETTE)
- pDirectDraw->DdCreatePalette = callbacks.CreatePalette;
+ pDirectDraw->DD.CreatePalette = callbacks.CreatePalette;
if (callbacks.dwFlags & DDHAL_CB32_GETSCANLINE)
- pDirectDraw->DdGetScanLine = callbacks.GetScanLine;
+ pDirectDraw->DD.GetScanLine = callbacks.GetScanLine;
if (callbacks.dwFlags & DDHAL_CB32_MAPMEMORY)
- pDirectDraw->DdMapMemory = callbacks.MapMemory;
+ pDirectDraw->DD.MapMemory = callbacks.MapMemory;
+ /* Surface Callbacks */
+ pDirectDraw->Surf.dwFlags = surface_callbacks.dwFlags;
+
if (surface_callbacks.dwFlags & DDHAL_SURFCB32_DESTROYSURFACE)
- pDirectDraw->DdDestroySurface =
surface_callbacks.DestroySurface;
+ pDirectDraw->Surf.DestroySurface =
surface_callbacks.DestroySurface;
if (surface_callbacks.dwFlags & DDHAL_SURFCB32_FLIP)
- pDirectDraw->DdFlip = surface_callbacks.Flip;
+ pDirectDraw->Surf.Flip = surface_callbacks.Flip;
if (surface_callbacks.dwFlags & DDHAL_SURFCB32_SETCLIPLIST)
- pDirectDraw->DdSetClipList =
surface_callbacks.SetClipList;
+ pDirectDraw->Surf.SetClipList =
surface_callbacks.SetClipList;
if (surface_callbacks.dwFlags & DDHAL_SURFCB32_LOCK)
- pDirectDraw->DdLock = surface_callbacks.Lock;
+ pDirectDraw->Surf.Lock = surface_callbacks.Lock;
if (surface_callbacks.dwFlags & DDHAL_SURFCB32_UNLOCK)
- pDirectDraw->DdUnlock = surface_callbacks.Unlock;
+ pDirectDraw->Surf.Unlock = surface_callbacks.Unlock;
if (surface_callbacks.dwFlags & DDHAL_SURFCB32_BLT)
- pDirectDraw->DdBlt = surface_callbacks.Blt;
+ pDirectDraw->Surf.Blt = surface_callbacks.Blt;
+ /* DD Callbacks SetColorKey is same as Surface callback
SetColorKey */
if (surface_callbacks.dwFlags & DDHAL_SURFCB32_SETCOLORKEY)
- pDirectDraw->DdSetColorKey =
surface_callbacks.SetColorKey;
+ pDirectDraw->Surf.SetColorKey =
surface_callbacks.SetColorKey;
if (surface_callbacks.dwFlags &
DDHAL_SURFCB32_ADDATTACHEDSURFACE)
- pDirectDraw->DdAddAttachedSurface =
surface_callbacks.AddAttachedSurface;
+ pDirectDraw->Surf.AddAttachedSurface =
surface_callbacks.AddAttachedSurface;
if (surface_callbacks.dwFlags & DDHAL_SURFCB32_GETBLTSTATUS)
- pDirectDraw->DdGetBltStatus =
surface_callbacks.GetBltStatus;
+ pDirectDraw->Surf.GetBltStatus =
surface_callbacks.GetBltStatus;
if (surface_callbacks.dwFlags & DDHAL_SURFCB32_GETFLIPSTATUS)
- pDirectDraw->DdGetFlipStatus =
surface_callbacks.GetFlipStatus;
+ pDirectDraw->Surf.GetFlipStatus =
surface_callbacks.GetFlipStatus;
if (surface_callbacks.dwFlags & DDHAL_SURFCB32_UPDATEOVERLAY)
- pDirectDraw->DdUpdateOverlay =
surface_callbacks.UpdateOverlay;
+ pDirectDraw->Surf.UpdateOverlay =
surface_callbacks.UpdateOverlay;
if (surface_callbacks.dwFlags &
DDHAL_SURFCB32_SETOVERLAYPOSITION)
- pDirectDraw->DdSetOverlayPosition =
surface_callbacks.SetOverlayPosition;
+ pDirectDraw->Surf.SetOverlayPosition =
surface_callbacks.SetOverlayPosition;
if (surface_callbacks.dwFlags & DDHAL_SURFCB32_SETPALETTE)
- pDirectDraw->DdSetPalette =
surface_callbacks.SetPalette;
-
+ pDirectDraw->Surf.SetPalette =
surface_callbacks.SetPalette;
+
+ /* Palette Callbacks */
+ pDirectDraw->Pal.dwFlags = palette_callbacks.dwFlags;
if (palette_callbacks.dwFlags & DDHAL_PALCB32_DESTROYPALETTE)
- pDirectDraw->DdDestroyPalette =
palette_callbacks.DestroyPalette;
+ pDirectDraw->Pal.DestroyPalette =
palette_callbacks.DestroyPalette;
if (palette_callbacks.dwFlags & DDHAL_PALCB32_SETENTRIES)
- pDirectDraw->DdSetEntries =
palette_callbacks.SetEntries;
+ pDirectDraw->Pal.SetEntries =
palette_callbacks.SetEntries;
GDIOBJ_UnlockObjByPtr(pDirectDraw);
DC_UnlockDc(pDC);
@@ -204,7 +218,265 @@
return TRUE;
}
+
/***********************************************************************
*/
+/* DD CALLBACKS
*/
+/* FIXME NtGdiDdCreateSurface we do not call to ddCreateSurface
*/
+/**********************************************************************
**/
+
+DWORD STDCALL NtGdiDdCreateSurface(
+ HANDLE hDirectDrawLocal,
+ HANDLE *hSurface,
+ DDSURFACEDESC *puSurfaceDescription,
+ DD_SURFACE_GLOBAL *puSurfaceGlobalData,
+ DD_SURFACE_LOCAL *puSurfaceLocalData,
+ DD_SURFACE_MORE *puSurfaceMoreData,
+ PDD_CREATESURFACEDATA puCreateSurfaceData,
+ HANDLE *puhSurface
+)
+{
+ DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ /* DD_CREATESURFACEDATA surf; */
+
+ PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal,
GDI_OBJECT_TYPE_DIRECTDRAW);
+ if (pDirectDraw == NULL)
+ return DDHAL_DRIVER_NOTHANDLED;
+
+ if (!(pDirectDraw->DD.dwFlags & DDHAL_CB32_CANCREATESURFACE))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ {
+ UNIMPLEMENTED;
+ /*
+ ddRVal = pDirectDraw->DD.CreateSurface(&surf);
+ */
+ }
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
+DWORD STDCALL NtGdiDdWaitForVerticalBlank(
+ HANDLE hDirectDrawLocal,
+ PDD_WAITFORVERTICALBLANKDATA puWaitForVerticalBlankData
+)
+{
+ DWORD ddRVal;
+ PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal,
GDI_OBJECT_TYPE_DIRECTDRAW);
+ if (pDirectDraw == NULL)
+ return DDHAL_DRIVER_NOTHANDLED;
+
+ if (!(pDirectDraw->DD.dwFlags &
DDHAL_CB32_WAITFORVERTICALBLANK))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ ddRVal =
pDirectDraw->DD.WaitForVerticalBlank(puWaitForVerticalBlankData);
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
+DWORD STDCALL NtGdiDdCanCreateSurface(
+ HANDLE hDirectDrawLocal,
+ PDD_CANCREATESURFACEDATA puCanCreateSurfaceData
+)
+{
+ DWORD ddRVal;
+
+ PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal,
GDI_OBJECT_TYPE_DIRECTDRAW);
+ if (pDirectDraw == NULL)
+ return DDHAL_DRIVER_NOTHANDLED;
+
+ if (!(pDirectDraw->DD.dwFlags & DDHAL_CB32_CANCREATESURFACE))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ ddRVal =
pDirectDraw->DD.CanCreateSurface(puCanCreateSurfaceData);
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
+DWORD STDCALL NtGdiDdGetScanLine(
+ HANDLE hDirectDrawLocal,
+ PDD_GETSCANLINEDATA puGetScanLineData
+)
+{
+ DWORD ddRVal;
+
+ PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal,
GDI_OBJECT_TYPE_DIRECTDRAW);
+ if (pDirectDraw == NULL)
+ return DDHAL_DRIVER_NOTHANDLED;
+
+ if (!(pDirectDraw->DD.dwFlags & DDHAL_CB32_GETSCANLINE))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ ddRVal = pDirectDraw->DD.GetScanLine(puGetScanLineData);
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
+
+
+/**********************************************************************
**/
+/* Surface CALLBACKS
*/
+/* FIXME
*/
+/* NtGdiDdDestroySurface
*/
+/**********************************************************************
**/
+
+DWORD STDCALL NtGdiDdDestroySurface(
+ HANDLE hSurface,
+ BOOL bRealDestroy
+)
+{
+ 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_DESTROYSURFACE))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ {
+ /* DD_DESTROYSURFACEDATA DestroySurf; */
+ UNIMPLEMENTED;
+ /* ddRVal = pDirectDraw->Surf.DestroySurface(DestroySurf); */
+ }
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
+DWORD STDCALL NtGdiDdFlip(
+ HANDLE hSurfaceCurrent,
+ HANDLE hSurfaceTarget,
+ HANDLE hSurfaceCurrentLeft,
+ HANDLE hSurfaceTargetLeft,
+ PDD_FLIPDATA puFlipData
+)
+{
+ DWORD ddRVal;
+
+ PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceTarget,
GDI_OBJECT_TYPE_DIRECTDRAW);
+ if (pDirectDraw == NULL)
+ return DDHAL_DRIVER_NOTHANDLED;
+
+ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_FLIP))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ ddRVal = pDirectDraw->Surf.Flip(puFlipData);
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
+DWORD STDCALL NtGdiDdLock(
+ HANDLE hSurface,
+ PDD_LOCKDATA puLockData,
+ HDC hdcClip
+)
+{
+ 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_LOCK))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ ddRVal = pDirectDraw->Surf.Lock(puLockData);
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
+
+DWORD STDCALL NtGdiDdSetColorKey(
+ HANDLE hSurface,
+ PDD_SETCOLORKEYDATA puSetColorKeyData
+)
+{
+ 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_SETCOLORKEY))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ ddRVal = pDirectDraw->Surf.SetColorKey(puSetColorKeyData);
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
+DWORD STDCALL NtGdiDdBlt(
+ HANDLE hSurfaceDest,
+ HANDLE hSurfaceSrc,
+ PDD_BLTDATA puBltData
+)
+{
+ DWORD ddRVal;
+
+ PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceDest,
GDI_OBJECT_TYPE_DIRECTDRAW);
+ if (pDirectDraw == NULL)
+ return DDHAL_DRIVER_NOTHANDLED;
+
+ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_BLT))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ ddRVal = pDirectDraw->Surf.Blt(puBltData);
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+
+ return ddRVal;
+ }
+
+DWORD STDCALL NtGdiDdUpdateOverlay(
+ HANDLE hSurfaceDestination,
+ HANDLE hSurfaceSource,
+ PDD_UPDATEOVERLAYDATA puUpdateOverlayData
+)
+{
+ 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_UPDATEOVERLAY))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ ddRVal = pDirectDraw->Surf.UpdateOverlay(puUpdateOverlayData);
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
+DWORD STDCALL NtGdiDdUnlock(
+ HANDLE hSurface,
+ PDD_UNLOCKDATA puUnlockData
+)
+{
+ 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_UPDATEOVERLAY))
+ ddRVal = DDHAL_DRIVER_NOTHANDLED;
+ else
+ ddRVal = pDirectDraw->Surf.Unlock(puUnlockData);
+
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ return ddRVal;
+}
+
+
+/**********************************************************************
**/
/* SURFACE OBJECT
*/
/***********************************************************************
*/
@@ -260,6 +532,13 @@
return GDIOBJ_FreeObj(hSurface, GDI_OBJECT_TYPE_DD_SURFACE);
}
+
+
+/**********************************************************************
**/
+/* DIRECT DRAW SURFACR END
*/
+/**********************************************************************
**/
+
+
/*
BOOL STDCALL NtGdiDdAttachSurface(
HANDLE hSurfaceFrom,
@@ -294,18 +573,12 @@
PDD_GETDRIVERINFODATA puGetDriverInfoData)
{
- DWORD pdwNumHeaps;
- VIDEOMEMORY *pvmList = NULL;
- DWORD pdwNumFourCC;
- DWORD *pdwFourCC = NULL;
DWORD ddRVal;
PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal,
GDI_OBJECT_TYPE_DIRECTDRAW);
- ddRVal = pDirectDraw->DrvGetDirectDrawInfo(
- pDirectDraw->Global.dhpdev,(PDD_HALINFO)
puGetDriverInfoData,
- &pdwNumHeaps, pvmList, &pdwNumFourCC, pdwFourCC);
-
+ ddRVal = pDirectDraw->DdGetDriverInfo(puGetDriverInfoData);
+
GDIOBJ_UnlockObjByPtr(pDirectDraw);
return ddRVal;
@@ -313,33 +586,26 @@
-DWORD STDCALL NtGdiDdWaitForVerticalBlank(
- HANDLE hDirectDrawLocal,
- PDD_WAITFORVERTICALBLANKDATA puWaitForVerticalBlankData
-)
-{
- DWORD ddRVal;
- PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal,
GDI_OBJECT_TYPE_DIRECTDRAW);
-
- ddRVal =
pDirectDraw->DdWaitForVerticalBlank(puWaitForVerticalBlankData);
- GDIOBJ_UnlockObjByPtr(pDirectDraw);
- return ddRVal;
-}
-DWORD STDCALL NtGdiDdCanCreateSurface(
+
+
+
+
+
+DWORD STDCALL NtGdiDdGetAvailDriverMemory(
HANDLE hDirectDrawLocal,
- PDD_CANCREATESURFACEDATA puCanCreateSurfaceData
+ PDD_GETAVAILDRIVERMEMORYDATA puGetAvailDriverMemoryData
)
{
DWORD ddRVal;
PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal,
GDI_OBJECT_TYPE_DIRECTDRAW);
- ddRVal =
pDirectDraw->DdCanCreateSurface(puCanCreateSurfaceData);
-
+ ddRVal =
pDirectDraw->DdGetAvailDriverMemory(puGetAvailDriverMemoryData);
+
GDIOBJ_UnlockObjByPtr(pDirectDraw);
return ddRVal;
@@ -347,48 +613,21 @@
-DWORD STDCALL NtGdiDdBlt(
- HANDLE hSurfaceDest,
- HANDLE hSurfaceSrc,
- PDD_BLTDATA puBltData
-)
-{
- DWORD ddRVal;
- PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceDest,
GDI_OBJECT_TYPE_DIRECTDRAW);
-
- puBltData->lpDDDestSurface = hSurfaceDest;
- puBltData->lpDDSrcSurface = hSurfaceSrc;
- puBltData->lpDD = pDirectDraw->Local.lpGbl;
-
- ddRVal = pDirectDraw->DdBlt(puBltData);
-
- GDIOBJ_UnlockObjByPtr(pDirectDraw);
-
- return ddRVal;
-}
-
- /* FIXME
- this call is not implement yet
- where to get the pointer
DdGetAvailDriverMemory(puGetAvailDriverMemoryData
- for the call in NtGdiDdCreateDirectDrawObject `??
- or some where else ??
- */
-
-DWORD STDCALL NtGdiDdGetAvailDriverMemory(
- HANDLE hDirectDrawLocal,
- PDD_GETAVAILDRIVERMEMORYDATA puGetAvailDriverMemoryData
+DWORD STDCALL NtGdiDdSetExclusiveMode(
+ HANDLE hDirectDraw,
+ PDD_SETEXCLUSIVEMODEDATA puSetExclusiveModeData
)
{
DWORD ddRVal;
- PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal,
GDI_OBJECT_TYPE_DIRECTDRAW);
+ PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDraw,
GDI_OBJECT_TYPE_DIRECTDRAW);
- ddRVal =
pDirectDraw->DdGetAvailDriverMemory(puGetAvailDriverMemoryData);
-
- GDIOBJ_UnlockObjByPtr(pDirectDraw);
+ ddRVal = pDirectDraw->DdSetExclusiveMode(puSetExclusiveModeData);
- return ddRVal;
+ GDIOBJ_UnlockObjByPtr(pDirectDraw);
+
+ return ddRVal;
}
_____
Modified: trunk/reactos/subsys/win32k/ntddraw/stubs.c
--- trunk/reactos/subsys/win32k/ntddraw/stubs.c 2005-10-07 20:15:10 UTC
(rev 18312)
+++ trunk/reactos/subsys/win32k/ntddraw/stubs.c 2005-10-07 20:27:52 UTC
(rev 18313)
@@ -141,16 +141,7 @@
return 0;
}
-/*
-HANDLE STDCALL NtGdiDdCreateDirectDrawObject(
- HDC hdc
-)
-{
- UNIMPLEMENTED
- return 0;
-}
-*/
HANDLE STDCALL NtGdiDdCreateMoComp(
HANDLE hDirectDraw,
@@ -162,21 +153,7 @@
return 0;
}
-DWORD STDCALL NtGdiDdCreateSurface(
- HANDLE hDirectDraw,
- HANDLE *hSurface,
- DDSURFACEDESC *puSurfaceDescription,
- DD_SURFACE_GLOBAL *puSurfaceGlobalData,
- DD_SURFACE_LOCAL *puSurfaceLocalData,
- DD_SURFACE_MORE *puSurfaceMoreData,
- PDD_CREATESURFACEDATA puCreateSurfaceData,
- HANDLE *puhSurface
-)
-{
- UNIMPLEMENTED
- return 0;
-}
DWORD STDCALL NtGdiDdCreateSurfaceEx(
HANDLE hDirectDraw,
@@ -189,40 +166,8 @@
return 0;
}
-/*
-HANDLE STDCALL NtGdiDdCreateSurfaceObject(
- HANDLE hDirectDrawLocal,
- HANDLE hSurface,
- PDD_SURFACE_LOCAL puSurfaceLocal,
- PDD_SURFACE_MORE puSurfaceMore,
- PDD_SURFACE_GLOBAL puSurfaceGlobal,
- BOOL bComplete
-)
-{
- UNIMPLEMENTED
- return 0;
-}
-BOOL STDCALL NtGdiDdDeleteDirectDrawObject(
- HANDLE hDirectDrawLocal
-)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
-BOOL STDCALL NtGdiDdDeleteSurfaceObject(
- HANDLE hSurface
-)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-*/
-
DWORD STDCALL NtGdiDdDestroyD3DBuffer(
HANDLE hSurface
)
@@ -242,15 +187,7 @@
return 0;
}
-DWORD STDCALL NtGdiDdDestroySurface(
- HANDLE hSurface,
- BOOL bRealDestroy
-)
-{
- UNIMPLEMENTED
- return 0;
-}
DWORD STDCALL NtGdiDdEndMoCompFrame(
HANDLE hMoComp,
@@ -262,18 +199,7 @@
return 0;
}
-DWORD STDCALL NtGdiDdFlip(
- HANDLE hSurfaceCurrent,
- HANDLE hSurfaceTarget,
- HANDLE hSurfaceCurrentLeft,
- HANDLE hSurfaceTargetLeft,
- PDD_FLIPDATA puFlipData
-)
-{
- UNIMPLEMENTED
- return 0;
-}
DWORD STDCALL NtGdiDdFlipToGDISurface(
HANDLE hDirectDraw,
@@ -378,26 +304,9 @@
return 0;
}
-DWORD STDCALL NtGdiDdGetScanLine(
- HANDLE hDirectDraw,
- PDD_GETSCANLINEDATA puGetScanLineData
-)
-{
- UNIMPLEMENTED
- return 0;
-}
-DWORD STDCALL NtGdiDdLock(
- HANDLE hSurface,
- PDD_LOCKDATA puLockData,
- HDC hdcClip
-)
-{
- UNIMPLEMENTED
- return 0;
-}
DWORD STDCALL NtGdiDdLockD3D(
HANDLE hSurface,
@@ -459,25 +368,9 @@
return 0;
}
-DWORD STDCALL NtGdiDdSetColorKey(
- HANDLE hSurface,
- PDD_SETCOLORKEYDATA puSetColorKeyData
-)
-{
- UNIMPLEMENTED
- return 0;
-}
-DWORD STDCALL NtGdiDdSetExclusiveMode(
- HANDLE hDirectDraw,
- PDD_SETEXCLUSIVEMODEDATA puSetExclusiveModeData
-)
-{
- UNIMPLEMENTED
- return 0;
-}
BOOL STDCALL NtGdiDdSetGammaRamp(
HANDLE hDirectDraw,
@@ -509,15 +402,7 @@
UNIMPLEMENTED
}
-DWORD STDCALL NtGdiDdUnlock(
- HANDLE hSurface,
- PDD_UNLOCKDATA puUnlockData
-)
-{
- UNIMPLEMENTED
- return 0;
-}
DWORD STDCALL NtGdiDdUnlockD3D(
HANDLE hSurface,
@@ -529,16 +414,7 @@
return 0;
}
-DWORD STDCALL NtGdiDdUpdateOverlay(
- HANDLE hSurfaceDestination,
- HANDLE hSurfaceSource,
- PDD_UPDATEOVERLAYDATA puUpdateOverlayData
-)
-{
- UNIMPLEMENTED
- return 0;
-}
DWORD STDCALL NtGdiDdAlphaBlt(VOID)