winebuild: Write actual (not aligned) sizes in the resource headers.

Dmitry Timoshkov dmitry at baikal.ru
Thu Jan 2 06:57:19 CST 2014


This patch makes SizeofResource() return correct values in my winelib
application, and as a side effect sxs manifest files created for fake
dlls no longer have trailing zeros. Note: wrc does its job correctly,
and the .res file it creates matches what rc.exe produces.
---
 tools/winebuild/res32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c
index 0c39ec1..d459a5f 100644
--- a/tools/winebuild/res32.c
+++ b/tools/winebuild/res32.c
@@ -477,7 +477,7 @@ void output_resources( DLLSPEC *spec )
 
     for (i = 0, res = spec->resources; i < spec->nb_resources; i++, res++)
         output( "\t.long .L__wine_spec_res_%d-.L__wine_spec_rva_base,%u,0,0\n",
-                i, (res->data_size + 3) & ~3 );
+                i, res->data_size );
 
     /* dump the name strings */
 
@@ -578,7 +578,7 @@ void output_bin_resources( DLLSPEC *spec, unsigned int start_rva )
     for (i = 0, res = spec->resources; i < spec->nb_resources; i++, res++)
     {
         put_dword( data_offset + start_rva );
-        put_dword( (res->data_size + 3) & ~3 );
+        put_dword( res->data_size );
         put_dword( 0 );
         put_dword( 0 );
         data_offset += (res->data_size + 3) & ~3;
-- 
1.8.5.2




More information about the wine-patches mailing list