Commit 59e1d114 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 70441899
...@@ -1521,7 +1521,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing, ...@@ -1521,7 +1521,7 @@ HANDLE WINAPI CreateFileW( LPCWSTR filename, DWORD access, DWORD sharing,
static const WCHAR conW[] = {'C','O','N'}; static const WCHAR conW[] = {'C','O','N'};
if (LOWORD(dosdev) == sizeof(conW) && 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)) switch (access & (GENERIC_READ|GENERIC_WRITE))
{ {
......
...@@ -550,7 +550,7 @@ static void set_registry_variables( HANDLE hkey, ULONG type ) ...@@ -550,7 +550,7 @@ static void set_registry_variables( HANDLE hkey, ULONG type )
} }
/* PATH is magic */ /* PATH is magic */
if (env_name.Length == sizeof(pathW) && 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 )) !RtlQueryEnvironmentVariable_U( NULL, &env_name, &tmp ))
{ {
RtlAppendUnicodeToString( &tmp, sep ); RtlAppendUnicodeToString( &tmp, sep );
......
...@@ -1942,7 +1942,7 @@ BOOL WINAPI GetVolumePathNamesForVolumeNameW(LPCWSTR volumename, LPWSTR volumepa ...@@ -1942,7 +1942,7 @@ BOOL WINAPI GetVolumePathNamesForVolumeNameW(LPCWSTR volumename, LPWSTR volumepa
linkname = (const WCHAR *)((const char *)link + link->MountPoints[j].SymbolicLinkNameOffset); linkname = (const WCHAR *)((const char *)link + link->MountPoints[j].SymbolicLinkNameOffset);
if (link->MountPoints[j].SymbolicLinkNameLength == sizeof(dosdevicesW) + 2 * sizeof(WCHAR) && if (link->MountPoints[j].SymbolicLinkNameLength == sizeof(dosdevicesW) + 2 * sizeof(WCHAR) &&
!memicmpW( linkname, dosdevicesW, ARRAY_SIZE( dosdevicesW ))) !strncmpiW( linkname, dosdevicesW, ARRAY_SIZE( dosdevicesW )))
{ {
len += 4; len += 4;
if (volumepathname && len < buflen) if (volumepathname && len < buflen)
......
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