schedsvc: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-02-17 07:12:33 +01:00 committed by Alexandre Julliard
parent 486ad92d55
commit a9bb877631
4 changed files with 51 additions and 52 deletions

View File

@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = schedsvc.dll MODULE = schedsvc.dll
IMPORTS = rpcrt4 advapi32 ole32 IMPORTS = rpcrt4 advapi32 ole32

View File

@ -335,7 +335,7 @@ static DWORD load_unicode_strings(const char *data, DWORD limit, struct job_t *j
{ {
if (limit < sizeof(USHORT)) if (limit < sizeof(USHORT))
{ {
TRACE("invalid string %u offset\n", i); TRACE("invalid string %lu offset\n", i);
break; break;
} }
@ -345,11 +345,11 @@ static DWORD load_unicode_strings(const char *data, DWORD limit, struct job_t *j
limit -= sizeof(USHORT); limit -= sizeof(USHORT);
if (limit < len * sizeof(WCHAR)) if (limit < len * sizeof(WCHAR))
{ {
TRACE("invalid string %u size\n", i); TRACE("invalid string %lu size\n", i);
break; break;
} }
TRACE("string %u: %s\n", i, wine_dbgstr_wn((const WCHAR *)data, len)); TRACE("string %lu: %s\n", i, wine_dbgstr_wn((const WCHAR *)data, len));
switch (i) switch (i)
{ {
@ -439,7 +439,7 @@ static BOOL load_job_data(const char *data, DWORD size, struct job_t *info)
TRACE("invalid name_size_offset\n"); TRACE("invalid name_size_offset\n");
return FALSE; return FALSE;
} }
TRACE("unicode strings end at %#x\n", fixed->name_size_offset + unicode_strings_size); TRACE("unicode strings end at %#lx\n", fixed->name_size_offset + unicode_strings_size);
if (size < fixed->trigger_offset + sizeof(USHORT)) if (size < fixed->trigger_offset + sizeof(USHORT))
{ {
@ -449,7 +449,7 @@ static BOOL load_job_data(const char *data, DWORD size, struct job_t *info)
info->trigger_count = *(const USHORT *)(data + fixed->trigger_offset); info->trigger_count = *(const USHORT *)(data + fixed->trigger_offset);
TRACE("trigger_count %u\n", info->trigger_count); TRACE("trigger_count %u\n", info->trigger_count);
triggers_size = size - fixed->trigger_offset - sizeof(USHORT); triggers_size = size - fixed->trigger_offset - sizeof(USHORT);
TRACE("triggers_size %u\n", triggers_size); TRACE("triggers_size %lu\n", triggers_size);
data += fixed->name_size_offset + unicode_strings_size; data += fixed->name_size_offset + unicode_strings_size;
size -= fixed->name_size_offset + unicode_strings_size; size -= fixed->name_size_offset + unicode_strings_size;
@ -467,7 +467,7 @@ static BOOL load_job_data(const char *data, DWORD size, struct job_t *info)
TRACE("no space for user data\n"); TRACE("no space for user data\n");
return FALSE; return FALSE;
} }
TRACE("User Data size %#x\n", data_size); TRACE("User Data size %#lx\n", data_size);
size -= sizeof(USHORT) + data_size; size -= sizeof(USHORT) + data_size;
data += sizeof(USHORT) + data_size; data += sizeof(USHORT) + data_size;
@ -485,13 +485,13 @@ static BOOL load_job_data(const char *data, DWORD size, struct job_t *info)
TRACE("no space for reserved data\n"); TRACE("no space for reserved data\n");
return FALSE; return FALSE;
} }
TRACE("Reserved Data size %#x\n", data_size); TRACE("Reserved Data size %#lx\n", data_size);
size -= sizeof(USHORT) + data_size; size -= sizeof(USHORT) + data_size;
data += sizeof(USHORT) + data_size; data += sizeof(USHORT) + data_size;
/* Trigger Data */ /* Trigger Data */
TRACE("trigger_offset %04x, triggers end at %04x\n", fixed->trigger_offset, TRACE("trigger_offset %04x, triggers end at %04lx\n", fixed->trigger_offset,
(DWORD)(fixed->trigger_offset + sizeof(USHORT) + info->trigger_count * sizeof(TASK_TRIGGER))); (DWORD)(fixed->trigger_offset + sizeof(USHORT) + info->trigger_count * sizeof(TASK_TRIGGER)));
info->trigger_count = *(const USHORT *)data; info->trigger_count = *(const USHORT *)data;
@ -525,9 +525,9 @@ static BOOL load_job_data(const char *data, DWORD size, struct job_t *info)
TRACE("wEndDay = %u\n", trigger[i].wEndDay); TRACE("wEndDay = %u\n", trigger[i].wEndDay);
TRACE("wStartHour = %u\n", trigger[i].wStartHour); TRACE("wStartHour = %u\n", trigger[i].wStartHour);
TRACE("wStartMinute = %u\n", trigger[i].wStartMinute); TRACE("wStartMinute = %u\n", trigger[i].wStartMinute);
TRACE("MinutesDuration = %u\n", trigger[i].MinutesDuration); TRACE("MinutesDuration = %lu\n", trigger[i].MinutesDuration);
TRACE("MinutesInterval = %u\n", trigger[i].MinutesInterval); TRACE("MinutesInterval = %lu\n", trigger[i].MinutesInterval);
TRACE("rgFlags = %u\n", trigger[i].rgFlags); TRACE("rgFlags = %lu\n", trigger[i].rgFlags);
TRACE("TriggerType = %u\n", trigger[i].TriggerType); TRACE("TriggerType = %u\n", trigger[i].TriggerType);
TRACE("Reserved2 = %u\n", trigger[i].Reserved2); TRACE("Reserved2 = %u\n", trigger[i].Reserved2);
TRACE("wRandomMinutesInterval = %u\n", trigger[i].wRandomMinutesInterval); TRACE("wRandomMinutesInterval = %u\n", trigger[i].wRandomMinutesInterval);
@ -563,7 +563,7 @@ static BOOL load_job(const WCHAR *name, struct job_t *info)
file = CreateFileW(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); file = CreateFileW(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
if (file == INVALID_HANDLE_VALUE) if (file == INVALID_HANDLE_VALUE)
{ {
TRACE("Failed to open %s, error %u\n", debugstr_w(name), GetLastError()); TRACE("Failed to open %s, error %lu\n", debugstr_w(name), GetLastError());
if (GetLastError() != ERROR_SHARING_VIOLATION || try++ >= 3) break; if (GetLastError() != ERROR_SHARING_VIOLATION || try++ >= 3) break;
Sleep(100); Sleep(100);
continue; continue;
@ -574,7 +574,7 @@ static BOOL load_job(const WCHAR *name, struct job_t *info)
mapping = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, 0); mapping = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, 0);
if (!mapping) if (!mapping)
{ {
TRACE("Failed to create file mapping %s, error %u\n", debugstr_w(name), GetLastError()); TRACE("Failed to create file mapping %s, error %lu\n", debugstr_w(name), GetLastError());
CloseHandle(file); CloseHandle(file);
break; break;
} }
@ -880,7 +880,7 @@ static void update_job_status(struct job_t *job)
if (GetLastError() != ERROR_SHARING_VIOLATION || try++ >= 3) if (GetLastError() != ERROR_SHARING_VIOLATION || try++ >= 3)
{ {
TRACE("Failed to update %s, error %u\n", debugstr_w(job->name), GetLastError()); TRACE("Failed to update %s, error %lu\n", debugstr_w(job->name), GetLastError());
return; return;
} }
Sleep(100); Sleep(100);
@ -1131,7 +1131,7 @@ DWORD __cdecl NetrJobAdd(ATSVC_HANDLE server_name, AT_INFO *info, DWORD *jobid)
if (GetLastError() != ERROR_FILE_EXISTS) if (GetLastError() != ERROR_FILE_EXISTS)
{ {
TRACE("create_job error %u\n", GetLastError()); TRACE("create_job error %lu\n", GetLastError());
return GetLastError(); return GetLastError();
} }
@ -1145,7 +1145,7 @@ DWORD __cdecl NetrJobDel(ATSVC_HANDLE server_name, DWORD min_jobid, DWORD max_jo
{ {
DWORD jobid, ret = APE_AT_ID_NOT_FOUND; DWORD jobid, ret = APE_AT_ID_NOT_FOUND;
TRACE("%s,%u,%u\n", debugstr_w(server_name), min_jobid, max_jobid); TRACE("%s,%lu,%lu\n", debugstr_w(server_name), min_jobid, max_jobid);
EnterCriticalSection(&at_job_list_section); EnterCriticalSection(&at_job_list_section);
@ -1155,7 +1155,7 @@ DWORD __cdecl NetrJobDel(ATSVC_HANDLE server_name, DWORD min_jobid, DWORD max_jo
if (!job) if (!job)
{ {
TRACE("job %u not found\n", jobid); TRACE("job %lu not found\n", jobid);
ret = APE_AT_ID_NOT_FOUND; ret = APE_AT_ID_NOT_FOUND;
break; break;
} }
@ -1190,7 +1190,7 @@ DWORD __cdecl NetrJobEnum(ATSVC_HANDLE server_name, AT_ENUM_CONTAINER *container
DWORD allocated; DWORD allocated;
struct job_t *job; struct job_t *job;
TRACE("%s,%p,%u,%p,%p\n", debugstr_w(server_name), container, max_length, total, resume); TRACE("%s,%p,%lu,%p,%p\n", debugstr_w(server_name), container, max_length, total, resume);
*total = 0; *total = 0;
*resume = 0; *resume = 0;
@ -1242,7 +1242,7 @@ DWORD __cdecl NetrJobGetInfo(ATSVC_HANDLE server_name, DWORD jobid, AT_INFO **in
struct job_t *job; struct job_t *job;
DWORD ret = APE_AT_ID_NOT_FOUND; DWORD ret = APE_AT_ID_NOT_FOUND;
TRACE("%s,%u,%p\n", debugstr_w(server_name), jobid, info); TRACE("%s,%lu,%p\n", debugstr_w(server_name), jobid, info);
EnterCriticalSection(&at_job_list_section); EnterCriticalSection(&at_job_list_section);

View File

@ -170,7 +170,7 @@ HRESULT __cdecl SchRpcRegisterTask(const WCHAR *path, const WCHAR *xml, DWORD fl
DWORD disposition; DWORD disposition;
HRESULT hr; HRESULT hr;
TRACE("%s,%s,%#x,%s,%u,%u,%p,%p,%p\n", debugstr_w(path), debugstr_w(xml), flags, TRACE("%s,%s,%#lx,%s,%lu,%lu,%p,%p,%p\n", debugstr_w(path), debugstr_w(xml), flags,
debugstr_w(sddl), task_logon_type, n_creds, creds, actual_path, xml_error_info); debugstr_w(sddl), task_logon_type, n_creds, creds, actual_path, xml_error_info);
*actual_path = NULL; *actual_path = NULL;
@ -332,7 +332,7 @@ HRESULT __cdecl SchRpcCreateFolder(const WCHAR *path, const WCHAR *sddl, DWORD f
WCHAR *full_name; WCHAR *full_name;
HRESULT hr; HRESULT hr;
TRACE("%s,%s,%#x\n", debugstr_w(path), debugstr_w(sddl), flags); TRACE("%s,%s,%#lx\n", debugstr_w(path), debugstr_w(sddl), flags);
if (flags) return E_INVALIDARG; if (flags) return E_INVALIDARG;
@ -347,13 +347,13 @@ HRESULT __cdecl SchRpcCreateFolder(const WCHAR *path, const WCHAR *sddl, DWORD f
HRESULT __cdecl SchRpcSetSecurity(const WCHAR *path, const WCHAR *sddl, DWORD flags) HRESULT __cdecl SchRpcSetSecurity(const WCHAR *path, const WCHAR *sddl, DWORD flags)
{ {
FIXME("%s,%s,%#x: stub\n", debugstr_w(path), debugstr_w(sddl), flags); FIXME("%s,%s,%#lx: stub\n", debugstr_w(path), debugstr_w(sddl), flags);
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT __cdecl SchRpcGetSecurity(const WCHAR *path, DWORD flags, WCHAR **sddl) HRESULT __cdecl SchRpcGetSecurity(const WCHAR *path, DWORD flags, WCHAR **sddl)
{ {
FIXME("%s,%#x,%p: stub\n", debugstr_w(path), flags, sddl); FIXME("%s,%#lx,%p: stub\n", debugstr_w(path), flags, sddl);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -398,7 +398,7 @@ HRESULT __cdecl SchRpcEnumFolders(const WCHAR *path, DWORD flags, DWORD *start_i
DWORD allocated, count, index; DWORD allocated, count, index;
TASK_NAMES list; TASK_NAMES list;
TRACE("%s,%#x,%u,%u,%p,%p\n", debugstr_w(path), flags, *start_index, n_requested, n_names, names); TRACE("%s,%#lx,%lu,%lu,%p,%p\n", debugstr_w(path), flags, *start_index, n_requested, n_names, names);
*n_names = 0; *n_names = 0;
*names = NULL; *names = NULL;
@ -506,7 +506,7 @@ HRESULT __cdecl SchRpcEnumTasks(const WCHAR *path, DWORD flags, DWORD *start_ind
DWORD allocated, count, index; DWORD allocated, count, index;
TASK_NAMES list; TASK_NAMES list;
TRACE("%s,%#x,%u,%u,%p,%p\n", debugstr_w(path), flags, *start_index, n_requested, n_names, names); TRACE("%s,%#lx,%lu,%lu,%p,%p\n", debugstr_w(path), flags, *start_index, n_requested, n_names, names);
*n_names = 0; *n_names = 0;
*names = NULL; *names = NULL;
@ -604,7 +604,7 @@ HRESULT __cdecl SchRpcEnumTasks(const WCHAR *path, DWORD flags, DWORD *start_ind
HRESULT __cdecl SchRpcEnumInstances(const WCHAR *path, DWORD flags, DWORD *n_guids, GUID **guids) HRESULT __cdecl SchRpcEnumInstances(const WCHAR *path, DWORD flags, DWORD *n_guids, GUID **guids)
{ {
FIXME("%s,%#x,%p,%p: stub\n", debugstr_w(path), flags, n_guids, guids); FIXME("%s,%#lx,%p,%p: stub\n", debugstr_w(path), flags, n_guids, guids);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -618,20 +618,20 @@ HRESULT __cdecl SchRpcGetInstanceInfo(GUID guid, WCHAR **path, DWORD *task_state
HRESULT __cdecl SchRpcStopInstance(GUID guid, DWORD flags) HRESULT __cdecl SchRpcStopInstance(GUID guid, DWORD flags)
{ {
FIXME("%s,%#x: stub\n", wine_dbgstr_guid(&guid), flags); FIXME("%s,%#lx: stub\n", wine_dbgstr_guid(&guid), flags);
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT __cdecl SchRpcStop(const WCHAR *path, DWORD flags) HRESULT __cdecl SchRpcStop(const WCHAR *path, DWORD flags)
{ {
FIXME("%s,%#x: stub\n", debugstr_w(path), flags); FIXME("%s,%#lx: stub\n", debugstr_w(path), flags);
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT __cdecl SchRpcRun(const WCHAR *path, DWORD n_args, const WCHAR **args, DWORD flags, HRESULT __cdecl SchRpcRun(const WCHAR *path, DWORD n_args, const WCHAR **args, DWORD flags,
DWORD session_id, const WCHAR *user, GUID *guid) DWORD session_id, const WCHAR *user, GUID *guid)
{ {
FIXME("%s,%u,%p,%#x,%#x,%s,%p: stub\n", debugstr_w(path), n_args, args, flags, FIXME("%s,%lu,%p,%#lx,%#lx,%s,%p: stub\n", debugstr_w(path), n_args, args, flags,
session_id, debugstr_w(user), guid); session_id, debugstr_w(user), guid);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -641,7 +641,7 @@ HRESULT __cdecl SchRpcDelete(const WCHAR *path, DWORD flags)
WCHAR *full_name; WCHAR *full_name;
HRESULT hr = S_OK; HRESULT hr = S_OK;
TRACE("%s,%#x\n", debugstr_w(path), flags); TRACE("%s,%#lx\n", debugstr_w(path), flags);
if (flags) return E_INVALIDARG; if (flags) return E_INVALIDARG;
@ -664,14 +664,14 @@ HRESULT __cdecl SchRpcDelete(const WCHAR *path, DWORD flags)
HRESULT __cdecl SchRpcRename(const WCHAR *path, const WCHAR *name, DWORD flags) HRESULT __cdecl SchRpcRename(const WCHAR *path, const WCHAR *name, DWORD flags)
{ {
FIXME("%s,%s,%#x: stub\n", debugstr_w(path), debugstr_w(name), flags); FIXME("%s,%s,%#lx: stub\n", debugstr_w(path), debugstr_w(name), flags);
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT __cdecl SchRpcScheduledRuntimes(const WCHAR *path, SYSTEMTIME *start, SYSTEMTIME *end, DWORD flags, HRESULT __cdecl SchRpcScheduledRuntimes(const WCHAR *path, SYSTEMTIME *start, SYSTEMTIME *end, DWORD flags,
DWORD n_requested, DWORD *n_runtimes, SYSTEMTIME **runtimes) DWORD n_requested, DWORD *n_runtimes, SYSTEMTIME **runtimes)
{ {
FIXME("%s,%p,%p,%#x,%u,%p,%p: stub\n", debugstr_w(path), start, end, flags, FIXME("%s,%p,%p,%#lx,%lu,%p,%p: stub\n", debugstr_w(path), start, end, flags,
n_requested, n_runtimes, runtimes); n_requested, n_runtimes, runtimes);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -687,7 +687,7 @@ HRESULT __cdecl SchRpcGetTaskInfo(const WCHAR *path, DWORD flags, DWORD *enabled
WCHAR *full_name, *xml; WCHAR *full_name, *xml;
HRESULT hr; HRESULT hr;
FIXME("%s,%#x,%p,%p: stub\n", debugstr_w(path), flags, enabled, task_state); FIXME("%s,%#lx,%p,%p: stub\n", debugstr_w(path), flags, enabled, task_state);
full_name = get_full_name(path, NULL); full_name = get_full_name(path, NULL);
if (!full_name) return E_OUTOFMEMORY; if (!full_name) return E_OUTOFMEMORY;
@ -710,6 +710,6 @@ HRESULT __cdecl SchRpcGetNumberOfMissedRuns(const WCHAR *path, DWORD *runs)
HRESULT __cdecl SchRpcEnableTask(const WCHAR *path, DWORD enabled) HRESULT __cdecl SchRpcEnableTask(const WCHAR *path, DWORD enabled)
{ {
FIXME("%s,%u: stub\n", debugstr_w(path), enabled); FIXME("%s,%lu: stub\n", debugstr_w(path), enabled);
return E_NOTIMPL; return E_NOTIMPL;
} }

View File

@ -81,7 +81,7 @@ static DWORD WINAPI tasks_monitor_thread(void *arg)
NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, NULL); NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, NULL);
if (htasks == INVALID_HANDLE_VALUE) if (htasks == INVALID_HANDLE_VALUE)
{ {
ERR("Couldn't start monitoring %s for tasks, error %u\n", debugstr_w(path), GetLastError()); ERR("Couldn't start monitoring %s for tasks, error %lu\n", debugstr_w(path), GetLastError());
return -1; return -1;
} }
@ -146,11 +146,11 @@ static DWORD WINAPI tasks_monitor_thread(void *arg)
{ {
if (msg == JOB_OBJECT_MSG_EXIT_PROCESS) if (msg == JOB_OBJECT_MSG_EXIT_PROCESS)
{ {
TRACE("got message: process %#lx has terminated\n", pid); TRACE("got message: process %#Ix has terminated\n", pid);
update_process_status(pid); update_process_status(pid);
} }
else else
FIXME("got message %#x from the job\n", msg); FIXME("got message %#lx from the job\n", msg);
} }
continue; continue;
} }
@ -191,7 +191,7 @@ static DWORD WINAPI tasks_monitor_thread(void *arg)
break; break;
default: default:
FIXME("%s: action %#x not handled\n", debugstr_w(info.data.FileName), info.data.Action); FIXME("%s: action %#lx not handled\n", debugstr_w(info.data.FileName), info.data.Action);
break; break;
} }
@ -235,7 +235,7 @@ void schedsvc_auto_start(void)
scm = OpenSCManagerW(NULL, NULL, 0); scm = OpenSCManagerW(NULL, NULL, 0);
if (!scm) if (!scm)
{ {
WARN("failed to open SCM (%u)\n", GetLastError()); WARN("failed to open SCM (%lu)\n", GetLastError());
return; return;
} }
@ -261,12 +261,12 @@ void schedsvc_auto_start(void)
} }
} }
else else
WARN("failed to query service config (%u)\n", GetLastError()); WARN("failed to query service config (%lu)\n", GetLastError());
CloseServiceHandle(service); CloseServiceHandle(service);
} }
else else
WARN("failed to open service (%u)\n", GetLastError()); WARN("failed to open service (%lu)\n", GetLastError());
CloseServiceHandle(scm); CloseServiceHandle(scm);
} }
@ -289,7 +289,7 @@ static void schedsvc_update_status(DWORD state)
static void WINAPI schedsvc_handler(DWORD control) static void WINAPI schedsvc_handler(DWORD control)
{ {
TRACE("%#x\n", control); TRACE("%#lx\n", control);
switch (control) switch (control)
{ {
@ -318,14 +318,14 @@ static RPC_STATUS RPC_init(void)
status = RpcServerRegisterIf(ITaskSchedulerService_v1_0_s_ifspec, NULL, NULL); status = RpcServerRegisterIf(ITaskSchedulerService_v1_0_s_ifspec, NULL, NULL);
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
ERR("RpcServerRegisterIf error %#x\n", status); ERR("RpcServerRegisterIf error %#lx\n", status);
return status; return status;
} }
status = RpcServerRegisterIf(atsvc_v1_0_s_ifspec, NULL, NULL); status = RpcServerRegisterIf(atsvc_v1_0_s_ifspec, NULL, NULL);
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
ERR("RpcServerRegisterIf error %#x\n", status); ERR("RpcServerRegisterIf error %#lx\n", status);
RpcServerUnregisterIf(ITaskSchedulerService_v1_0_s_ifspec, NULL, FALSE); RpcServerUnregisterIf(ITaskSchedulerService_v1_0_s_ifspec, NULL, FALSE);
return status; return status;
} }
@ -333,42 +333,42 @@ static RPC_STATUS RPC_init(void)
status = RpcServerUseProtseqEpW(ncacn_npW, RPC_C_PROTSEQ_MAX_REQS_DEFAULT, endpoint_npW, NULL); status = RpcServerUseProtseqEpW(ncacn_npW, RPC_C_PROTSEQ_MAX_REQS_DEFAULT, endpoint_npW, NULL);
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
ERR("RpcServerUseProtseqEp error %#x\n", status); ERR("RpcServerUseProtseqEp error %#lx\n", status);
return status; return status;
} }
status = RpcServerUseProtseqEpW(ncalrpcW, RPC_C_PROTSEQ_MAX_REQS_DEFAULT, endpoint_lrpcW, NULL); status = RpcServerUseProtseqEpW(ncalrpcW, RPC_C_PROTSEQ_MAX_REQS_DEFAULT, endpoint_lrpcW, NULL);
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
ERR("RpcServerUseProtseqEp error %#x\n", status); ERR("RpcServerUseProtseqEp error %#lx\n", status);
return status; return status;
} }
status = RpcServerInqBindings(&sched_bindings); status = RpcServerInqBindings(&sched_bindings);
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
ERR("RpcServerInqBindings error %#x\n", status); ERR("RpcServerInqBindings error %#lx\n", status);
return status; return status;
} }
status = RpcEpRegisterW(ITaskSchedulerService_v1_0_s_ifspec, sched_bindings, NULL, NULL); status = RpcEpRegisterW(ITaskSchedulerService_v1_0_s_ifspec, sched_bindings, NULL, NULL);
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
ERR("RpcEpRegister error %#x\n", status); ERR("RpcEpRegister error %#lx\n", status);
return status; return status;
} }
status = RpcEpRegisterW(atsvc_v1_0_s_ifspec, sched_bindings, NULL, NULL); status = RpcEpRegisterW(atsvc_v1_0_s_ifspec, sched_bindings, NULL, NULL);
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
ERR("RpcEpRegister error %#x\n", status); ERR("RpcEpRegister error %#lx\n", status);
return status; return status;
} }
status = RpcServerListen(1, RPC_C_LISTEN_MAX_CALLS_DEFAULT, TRUE); status = RpcServerListen(1, RPC_C_LISTEN_MAX_CALLS_DEFAULT, TRUE);
if (status != RPC_S_OK) if (status != RPC_S_OK)
{ {
ERR("RpcServerListen error %#x\n", status); ERR("RpcServerListen error %#lx\n", status);
return status; return status;
} }
return RPC_S_OK; return RPC_S_OK;
@ -394,7 +394,7 @@ void WINAPI ServiceMain(DWORD argc, LPWSTR *argv)
schedsvc_handle = RegisterServiceCtrlHandlerW(scheduleW, schedsvc_handler); schedsvc_handle = RegisterServiceCtrlHandlerW(scheduleW, schedsvc_handler);
if (!schedsvc_handle) if (!schedsvc_handle)
{ {
ERR("RegisterServiceCtrlHandler error %d\n", GetLastError()); ERR("RegisterServiceCtrlHandler error %ld\n", GetLastError());
return; return;
} }