Author: greatlrd
Date: Sun Oct 14 23:45:13 2007
New Revision: 29572
URL:
http://svn.reactos.org/svn/reactos?rev=29572&view=rev
Log:
more redirect from win32k to dxg.sys
btw no old code exists in current file.
Modified:
branches/reactx/reactos/subsystems/win32/win32k/ntddraw/dd.c
branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddraw.c
branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddsurf.c
branches/reactx/reactos/subsystems/win32/win32k/ntddraw/stubs.c
Modified: branches/reactx/reactos/subsystems/win32/win32k/ntddraw/dd.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/subsystems/win32…
==============================================================================
--- branches/reactx/reactos/subsystems/win32/win32k/ntddraw/dd.c (original)
+++ branches/reactx/reactos/subsystems/win32/win32k/ntddraw/dd.c Sun Oct 14 23:45:13 2007
@@ -18,15 +18,11 @@
extern PDRVFN gpDxFuncs;
-/* is not longer in use PDD_DESTROYDRIVER DestroyDriver */
typedef DWORD (NTAPI *PGD_DDCREATESURFACE)(HANDLE, HANDLE *, DDSURFACEDESC *,
DD_SURFACE_GLOBAL *, DD_SURFACE_LOCAL *, DD_SURFACE_MORE *, PDD_CREATESURFACEDATA , HANDLE
*);
-/* see ddsurf.c for PDD_SETCOLORKEY SetColorKey; */
-/* is not longer in use PDD_SETMODE SetMode; */
typedef DWORD (NTAPI *PGD_DXDDWAITFORVERTICALBLANK)(HANDLE,
PDD_WAITFORVERTICALBLANKDATA);
typedef DWORD (NTAPI *PGD_DDCANCREATESURFACE)(HANDLE hDirectDrawLocal,
PDD_CANCREATESURFACEDATA puCanCreateSurfaceData);
-/* is not longer in use PDD_CREATEPALETTE CreatePalette; */
typedef DWORD (NTAPI *PGD_DXDDGETSCANLINE)(HANDLE, PDD_GETSCANLINEDATA);
-/* is not longer in use PDD_MAPMEMORY MapMemory; */
+typedef DWORD (NTAPI *PGD_DXDDCREATESURFACEEX)(HANDLE,HANDLE,DWORD);
#define DXG_GET_INDEX_FUNCTION(INDEX, FUNCTION) \
if (gpDxFuncs) \
@@ -142,3 +138,34 @@
}
+/************************************************************************/
+/* This is not part of the ddsurface interface but it have */
+/* deal with the surface */
+/************************************************************************/
+
+/************************************************************************/
+/* NtGdiDdCreateSurfaceEx */
+/************************************************************************/
+DWORD
+STDCALL
+NtGdiDdCreateSurfaceEx(HANDLE hDirectDraw,
+ HANDLE hSurface,
+ DWORD dwSurfaceHandle)
+{
+ PGD_DXDDCREATESURFACEEX pfnDdCreateSurfaceEx = NULL;
+ INT i;
+
+ DXG_GET_INDEX_FUNCTION(DXG_INDEX_DxDdCreateSurfaceEx, pfnDdCreateSurfaceEx);
+
+ if (pfnDdCreateSurfaceEx == NULL)
+ {
+ DPRINT1("Warring no pfnDdCreateSurfaceEx");
+ return DDHAL_DRIVER_NOTHANDLED;
+ }
+
+ DPRINT1("Calling on dxg.sys pfnDdCreateSurfaceEx");
+ return pfnDdCreateSurfaceEx(hDirectDrawLocal,puGetScanLineData);
+
+}
+
+
Modified: branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddraw.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/subsystems/win32…
==============================================================================
--- branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddraw.c (original)
+++ branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddraw.c Sun Oct 14 23:45:13
2007
@@ -22,6 +22,10 @@
+typedef DWORD (NTAPI *PGD_DXDDREENABLEDIRECTDRAWOBJECT)(HANDLE, BOOL);
+typedef DWORD (NTAPI *PGD_DXDDGETDRIVERINFO)(HANDLE, PDD_GETDRIVERINFODATA);
+typedef DWORD (NTAPI *PGD_DXDDGETAVAILDRIVERMEMORY(HANDLE,
PDD_GETAVAILDRIVERMEMORYDATA);
+typedef DWORD (NTAPI *PGD_DXDDSETEXCLUSIVEMODE)(HANDLE, PDD_SETEXCLUSIVEMODEDATA);
typedef NTSTATUS (NTAPI *PGD_DXDDSTARTUPDXGRAPHICS) (ULONG, PDRVENABLEDATA, ULONG,
PDRVENABLEDATA, PULONG, PEPROCESS);
typedef NTSTATUS (NTAPI *PGD_DXDDCLEANUPDXGRAPHICS) (VOID);
typedef HANDLE (NTAPI *PGD_DDCREATEDIRECTDRAWOBJECT) (HDC hdc);
@@ -354,169 +358,107 @@
}
-
-
-
-BOOL
-STDCALL NtGdiDdReenableDirectDrawObject(
- HANDLE hDirectDrawLocal,
- BOOL *pubNewMode
-)
-{
- BOOL Ret=FALSE;
- NTSTATUS Status = FALSE;
- PDD_DIRECTDRAW pDirectDraw;
-
- if (hDirectDrawLocal == NULL)
- {
- return Ret;
- }
-
- pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal,
- GDI_OBJECT_TYPE_DIRECTDRAW);
-
- if (!pDirectDraw)
- {
- return Ret;
- }
-
- /*
- * FIXME detect mode change thic code maybe are not correct
- * if we call on intEnableDriver it will cause some memory leak
- * we need free the alloc memory before we call on it
- */
- Ret = intEnableDriver(pDirectDraw);
-
- _SEH_TRY
- {
- ProbeForWrite(pubNewMode, sizeof(BOOL), 1);
- *pubNewMode = Ret;
- }
- _SEH_HANDLE
- {
- Status = _SEH_GetExceptionCode();
- }
- _SEH_END;
- if(!NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- return Ret;
- }
-
- GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
-
- return Ret;
-
-}
-
-
-
-DWORD STDCALL NtGdiDdGetDriverInfo(
- HANDLE hDirectDrawLocal,
- PDD_GETDRIVERINFODATA puGetDriverInfoData)
-
-{
- DWORD ddRVal = 0;
- PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal,
- GDI_OBJECT_TYPE_DIRECTDRAW);
-
- DPRINT1("NtGdiDdGetDriverInfo\n");
-
- if (pDirectDraw == NULL)
- {
- return DDHAL_DRIVER_NOTHANDLED;
- }
-
- /* it exsist two version of NtGdiDdGetDriverInfo we need check for both flags */
- if (!(pDirectDraw->Hal.dwFlags & DDHALINFO_GETDRIVERINFOSET))
- ddRVal++;
-
- if (!(pDirectDraw->Hal.dwFlags & DDHALINFO_GETDRIVERINFO2))
- ddRVal++;
-
- /* Now we are doing the call to drv DrvGetDriverInfo */
- if (ddRVal == 2)
- {
- DPRINT1("NtGdiDdGetDriverInfo DDHAL_DRIVER_NOTHANDLED");
- ddRVal = DDHAL_DRIVER_NOTHANDLED;
- }
- else
- {
- ddRVal = pDirectDraw->Hal.GetDriverInfo(puGetDriverInfoData);
- }
-
- GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
-
- return ddRVal;
-}
-
-
-
-
-
-DWORD STDCALL NtGdiDdGetAvailDriverMemory(
- HANDLE hDirectDrawLocal,
- PDD_GETAVAILDRIVERMEMORYDATA puGetAvailDriverMemoryData
-)
-{
- DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED;
- PDD_DIRECTDRAW_GLOBAL lgpl;
-
- PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDrawLocal,
GDI_OBJECT_TYPE_DIRECTDRAW);
-#ifdef DX_DEBUG
- DPRINT1("NtGdiDdGetAvailDriverMemory\n");
-#endif
-
- /* backup the orignal PDev and info */
- lgpl = puGetAvailDriverMemoryData->lpDD;
-
- /* use our cache version instead */
- puGetAvailDriverMemoryData->lpDD = &pDirectDraw->Global;
-
- /* make the call */
- // ddRVal = pDirectDraw->DdGetAvailDriverMemory(puGetAvailDriverMemoryData);
-
- GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
-
-
- /* But back the orignal PDev */
- puGetAvailDriverMemoryData->lpDD = lgpl;
-
- return ddRVal;
-}
-
-
-
-
-DWORD STDCALL NtGdiDdSetExclusiveMode(
- HANDLE hDirectDraw,
- PDD_SETEXCLUSIVEMODEDATA puSetExclusiveModeData
-)
-{
- DWORD ddRVal;
- PDD_DIRECTDRAW_GLOBAL lgpl;
-
- PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(DdHandleTable, hDirectDraw,
GDI_OBJECT_TYPE_DIRECTDRAW);
-
-#ifdef DX_DEBUG
- DPRINT1("NtGdiDdSetExclusiveMode\n");
-#endif
-
- /* backup the orignal PDev and info */
- lgpl = puSetExclusiveModeData->lpDD;
-
- /* use our cache version instead */
- puSetExclusiveModeData->lpDD = &pDirectDraw->Global;
-
- /* make the call */
- ddRVal = pDirectDraw->DdSetExclusiveMode(puSetExclusiveModeData);
-
- GDIOBJ_UnlockObjByPtr(DdHandleTable, pDirectDraw);
-
- /* But back the orignal PDev */
- puSetExclusiveModeData->lpDD = lgpl;
-
- return ddRVal;
+/************************************************************************/
+/* NtGdiDdReenableDirectDrawObject */
+/************************************************************************/
+
+
+BOOL
+STDCALL
+NtGdiDdReenableDirectDrawObject(HANDLE hDirectDrawLocal,
+ BOOL *pubNewMode)
+{
+ PGD_DXDDREENABLEDIRECTDRAWOBJECT pfnDdReenableDirectDrawObject = NULL;
+ INT i;
+
+ DXG_GET_INDEX_FUNCTION(DXG_INDEX_DxDdReenableDirectDrawObject,
pfnDdReenableDirectDrawObject);
+
+ if (pfnDdReenableDirectDrawObject == NULL)
+ {
+ DPRINT1("Warring no pfnDdReenableDirectDrawObject");
+ return DDHAL_DRIVER_NOTHANDLED;
+ }
+
+ DPRINT1("Calling on dxg.sys pfnDdReenableDirectDrawObject");
+ return pfnDdReenableDirectDrawObject(hDirectDrawLocal, pubNewMode);
+}
+
+
+/************************************************************************/
+/* NtGdiDdGetDriverInfo */
+/************************************************************************/
+
+DWORD
+STDCALL
+NtGdiDdGetDriverInfo(HANDLE hDirectDrawLocal,
+ PDD_GETDRIVERINFODATA puGetDriverInfoData)
+
+{
+ PGD_DXDDGETDRIVERINFO pfnDdGetDriverInfo = NULL;
+ INT i;
+
+ DXG_GET_INDEX_FUNCTION(DXG_INDEX_DxDdGetDriverInfo, pfnDdGetDriverInfo);
+
+ if (pfnDdGetDriverInfo == NULL)
+ {
+ DPRINT1("Warring no pfnDdGetDriverInfo");
+ return DDHAL_DRIVER_NOTHANDLED;
+ }
+
+ DPRINT1("Calling on dxg.sys pfnDdGetDriverInfo");
+ return pfnDdGetDriverInfo(hDirectDrawLocal, puGetDriverInfoData);
+
+
+}
+
+
+/************************************************************************/
+/* NtGdiDdGetAvailDriverMemory */
+/************************************************************************/
+DWORD
+STDCALL
+NtGdiDdGetAvailDriverMemory(HANDLE hDirectDrawLocal,
+ PDD_GETAVAILDRIVERMEMORYDATA puGetAvailDriverMemoryData)
+{
+ PGD_DXDDGETAVAILDRIVERMEMORY pfnDdGetAvailDriverMemory = NULL;
+ INT i;
+
+ DXG_GET_INDEX_FUNCTION(DXG_INDEX_DxDdGetAvailDriverMemory,
pfnDdGetAvailDriverMemory);
+
+ if (pfnDdGetAvailDriverMemory == NULL)
+ {
+ DPRINT1("Warring no pfnDdGetAvailDriverMemory");
+ return DDHAL_DRIVER_NOTHANDLED;
+ }
+
+ DPRINT1("Calling on dxg.sys pfnDdGetAvailDriverMemory");
+ return pfnDdGetAvailDriverMemory(hDirectDrawLocal, puGetAvailDriverMemoryData);
+}
+
+
+/************************************************************************/
+/* NtGdiDdSetExclusiveMode */
+/************************************************************************/
+
+DWORD
+STDCALL
+NtGdiDdSetExclusiveMode(HANDLE hDirectDraw,
+ PDD_SETEXCLUSIVEMODEDATA puSetExclusiveModeData)
+{
+ PGD_DXDDSETEXCLUSIVEMODE pfnDdSetExclusiveMode = NULL;
+ INT i;
+
+ DXG_GET_INDEX_FUNCTION(DXG_INDEX_DxDdSetExclusiveMode, pfnDdSetExclusiveMode);
+
+ if (pfnDdSetExclusiveMode == NULL)
+ {
+ DPRINT1("Warring no pfnDdSetExclusiveMode");
+ return DDHAL_DRIVER_NOTHANDLED;
+ }
+
+ DPRINT1("Calling on dxg.sys pfnDdSetExclusiveMode");
+ return pfnDdSetExclusiveMode(hDirectDrawLocal, puGetAvailDriverMemoryData);
+
}
Modified: branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddsurf.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/subsystems/win32…
==============================================================================
--- branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddsurf.c (original)
+++ branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddsurf.c Sun Oct 14 23:45:13
2007
@@ -16,6 +16,7 @@
extern PDRVFN gpDxFuncs;
+typedef DWORD (NTAPI *PGD_DXDDUNATTACHSURFACE)(HANDLE, HANDLE);
typedef DWORD (NTAPI *PGD_DXDDDESTROYSURFACE)(HANDLE, BOOL);
typedef DWORD (NTAPI *PGD_DXDDFLIP)(HANDLE, HANDLE, HANDLE, HANDLE, PDD_FLIPDATA);
/* Does not exists in win32k or dxg.sys PDD_SURFCB_SETCLIPLIST SetClipList; */
@@ -361,3 +362,27 @@
return pfnDdAttachSurface(hSurfaceFrom,hSurfaceTo);
}
+/************************************************************************/
+/* NtGdiDdUnattachSurface */
+/************************************************************************/
+VOID
+STDCALL
+NtGdiDdUnattachSurface(HANDLE hSurface,
+ HANDLE hSurfaceAttached)
+{
+ PGD_DXDDUNATTACHSURFACE pfnDdUnattachSurface = NULL;
+ INT i;
+
+ DXG_GET_INDEX_FUNCTION(DXG_INDEX_DxDdUnattachSurface, pfnDdUnattachSurface);
+
+ if (pfnDdUnattachSurface == NULL)
+ {
+ DPRINT1("Warring no pfnDdUnattachSurface");
+ return DDHAL_DRIVER_NOTHANDLED;
+ }
+
+ DPRINT1("Calling on dxg.sys pfnDdUnattachSurface");
+ return pfnDdUnattachSurface(hSurface,hSurfaceAttached);
+}
+
+
Modified: branches/reactx/reactos/subsystems/win32/win32k/ntddraw/stubs.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/subsystems/win32…
==============================================================================
--- branches/reactx/reactos/subsystems/win32/win32k/ntddraw/stubs.c (original)
+++ branches/reactx/reactos/subsystems/win32/win32k/ntddraw/stubs.c Sun Oct 14 23:45:13
2007
@@ -13,16 +13,7 @@
#define NDEBUG
#include <debug.h>
-DWORD STDCALL NtGdiDdCreateSurfaceEx(
- HANDLE hDirectDraw,
- HANDLE hSurface,
- DWORD dwSurfaceHandle
-)
-{
- UNIMPLEMENTED
- return 0;
-}
DWORD STDCALL NtGdiDdFlipToGDISurface(
HANDLE hDirectDraw,
@@ -86,13 +77,7 @@
return 0;
}
-VOID STDCALL NtGdiDdUnattachSurface(
- HANDLE hSurface,
- HANDLE hSurfaceAttached
-)
-{
- UNIMPLEMENTED
-}
+