kernel32/tests: Add some tests for CIL 32-bit image flags.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-02-15 08:07:09 +01:00
parent 50e5364330
commit 2df367a4f7
2 changed files with 30 additions and 2 deletions

View File

@ -405,7 +405,8 @@ static BOOL query_image_section( int id, const char *dll_name, const IMAGE_NT_HE
todo_wine
ok( S(U(image)).ComPlusILOnly || broken(is_winxp),
"%u: wrong ComPlusILOnly flags %02x\n", id, U(image).ImageFlags );
if (nt_header->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)
if (nt_header->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC &&
!(cor_header->Flags & COMIMAGE_FLAGS_32BITREQUIRED))
todo_wine
ok( S(U(image)).ComPlusNativeReady || broken(is_winxp),
"%u: wrong ComPlusNativeReady flags %02x\n", id, U(image).ImageFlags );
@ -1019,6 +1020,14 @@ static void test_Loader(void)
status = map_image_section( &nt_header, &section, &cor_header, __LINE__ );
ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status );
cor_header.Flags = COMIMAGE_FLAGS_ILONLY | COMIMAGE_FLAGS_32BITREQUIRED;
status = map_image_section( &nt_header, &section, &cor_header, __LINE__ );
ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status );
cor_header.Flags = COMIMAGE_FLAGS_ILONLY | COMIMAGE_FLAGS_32BITPREFERRED;
status = map_image_section( &nt_header, &section, &cor_header, __LINE__ );
ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status );
cor_header.Flags = 0;
status = map_image_section( &nt_header, &section, &cor_header, __LINE__ );
ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status );
@ -1122,6 +1131,16 @@ static void test_Loader(void)
ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64),
"NtCreateSection error %08x\n", status );
cor_header.Flags = COMIMAGE_FLAGS_ILONLY | COMIMAGE_FLAGS_32BITREQUIRED;
status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, &section, &cor_header, __LINE__ );
ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64),
"NtCreateSection error %08x\n", status );
cor_header.Flags = COMIMAGE_FLAGS_ILONLY | COMIMAGE_FLAGS_32BITPREFERRED;
status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, &section, &cor_header, __LINE__ );
ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64),
"NtCreateSection error %08x\n", status );
cor_header.Flags = 0;
status = map_image_section( (IMAGE_NT_HEADERS *)&nt64, &section, &cor_header, __LINE__ );
ok( status == (is_wow64 ? STATUS_SUCCESS : STATUS_INVALID_IMAGE_WIN_64),
@ -1218,6 +1237,14 @@ static void test_Loader(void)
status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, &section, &cor_header, __LINE__ );
ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status );
cor_header.Flags = COMIMAGE_FLAGS_ILONLY | COMIMAGE_FLAGS_32BITREQUIRED;
status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, &section, &cor_header, __LINE__ );
ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status );
cor_header.Flags = COMIMAGE_FLAGS_ILONLY | COMIMAGE_FLAGS_32BITPREFERRED;
status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, &section, &cor_header, __LINE__ );
ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status );
cor_header.Flags = 0;
status = map_image_section( (IMAGE_NT_HEADERS *)&nt32, &section, &cor_header, __LINE__ );
ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status );

View File

@ -3621,10 +3621,11 @@ typedef enum ReplacesCorHdrNumericDefines
COMIMAGE_FLAGS_STRONGNAMESIGNED = 0x00000008,
COMIMAGE_FLAGS_NATIVE_ENTRYPOINT= 0x00000010,
COMIMAGE_FLAGS_TRACKDEBUGDATA = 0x00010000,
COMIMAGE_FLAGS_32BITPREFERRED = 0x00020000,
COR_VERSION_MAJOR_V2 = 2,
COR_VERSION_MAJOR = COR_VERSION_MAJOR_V2,
COR_VERSION_MINOR = 0,
COR_VERSION_MINOR = 5,
COR_DELETED_NAME_LENGTH = 8,
COR_VTABLEGAP_NAME_LENGTH = 8,