Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
509e4d17
Commit
509e4d17
authored
Oct 07, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A couple more fixes in RtlGetFullPathName_U.
Reverted my previous fix in RtlDosSearchPath_U, extension handling is supposed to be broken.
parent
8d174d3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
path.c
dlls/ntdll/path.c
+17
-12
No files found.
dlls/ntdll/path.c
View file @
509e4d17
...
...
@@ -262,12 +262,12 @@ ULONG WINAPI RtlDosSearchPath_U(LPCWSTR paths, LPCWSTR search, LPCWSTR ext,
if
(
type
==
RELATIVE_PATH
)
{
ULONG
allocated
=
0
,
needed
,
filelen
;
WCHAR
*
p
,
*
name
=
NULL
;
WCHAR
*
name
=
NULL
;
filelen
=
1
/* for \ */
+
strlenW
(
search
)
+
1
/* \0 */
;
p
=
strrchrW
(
search
,
'.'
);
if
(
p
&&
!
strchrW
(
p
,
'\\'
)
&&
!
strchrW
(
p
,
'/'
))
ext
=
NULL
;
/* Windows only checks for '.' without worrying about path components */
if
(
strchrW
(
search
,
'.'
))
ext
=
NULL
;
if
(
ext
!=
NULL
)
filelen
+=
strlenW
(
ext
);
while
(
*
paths
)
...
...
@@ -495,6 +495,7 @@ static ULONG get_full_path_helper(LPCWSTR name, LPWSTR buffer, ULONG size)
if
(
prev
<
buffer
+
mark
)
prev
=
p
-
1
;
reqsize
-=
(
p
+
2
-
prev
)
*
sizeof
(
WCHAR
);
memmove
(
prev
,
p
+
2
,
buffer
+
reqsize
-
prev
+
sizeof
(
WCHAR
));
p
=
prev
;
}
break
;
case
'\0'
:
...
...
@@ -531,6 +532,7 @@ done:
DWORD
WINAPI
RtlGetFullPathName_U
(
const
WCHAR
*
name
,
ULONG
size
,
WCHAR
*
buffer
,
WCHAR
**
file_part
)
{
WCHAR
*
ptr
;
DWORD
dosdev
;
DWORD
reqsize
;
...
...
@@ -558,17 +560,20 @@ DWORD WINAPI RtlGetFullPathName_U(const WCHAR* name, ULONG size, WCHAR* buffer,
reqsize
=
get_full_path_helper
(
name
,
buffer
,
size
);
if
(
reqsize
>
size
)
{
LPWSTR
tmp
=
RtlAllocateHeap
(
ntdll_get_process_heap
(),
0
,
reqsize
);
reqsize
=
get_full_path_helper
(
name
,
tmp
,
reqsize
)
+
sizeof
(
WCHAR
);
LPWSTR
tmp
=
RtlAllocateHeap
(
ntdll_get_process_heap
(),
0
,
reqsize
);
reqsize
=
get_full_path_helper
(
name
,
tmp
,
reqsize
);
if
(
reqsize
>
size
)
/* it may have worked the second time */
{
RtlFreeHeap
(
ntdll_get_process_heap
(),
0
,
tmp
);
return
reqsize
+
sizeof
(
WCHAR
);
}
memcpy
(
buffer
,
tmp
,
reqsize
+
sizeof
(
WCHAR
)
);
RtlFreeHeap
(
ntdll_get_process_heap
(),
0
,
tmp
);
}
else
{
WCHAR
*
ptr
;
/* find file part */
if
(
file_part
&&
(
ptr
=
strrchrW
(
buffer
,
'\\'
))
!=
NULL
&&
ptr
>=
buffer
+
2
&&
*++
ptr
)
*
file_part
=
ptr
;
}
/* find file part */
if
(
file_part
&&
(
ptr
=
strrchrW
(
buffer
,
'\\'
))
!=
NULL
&&
ptr
>=
buffer
+
2
&&
*++
ptr
)
*
file_part
=
ptr
;
return
reqsize
;
}
...
...
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