Replacing vfs memory mapping with base memory mapping.

Progress on #294.
This commit is contained in:
Ben Vanik
2015-06-27 18:02:20 -07:00
parent 23f91b58f3
commit 1ac19f1b08
10 changed files with 57 additions and 90 deletions

View File

@@ -51,13 +51,13 @@ X_STATUS XUserModule::LoadFromFile(std::string path) {
// If the FS supports mapping, map the file in and load from that.
if (fs_entry->can_map()) {
// Map.
auto mmap = fs_entry->CreateMemoryMapping(vfs::Mode::READ, 0, 0);
auto mmap = fs_entry->OpenMapped(MappedMemory::Mode::kRead);
if (!mmap) {
return result;
}
// Load the module.
result = LoadFromMemory(mmap->address(), mmap->length());
result = LoadFromMemory(mmap->data(), mmap->size());
} else {
X_FILE_NETWORK_OPEN_INFORMATION file_info = {0};
result = fs_entry->QueryInfo(&file_info);