Fabian Maurer : ntdll/actctx: Don' t stop looking for manifest if dll without manifest is found.
Alexandre Julliard
julliard at winehq.org
Wed Aug 29 16:10:46 CDT 2018
Module: wine
Branch: master
Commit: 56b3304a019486b52681a05d4b5454b475275e51
URL: https://source.winehq.org/git/wine.git/?a=commit;h=56b3304a019486b52681a05d4b5454b475275e51
Author: Fabian Maurer <dark.shadow4 at web.de>
Date: Sat Aug 25 19:48:37 2018 +0200
ntdll/actctx: Don't stop looking for manifest if dll without manifest is found.
Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/tests/Makefile.in | 7 ++++---
dlls/kernel32/tests/actctx.c | 36 +++++++++++++++++++++++++++++++++++-
dlls/kernel32/tests/dummy.c | 1 +
dlls/kernel32/tests/dummy.spec | 1 +
dlls/ntdll/actctx.c | 3 ++-
5 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/dlls/kernel32/tests/Makefile.in b/dlls/kernel32/tests/Makefile.in
index 2f2ac5f8..e06141d 100644
--- a/dlls/kernel32/tests/Makefile.in
+++ b/dlls/kernel32/tests/Makefile.in
@@ -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
diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index 96d9b8c..6891fbe 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -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");
diff --git a/dlls/kernel32/tests/dummy.c b/dlls/kernel32/tests/dummy.c
new file mode 100644
index 0000000..3053583
--- /dev/null
+++ b/dlls/kernel32/tests/dummy.c
@@ -0,0 +1 @@
+/* nothing here */
diff --git a/dlls/kernel32/tests/dummy.spec b/dlls/kernel32/tests/dummy.spec
new file mode 100644
index 0000000..b2a4ba5
--- /dev/null
+++ b/dlls/kernel32/tests/dummy.spec
@@ -0,0 +1 @@
+# nothing here
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index 53a8b06..08b6c50 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -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 );
}
More information about the wine-cvs
mailing list