kernel32: Use strncmpiW instead of memicmpW for strings without embedded nulls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7044189925
commit
59e1d114a4
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue