delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/04/03/01:09:52

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <001201bf9d2b$085e3710$0201a8c0@jayk_home4nt>
From: "Jay Krell" <jay DOT krell AT cornell DOT edu>
To: "Mumit Khan" <khan AT NanoTech DOT Wisc DOT EDU>, <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: Permission denied with makeinfo from texinfo-4.0
Date: Sun, 2 Apr 2000 22:11:00 -0700
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3612.1700
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700

------=_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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019