Ignore:
Timestamp:
May 20, 2002, 3:47:59 PM (23 years ago)
Author:
sandervl
Message:

DF: Removed 64 MB memory mapped file limit & Fix for opening memory mapped file with size larger than the file size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/mmap.cpp

    r8203 r8456  
    1 /* $Id: mmap.cpp,v 1.55 2002-04-07 15:44:11 sandervl Exp $ */
     1/* $Id: mmap.cpp,v 1.56 2002-05-20 13:47:59 sandervl Exp $ */
    22
    33/*
     
    105105//******************************************************************************
    106106//******************************************************************************
    107 BOOL Win32MemMap::Init()
     107BOOL Win32MemMap::Init(DWORD aMSize)
    108108{
    109109    mapMutex.enter();
     
    134134            goto fail;
    135135        }
     136        if (mSize < aMSize)
     137        {
     138            dprintf(("Win32MemMap::init: file size %d, memory map size %d", mSize, aMSize));
     139            //Froloff: Need to check if exist the possibility of file to memory
     140            //         mapping not from the beginning of file
     141            mSize = SetFilePointer(hMemFile, aMSize, NULL, FILE_BEGIN);
     142            // Commit filesize changes onto disk
     143            SetEndOfFile(hMemFile);
     144        }
     145#if 0
    136146        //SvL: Temporary limitation of size (Warp Server Advanced doesn't allow
    137147        //     one to reserve more than 450 MB (unless you override the virtual
     
    140150            mSize = 64*1024*1024;
    141151        }
     152#endif
    142153    }
    143154
     
    611622    //Named file mappings from other processes are always shared;
    612623    //map into our address space
    613     if(map->getMemName() != NULL && map->getProcessId() != mProcessId) 
     624    if(map->getMemName() != NULL && map->getProcessId() != mProcessId)
    614625    {
    615626        //shared memory map, so map it into our address space
     
    756767    }
    757768    while(view);
    758  
     769
    759770    //failure if we get here
    760771    view = NULL;
Note: See TracChangeset for help on using the changeset viewer.