[Issue 21657] MmFile cannot map empty files

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 13 10:29:16 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21657

wolframw <wolframw at protonmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wolframw at protonmail.com

--- Comment #1 from wolframw <wolframw at protonmail.com> ---
Windows cannot map empty files. The MSDN doc for CreateFileMappingW [1] says:
> An attempt to map a file with a length of 0 (zero) fails with an error code
> of ERROR_FILE_INVALID. Applications should test for files with a length of
> 0 (zero) and reject those files.

[1]
https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-createfilemappingw

--


More information about the Digitalmars-d-bugs mailing list