Date: Wed, 8 Aug 2001 18:28:16 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Andrew Cottrell cc: djgpp-workers AT delorie DOT com, Charles Sandmann Subject: Re: Windows 2000 patch for utime.c v1 In-Reply-To: <009801c12008$7b1f98a0$0a02a8c0@acceleron> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On Wed, 8 Aug 2001, Andrew Cottrell wrote: > Here is my first attempt at a patch to fix the problem with utime under > Windows 2000. Thanks! Comments below. > Should I change the code to execute the new check for all versions of > Windows or only NT or ....? If most other versions of Windows fail with 7143h, I think we shouldn't call it unless on NT/W2K/XP. > + #include Please always use the (much more portable) forward slash. The above will not compile in cross-compiled environment. > + if ((_USE_LFN) && ( _osmajor < 7 || _osmajor > 9)) /* LFN & NT */ This is not the right way to test for NT/W2K. Please use this: if (_osmajor == 5 && _USE_LFN && _get_dos_version (1) == 0x532) /* LFN & NT */ > + _put_path(path); > + r.x.ds = __tb_segment; /* DS:DX -> ASCIZ filename */ > + r.x.dx = __tb_offset; > + > + r.x.cx = dostime; /* New time */ > + r.x.di = dosdate; /* New date */ > + r.x.si = 0x00; /* Set to zero just in case */ > + > + r.x.ax = 0x7143; /* LFN API for extend3ed get/set time */ There's a typo in the comment here. > + r.x.bx = 0x03; /* Set last write date / time */ > + __dpmi_int(0x21, &r); > + > + if (!(r.x.flags & 1)) /* Pass exit otherwise try other methods */ > + { > + return 0; I think we should set access date/time as well (using subfunction 05), like we do on Windows 9X. Please see if subfunction 05 works, and if so, does it support setting the access time, not only date. Thanks again for working on this.