schedsvc/tests: Avoid a crash in a SchRpcRegisterTask test.

Signed-off-by: Detlef Riekenberg <wine.dev@web.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Detlef Riekenberg 2019-03-21 14:37:18 +01:00 committed by Alexandre Julliard
parent cdd5476cf0
commit 124dbb84b5

View file

@ -526,13 +526,16 @@ todo_wine
path = NULL;
info = NULL;
hr = SchRpcRegisterTask(NULL, xmlW, TASK_CREATE, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info);
ok(hr == S_OK, "expected S_OK, got %#x\n", hr);
ok(!info, "expected NULL, info %p\n", info);
hr = IIDFromString(path, &iid);
ok(hr == S_OK, "IIDFromString(%s) error %#x\n", wine_dbgstr_w(path), hr);
hr = SchRpcDelete(path, 0);
ok(hr == S_OK, "expected S_OK, got %#x\n", hr);
MIDL_user_free(path);
ok(hr == S_OK || hr == E_ACCESSDENIED, "expected S_OK, got %#x\n", hr);
if (hr != E_ACCESSDENIED)
{
ok(!info, "expected NULL, info %p\n", info);
hr = IIDFromString(path, &iid);
ok(hr == S_OK, "IIDFromString(%s) error %#x\n", wine_dbgstr_w(path), hr);
hr = SchRpcDelete(path, 0);
ok(hr == S_OK, "expected S_OK, got %#x\n", hr);
MIDL_user_free(path);
}
hr = RpcBindingFree(&rpc_handle);
ok(hr == RPC_S_OK, "RpcBindingFree error %#x\n", hr);