Ignore:
Timestamp:
Jan 22, 2001, 7:26:52 PM (25 years ago)
Author:
sandervl
Message:

memory map + handle manager fixes

File:
1 edited

Legend:

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

    r4230 r5011  
    1 /* $Id: hmmmap.cpp,v 1.15 2000-09-10 21:54:06 sandervl Exp $ */
     1/* $Id: hmmmap.cpp,v 1.16 2001-01-22 18:26:51 sandervl Exp $ */
    22
    33/*
     
    5656                                             DWORD size_high, /* [in] High-order 32 bits of object size */
    5757                                             DWORD size_low,  /* [in] Low-order 32 bits of object size */
    58                                              LPCSTR name,     /* [in] Name of file-mapping object */
    59                                              HFILE *hOldMap)  // if create an existing memmap, return handle of old one
     58                                             LPCSTR name)     /* [in] Name of file-mapping object */
    6059{
    6160 Win32MemMap *map;
     
    9594        //Is it allowed to open an existing view with different flags?
    9695        //(i.e. write access to readonly object)
    97         //Return handle of existing file mapping
    98         dprintf(("CreateFileMapping: Return handle of existing file mapping %s", name));
     96        dprintf(("CreateFileMapping: duplicate handle of existing file mapping %s", name));
     97
     98        //if map already exists, we must create a new handle to the existing
     99        //map object and return ERROR_ALREADY_EXISTS
    99100        map->AddRef();
    100         *hOldMap = map->getMapHandle();
    101         return ERROR_ALREADY_EXISTS;
     101        pHMHandleData->dwUserData = (ULONG)map;
     102        pHMHandleData->dwInternalType = HMTYPE_MEMMAP;
     103        return ERROR_ALREADY_EXISTS;
    102104  }
    103105  else {
     
    109111        }
    110112
    111         if(map->Init(pHMHandleData->hHMHandle) == FALSE) {
     113        if(map->Init() == FALSE) {
    112114                dprintf(("CreateFileMappingA: init failed!"));
    113115                delete map;
     
    218220  //view of the file is unmapped.
    219221  map = (Win32MemMap *)pHMHandleData->dwUserData;
    220   map->close();
     222  map->Release();
    221223
    222224  return NO_ERROR;
Note: See TracChangeset for help on using the changeset viewer.