schedsvc: Implement NetrJobDel.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2018-04-17 15:12:15 +08:00 committed by Alexandre Julliard
parent bab40d15a0
commit 934a64919d
1 changed files with 29 additions and 2 deletions

View File

@ -363,8 +363,35 @@ DWORD __cdecl NetrJobAdd(ATSVC_HANDLE server_name, AT_INFO *info, DWORD *jobid)
DWORD __cdecl NetrJobDel(ATSVC_HANDLE server_name, DWORD min_jobid, DWORD max_jobid)
{
FIXME("%s,%u,%u: stub\n", debugstr_w(server_name), min_jobid, max_jobid);
return ERROR_NOT_SUPPORTED;
DWORD jobid, ret = ERROR_FILE_NOT_FOUND;
TRACE("%s,%u,%u\n", debugstr_w(server_name), min_jobid, max_jobid);
EnterCriticalSection(&at_job_list_section);
for (jobid = min_jobid; jobid <= max_jobid; jobid++)
{
struct job_t *job = find_job(jobid, NULL);
if (!job)
{
TRACE("job %u not found\n", jobid);
ret = ERROR_FILE_NOT_FOUND;
break;
}
TRACE("deleting job %s\n", debugstr_w(job->name));
if (!DeleteFileW(job->name))
{
ret = GetLastError();
break;
}
ret = ERROR_SUCCESS;
}
LeaveCriticalSection(&at_job_list_section);
return ret;
}
static void free_container(AT_ENUM_CONTAINER *container)