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
e8e13308
Commit
e8e13308
authored
Jun 16, 2015
by
Erich E. Hoover
Committed by
Alexandre Julliard
Jun 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Handle semi-DOS paths in GetVolumePathName.
Add support for "semi-DOS" paths, these paths revert to the drive letter specified in the first character.
parent
62279b7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
volume.c
dlls/kernel32/tests/volume.c
+8
-0
volume.c
dlls/kernel32/volume.c
+12
-2
No files found.
dlls/kernel32/tests/volume.c
View file @
e8e13308
...
...
@@ -663,6 +663,14 @@ static void test_GetVolumePathNameA(void)
"
\\\\
ReallyBogus
\\
InvalidDrive:
\\
"
/* win2k, winxp */
,
sizeof
(
volume_path
),
ERROR_INVALID_NAME
,
NO_ERROR
},
{
/* test 15: poor quality input, valid output, valid output length, different drive */
"D::"
,
"D:
\\
"
,
sizeof
(
volume_path
),
NO_ERROR
,
NO_ERROR
},
{
/* test 16: unused drive letter */
"M::"
,
"C:
\\
"
,
4
,
ERROR_FILE_NOT_FOUND
,
ERROR_MORE_DATA
},
};
BOOL
ret
,
success
;
DWORD
error
;
...
...
dlls/kernel32/volume.c
View file @
e8e13308
...
...
@@ -1818,7 +1818,7 @@ BOOL WINAPI GetVolumePathNameA(LPCSTR filename, LPSTR volumepathname, DWORD bufl
BOOL
WINAPI
GetVolumePathNameW
(
LPCWSTR
filename
,
LPWSTR
volumepathname
,
DWORD
buflen
)
{
static
const
WCHAR
ntprefixW
[]
=
{
'\\'
,
'\\'
,
'?'
,
'\\'
,
0
};
static
const
WCHAR
fallbackpathW
[]
=
{
'C'
,
':'
,
'\\'
,
0
};
WCHAR
fallbackpathW
[]
=
{
'C'
,
':'
,
'\\'
,
0
};
NTSTATUS
status
=
STATUS_SUCCESS
;
WCHAR
*
volumenameW
=
NULL
,
*
c
;
int
pos
,
last_pos
,
stop_pos
;
...
...
@@ -1897,7 +1897,17 @@ BOOL WINAPI GetVolumePathNameW(LPCWSTR filename, LPWSTR volumepathname, DWORD bu
goto
cleanup
;
}
/* DOS-style paths revert to C:\ (anything not beginning with a slash) */
/* DOS-style paths (anything not beginning with a slash) have fallback replies */
if
(
filename
[
1
]
==
':'
)
{
/* if the path is semi-sane (X:) then use the given drive letter (if it is mounted) */
fallbackpathW
[
0
]
=
filename
[
0
];
if
(
!
isalphaW
(
filename
[
0
])
||
GetDriveTypeW
(
fallbackpathW
)
==
DRIVE_NO_ROOT_DIR
)
{
status
=
STATUS_OBJECT_NAME_NOT_FOUND
;
goto
cleanup
;
}
}
last_pos
=
strlenW
(
fallbackpathW
)
-
1
;
/* points to \\ */
filename
=
fallbackpathW
;
status
=
STATUS_SUCCESS
;
...
...
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