This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: windres: serious bug


 --- Ian Lance Taylor <ian at airs dot com> wrote: > "Dimitrie O. Paun"
<dimi at intelliware dot ca> writes:
> 
> Here is an untested patch.  I haven't even run it, although it does
> compile.  It should point out the right places to change.
> 
> Ian
> 
> Index: rcparse.y

Thanks Ian
This works fine for me. Also, it causes no regressions in windres
testsuite.

Howvere, when trying to create a new testcase for the control id, i
found a difference in how rc amd windres handle the class name
(the fifth element, QUOTEDSTRING, in this case at line 619 in patched
rcparse.y)

	| CONTROL optresidc numexpr ',' QUOTEDSTRING control_styleexpr
	    cnumexpr cnumexpr cnumexpr cnumexpr optcnumexpr opt_control_data
	  {
	    $$ = define_control ($2, $3, $7, $8, $9, $10, 0, style, $11);
	    if ($12 != NULL)
	      {
		if (dialog.ex == NULL)
		  rcparse_warning ("control data requires DIALOGEX");
		$$->data = $12;
	      }
	    $$->class.named = 1;
  	    unicode_from_ascii (&$$->class.u.n.length, &$$->class.u.n.name, $5);
	  }
 

Using this id.rc (which parses with old windres as well as patched version)
as testcase:


101 DIALOGEX 0, 0, 200, 200

BEGIN
CONTROL "stringid", 102, "Static", 0x5000120e, 5, 5, 10, 10
END

where "Static" is the class name.

I get this from windres:

dump of id.res from windres

Contents of section .data:
 0000 00000000 20000000 ffff0000 ffff0000  .... ...........
 0010 00000000 00000000 00000000 00000000  ................
 0020 5a000000 20000000 ffff0500 ffff6500  Z... .........e.
 0030 00000000 30100904 00000000 00000000  ....0...........
 0040 0100ffff 00000000 00000000 00008880  ................
 0050 01000000 0000c800 c8000000 00000000  ................
 0060 00000000 00000000 0e120050 05000500  ...........P....
 0070 0a000a00 66000000 53007400 61007400  ....f...S.t.a.t.
 0080 69006300 00007300 74007200 69006e00  i.c...s.t.r.i.n.
 0090 67006900 64000000 00000000           g.i.d.......


and this from rc.exe:

dump of id.res from rc

Contents of section .data:
 0000 00000000 20000000 ffff0000 ffff0000  .... ...........
 0010 00000000 00000000 00000000 00000000  ................
 0020 50000000 20000000 ffff0500 ffff6500  P... .........e.
 0030 00000000 30100904 00000000 00000000  ....0...........
 0040 0100ffff 00000000 00000000 00008880  ................
 0050 01000000 0000c800 c8000000 00000000  ................
 0060 00000000 00000000 0e120050 05000500  ...........P....
 0070 0a000a00 66000000 ffff8200 73007400  ....f.......s.t.
 0080 72006900 6e006700 69006400 00000000  r.i.n.g.i.d.....


Note the class name "Static" is missing in the rc.exe output

I don't know what the class name is used for.  Maybe it just for the GUI
resource editor.  It doesn't make any difference to how the finally
executable works in my tests, but this windres-rc difference makes testcase
construction difficult with the current framework.

I'm not a big windres user, so I may be missing something here.  Dimitrie, can
you help.

Danny



http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]