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
4658e4d8
Commit
4658e4d8
authored
Nov 22, 1998
by
Juergen Schmied
Committed by
Alexandre Julliard
Nov 22, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes error handling (SetLastError() and return value).
parent
d5af0175
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
3 deletions
+39
-3
dos_fs.c
files/dos_fs.c
+39
-3
No files found.
files/dos_fs.c
View file @
4658e4d8
...
...
@@ -845,14 +845,35 @@ BOOL32 DOSFS_GetFullName( LPCSTR name, BOOL32 check_last, DOS_FULL_NAME *full )
/***********************************************************************
* GetShortPathName32A (KERNEL32.271)
*
* NOTES
* observed:
* longpath=NULL: LastError=ERROR_INVALID_PARAMETER, ret=0
* *longpath="" or invalid: LastError=ERROR_BAD_PATHNAME, ret=0
*/
DWORD
WINAPI
GetShortPathName32A
(
LPCSTR
longpath
,
LPSTR
shortpath
,
DWORD
shortlen
)
{
DOS_FULL_NAME
full_name
;
if
(
!
longpath
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
!
longpath
[
0
])
{
SetLastError
(
ERROR_BAD_PATHNAME
);
return
0
;
}
/* FIXME: is it correct to always return a fully qualified short path? */
if
(
!
DOSFS_GetFullName
(
longpath
,
TRUE
,
&
full_name
))
return
0
;
if
(
!
DOSFS_GetFullName
(
longpath
,
TRUE
,
&
full_name
))
{
SetLastError
(
ERROR_BAD_PATHNAME
);
return
0
;
}
lstrcpyn32A
(
shortpath
,
full_name
.
short_name
,
shortlen
);
return
strlen
(
full_name
.
short_name
);
}
...
...
@@ -865,8 +886,21 @@ DWORD WINAPI GetShortPathName32W( LPCWSTR longpath, LPWSTR shortpath,
DWORD
shortlen
)
{
DOS_FULL_NAME
full_name
;
LPSTR
longpathA
;
DWORD
ret
=
0
;
LPSTR
longpathA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
longpath
);
if
(
!
longpath
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
!
longpath
[
0
])
{
SetLastError
(
ERROR_BAD_PATHNAME
);
return
0
;
}
longpathA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
longpath
);
/* FIXME: is it correct to always return a fully qualified short path? */
if
(
DOSFS_GetFullName
(
longpathA
,
TRUE
,
&
full_name
))
...
...
@@ -874,8 +908,10 @@ DWORD WINAPI GetShortPathName32W( LPCWSTR longpath, LPWSTR shortpath,
ret
=
strlen
(
full_name
.
short_name
);
lstrcpynAtoW
(
shortpath
,
full_name
.
short_name
,
shortlen
);
}
SetLastError
(
ERROR_BAD_PATHNAME
);
HeapFree
(
GetProcessHeap
(),
0
,
longpathA
);
return
ret
;
return
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