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
d37d9860
Commit
d37d9860
authored
Mar 24, 2018
by
Mark White
Committed by
Alexandre Julliard
Mar 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix forward slash path handling to GetVolumePathNameW.
Signed-off-by:
Mark White
<
chopinbig2@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fb48a8f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
volume.c
dlls/kernel32/tests/volume.c
+4
-0
volume.c
dlls/kernel32/volume.c
+4
-4
No files found.
dlls/kernel32/tests/volume.c
View file @
d37d9860
...
...
@@ -772,6 +772,10 @@ static void test_GetVolumePathNameA(void)
"s:omefile"
,
"S:
\\
"
/* win2k, winxp */
,
sizeof
(
volume_path
),
ERROR_FILE_NOT_FOUND
,
NO_ERROR
},
{
/* test 42: a reasonable forward slash path that is guaranteed to exist */
"C:/windows/system32"
,
"C:
\\
"
,
sizeof
(
volume_path
),
NO_ERROR
,
NO_ERROR
},
};
BOOL
ret
,
success
;
DWORD
error
;
...
...
dlls/kernel32/volume.c
View file @
d37d9860
...
...
@@ -1693,6 +1693,10 @@ BOOL WINAPI GetVolumePathNameW(LPCWSTR filename, LPWSTR volumepathname, DWORD bu
return
FALSE
;
}
strcpyW
(
volumenameW
,
filename
);
/* Normalize path */
for
(
c
=
volumenameW
;
*
c
;
c
++
)
if
(
*
c
==
'/'
)
*
c
=
'\\'
;
stop_pos
=
0
;
/* stop searching slashes early for NT-type and nearly NT-type paths */
if
(
strncmpW
(
ntprefixW
,
filename
,
strlenW
(
ntprefixW
))
==
0
)
...
...
@@ -1776,14 +1780,10 @@ BOOL WINAPI GetVolumePathNameW(LPCWSTR filename, LPWSTR volumepathname, DWORD bu
if
(
last_pos
+
1
<=
buflen
)
{
WCHAR
*
p
;
memcpy
(
volumepathname
,
filename
,
last_pos
*
sizeof
(
WCHAR
));
if
(
last_pos
+
2
<=
buflen
)
volumepathname
[
last_pos
++
]
=
'\\'
;
volumepathname
[
last_pos
]
=
'\0'
;
/* Normalize path */
for
(
p
=
volumepathname
;
*
p
;
p
++
)
if
(
*
p
==
'/'
)
*
p
=
'\\'
;
/* DOS-style paths always return upper-case drive letters */
if
(
volumepathname
[
1
]
==
':'
)
volumepathname
[
0
]
=
toupperW
(
volumepathname
[
0
]);
...
...
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