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>
This commit is contained in:
parent
998eef6eca
commit
31d2026537
|
@ -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)
|
DWORD __cdecl NetrJobGetInfo(ATSVC_HANDLE server_name, DWORD jobid, AT_INFO **info)
|
||||||
{
|
{
|
||||||
struct job_t *job;
|
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);
|
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->Flags = job->info.Flags;
|
||||||
info_ret->Command = heap_strdupW(job->info.Command);
|
info_ret->Command = heap_strdupW(job->info.Command);
|
||||||
*info = info_ret;
|
*info = info_ret;
|
||||||
|
ret = ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ START_TEST(atsvcapi)
|
||||||
WCHAR server_name[MAX_COMPUTERNAME_LENGTH + 1];
|
WCHAR server_name[MAX_COMPUTERNAME_LENGTH + 1];
|
||||||
PTOP_LEVEL_EXCEPTION_FILTER old_exception_filter;
|
PTOP_LEVEL_EXCEPTION_FILTER old_exception_filter;
|
||||||
AT_ENUM_CONTAINER container;
|
AT_ENUM_CONTAINER container;
|
||||||
AT_INFO info;
|
AT_INFO info, *info2;
|
||||||
DWORD ret, i, total, start_index, jobid, try, try_count;
|
DWORD ret, i, total, start_index, jobid, try, try_count;
|
||||||
BOOL found;
|
BOOL found;
|
||||||
|
|
||||||
|
@ -104,6 +104,10 @@ START_TEST(atsvcapi)
|
||||||
test_failures = 1;
|
test_failures = 1;
|
||||||
test_skipped = 0;
|
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;
|
try_count = 5;
|
||||||
|
|
||||||
for (try = 1; try <= try_count; try++)
|
for (try = 1; try <= try_count; try++)
|
||||||
|
@ -127,8 +131,6 @@ START_TEST(atsvcapi)
|
||||||
|
|
||||||
for (i = 0; i < container.EntriesRead; i++)
|
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));
|
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 ||
|
if (container.Buffer[i].JobId == jobid ||
|
||||||
|
|
|
@ -29,6 +29,8 @@ import "ocidl.idl";
|
||||||
]
|
]
|
||||||
interface atsvc
|
interface atsvc
|
||||||
{
|
{
|
||||||
|
const DWORD APE_AT_ID_NOT_FOUND = 0x00000ede;
|
||||||
|
|
||||||
typedef [handle] const WCHAR *ATSVC_HANDLE;
|
typedef [handle] const WCHAR *ATSVC_HANDLE;
|
||||||
|
|
||||||
typedef struct _AT_ENUM
|
typedef struct _AT_ENUM
|
||||||
|
|
Loading…
Reference in New Issue