Commit 9f7907eb authored by Peter Ganten's avatar Peter Ganten Committed by Alexandre Julliard

Moved Wine private heap creation flags to other values.

Return system heap when a shared heap is requested.
parent 2e9f786d
...@@ -163,10 +163,14 @@ typedef struct _SINGLE_LIST_ENTRY { ...@@ -163,10 +163,14 @@ typedef struct _SINGLE_LIST_ENTRY {
#define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
#define HEAP_CREATE_ALIGN_16 0x00010000 #define HEAP_CREATE_ALIGN_16 0x00010000
#define HEAP_CREATE_ENABLE_TRACING 0x00020000 #define HEAP_CREATE_ENABLE_TRACING 0x00020000
#define HEAP_WINE_SEGPTR 0x01000000 /* Not a Win32 flag */
#define HEAP_WINE_CODESEG 0x02000000 /* Not a Win32 flag */ /* This flag allows it to create heaps shared by all processes under win95,
#define HEAP_WINE_CODE16SEG 0x04000000 /* Not a Win32 flag */ FIXME: correct name */
#define HEAP_WINE_SHARED 0x08000000 /* Not a Win32 flag */ #define HEAP_SHARED 0x04000000
#define HEAP_WINE_SEGPTR 0x10000000 /* Not a Win32 flag */
#define HEAP_WINE_CODESEG 0x20000000 /* Not a Win32 flag */
#define HEAP_WINE_CODE16SEG 0x40000000 /* Not a Win32 flag */
/* Processor feature flags. */ /* Processor feature flags. */
#define PF_FLOATING_POINT_PRECISION_ERRATA 0 #define PF_FLOATING_POINT_PRECISION_ERRATA 0
......
...@@ -430,7 +430,7 @@ static void HEAP_MakeInUseBlockFree( SUBHEAP *subheap, ARENA_INUSE *pArena ) ...@@ -430,7 +430,7 @@ static void HEAP_MakeInUseBlockFree( SUBHEAP *subheap, ARENA_INUSE *pArena )
/* Decommit the end of the heap */ /* Decommit the end of the heap */
if (!(subheap->heap->flags & HEAP_WINE_SHARED)) HEAP_Decommit( subheap, pFree + 1 ); if (!(subheap->heap->flags & HEAP_SHARED)) HEAP_Decommit( subheap, pFree + 1 );
} }
...@@ -469,7 +469,7 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags, ...@@ -469,7 +469,7 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags,
/* Commit memory */ /* Commit memory */
if (flags & HEAP_WINE_SHARED) if (flags & HEAP_SHARED)
commitSize = totalSize; /* always commit everything in a shared heap */ commitSize = totalSize; /* always commit everything in a shared heap */
if (!VirtualAlloc(address, commitSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE)) if (!VirtualAlloc(address, commitSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE))
{ {
...@@ -998,6 +998,11 @@ HANDLE WINAPI HeapCreate( ...@@ -998,6 +998,11 @@ HANDLE WINAPI HeapCreate(
) { ) {
SUBHEAP *subheap; SUBHEAP *subheap;
if ( flags & HEAP_SHARED ) {
FIXME ( "Shared Heap requested, returning system heap.\n" );
return SystemHeap;
}
/* Allocate the heap block */ /* Allocate the heap block */
if (!maxSize) if (!maxSize)
...@@ -1039,6 +1044,11 @@ BOOL WINAPI HeapDestroy( HANDLE heap /* [in] Handle of heap */ ) ...@@ -1039,6 +1044,11 @@ BOOL WINAPI HeapDestroy( HANDLE heap /* [in] Handle of heap */ )
HEAP *heapPtr = HEAP_GetPtr( heap ); HEAP *heapPtr = HEAP_GetPtr( heap );
SUBHEAP *subheap; SUBHEAP *subheap;
if ( heap == SystemHeap ) {
FIXME ( "attempt to destroy system heap, returning TRUE!\n" );
return TRUE;
}
TRACE("%08x\n", heap ); TRACE("%08x\n", heap );
if (!heapPtr) return FALSE; if (!heapPtr) return FALSE;
...@@ -1570,7 +1580,7 @@ BOOL HEAP_CreateSystemHeap(void) ...@@ -1570,7 +1580,7 @@ BOOL HEAP_CreateSystemHeap(void)
if (created) /* newly created heap */ if (created) /* newly created heap */
{ {
HEAP_InitSubHeap( heapPtr, heapPtr, HEAP_WINE_SHARED, 0, HEAP_DEF_SIZE ); HEAP_InitSubHeap( heapPtr, heapPtr, HEAP_SHARED, 0, HEAP_DEF_SIZE );
HeapLock( heap ); HeapLock( heap );
descr = heapPtr->private = HeapAlloc( heap, HEAP_ZERO_MEMORY, sizeof(*descr) ); descr = heapPtr->private = HeapAlloc( heap, HEAP_ZERO_MEMORY, sizeof(*descr) );
assert( descr ); assert( descr );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment