Mail Archives: cygwin/2000/04/03/01:09:52
------=_NextPart_000_000F_01BF9CF0.5420C0E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Do you have a simple repro case for this? I tried under NT4 on NTFS and FAT
and on Win98se on FAT with the attached program and it worked (returned
true, 0 bytes, last error was 0 on NT, 120 on 9x, but given the returned
true, last error should be ignored).
-----Original Message-----
From: Mumit Khan <khan AT NanoTech DOT Wisc DOT EDU>
To: cygwin AT sourceware DOT cygnus DOT com <cygwin AT sourceware DOT cygnus DOT com>
Cc: Christopher Faylor <cgf AT cygnus DOT com>
Date: Sunday, April 02, 2000 1:58 PM
Subject: Re: Permission denied with makeinfo from texinfo-4.0
>fyi, the makeinfo bug is caused by a (undocumented of course) bug in Win32
>ReadFile routine.
>
>Here's what David Korn says when it showed up in UWIN as well:
>
> Yet some more bizarre undocumented win32 behavior. If you call the
> Win32 ReadFile() function with size greater than 32K, and you are
> at the end of file, it does not return successfully with 0 bytes as
> you would expect, but fails with ERROR_NOACCESS.
>
[]
>Regards,
>Mumit
>
>
>
------=_NextPart_000_000F_01BF9CF0.5420C0E0
Content-Type: application/octet-stream;
name="rdeof1.c"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="rdeof1.c"
#include "windows.h"
#include <stdio.h>
void Main(int argc, char** argv)
{
HANDLE hFile;
char buffer[64000];
BOOL b;
unsigned long bytes;
long lastError;
hFile =3D CreateFile(argv[1] ? argv[1] : argv[0], GENERIC_READ, =
FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
bytes =3D 1;
SetFilePointer(hFile, 0, NULL, FILE_END);
b =3D ReadFile(hFile, buffer, 10, &bytes, NULL);
lastError =3D GetLastError();
printf("ReadFile:%s,%lu bytes, GetLastError:%ld\n", b ? "true" : =
"false", bytes, lastError);
bytes =3D 2;
b =3D ReadFile(hFile, buffer, 30000, &bytes, NULL);
lastError =3D GetLastError();
printf("ReadFile:%s,%lu bytes, GetLastError:%ld\n", b ? "true" : =
"false", bytes, lastError);
bytes =3D 3;
b =3D ReadFile(hFile, buffer, 40000, &bytes, NULL);
lastError =3D GetLastError();
printf("ReadFile:%s,%lu bytes, GetLastError:%ld\n", b ? "true" : =
"false", bytes, lastError);
}
int main(int argc, char** argv)
{
Main(argc, argv);
return 0;
}
------=_NextPart_000_000F_01BF9CF0.5420C0E0
Content-Type: text/plain; charset=us-ascii
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
------=_NextPart_000_000F_01BF9CF0.5420C0E0--
- Raw text -