Author: greatlrd
Date: Sun Mar 2 12:19:08 2008
New Revision: 32545
URL: http://svn.reactos.org/svn/reactos?rev=3D32545&view=3Drev
Log:
Fixed all known issue with DdCreateSurface in gdi32, it works with more tha=
t one surface now.
Modified:
trunk/reactos/dll/win32/gdi32/misc/gdientry.c
Modified: trunk/reactos/dll/win32/gdi32/misc/gdientry.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/=
gdientry.c?rev=3D32545&r1=3D32544&r2=3D32545&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/reactos/dll/win32/gdi32/misc/gdientry.c (original)
+++ trunk/reactos/dll/win32/gdi32/misc/gdientry.c Sun Mar 2 12:19:08 2008
@@ -274,11 +274,11 @@
(PDD_CANCREATESURFACEDATA)CanCreateSurf=
ace);
}
=
-
-
-
-
-/* TODO : finish all fixme */ =
+/*
+ * @implemented
+ *
+ * DdCreateSurface
+ */
DWORD
WINAPI
DdCreateSurface(LPDDHAL_CREATESURFACEDATA pCreateSurface)
@@ -301,6 +301,24 @@
PHANDLE phSurface =3D NULL, puhSurface =3D NULL;
ULONG i;
LPDDSURFACEDESC pSurfaceDesc =3D NULL;
+
+ /* TODO : Speed optimze, most games/dx apps/program does not want 1 su=
rface, they want lest 2
+ * so we need incress the stack so it can contain 2 surface instead of=
one, this will incress =
+ * the speed of the apps when it trying alloc buffer. How to incress t=
he surface stack space
+ * we need create a own struct for DD_SURFACE_LOCAL DdSurfaceLocal, DD=
_SURFACE_MORE DdSurfaceMore
+ * DD_SURFACE_GLOBAL DdSurfaceGlobal. HANDLE hPrevSurface, hSurface. l=
ike
+ * struct { DD_SURFACE_LOCAL DdSurfaceLocal1, DD_SURFACE_LOCAL DdSurfa=
ceLocal2 }
+ * lest so it contain two surface. maybe 4. we need watch what is most=
common here before =
+ * we create the size activate this IF when you start doing the optim=
ze and please also
+ * take report from user which value they got here
+ */ =
+#if 0
+ {
+ char buffer[1024]; \
+ sprintf ( buffer, "Function %s : Optimze max to %d Surface ? (%s:%=
d)\n", __FUNCTION__,SurfaceCount,__FILE__,__LINE__ );
+ OutputDebugStringA(buffer);
+ }
+#endif
=
/* Check how many surfaces there are */
if (SurfaceCount !=3D 1)
@@ -475,12 +493,11 @@
lcl->lpSurfMore->ddsCapsEx.dwCaps3 =3D ptmpDdSurfaceMore->=
ddsCapsEx.dwCaps3;
lcl->lpSurfMore->ddsCapsEx.dwCaps4 =3D ptmpDdSurfaceMore->=
ddsCapsEx.dwCaps4;
}
- /* FIXME count to next SurfaceCount for
- ptmpDdSurfaceGlobal =3D pDdSurfaceGlobal;
- ptmpDdSurfaceLocal =3D pDdSurfaceLocal;
- ptmpDdSurfaceMore =3D pDdSurfaceMore;
- we only support one surface create at moment
- */
+
+ /* count to next SurfaceCount */
+ ptmpDdSurfaceGlobal =3D (PDD_SURFACE_GLOBAL) (((PBYTE) ((ULONG=
_PTR) ptmpDdSurfaceGlobal)) + sizeof(DD_SURFACE_GLOBAL));
+ ptmpDdSurfaceLocal =3D (PDD_SURFACE_LOCAL) (((PBYTE) ((ULONG_P=
TR) ptmpDdSurfaceLocal)) + sizeof(DD_SURFACE_LOCAL));
+ ptmpDdSurfaceMore =3D (PDD_SURFACE_MORE) (((PBYTE) ((ULONG_PTR=
) ptmpDdSurfaceMore)) + sizeof(DD_SURFACE_MORE));
}
}
=
Author: jimtabor
Date: Wed Mar 26 20:41:27 2008
New Revision: 32771
URL: http://svn.reactos.org/svn/reactos?rev=32771&view=rev
Log:
Question is what is its?
Modified:
trunk/reactos/ntoskrnl/ex/handle.c
Modified: trunk/reactos/ntoskrnl/ex/handle.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/handle.c?rev=3…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] Wed Mar 26 20:41:27 2008
@@ -874,7 +874,7 @@
for (;;)
{
/* Get the current value and check if it's locked */
- OldValue = *(volatile LONG_PTRits *)&HandleTableEntry->Object;
+ OldValue = *(volatile LONG_PTR *)&HandleTableEntry->Object;
if (OldValue & EXHANDLE_TABLE_ENTRY_LOCK_BIT)
{
/* It's not locked, remove the lock bit to lock it */
Author: hyperion
Date: Wed Mar 26 20:13:24 2008
New Revision: 32770
URL: http://svn.reactos.org/svn/reactos?rev=32770&view=rev
Log:
Fix some serious handle table bugs which led to memory corruption and stale values (which led to more memory corruption). Patch by Alex Ionescu.
Modified:
trunk/reactos/ntoskrnl/ex/handle.c
Modified: trunk/reactos/ntoskrnl/ex/handle.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/handle.c?rev=3…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/handle.c [iso-8859-1] Wed Mar 26 20:13:24 2008
@@ -17,7 +17,7 @@
LIST_ENTRY HandleTableListHead;
EX_PUSH_LOCK HandleTableListLock;
-#define SizeOfHandle(x) (sizeof(HANDLE) * x)
+#define SizeOfHandle(x) (sizeof(HANDLE) * (x))
/* PRIVATE FUNCTIONS *********************************************************/
@@ -43,11 +43,11 @@
/* Clear the tag bits and check what the next handle is */
Handle.TagBits = 0;
- NextHandle = HandleTable->NextHandleNeedingPool;
+ NextHandle = *(volatile ULONG*)&HandleTable->NextHandleNeedingPool;
if (Handle.Value >= NextHandle) return NULL;
/* Get the table code */
- TableBase = (ULONG_PTR)HandleTable->TableCode;
+ TableBase = *(volatile ULONG_PTR*)&HandleTable->TableCode;
/* Extract the table level and actual table base */
TableLevel = (ULONG)(TableBase & 3);
@@ -734,7 +734,7 @@
ExAcquirePushLockShared(&HandleTable->HandleTableLock[i]);
/* Check if the value changed after acquiring the lock */
- if (OldValue != HandleTable->FirstFree)
+ if (OldValue != *(volatile ULONG*)&HandleTable->FirstFree)
{
/* It did, so try again */
ExReleasePushLockShared(&HandleTable->HandleTableLock[i]);
@@ -743,7 +743,7 @@
}
/* Now get the next value and do the compare */
- NewValue = Entry->NextFreeTableEntry;
+ NewValue = *(volatile ULONG*)&Entry->NextFreeTableEntry;
NewValue1 = InterlockedCompareExchange((PLONG) &HandleTable->FirstFree,
NewValue,
OldValue);
@@ -874,7 +874,7 @@
for (;;)
{
/* Get the current value and check if it's locked */
- OldValue = (LONG_PTR)HandleTableEntry->Object;
+ OldValue = *(volatile LONG_PTRits *)&HandleTableEntry->Object;
if (OldValue & EXHANDLE_TABLE_ENTRY_LOCK_BIT)
{
/* It's not locked, remove the lock bit to lock it */