shcore: Build with msvcrt.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-06-20 09:10:42 +02:00
parent aa79882a26
commit 8c9f593e3b
2 changed files with 10 additions and 10 deletions

View file

@ -1,5 +1,7 @@
MODULE = shcore.dll MODULE = shcore.dll
IMPORTS = user32 gdi32 ole32 advapi32 IMPORTS = user32 gdi32 ole32 advapi32
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ C_SRCS = \
main.c main.c

View file

@ -17,7 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdarg.h> #include <stdarg.h>
#define COBJMACROS #define COBJMACROS
@ -33,7 +32,6 @@
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h" #include "wine/heap.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(shcore); WINE_DEFAULT_DEBUG_CHANNEL(shcore);
@ -389,12 +387,12 @@ WCHAR** WINAPI CommandLineToArgvW(const WCHAR *cmdline, int *numargs)
* with it. This way the caller can make a single LocalFree() call to free * with it. This way the caller can make a single LocalFree() call to free
* both, as per MSDN. * both, as per MSDN.
*/ */
argv = LocalAlloc(LMEM_FIXED, (argc + 1) * sizeof(WCHAR *) + (strlenW(cmdline) + 1) * sizeof(WCHAR)); argv = LocalAlloc(LMEM_FIXED, (argc + 1) * sizeof(WCHAR *) + (lstrlenW(cmdline) + 1) * sizeof(WCHAR));
if (!argv) if (!argv)
return NULL; return NULL;
/* --- Then split and copy the arguments */ /* --- Then split and copy the arguments */
argv[0] = d = strcpyW((WCHAR *)(argv + argc + 1), cmdline); argv[0] = d = lstrcpyW((WCHAR *)(argv + argc + 1), cmdline);
argc = 1; argc = 1;
/* The first argument, the executable path, follows special rules */ /* The first argument, the executable path, follows special rules */
if (*d == '"') if (*d == '"')
@ -1005,7 +1003,7 @@ static HRESULT WINAPI filestream_Stat(IStream *iface, STATSTG *statstg, DWORD fl
statstg->pwcsName = NULL; statstg->pwcsName = NULL;
else else
{ {
int len = strlenW(stream->u.file.path); int len = lstrlenW(stream->u.file.path);
if ((statstg->pwcsName = CoTaskMemAlloc((len + 1) * sizeof(WCHAR)))) if ((statstg->pwcsName = CoTaskMemAlloc((len + 1) * sizeof(WCHAR))))
memcpy(statstg->pwcsName, stream->u.file.path, (len + 1) * sizeof(WCHAR)); memcpy(statstg->pwcsName, stream->u.file.path, (len + 1) * sizeof(WCHAR));
} }
@ -1116,7 +1114,7 @@ HRESULT WINAPI SHCreateStreamOnFileEx(const WCHAR *path, DWORD mode, DWORD attri
stream->u.file.handle = hFile; stream->u.file.handle = hFile;
stream->u.file.mode = mode; stream->u.file.mode = mode;
len = strlenW(path); len = lstrlenW(path);
stream->u.file.path = heap_alloc((len + 1) * sizeof(WCHAR)); stream->u.file.path = heap_alloc((len + 1) * sizeof(WCHAR));
memcpy(stream->u.file.path, path, (len + 1) * sizeof(WCHAR)); memcpy(stream->u.file.path, path, (len + 1) * sizeof(WCHAR));
@ -1651,7 +1649,7 @@ HRESULT WINAPI SHStrDupW(const WCHAR *src, WCHAR **dest)
if (!src) if (!src)
return E_INVALIDARG; return E_INVALIDARG;
len = (strlenW(src) + 1) * sizeof(WCHAR); len = (lstrlenW(src) + 1) * sizeof(WCHAR);
*dest = CoTaskMemAlloc(len); *dest = CoTaskMemAlloc(len);
if (!*dest) if (!*dest)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
@ -1741,7 +1739,7 @@ DWORD WINAPI SHUnicodeToUnicode(const WCHAR *src, WCHAR *dest, int dest_len)
return 0; return 0;
lstrcpynW(dest, src, dest_len); lstrcpynW(dest, src, dest_len);
ret = strlenW(dest); ret = lstrlenW(dest);
return src[ret] ? 0 : ret + 1; return src[ret] ? 0 : ret + 1;
} }
@ -2077,7 +2075,7 @@ DWORD WINAPI SHQueryValueExW(HKEY hkey, const WCHAR *name, DWORD *reserved, DWOR
} }
else else
{ {
length = (strlenW(buff) + 1) * sizeof(WCHAR); length = (lstrlenW(buff) + 1) * sizeof(WCHAR);
value = heap_alloc(length); value = heap_alloc(length);
memcpy(value, buff, length); memcpy(value, buff, length);
length = ExpandEnvironmentStringsW(value, buff, *buff_len / sizeof(WCHAR)); length = ExpandEnvironmentStringsW(value, buff, *buff_len / sizeof(WCHAR));
@ -2208,7 +2206,7 @@ int WINAPI SHRegGetIntW(HKEY hkey, const WCHAR *value, int default_value)
return default_value; return default_value;
if (*buff >= '0' && *buff <= '9') if (*buff >= '0' && *buff <= '9')
return atoiW(buff); return wcstol(buff, NULL, 10);
return default_value; return default_value;
} }