Changeset 678 for trunk/src/kernel32/virtual.cpp
- Timestamp:
- Aug 25, 1999, 12:28:41 PM (26 years ago)
- 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 phallerExp $ */1 /* $Id: virtual.cpp,v 1.4 1999-08-25 10:28:41 sandervl Exp $ */ 2 2 3 3 /* … … 19 19 #include <win\virtual.h> 20 20 #include <heapstring.h> 21 #include "mmap.h"22 21 #include <handlemanager.h> 23 22 … … 39 38 LPCSTR name /* [in] Name of file-mapping object */ ) 40 39 { 41 return HMCreateFileMapping(hFile, sa, protect, size_high, size_low, name);40 return HMCreateFileMapping(hFile, sa, protect, size_high, size_low, name); 42 41 } 43 42 … … 47 46 * See CreateFileMapping32A 48 47 */ 49 HANDLE WINAPI CreateFileMappingW( HFILE hFile, LPSECURITY_ATTRIBUTES attr, 50 DWORD protect, DWORD size_high, 48 HANDLE WINAPI CreateFileMappingW( HFILE hFile, LPSECURITY_ATTRIBUTES attr, 49 DWORD protect, DWORD size_high, 51 50 DWORD size_low, LPCWSTR name ) 52 51 { … … 72 71 LPCSTR name ) /* [in] Name of file-mapping object */ 73 72 { 74 return (HMOpenFileMapping(access, inherit, name)); 73 dprintf(("OpenFileMappingA: %x %d %s", access, inherit, name)); 74 return HMOpenFileMapping(access, inherit, name); 75 75 } 76 76 … … 103 103 DWORD offset_low, /* [in] Low-order 32 bits of file offset */ 104 104 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 ); 109 109 } 110 110 … … 125 125 DWORD count, /* [in] Number of bytes to map */ 126 126 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); 131 130 } 132 131 … … 143 142 LPCVOID base, /* [in] Start address of byte range to flush */ 144 143 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; 148 148 } 149 149 … … 161 161 */ 162 162 BOOL 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 } 168 172 169 173 /*********************************************************************** … … 171 175 * 172 176 * Helper function to map a file to memory: 173 * name - file name 177 * name - file name 174 178 * [RETURN] ptr - pointer to mapped file 175 179 */ … … 179 183 LPVOID ptr = NULL; 180 184 181 hFile = CreateFileW( name, GENERIC_READ, FILE_SHARE_READ, NULL, 185 hFile = CreateFileW( name, GENERIC_READ, FILE_SHARE_READ, NULL, 182 186 OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0); 183 187 if (hFile != INVALID_HANDLE_VALUE) … … 198 202 * 199 203 * Helper function to map a file to memory: 200 * name - file name 204 * name - file name 201 205 * [RETURN] ptr - pointer to mapped file 202 206 */ … … 206 210 LPVOID ptr = NULL; 207 211 208 hFile = CreateFileA(name, GENERIC_READ, FILE_SHARE_READ, NULL, 212 hFile = CreateFileA(name, GENERIC_READ, FILE_SHARE_READ, NULL, 209 213 OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0); 210 214 if (hFile != INVALID_HANDLE_VALUE) … … 220 224 return ptr; 221 225 } 222
Note:
See TracChangeset
for help on using the changeset viewer.