Alexandre Julliard : ntdll: Use strncmpiW instead of memicmpW for strings without embedded nulls.
Alexandre Julliard
julliard at winehq.org
Wed May 8 18:22:48 CDT 2019
Module: wine
Branch: master
Commit: 6fc259a57dafab9e72af13980c021e2a59257935
URL: https://source.winehq.org/git/wine.git/?a=commit;h=6fc259a57dafab9e72af13980c021e2a59257935
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed May 8 08:34:32 2019 -0500
ntdll: Use strncmpiW instead of memicmpW for strings without embedded nulls.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/actctx.c | 2 +-
dlls/ntdll/directory.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index ee1f764..106fea8 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -3144,7 +3144,7 @@ static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai )
tmp = strchrW(tmp, '_') + 1;
tmp = strchrW(tmp, '_') + 1;
if (dir_info->FileNameLength - (tmp - dir_info->FileName) * sizeof(WCHAR) == sizeof(wine_trailerW) &&
- !memicmpW( tmp, wine_trailerW, ARRAY_SIZE( wine_trailerW )))
+ !strncmpiW( tmp, wine_trailerW, ARRAY_SIZE( wine_trailerW )))
{
/* prefer a non-Wine manifest if we already have one */
/* we'll still load the builtin dll if specified through DllOverrides */
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index c853470..bbdbbe9 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -2101,7 +2101,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i
{
ret = ntdll_umbstowcs( 0, kde[1].d_name, strlen(kde[1].d_name),
buffer, MAX_DIR_ENTRY_LEN );
- if (ret == length && !memicmpW( buffer, name, length))
+ if (ret == length && !strncmpiW( buffer, name, length))
{
strcpy( unix_name + pos, kde[1].d_name );
RtlLeaveCriticalSection( &dir_section );
@@ -2111,7 +2111,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i
}
ret = ntdll_umbstowcs( 0, kde[0].d_name, strlen(kde[0].d_name),
buffer, MAX_DIR_ENTRY_LEN );
- if (ret == length && !memicmpW( buffer, name, length))
+ if (ret == length && !strncmpiW( buffer, name, length))
{
strcpy( unix_name + pos,
kde[1].d_name[0] ? kde[1].d_name : kde[0].d_name );
@@ -2145,7 +2145,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i
while ((de = readdir( dir )))
{
ret = ntdll_umbstowcs( 0, de->d_name, strlen(de->d_name), buffer, MAX_DIR_ENTRY_LEN );
- if (ret == length && !memicmpW( buffer, name, length ))
+ if (ret == length && !strncmpiW( buffer, name, length ))
{
strcpy( unix_name + pos, de->d_name );
closedir( dir );
@@ -2159,7 +2159,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i
{
WCHAR short_nameW[12];
ret = hash_short_file_name( &str, short_nameW );
- if (ret == length && !memicmpW( short_nameW, name, length ))
+ if (ret == length && !strncmpiW( short_nameW, name, length ))
{
strcpy( unix_name + pos, de->d_name );
closedir( dir );
@@ -2468,7 +2468,7 @@ static inline int get_dos_prefix_len( const UNICODE_STRING *name )
return ARRAY_SIZE( nt_prefixW );
if (name->Length >= sizeof(dosdev_prefixW) &&
- !memicmpW( name->Buffer, dosdev_prefixW, ARRAY_SIZE( dosdev_prefixW )))
+ !strncmpiW( name->Buffer, dosdev_prefixW, ARRAY_SIZE( dosdev_prefixW )))
return ARRAY_SIZE( dosdev_prefixW );
return 0;
More information about the wine-cvs
mailing list