Commit 88680e52 authored by Alexandre Julliard's avatar Alexandre Julliard

schedsvc: Build with msvcrt.

parent 6dde50b1
MODULE = schedsvc.dll MODULE = schedsvc.dll
IMPORTS = rpcrt4 advapi32 ole32 IMPORTS = rpcrt4 advapi32 ole32
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ C_SRCS = \
atsvc.c \ atsvc.c \
schedsvc.c \ schedsvc.c \
......
...@@ -1096,9 +1096,9 @@ DWORD __cdecl NetrJobAdd(ATSVC_HANDLE server_name, AT_INFO *info, DWORD *jobid) ...@@ -1096,9 +1096,9 @@ DWORD __cdecl NetrJobAdd(ATSVC_HANDLE server_name, AT_INFO *info, DWORD *jobid)
static const WCHAR fmtW[] = { '\\','T','a','s','k','s','\\','A','t','%','u','.','j','o','b',0 }; static const WCHAR fmtW[] = { '\\','T','a','s','k','s','\\','A','t','%','u','.','j','o','b',0 };
WCHAR task_name[MAX_PATH], name[32]; WCHAR task_name[MAX_PATH], name[32];
strcpyW(task_name, windir); lstrcpyW(task_name, windir);
sprintfW(name, fmtW, current_jobid); swprintf(name, ARRAY_SIZE(name), fmtW, current_jobid);
strcatW(task_name, name); lstrcatW(task_name, name);
if (create_job(task_name, info)) if (create_job(task_name, info))
{ {
struct job_t *job; struct job_t *job;
......
...@@ -46,17 +46,17 @@ static WCHAR *get_full_name(const WCHAR *path, WCHAR **relative_path) ...@@ -46,17 +46,17 @@ static WCHAR *get_full_name(const WCHAR *path, WCHAR **relative_path)
int len; int len;
len = GetSystemDirectoryW(NULL, 0); len = GetSystemDirectoryW(NULL, 0);
len += strlenW(tasksW) + strlenW(path); len += lstrlenW(tasksW) + lstrlenW(path);
target = heap_alloc(len * sizeof(WCHAR)); target = heap_alloc(len * sizeof(WCHAR));
if (target) if (target)
{ {
GetSystemDirectoryW(target, len); GetSystemDirectoryW(target, len);
strcatW(target, tasksW); lstrcatW(target, tasksW);
if (relative_path) if (relative_path)
*relative_path = target + strlenW(target) - 1; *relative_path = target + lstrlenW(target) - 1;
while (*path == '\\') path++; while (*path == '\\') path++;
strcatW(target, path); lstrcatW(target, path);
} }
return target; return target;
} }
...@@ -70,12 +70,12 @@ static HRESULT create_directory(const WCHAR *path) ...@@ -70,12 +70,12 @@ static HRESULT create_directory(const WCHAR *path)
WCHAR *new_path; WCHAR *new_path;
int len; int len;
new_path = heap_alloc((strlenW(path) + 1) * sizeof(WCHAR)); new_path = heap_alloc((lstrlenW(path) + 1) * sizeof(WCHAR));
if (!new_path) return E_OUTOFMEMORY; if (!new_path) return E_OUTOFMEMORY;
strcpyW(new_path, path); lstrcpyW(new_path, path);
len = strlenW(new_path); len = lstrlenW(new_path);
while (len && new_path[len - 1] == '\\') while (len && new_path[len - 1] == '\\')
{ {
new_path[len - 1] = 0; new_path[len - 1] = 0;
...@@ -87,7 +87,7 @@ static HRESULT create_directory(const WCHAR *path) ...@@ -87,7 +87,7 @@ static HRESULT create_directory(const WCHAR *path)
WCHAR *slash; WCHAR *slash;
DWORD last_error = GetLastError(); DWORD last_error = GetLastError();
if (last_error != ERROR_PATH_NOT_FOUND || !(slash = strrchrW(new_path, '\\'))) if (last_error != ERROR_PATH_NOT_FOUND || !(slash = wcsrchr(new_path, '\\')))
{ {
hr = HRESULT_FROM_WIN32(last_error); hr = HRESULT_FROM_WIN32(last_error);
break; break;
...@@ -184,10 +184,10 @@ HRESULT __cdecl SchRpcRegisterTask(const WCHAR *path, const WCHAR *xml, DWORD fl ...@@ -184,10 +184,10 @@ HRESULT __cdecl SchRpcRegisterTask(const WCHAR *path, const WCHAR *xml, DWORD fl
full_name = get_full_name(path, &relative_path); full_name = get_full_name(path, &relative_path);
if (!full_name) return E_OUTOFMEMORY; if (!full_name) return E_OUTOFMEMORY;
if (strchrW(path, '\\') || strchrW(path, '/')) if (wcschr(path, '\\') || wcschr(path, '/'))
{ {
WCHAR *p = strrchrW(full_name, '/'); WCHAR *p = wcsrchr(full_name, '/');
if (!p) p = strrchrW(full_name, '\\'); if (!p) p = wcsrchr(full_name, '\\');
*p = 0; *p = 0;
hr = create_directory(full_name); hr = create_directory(full_name);
if (hr != S_OK && hr != HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)) if (hr != S_OK && hr != HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS))
...@@ -410,14 +410,14 @@ HRESULT __cdecl SchRpcEnumFolders(const WCHAR *path, DWORD flags, DWORD *start_i ...@@ -410,14 +410,14 @@ HRESULT __cdecl SchRpcEnumFolders(const WCHAR *path, DWORD flags, DWORD *start_i
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;
if (strlenW(full_name) + 2 > MAX_PATH) if (lstrlenW(full_name) + 2 > MAX_PATH)
{ {
heap_free(full_name); heap_free(full_name);
return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE); return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE);
} }
strcpyW(pathW, full_name); lstrcpyW(pathW, full_name);
strcatW(pathW, allW); lstrcatW(pathW, allW);
heap_free(full_name); heap_free(full_name);
...@@ -518,14 +518,14 @@ HRESULT __cdecl SchRpcEnumTasks(const WCHAR *path, DWORD flags, DWORD *start_ind ...@@ -518,14 +518,14 @@ HRESULT __cdecl SchRpcEnumTasks(const WCHAR *path, DWORD flags, DWORD *start_ind
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;
if (strlenW(full_name) + 2 > MAX_PATH) if (lstrlenW(full_name) + 2 > MAX_PATH)
{ {
heap_free(full_name); heap_free(full_name);
return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE); return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE);
} }
strcpyW(pathW, full_name); lstrcpyW(pathW, full_name);
strcatW(pathW, allW); lstrcatW(pathW, allW);
heap_free(full_name); heap_free(full_name);
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#define __WINE_SCHEDSVC_PRIVATE_H__ #define __WINE_SCHEDSVC_PRIVATE_H__
#include "wine/heap.h" #include "wine/heap.h"
#include "wine/unicode.h"
void schedsvc_auto_start(void) DECLSPEC_HIDDEN; void schedsvc_auto_start(void) DECLSPEC_HIDDEN;
void add_job(const WCHAR *name) DECLSPEC_HIDDEN; void add_job(const WCHAR *name) DECLSPEC_HIDDEN;
...@@ -38,7 +37,7 @@ static inline WCHAR *heap_strdupW(const WCHAR *src) ...@@ -38,7 +37,7 @@ static inline WCHAR *heap_strdupW(const WCHAR *src)
WCHAR *dst; WCHAR *dst;
unsigned len; unsigned len;
if (!src) return NULL; if (!src) return NULL;
len = (strlenW(src) + 1) * sizeof(WCHAR); len = (lstrlenW(src) + 1) * sizeof(WCHAR);
if ((dst = heap_alloc(len))) memcpy(dst, src, len); if ((dst = heap_alloc(len))) memcpy(dst, src, len);
return dst; return dst;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment