From ffcced0f3906534e6765730d44d8e9d82bbf864e Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 20 Feb 2014 12:59:34 +0400 Subject: [PATCH] ole32/tests: Handle context generation failure better. --- dlls/ole32/tests/compobj.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index c96dfe0dee0..b85842bcae0 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -192,7 +192,13 @@ static HANDLE activate_context(const char *manifest, ULONG_PTR *cookie) actctx.lpSource = path; handle = pCreateActCtxW(&actctx); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + ok(handle != INVALID_HANDLE_VALUE || broken(handle == INVALID_HANDLE_VALUE) /* some old XP/2k3 versions */, + "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + if (handle == INVALID_HANDLE_VALUE) + { + win_skip("activation context generation failed, some tests will be skipped\n"); + handle = NULL; + } ok(actctx.cbSize == sizeof(ACTCTXW), "actctx.cbSize=%d\n", actctx.cbSize); ok(actctx.dwFlags == 0, "actctx.dwFlags=%d\n", actctx.dwFlags); @@ -206,8 +212,11 @@ static HANDLE activate_context(const char *manifest, ULONG_PTR *cookie) DeleteFileA("file.manifest"); - ret = pActivateActCtx(handle, cookie); - ok(ret, "ActivateActCtx failed: %u\n", GetLastError()); + if (handle) + { + ret = pActivateActCtx(handle, cookie); + ok(ret, "ActivateActCtx failed: %u\n", GetLastError()); + } return handle; }