mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
add complete startup process code for dxg.sys
svn path=/branches/reactx/; revision=29848
This commit is contained in:
parent
3cc2abdc0a
commit
19462f737c
5 changed files with 67 additions and 9 deletions
|
@ -6,7 +6,9 @@ installbase="system32/drivers" installname="dxg.sys">
|
|||
<include base="dxg">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<library>dxgthk</library>
|
||||
<library>ntoskrnl</library>
|
||||
<file>main.c</file>
|
||||
<file>eng.c</file>
|
||||
<file>historic.c</file>
|
||||
<file>dxg.rc</file>
|
||||
</module>
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <reactos/drivers/directx/dxg.h>
|
||||
#include <reactos/drivers/directx/dxeng.h>
|
||||
|
||||
#include "tags.h"
|
||||
|
||||
|
||||
/* exported functions */
|
||||
NTSTATUS DriverEntry(IN PVOID Context1, IN PVOID Context2);
|
||||
|
@ -39,5 +41,6 @@ DWORD STDCALL DxDxgGenericThunk(ULONG_PTR ulIndex, ULONG_PTR ulHandle, SIZE_T *p
|
|||
DWORD STDCALL DxDdIoctl(ULONG ulIoctl, PVOID pBuffer, ULONG ulBufferSize);
|
||||
|
||||
/* Internel functions */
|
||||
BOOL DdHmgCreate();
|
||||
BOOL DdHmgDestroy();
|
||||
|
||||
|
|
14
reactos/drivers/directx/dxg/eng.c
Normal file
14
reactos/drivers/directx/dxg/eng.c
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* PURPOSE: Native driver for dxg implementation
|
||||
* FILE: drivers/directx/dxg/main.c
|
||||
* PROGRAMER: Magnus olsen (magnus@greatlord.com)
|
||||
* REVISION HISTORY:
|
||||
* 15/10-2007 Magnus Olsen
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -20,6 +20,11 @@ HSEMAPHORE ghsemHmgr = NULL;
|
|||
HSEMAPHORE ghsemDummyPage = NULL;
|
||||
VOID *gpDummyPage = NULL;
|
||||
PEPROCESS gpepSession = NULL;
|
||||
PLARGE_INTEGER gpLockShortDelay = NULL;
|
||||
HANDLE ghFreeDdHmgr = 0;
|
||||
VOID *gpentDdHmgr = NULL;
|
||||
VOID *gpentDdHmgrLast = NULL;
|
||||
|
||||
|
||||
PDRVFN gpEngFuncs;
|
||||
const ULONG gcDxgFuncs = DXG_INDEX_DxDdIoctl + 1;
|
||||
|
@ -92,7 +97,6 @@ DxDdStartupDxGraphics (ULONG SizeEngDrv,
|
|||
/* Note 12/1-2004 : Why is this set to 0x618 */
|
||||
*DirectDrawContext = 0x618;
|
||||
|
||||
#if 0
|
||||
if (DdHmgCreate())
|
||||
{
|
||||
ghsemDummyPage = EngCreateSemaphore();
|
||||
|
@ -103,7 +107,6 @@ DxDdStartupDxGraphics (ULONG SizeEngDrv,
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
DdHmgDestroy();
|
||||
|
||||
|
@ -119,16 +122,13 @@ DxDdStartupDxGraphics (ULONG SizeEngDrv,
|
|||
NTSTATUS
|
||||
DxDdCleanupDxGraphics()
|
||||
{
|
||||
|
||||
DdHmgDestroy();
|
||||
|
||||
if (!ghsemDummyPage)
|
||||
{
|
||||
if (!gpDummyPage)
|
||||
{
|
||||
#if 0
|
||||
ExFreePoolWithTag(gpDummyPage,0);
|
||||
#endif
|
||||
gpDummyPage = NULL;
|
||||
gcDummyPageRefCnt = 0;
|
||||
}
|
||||
|
@ -143,16 +143,15 @@ DdHmgDestroy()
|
|||
{
|
||||
gcMaxDdHmgr = 0;
|
||||
gcSizeDdHmgr = 0;
|
||||
#if 0
|
||||
ghFreeDdHmgr = 0;
|
||||
gpentDdHmgrLast = 0;
|
||||
gpentDdHmgrLast = NULL;
|
||||
|
||||
if (gpentDdHmgr)
|
||||
{
|
||||
EngFreeMem(gpentDdHmgr);
|
||||
gpentDdHmgr = 0;
|
||||
gpentDdHmgr = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ghsemHmgr)
|
||||
{
|
||||
EngDeleteSemaphore(ghsemHmgr);
|
||||
|
@ -162,3 +161,35 @@ DdHmgDestroy()
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
DdHmgCreate()
|
||||
{
|
||||
gpentDdHmgr = EngAllocMem(FL_ZERO_MEMORY, gcSizeDdHmgr, TAG_THDD);
|
||||
ghFreeDdHmgr = 0;
|
||||
gcMaxDdHmgr = 1;
|
||||
|
||||
if (gpentDdHmgr)
|
||||
{
|
||||
ghsemHmgr = EngCreateSemaphore();
|
||||
|
||||
if (ghsemHmgr)
|
||||
{
|
||||
gpLockShortDelay = EngAllocMem(FL_ZERO_MEMORY | FL_NONPAGED_MEMORY, sizeof(LARGE_INTEGER), TAG_GINI);
|
||||
|
||||
if (gpLockShortDelay)
|
||||
{
|
||||
gpLockShortDelay->QuadPart = ((LONGLONG)-100000);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
EngDeleteSemaphore(ghsemHmgr);
|
||||
ghsemHmgr = NULL;
|
||||
}
|
||||
|
||||
EngFreeMem(gpentDdHmgr);
|
||||
gpentDdHmgr = NULL;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
8
reactos/drivers/directx/dxg/tags.h
Normal file
8
reactos/drivers/directx/dxg/tags.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
|
||||
|
||||
#define TAG_THDD TAG('t', 'h', 'd', 'd')
|
||||
#define TAG_GINI TAG('G', 'i', 'n', 'i')
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue