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
285c5490
Commit
285c5490
authored
Mar 31, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use wcsrchr() instead of strrchrW().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
667fbe87
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
20 deletions
+21
-20
actctx.c
dlls/ntdll/actctx.c
+2
-2
loader.c
dlls/ntdll/loader.c
+8
-8
loadorder.c
dlls/ntdll/loadorder.c
+3
-3
nt.c
dlls/ntdll/nt.c
+1
-1
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-0
path.c
dlls/ntdll/path.c
+2
-2
process.c
dlls/ntdll/process.c
+1
-1
relay.c
dlls/ntdll/relay.c
+1
-1
version.c
dlls/ntdll/version.c
+2
-2
No files found.
dlls/ntdll/actctx.c
View file @
285c5490
...
...
@@ -3235,7 +3235,7 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit
path
[
path_us
.
Length
/
sizeof
(
WCHAR
)]
=
'\\'
;
wcscpy
(
path
+
path_us
.
Length
/
sizeof
(
WCHAR
)
+
1
,
file
);
RtlInitUnicodeString
(
&
path_us
,
path
);
*
strrchrW
(
file
,
'.'
)
=
0
;
/* remove .manifest extension */
*
wcsrchr
(
file
,
'.'
)
=
0
;
/* remove .manifest extension */
if
(
!
open_nt_file
(
&
handle
,
&
path_us
))
{
...
...
@@ -4998,7 +4998,7 @@ NTSTATUS WINAPI RtlCreateActivationContext( HANDLE *handle, const void *ptr )
else
module
=
NtCurrentTeb
()
->
Peb
->
ImageBaseAddress
;
if
((
status
=
get_module_filename
(
module
,
&
dir
,
0
)))
goto
error
;
if
((
p
=
strrchrW
(
dir
.
Buffer
,
'\\'
)))
p
[
1
]
=
0
;
if
((
p
=
wcsrchr
(
dir
.
Buffer
,
'\\'
)))
p
[
1
]
=
0
;
actctx
->
appdir
.
info
=
dir
.
Buffer
;
}
...
...
dlls/ntdll/loader.c
View file @
285c5490
...
...
@@ -1186,7 +1186,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
wm
->
ldr
.
LoadCount
=
1
;
RtlCreateUnicodeString
(
&
wm
->
ldr
.
FullDllName
,
nt_name
->
Buffer
+
4
/* \??\ prefix */
);
if
((
p
=
strrchrW
(
wm
->
ldr
.
FullDllName
.
Buffer
,
'\\'
)))
p
++
;
if
((
p
=
wcsrchr
(
wm
->
ldr
.
FullDllName
.
Buffer
,
'\\'
)))
p
++
;
else
p
=
wm
->
ldr
.
FullDllName
.
Buffer
;
RtlInitUnicodeString
(
&
wm
->
ldr
.
BaseDllName
,
p
);
...
...
@@ -1756,7 +1756,7 @@ static BOOL get_builtin_fullname( UNICODE_STRING *nt_name, const UNICODE_STRING
ascii_to_unicode
(
filenameW
,
filename
,
len
+
1
);
/* check if path can correspond to the dll we have */
if
(
path
&&
(
p
=
strrchrW
(
path
->
Buffer
,
'\\'
)))
if
(
path
&&
(
p
=
wcsrchr
(
path
->
Buffer
,
'\\'
)))
{
p
++
;
if
(
!
wcsnicmp
(
p
,
filenameW
,
len
)
&&
(
!
p
[
len
]
||
!
wcsicmp
(
p
+
len
,
soW
)))
...
...
@@ -2101,8 +2101,8 @@ static inline const WCHAR *get_module_path_end( const WCHAR *module )
const
WCHAR
*
p
;
const
WCHAR
*
mod_end
=
module
;
if
((
p
=
strrchrW
(
mod_end
,
'\\'
)))
mod_end
=
p
;
if
((
p
=
strrchrW
(
mod_end
,
'/'
)))
mod_end
=
p
;
if
((
p
=
wcsrchr
(
mod_end
,
'\\'
)))
mod_end
=
p
;
if
((
p
=
wcsrchr
(
mod_end
,
'/'
)))
mod_end
=
p
;
if
(
mod_end
==
module
+
2
&&
module
[
1
]
==
':'
)
mod_end
++
;
if
(
mod_end
==
module
&&
module
[
0
]
&&
module
[
1
]
==
':'
)
mod_end
+=
2
;
return
mod_end
;
...
...
@@ -2683,8 +2683,8 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, const UNICODE_STRING *nt_na
/* Fix the name in case we have a full path and extension */
name
=
nt_name
->
Buffer
;
if
((
p
=
strrchrW
(
name
,
'\\'
)))
name
=
p
+
1
;
if
((
p
=
strrchrW
(
name
,
'/'
)))
name
=
p
+
1
;
if
((
p
=
wcsrchr
(
name
,
'\\'
)))
name
=
p
+
1
;
if
((
p
=
wcsrchr
(
name
,
'/'
)))
name
=
p
+
1
;
TRACE
(
"Trying built-in %s
\n
"
,
debugstr_w
(
name
));
...
...
@@ -2761,7 +2761,7 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
goto
done
;
}
if
((
p
=
strrchrW
(
info
->
lpAssemblyManifestPath
,
'\\'
)))
if
((
p
=
wcsrchr
(
info
->
lpAssemblyManifestPath
,
'\\'
)))
{
DWORD
len
,
dirlen
=
info
->
ulAssemblyDirectoryNameLength
/
sizeof
(
WCHAR
);
p
++
;
...
...
@@ -2890,7 +2890,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, con
if
(
default_ext
)
/* first append default extension */
{
if
(
!
(
ext
=
strrchrW
(
libname
,
'.'
))
||
wcschr
(
ext
,
'/'
)
||
wcschr
(
ext
,
'\\'
))
if
(
!
(
ext
=
wcsrchr
(
libname
,
'.'
))
||
wcschr
(
ext
,
'/'
)
||
wcschr
(
ext
,
'\\'
))
{
if
(
!
(
dllname
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
(
strlenW
(
libname
)
+
strlenW
(
default_ext
)
+
1
)
*
sizeof
(
WCHAR
))))
...
...
dlls/ntdll/loadorder.c
View file @
285c5490
...
...
@@ -79,8 +79,8 @@ static const WCHAR *get_basename( const WCHAR *name )
const
WCHAR
*
ptr
;
if
(
name
[
0
]
&&
name
[
1
]
==
':'
)
name
+=
2
;
/* strip drive specification */
if
((
ptr
=
strrchrW
(
name
,
'\\'
)))
name
=
ptr
+
1
;
if
((
ptr
=
strrchrW
(
name
,
'/'
)))
name
=
ptr
+
1
;
if
((
ptr
=
wcsrchr
(
name
,
'\\'
)))
name
=
ptr
+
1
;
if
((
ptr
=
wcsrchr
(
name
,
'/'
)))
name
=
ptr
+
1
;
return
name
;
}
...
...
@@ -92,7 +92,7 @@ static const WCHAR *get_basename( const WCHAR *name )
static
inline
void
remove_dll_ext
(
WCHAR
*
name
)
{
static
const
WCHAR
dllW
[]
=
{
'.'
,
'd'
,
'l'
,
'l'
,
0
};
WCHAR
*
p
=
strrchrW
(
name
,
'.'
);
WCHAR
*
p
=
wcsrchr
(
name
,
'.'
);
if
(
p
&&
!
wcsicmp
(
p
,
dllW
))
*
p
=
0
;
}
...
...
dlls/ntdll/nt.c
View file @
285c5490
...
...
@@ -2673,7 +2673,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
procname
[
wine_server_reply_size
(
reply
)
/
sizeof
(
WCHAR
)]
=
0
;
/* Get only the executable name, not the path */
if
((
exename
=
strrchrW
(
procname
,
'\\'
))
!=
NULL
)
exename
++
;
if
((
exename
=
wcsrchr
(
procname
,
'\\'
))
!=
NULL
)
exename
++
;
else
exename
=
procname
;
wlen
=
(
strlenW
(
exename
)
+
1
)
*
sizeof
(
WCHAR
);
...
...
dlls/ntdll/ntdll_misc.h
View file @
285c5490
...
...
@@ -306,6 +306,7 @@ int WINAPIV NTDLL_swprintf( WCHAR *str, const WCHAR *format, ... );
#define wcscat(d,s) NTDLL_wcscat(d,s)
#define wcschr(s,c) NTDLL_wcschr(s,c)
#define wcspbrk(s,a) NTDLL_wcspbrk(s,a)
#define wcsrchr(s,c) NTDLL_wcsrchr(s,c)
#define wcstoul(s,e,b) NTDLL_wcstoul(s,e,b)
/* convert from straight ASCII to Unicode without depending on the current codepage */
...
...
dlls/ntdll/path.c
View file @
285c5490
...
...
@@ -364,7 +364,7 @@ NTSTATUS WINAPI RtlDosPathNameToNtPathName_U_WithStatus(const WCHAR *dos_path, U
ntpath
->
Buffer
[
1
]
=
'?'
;
/* change \\?\ to \??\ */
if
(
file_part
)
{
if
((
ptr
=
strrchrW
(
ntpath
->
Buffer
,
'\\'
))
&&
ptr
[
1
])
*
file_part
=
ptr
+
1
;
if
((
ptr
=
wcsrchr
(
ntpath
->
Buffer
,
'\\'
))
&&
ptr
[
1
])
*
file_part
=
ptr
+
1
;
else
*
file_part
=
NULL
;
}
return
STATUS_SUCCESS
;
...
...
@@ -855,7 +855,7 @@ DWORD WINAPI RtlGetFullPathName_U(const WCHAR* name, ULONG size, WCHAR* buffer,
}
/* find file part */
if
(
file_part
&&
(
ptr
=
strrchrW
(
buffer
,
'\\'
))
!=
NULL
&&
ptr
>=
buffer
+
2
&&
*++
ptr
)
if
(
file_part
&&
(
ptr
=
wcsrchr
(
buffer
,
'\\'
))
!=
NULL
&&
ptr
>=
buffer
+
2
&&
*++
ptr
)
*
file_part
=
ptr
;
return
reqsize
;
}
...
...
dlls/ntdll/process.c
View file @
285c5490
...
...
@@ -1578,7 +1578,7 @@ NTSTATUS restart_process( RTL_USER_PROCESS_PARAMETERS *params, NTSTATUS status )
/* check for .com or .pif extension */
if
(
status
==
STATUS_INVALID_IMAGE_NOT_MZ
&&
(
p
=
strrchrW
(
params
->
ImagePathName
.
Buffer
,
'.'
))
&&
(
p
=
wcsrchr
(
params
->
ImagePathName
.
Buffer
,
'.'
))
&&
(
!
wcsicmp
(
p
,
comW
)
||
!
wcsicmp
(
p
,
pifW
)))
status
=
STATUS_INVALID_IMAGE_WIN_16
;
...
...
dlls/ntdll/relay.c
View file @
285c5490
...
...
@@ -223,7 +223,7 @@ static BOOL check_list( const WCHAR *module, int ordinal, const char *func, cons
sprintf
(
ord_str
,
"%d"
,
ordinal
);
for
(;
*
list
;
list
++
)
{
const
WCHAR
*
p
=
strrchrW
(
*
list
,
'.'
);
const
WCHAR
*
p
=
wcsrchr
(
*
list
,
'.'
);
if
(
p
&&
p
>
*
list
)
/* check module and function */
{
int
len
=
p
-
*
list
;
...
...
dlls/ntdll/version.c
View file @
285c5490
...
...
@@ -501,8 +501,8 @@ void version_init(void)
/* open AppDefaults\\appname key */
if
((
p
=
strrchrW
(
appname
,
'/'
)))
appname
=
p
+
1
;
if
((
p
=
strrchrW
(
appname
,
'\\'
)))
appname
=
p
+
1
;
if
((
p
=
wcsrchr
(
appname
,
'/'
)))
appname
=
p
+
1
;
if
((
p
=
wcsrchr
(
appname
,
'\\'
)))
appname
=
p
+
1
;
wcscpy
(
appversion
,
appdefaultsW
);
wcscat
(
appversion
,
appname
);
...
...
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