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 {
#define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
#define HEAP_CREATE_ALIGN_16 0x00010000
#define HEAP_CREATE_ENABLE_TRACING 0x00020000
#define HEAP_WINE_SEGPTR 0x01000000 /* Not a Win32 flag */
#define HEAP_WINE_CODESEG 0x02000000 /* Not a Win32 flag */
#define HEAP_WINE_CODE16SEG 0x04000000 /* Not a Win32 flag */
#define HEAP_WINE_SHARED 0x08000000 /* Not a Win32 flag */
/* This flag allows it to create heaps shared by all processes under win95,
FIXME: correct name */
#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. */
#define PF_FLOATING_POINT_PRECISION_ERRATA 0
......
......@@ -430,7 +430,7 @@ static void HEAP_MakeInUseBlockFree( SUBHEAP *subheap, ARENA_INUSE *pArena )
/* 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,
/* Commit memory */
if (flags & HEAP_WINE_SHARED)
if (flags & HEAP_SHARED)
commitSize = totalSize; /* always commit everything in a shared heap */
if (!VirtualAlloc(address, commitSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE))
{
......@@ -998,6 +998,11 @@ HANDLE WINAPI HeapCreate(
) {
SUBHEAP *subheap;
if ( flags & HEAP_SHARED ) {
FIXME ( "Shared Heap requested, returning system heap.\n" );
return SystemHeap;
}
/* Allocate the heap block */
if (!maxSize)
......@@ -1039,6 +1044,11 @@ BOOL WINAPI HeapDestroy( HANDLE heap /* [in] Handle of heap */ )
HEAP *heapPtr = HEAP_GetPtr( heap );
SUBHEAP *subheap;
if ( heap == SystemHeap ) {
FIXME ( "attempt to destroy system heap, returning TRUE!\n" );
return TRUE;
}
TRACE("%08x\n", heap );
if (!heapPtr) return FALSE;
......@@ -1570,7 +1580,7 @@ BOOL HEAP_CreateSystemHeap(void)
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 );
descr = heapPtr->private = HeapAlloc( heap, HEAP_ZERO_MEMORY, sizeof(*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