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

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Dmitry Timoshkov 2018-04-25 11:29:45 +08:00 committed by Alexandre Julliard
parent 998eef6eca
commit 31d2026537
3 changed files with 9 additions and 4 deletions

View File

@ -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;
}
}

View File

@ -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 ||

View File

@ -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