Date: Sat, 25 Aug 2001 10:22:38 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: acottrel AT ihug DOT com DOT au Message-Id: <7458-Sat25Aug2001102237+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: sandmann AT clio DOT rice DOT edu, djgpp-workers AT delorie DOT com In-reply-to: <00de01c12d06$82e2cd40$0a02a8c0@acceleron> (acottrel@ihug.com.au) Subject: Re: Read 3F00 STDIN problem on Win 2K ( was Re: Fseek on STDIN problem on Win 2K) References: <00de01c12d06$82e2cd40$0a02a8c0 AT acceleron> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Andrew Cottrell" > Date: Sat, 25 Aug 2001 11:37:13 +1000 > > A quick fix is outlined below thanks to Charles finding that a fix for > is_executable() is to add a call to 4201 with an offset of 0 after the 3F00 > call, this also fixes _read(). If this is okay I can also include a similar > change to d_read.c and int86.c > > What do people think about this? [...] > + if(use_lfn && _osmajor == 5 && _get_dos_version(1) == 0x532) > + { > + /* Windows 2000 or XP; or NT with LFN TSR. Windows 2000 behaves > + badly when using 3F00 call. We need to seek to the current > + position in order for subseqent calls to work. */ > + memset(&r,0,sizeof(r)); > + r.x.ax = 0x4201; /* 4201h current file position */ > + r.x.bx = handle; /* BX = file handle */ > + r.x.cx = r.x.dx =0; /* CX:DX = (signed) offset from origin of new file position */ > + __dpmi_int(0x21, &r); Is 3F00 broken only under LFN? What happens if you set LFN=n on W2K: does it work then? If it's broken without LFN as well, you need to drop the test for _USE_LFN in these patcehs. And that memset to zero out the registers' struct is not needed when you call __dpmi_int (it zeroes out the important parts for you). Otherwise, the changes look fine. Thanks!