ntdll: Use strncmpiW instead of memicmpW for strings without embedded nulls.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ddac3dccc8
commit
6fc259a57d
|
@ -3144,7 +3144,7 @@ static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai )
|
||||||
tmp = strchrW(tmp, '_') + 1;
|
tmp = strchrW(tmp, '_') + 1;
|
||||||
tmp = strchrW(tmp, '_') + 1;
|
tmp = strchrW(tmp, '_') + 1;
|
||||||
if (dir_info->FileNameLength - (tmp - dir_info->FileName) * sizeof(WCHAR) == sizeof(wine_trailerW) &&
|
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 */
|
/* prefer a non-Wine manifest if we already have one */
|
||||||
/* we'll still load the builtin dll if specified through DllOverrides */
|
/* we'll still load the builtin dll if specified through DllOverrides */
|
||||||
|
|
|
@ -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),
|
ret = ntdll_umbstowcs( 0, kde[1].d_name, strlen(kde[1].d_name),
|
||||||
buffer, MAX_DIR_ENTRY_LEN );
|
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 );
|
strcpy( unix_name + pos, kde[1].d_name );
|
||||||
RtlLeaveCriticalSection( &dir_section );
|
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),
|
ret = ntdll_umbstowcs( 0, kde[0].d_name, strlen(kde[0].d_name),
|
||||||
buffer, MAX_DIR_ENTRY_LEN );
|
buffer, MAX_DIR_ENTRY_LEN );
|
||||||
if (ret == length && !memicmpW( buffer, name, length))
|
if (ret == length && !strncmpiW( buffer, name, length))
|
||||||
{
|
{
|
||||||
strcpy( unix_name + pos,
|
strcpy( unix_name + pos,
|
||||||
kde[1].d_name[0] ? kde[1].d_name : kde[0].d_name );
|
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 )))
|
while ((de = readdir( dir )))
|
||||||
{
|
{
|
||||||
ret = ntdll_umbstowcs( 0, de->d_name, strlen(de->d_name), buffer, MAX_DIR_ENTRY_LEN );
|
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 );
|
strcpy( unix_name + pos, de->d_name );
|
||||||
closedir( dir );
|
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];
|
WCHAR short_nameW[12];
|
||||||
ret = hash_short_file_name( &str, short_nameW );
|
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 );
|
strcpy( unix_name + pos, de->d_name );
|
||||||
closedir( dir );
|
closedir( dir );
|
||||||
|
@ -2468,7 +2468,7 @@ static inline int get_dos_prefix_len( const UNICODE_STRING *name )
|
||||||
return ARRAY_SIZE( nt_prefixW );
|
return ARRAY_SIZE( nt_prefixW );
|
||||||
|
|
||||||
if (name->Length >= sizeof(dosdev_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 ARRAY_SIZE( dosdev_prefixW );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue