Avoid collisions between parallel installations of Cygwin

Charles Wilson cygwin@cwilson.fastmail.fm
Tue Oct 13 18:03:00 GMT 2009

cgf wrote:
> So, while it might be neat to put these in the resource section, isn't
> that normally ASCII data?  Or is it binary too?  It's been too long
> since I played with that.

No, you can store binary data in a resource section using RCDATA. It's a
bit tricky to store streams of bytes (other than strings), but it can be
done. And WORDs or DWORDs are easy, although you have to worry about
alignment when switching between data types (the entire RCDATA resource
will be DWORD aligned to start with).

windres -o foo_res.o -i foo_res.rc
gcc -o foo.o -c foo.c
gcc -o foo.exe foo.o foo_res.o

If we add the discussed functionality and make it an option, it makes
sense to me to do it using resources ('course we'd need to provide a
(native win32) user tool to manipulate it). That way, it can be
interpreted by cygwin exactly once on load with no additional disk
access, and there's no question about changing (say /bin/.cygwinrc)
while the DLL is loaded and wondering why it hasn't taken effect -- in
this case, while the DLL is loaded you can't modify it.

And...by changing the DLL, you change its checksum so we could easily
distinguish a modified DLL from the real distributed ones, even without
the manipulation tool. Just compare md5sums.

It seems to me that this sort of thing is very different from the type
of stuff we use the CYGWIN variable for...


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo_res.rc
Type: image/x-xbitmap
Size: 658 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20091013/f7d44e93/attachment.xbm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: foo.c
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20091013/f7d44e93/attachment.c>

More information about the Cygwin-developers mailing list