Changeset 712 for trunk/src/kernel32/mmap.h
- Timestamp:
- Aug 27, 1999, 6:51:01 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/mmap.h
r699 r712 1 /* $Id: mmap.h,v 1. 8 1999-08-25 17:05:57sandervl Exp $ */1 /* $Id: mmap.h,v 1.9 1999-08-27 16:51:00 sandervl Exp $ */ 2 2 3 3 /* … … 19 19 #endif 20 20 21 //commit 4 pages at once when the app accesses it 22 #define NRPAGES_TOCOMMIT 200 23 24 #define MEMMAP_ACCESS_READ 1 25 #define MEMMAP_ACCESS_WRITE 2 26 #define MEMMAP_ACCESS_EXECUTE 4 27 28 class Win32MemMapView; 29 30 //****************************************************************************** 31 //****************************************************************************** 21 32 class Win32MemMap 22 33 { … … 26 37 27 38 BOOL Init(HANDLE hMemMap); 28 BOOL flushView( LPVOID lpvBase, ULONG cbFlush);39 BOOL flushView(ULONG offset, ULONG cbFlush); 29 40 LPVOID mapViewOfFile(ULONG size, ULONG offset, ULONG fdwAccess); 30 BOOL unmapViewOfFile( );41 BOOL unmapViewOfFile(Win32MemMapView *view); 31 42 32 43 HFILE getMapHandle() { return hMemMap; }; 33 44 LPSTR getMemName() { return lpszMapName; }; 34 45 DWORD getProtFlags() { return mProtFlags; }; 46 LPVOID getMappingAddr() { return pMapping; }; 35 47 36 48 void AddRef() { ++referenced; }; 37 49 void Release() { if(--referenced == 0) delete this; }; 38 50 39 BOOL hasReadAccess(); 40 BOOL hasWriteAccess(); 41 BOOL hasExecuteAccess(); 42 43 BOOL commitPage(LPVOID lpPageFaultAddr, ULONG nrpages, BOOL fWriteAccess); 51 BOOL commitPage(ULONG offset, BOOL fWriteAccess); 44 52 45 53 static Win32MemMap *findMap(LPSTR lpszName); … … 56 64 LPSTR lpszMapName; 57 65 void *pMapping; 58 BOOL fMapped; 66 67 ULONG nrMappings; 59 68 60 69 ULONG referenced; … … 66 75 Win32MemMap *next; 67 76 }; 77 //****************************************************************************** 78 //Memory mapped file View Class 79 //****************************************************************************** 80 class Win32MemMapView 81 { 82 public: 83 Win32MemMapView(Win32MemMap *map, ULONG offset, ULONG size, ULONG fdwAccess); 84 ~Win32MemMapView(); 85 86 DWORD getAccessFlags() { return mfAccess; }; 87 DWORD getSize() { return mSize; }; 88 LPVOID getViewAddr() { return pMapView; }; 89 ULONG getOffset() { return mOffset; }; 90 91 BOOL everythingOk() { return errorState == 0; }; 92 93 Win32MemMap *getParentMap() { return mParentMap;}; 94 95 static void deleteView(Win32MemMap *map); 96 static Win32MemMap *findMapByView(ULONG address, ULONG *offset, ULONG accessType, Win32MemMapView **pView=NULL); 97 static Win32MemMapView *findView(LPVOID address); 98 99 protected: 100 ULONG mSize, errorState; 101 ULONG mfAccess, mOffset; 102 void *pMapView; 103 104 Win32MemMap *mParentMap; 105 106 private: 107 static Win32MemMapView *mapviews; 108 Win32MemMapView *next; 109 110 friend class Win32MemMap; 111 }; 112 //****************************************************************************** 113 //****************************************************************************** 68 114 69 115 #endif //__MMAP_H__
Note:
See TracChangeset
for help on using the changeset viewer.