Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f831b3bd
Commit
f831b3bd
authored
Mar 27, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use wcsnicmp() instead of strncmpiW() where possible.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3e049b6b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
22 additions
and
21 deletions
+22
-21
actctx.c
dlls/ntdll/actctx.c
+6
-6
directory.c
dlls/ntdll/directory.c
+2
-2
env.c
dlls/ntdll/env.c
+2
-2
loadorder.c
dlls/ntdll/loadorder.c
+1
-1
locale.c
dlls/ntdll/locale.c
+1
-1
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-0
path.c
dlls/ntdll/path.c
+6
-6
process.c
dlls/ntdll/process.c
+2
-2
relay.c
dlls/ntdll/relay.c
+1
-1
No files found.
dlls/ntdll/actctx.c
View file @
f831b3bd
...
...
@@ -759,7 +759,7 @@ static inline BOOL xmlstr_cmp(const xmlstr_t* xmlstr, const WCHAR *str)
static
inline
BOOL
xmlstr_cmpi
(
const
xmlstr_t
*
xmlstr
,
const
WCHAR
*
str
)
{
return
!
strncmpiW
(
xmlstr
->
ptr
,
str
,
xmlstr
->
len
)
&&
!
str
[
xmlstr
->
len
];
return
!
wcsnicmp
(
xmlstr
->
ptr
,
str
,
xmlstr
->
len
)
&&
!
str
[
xmlstr
->
len
];
}
static
BOOL
xml_attr_cmp
(
const
struct
xml_attr
*
attr
,
const
WCHAR
*
str
)
...
...
@@ -1843,13 +1843,13 @@ static BOOL parse_typelib_flags(const xmlstr_t *value, struct entity *entity)
start
=
str
;
while
(
*
str
!=
','
&&
(
i
++
<
value
->
len
))
str
++
;
if
(
!
strncmpiW
(
start
,
restrictedW
,
str
-
start
))
if
(
!
wcsnicmp
(
start
,
restrictedW
,
str
-
start
))
*
flags
|=
LIBFLAG_FRESTRICTED
;
else
if
(
!
strncmpiW
(
start
,
controlW
,
str
-
start
))
else
if
(
!
wcsnicmp
(
start
,
controlW
,
str
-
start
))
*
flags
|=
LIBFLAG_FCONTROL
;
else
if
(
!
strncmpiW
(
start
,
hiddenW
,
str
-
start
))
else
if
(
!
wcsnicmp
(
start
,
hiddenW
,
str
-
start
))
*
flags
|=
LIBFLAG_FHIDDEN
;
else
if
(
!
strncmpiW
(
start
,
hasdiskimageW
,
str
-
start
))
else
if
(
!
wcsnicmp
(
start
,
hasdiskimageW
,
str
-
start
))
*
flags
|=
LIBFLAG_FHASDISKIMAGE
;
else
{
...
...
@@ -3146,7 +3146,7 @@ static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai )
tmp
=
strchrW
(
tmp
,
'_'
)
+
1
;
tmp
=
strchrW
(
tmp
,
'_'
)
+
1
;
if
(
dir_info
->
FileNameLength
-
(
tmp
-
dir_info
->
FileName
)
*
sizeof
(
WCHAR
)
==
sizeof
(
wine_trailerW
)
&&
!
strncmpiW
(
tmp
,
wine_trailerW
,
ARRAY_SIZE
(
wine_trailerW
)))
!
wcsnicmp
(
tmp
,
wine_trailerW
,
ARRAY_SIZE
(
wine_trailerW
)))
{
/* prefer a non-Wine manifest if we already have one */
/* we'll still load the builtin dll if specified through DllOverrides */
...
...
dlls/ntdll/directory.c
View file @
f831b3bd
...
...
@@ -2160,7 +2160,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i
{
WCHAR
short_nameW
[
12
];
ret
=
hash_short_file_name
(
&
str
,
short_nameW
);
if
(
ret
==
length
&&
!
strncmpiW
(
short_nameW
,
name
,
length
))
if
(
ret
==
length
&&
!
wcsnicmp
(
short_nameW
,
name
,
length
))
{
strcpy
(
unix_name
+
pos
,
de
->
d_name
);
closedir
(
dir
);
...
...
@@ -2409,7 +2409,7 @@ static inline int get_dos_prefix_len( const UNICODE_STRING *name )
return
ARRAY_SIZE
(
nt_prefixW
);
if
(
name
->
Length
>=
sizeof
(
dosdev_prefixW
)
&&
!
strncmpiW
(
name
->
Buffer
,
dosdev_prefixW
,
ARRAY_SIZE
(
dosdev_prefixW
)))
!
wcsnicmp
(
name
->
Buffer
,
dosdev_prefixW
,
ARRAY_SIZE
(
dosdev_prefixW
)))
return
ARRAY_SIZE
(
dosdev_prefixW
);
return
0
;
...
...
dlls/ntdll/env.c
View file @
f831b3bd
...
...
@@ -144,7 +144,7 @@ static void set_registry_variables( WCHAR **env, HANDLE hkey, ULONG type )
}
/* PATH is magic */
if
(
env_name
.
Length
==
sizeof
(
pathW
)
&&
!
strncmpiW
(
env_name
.
Buffer
,
pathW
,
ARRAY_SIZE
(
pathW
))
&&
!
wcsnicmp
(
env_name
.
Buffer
,
pathW
,
ARRAY_SIZE
(
pathW
))
&&
!
RtlQueryEnvironmentVariable_U
(
*
env
,
&
env_name
,
&
tmp
))
{
RtlAppendUnicodeToString
(
&
tmp
,
sep
);
...
...
@@ -662,7 +662,7 @@ static inline BOOL is_path_prefix( const WCHAR *prefix, const WCHAR *path, const
{
DWORD
len
=
strlenW
(
prefix
);
if
(
strncmpiW
(
path
,
prefix
,
len
))
return
FALSE
;
if
(
wcsnicmp
(
path
,
prefix
,
len
))
return
FALSE
;
while
(
path
[
len
]
==
'\\'
)
len
++
;
return
path
+
len
==
file
;
}
...
...
dlls/ntdll/loadorder.c
View file @
f831b3bd
...
...
@@ -447,7 +447,7 @@ enum loadorder get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_n
/* Strip path information if the module resides in the system directory
*/
if
(
!
strncmpiW
(
system_dir
,
path
,
strlenW
(
system_dir
)))
if
(
!
wcsnicmp
(
system_dir
,
path
,
strlenW
(
system_dir
)))
{
const
WCHAR
*
p
=
path
+
strlenW
(
system_dir
);
while
(
*
p
==
'\\'
||
*
p
==
'/'
)
p
++
;
...
...
dlls/ntdll/locale.c
View file @
f831b3bd
...
...
@@ -1719,7 +1719,7 @@ NTSTATUS WINAPI RtlLocaleNameToLcid( const WCHAR *name, LCID *lcid, ULONG flags
p
=
buf
;
while
(
*
p
)
{
if
(
!
strncmpiW
(
p
,
script
,
len
)
&&
(
!
p
[
len
]
||
p
[
len
]
==
';'
))
break
;
if
(
!
wcsnicmp
(
p
,
script
,
len
)
&&
(
!
p
[
len
]
||
p
[
len
]
==
';'
))
break
;
if
(
!
(
p
=
strchrW
(
p
,
';'
)))
break
;
p
++
;
}
...
...
dlls/ntdll/ntdll_misc.h
View file @
f831b3bd
...
...
@@ -297,5 +297,6 @@ LONG __cdecl NTDLL_wcstol( LPCWSTR s, LPWSTR *end, INT base );
ULONG
__cdecl
NTDLL_wcstoul
(
LPCWSTR
s
,
LPWSTR
*
end
,
INT
base
);
#define wcsicmp(s1,s2) NTDLL__wcsicmp(s1,s2)
#define wcsnicmp(s1,s2,n) NTDLL__wcsnicmp(s1,s2,n)
#endif
dlls/ntdll/path.c
View file @
f831b3bd
...
...
@@ -306,13 +306,13 @@ ULONG WINAPI RtlIsDosDeviceName_U( PCWSTR dos_name )
switch
(
end
-
start
+
1
)
{
case
3
:
if
(
strncmpiW
(
start
,
auxW
,
3
)
&&
strncmpiW
(
start
,
conW
,
3
)
&&
strncmpiW
(
start
,
nulW
,
3
)
&&
strncmpiW
(
start
,
prnW
,
3
))
break
;
if
(
wcsnicmp
(
start
,
auxW
,
3
)
&&
wcsnicmp
(
start
,
conW
,
3
)
&&
wcsnicmp
(
start
,
nulW
,
3
)
&&
wcsnicmp
(
start
,
prnW
,
3
))
break
;
return
MAKELONG
(
3
*
sizeof
(
WCHAR
),
(
start
-
dos_name
)
*
sizeof
(
WCHAR
)
);
case
4
:
if
(
strncmpiW
(
start
,
comW
,
3
)
&&
strncmpiW
(
start
,
lptW
,
3
))
break
;
if
(
wcsnicmp
(
start
,
comW
,
3
)
&&
wcsnicmp
(
start
,
lptW
,
3
))
break
;
if
(
*
end
<=
'0'
||
*
end
>
'9'
)
break
;
return
MAKELONG
(
4
*
sizeof
(
WCHAR
),
(
start
-
dos_name
)
*
sizeof
(
WCHAR
)
);
default:
/* can't match anything */
...
...
@@ -1045,7 +1045,7 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir)
if
(
size
&&
ptr
[
size
-
1
]
!=
'\\'
)
ptr
[
size
++
]
=
'\\'
;
/* convert \??\UNC\ path to \\ prefix */
if
(
size
>=
4
&&
!
strncmpiW
(
ptr
,
UncPfxW
,
4
))
if
(
size
>=
4
&&
!
wcsnicmp
(
ptr
,
UncPfxW
,
4
))
{
ptr
+=
2
;
size
-=
2
;
...
...
dlls/ntdll/process.c
View file @
f831b3bd
...
...
@@ -1244,13 +1244,13 @@ static BOOL is_builtin_path( UNICODE_STRING *path, BOOL *is_64bit )
's'
,
'y'
,
's'
,
'w'
,
'o'
,
'w'
,
'6'
,
'4'
};
*
is_64bit
=
is_win64
;
if
(
path
->
Length
>
sizeof
(
systemW
)
&&
!
strncmpiW
(
path
->
Buffer
,
systemW
,
ARRAY_SIZE
(
systemW
)
))
if
(
path
->
Length
>
sizeof
(
systemW
)
&&
!
wcsnicmp
(
path
->
Buffer
,
systemW
,
ARRAY_SIZE
(
systemW
)
))
{
if
(
is_wow64
&&
!
ntdll_get_thread_data
()
->
wow64_redir
)
*
is_64bit
=
TRUE
;
return
TRUE
;
}
if
((
is_win64
||
is_wow64
)
&&
path
->
Length
>
sizeof
(
wow64W
)
&&
!
strncmpiW
(
path
->
Buffer
,
wow64W
,
ARRAY_SIZE
(
wow64W
)
))
!
wcsnicmp
(
path
->
Buffer
,
wow64W
,
ARRAY_SIZE
(
wow64W
)
))
{
*
is_64bit
=
FALSE
;
return
TRUE
;
...
...
dlls/ntdll/relay.c
View file @
f831b3bd
...
...
@@ -294,7 +294,7 @@ static BOOL check_from_module( const WCHAR **includelist, const WCHAR **excludel
if
(
!
wcsicmp
(
*
listitem
,
module
))
return
!
show
;
len
=
strlenW
(
*
listitem
);
if
(
!
strncmpiW
(
*
listitem
,
module
,
len
)
&&
!
wcsicmp
(
module
+
len
,
dllW
))
if
(
!
wcsnicmp
(
*
listitem
,
module
,
len
)
&&
!
wcsicmp
(
module
+
len
,
dllW
))
return
!
show
;
}
return
show
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment