Commit af0ede42 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

schedsvc/tests: Add a test for NULL task name passed to SchRpcRegisterTask.

parent ea248186
...@@ -180,6 +180,12 @@ HRESULT __cdecl SchRpcRegisterTask(const WCHAR *path, const WCHAR *xml, DWORD fl ...@@ -180,6 +180,12 @@ HRESULT __cdecl SchRpcRegisterTask(const WCHAR *path, const WCHAR *xml, DWORD fl
/* FIXME: assume that validation is performed on the client side */ /* FIXME: assume that validation is performed on the client side */
if (flags & TASK_VALIDATE_ONLY) return S_OK; if (flags & TASK_VALIDATE_ONLY) return S_OK;
if (!path)
{
FIXME("NULL name is not supported\n");
return E_INVALIDARG;
}
full_name = get_full_name(path, &relative_path); full_name = get_full_name(path, &relative_path);
if (!full_name) return E_OUTOFMEMORY; if (!full_name) return E_OUTOFMEMORY;
......
TESTDLL = schedsvc.dll TESTDLL = schedsvc.dll
IMPORTS = rpcrt4 IMPORTS = rpcrt4 ole32
C_SRCS = \ C_SRCS = \
rpcapi.c rpcapi.c
......
...@@ -99,6 +99,7 @@ START_TEST(rpcapi) ...@@ -99,6 +99,7 @@ START_TEST(rpcapi)
TASK_NAMES names; TASK_NAMES names;
unsigned char *binding_str; unsigned char *binding_str;
PTOP_LEVEL_EXCEPTION_FILTER old_exception_filter; PTOP_LEVEL_EXCEPTION_FILTER old_exception_filter;
IID iid;
hr = RpcStringBindingComposeA(NULL, ncalrpc, NULL, NULL, NULL, &binding_str); hr = RpcStringBindingComposeA(NULL, ncalrpc, NULL, NULL, NULL, &binding_str);
ok(hr == RPC_S_OK, "RpcStringBindingCompose error %#x\n", hr); ok(hr == RPC_S_OK, "RpcStringBindingCompose error %#x\n", hr);
...@@ -517,6 +518,21 @@ todo_wine ...@@ -517,6 +518,21 @@ todo_wine
hr = SchRpcDelete(Wine, 0); hr = SchRpcDelete(Wine, 0);
ok(hr == S_OK, "expected S_OK, got %#x\n", hr); ok(hr == S_OK, "expected S_OK, got %#x\n", hr);
path = NULL;
info = NULL;
hr = SchRpcRegisterTask(NULL, xmlW, TASK_CREATE, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info);
todo_wine
ok(hr == S_OK, "expected S_OK, got %#x\n", hr);
ok(!info, "expected NULL, info %p\n", info);
if (hr == S_OK)
{
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); hr = RpcBindingFree(&rpc_handle);
ok(hr == RPC_S_OK, "RpcBindingFree error %#x\n", hr); ok(hr == RPC_S_OK, "RpcBindingFree error %#x\n", hr);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment