Author: greatlrd
Date: Fri Dec 3 15:24:15 2010
New Revision: 49928
URL:
http://svn.reactos.org/svn/reactos?rev=49928&view=rev
Log:
DdHmgCreate(VOID)
Bugfix the delay value
DdHmgLock
Cleanup it a bit, not fixed all bug yet
Modified:
branches/reactx/reactos/drivers/directx/dxg/ddhmg.c
branches/reactx/reactos/drivers/directx/dxg/historic.c
branches/reactx/reactos/drivers/directx/dxg/main.c
Modified: branches/reactx/reactos/drivers/directx/dxg/ddhmg.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/directx/…
==============================================================================
--- branches/reactx/reactos/drivers/directx/dxg/ddhmg.c [iso-8859-1] (original)
+++ branches/reactx/reactos/drivers/directx/dxg/ddhmg.c [iso-8859-1] Fri Dec 3 15:24:15
2010
@@ -10,6 +10,10 @@
#include <dxg_int.h>
+#define GET_DHMG_INDEX(xxhandle) ((DWORD)(DWORD_PTR)xxhandle & 0x1FFFFF)
+#define GET_DHMG_ENTRY(index) (PDD_ENTRY)((PBYTE)gpentDdHmgr + (sizeof(DD_ENTRY) *
index))
+
+
/* The DdHmgr manger stuff */
ULONG gcSizeDdHmgr = 64 * sizeof(DD_ENTRY);
PDD_ENTRY gpentDdHmgr = NULL;
@@ -19,15 +23,6 @@
HANDLE ghFreeDdHmgr = 0;
HSEMAPHORE ghsemHmgr = NULL;
-
-BOOL
-FASTCALL
-VerifyObjectOwner(PDD_ENTRY pEntry)
-{
- DWORD Pid = (DWORD)(DWORD_PTR)PsGetCurrentProcessId() & 0xFFFFFFFC;
- DWORD check = pEntry->ObjectOwner.ulObj & 0xFFFFFFFE;
- return ( (check == Pid) || (!check));
-}
/*++
* @name DdHmgCreate
@@ -61,6 +56,7 @@
if (gpLockShortDelay)
{
gpLockShortDelay->HighPart = -1;
+ gpLockShortDelay->LowPart = -100000;
return TRUE;
}
@@ -144,32 +140,26 @@
FASTCALL
DdHmgLock(HANDLE DdHandle, UCHAR ObjectType, BOOLEAN LockOwned)
{
+ DWORD Index = GET_DHMG_INDEX(DdHandle);
+ PDD_ENTRY pEntry = NULL;
+ PDD_ENTRY Object = NULL;
- DWORD Index = (DWORD)(DWORD_PTR)DdHandle & 0x1FFFFF;
- PDD_ENTRY pEntry = NULL;
- PVOID Object = NULL;
-
- if ( !LockOwned )
+ if ( LockOwned )
{
EngAcquireSemaphore(ghsemHmgr);
}
if ( Index < gcMaxDdHmgr )
{
- pEntry = (PDD_ENTRY)((PBYTE)gpentDdHmgr + (sizeof(DD_ENTRY) * Index));
- if ( VerifyObjectOwner(pEntry) )
+ pEntry = GET_DHMG_ENTRY(Index);
+
+ if ( (pEntry->Objt == ObjectType ) &&
+ (pEntry->FullUnique == (((DWORD)DdHandle >> 21) & 0x7FF) )
&&
+ (pEntry->pobj->cExclusiveLock == 0) &&
+ (pEntry->pobj->Tid == PsGetCurrentThread()) )
{
- /* FIXME
- if ( (pEntry->Objt == ObjectType ) &&
- (pEntry->FullUnique == (((DWORD)DdHandle >> 21) & 0x7FF) )
&&
- (pEntry->pobj->cExclusiveLock == 0) &&
- (pEntry->pobj->Tid == PsGetCurrentThread()))
- {
- InterlockedIncrement(&pEntry->pobj->cExclusiveLock);
- pEntry->pobj->Tid = PsGetCurrentThread();
- Object = pEntry->pobj;
- }
- */
+ // FIXME InterlockedIncrement(&pEntry->pobj->cExclusiveLock);
+ Object = pEntry;
}
}
@@ -180,3 +170,4 @@
return Object;
}
+
Modified: branches/reactx/reactos/drivers/directx/dxg/historic.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/directx/…
==============================================================================
--- branches/reactx/reactos/drivers/directx/dxg/historic.c [iso-8859-1] (original)
+++ branches/reactx/reactos/drivers/directx/dxg/historic.c [iso-8859-1] Fri Dec 3
15:24:15 2010
@@ -7,6 +7,7 @@
* PROGRAMER: Magnus olsen (magnus(a)greatlord.com)
* REVISION HISTORY:
* 15/10-2007 Magnus Olsen
+ * 20/11-2010 Magnus Olsen All function match windows7
*/
#include <dxg_int.h>
@@ -39,7 +40,7 @@
* Always returns DDHAL_DRIVER_NOTHANDLED
*
* @remarks.
-* This function is no longer used in Windows NT 2000/XP/2003
+* This function is no longer used in Windows NT 2000/XP/2003/2008/7
*
*--*/
DWORD
@@ -74,7 +75,7 @@
* Always returns DDERR_UNSUPPORTED
*
* @remarks.
-* This function is no longer used in Windows NT 2000/XP/2003
+* This function is no longer used in Windows NT 2000/XP/2003/2008/7
*
*--*/
DWORD
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 [iso-8859-1] (original)
+++ branches/reactx/reactos/drivers/directx/dxg/main.c [iso-8859-1] Fri Dec 3 15:24:15
2010
@@ -11,6 +11,8 @@
#include <dxg_int.h>
#include "dxg_driver.h"
+
+#define DXG_DRIVER_VERSION 0x80000
LONG gcDummyPageRefCnt = 0;
HSEMAPHORE ghsemDummyPage = NULL;
@@ -28,7 +30,7 @@
DriverEntry(IN PVOID Context1,
IN PVOID Context2)
{
- return 0;
+ return STATUS_SUCCESS;
}
NTSTATUS
@@ -59,7 +61,7 @@
/*
* Setup internal driver functions list we got from dxg driver functions list
*/
- pDxgDrv->iDriverVersion = 0x80000; /* Note 12/1-2004 : DirectX 8 ? */
+ pDxgDrv->iDriverVersion = DXG_DRIVER_VERSION;
pDxgDrv->c = gcDxgFuncs;
pDxgDrv->pdrvfn = gaDxgFuncs;
@@ -133,6 +135,6 @@
ghsemDummyPage = 0;
}
- return 0;
+ return STATUS_SUCCESS;
}