Home » U++ Library support » U++ Core » Latest change on FileMapping::Map() wrong for win32
Re: Latest change on FileMapping::Map() wrong for win32 [message #23510 is a reply to message #23428] |
Sun, 25 October 2009 19:04   |
hans
Messages: 44 Registered: March 2006 Location: Germany
|
Member |
|
|
Hi, the code for the return test is now OK (last SVN version),
but after some testing I found two other bugs.
In bool FileMapping::Map(int64 mapoffset, dword maplen) there is commented out (on windows version only) the write flag, this
leads to Access violation on write access. Should be
#ifdef PLATFORM_WIN32
rawbase = (byte *)MapViewOfFile(hmap, write ? FILE_MAP_WRITE : FILE_MAP_READ,
(dword)(rawoffset >> 32), (dword)(rawoffset >> 0), rawsize);
#else
More strangely, the
bool FileMapping::Create(const wchar *file, int64 filesize_, bool delete_share) function is wrong on windows too. The created file is zero size, so line
hmap = CreateFileMapping(hfile, NULL, PAGE_READWRITE, 0, 0, NULL);
fails.
It should set the file size, so please change to:
long lo = (dword)filesize_, hi = (dword)(filesize_ >> 32);
hmap = CreateFileMapping(hfile, NULL, PAGE_READWRITE, hi, lo, NULL);
Greetings,
Hans
[Updated on: Sun, 25 October 2009 19:15] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Apr 30 14:51:53 CEST 2025
Total time taken to generate the page: 0.04194 seconds
|