Skip to content
⌘ NSIS Forum Archive

Failed creating mmap

4 posts

torikx#edited

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)
    return 0;
  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)
    return 0;
... 
kichik#
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.