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
04762b35
Commit
04762b35
authored
Apr 05, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move the global options initialization to LdrInitializeThunk().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4f594e15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
51 deletions
+51
-51
loader.c
dlls/ntdll/loader.c
+51
-51
No files found.
dlls/ntdll/loader.c
View file @
04762b35
...
...
@@ -3484,6 +3484,54 @@ static void process_breakpoint(void)
}
/***********************************************************************
* load_global_options
*/
static
void
load_global_options
(
void
)
{
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
name_str
;
HANDLE
hkey
;
ULONG
value
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
&
name_str
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
name_str
,
L"Machine
\\
System
\\
CurrentControlSet
\\
Control
\\
Session Manager"
);
if
(
!
NtOpenKey
(
&
hkey
,
KEY_QUERY_VALUE
,
&
attr
))
{
query_dword_option
(
hkey
,
L"GlobalFlag"
,
&
NtCurrentTeb
()
->
Peb
->
NtGlobalFlag
);
query_dword_option
(
hkey
,
L"SafeProcessSearchMode"
,
&
path_safe_mode
);
query_dword_option
(
hkey
,
L"SafeDllSearchMode"
,
&
dll_safe_mode
);
if
(
!
query_dword_option
(
hkey
,
L"CriticalSectionTimeout"
,
&
value
))
NtCurrentTeb
()
->
Peb
->
CriticalSectionTimeout
.
QuadPart
=
(
ULONGLONG
)
value
*
-
10000000
;
if
(
!
query_dword_option
(
hkey
,
L"HeapSegmentReserve"
,
&
value
))
NtCurrentTeb
()
->
Peb
->
HeapSegmentReserve
=
value
;
if
(
!
query_dword_option
(
hkey
,
L"HeapSegmentCommit"
,
&
value
))
NtCurrentTeb
()
->
Peb
->
HeapSegmentCommit
=
value
;
if
(
!
query_dword_option
(
hkey
,
L"HeapDeCommitTotalFreeThreshold"
,
&
value
))
NtCurrentTeb
()
->
Peb
->
HeapDeCommitTotalFreeThreshold
=
value
;
if
(
!
query_dword_option
(
hkey
,
L"HeapDeCommitFreeBlockThreshold"
,
&
value
))
NtCurrentTeb
()
->
Peb
->
HeapDeCommitFreeBlockThreshold
=
value
;
NtClose
(
hkey
);
}
LdrQueryImageFileExecutionOptions
(
&
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
ImagePathName
,
L"GlobalFlag"
,
REG_DWORD
,
&
NtCurrentTeb
()
->
Peb
->
NtGlobalFlag
,
sizeof
(
DWORD
),
NULL
);
heap_set_debug_flags
(
GetProcessHeap
()
);
}
#ifndef _WIN64
void
*
Wow64Transition
=
NULL
;
...
...
@@ -3568,6 +3616,9 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
ANSI_STRING
func_name
;
WINE_MODREF
*
kernel32
;
init_user_process_params
();
load_global_options
();
version_init
();
#ifndef _WIN64
init_wow64
();
#endif
...
...
@@ -3658,54 +3709,6 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
/***********************************************************************
* load_global_options
*/
static
void
load_global_options
(
void
)
{
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
name_str
;
HANDLE
hkey
;
ULONG
value
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
&
name_str
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
RtlInitUnicodeString
(
&
name_str
,
L"Machine
\\
System
\\
CurrentControlSet
\\
Control
\\
Session Manager"
);
if
(
!
NtOpenKey
(
&
hkey
,
KEY_QUERY_VALUE
,
&
attr
))
{
query_dword_option
(
hkey
,
L"GlobalFlag"
,
&
NtCurrentTeb
()
->
Peb
->
NtGlobalFlag
);
query_dword_option
(
hkey
,
L"SafeProcessSearchMode"
,
&
path_safe_mode
);
query_dword_option
(
hkey
,
L"SafeDllSearchMode"
,
&
dll_safe_mode
);
if
(
!
query_dword_option
(
hkey
,
L"CriticalSectionTimeout"
,
&
value
))
NtCurrentTeb
()
->
Peb
->
CriticalSectionTimeout
.
QuadPart
=
(
ULONGLONG
)
value
*
-
10000000
;
if
(
!
query_dword_option
(
hkey
,
L"HeapSegmentReserve"
,
&
value
))
NtCurrentTeb
()
->
Peb
->
HeapSegmentReserve
=
value
;
if
(
!
query_dword_option
(
hkey
,
L"HeapSegmentCommit"
,
&
value
))
NtCurrentTeb
()
->
Peb
->
HeapSegmentCommit
=
value
;
if
(
!
query_dword_option
(
hkey
,
L"HeapDeCommitTotalFreeThreshold"
,
&
value
))
NtCurrentTeb
()
->
Peb
->
HeapDeCommitTotalFreeThreshold
=
value
;
if
(
!
query_dword_option
(
hkey
,
L"HeapDeCommitFreeBlockThreshold"
,
&
value
))
NtCurrentTeb
()
->
Peb
->
HeapDeCommitFreeBlockThreshold
=
value
;
NtClose
(
hkey
);
}
LdrQueryImageFileExecutionOptions
(
&
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
ImagePathName
,
L"GlobalFlag"
,
REG_DWORD
,
&
NtCurrentTeb
()
->
Peb
->
NtGlobalFlag
,
sizeof
(
DWORD
),
NULL
);
heap_set_debug_flags
(
GetProcessHeap
()
);
}
/***********************************************************************
* RtlImageDirectoryEntryToData (NTDLL.@)
*/
PVOID
WINAPI
RtlImageDirectoryEntryToData
(
HMODULE
module
,
BOOL
image
,
WORD
dir
,
ULONG
*
size
)
...
...
@@ -4067,9 +4070,6 @@ static NTSTATUS process_init(void)
InitializeListHead
(
&
ldr
.
InMemoryOrderModuleList
);
InitializeListHead
(
&
ldr
.
InInitializationOrderModuleList
);
init_user_process_params
();
load_global_options
();
version_init
();
return
STATUS_SUCCESS
;
}
...
...
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