Author: greatlrd
Date: Fri Dec 10 11:08:37 2010
New Revision: 50002
URL: http://svn.reactos.org/svn/reactos?rev=50002&view=rev
Log:
intEnableReactXDriver
Primary surface have been rewriten in win32k
ppdev does not alloc edd_directx_global struct
any more, that is not a problem we doing it here
instead. it alloc it when it is need it. not before
Modified:
branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddraw.c
Modified: branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddraw.c
URL: http://svn.reactos.org/svn/reactos/branches/reactx/reactos/subsystems/win32…
==============================================================================
--- branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddraw.c [iso-8859-1] (original)
+++ branches/reactx/reactos/subsystems/win32/win32k/ntddraw/ddraw.c [iso-8859-1] Fri Dec 10 11:08:37 2010
@@ -39,8 +39,6 @@
PGD_DXDDENABLEDIRECTDRAW pfnDdEnableDirectDraw = NULL;
BOOL success = FALSE;
- /* FIXME get the process data */
-
/* Do not try load dxg.sys when it have already been load once */
if (gpfnStartupDxGraphics == NULL)
{
@@ -60,6 +58,20 @@
}
pDev = pDC->ppdev;
+
+ /* This code should be where primary surface is create
+ but we save some memory use to alloc it when it is need it */
+ if (pDev->pEDDgpl == NULL)
+ {
+ pDev->pEDDgpl = ExAllocatePoolWithTag(PagedPool, sizeof(EDD_DIRECTDRAW_GLOBAL), TAG_EDDGBL);
+ if (!pDev->pEDDgpl)
+ {
+ DPRINT1("Warning : Failed to allocate memmory for EDD_DIRECTDRAW_GLOBAL\n");
+ DC_UnlockDc(pDC);
+ return FALSE;
+ }
+ RtlZeroMemory( pDev->pEDDgpl ,sizeof(EDD_DIRECTDRAW_GLOBAL));
+ }
/* test see if drv got a dx interface or not */
if ( ( pDev->DriverFunctions.DisableDirectDraw == NULL) ||
@@ -69,8 +81,7 @@
}
else
{
-
- /* CHeck see if dx have been enable or not */
+ /* Check see if dx have been enable or not */
if ( pDev->pEDDgpl->pvmList == NULL)
{
pDev->pEDDgpl->ddCallbacks.dwSize = sizeof(DD_CALLBACKS);
@@ -98,7 +109,6 @@
success = TRUE;
}
}
-
DPRINT1("Return value : 0x%08x\n",success);
DC_UnlockDc(pDC);
Author: fireball
Date: Fri Dec 10 09:33:20 2010
New Revision: 50000
URL: http://svn.reactos.org/svn/reactos?rev=50000&view=rev
Log:
[HEAP]
- Time has come to get rid of a slightly modified implementation of WINE's heap, which is a hack based on Windows 95's heap implementation, itself a hack of DOS memory management. It supported 3 out of the 18 possible NT Heap Flags, did not support custom allocation/deallocation routines, and was about 50-80x slower with fragmentation rates up to 500x higher when compared to NT's LFH (WINE is lucky because the advanced NT Heap features are used in kernel-mode usually, not in user-mode, and they are crossing their fingers for this being the same). Several high-end SQL/Database applications would significantly benefit from custom heap features provided by NT. Not to say about removing crappy support for a custom Commit routine and crappy support for User-defined flags and the User-defined value.
- So, the glorious moment for a new heap manager, which is (to remind you) a totally new heap manager, resembling real NT heap manager, based on data structures similar to Windows 2003 and Vista+'s heap structures, supporting advanced heap flags (e.g. useful for debugging), having substantially lower fragmentation rates (and thus speed and reliability), having native support for user-defined flags and user-defined values, also native support for a custom commit routine, which is very important for trunk's win32 subsystem. It also reserves, commits, decommits and frees memory on the fly, unlike existing heap manager which prefers to reserve and commit as much as possible, and doesn't decommit when it's no longer necessary. Not to say about support for per process heaps, with a proper lock, and a further support for a special so-called debug heap allocator (to be implemented in heapdbg.c) which will be useful for finding heap corruptions.
Yeah, I'm not a fun person :D
Added:
trunk/reactos/lib/rtl/heap.c
- copied unchanged from r49999, trunk/reactos/lib/rtl/heap_rewrite.c
Removed:
trunk/reactos/lib/rtl/heap_rewrite.c
[This mail would be too long, it was shortened to contain the URLs only.]
Removed: trunk/reactos/lib/rtl/heap_rewrite.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/heap_rewrite.c?rev…