Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <008601be5c50$a673d260$b49eccc2@amd-based-pc> From: "Krzysztof Nikiel" To: "cygwin mailing list" , "DJ Delorie" Subject: Re: Re: 'windres' bug Date: Fri, 19 Feb 1999 22:41:13 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 -----Original Message----- From: DJ Delorie To: krzych00 AT friko7 DOT onet DOT pl Cc: cygwin AT sourceware DOT cygnus DOT com Date: 18 lutego 1999 19:08 Subject: Re: 'windres' bug > >> VS_VERSIONINFO structure created by 'windres' (B20.1) >> cannot be read by win9x (I don't know about nt). >> Stringtable sould have a 'total length' (first word), >> 'length of value' (second word) - missing (always set to 0), >> and 'type' (third word). > >I applied a patch for this from a net user just yesterday! What a >coincidence. I've attached a diff if you need it. > >--- resbin.c 1998/10/07 01:21:02 >+++ resbin.c 1999/02/18 02:52:53 >@@ -2258,5 +2258,4 @@ > vsslen = 6; > >- put_16 (big_endian, 0, vssd->data + 2); > put_16 (big_endian, 1, vssd->data + 4); > >@@ -2278,4 +2277,5 @@ > > *pp = unicode_to_bin (vs->value, big_endian); >+ put_16 (big_endian, (*pp)->length / 2, vssd->data + 2); > length += (*pp)->length; > vilen += (*pp)->length; > > Yes, indeed. It's big confusing coincidence. I have sent similar uuencoded patch to cygwin just before getting your message! 'windres VS_VERSION_INFO patch': *** resbin.c.0 Wed Oct 07 01:21:02 1998 --- resbin.c Fri Feb 19 11:31:40 1999 *************** *** 2255,2265 **** length += 6; vilen += 6; vslen += 6; vsslen = 6; - put_16 (big_endian, 0, vssd->data + 2); put_16 (big_endian, 1, vssd->data + 4); *pp = vssd; pp = &vssd->next; --- 2255,2264 ---- *************** *** 2279,2288 **** --- 2278,2290 ---- *pp = unicode_to_bin (vs->value, big_endian); length += (*pp)->length; vilen += (*pp)->length; vslen += (*pp)->length; vsslen += (*pp)->length; + + put_16 (big_endian, (*pp)->length, vssd->data + 2); + pp = &(*pp)->next; put_16 (big_endian, vsslen, vssd->data); } Patches are similar but they are different! [ (*pp)->length vs (*pp)->length / 2] The question is: which one is the right one? (this is not very sure for me) In first version of my patch was this '(*pp)->length / 2'(number of UNICODE chars in string - should be right because based on Microsoft/Borland compilers output) But in second version is '(*pp)->length' (number of bytes used should be even more right considering a bug in microsoft based compilers - isn't very probabe?) And here comes more of confusing questions... In binary table (which is the same structure as stringtabe) second word seems to mean 'bytes used' not 'data items used', the same should be in string version. On the other hand, Microsoft (THE VERY GREAT AUTHOR) should exactly know what it stands for, so 'chars used' may be considered a perfect right one. Finaly, it doesn't matter since any non-zero value seems to work fine! Now You decide which version is the right version. Thanks Krzysiek -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com