X-Authentication-Warning: new-smtp2.ihug.com.au: Host p160-tnt4.syd.ihug.com.au [203.173.134.160] claimed to be acceleron Message-ID: <001601c11db0$313103f0$0a02a8c0@acceleron> From: "Andrew Cottrell" To: "Eli Zaretskii" Cc: , "Charles Sandmann" References: Subject: Re: Windows 2000 utime query Date: Sun, 5 Aug 2001 23:11:45 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Reply-To: djgpp-workers AT delorie DOT com > On Sun, 5 Aug 2001, Andrew Cottrell wrote: > > > I have downloaded the touch program from the freedos site and it works on > > Win2K. I am in the process of downloading the source files and I hope the > > source is in one of them. > > 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. Any suggestions for me to try tmorrow night after work. Andrew ======================= DJGPP TOUCH.EXE EXAMPLE ======================= DJGPP_204 D:\dj204\contrib\touch>dir new.txt 07/08/2001 11:00p 4 new.txt DJGPP_204 D:\dj204\contrib\touch>touch fildes = 5 dostime (cx)= 0xB80D dosdate (dx)= 0x2B07 r.x.flags = 0x0002 r.x.ax = 0x5700 NEW dosdate (dx)= 0x2B08 dostime (cx)= 0xB80D dosdate (dx)= 0x2B08 r.x.flags = 0x0003 r.x.ax = 0x0001 DJGPP_204 D:\dj204\contrib\touch>dir new.txt 07/08/2001 11:00p 4 new.txt ======================= PACIFIC TOUCH.EXE EXAMPLE ======================= PAC D:\pacific\test>dir new.txt 07/08/2001 10:27p 6 new.txt PAC D:\pacific\test>touch 14 filedes = 5 20 dostime (cx) = 0xB378 21 dosdate (dx) = 0x2B07 22 cflag value = 0x0000 24 return value (ax) = 0x5700 27 dostime (cx) = 0xB378 28 dosdate (dx) = 0x2B08 29 cflag value = 0x0000 30 return value (ax) = 0x5700 36 dostime (cx) = 0xB378 37 dosdate (dx) = 0x2B08 38 cflag value = 0x0000 39 return value (ax) = 0x5701 PAC D:\pacific\test>dir new.txt 08/08/2001 10:27p 6 new.txt ======================= DJGPP TOUCH.C CODE ======================= #include #include /* for mode definitions */ #include static void touchfile(const char *path) { __dpmi_regs r; int fildes; fildes = open(path, O_RDONLY); if (fildes == -1) { printf("%s %d\n",__FILE__,__LINE__); return; } printf("fildes = %d\n",fildes); r.x.ax = 0x5700; r.x.bx = fildes; __dpmi_int(0x21, &r); printf("dostime (cx)= 0x%04X\n", r.x.cx); printf("dosdate (dx)= 0x%04X\n", r.x.dx); printf("r.x.flags = 0x%04X\n", r.x.flags); printf("r.x.ax = 0x%04X\n\n", r.x.ax); r.x.dx++; printf("NEW dosdate (dx)= 0x%04X\n", r.x.dx); r.x.ax = 0x5701; r.x.bx = fildes; /* File handle */ __dpmi_int(0x21, &r); printf("dostime (cx)= 0x%04X\n", r.x.cx); printf("dosdate (dx)= 0x%04X\n", r.x.dx); printf("r.x.flags = 0x%04X\n", r.x.flags); printf("r.x.ax = 0x%04X\n", r.x.ax); close(fildes); return; } int main() { touchfile("new.txt"); return 0; } ======================= PACIFIC TOUCH.C CODE ======================= #include #include #include #include #include static void touchfile(register char * filename) { union REGS regs; int filedes; filedes = open(filename, S_IREAD); printf("%d filedes = %d\n", __LINE__, filedes); regs.x.ax = 0x5700; regs.x.bx = filedes; intdos(®s, ®s); printf("%d dostime (cx) = 0x%04X\n", __LINE__, regs.x.cx); printf("%d dosdate (dx) = 0x%04X\n", __LINE__, regs.x.dx); printf("%d cflag value = 0x%04X\n", __LINE__, regs.x.cflag); printf("%d return value (ax) = 0x%04X\n", __LINE__, regs.x.ax); regs.x.dx++; printf("%d dostime (cx) = 0x%04X\n", __LINE__, regs.x.cx); printf("%d dosdate (dx) = 0x%04X\n", __LINE__, regs.x.dx); printf("%d cflag value = 0x%04X\n", __LINE__, regs.x.cflag); printf("%d return value (ax) = 0x%04X\n", __LINE__, regs.x.ax); regs.x.ax = 0x5701; regs.x.bx = filedes; intdos(®s, ®s); printf("%d dostime (cx) = 0x%04X\n", __LINE__, regs.x.cx); printf("%d dosdate (dx) = 0x%04X\n", __LINE__, regs.x.dx); printf("%d cflag value = 0x%04X\n", __LINE__, regs.x.cflag); printf("%d return value (ax) = 0x%04X\n", __LINE__, regs.x.ax); close(filedes); } int main() { touchfile("new.txt"); }