Commit eb49e435 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernelbase/tests: Add test of assembly path of manifest embedded in exe module.

parent 2d764e90
......@@ -3,3 +3,6 @@ TESTDLL = kernelbase.dll
C_SRCS = \
path.c \
sync.c
RC_SRCS = \
rsrc.rc
......@@ -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();
}
/*
* 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
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity processorArchitecture="*" type="win32" name="Firefly" version="16.0.0.0" />
<description>Wine Test</description>
<file name="testdll.dll" />
</assembly>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment