From 0abf72fdee8caa96f45b319142f2050fc36f4a3d Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 28 Nov 2014 19:22:34 +0000 Subject: [PATCH] [KERNEL32_WINETEST] Addendum to r65511. svn path=/trunk/; revision=65512 --- rostests/winetests/kernel32/actctx.c | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/rostests/winetests/kernel32/actctx.c b/rostests/winetests/kernel32/actctx.c index 792a292b8d2..5d4035a4aff 100644 --- a/rostests/winetests/kernel32/actctx.c +++ b/rostests/winetests/kernel32/actctx.c @@ -2167,6 +2167,65 @@ todo_wine handle = pCreateActCtxA(&actctx); ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle); ok(GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND, "got error %d\n", GetLastError()); + + /* load manifest from lpAssemblyDirectory directory */ + write_manifest("testdir.manifest", manifest1); + GetTempPathA(sizeof(path)/sizeof(path[0]), path); + SetCurrentDirectoryA(path); + strcat(path, "assembly_dir"); + strcpy(dir, path); + strcat(path, "\\testdir.manifest"); + + memset(&actctx, 0, sizeof(actctx)); + actctx.cbSize = sizeof(actctx); + actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID; + actctx.lpSource = "testdir.manifest"; + actctx.lpAssemblyDirectory = dir; + + SetLastError(0xdeadbeef); + handle = pCreateActCtxA(&actctx); + ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle); + ok(GetLastError()==ERROR_PATH_NOT_FOUND || + broken(GetLastError()==ERROR_FILE_NOT_FOUND) /* WinXP */, + "got error %d\n", GetLastError()); + + CreateDirectoryA(dir, NULL); + memset(&actctx, 0, sizeof(actctx)); + actctx.cbSize = sizeof(actctx); + actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID; + actctx.lpSource = "testdir.manifest"; + actctx.lpAssemblyDirectory = dir; + + SetLastError(0xdeadbeef); + handle = pCreateActCtxA(&actctx); + ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %d\n", GetLastError()); + SetCurrentDirectoryW(work_dir); + + write_manifest("assembly_dir\\testdir.manifest", manifest1); + memset(&actctx, 0, sizeof(actctx)); + actctx.cbSize = sizeof(actctx); + actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID; + actctx.lpSource = "testdir.manifest"; + actctx.lpAssemblyDirectory = dir; + + handle = pCreateActCtxA(&actctx); + ok(handle != INVALID_HANDLE_VALUE, "got handle %p\n", handle); + pReleaseActCtx(handle); + + memset(&actctx, 0, sizeof(actctx)); + actctx.cbSize = sizeof(actctx); + actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID; + actctx.lpSource = path; + actctx.lpAssemblyDirectory = dir; + + handle = pCreateActCtxA(&actctx); + ok(handle != INVALID_HANDLE_VALUE, "got handle %p\n", handle); + pReleaseActCtx(handle); + + delete_manifest_file("testdir.manifest"); + delete_manifest_file("assembly_dir\\testdir.manifest"); + RemoveDirectoryA(dir); } static BOOL init_funcs(void)