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

--- Comment #1 from Kenny Alive <artemal...@gmail.com> ---
Additionally since ReadFile (and ReadFileEx too) can read file in chunks not
larger than 4GB the file reading code should be updated to something like this:

            ulong totalNumRead = 0;
            while (totalNumRead != size)
            {
                uint chunkSize = (size - totalNumRead) & 0xffffffff;
                DWORD numRead = void;
                cenforce(ReadFile(hFile, cast(ubyte*)lpBuffer + totalNumRead,
chunkSize, &numRead, null) != 0
                        && numRead == chunkSize, name);
                totalNumRead += chunkSize;
            }

--

Reply via email to