Changeset 684 for trunk/src


Ignore:
Timestamp:
Aug 25, 1999, 1:40:18 PM (26 years ago)
Author:
sandervl
Message:

Memory mapping changes

Location:
trunk/src/kernel32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/makefile

    r678 r684  
    1 # $Id: makefile,v 1.30 1999-08-25 10:28:40 sandervl Exp $
     1# $Id: makefile,v 1.31 1999-08-25 11:40:18 sandervl Exp $
    22
    33#
     
    305305        $(PDWIN32_INCLUDE)\unicode.h
    306306
    307 virtual.obj:   virtual.cpp $(PDWIN32_INCLUDE)\win\virtual.h $(PDWIN32_INCLUDE)\handlemanager.h
     307virtual.obj:   virtual.cpp $(PDWIN32_INCLUDE)\win\virtual.h $(PDWIN32_INCLUDE)\handlemanager.h mmap.h
    308308mmap.obj:      mmap.cpp mmap.h $(PDWIN32_INCLUDE)\vmutex.h
    309309
  • trunk/src/kernel32/mmap.cpp

    r678 r684  
    1 /* $Id: mmap.cpp,v 1.9 1999-08-25 10:28:40 sandervl Exp $ */
     1/* $Id: mmap.cpp,v 1.10 1999-08-25 11:40:18 sandervl Exp $ */
    22
    33/*
     
    254254        goto parmfail;
    255255
     256  if(cbFlush == 0)
     257        cbFlush = mSize;
     258
    256259  if(lpvBase < pMapping || (ULONG)lpvBase+cbFlush > (ULONG)pMapping+mSize)
    257260        goto parmfail;
     
    259262  if(mProtFlags & PAGE_READONLY)
    260263        goto parmfail;
     264
     265  if(hMemFile == -1)
     266        goto success; //TODO: Return an error here?
    261267
    262268  nrpages = cbFlush/PAGE_SIZE;
     
    293299        }
    294300  }
     301success:
    295302//  mapMutex.leave();
    296303  return TRUE;
  • trunk/src/kernel32/virtual.cpp

    r678 r684  
    1 /* $Id: virtual.cpp,v 1.4 1999-08-25 10:28:41 sandervl Exp $ */
     1/* $Id: virtual.cpp,v 1.5 1999-08-25 11:40:18 sandervl Exp $ */
    22
    33/*
     
    2020#include <heapstring.h>
    2121#include <handlemanager.h>
     22#include "mmap.h"
    2223
    2324/***********************************************************************
     
    144145)
    145146{
    146     dprintf(("FlushViewOfFile: NOT IMPLEMENTED"));
    147     return TRUE;
     147 Win32MemMap *map;
     148
     149    if (!base)
     150    {
     151        SetLastError( ERROR_INVALID_PARAMETER );
     152        return FALSE;
     153    }
     154    map = Win32MemMap::findMap((ULONG)base);
     155    if(map == NULL) {
     156        SetLastError( ERROR_FILE_NOT_FOUND );
     157        return FALSE;
     158    }
     159    return map->flushView((LPVOID)base, cbFlush);
    148160}
    149161
     
    163175)
    164176{
     177 Win32MemMap *map;
     178
    165179    if (!addr)
    166180    {
     
    168182        return FALSE;
    169183    }
    170     return TRUE;
     184    map = Win32MemMap::findMap((ULONG)addr);
     185    if(map == NULL) {
     186        SetLastError( ERROR_FILE_NOT_FOUND );
     187        return FALSE;
     188    }
     189    return map->unmapViewOfFile();
    171190}
    172191
Note: See TracChangeset for help on using the changeset viewer.