36
36
37
37
using namespace PE ;
38
38
39
- RawDataSource::RawDataSource (pntr data, size_t size, bool readonly) : readonly(readonly), orig_data(data), sz(size) {
39
+ RawDataSource::RawDataSource (void * data, size_t size, bool readonly) : readonly(readonly), orig_data(data), sz(size) {
40
40
if (readonly) {
41
41
#ifdef USE_WINDOWS_API
42
42
DWORD old_protect = 0 ;
@@ -53,7 +53,7 @@ RawDataSource::RawDataSource(pntr data, size_t size, bool readonly) : readonly(r
53
53
RawDataSource::~RawDataSource () { this ->close (); }
54
54
bool RawDataSource::isreadonly () const { return this ->readonly ; };
55
55
bool RawDataSource::flush () { return true ; }
56
- pntr RawDataSource::data () { return this ->d ; }
56
+ void * RawDataSource::data () { return this ->d ; }
57
57
size_t RawDataSource::size () const { return this ->sz ; }
58
58
void RawDataSource::close () {
59
59
if (this ->d ) {
@@ -90,9 +90,9 @@ bool RawDataSource::resize(size_t new_size) {
90
90
#include < map>
91
91
#include < vector>
92
92
using namespace std ;
93
- typedef map<const_str, vector<pntr > > MMFs;
93
+ typedef map<const_str, vector<void * > > MMFs;
94
94
static MMFs mmfs;
95
- static void _RemoveMMF (MMFs &mmfs, const_str file, pntr x) {
95
+ static void _RemoveMMF (MMFs &mmfs, const_str file, void * x) {
96
96
MMFs::iterator v = mmfs.find (file);
97
97
if (v != mmfs.end ()) {
98
98
size_t size = v->second .size ();
@@ -110,14 +110,14 @@ static void _RemoveMMF(MMFs &mmfs, const_str file, pntr x) {
110
110
}
111
111
}
112
112
}
113
- static pntr AddMMF (const_str file, pntr mm) { if (mm != NULL && mm != (pntr )-1 ) { mmfs[file].push_back (mm); } return mm; }
114
- static void RemoveMMF (const_str file, pntr mm) { _RemoveMMF (mmfs, file, mm); }
113
+ static void * AddMMF (const_str file, void * mm) { if (mm != NULL && mm != (void * )-1 ) { mmfs[file].push_back (mm); } return mm; }
114
+ static void RemoveMMF (const_str file, void * mm) { _RemoveMMF (mmfs, file, mm); }
115
115
116
116
#ifdef USE_WINDOWS_API
117
117
static MMFs mmfViews;
118
118
typedef BOOL (WINAPI *UNMAP_OR_CLOSE)(void *);
119
- static pntr AddMMFView (const_str file, pntr view) { if (view != NULL ) mmfViews[file].push_back (view); return view; }
120
- static void RemoveMMFView (const_str file, pntr view) { _RemoveMMF (mmfViews, file, view); }
119
+ static void * AddMMFView (const_str file, void * view) { if (view != NULL ) mmfViews[file].push_back (view); return view; }
120
+ static void RemoveMMFView (const_str file, void * view) { _RemoveMMF (mmfViews, file, view); }
121
121
static void _UnmapAll (MMFs &mmfs, const_str file, UNMAP_OR_CLOSE func) {
122
122
MMFs::iterator v = mmfs.find (file);
123
123
if (v != mmfs.end ()) {
@@ -215,7 +215,7 @@ bool MemoryMappedDataSource::flush() {
215
215
#endif
216
216
}
217
217
218
- pntr MemoryMappedDataSource::data () { return this ->d ; }
218
+ void * MemoryMappedDataSource::data () { return this ->d ; }
219
219
size_t MemoryMappedDataSource::size () const { return this ->sz ; }
220
220
void MemoryMappedDataSource::close () {
221
221
this ->unmap ();
0 commit comments