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
7929b21e
Commit
7929b21e
authored
Apr 01, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Define NtCurrentTeb64() on 64-bit to avoid some #ifdefs.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e6ed9430
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
37 deletions
+14
-37
directory.c
dlls/ntdll/directory.c
+0
-8
env.c
dlls/ntdll/env.c
+4
-7
loader.c
dlls/ntdll/loader.c
+1
-6
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+3
-4
env.c
dlls/ntdll/unix/env.c
+3
-5
file.c
dlls/ntdll/unix/file.c
+0
-4
loader.c
dlls/ntdll/unix/loader.c
+0
-2
unix_private.h
dlls/ntdll/unix/unix_private.h
+3
-1
No files found.
dlls/ntdll/directory.c
View file @
7929b21e
...
...
@@ -46,13 +46,9 @@
*/
NTSTATUS
WINAPI
RtlWow64EnableFsRedirection
(
BOOLEAN
enable
)
{
#ifdef _WIN64
return
STATUS_NOT_IMPLEMENTED
;
#else
if
(
!
NtCurrentTeb64
())
return
STATUS_NOT_IMPLEMENTED
;
NtCurrentTeb64
()
->
TlsSlots
[
WOW64_TLS_FILESYSREDIR
]
=
!
enable
;
return
STATUS_SUCCESS
;
#endif
}
...
...
@@ -61,9 +57,6 @@ NTSTATUS WINAPI RtlWow64EnableFsRedirection( BOOLEAN enable )
*/
NTSTATUS
WINAPI
RtlWow64EnableFsRedirectionEx
(
ULONG
disable
,
ULONG
*
old_value
)
{
#ifdef _WIN64
return
STATUS_NOT_IMPLEMENTED
;
#else
if
(
!
NtCurrentTeb64
())
return
STATUS_NOT_IMPLEMENTED
;
__TRY
...
...
@@ -78,7 +71,6 @@ NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx( ULONG disable, ULONG *old_value )
NtCurrentTeb64
()
->
TlsSlots
[
WOW64_TLS_FILESYSREDIR
]
=
disable
;
return
STATUS_SUCCESS
;
#endif
}
...
...
dlls/ntdll/env.c
View file @
7929b21e
...
...
@@ -73,14 +73,11 @@ static void set_wow64_environment( WCHAR **env )
RtlSetEnvironmentVariable
(
env
,
&
arch6432_strW
,
NULL
);
}
}
else
if
(
!
RtlQueryEnvironmentVariable_U
(
*
env
,
&
arch_strW
,
&
valW
))
else
if
(
NtCurrentTeb64
()
&&
!
RtlQueryEnvironmentVariable_U
(
*
env
,
&
arch_strW
,
&
valW
))
{
if
(
is_wow64
)
{
RtlSetEnvironmentVariable
(
env
,
&
arch6432_strW
,
&
valW
);
RtlInitUnicodeString
(
&
nameW
,
L"x86"
);
RtlSetEnvironmentVariable
(
env
,
&
arch_strW
,
&
nameW
);
}
RtlSetEnvironmentVariable
(
env
,
&
arch6432_strW
,
&
valW
);
RtlInitUnicodeString
(
&
nameW
,
L"x86"
);
RtlSetEnvironmentVariable
(
env
,
&
arch_strW
,
&
nameW
);
}
/* set the ProgramFiles variables */
...
...
dlls/ntdll/loader.c
View file @
7929b21e
...
...
@@ -69,7 +69,6 @@ const WCHAR system_dir[] = L"C:\\windows\\system32\\";
const
WCHAR
syswow64_dir
[]
=
L"C:
\\
windows
\\
syswow64
\\
"
;
HMODULE
kernel32_handle
=
0
;
BOOL
is_wow64
=
FALSE
;
/* system search path */
static
const
WCHAR
system_path
[]
=
L"C:
\\
windows
\\
system32;C:
\\
windows
\\
system;C:
\\
windows"
;
...
...
@@ -2704,7 +2703,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, con
}
/* Win 7/2008R2 and up seem to re-enable WoW64 FS redirection when loading libraries */
if
(
is_wow64
)
RtlWow64EnableFsRedirectionEx
(
0
,
&
wow64_old_value
);
RtlWow64EnableFsRedirectionEx
(
0
,
&
wow64_old_value
);
nt_name
->
Buffer
=
NULL
;
...
...
@@ -4048,10 +4047,6 @@ static NTSTATUS process_init(void)
InitializeListHead
(
&
ldr
.
InMemoryOrderModuleList
);
InitializeListHead
(
&
ldr
.
InInitializationOrderModuleList
);
#ifndef _WIN64
is_wow64
=
!!
NtCurrentTeb64
();
#endif
init_user_process_params
();
load_global_options
();
version_init
();
...
...
dlls/ntdll/ntdll_misc.h
View file @
7929b21e
...
...
@@ -64,9 +64,6 @@ extern void heap_set_debug_flags( HANDLE handle ) DECLSPEC_HIDDEN;
extern
void
init_user_process_params
(
void
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
DECLSPEC_NORETURN
signal_start_thread
(
CONTEXT
*
ctx
)
DECLSPEC_HIDDEN
;
/* server support */
extern
BOOL
is_wow64
DECLSPEC_HIDDEN
;
/* module handling */
extern
LIST_ENTRY
tls_links
DECLSPEC_HIDDEN
;
extern
FARPROC
RELAY_GetProcAddress
(
HMODULE
module
,
const
IMAGE_EXPORT_DIRECTORY
*
exports
,
...
...
@@ -90,7 +87,9 @@ extern int CDECL NTDLL__vsnwprintf( WCHAR *str, SIZE_T len, const WCHAR *format,
/* load order */
#ifndef _WIN64
#ifdef _WIN64
static
inline
TEB64
*
NtCurrentTeb64
(
void
)
{
return
NULL
;
}
#else
static
inline
TEB64
*
NtCurrentTeb64
(
void
)
{
return
(
TEB64
*
)
NtCurrentTeb
()
->
GdiBatchCount
;
}
#endif
...
...
dlls/ntdll/unix/env.c
View file @
7929b21e
...
...
@@ -1827,7 +1827,6 @@ static void run_wineboot( WCHAR *env, SIZE_T size )
wine_server_fd_to_handle
(
2
,
GENERIC_WRITE
|
SYNCHRONIZE
,
OBJ_INHERIT
,
&
params
.
hStdError
);
#ifndef _WIN64
if
(
NtCurrentTeb64
()
&&
!
NtCurrentTeb64
()
->
TlsSlots
[
WOW64_TLS_FILESYSREDIR
])
{
NtCurrentTeb64
()
->
TlsSlots
[
WOW64_TLS_FILESYSREDIR
]
=
TRUE
;
...
...
@@ -1837,10 +1836,9 @@ static void run_wineboot( WCHAR *env, SIZE_T size )
NtCurrentTeb64
()
->
TlsSlots
[
WOW64_TLS_FILESYSREDIR
]
=
FALSE
;
}
else
#endif
status
=
NtCreateUserProcess
(
&
process
,
&
thread
,
PROCESS_ALL_ACCESS
,
THREAD_ALL_ACCESS
,
NULL
,
NULL
,
0
,
THREAD_CREATE_FLAGS_CREATE_SUSPENDED
,
&
params
,
&
create_info
,
&
ps_attr
);
status
=
NtCreateUserProcess
(
&
process
,
&
thread
,
PROCESS_ALL_ACCESS
,
THREAD_ALL_ACCESS
,
NULL
,
NULL
,
0
,
THREAD_CREATE_FLAGS_CREATE_SUSPENDED
,
&
params
,
&
create_info
,
&
ps_attr
);
NtClose
(
params
.
hStdError
);
if
(
status
)
...
...
dlls/ntdll/unix/file.c
View file @
7929b21e
...
...
@@ -3118,11 +3118,7 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
int
ret
,
len
;
struct
stat
st
;
char
*
unix_name
=
*
buffer
;
#ifdef _WIN64
const
BOOL
redirect
=
FALSE
;
#else
const
BOOL
redirect
=
NtCurrentTeb64
()
&&
!
NtCurrentTeb64
()
->
TlsSlots
[
WOW64_TLS_FILESYSREDIR
];
#endif
/* try a shortcut first */
...
...
dlls/ntdll/unix/loader.c
View file @
7929b21e
...
...
@@ -1439,10 +1439,8 @@ BOOL is_builtin_path( const UNICODE_STRING *path, WORD *machine )
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
])
*
machine
=
IMAGE_FILE_MACHINE_AMD64
;
#endif
goto
found
;
}
if
((
is_win64
||
is_wow64
)
&&
path
->
Length
>
sizeof
(
wow64W
)
&&
...
...
dlls/ntdll/unix/unix_private.h
View file @
7929b21e
...
...
@@ -315,7 +315,9 @@ static inline void mutex_unlock( pthread_mutex_t *mutex )
if
(
!
process_exiting
)
pthread_mutex_unlock
(
mutex
);
}
#ifndef _WIN64
#ifdef _WIN64
static
inline
TEB64
*
NtCurrentTeb64
(
void
)
{
return
NULL
;
}
#else
static
inline
TEB64
*
NtCurrentTeb64
(
void
)
{
return
(
TEB64
*
)
NtCurrentTeb
()
->
GdiBatchCount
;
}
#endif
...
...
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