Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
305cb8af
Commit
305cb8af
authored
Feb 25, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Initialize the ShowDotFiles option on the Unix side.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
06b729f7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
56 deletions
+54
-56
directory.c
dlls/ntdll/directory.c
+0
-39
loader.c
dlls/ntdll/loader.c
+0
-1
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+0
-2
file.c
dlls/ntdll/unix/file.c
+53
-9
loader.c
dlls/ntdll/unix/loader.c
+0
-1
unixlib.h
dlls/ntdll/unixlib.h
+1
-4
No files found.
dlls/ntdll/directory.c
View file @
305cb8af
...
...
@@ -40,45 +40,6 @@
#include "wine/debug.h"
#include "wine/exception.h"
#define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
static
BOOL
show_dot_files
;
/***********************************************************************
* init_directories
*/
void
init_directories
(
void
)
{
char
tmp
[
80
];
HANDLE
root
,
hkey
;
DWORD
dummy
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
RtlOpenCurrentUser
(
KEY_ALL_ACCESS
,
&
root
);
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
root
;
attr
.
ObjectName
=
&
nameW
;
attr
.
Attributes
=
0
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
nameW
,
L"Software
\\
Wine"
);
/* @@ Wine registry key: HKCU\Software\Wine */
if
(
!
NtOpenKey
(
&
hkey
,
KEY_ALL_ACCESS
,
&
attr
))
{
RtlInitUnicodeString
(
&
nameW
,
L"ShowDotFiles"
);
if
(
!
NtQueryValueKey
(
hkey
,
&
nameW
,
KeyValuePartialInformation
,
tmp
,
sizeof
(
tmp
),
&
dummy
))
{
WCHAR
*
str
=
(
WCHAR
*
)((
KEY_VALUE_PARTIAL_INFORMATION
*
)
tmp
)
->
Data
;
show_dot_files
=
IS_OPTION_TRUE
(
str
[
0
]
);
}
NtClose
(
hkey
);
}
NtClose
(
root
);
unix_funcs
->
set_show_dot_files
(
show_dot_files
);
}
/******************************************************************
* RtlWow64EnableFsRedirection (NTDLL.@)
...
...
dlls/ntdll/loader.c
View file @
305cb8af
...
...
@@ -3999,7 +3999,6 @@ static NTSTATUS process_init(void)
#endif
init_unix_codepage
();
init_directories
();
init_user_process_params
();
params
=
peb
->
ProcessParameters
;
...
...
dlls/ntdll/ntdll_misc.h
View file @
305cb8af
...
...
@@ -84,8 +84,6 @@ extern const WCHAR syswow64_dir[] DECLSPEC_HIDDEN;
extern
void
(
FASTCALL
*
pBaseThreadInitThunk
)(
DWORD
,
LPTHREAD_START_ROUTINE
,
void
*
)
DECLSPEC_HIDDEN
;
extern
const
struct
unix_funcs
*
unix_funcs
DECLSPEC_HIDDEN
;
extern
void
init_directories
(
void
)
DECLSPEC_HIDDEN
;
extern
struct
_KUSER_SHARED_DATA
*
user_shared_data
DECLSPEC_HIDDEN
;
/* locale */
...
...
dlls/ntdll/unix/file.c
View file @
305cb8af
...
...
@@ -2726,11 +2726,46 @@ static int get_redirect_path( char *unix_name, int pos, const WCHAR *name, int l
#endif
#define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
static
NTSTATUS
open_hkcu_key
(
const
char
*
path
,
HANDLE
*
key
)
{
NTSTATUS
status
;
char
buffer
[
256
];
WCHAR
bufferW
[
256
];
DWORD_PTR
sid_data
[(
sizeof
(
TOKEN_USER
)
+
SECURITY_MAX_SID_SIZE
)
/
sizeof
(
DWORD_PTR
)];
DWORD
i
,
len
=
sizeof
(
sid_data
);
SID
*
sid
;
UNICODE_STRING
name
;
OBJECT_ATTRIBUTES
attr
;
status
=
NtQueryInformationToken
(
GetCurrentThreadEffectiveToken
(),
TokenUser
,
sid_data
,
len
,
&
len
);
if
(
status
)
return
status
;
sid
=
((
TOKEN_USER
*
)
sid_data
)
->
User
.
Sid
;
len
=
sprintf
(
buffer
,
"
\\
Registry
\\
User
\\
S-%u-%u"
,
sid
->
Revision
,
MAKELONG
(
MAKEWORD
(
sid
->
IdentifierAuthority
.
Value
[
5
],
sid
->
IdentifierAuthority
.
Value
[
4
]
),
MAKEWORD
(
sid
->
IdentifierAuthority
.
Value
[
3
],
sid
->
IdentifierAuthority
.
Value
[
2
]
)));
for
(
i
=
0
;
i
<
sid
->
SubAuthorityCount
;
i
++
)
len
+=
sprintf
(
buffer
+
len
,
"-%u"
,
sid
->
SubAuthority
[
i
]
);
len
+=
sprintf
(
buffer
+
len
,
"
\\
%s"
,
path
);
name
.
Buffer
=
bufferW
;
name
.
Length
=
len
*
sizeof
(
WCHAR
);
name
.
MaximumLength
=
name
.
Length
+
sizeof
(
WCHAR
);
ascii_to_unicode
(
bufferW
,
buffer
,
len
+
1
);
InitializeObjectAttributes
(
&
attr
,
&
name
,
OBJ_CASE_INSENSITIVE
,
0
,
NULL
);
return
NtCreateKey
(
key
,
KEY_ALL_ACCESS
,
&
attr
,
0
,
NULL
,
0
,
NULL
);
}
/***********************************************************************
* init_files
*/
void
init_files
(
void
)
{
HANDLE
key
;
#ifndef _WIN64
if
(
is_wow64
)
init_redirects
();
#endif
...
...
@@ -2744,6 +2779,24 @@ void init_files(void)
/* retrieve initial umask */
start_umask
=
umask
(
0777
);
umask
(
start_umask
);
if
(
!
open_hkcu_key
(
"Software
\\
Wine"
,
&
key
))
{
static
WCHAR
showdotfilesW
[]
=
{
'S'
,
'h'
,
'o'
,
'w'
,
'D'
,
'o'
,
't'
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
0
};
char
tmp
[
80
];
DWORD
dummy
;
UNICODE_STRING
nameW
;
nameW
.
MaximumLength
=
sizeof
(
showdotfilesW
);
nameW
.
Length
=
nameW
.
MaximumLength
-
sizeof
(
WCHAR
);
nameW
.
Buffer
=
showdotfilesW
;
if
(
!
NtQueryValueKey
(
key
,
&
nameW
,
KeyValuePartialInformation
,
tmp
,
sizeof
(
tmp
),
&
dummy
))
{
WCHAR
*
str
=
(
WCHAR
*
)((
KEY_VALUE_PARTIAL_INFORMATION
*
)
tmp
)
->
Data
;
show_dot_files
=
IS_OPTION_TRUE
(
str
[
0
]
);
}
NtClose
(
key
);
}
}
...
...
@@ -3522,15 +3575,6 @@ static NTSTATUS unmount_device( HANDLE handle )
}
/***********************************************************************
* set_show_dot_files
*/
void
CDECL
set_show_dot_files
(
BOOL
enable
)
{
show_dot_files
=
enable
;
}
/******************************************************************************
* open_unix_file
*
...
...
dlls/ntdll/unix/loader.c
View file @
305cb8af
...
...
@@ -1718,7 +1718,6 @@ static struct unix_funcs unix_funcs =
get_unix_codepage_data
,
get_locales
,
virtual_release_address_space
,
set_show_dot_files
,
load_so_dll
,
load_builtin_dll
,
unload_builtin_dll
,
...
...
dlls/ntdll/unixlib.h
View file @
305cb8af
...
...
@@ -26,7 +26,7 @@
struct
_DISPATCHER_CONTEXT
;
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 11
2
#define NTDLL_UNIXLIB_VERSION 11
3
struct
unix_funcs
{
...
...
@@ -76,9 +76,6 @@ struct unix_funcs
/* virtual memory functions */
void
(
CDECL
*
virtual_release_address_space
)(
void
);
/* file functions */
void
(
CDECL
*
set_show_dot_files
)(
BOOL
enable
);
/* loader functions */
NTSTATUS
(
CDECL
*
load_so_dll
)(
UNICODE_STRING
*
nt_name
,
void
**
module
);
NTSTATUS
(
CDECL
*
load_builtin_dll
)(
UNICODE_STRING
*
name
,
void
**
module
,
void
**
unix_entry
,
...
...
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