Archive: Failed creating mmap


Failed creating mmap
  Hi,
I get a
"failed creating mmap of..." error on a file (yes, it's over 2 GB in size).

I think the relevant code in mmap.c is:

int MMapFile::setfile(HANDLE hFile, DWORD dwSize)

...
>m_iSize = (int) dwSize;

if (m_iSize <= 0)
return0;

m_hFileMap = CreateFileMapping(m_hFile, NULL, PAGE_READONLY, 0, m_iSize, NULL);
DWORD is unsigned int, yet it's cast into signed int, why?

Does the following change result in any erronous side-effects?

...

>m_uSize = (unsigned int) dwSize;

if (
m_uSize == 0)
return0;
...

Yes, the change will probably result in an error in another line of code where an int is expected. Installers over 2GB are not supported, yet.


Does the offset parameter ever have a negative value in those get methods?


No, but almost everything in other classes expects signed ints.