ByteArray: munmap() memory-mapped file on close
commit0fc21a3fee2d3c0aa399f7b8038d47cafd2833d2
authorrofl0r <rofl0r@users.noreply.github.com>
Wed, 31 Aug 2022 14:25:37 +0000 (31 14:25 +0000)
committerrofl0r <rofl0r@users.noreply.github.com>
Wed, 31 Aug 2022 14:32:16 +0000 (31 14:32 +0000)
tree0f35f6bff7b2968657b9b6db9c30bdc5d287037f
parentc688a0800ee8563fd5c0444cae59033e5f0aeb95
ByteArray: munmap() memory-mapped file on close

after hours of debugging why agsinject's rename() functionality
didn't work on windows, it turned out that it was because the
file contents of the old crm/dat file were still mmap()ed.
when trying to open the file in "wb" mode again, WINEDEBUG=+relay
mode spit out a failed CreateFile call whose GetLastError
was 0x4c8 - ERROR_USER_MAPPED_FILE:

> The requested operation cannot be performed on a file with a
> user-mapped section open.
ByteArray.c
ByteArray.h