Make winelib resource data writeable

Felix Nawothnig felix.nawothnig at
Mon May 16 06:32:42 CDT 2005

Dmitry Timoshkov wrote:
>>For PE files there is a hack in kernel/except.c which does COW for 
>>resource data - but winelib apps crash when they try to write to it.
>>(If this is a design-decision please tell me)
> As it's clearly indicated in the error message in kernel/except.c only
> broken apps try to write to the resources. What your application is trying
> to do?

It tries to write to a resource, which seems to work under Windows even 
if .rsrc is marked as readonly. The pointer returned by LockResource is 
not const so I'm not sure if those apps qualify as "broken" anyway - 
they are just exploiting undocumented (?) behaviour.

By the way, anyone knows if writing to a (readonly) resource throws an 
exception on windows (which is handled & ignored by kernel32.dll) one 
can catch or does the PE loader maybe ignore the RO flag for .rsrc? 
(can't test this since mingw seems to mark .rsrc as RW...)


More information about the wine-devel mailing list