<p></p>
<p><b>@VincentBlondeau</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/485#discussion_r407173808">platforms/win32/plugins/FilePlugin/sqWin32FilePrims.c</a>:</p>
<pre style='color:#555'>>    position = sqImageFilePosition(h);
-  ReadFile((HANDLE)(h-1), (LPVOID) ptr, count*sz, &dwReallyRead, NULL);
-  while(dwReallyRead != (DWORD)(count*sz)) {
-    DWORD err = GetLastError();
-    if(sqMessageBox(MB_ABORTRETRYIGNORE, TEXT("Squeak Warning"),TEXT("Image file read problem (%d out of %d bytes read)"), dwReallyRead, count*sz)
-       == IDABORT) return (dwReallyRead / sz);
-    sqImageFileSeek(h, position);
-    ReadFile((HANDLE)(h-1), (LPVOID) ptr, count*sz, &dwReallyRead, NULL);
+  while (reallyRead != totalToRead) {
+    DWORD toRead = (totalToRead - reallyRead) > (size_t)MAX_DWORD ? MAX_DWORD : totalToRead - reallyRead;
+    BOOL ret = ReadFile((HANDLE)(h - 1), (LPVOID)((sqInt)ptr + (sqInt)reallyRead), toRead, &dwReallyRead, NULL);
+    reallyRead += dwReallyRead;
+
+    if (!ret | dwReallyRead != toRead) {
</pre>
<p>It is not clever code here. Thanks for spotting it!</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you commented.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/485#discussion_r407173808">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AIJPEW57GOJIKARGGHAISPDRMGESJANCNFSM4MGDV3UQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AIJPEWYAVADGDSLHP3GGZKLRMGESJA5CNFSM4MGDV3U2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOC5NQAAY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/485#discussion_r407173808",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/485#discussion_r407173808",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>