mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 10:47:18 +00:00
ntdll/actctx: Don't stop looking for manifest if dll without manifest is found.
Signed-off-by: Fabian Maurer <dark.shadow4@web.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ce2be144ea
commit
56b3304a01
|
@ -1,7 +1,7 @@
|
|||
TESTDLL = kernel32.dll
|
||||
IMPORTS = user32 advapi32
|
||||
|
||||
C_SRCS = \
|
||||
SOURCES = \
|
||||
actctx.c \
|
||||
atom.c \
|
||||
change.c \
|
||||
|
@ -11,6 +11,8 @@ C_SRCS = \
|
|||
debugger.c \
|
||||
directory.c \
|
||||
drive.c \
|
||||
dummy.c \
|
||||
dummy.spec \
|
||||
environ.c \
|
||||
fiber.c \
|
||||
file.c \
|
||||
|
@ -26,6 +28,7 @@ C_SRCS = \
|
|||
process.c \
|
||||
profile.c \
|
||||
resource.c \
|
||||
resource.rc \
|
||||
sync.c \
|
||||
thread.c \
|
||||
time.c \
|
||||
|
@ -34,5 +37,3 @@ C_SRCS = \
|
|||
version.c \
|
||||
virtual.c \
|
||||
volume.c
|
||||
|
||||
RC_SRCS = resource.rc
|
||||
|
|
|
@ -2598,9 +2598,27 @@ static void delete_manifest_file(const char *filename)
|
|||
DeleteFileA(path);
|
||||
}
|
||||
|
||||
static void extract_resource(const char *name, const char *type, const char *path)
|
||||
{
|
||||
DWORD written;
|
||||
HANDLE file;
|
||||
HRSRC res;
|
||||
void *ptr;
|
||||
|
||||
file = CreateFileA(path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
|
||||
ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", path, GetLastError());
|
||||
|
||||
res = FindResourceA(NULL, name, type);
|
||||
ok( res != 0, "couldn't find resource\n" );
|
||||
ptr = LockResource( LoadResource( GetModuleHandleA(NULL), res ));
|
||||
WriteFile( file, ptr, SizeofResource( GetModuleHandleA(NULL), res ), &written, NULL );
|
||||
ok( written == SizeofResource( GetModuleHandleA(NULL), res ), "couldn't write resource\n" );
|
||||
CloseHandle( file );
|
||||
}
|
||||
|
||||
static void test_CreateActCtx(void)
|
||||
{
|
||||
CHAR path[MAX_PATH], dir[MAX_PATH];
|
||||
CHAR path[MAX_PATH], dir[MAX_PATH], dll[MAX_PATH];
|
||||
ACTCTXA actctx;
|
||||
HANDLE handle;
|
||||
|
||||
|
@ -2637,6 +2655,22 @@ todo_wine {
|
|||
}
|
||||
if (handle != INVALID_HANDLE_VALUE) pReleaseActCtx(handle);
|
||||
|
||||
/* with specified directory, that does contain dependent assembly */
|
||||
GetTempPathA(ARRAY_SIZE(dir), dir);
|
||||
actctx.lpAssemblyDirectory = dir;
|
||||
handle = pCreateActCtxA(&actctx);
|
||||
ok(handle != INVALID_HANDLE_VALUE, "got handle %p\n", handle);
|
||||
pReleaseActCtx(handle);
|
||||
|
||||
/* Should still work if we add a dll with the same name, but without manifest */
|
||||
strcpy(dll, dir);
|
||||
strcat(dll, "testdep1.dll");
|
||||
extract_resource("dummy.dll", "TESTDLL", dll);
|
||||
handle = pCreateActCtxA(&actctx);
|
||||
ok(handle != INVALID_HANDLE_VALUE || broken(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX) , "got error %d\n", GetLastError());
|
||||
pReleaseActCtx(handle);
|
||||
DeleteFileA(dll);
|
||||
|
||||
delete_manifest_file("main_wndcls.manifest");
|
||||
delete_manifest_file("testdep1.manifest");
|
||||
delete_manifest_file("testdep2.manifest");
|
||||
|
|
1
dlls/kernel32/tests/dummy.c
Normal file
1
dlls/kernel32/tests/dummy.c
Normal file
|
@ -0,0 +1 @@
|
|||
/* nothing here */
|
1
dlls/kernel32/tests/dummy.spec
Normal file
1
dlls/kernel32/tests/dummy.spec
Normal file
|
@ -0,0 +1 @@
|
|||
# nothing here
|
|
@ -3294,7 +3294,8 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl,
|
|||
status = get_manifest_in_pe_file( acl, ai, nameW.Buffer, directory, FALSE, file,
|
||||
(LPCWSTR)CREATEPROCESS_MANIFEST_RESOURCE_ID, 0 );
|
||||
NtClose( file );
|
||||
break;
|
||||
if (status == STATUS_SUCCESS)
|
||||
break;
|
||||
}
|
||||
RtlFreeUnicodeString( &nameW );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue