From 59e1d114a407a358157d316e8ba09febd3b00b1d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 7 May 2019 11:31:05 -0500 Subject: [PATCH] kernel32: Use strncmpiW instead of memicmpW for strings without embedded nulls. Signed-off-by: Alexandre Julliard --- dlls/kernel32/file.c | 2 +- dlls/kernel32/process.c | 2 +- dlls/kernel32/volume.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index 6c826138b4d..30c8dbd1d98 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -1521,7 +1521,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing, static const WCHAR conW[] = {'C','O','N'}; if (LOWORD(dosdev) == sizeof(conW) && - !memicmpW( filename + HIWORD(dosdev)/sizeof(WCHAR), conW, ARRAY_SIZE( conW ))) + !strncmpiW( filename + HIWORD(dosdev)/sizeof(WCHAR), conW, ARRAY_SIZE( conW ))) { switch (access & (GENERIC_READ|GENERIC_WRITE)) { diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 09f0433deb0..09ab077896c 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -550,7 +550,7 @@ static void set_registry_variables( HANDLE hkey, ULONG type ) } /* PATH is magic */ if (env_name.Length == sizeof(pathW) && - !memicmpW( env_name.Buffer, pathW, ARRAY_SIZE( pathW )) && + !strncmpiW( env_name.Buffer, pathW, ARRAY_SIZE( pathW )) && !RtlQueryEnvironmentVariable_U( NULL, &env_name, &tmp )) { RtlAppendUnicodeToString( &tmp, sep ); diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c index 12084369cbe..4fd913aa227 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -1942,7 +1942,7 @@ BOOL WINAPI GetVolumePathNamesForVolumeNameW(LPCWSTR volumename, LPWSTR volumepa linkname = (const WCHAR *)((const char *)link + link->MountPoints[j].SymbolicLinkNameOffset); if (link->MountPoints[j].SymbolicLinkNameLength == sizeof(dosdevicesW) + 2 * sizeof(WCHAR) && - !memicmpW( linkname, dosdevicesW, ARRAY_SIZE( dosdevicesW ))) + !strncmpiW( linkname, dosdevicesW, ARRAY_SIZE( dosdevicesW ))) { len += 4; if (volumepathname && len < buflen)