| Index: runtime/bin/file_win.cc
|
| diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc
|
| index c9f98b560a1e375feea1684c6ed4bde87550611b..3e326c314561904db52862709dbabc2d8205a6e0 100644
|
| --- a/runtime/bin/file_win.cc
|
| +++ b/runtime/bin/file_win.cc
|
| @@ -75,8 +75,24 @@ bool File::IsClosed() {
|
|
|
|
|
| void* File::Map(MapType type, int64_t position, int64_t length) {
|
| - UNIMPLEMENTED();
|
| - return NULL;
|
| + ASSERT(handle_->fd() >= 0);
|
| + int flags;
|
| + switch (type) {
|
| + case kReadOnly:
|
| + flags = PAGE_READONLY;
|
| + break;
|
| + case KReadExecute:
|
| + flags = PAGE_EXECUTE_READ:
|
| + break;
|
| + default:
|
| + return NULL;
|
| + }
|
| + HANDLE mapping = CreateFileMapping(handle_->fd(), NULL, flags, 0, 0, NULL);
|
| + return MapViewOfFile(mapping,
|
| + FILE_MAP_READ,
|
| + Utils::High32Bits(position),
|
| + Utils::Low32Bits(position),
|
| + length);
|
| }
|
|
|
|
|
|
|