kernel32: Use strncmpiW instead of memicmpW for strings without embedded nulls.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-05-07 11:31:05 -05:00
parent 7044189925
commit 59e1d114a4
3 changed files with 3 additions and 3 deletions

View file

@ -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))
{

View file

@ -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 );

View file

@ -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)