Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
hans is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Deepcopying One container
Next Topic: FtpClient use with Progress FIX
Goto Forum:
  


Current Time: Wed Apr 30 19:32:35 CEST 2025

Total time taken to generate the page: 0.02807 seconds