Commit 18411a19 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Use wcscpy() instead of strcpyW().

parent 20f90c1f
...@@ -737,7 +737,7 @@ static WCHAR *strdupW(const WCHAR* str) ...@@ -737,7 +737,7 @@ static WCHAR *strdupW(const WCHAR* str)
if (!(ptr = RtlAllocateHeap(GetProcessHeap(), 0, (strlenW(str) + 1) * sizeof(WCHAR)))) if (!(ptr = RtlAllocateHeap(GetProcessHeap(), 0, (strlenW(str) + 1) * sizeof(WCHAR))))
return NULL; return NULL;
return strcpyW(ptr, str); return wcscpy(ptr, str);
} }
static WCHAR *xmlstrdupW(const xmlstr_t* str) static WCHAR *xmlstrdupW(const xmlstr_t* str)
...@@ -1098,7 +1098,7 @@ static WCHAR *build_assembly_dir(struct assembly_identity* ai) ...@@ -1098,7 +1098,7 @@ static WCHAR *build_assembly_dir(struct assembly_identity* ai)
if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, size ))) return NULL; if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, size ))) return NULL;
strcpyW( ret, arch ); wcscpy( ret, arch );
strcatW( ret, undW ); strcatW( ret, undW );
strcatW( ret, name ); strcatW( ret, name );
strcatW( ret, undW ); strcatW( ret, undW );
...@@ -1121,7 +1121,7 @@ static inline void append_string( WCHAR *buffer, const WCHAR *prefix, const WCHA ...@@ -1121,7 +1121,7 @@ static inline void append_string( WCHAR *buffer, const WCHAR *prefix, const WCHA
strcatW( buffer, prefix ); strcatW( buffer, prefix );
p += strlenW(p); p += strlenW(p);
*p++ = '"'; *p++ = '"';
strcpyW( p, str ); wcscpy( p, str );
p += strlenW(p); p += strlenW(p);
*p++ = '"'; *p++ = '"';
*p = 0; *p = 0;
...@@ -1152,7 +1152,7 @@ static WCHAR *build_assembly_id( const struct assembly_identity *ai ) ...@@ -1152,7 +1152,7 @@ static WCHAR *build_assembly_id( const struct assembly_identity *ai )
if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR) ))) if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR) )))
return NULL; return NULL;
if (ai->name) strcpyW( ret, ai->name ); if (ai->name) wcscpy( ret, ai->name );
else *ret = 0; else *ret = 0;
append_string( ret, archW, ai->arch ); append_string( ret, archW, ai->arch );
append_string( ret, public_keyW, ai->public_key ); append_string( ret, public_keyW, ai->public_key );
...@@ -3074,7 +3074,7 @@ static NTSTATUS get_manifest_in_associated_manifest( struct actctx_loader* acl, ...@@ -3074,7 +3074,7 @@ static NTSTATUS get_manifest_in_associated_manifest( struct actctx_loader* acl,
if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0,
(strlenW(filename) + 10) * sizeof(WCHAR) + sizeof(dotManifestW) ))) (strlenW(filename) + 10) * sizeof(WCHAR) + sizeof(dotManifestW) )))
return STATUS_NO_MEMORY; return STATUS_NO_MEMORY;
strcpyW( buffer, filename ); wcscpy( buffer, filename );
if (resid != 1) NTDLL_swprintf( buffer + strlenW(buffer), fmtW, resid ); if (resid != 1) NTDLL_swprintf( buffer + strlenW(buffer), fmtW, resid );
strcatW( buffer, dotManifestW ); strcatW( buffer, dotManifestW );
RtlInitUnicodeString( &nameW, buffer ); RtlInitUnicodeString( &nameW, buffer );
...@@ -3193,7 +3193,7 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit ...@@ -3193,7 +3193,7 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit
strlenW(user_shared_data->NtSystemRoot) * sizeof(WCHAR) ))) strlenW(user_shared_data->NtSystemRoot) * sizeof(WCHAR) )))
return STATUS_NO_MEMORY; return STATUS_NO_MEMORY;
strcpyW( path, user_shared_data->NtSystemRoot ); wcscpy( path, user_shared_data->NtSystemRoot );
memcpy( path + strlenW(path), manifest_dirW, sizeof(manifest_dirW) ); memcpy( path + strlenW(path), manifest_dirW, sizeof(manifest_dirW) );
if (!RtlDosPathNameToNtPathName_U( path, &path_us, NULL, NULL )) if (!RtlDosPathNameToNtPathName_U( path, &path_us, NULL, NULL ))
...@@ -3233,7 +3233,7 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit ...@@ -3233,7 +3233,7 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit
} }
path[path_us.Length/sizeof(WCHAR)] = '\\'; path[path_us.Length/sizeof(WCHAR)] = '\\';
strcpyW( path + path_us.Length/sizeof(WCHAR) + 1, file ); wcscpy( path + path_us.Length/sizeof(WCHAR) + 1, file );
RtlInitUnicodeString( &path_us, path ); RtlInitUnicodeString( &path_us, path );
*strrchrW(file, '.') = 0; /* remove .manifest extension */ *strrchrW(file, '.') = 0; /* remove .manifest extension */
...@@ -3289,7 +3289,7 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl, ...@@ -3289,7 +3289,7 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl,
* First 'appdir' is used as <dir>, if that failed * First 'appdir' is used as <dir>, if that failed
* it tries application manifest file path. * it tries application manifest file path.
*/ */
strcpyW( buffer, acl->actctx->appdir.info ); wcscpy( buffer, acl->actctx->appdir.info );
p = buffer + strlenW(buffer); p = buffer + strlenW(buffer);
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
...@@ -3300,10 +3300,10 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl, ...@@ -3300,10 +3300,10 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl,
} }
else *p++ = '\\'; else *p++ = '\\';
strcpyW( p, ai->name ); wcscpy( p, ai->name );
p += strlenW(p); p += strlenW(p);
strcpyW( p, dotDllW ); wcscpy( p, dotDllW );
if (RtlDosPathNameToNtPathName_U( buffer, &nameW, NULL, NULL )) if (RtlDosPathNameToNtPathName_U( buffer, &nameW, NULL, NULL ))
{ {
status = open_nt_file( &file, &nameW ); status = open_nt_file( &file, &nameW );
...@@ -3318,7 +3318,7 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl, ...@@ -3318,7 +3318,7 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl,
RtlFreeUnicodeString( &nameW ); RtlFreeUnicodeString( &nameW );
} }
strcpyW( p, dotManifestW ); wcscpy( p, dotManifestW );
if (RtlDosPathNameToNtPathName_U( buffer, &nameW, NULL, NULL )) if (RtlDosPathNameToNtPathName_U( buffer, &nameW, NULL, NULL ))
{ {
status = open_nt_file( &file, &nameW ); status = open_nt_file( &file, &nameW );
...@@ -5604,6 +5604,6 @@ NTSTATUS WINAPI RtlQueryActivationContextApplicationSettings( DWORD flags, HANDL ...@@ -5604,6 +5604,6 @@ NTSTATUS WINAPI RtlQueryActivationContextApplicationSettings( DWORD flags, HANDL
if (written) *written = strlenW(res) + 1; if (written) *written = strlenW(res) + 1;
if (size < strlenW(res)) return STATUS_BUFFER_TOO_SMALL; if (size < strlenW(res)) return STATUS_BUFFER_TOO_SMALL;
strcpyW( buffer, res ); wcscpy( buffer, res );
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
...@@ -348,7 +348,7 @@ static const char *add_dir_data_nameA( struct dir_data *data, const char *name ) ...@@ -348,7 +348,7 @@ static const char *add_dir_data_nameA( struct dir_data *data, const char *name )
static const WCHAR *add_dir_data_nameW( struct dir_data *data, const WCHAR *name ) static const WCHAR *add_dir_data_nameW( struct dir_data *data, const WCHAR *name )
{ {
WCHAR *ptr = get_dir_data_space( data, (strlenW( name ) + 1) * sizeof(WCHAR) ); WCHAR *ptr = get_dir_data_space( data, (strlenW( name ) + 1) * sizeof(WCHAR) );
if (ptr) strcpyW( ptr, name ); if (ptr) wcscpy( ptr, name );
return ptr; return ptr;
} }
......
...@@ -709,7 +709,7 @@ static void get_image_path( const char *argv0, UNICODE_STRING *path ) ...@@ -709,7 +709,7 @@ static void get_image_path( const char *argv0, UNICODE_STRING *path )
/* build builtin path inside system directory */ /* build builtin path inside system directory */
len = strlenW( system_dir ); len = strlenW( system_dir );
if (strlenW( name ) >= MAX_PATH - 4 - len) goto failed; if (strlenW( name ) >= MAX_PATH - 4 - len) goto failed;
strcpyW( full_name, system_dir ); wcscpy( full_name, system_dir );
strcatW( full_name, name ); strcatW( full_name, name );
if (!strchrW( name, '.' )) strcatW( full_name, exeW ); if (!strchrW( name, '.' )) strcatW( full_name, exeW );
} }
...@@ -744,7 +744,7 @@ static void set_library_wargv( char **argv, const UNICODE_STRING *image ) ...@@ -744,7 +744,7 @@ static void set_library_wargv( char **argv, const UNICODE_STRING *image )
p = (WCHAR *)(wargv + argc + 1); p = (WCHAR *)(wargv + argc + 1);
if (image) if (image)
{ {
strcpyW( p, image->Buffer ); wcscpy( p, image->Buffer );
wargv[0] = p; wargv[0] = p;
p += 1 + image->Length / sizeof(WCHAR); p += 1 + image->Length / sizeof(WCHAR);
total -= 1 + image->Length / sizeof(WCHAR); total -= 1 + image->Length / sizeof(WCHAR);
...@@ -831,7 +831,7 @@ static void build_command_line( WCHAR **argv, UNICODE_STRING *cmdline ) ...@@ -831,7 +831,7 @@ static void build_command_line( WCHAR **argv, UNICODE_STRING *cmdline )
} }
else else
{ {
strcpyW( p, *arg ); wcscpy( p, *arg );
p += strlenW( p ); p += strlenW( p );
} }
if (has_space) if (has_space)
......
...@@ -99,7 +99,6 @@ ...@@ -99,7 +99,6 @@
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#define NONAMELESSUNION #define NONAMELESSUNION
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/server.h" #include "wine/server.h"
#include "ntdll_misc.h" #include "ntdll_misc.h"
......
...@@ -1774,7 +1774,7 @@ static BOOL get_builtin_fullname( UNICODE_STRING *nt_name, const UNICODE_STRING ...@@ -1774,7 +1774,7 @@ static BOOL get_builtin_fullname( UNICODE_STRING *nt_name, const UNICODE_STRING
if (!(fullname = RtlAllocateHeap( GetProcessHeap(), 0, if (!(fullname = RtlAllocateHeap( GetProcessHeap(), 0,
(strlenW(system_dir) + len + 5) * sizeof(WCHAR) ))) (strlenW(system_dir) + len + 5) * sizeof(WCHAR) )))
return FALSE; return FALSE;
strcpyW( fullname, nt_prefixW ); wcscpy( fullname, nt_prefixW );
strcatW( fullname, system_dir ); strcatW( fullname, system_dir );
strcatW( fullname, filenameW ); strcatW( fullname, filenameW );
done: done:
...@@ -2235,7 +2235,7 @@ static NTSTATUS get_dll_load_path_search_flags( LPCWSTR module, DWORD flags, WCH ...@@ -2235,7 +2235,7 @@ static NTSTATUS get_dll_load_path_search_flags( LPCWSTR module, DWORD flags, WCH
p = append_path( p, dir->dir + 4 /* \??\ */, -1 ); p = append_path( p, dir->dir + 4 /* \??\ */, -1 );
p = append_path( p, dll_directory.Buffer, dll_directory.Length / sizeof(WCHAR) ); p = append_path( p, dll_directory.Buffer, dll_directory.Length / sizeof(WCHAR) );
} }
if (flags & LOAD_LIBRARY_SEARCH_SYSTEM32) strcpyW( p, system_dir ); if (flags & LOAD_LIBRARY_SEARCH_SYSTEM32) wcscpy( p, system_dir );
else else
{ {
if (p > ret) p--; if (p > ret) p--;
...@@ -2781,7 +2781,7 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname ) ...@@ -2781,7 +2781,7 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
} }
memcpy( p, info->lpAssemblyManifestPath, dirlen * sizeof(WCHAR) ); memcpy( p, info->lpAssemblyManifestPath, dirlen * sizeof(WCHAR) );
p += dirlen; p += dirlen;
strcpyW( p, libname ); wcscpy( p, libname );
goto done; goto done;
} }
} }
...@@ -2800,14 +2800,14 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname ) ...@@ -2800,14 +2800,14 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
status = STATUS_NO_MEMORY; status = STATUS_NO_MEMORY;
goto done; goto done;
} }
strcpyW( p, user_shared_data->NtSystemRoot ); wcscpy( p, user_shared_data->NtSystemRoot );
p += strlenW(p); p += strlenW(p);
memcpy( p, winsxsW, sizeof(winsxsW) ); memcpy( p, winsxsW, sizeof(winsxsW) );
p += ARRAY_SIZE( winsxsW ); p += ARRAY_SIZE( winsxsW );
memcpy( p, info->lpAssemblyDirectoryName, info->ulAssemblyDirectoryNameLength ); memcpy( p, info->lpAssemblyDirectoryName, info->ulAssemblyDirectoryNameLength );
p += info->ulAssemblyDirectoryNameLength / sizeof(WCHAR); p += info->ulAssemblyDirectoryNameLength / sizeof(WCHAR);
*p++ = '\\'; *p++ = '\\';
strcpyW( p, libname ); wcscpy( p, libname );
done: done:
RtlFreeHeap( GetProcessHeap(), 0, info ); RtlFreeHeap( GetProcessHeap(), 0, info );
RtlReleaseActivationContext( data.hActCtx ); RtlReleaseActivationContext( data.hActCtx );
...@@ -2844,7 +2844,7 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING * ...@@ -2844,7 +2844,7 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING *
if (*ptr == ';') ptr++; if (*ptr == ';') ptr++;
memcpy( name, paths, len * sizeof(WCHAR) ); memcpy( name, paths, len * sizeof(WCHAR) );
if (len && name[len - 1] != '\\') name[len++] = '\\'; if (len && name[len - 1] != '\\') name[len++] = '\\';
strcpyW( name + len, search ); wcscpy( name + len, search );
nt_name->Buffer = NULL; nt_name->Buffer = NULL;
if ((status = RtlDosPathNameToNtPathName_U_WithStatus( name, nt_name, NULL, NULL ))) goto done; if ((status = RtlDosPathNameToNtPathName_U_WithStatus( name, nt_name, NULL, NULL ))) goto done;
...@@ -2859,7 +2859,7 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING * ...@@ -2859,7 +2859,7 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING *
if (!found_image) if (!found_image)
{ {
/* not found, return file in the system dir to be loaded as builtin */ /* not found, return file in the system dir to be loaded as builtin */
strcpyW( name, system_dir ); wcscpy( name, system_dir );
strcatW( name, search ); strcatW( name, search );
if (!RtlDosPathNameToNtPathName_U( name, nt_name, NULL, NULL )) status = STATUS_NO_MEMORY; if (!RtlDosPathNameToNtPathName_U( name, nt_name, NULL, NULL )) status = STATUS_NO_MEMORY;
} }
...@@ -2895,7 +2895,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, con ...@@ -2895,7 +2895,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, con
if (!(dllname = RtlAllocateHeap( GetProcessHeap(), 0, if (!(dllname = RtlAllocateHeap( GetProcessHeap(), 0,
(strlenW(libname)+strlenW(default_ext)+1) * sizeof(WCHAR)))) (strlenW(libname)+strlenW(default_ext)+1) * sizeof(WCHAR))))
return STATUS_NO_MEMORY; return STATUS_NO_MEMORY;
strcpyW( dllname, libname ); wcscpy( dllname, libname );
strcatW( dllname, default_ext ); strcatW( dllname, default_ext );
libname = dllname; libname = dllname;
} }
......
...@@ -343,7 +343,7 @@ static HANDLE get_app_key( const WCHAR *app_name ) ...@@ -343,7 +343,7 @@ static HANDLE get_app_key( const WCHAR *app_name )
sizeof(AppDefaultsW) + sizeof(DllOverridesW) + sizeof(AppDefaultsW) + sizeof(DllOverridesW) +
strlenW(app_name) * sizeof(WCHAR) ); strlenW(app_name) * sizeof(WCHAR) );
if (!str) return 0; if (!str) return 0;
strcpyW( str, AppDefaultsW ); wcscpy( str, AppDefaultsW );
strcatW( str, app_name ); strcatW( str, app_name );
strcatW( str, DllOverridesW ); strcatW( str, DllOverridesW );
...@@ -454,7 +454,7 @@ enum loadorder get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_n ...@@ -454,7 +454,7 @@ enum loadorder get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_n
if (!(len = strlenW(path))) return ret; if (!(len = strlenW(path))) return ret;
if (!(module = RtlAllocateHeap( GetProcessHeap(), 0, (len + 2) * sizeof(WCHAR) ))) return ret; if (!(module = RtlAllocateHeap( GetProcessHeap(), 0, (len + 2) * sizeof(WCHAR) ))) return ret;
strcpyW( module+1, path ); /* reserve module[0] for the wildcard char */ wcscpy( module+1, path ); /* reserve module[0] for the wildcard char */
remove_dll_ext( module + 1 ); remove_dll_ext( module + 1 );
basename = (WCHAR *)get_basename( module+1 ); basename = (WCHAR *)get_basename( module+1 );
......
...@@ -849,7 +849,7 @@ static LCID unix_locale_to_lcid( const char *unix_name ) ...@@ -849,7 +849,7 @@ static LCID unix_locale_to_lcid( const char *unix_name )
{ {
if (!strcmpW( buffer, posixW ) || !strcmpW( buffer, cW )) if (!strcmpW( buffer, posixW ) || !strcmpW( buffer, cW ))
return MAKELCID( MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT), SORT_DEFAULT ); return MAKELCID( MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT), SORT_DEFAULT );
strcpyW( win_name, buffer ); wcscpy( win_name, buffer );
} }
else else
{ {
...@@ -874,7 +874,7 @@ static LCID unix_locale_to_lcid( const char *unix_name ) ...@@ -874,7 +874,7 @@ static LCID unix_locale_to_lcid( const char *unix_name )
/* rebuild a Windows name */ /* rebuild a Windows name */
strcpyW( win_name, buffer ); wcscpy( win_name, buffer );
if (modifier) if (modifier)
{ {
if (!strcmpW( modifier, latinW )) strcatW( win_name, latnW ); if (!strcmpW( modifier, latinW )) strcatW( win_name, latnW );
...@@ -885,7 +885,7 @@ static LCID unix_locale_to_lcid( const char *unix_name ) ...@@ -885,7 +885,7 @@ static LCID unix_locale_to_lcid( const char *unix_name )
{ {
p = win_name + strlenW(win_name); p = win_name + strlenW(win_name);
*p++ = '-'; *p++ = '-';
strcpyW( p, country ); wcscpy( p, country );
} }
if (!RtlLocaleNameToLcid( win_name, &lcid, 0 )) return lcid; if (!RtlLocaleNameToLcid( win_name, &lcid, 0 )) return lcid;
...@@ -1672,7 +1672,7 @@ NTSTATUS WINAPI RtlLocaleNameToLcid( const WCHAR *name, LCID *lcid, ULONG flags ...@@ -1672,7 +1672,7 @@ NTSTATUS WINAPI RtlLocaleNameToLcid( const WCHAR *name, LCID *lcid, ULONG flags
goto found; goto found;
} }
if (strlenW( name ) >= LOCALE_NAME_MAX_LENGTH) return STATUS_INVALID_PARAMETER_1; if (strlenW( name ) >= LOCALE_NAME_MAX_LENGTH) return STATUS_INVALID_PARAMETER_1;
strcpyW( lang, name ); wcscpy( lang, name );
if ((p = strpbrkW( lang, sepW )) && *p == '-') if ((p = strpbrkW( lang, sepW )) && *p == '-')
{ {
......
...@@ -302,6 +302,7 @@ int WINAPIV NTDLL_swprintf( WCHAR *str, const WCHAR *format, ... ); ...@@ -302,6 +302,7 @@ int WINAPIV NTDLL_swprintf( WCHAR *str, const WCHAR *format, ... );
#define towupper(c) NTDLL_towupper(c) #define towupper(c) NTDLL_towupper(c)
#define wcslwr(s) NTDLL__wcslwr(s) #define wcslwr(s) NTDLL__wcslwr(s)
#define wcsupr(s) NTDLL__wcsupr(s) #define wcsupr(s) NTDLL__wcsupr(s)
#define wcscpy(d,s) NTDLL_wcscpy(d,s)
#define wcstoul(s,e,b) NTDLL_wcstoul(s,e,b) #define wcstoul(s,e,b) NTDLL_wcstoul(s,e,b)
/* convert from straight ASCII to Unicode without depending on the current codepage */ /* convert from straight ASCII to Unicode without depending on the current codepage */
......
...@@ -394,7 +394,7 @@ NTSTATUS WINAPI RtlDosPathNameToNtPathName_U_WithStatus(const WCHAR *dos_path, U ...@@ -394,7 +394,7 @@ NTSTATUS WINAPI RtlDosPathNameToNtPathName_U_WithStatus(const WCHAR *dos_path, U
return STATUS_NO_MEMORY; return STATUS_NO_MEMORY;
} }
strcpyW(ntpath->Buffer, NTDosPrefixW); wcscpy(ntpath->Buffer, NTDosPrefixW);
switch (RtlDetermineDosPathNameType_U(ptr)) switch (RtlDetermineDosPathNameType_U(ptr))
{ {
case UNC_PATH: /* \\foo */ case UNC_PATH: /* \\foo */
...@@ -513,7 +513,7 @@ ULONG WINAPI RtlDosSearchPath_U(LPCWSTR paths, LPCWSTR search, LPCWSTR ext, ...@@ -513,7 +513,7 @@ ULONG WINAPI RtlDosSearchPath_U(LPCWSTR paths, LPCWSTR search, LPCWSTR ext,
memmove(name, paths, needed * sizeof(WCHAR)); memmove(name, paths, needed * sizeof(WCHAR));
/* append '\\' if none is present */ /* append '\\' if none is present */
if (needed > 0 && name[needed - 1] != '\\') name[needed++] = '\\'; if (needed > 0 && name[needed - 1] != '\\') name[needed++] = '\\';
strcpyW(&name[needed], search); wcscpy(&name[needed], search);
if (ext) strcatW(&name[needed], ext); if (ext) strcatW(&name[needed], ext);
if (RtlDoesFileExists_U(name)) if (RtlDoesFileExists_U(name))
{ {
...@@ -832,7 +832,7 @@ DWORD WINAPI RtlGetFullPathName_U(const WCHAR* name, ULONG size, WCHAR* buffer, ...@@ -832,7 +832,7 @@ DWORD WINAPI RtlGetFullPathName_U(const WCHAR* name, ULONG size, WCHAR* buffer,
DWORD sz = LOWORD(dosdev); /* in bytes */ DWORD sz = LOWORD(dosdev); /* in bytes */
if (8 + sz + 2 > size) return sz + 10; if (8 + sz + 2 > size) return sz + 10;
strcpyW(buffer, DeviceRootW); wcscpy(buffer, DeviceRootW);
memmove(buffer + 4, name + offset, sz); memmove(buffer + 4, name + offset, sz);
buffer[4 + sz / sizeof(WCHAR)] = '\0'; buffer[4 + sz / sizeof(WCHAR)] = '\0';
/* file_part isn't set in this case */ /* file_part isn't set in this case */
......
...@@ -1192,7 +1192,7 @@ static NTSTATUS RTL_KeyHandleCreateObject(ULONG RelativeTo, PCWSTR Path, POBJECT ...@@ -1192,7 +1192,7 @@ static NTSTATUS RTL_KeyHandleCreateObject(ULONG RelativeTo, PCWSTR Path, POBJECT
if (str->Buffer == NULL) if (str->Buffer == NULL)
return STATUS_NO_MEMORY; return STATUS_NO_MEMORY;
strcpyW(str->Buffer, base); wcscpy(str->Buffer, base);
strcatW(str->Buffer, Path); strcatW(str->Buffer, Path);
str->Length = len - sizeof(WCHAR); str->Length = len - sizeof(WCHAR);
str->MaximumLength = len; str->MaximumLength = len;
......
...@@ -116,7 +116,7 @@ static const WCHAR **build_list( const WCHAR *buffer ) ...@@ -116,7 +116,7 @@ static const WCHAR **build_list( const WCHAR *buffer )
WCHAR *str = (WCHAR *)(ret + count + 1); WCHAR *str = (WCHAR *)(ret + count + 1);
WCHAR *q = str; WCHAR *q = str;
strcpyW( str, buffer ); wcscpy( str, buffer );
count = 0; count = 0;
for (;;) for (;;)
{ {
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include "winternl.h" #include "winternl.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/unicode.h"
#include "ntdll_misc.h" #include "ntdll_misc.h"
#include "inaddr.h" #include "inaddr.h"
#include "in6addr.h" #include "in6addr.h"
...@@ -1119,7 +1118,7 @@ NTSTATUS WINAPI RtlIpv4AddressToStringExW(const IN_ADDR *pin, USHORT port, LPWST ...@@ -1119,7 +1118,7 @@ NTSTATUS WINAPI RtlIpv4AddressToStringExW(const IN_ADDR *pin, USHORT port, LPWST
if (*psize > needed) { if (*psize > needed) {
*psize = needed + 1; *psize = needed + 1;
strcpyW(buffer, tmp_ip); wcscpy(buffer, tmp_ip);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include "ntdll_misc.h" #include "ntdll_misc.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/library.h" #include "wine/library.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ntdll); WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
......
...@@ -684,7 +684,7 @@ static BOOL match_tz_name(const char* tz_name, ...@@ -684,7 +684,7 @@ static BOOL match_tz_name(const char* tz_name,
if (reg_tzi->DaylightDate.wMonth) if (reg_tzi->DaylightDate.wMonth)
return TRUE; return TRUE;
strcpyW(key.key_name, reg_tzi->TimeZoneKeyName); wcscpy(key.key_name, reg_tzi->TimeZoneKeyName);
match = bsearch(&key, mapping, ARRAY_SIZE(mapping), sizeof(mapping[0]), compare_tz_key); match = bsearch(&key, mapping, ARRAY_SIZE(mapping), sizeof(mapping[0]), compare_tz_key);
if (!match) if (!match)
return TRUE; return TRUE;
......
...@@ -504,7 +504,7 @@ void version_init(void) ...@@ -504,7 +504,7 @@ void version_init(void)
if ((p = strrchrW( appname, '/' ))) appname = p + 1; if ((p = strrchrW( appname, '/' ))) appname = p + 1;
if ((p = strrchrW( appname, '\\' ))) appname = p + 1; if ((p = strrchrW( appname, '\\' ))) appname = p + 1;
strcpyW( appversion, appdefaultsW ); wcscpy( appversion, appdefaultsW );
strcatW( appversion, appname ); strcatW( appversion, appname );
RtlInitUnicodeString( &nameW, appversion ); RtlInitUnicodeString( &nameW, appversion );
attr.RootDirectory = config_key; attr.RootDirectory = config_key;
...@@ -595,7 +595,7 @@ NTSTATUS WINAPI RtlGetVersion( RTL_OSVERSIONINFOEXW *info ) ...@@ -595,7 +595,7 @@ NTSTATUS WINAPI RtlGetVersion( RTL_OSVERSIONINFOEXW *info )
info->dwMinorVersion = current_version->dwMinorVersion; info->dwMinorVersion = current_version->dwMinorVersion;
info->dwBuildNumber = current_version->dwBuildNumber; info->dwBuildNumber = current_version->dwBuildNumber;
info->dwPlatformId = current_version->dwPlatformId; info->dwPlatformId = current_version->dwPlatformId;
strcpyW( info->szCSDVersion, current_version->szCSDVersion ); wcscpy( info->szCSDVersion, current_version->szCSDVersion );
if(info->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW)) if(info->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW))
{ {
info->wServicePackMajor = current_version->wServicePackMajor; info->wServicePackMajor = current_version->wServicePackMajor;
......
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