Author: greatlrd
Date: Sat Apr 26 04:29:10 2008
New Revision: 33147
URL:
http://svn.reactos.org/svn/reactos?rev=33147&view=rev
Log:
fixed : we do not longer losing the hdev for ms dxg.sys
fixed : remove few hacks I did and reactivate some api I did take offline.
the struct EDD_DIRECTDRAW_LOCAL from yuah gdi book does not match windows xp, I have
verify some member for windows xp.
the struct EDD_DIRECTDRAW_GLOBAL from yuah gdi book does not match windows xp, I have
verify some member for windows xp.
and add two new member so hPDEV get in right place.
Modified:
trunk/reactos/include/reactos/drivers/directx/directxint.h
trunk/reactos/subsystems/win32/win32k/ntddraw/dd.c
trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c
trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c
Modified: trunk/reactos/include/reactos/drivers/directx/directxint.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/di…
==============================================================================
--- trunk/reactos/include/reactos/drivers/directx/directxint.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/drivers/directx/directxint.h [iso-8859-1] Sat Apr 26
04:29:10 2008
@@ -12,17 +12,17 @@
// GDI Object Header
//
DD_BASEOBJECT pobj;
-/* 0x10 */ struct _EDD_DIRECTDRAW_GLOBAL * peDirectDrawGlobal;
+/* 0x10 */ struct _EDD_DIRECTDRAW_GLOBAL * peDirectDrawGlobal; // verify it match
windows xp
/* 0x1C */ struct _EDD_SURFACE * peSurface_DdList;
/* 0x1C */ ULONG unk_01c;
/* 0x20 */ ULONG unk_020;
-/* 0x24 */ struct _EDD_DIRECTDRAW_GLOBAL * peDirectDrawGlobal2;
+/* 0x24 */ struct _EDD_DIRECTDRAW_GLOBAL * peDirectDrawGlobal2; // verify it match
windows xp
/* 0x28 */ FLATPTR fpProcess;
/* 0x2C */ FLONG fl;
-/* 0x30 */ HANDLE UniqueProcess;
+/* 0x30 */ struct _EDD_DIRECTDRAW_LOCAL *peDirectDrawLocal_prev; // verify it match
windows xp, to old lcl store here when new handle are create.
/* 0x34 */ PEPROCESS Process;
/* 0x38 */ ULONG unk_038;
-/* 0x3C */ ULONG unk_03C;
+/* 0x3C */ HANDLE UniqueProcess;
/* 0x40 */ VOID *unk_040;
/* 0x44 */ VOID *unk_044;
/* 0x48 */ ULONG unk_048;
@@ -121,7 +121,7 @@
/* 0x4EC */ ULONG unk_4ec[18];
/* 0x534 */ D3DNTHAL_CALLBACKS3 d3dNtHalCallbacks3;
/* 0x54C */ ULONG unk_54c[23];
-/* 0x5A8 */ EDD_DIRECTDRAW_LOCAL* peDirectDrawLocalList;
+/* 0x5A8 */ EDD_DIRECTDRAW_LOCAL* peDirectDrawLocalList; // verify it match windows
xp, comment it is current local struct not a list
/* 0x5ac */ EDD_SURFACE* peSurface_LockList;
/* 0x5B0 */ FLONG fl;
/* 0x5B4 */ ULONG cSurfaceLocks;
@@ -131,6 +131,8 @@
/* 0x5C4 */ BOOL bSuspended;
/* 0x5C8 */ ULONG unk_5c8[12];
/* 0x5F8 */ RECTL rcbounds;
+/* 0x5FC */ ULONG unk_5FC;
+/* 0x600 */ ULONG unk_600;
/* 0x608 */ HDEV hDev;
/* 0x60c */ PVOID hPDev; /* The real Pdev */
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/dd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntddraw/dd.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntddraw/dd.c [iso-8859-1] Sat Apr 26 04:29:10
2008
@@ -75,10 +75,8 @@
}
DPRINT1("Calling on dxg.sys DdCanCreateSurface\n");
- DPRINT1("FIXME it crash when it trying call on pfnDdCanCreateSurface\n");
- /* FIXME it crash when it trying call on pfnDdCanCreateSurface */
- // return pfnDdCanCreateSurface(hDirectDrawLocal,puCanCreateSurfaceData);
- return 0;
+
+ return pfnDdCanCreateSurface(hDirectDrawLocal,puCanCreateSurfaceData);
}
/************************************************************************/
@@ -98,10 +96,8 @@
}
DPRINT1("Calling on dxg.sys pfnDdGetScanLine\n");
- DPRINT1("FIXME it crash when it trying call on pfnDdGetScanLine\n");
- /* FIXME it crash when it trying call on pfnDdGetScanLine */
- // return pfnDdGetScanLine(hDirectDrawLocal,puGetScanLineData);
- return 0;
+
+ return pfnDdGetScanLine(hDirectDrawLocal,puGetScanLineData);
}
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntddraw/ddraw.c [iso-8859-1] Sat Apr 26 04:29:10
2008
@@ -24,7 +24,7 @@
ULONG gdwDirectDrawContext;
EDD_DIRECTDRAW_GLOBAL edd_DdirectDraw_Global;
-EDD_DIRECTDRAW_LOCAL edd_DirectDrawLocalList;
+
/************************************************************************/
@@ -118,18 +118,6 @@
gpDxFuncs[lstDrvFN[t].iFunc].pfn =lstDrvFN[t].pfn;
}
- /* dump sort list for debuging */
-#if DXDDRAWDEBUG
- DPRINT1("ghDxGraphics address 0x%08lx\n",ghDxGraphics);
- DPRINT1("gpfnStartupDxGraphics address
0x%08lx\n",gpfnStartupDxGraphics);
- DPRINT1("gpfnCleanupDxGraphics address
0x%08lx\n",gpfnCleanupDxGraphics);
-
- for (t=0;t<=DXG_INDEX_DxDdIoctl;t++)
- {
- DPRINT1("gpDxFuncs[0x%08lx].iFunc =
0x%08lx\n",t,gpDxFuncs[t].iFunc);
- DPRINT1("gpDxFuncs[0x%08lx].pfn =
0x%08lx\n",t,gpDxFuncs[t].pfn);
- }
-#endif
DPRINT1("DirectX interface is activated\n");
}
@@ -184,16 +172,11 @@
((PGDIDEVICE)pDC->pPDev)->pEDDgpl = &edd_DdirectDraw_Global;
RtlZeroMemory(&edd_DdirectDraw_Global,sizeof(EDD_DIRECTDRAW_GLOBAL));
- /* FIXME this should be alloc by win32k */
- RtlZeroMemory(&edd_DirectDrawLocalList,sizeof(EDD_DIRECTDRAW_LOCAL));
+
/* setup hdev for edd_DdirectDraw_Global xp */
- edd_DdirectDraw_Global.hDev = (PVOID)pDC->pPDev;
edd_DdirectDraw_Global.hPDev = (PVOID)pDC->pPDev;
- edd_DdirectDraw_Global.peDirectDrawLocalList = &edd_DirectDrawLocalList;
-
- /* setup hdev for edd_DdirectDraw_Local xp */
- edd_DirectDrawLocalList.peDirectDrawGlobal = &edd_DdirectDraw_Global;
+
DC_UnlockDc(pDC);
/* get the pfnDdCreateDirectDrawObject after we load the drv */
@@ -353,12 +336,11 @@
DPRINT1("Warning: hDirectDrawLocal is NULL\n");
return DDHAL_DRIVER_HANDLED;
}
+
DPRINT1("hDirectDrawLocal = %lx \n",hDirectDrawLocal);
DPRINT1("Calling dxg.sys pfnDdDeleteDirectDrawObject\n");
- DPRINT1("FIXME delete of the HANDLE\n");
- /* FIXME it crash inside or after it return from DxEngLockShareSem */
- // return pfnDdDeleteDirectDrawObject(hDirectDrawLocal);
- return DDHAL_DRIVER_HANDLED;
+
+ return pfnDdDeleteDirectDrawObject(hDirectDrawLocal);
}
/************************************************************************/
@@ -627,20 +609,20 @@
/* internal debug api */
void dump_edd_directdraw_global(EDD_DIRECTDRAW_GLOBAL *pEddgbl)
{
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->dhpdev :
0x%08lx\n",pEddgbl->dhpdev);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->dwReserved1 :
0x%08lx\n",pEddgbl->dwReserved1);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->dwReserved2 :
0x%08lx\n",pEddgbl->dwReserved2);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->unk_000c[0] :
0x%08lx\n",pEddgbl->unk_000c[0]);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->unk_000c[1] :
0x%08lx\n",pEddgbl->unk_000c[1]);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->unk_000c[2] :
0x%08lx\n",pEddgbl->unk_000c[2]);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->cDriverReferences :
0x%08lx\n",pEddgbl->cDriverReferences);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->unk_01c[0] :
0x%08lx\n",pEddgbl->unk_01c[0]);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->unk_01c[1] :
0x%08lx\n",pEddgbl->unk_01c[1]);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->unk_01c[2] :
0x%08lx\n",pEddgbl->unk_01c[2]);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->llAssertModeTimeout :
0x%llx\n",pEddgbl->llAssertModeTimeout);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->dwNumHeaps :
0x%08lx\n",pEddgbl->dwNumHeaps);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->dhpdev :
0x%08lx\n",(((DWORD)&pEddgbl->dhpdev) - (DWORD)pEddgbl), pEddgbl->dhpdev);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->dwReserved1 :
0x%08lx\n",(((DWORD)&pEddgbl->dwReserved1) -
(DWORD)pEddgbl),pEddgbl->dwReserved1);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->dwReserved2 :
0x%08lx\n",(((DWORD)&pEddgbl->dwReserved2) -
(DWORD)pEddgbl),pEddgbl->dwReserved2);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->unk_000c[0] :
0x%08lx\n",(((DWORD)&pEddgbl->unk_000c) -
(DWORD)pEddgbl),pEddgbl->unk_000c[0]);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->unk_000c[1] :
0x%08lx\n",(((DWORD)&pEddgbl->unk_000c) -
(DWORD)pEddgbl),pEddgbl->unk_000c[1]);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->unk_000c[2] :
0x%08lx\n",(((DWORD)&pEddgbl->unk_000c) -
(DWORD)pEddgbl),pEddgbl->unk_000c[2]);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->cDriverReferences :
0x%08lx\n",(((DWORD)&pEddgbl->cDriverReferences) -
(DWORD)pEddgbl),pEddgbl->cDriverReferences);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->unk_01c[0] :
0x%08lx\n",(((DWORD)&pEddgbl->unk_01c) -
(DWORD)pEddgbl),pEddgbl->unk_01c[0]);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->unk_01c[1] :
0x%08lx\n",(((DWORD)&pEddgbl->unk_01c) -
(DWORD)pEddgbl),pEddgbl->unk_01c[1]);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->unk_01c[2] :
0x%08lx\n",(((DWORD)&pEddgbl->unk_01c) -
(DWORD)pEddgbl),pEddgbl->unk_01c[2]);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->llAssertModeTimeout :
0x%llx\n",(((DWORD)&pEddgbl->llAssertModeTimeout) -
(DWORD)pEddgbl),pEddgbl->llAssertModeTimeout);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->dwNumHeaps :
0x%08lx\n",(((DWORD)&pEddgbl->dwNumHeaps) -
(DWORD)pEddgbl),pEddgbl->dwNumHeaps);
// VIDEOMEMORY *pvmList;
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->pvmList :
0x%08lx\n",pEddgbl->pvmList);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->pvmList :
0x%08lx\n",(((DWORD)&pEddgbl->pvmList) -
(DWORD)pEddgbl),pEddgbl->pvmList);
DPRINT1("PEDD_DIRECTDRAW_GLOBAL->dwNumFourCC :
0x%08lx\n",pEddgbl->dwNumFourCC);
DPRINT1("PEDD_DIRECTDRAW_GLOBAL->pdwFourCC :
0x%08lx\n",pEddgbl->pdwFourCC);
// DD_HALINFO ddHalInfo;
@@ -844,8 +826,10 @@
DPRINT1("PEDD_DIRECTDRAW_GLOBAL->unk_5c8[11] :
0x%08lx\n",pEddgbl->unk_5c8[11]);
// RECTL rcbounds;
DPRINT1("PEDD_DIRECTDRAW_GLOBAL->rcbounds :
0x%08lx\n",pEddgbl->rcbounds);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->hDev :
0x%08lx\n",pEddgbl->hDev);
- DPRINT1("PEDD_DIRECTDRAW_GLOBAL->hPDev :
0x%08lx\n",pEddgbl->hPDev);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->unk_5FC :
0x%08lx\n",(((DWORD)&pEddgbl->unk_5FC) - (DWORD)pEddgbl),
pEddgbl->unk_5FC);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->unk_600 :
0x%08lx\n",(((DWORD)&pEddgbl->unk_600) - (DWORD)pEddgbl),
pEddgbl->unk_600);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->hDev :
0x%08lx\n",(((DWORD)&pEddgbl->hDev) - (DWORD)pEddgbl), pEddgbl->hDev);
+ DPRINT1("0x%08lx PEDD_DIRECTDRAW_GLOBAL->hPDev :
0x%08lx\n",(((DWORD)&pEddgbl->hPDev) - (DWORD)pEddgbl), pEddgbl->hPDev);
DPRINT1("PEDD_DIRECTDRAW_GLOBAL->ddPaletteCallbacks :
0x%08lx\n",pEddgbl->ddPaletteCallbacks);
DPRINT1("PEDD_DIRECTDRAW_GLOBAL->unk_1e0[0] :
0x%08lx\n",pEddgbl->unk_610[0]);
DPRINT1("PEDD_DIRECTDRAW_GLOBAL->unk_610[1] :
0x%08lx\n",pEddgbl->unk_610[1]);
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c [iso-8859-1] Sat Apr 26 04:29:10
2008
@@ -178,7 +178,7 @@
STDCALL
DxEngLockShareSem()
{
- BOOLEAN retVal = 0;
+ BOOLEAN retVal = FALSE;
DPRINT1("ReactX Calling : DxEngLockShareSem\n");
#if 0
if (ExIsResourceAcquiredExclusiveLite(&ghsemShareDevLock) == FALSE)
@@ -541,11 +541,11 @@
PGDIDEVICE pPDev = (PGDIDEVICE)hDev;
PERESOURCE Resource;
+ DPRINT1("ReactX Calling : DxEngLockHdev \n");
+
DPRINT1("hDev : 0x%08lx\n",hDev);
Resource = pPDev->hsemDevLock;
-
- DPRINT1("ReactX Calling : DxEngLockHdev \n");
if (Resource)
{