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
b3ea3956
Commit
b3ea3956
authored
Sep 17, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mountmgr: Support $HOME paths to define shell folders.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fefb5da4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
mountmgr.c
dlls/mountmgr.sys/mountmgr.c
+26
-6
No files found.
dlls/mountmgr.sys/mountmgr.c
View file @
b3ea3956
...
...
@@ -301,7 +301,8 @@ static NTSTATUS define_shell_folder( const void *in_buff, SIZE_T insize )
UNICODE_STRING
name
;
NTSTATUS
status
;
ULONG
size
=
256
;
char
*
buffer
,
*
backup
=
NULL
;
const
char
*
home
;
char
*
buffer
=
NULL
,
*
backup
=
NULL
,
*
homelink
=
NULL
;
struct
stat
st
;
unsigned
int
i
;
...
...
@@ -319,8 +320,21 @@ static NTSTATUS define_shell_folder( const void *in_buff, SIZE_T insize )
if
(
!
link
[
0
])
link
=
NULL
;
}
if
(
link
&&
(
!
strcmp
(
link
,
"$HOME"
)
||
!
strncmp
(
link
,
"$HOME/"
,
6
))
&&
(
home
=
getenv
(
"HOME"
)))
{
link
+=
5
;
homelink
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
home
)
+
strlen
(
link
)
+
1
);
strcpy
(
homelink
,
home
);
strcat
(
homelink
,
link
);
link
=
homelink
;
}
/* ignore nonexistent link targets */
if
(
link
&&
stat
(
link
,
&
st
))
return
STATUS_OBJECT_NAME_NOT_FOUND
;
if
(
link
&&
(
stat
(
link
,
&
st
)
||
!
S_ISDIR
(
st
.
st_mode
)))
{
status
=
STATUS_OBJECT_NAME_NOT_FOUND
;
goto
done
;
}
name
.
Buffer
=
(
WCHAR
*
)((
char
*
)
in_buff
+
input
->
folder_offset
);
name
.
Length
=
input
->
folder_size
;
...
...
@@ -328,11 +342,16 @@ static NTSTATUS define_shell_folder( const void *in_buff, SIZE_T insize )
for
(;;)
{
if
(
!
(
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
return
STATUS_NO_MEMORY
;
status
=
wine_nt_to_unix_file_name
(
&
attr
,
buffer
,
&
size
,
FILE_OPEN
);
if
(
!
status
)
break
;
if
(
!
(
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
{
status
=
STATUS_NO_MEMORY
;
goto
done
;
}
status
=
wine_nt_to_unix_file_name
(
&
attr
,
buffer
,
&
size
,
FILE_OPEN_IF
);
if
(
status
==
STATUS_NO_SUCH_FILE
)
status
=
STATUS_SUCCESS
;
if
(
status
==
STATUS_SUCCESS
)
break
;
if
(
status
!=
STATUS_BUFFER_TOO_SMALL
)
goto
done
;
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
if
(
status
!=
STATUS_BUFFER_TOO_SMALL
)
return
status
;
}
if
(
input
->
create_backup
)
...
...
@@ -376,6 +395,7 @@ static NTSTATUS define_shell_folder( const void *in_buff, SIZE_T insize )
done:
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
backup
);
HeapFree
(
GetProcessHeap
(),
0
,
homelink
);
return
status
;
}
...
...
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