Ignore:
Timestamp:
Aug 25, 1999, 12:28:41 PM (26 years ago)
Author:
sandervl
Message:

Put back handlemanager changes + memory mapped file changes

File:
1 edited

Legend:

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

    r673 r678  
    1 /* $Id: virtual.cpp,v 1.3 1999-08-25 08:55:19 phaller Exp $ */
     1/* $Id: virtual.cpp,v 1.4 1999-08-25 10:28:41 sandervl Exp $ */
    22
    33/*
     
    1919#include <win\virtual.h>
    2020#include <heapstring.h>
    21 #include "mmap.h"
    2221#include <handlemanager.h>
    2322
     
    3938                LPCSTR name      /* [in] Name of file-mapping object */ )
    4039{
    41   return HMCreateFileMapping(hFile, sa, protect, size_high, size_low, name);
     40   return HMCreateFileMapping(hFile, sa, protect, size_high, size_low, name);
    4241}
    4342
     
    4746 * See CreateFileMapping32A
    4847 */
    49 HANDLE WINAPI CreateFileMappingW( HFILE hFile, LPSECURITY_ATTRIBUTES attr,
    50                                       DWORD protect, DWORD size_high,
     48HANDLE WINAPI CreateFileMappingW( HFILE hFile, LPSECURITY_ATTRIBUTES attr, 
     49                                      DWORD protect, DWORD size_high, 
    5150                                      DWORD size_low, LPCWSTR name )
    5251{
     
    7271                LPCSTR name )   /* [in] Name of file-mapping object */
    7372{
    74   return (HMOpenFileMapping(access, inherit, name));
     73    dprintf(("OpenFileMappingA: %x %d %s", access, inherit, name));
     74    return HMOpenFileMapping(access, inherit, name);
    7575}
    7676
     
    103103              DWORD offset_low,  /* [in] Low-order 32 bits of file offset */
    104104              DWORD count        /* [in] Number of bytes to map */
    105 )
    106 {
    107   return HMMapViewOfFile( mapping, access, offset_high,
    108                           offset_low, count);
     105) 
     106{
     107    return MapViewOfFileEx( mapping, access, offset_high,
     108                            offset_low, count, NULL );
    109109}
    110110
     
    125125              DWORD count,       /* [in] Number of bytes to map */
    126126              LPVOID addr        /* [in] Suggested starting address for mapped view */
    127 )
    128 {
    129   return HMMapViewOfFileEx( handle, access, offset_high,
    130                             offset_low, count, addr);
     127)
     128{
     129  return HMMapViewOfFileEx(handle, access, offset_high, offset_low, count, addr);
    131130}
    132131
     
    143142              LPCVOID base, /* [in] Start address of byte range to flush */
    144143              DWORD cbFlush /* [in] Number of bytes in range */
    145 )
    146 {
    147   return HMFlushViewOfFile( (LPVOID)base, cbFlush);
     144)
     145{
     146    dprintf(("FlushViewOfFile: NOT IMPLEMENTED"));
     147    return TRUE;
    148148}
    149149
     
    161161 */
    162162BOOL WINAPI UnmapViewOfFile(LPVOID addr /* [in] Address where mapped view begins */
    163 )
    164 {
    165   return HMUnmapViewOfFile( addr );
    166 }
    167 
     163)
     164{
     165    if (!addr)
     166    {
     167        SetLastError( ERROR_INVALID_PARAMETER );
     168        return FALSE;
     169    }
     170    return TRUE;
     171}
    168172
    169173/***********************************************************************
     
    171175 *
    172176 * Helper function to map a file to memory:
    173  *  name                        -       file name
     177 *  name                        -       file name 
    174178 *  [RETURN] ptr                -       pointer to mapped file
    175179 */
     
    179183    LPVOID ptr = NULL;
    180184
    181     hFile = CreateFileW( name, GENERIC_READ, FILE_SHARE_READ, NULL,
     185    hFile = CreateFileW( name, GENERIC_READ, FILE_SHARE_READ, NULL, 
    182186                           OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0);
    183187    if (hFile != INVALID_HANDLE_VALUE)
     
    198202 *
    199203 * Helper function to map a file to memory:
    200  *  name                        -       file name
     204 *  name                        -       file name 
    201205 *  [RETURN] ptr                -       pointer to mapped file
    202206 */
     
    206210    LPVOID ptr = NULL;
    207211
    208     hFile = CreateFileA(name, GENERIC_READ, FILE_SHARE_READ, NULL,
     212    hFile = CreateFileA(name, GENERIC_READ, FILE_SHARE_READ, NULL, 
    209213                        OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0);
    210214    if (hFile != INVALID_HANDLE_VALUE)
     
    220224    return ptr;
    221225}
    222 
Note: See TracChangeset for help on using the changeset viewer.