This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project. See the Cygwin home page for more information.
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: Re: 'windres' bug




-----Original Message-----
From: DJ Delorie <dj@delorie.com>
To: krzych00@friko7.onet.pl <krzych00@friko7.onet.pl>
Cc: cygwin@sourceware.cygnus.com <cygwin@sourceware.cygnus.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@sourceware.cygnus.com