[KERNEL32_WINETEST] Addendum to r65511.
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 28 Nov 2014 19:22:34 +0000 (19:22 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 28 Nov 2014 19:22:34 +0000 (19:22 +0000)
svn path=/trunk/; revision=65512

rostests/winetests/kernel32/actctx.c

index 792a292..5d4035a 100644 (file)
@@ -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)