Date: Sun, 05 Aug 2001 18:10:19 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: acottrel AT ihug DOT com DOT au Message-Id: <9003-Sun05Aug2001181019+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: djgpp-workers AT delorie DOT com, sandmann AT clio DOT rice DOT edu In-reply-to: <001601c11db0$313103f0$0a02a8c0@acceleron> (acottrel@ihug.com.au) Subject: Re: Windows 2000 utime query References: <001601c11db0$313103f0$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: Sun, 5 Aug 2001 23:11:45 +1000 > > > > It might be that function 5701 fails from protected mode, but not from > > real mode. (Crazy, I know; but so is the failure itself.) > > > Looks like you are not crazy. I downloaded the FreeDOS touch source code and > it was in assembler, bit it worked. I then downloaded PACIFIC C and wrote a > small test app below for DJGPP and PACIFIC C. I hope the examples are not > to big, but I thought they may be useful for analysis of the problem. The > app does the same interrupt calls. > > Real mode works in Pacific C and protected mode in DJGPP fails. I thought I > was going crazy. The sample works fine on Win 98. Could it be that W2K clobbers some of the registers on the way from DPMI's function 0300h to its DOS function dispatch code? And just to relieve my conscience: could you please look at the value of the global variables __dpmi_int_flags, __dpmi_int_ss, and __dpmi_int_sp, both before and after the call to __dpmi_int, and see what are they (should all be zeroes)? Anyway, if crazy does it, let's get crazier. Or, in the words of a poet: Yeah let's do something crazy, something absolutely wrong while we're waiting for the miracle, for the miracle to come. Leonard Cohen To wit: try invoking function 5701h via INT 21h in protected mode, like this: union REGS regs; regs.d.eax = 0x5701; regs.d.ebx = filedesc; regs.d.ecx = dostime; regs.d.edx = dosdate; _int86 (0x21, ®s, ®s); Note that I make a point of using the 32-bit registers, to avoid leaving random garbage in the upper 16 bits. Don't know if this matters (it could even be wrong).