actvate more code and slash away more notes to the trachcan, and smaller cleanup

svn path=/branches/reactx/; revision=29798
This commit is contained in:
Magnus Olsen 2007-10-22 21:15:10 +00:00
parent 969eb0a20a
commit 03cd85d4e1
3 changed files with 31 additions and 17 deletions

View file

@ -4,4 +4,7 @@
<directory name="dxg"> <directory name="dxg">
<xi:include href="dxg/dxg.rbuild" /> <xi:include href="dxg/dxg.rbuild" />
</directory> </directory>
<directory name="dxgthk">
<xi:include href="dxgthk/dxgthk.rbuild" />
</directory>
</group> </group>

View file

@ -5,6 +5,7 @@ installbase="system32/drivers" installname="dxg.sys">
<importlibrary definition="dxg.def" /> <importlibrary definition="dxg.def" />
<include base="dxg">.</include> <include base="dxg">.</include>
<define name="__USE_W32API" /> <define name="__USE_W32API" />
<library>dxgthk</library>
<file>main.c</file> <file>main.c</file>
<file>dxg.rc</file> <file>dxg.rc</file>
</module> </module>

View file

@ -12,14 +12,18 @@
#include <dxg_int.h> #include <dxg_int.h>
ULONG gcDxgFuncs = 0x5C;
ULONG gcMaxDdHmgr = 0; ULONG gcMaxDdHmgr = 0;
ULONG gcSizeDdHmgr = 0; ULONG gcSizeDdHmgr = 0;
gcDummyPageRefCnt = 0; LONG gcDummyPageRefCnt = 0;
HSEMAPHORE ghsemHmgr = NULL;
HSEMAPHORE ghsemDummyPage = NULL;
VOID *gpDummyPage = NULL;
PEPROCESS gpepSession = NULL;
HSEMAPHORE *ghsemHmgr = NULL; PDRVFN gpEngFuncs;
VOID * gpDummyPage;
const ULONG gcDxgFuncs = DXG_INDEX_DxDdIoctl + 1;
DRVFN gaDxgFuncs [] = DRVFN gaDxgFuncs [] =
{ {
{0, (PFN) NULL} {0, (PFN) NULL}
@ -46,6 +50,7 @@ DxDdStartupDxGraphics (ULONG SizeEngDrv,
{ {
PDRVFN drv_func; PDRVFN drv_func;
INT i;
/* Test see if the data is vaild we got from win32k.sys */ /* Test see if the data is vaild we got from win32k.sys */
if ((SizeEngDrv != sizeof(DRVENABLEDATA)) || if ((SizeEngDrv != sizeof(DRVENABLEDATA)) ||
@ -55,9 +60,9 @@ DxDdStartupDxGraphics (ULONG SizeEngDrv,
} }
/* rest static value */ /* rest static value */
gpDummyPage = 0; gpDummyPage = NULL;
gcDummyPageRefCnt = 0; gcDummyPageRefCnt = 0;
ghsemDummyPage = 0; ghsemDummyPage = NULL;
/* /*
* Setup internal driver functions list we got from dxg driver functions list * Setup internal driver functions list we got from dxg driver functions list
@ -71,7 +76,7 @@ DxDdStartupDxGraphics (ULONG SizeEngDrv,
{ {
return STATUS_INTERNAL_ERROR; return STATUS_INTERNAL_ERROR;
} }
#if 0
/* /*
* Check if all drv functions are sorted right * Check if all drv functions are sorted right
* and if it really are exported * and if it really are exported
@ -79,7 +84,7 @@ DxDdStartupDxGraphics (ULONG SizeEngDrv,
for (i=1 ; i < DXENG_INDEX_DxEngLoadImage + 1; i++) for (i=1 ; i < DXENG_INDEX_DxEngLoadImage + 1; i++)
{ {
drv_func = &EngDrv->pdrvfn[i]; drv_func = &pDxEngDrv->pdrvfn[i];
if ((drv_func->iFunc != i) || if ((drv_func->iFunc != i) ||
(drv_func->pfn == 0)) (drv_func->pfn == 0))
@ -93,6 +98,7 @@ DxDdStartupDxGraphics (ULONG SizeEngDrv,
/* Note 12/1-2004 : Why is this set to 0x618 */ /* Note 12/1-2004 : Why is this set to 0x618 */
*DirectDrawContext = 0x618; *DirectDrawContext = 0x618;
#if 0
if (DdHmgCreate()) if (DdHmgCreate())
{ {
ghsemDummyPage = EngCreateSemaphore(); ghsemDummyPage = EngCreateSemaphore();
@ -103,6 +109,7 @@ DxDdStartupDxGraphics (ULONG SizeEngDrv,
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
} }
#endif
DdHmgDestroy(); DdHmgDestroy();
@ -111,37 +118,39 @@ DxDdStartupDxGraphics (ULONG SizeEngDrv,
EngDeleteSemaphore(ghsemDummyPage); EngDeleteSemaphore(ghsemDummyPage);
ghsemDummyPage = 0; ghsemDummyPage = 0;
} }
#endif
return STATUS_NO_MEMORY; return STATUS_NO_MEMORY;
} }
NTSTATUS NTSTATUS
DxDdCleanupDxGraphics() DxDdCleanupDxGraphics()
{ {
#if 0
DdHmgDestroy(); DdHmgDestroy();
if (!ghsemDummyPage) if (!ghsemDummyPage)
{ {
if (!gpDummyPage) if (!gpDummyPage)
{ {
#if 0
ExFreePoolWithTag(gpDummyPage,0); ExFreePoolWithTag(gpDummyPage,0);
gpDummyPage = 0; #endif
gpDummyPage = NULL;
gcDummyPageRefCnt = 0; gcDummyPageRefCnt = 0;
} }
EngDeleteSemaphore(ghsemDummyPage) EngDeleteSemaphore(ghsemDummyPage);
} }
#endif
return 0; return 0;
} }
BOOL BOOL
DdHmgDestroy() DdHmgDestroy()
{ {
#if 0
ghFreeDdHmgr = 0;
gcMaxDdHmgr = 0; gcMaxDdHmgr = 0;
gcSizeDdHmgr = 0; gcSizeDdHmgr = 0;
#if 0
ghFreeDdHmgr = 0;
gpentDdHmgrLast = 0; gpentDdHmgrLast = 0;
if (gpentDdHmgr) if (gpentDdHmgr)
@ -149,12 +158,13 @@ DdHmgDestroy()
EngFreeMem(gpentDdHmgr); EngFreeMem(gpentDdHmgr);
gpentDdHmgr = 0; gpentDdHmgr = 0;
} }
#endif
if (ghsemHmgr) if (ghsemHmgr)
{ {
EngDeleteSemaphore(ghsemHmgr); EngDeleteSemaphore(ghsemHmgr);
ghsemHmgr = NULL;
} }
#endif
return TRUE; return TRUE;
} }