CloseHandle( file );
res = BeginUpdateResource( filename, TRUE );
+ if ( res != NULL || GetLastError() != ERROR_FILE_INVALID )
+ {
ok( res != NULL, "BeginUpdateResource failed\n");
/* check if it's possible to open the file now */
r = EndUpdateResource( res, FALSE );
ok( r == FALSE, "EndUpdateResource failed\n");
+ }
+ else
+ skip( "Can't update resource in empty file\n" );
res = BeginUpdateResource( filename, FALSE );
ok( res == NULL, "BeginUpdateResource failed\n");
res = BeginUpdateResource( filename, TRUE );
ok( res != NULL, "BeginUpdateResource failed\n");
+ if (0) /* this causes subsequent tests to fail on Vista */
+ {
r = UpdateResource( res,
MAKEINTRESOURCE(0x1230),
MAKEINTRESOURCE(0x4567),
0xabcd,
NULL, 0 );
ok( r == FALSE, "UpdateResource failed\n");
+ }
r = UpdateResource( res,
MAKEINTRESOURCE(0x1230),
MAKEINTRESOURCE(0x4567),
0xabcd,
foo, sizeof foo );
- ok( r == TRUE, "UpdateResource failed\n");
+ ok( r == TRUE, "UpdateResource failed: %d\n", GetLastError());
r = EndUpdateResource( res, FALSE );
- ok( r, "EndUpdateResource failed\n");
+ ok( r, "EndUpdateResource failed: %d\n", GetLastError());
}
dir = (void*) ((BYTE*) dos + sec[1].VirtualAddress);
ok( dir->Characteristics == 0, "Characteristics wrong\n");
- ok( dir->TimeDateStamp == 0, "TimeDateStamp wrong\n");
+ ok( dir->TimeDateStamp == 0 || abs( dir->TimeDateStamp - GetTickCount() ) < 1000 /* nt4 */,
+ "TimeDateStamp wrong %u\n", dir->TimeDateStamp);
ok( dir->MajorVersion == 4, "MajorVersion wrong\n");
ok( dir->MinorVersion == 0, "MinorVersion wrong\n");
if (GLE == ERROR_CALL_NOT_IMPLEMENTED)
{
- skip("Resource calls are not implemented\n");
+ win_skip("Resource calls are not implemented\n");
return;
}