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
ea5941ba
Commit
ea5941ba
authored
Dec 05, 1999
by
Peter Ganten
Committed by
Alexandre Julliard
Dec 05, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GetCurrentDirectoryA and W to return the needed space for the CWD,
if the buffer size is not large enough.
parent
f92a7770
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
drive.c
files/drive.c
+13
-8
No files found.
files/drive.c
View file @
ea5941ba
...
...
@@ -286,7 +286,7 @@ int DRIVE_SetCurrentDrive( int drive )
/***********************************************************************
* DRIVE_FindDriveRoot
*
* Find a drive for which the root matches the beg
g
inning of the given path.
* Find a drive for which the root matches the beginning of the given path.
* This can be used to translate a Unix path into a drive + DOS path.
* Return value is the drive, or -1 on error. On success, path is modified
* to point to the beginning of the DOS path.
...
...
@@ -686,7 +686,7 @@ static int DRIVE_GetFreeSpace( int drive, PULARGE_INTEGER size,
return
1
;
}
/*
/*
**********************************************************************
* DRIVE_GetCurrentDirectory
* Returns "X:\\path\\etc\\".
*
...
...
@@ -1033,12 +1033,17 @@ UINT WINAPI GetCurrentDirectoryA( UINT buflen, LPSTR buf )
{
UINT
ret
;
char
longname
[
MAX_PATHNAME_LEN
];
ret
=
DRIVE_GetCurrentDirectory
(
buflen
,
buf
);
GetLongPathNameA
(
buf
,
longname
,
buflen
);
char
shortname
[
MAX_PATHNAME_LEN
];
ret
=
DRIVE_GetCurrentDirectory
(
MAX_PATHNAME_LEN
,
shortname
);
if
(
ret
>
MAX_PATHNAME_LEN
)
{
ERR_
(
file
)(
"pathnamelength (%d) > MAX_PATHNAME_LEN!
\n
"
,
ret
);
return
ret
;
}
GetLongPathNameA
(
shortname
,
longname
,
MAX_PATHNAME_LEN
);
ret
=
lstrlenA
(
longname
)
+
1
;
if
(
ret
>
buflen
)
return
ret
;
lstrcpyA
(
buf
,
longname
);
return
ret
;
return
ret
-
1
;
}
/***********************************************************************
...
...
@@ -1048,7 +1053,7 @@ UINT WINAPI GetCurrentDirectoryW( UINT buflen, LPWSTR buf )
{
LPSTR
xpath
=
HeapAlloc
(
GetProcessHeap
(),
0
,
buflen
+
1
);
UINT
ret
=
GetCurrentDirectoryA
(
buflen
,
xpath
);
lstrcpyAtoW
(
buf
,
xpath
);
if
(
ret
<
buflen
)
lstrcpyAtoW
(
buf
,
xpath
);
HeapFree
(
GetProcessHeap
(),
0
,
xpath
);
return
ret
;
}
...
...
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