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
74390cea
Commit
74390cea
authored
Mar 19, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a global constant for the system directory.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1d66a108
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
14 deletions
+12
-14
env.c
dlls/ntdll/unix/env.c
+7
-7
loadorder.c
dlls/ntdll/unix/loadorder.c
+2
-4
process.c
dlls/ntdll/unix/process.c
+2
-3
unix_private.h
dlls/ntdll/unix/unix_private.h
+1
-0
No files found.
dlls/ntdll/unix/env.c
View file @
74390cea
...
...
@@ -76,6 +76,10 @@ static LANGID user_ui_language, system_ui_language;
static
char
system_locale
[
LOCALE_NAME_MAX_LENGTH
];
static
char
user_locale
[
LOCALE_NAME_MAX_LENGTH
];
/* system directory with trailing backslash */
const
WCHAR
system_dir
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
'\\'
,
0
};
static
struct
{
USHORT
*
data
;
...
...
@@ -149,8 +153,6 @@ static void *read_nls_file( ULONG type, ULONG id )
static
NTSTATUS
open_nls_data_file
(
ULONG
type
,
ULONG
id
,
HANDLE
*
file
)
{
static
const
WCHAR
systemdirW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
'\\'
,
0
};
static
const
WCHAR
sortdirW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'g'
,
'l'
,
'o'
,
'b'
,
'a'
,
'l'
,
'i'
,
'z'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'\\'
,
's'
,
'o'
,
'r'
,
't'
,
'i'
,
'n'
,
'g'
,
'\\'
,
0
};
...
...
@@ -165,7 +167,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
if
(
!
path
)
return
STATUS_OBJECT_NAME_NOT_FOUND
;
/* try to open file in system dir */
wcscpy
(
buffer
,
type
==
NLS_SECTION_SORTKEYS
?
sortdirW
:
system
dirW
);
wcscpy
(
buffer
,
type
==
NLS_SECTION_SORTKEYS
?
sortdirW
:
system
_dir
);
p
=
strrchr
(
path
,
'/'
)
+
1
;
ascii_to_unicode
(
buffer
+
wcslen
(
buffer
),
p
,
strlen
(
p
)
+
1
);
init_unicode_string
(
&
valueW
,
buffer
);
...
...
@@ -1609,8 +1611,6 @@ static void run_wineboot( WCHAR *env, SIZE_T size )
static
const
WCHAR
cmdlineW
[]
=
{
'"'
,
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'e'
,
'b'
,
'o'
,
'o'
,
't'
,
'.'
,
'e'
,
'x'
,
'e'
,
'"'
,
' '
,
'-'
,
'-'
,
'i'
,
'n'
,
'i'
,
't'
,
0
};
static
const
WCHAR
sysdirW
[]
=
{
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
0
};
RTL_USER_PROCESS_PARAMETERS
params
=
{
sizeof
(
params
),
sizeof
(
params
)
};
PS_ATTRIBUTE_LIST
ps_attr
;
PS_CREATE_INFO
create_info
;
...
...
@@ -1635,8 +1635,8 @@ static void run_wineboot( WCHAR *env, SIZE_T size )
params
.
Flags
=
PROCESS_PARAMS_FLAG_NORMALIZED
;
params
.
Environment
=
env
;
params
.
EnvironmentSize
=
size
;
init_unicode_string
(
&
params
.
CurrentDirectory
.
DosPath
,
sys
dirW
);
init_unicode_string
(
&
params
.
DllPath
,
sys
dirW
);
init_unicode_string
(
&
params
.
CurrentDirectory
.
DosPath
,
sys
tem_dir
+
4
);
init_unicode_string
(
&
params
.
DllPath
,
sys
tem_dir
+
4
);
init_unicode_string
(
&
params
.
ImagePathName
,
appnameW
+
4
);
init_unicode_string
(
&
params
.
CommandLine
,
cmdlineW
);
init_unicode_string
(
&
params
.
WindowTitle
,
appnameW
+
4
);
...
...
dlls/ntdll/unix/loadorder.c
View file @
74390cea
...
...
@@ -381,8 +381,6 @@ static enum loadorder get_load_order_value( HANDLE std_key, HANDLE app_key, WCHA
enum
loadorder
CDECL
get_load_order
(
const
WCHAR
*
app_name
,
const
UNICODE_STRING
*
nt_name
)
{
static
const
WCHAR
prefixW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
};
static
const
WCHAR
system_dir
[]
=
{
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
};
enum
loadorder
ret
=
LO_INVALID
;
HANDLE
std_key
,
app_key
=
0
;
const
WCHAR
*
path
=
nt_name
->
Buffer
;
...
...
@@ -398,9 +396,9 @@ enum loadorder CDECL get_load_order( const WCHAR *app_name, const UNICODE_STRING
/* Strip path information if the module resides in the system directory
*/
if
(
!
wcsnicmp
(
system_dir
,
path
,
ARRAY_SIZE
(
system_dir
)
))
if
(
!
wcsnicmp
(
system_dir
+
4
,
path
,
wcslen
(
system_dir
)
-
4
))
{
const
WCHAR
*
p
=
path
+
ARRAY_SIZE
(
system_dir
)
;
const
WCHAR
*
p
=
path
+
wcslen
(
system_dir
)
-
4
;
while
(
*
p
==
'\\'
||
*
p
==
'/'
)
p
++
;
if
(
!
wcschr
(
p
,
'\\'
)
&&
!
wcschr
(
p
,
'/'
))
path
=
p
;
}
...
...
dlls/ntdll/unix/process.c
View file @
74390cea
...
...
@@ -281,13 +281,12 @@ static startup_info_t *create_startup_info( const RTL_USER_PROCESS_PARAMETERS *p
*/
static
BOOL
is_builtin_path
(
UNICODE_STRING
*
path
,
BOOL
*
is_64bit
)
{
static
const
WCHAR
systemW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'c'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
'\\'
};
static
const
WCHAR
wow64W
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'c'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
'w'
,
'o'
,
'w'
,
'6'
,
'4'
};
*
is_64bit
=
is_win64
;
if
(
path
->
Length
>
sizeof
(
systemW
)
&&
!
wcsnicmp
(
path
->
Buffer
,
systemW
,
ARRAY_SIZE
(
systemW
)
))
if
(
path
->
Length
>
wcslen
(
system_dir
)
*
sizeof
(
WCHAR
)
&&
!
wcsnicmp
(
path
->
Buffer
,
system_dir
,
wcslen
(
system_dir
)
))
{
#ifndef _WIN64
if
(
NtCurrentTeb64
()
&&
NtCurrentTeb64
()
->
TlsSlots
[
WOW64_TLS_FILESYSREDIR
])
*
is_64bit
=
TRUE
;
...
...
dlls/ntdll/unix/unix_private.h
View file @
74390cea
...
...
@@ -122,6 +122,7 @@ extern int main_argc DECLSPEC_HIDDEN;
extern
char
**
main_argv
DECLSPEC_HIDDEN
;
extern
char
**
main_envp
DECLSPEC_HIDDEN
;
extern
WCHAR
**
main_wargv
DECLSPEC_HIDDEN
;
extern
const
WCHAR
system_dir
[]
DECLSPEC_HIDDEN
;
extern
unsigned
int
server_cpus
DECLSPEC_HIDDEN
;
extern
BOOL
is_wow64
DECLSPEC_HIDDEN
;
extern
BOOL
process_exiting
DECLSPEC_HIDDEN
;
...
...
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