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
59a7777f
Commit
59a7777f
authored
Feb 19, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Hardcode the windows and system directories.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
12276796
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
45 deletions
+9
-45
kernel_private.h
dlls/kernel32/kernel_private.h
+2
-2
process.c
dlls/kernel32/process.c
+7
-43
No files found.
dlls/kernel32/kernel_private.h
View file @
59a7777f
...
...
@@ -55,8 +55,8 @@ static inline obj_handle_t console_handle_unmap(HANDLE h)
extern
HMODULE
kernel32_handle
DECLSPEC_HIDDEN
;
extern
SYSTEM_BASIC_INFORMATION
system_info
DECLSPEC_HIDDEN
;
extern
const
WCHAR
*
DIR_Windows
DECLSPEC_HIDDEN
;
extern
const
WCHAR
*
DIR_System
DECLSPEC_HIDDEN
;
extern
const
WCHAR
DIR_Windows
[]
DECLSPEC_HIDDEN
;
extern
const
WCHAR
DIR_System
[]
DECLSPEC_HIDDEN
;
extern
const
WCHAR
*
DIR_SysWow64
DECLSPEC_HIDDEN
;
extern
void
FILE_SetDosError
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/kernel32/process.c
View file @
59a7777f
...
...
@@ -64,7 +64,6 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
process
);
WINE_DECLARE_DEBUG_CHANNEL
(
file
);
WINE_DECLARE_DEBUG_CHANNEL
(
relay
);
#ifdef __APPLE__
...
...
@@ -90,8 +89,9 @@ static const BOOL is_win64 = (sizeof(void *) > sizeof(int));
HMODULE
kernel32_handle
=
0
;
SYSTEM_BASIC_INFORMATION
system_info
=
{
0
};
const
WCHAR
*
DIR_Windows
=
NULL
;
const
WCHAR
*
DIR_System
=
NULL
;
const
WCHAR
DIR_Windows
[]
=
{
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
0
};
const
WCHAR
DIR_System
[]
=
{
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
0
};
const
WCHAR
*
DIR_SysWow64
=
NULL
;
/* Process flags */
...
...
@@ -954,41 +954,12 @@ done:
/***********************************************************************
* init_windows_dirs
*
*
Initialize the windows and system directories from the environment
.
*
Create the windows and system directories if necessary
.
*/
static
void
init_windows_dirs
(
void
)
{
static
const
WCHAR
windirW
[]
=
{
'w'
,
'i'
,
'n'
,
'd'
,
'i'
,
'r'
,
0
};
static
const
WCHAR
winsysdirW
[]
=
{
'w'
,
'i'
,
'n'
,
's'
,
'y'
,
's'
,
'd'
,
'i'
,
'r'
,
0
};
static
const
WCHAR
default_windirW
[]
=
{
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
0
};
static
const
WCHAR
default_sysdirW
[]
=
{
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
0
};
static
const
WCHAR
default_syswow64W
[]
=
{
'\\'
,
's'
,
'y'
,
's'
,
'w'
,
'o'
,
'w'
,
'6'
,
'4'
,
0
};
DWORD
len
;
WCHAR
*
buffer
;
if
((
len
=
GetEnvironmentVariableW
(
windirW
,
NULL
,
0
)))
{
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
GetEnvironmentVariableW
(
windirW
,
buffer
,
len
);
DIR_Windows
=
buffer
;
}
else
DIR_Windows
=
default_windirW
;
if
((
len
=
GetEnvironmentVariableW
(
winsysdirW
,
NULL
,
0
)))
{
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
GetEnvironmentVariableW
(
winsysdirW
,
buffer
,
len
);
DIR_System
=
buffer
;
}
else
{
len
=
strlenW
(
DIR_Windows
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
+
sizeof
(
default_sysdirW
)
);
memcpy
(
buffer
,
DIR_Windows
,
len
*
sizeof
(
WCHAR
)
);
memcpy
(
buffer
+
len
,
default_sysdirW
,
sizeof
(
default_sysdirW
)
);
DIR_System
=
buffer
;
}
static
const
WCHAR
default_syswow64W
[]
=
{
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
'w'
,
'o'
,
'w'
,
'6'
,
'4'
,
0
};
if
(
!
CreateDirectoryW
(
DIR_Windows
,
NULL
)
&&
GetLastError
()
!=
ERROR_ALREADY_EXISTS
)
ERR
(
"directory %s could not be created, error %u
\n
"
,
...
...
@@ -999,18 +970,11 @@ static void init_windows_dirs(void)
if
(
is_win64
||
is_wow64
)
/* SysWow64 is always defined on 64-bit */
{
len
=
strlenW
(
DIR_Windows
);
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
+
sizeof
(
default_syswow64W
)
);
memcpy
(
buffer
,
DIR_Windows
,
len
*
sizeof
(
WCHAR
)
);
memcpy
(
buffer
+
len
,
default_syswow64W
,
sizeof
(
default_syswow64W
)
);
DIR_SysWow64
=
buffer
;
DIR_SysWow64
=
default_syswow64W
;
if
(
!
CreateDirectoryW
(
DIR_SysWow64
,
NULL
)
&&
GetLastError
()
!=
ERROR_ALREADY_EXISTS
)
ERR
(
"directory %s could not be created, error %u
\n
"
,
debugstr_w
(
DIR_SysWow64
),
GetLastError
()
);
}
TRACE_
(
file
)(
"WindowsDir = %s
\n
"
,
debugstr_w
(
DIR_Windows
)
);
TRACE_
(
file
)(
"SystemDir = %s
\n
"
,
debugstr_w
(
DIR_System
)
);
}
...
...
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