Author: greatlrd
Date: Mon Oct 22 20:26:59 2007
New Revision: 29780
URL:
http://svn.reactos.org/svn/reactos?rev=29780&view=rev
Log:
Adding code from 2004, DxDdStartupDxGraphics, DxDdCleanupDxGraphics(), DdHmgDestroy()
Added:
branches/reactx/reactos/drivers/directx/dxg/dxg.def (with props)
Modified:
branches/reactx/reactos/drivers/directx/dxg/dxg.rbuild
branches/reactx/reactos/drivers/directx/dxg/main.c
Added: branches/reactx/reactos/drivers/directx/dxg/dxg.def
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/directx/…
==============================================================================
--- branches/reactx/reactos/drivers/directx/dxg/dxg.def (added)
+++ branches/reactx/reactos/drivers/directx/dxg/dxg.def Mon Oct 22 20:26:59 2007
@@ -1,0 +1,9 @@
+; $Id: videoprt.def 27062 2007-06-07 21:13:06Z greatlrd $
+;
+; dxg.def - export definition file for ReactOS
+;
+EXPORTS
+DriverEntry@8
+DxDdCleanupDxGraphics@0
+DxDdStartupDxGraphics@24
+
Propchange: branches/reactx/reactos/drivers/directx/dxg/dxg.def
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/reactx/reactos/drivers/directx/dxg/dxg.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/directx/…
==============================================================================
--- branches/reactx/reactos/drivers/directx/dxg/dxg.rbuild (original)
+++ branches/reactx/reactos/drivers/directx/dxg/dxg.rbuild Mon Oct 22 20:26:59 2007
@@ -1,7 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
-<module name="dxg" type="kernelmodedriver"
installbase="system32/drivers" installname="dxg.sys">
- <include base="dxg.sys">.</include>
+<module name="dxg" type="kernelmodedriver"
+installbase="system32/drivers" installname="dxg.sys">
+ <importlibrary definition="dxg.def" />
+ <include base="dxg">.</include>
<define name="__USE_W32API" />
<file>main.c</file>
<file>dxg.rc</file>
Modified: branches/reactx/reactos/drivers/directx/dxg/main.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/directx/…
==============================================================================
--- branches/reactx/reactos/drivers/directx/dxg/main.c (original)
+++ branches/reactx/reactos/drivers/directx/dxg/main.c Mon Oct 22 20:26:59 2007
@@ -10,14 +10,7 @@
*/
#include <ntddk.h>
-
-NTSTATUS
-GsDriverEntry(IN PVOID Context1,
- IN PVOID Context2)
-{
- /* NOTE : in windows it does a secure cookies check */
- return DriverEntry(Context1, Context2);
-}
+#include <dxg_int.h>
NTSTATUS
@@ -26,3 +19,127 @@
{
return 0;
}
+
+NTSTATUS
+APIENTRY
+DxDdStartupDxGraphics (ULONG SizeEngDrv,
+ PDRVENABLEDATA pDxEngDrv,
+ ULONG SizeDxgDrv,
+ PDRVENABLEDATA pDxgDrv,
+ PULONG DirectDrawContext,
+ PEPROCESS Proc )
+{
+#if 0
+ PDRVFN drv_func;
+
+ /* Test see if the data is vaild we got from win32k.sys */
+ if (size_EngDrv != sizeof(DRVENABLEDATA)) ||
+ (size_DXG_INDEX_API != sizeof(DRVENABLEDATA))
+ {
+ return STATUS_BUFFER_TOO_SMALL;
+ }
+
+ /* rest static value */
+ gpDummyPage = 0;
+ gcDummyPageRefCnt = 0;
+ ghsemDummyPage = 0;
+
+ /*
+ * Setup internal driver functions list we got from dxg driver functions list
+ */
+ pDxgDrv->iDriverVersion = 0x80000; /* Note 12/1-2004 : DirectX 8 ? */
+ pDxgDrv->c = gcDxgFuncs;
+ pDxgDrv->pdrvfn = gaDxgFuncs;
+
+ /* check how many driver functions and fail if the value does not match */
+ if (pDxEngDrv->c != DXENG_INDEX_DxEngLoadImage + 1)
+ {
+ return STATUS_INTERNAL_ERROR;
+ }
+
+ /*
+ * Check if all drv functions are sorted right
+ * and if it really are exported
+ */
+
+ for (i=1 ; i < DXENG_INDEX_DxEngLoadImage + 1; i++)
+ {
+ drv_func = &EngDrv->pdrvfn[i];
+
+ if ((drv_func->iFunc != i) ||
+ (drv_func->pfn == 0))
+ {
+ return STATUS_INTERNAL_ERROR;
+ }
+ }
+
+ gpEngFuncs = pDxEngDrv->pdrvfn;
+
+ /* Note 12/1-2004 : Why is this set to 0x618 */
+ *DirectDrawContext = 0x618;
+
+ if (DdHmgCreate())
+ {
+ ghsemDummyPage = EngCreateSemaphore();
+
+ if (ghsemDummyPage)
+ {
+ gpepSession = Proc;
+ return STATUS_SUCCESS;
+ }
+ }
+
+ DdHmgDestroy();
+
+ if (ghsemDummyPage)
+ {
+ EngDeleteSemaphore(ghsemDummyPage);
+ ghsemDummyPage = 0;
+ }
+#endif
+ return STATUS_NO_MEMORY;
+}
+
+NTSTATUS
+DxDdCleanupDxGraphics()
+{
+#if 0
+ DdHmgDestroy();
+
+ if (!ghsemDummyPage)
+ {
+ if (!gpDummyPage)
+ {
+ ExFreePoolWithTag(gpDummyPage,0);
+ gpDummyPage = 0;
+ gcDummyPageRefCnt = 0;
+ }
+ EngDeleteSemaphore(ghsemDummyPage)
+ }
+#endif
+ return 0;
+}
+
+BOOL
+DdHmgDestroy()
+{
+#if 0
+ ghFreeDdHmgr = 0;
+ gcMaxDdHmgr = 0;
+ gcSizeDdHmgr = 0;
+ gpentDdHmgrLast = 0;
+
+ if (gpentDdHmgr)
+ {
+ EngFreeMem(gpentDdHmgr);
+ gpentDdHmgr = 0;
+ }
+
+ if (ghsemHmgr)
+ {
+ EngDeleteSemaphore(ghsemHmgr);
+ }
+#endif
+ return TRUE;
+}
+