diff --git a/dlls/kernelbase/tests/Makefile.in b/dlls/kernelbase/tests/Makefile.in index 22e4a17a581..fe7ab212e6e 100644 --- a/dlls/kernelbase/tests/Makefile.in +++ b/dlls/kernelbase/tests/Makefile.in @@ -3,3 +3,6 @@ TESTDLL = kernelbase.dll C_SRCS = \ path.c \ sync.c + +RC_SRCS = \ + rsrc.rc diff --git a/dlls/kernelbase/tests/path.c b/dlls/kernelbase/tests/path.c index d77eaebd913..2ee7b512b31 100644 --- a/dlls/kernelbase/tests/path.c +++ b/dlls/kernelbase/tests/path.c @@ -2337,6 +2337,26 @@ static void test_PathIsUNCEx(void) } } +static void test_actctx(void) +{ + ACTCTX_SECTION_KEYED_DATA data = { sizeof(data) }; + WCHAR exe_path[MAX_PATH]; + char buf[1024]; + ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *info = (void *)buf; + SIZE_T size; + BOOL b; + + b = FindActCtxSectionStringW(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION, L"testdll.dll", &data); + ok(b, "FindActCtxSectionString failed: %u\n", GetLastError()); + + b = QueryActCtxW(0, data.hActCtx, &data.ulAssemblyRosterIndex, AssemblyDetailedInformationInActivationContext, buf, sizeof(buf), &size); + ok(b, "QueryActCtx failed: %u\n", GetLastError()); + + GetModuleFileNameW(NULL, exe_path, ARRAY_SIZE(exe_path)); + ok(!lstrcmpW(info->lpAssemblyManifestPath, exe_path), "lpAssemblyManifestPath = %s expected %s\n", debugstr_w(info->lpAssemblyManifestPath), debugstr_w(exe_path)); + ok(!info->lpAssemblyDirectoryName, "lpAssemblyDirectoryName = %s\n", wine_dbgstr_w(info->lpAssemblyDirectoryName)); +} + START_TEST(path) { HMODULE hmod = LoadLibraryA("kernelbase.dll"); @@ -2386,4 +2406,5 @@ START_TEST(path) test_PathCchStripPrefix(); test_PathCchStripToRoot(); test_PathIsUNCEx(); + test_actctx(); } diff --git a/dlls/kernelbase/tests/rsrc.rc b/dlls/kernelbase/tests/rsrc.rc new file mode 100644 index 00000000000..57496b3ef2e --- /dev/null +++ b/dlls/kernelbase/tests/rsrc.rc @@ -0,0 +1,22 @@ +/* + * Copyright 2020 Jacek Caban + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "winuser.h" + +/* @makedep: test.manifest */ +1 RT_MANIFEST test.manifest diff --git a/dlls/kernelbase/tests/test.manifest b/dlls/kernelbase/tests/test.manifest new file mode 100644 index 00000000000..6dad9c5fdc6 --- /dev/null +++ b/dlls/kernelbase/tests/test.manifest @@ -0,0 +1,6 @@ + + + + Wine Test + +