ole32/tests: Handle context generation failure better.

This commit is contained in:
Nikolay Sivov 2014-02-20 12:59:34 +04:00 committed by Alexandre Julliard
parent eb19c39126
commit ffcced0f39
1 changed files with 12 additions and 3 deletions

View File

@ -192,7 +192,13 @@ static HANDLE activate_context(const char *manifest, ULONG_PTR *cookie)
actctx.lpSource = path; actctx.lpSource = path;
handle = pCreateActCtxW(&actctx); 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.cbSize == sizeof(ACTCTXW), "actctx.cbSize=%d\n", actctx.cbSize);
ok(actctx.dwFlags == 0, "actctx.dwFlags=%d\n", actctx.dwFlags); 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"); DeleteFileA("file.manifest");
if (handle)
{
ret = pActivateActCtx(handle, cookie); ret = pActivateActCtx(handle, cookie);
ok(ret, "ActivateActCtx failed: %u\n", GetLastError()); ok(ret, "ActivateActCtx failed: %u\n", GetLastError());
}
return handle; return handle;
} }