Commit b4bc2c36 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

kernel32: Don't try update version resources with invalid data, as it fails on Windows 2003.

parent e4eac235
...@@ -161,31 +161,15 @@ static void update_resources_delete( void ) ...@@ -161,31 +161,15 @@ static void update_resources_delete( void )
todo_wine ok( r, "EndUpdateResouce failed\n"); todo_wine ok( r, "EndUpdateResouce failed\n");
} }
struct verhdr {
WORD wLength;
WORD wValueLength;
WORD wType;
WCHAR key[1];
};
void update_resources_version(void) void update_resources_version(void)
{ {
HANDLE res = NULL; HANDLE res = NULL;
BOOL r; BOOL r;
struct verhdr hdr;
char foo[] = "red and white"; char foo[] = "red and white";
res = BeginUpdateResource( filename, TRUE ); res = BeginUpdateResource( filename, TRUE );
ok( res != NULL, "BeginUpdateResource failed\n"); ok( res != NULL, "BeginUpdateResource failed\n");
memset( &hdr, 0, sizeof hdr );
r = UpdateResource( res,
RT_VERSION,
MAKEINTRESOURCE(VS_VERSION_INFO),
MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL),
&hdr, sizeof hdr );
ok( r, "UpdateResouce failed\n");
r = UpdateResource( res, r = UpdateResource( res,
MAKEINTRESOURCE(0x1230), MAKEINTRESOURCE(0x1230),
MAKEINTRESOURCE(0x4567), MAKEINTRESOURCE(0x4567),
...@@ -219,10 +203,10 @@ void check_empty( IMAGE_RESOURCE_DIRECTORY *dir ) ...@@ -219,10 +203,10 @@ void check_empty( IMAGE_RESOURCE_DIRECTORY *dir )
todo_wine ok( !memcmp( pad, "PADDINGXXPADDING", 16), "padding wrong\n"); todo_wine ok( !memcmp( pad, "PADDINGXXPADDING", 16), "padding wrong\n");
} }
void check_version( IMAGE_RESOURCE_DIRECTORY *dir ) void check_not_empty( IMAGE_RESOURCE_DIRECTORY *dir )
{ {
ok( dir->NumberOfNamedEntries == 0, "NumberOfNamedEntries should be 0 instead of %d\n", dir->NumberOfNamedEntries); ok( dir->NumberOfNamedEntries == 0, "NumberOfNamedEntries should be 0 instead of %d\n", dir->NumberOfNamedEntries);
todo_wine ok( dir->NumberOfIdEntries == 2, "NumberOfIdEntries should be 2 instead of %d\n", dir->NumberOfIdEntries); todo_wine ok( dir->NumberOfIdEntries == 1, "NumberOfIdEntries should be 1 instead of %d\n", dir->NumberOfIdEntries);
} }
void check_exe( res_check_func fn ) void check_exe( res_check_func fn )
...@@ -287,6 +271,6 @@ START_TEST(resource) ...@@ -287,6 +271,6 @@ START_TEST(resource)
update_resources_delete(); update_resources_delete();
check_exe( check_empty ); check_exe( check_empty );
update_resources_version(); update_resources_version();
check_exe( check_version ); check_exe( check_not_empty );
DeleteFile( filename ); DeleteFile( filename );
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment