Commit 31d20265 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

schedsvc: Fix NetrJobGetInfo return value in case of invalid job id.

parent 998eef6e
......@@ -686,7 +686,7 @@ DWORD __cdecl NetrJobEnum(ATSVC_HANDLE server_name, AT_ENUM_CONTAINER *container
DWORD __cdecl NetrJobGetInfo(ATSVC_HANDLE server_name, DWORD jobid, AT_INFO **info)
{
struct job_t *job;
DWORD ret = ERROR_SUCCESS;
DWORD ret = APE_AT_ID_NOT_FOUND;
TRACE("%s,%u,%p\n", debugstr_w(server_name), jobid, info);
......@@ -706,6 +706,7 @@ DWORD __cdecl NetrJobGetInfo(ATSVC_HANDLE server_name, DWORD jobid, AT_INFO **in
info_ret->Flags = job->info.Flags;
info_ret->Command = heap_strdupW(job->info.Command);
*info = info_ret;
ret = ERROR_SUCCESS;
}
}
......
......@@ -58,7 +58,7 @@ START_TEST(atsvcapi)
WCHAR server_name[MAX_COMPUTERNAME_LENGTH + 1];
PTOP_LEVEL_EXCEPTION_FILTER old_exception_filter;
AT_ENUM_CONTAINER container;
AT_INFO info;
AT_INFO info, *info2;
DWORD ret, i, total, start_index, jobid, try, try_count;
BOOL found;
......@@ -104,6 +104,10 @@ START_TEST(atsvcapi)
test_failures = 1;
test_skipped = 0;
info2 = NULL;
ret = NetrJobGetInfo(server_name, 0xdeadbeef, &info2);
ok(ret == APE_AT_ID_NOT_FOUND || broken(1) /* vista and w2008 return rubbish here */, "wrong error %u\n", ret);
try_count = 5;
for (try = 1; try <= try_count; try++)
......@@ -127,8 +131,6 @@ START_TEST(atsvcapi)
for (i = 0; i < container.EntriesRead; i++)
{
AT_INFO *info2;
trace("%u: jobid %u, command %s\n", i, container.Buffer[i].JobId, wine_dbgstr_w(container.Buffer[i].Command));
if (container.Buffer[i].JobId == jobid ||
......
......@@ -29,6 +29,8 @@ import "ocidl.idl";
]
interface atsvc
{
const DWORD APE_AT_ID_NOT_FOUND = 0x00000ede;
typedef [handle] const WCHAR *ATSVC_HANDLE;
typedef struct _AT_ENUM
......
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