Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/schedsvc/atsvc.c | 3 ++- dlls/schedsvc/tests/atsvcapi.c | 8 +++++--- include/wine/atsvc.idl | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/schedsvc/atsvc.c b/dlls/schedsvc/atsvc.c index 83e7dcadbc..2010245fc6 100644 --- a/dlls/schedsvc/atsvc.c +++ b/dlls/schedsvc/atsvc.c @@ -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; } }
diff --git a/dlls/schedsvc/tests/atsvcapi.c b/dlls/schedsvc/tests/atsvcapi.c index 2226480a35..367c6dabc1 100644 --- a/dlls/schedsvc/tests/atsvcapi.c +++ b/dlls/schedsvc/tests/atsvcapi.c @@ -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 || diff --git a/include/wine/atsvc.idl b/include/wine/atsvc.idl index c1fce98074..5c723ed679 100644 --- a/include/wine/atsvc.idl +++ b/include/wine/atsvc.idl @@ -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