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
01af5452
Commit
01af5452
authored
Dec 14, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Update the environment variables that vary across 32-bit/64-bit/Wow64.
parent
6838b462
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
0 deletions
+82
-0
process.c
dlls/kernel32/process.c
+82
-0
No files found.
dlls/kernel32/process.c
View file @
01af5452
...
...
@@ -542,6 +542,87 @@ static void set_additional_environment(void)
}
/***********************************************************************
* set_wow64_environment
*
* Set the environment variables that change across 32/64/Wow64.
*/
static
void
set_wow64_environment
(
void
)
{
static
const
WCHAR
archW
[]
=
{
'P'
,
'R'
,
'O'
,
'C'
,
'E'
,
'S'
,
'S'
,
'O'
,
'R'
,
'_'
,
'A'
,
'R'
,
'C'
,
'H'
,
'I'
,
'T'
,
'E'
,
'C'
,
'T'
,
'U'
,
'R'
,
'E'
,
0
};
static
const
WCHAR
arch6432W
[]
=
{
'P'
,
'R'
,
'O'
,
'C'
,
'E'
,
'S'
,
'S'
,
'O'
,
'R'
,
'_'
,
'A'
,
'R'
,
'C'
,
'H'
,
'I'
,
'T'
,
'E'
,
'W'
,
'6'
,
'4'
,
'3'
,
'2'
,
0
};
static
const
WCHAR
x86W
[]
=
{
'x'
,
'8'
,
'6'
,
0
};
static
const
WCHAR
versionW
[]
=
{
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
progdirW
[]
=
{
'P'
,
'r'
,
'o'
,
'g'
,
'r'
,
'a'
,
'm'
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
'D'
,
'i'
,
'r'
,
0
};
static
const
WCHAR
progdir86W
[]
=
{
'P'
,
'r'
,
'o'
,
'g'
,
'r'
,
'a'
,
'm'
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
'D'
,
'i'
,
'r'
,
' '
,
'('
,
'x'
,
'8'
,
'6'
,
')'
,
0
};
static
const
WCHAR
progfilesW
[]
=
{
'P'
,
'r'
,
'o'
,
'g'
,
'r'
,
'a'
,
'm'
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
0
};
static
const
WCHAR
progw6432W
[]
=
{
'P'
,
'r'
,
'o'
,
'g'
,
'r'
,
'a'
,
'm'
,
'W'
,
'6'
,
'4'
,
'3'
,
'2'
,
0
};
static
const
WCHAR
commondirW
[]
=
{
'C'
,
'o'
,
'm'
,
'm'
,
'o'
,
'n'
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
'D'
,
'i'
,
'r'
,
0
};
static
const
WCHAR
commondir86W
[]
=
{
'C'
,
'o'
,
'm'
,
'm'
,
'o'
,
'n'
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
'D'
,
'i'
,
'r'
,
' '
,
'('
,
'x'
,
'8'
,
'6'
,
')'
,
0
};
static
const
WCHAR
commonfilesW
[]
=
{
'C'
,
'o'
,
'm'
,
'm'
,
'o'
,
'n'
,
'P'
,
'r'
,
'o'
,
'g'
,
'r'
,
'a'
,
'm'
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
0
};
static
const
WCHAR
commonw6432W
[]
=
{
'C'
,
'o'
,
'm'
,
'm'
,
'o'
,
'n'
,
'P'
,
'r'
,
'o'
,
'g'
,
'r'
,
'a'
,
'm'
,
'W'
,
'6'
,
'4'
,
'3'
,
'2'
,
0
};
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
;
WCHAR
arch
[
64
];
WCHAR
*
value
;
HANDLE
hkey
;
/* set the PROCESSOR_ARCHITECTURE variable */
if
(
GetEnvironmentVariableW
(
arch6432W
,
arch
,
sizeof
(
arch
)
))
{
if
(
is_win64
)
{
SetEnvironmentVariableW
(
archW
,
arch
);
SetEnvironmentVariableW
(
arch6432W
,
NULL
);
}
}
else
if
(
GetEnvironmentVariableW
(
archW
,
arch
,
sizeof
(
arch
)
))
{
if
(
is_wow64
)
{
SetEnvironmentVariableW
(
arch6432W
,
arch
);
SetEnvironmentVariableW
(
archW
,
x86W
);
}
}
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
&
nameW
;
attr
.
Attributes
=
0
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
nameW
,
versionW
);
if
(
NtOpenKey
(
&
hkey
,
KEY_READ
|
KEY_WOW64_64KEY
,
&
attr
))
return
;
/* set the ProgramFiles variables */
if
((
value
=
get_reg_value
(
hkey
,
progdirW
)))
{
if
(
is_win64
||
is_wow64
)
SetEnvironmentVariableW
(
progw6432W
,
value
);
if
(
is_win64
||
!
is_wow64
)
SetEnvironmentVariableW
(
progfilesW
,
value
);
}
if
(
is_wow64
&&
(
value
=
get_reg_value
(
hkey
,
progdir86W
)))
SetEnvironmentVariableW
(
progfilesW
,
value
);
/* set the CommonProgramFiles variables */
if
((
value
=
get_reg_value
(
hkey
,
commondirW
)))
{
if
(
is_win64
||
is_wow64
)
SetEnvironmentVariableW
(
commonw6432W
,
value
);
if
(
is_win64
||
!
is_wow64
)
SetEnvironmentVariableW
(
commonfilesW
,
value
);
}
if
(
is_wow64
&&
(
value
=
get_reg_value
(
hkey
,
commondir86W
)))
SetEnvironmentVariableW
(
commonfilesW
,
value
);
NtClose
(
hkey
);
}
/***********************************************************************
* set_library_wargv
*
* Set the Wine library Unicode argv global variables.
...
...
@@ -1125,6 +1206,7 @@ void CDECL __wine_kernel_init(void)
set_registry_environment
(
got_environment
);
set_additional_environment
();
}
set_wow64_environment
();
if
(
!
(
peb
->
ImageBaseAddress
=
LoadLibraryExW
(
main_exe_name
,
0
,
DONT_RESOLVE_DLL_REFERENCES
)))
{
...
...
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