Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3be8cb8b
Commit
3be8cb8b
authored
Jul 14, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved initialization of the default user process parameters to ntdll.
parent
3aefc4e4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
36 deletions
+35
-36
process.c
dlls/kernel/process.c
+4
-18
loader.c
dlls/ntdll/loader.c
+1
-14
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+3
-1
path.c
dlls/ntdll/path.c
+1
-1
thread.c
dlls/ntdll/thread.c
+26
-2
No files found.
dlls/kernel/process.c
View file @
3be8cb8b
...
...
@@ -743,6 +743,7 @@ static BOOL init_user_process_params( RTL_USER_PROCESS_PARAMETERS *params )
HANDLE
hstdin
,
hstdout
,
hstderr
;
size
=
info_size
=
params
->
AllocationSize
;
if
(
!
size
)
return
TRUE
;
/* no parameters received from parent */
SERVER_START_REQ
(
get_startup_info
)
{
...
...
@@ -933,7 +934,6 @@ static BOOL process_init(void)
{
static
const
WCHAR
kernel32W
[]
=
{
'k'
,
'e'
,
'r'
,
'n'
,
'e'
,
'l'
,
'3'
,
'2'
,
0
};
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
RTL_USER_PROCESS_PARAMETERS
*
params
=
peb
->
ProcessParameters
;
extern
void
__wine_dbg_kernel32_init
(
void
);
PTHREAD_Init
();
...
...
@@ -944,27 +944,13 @@ static BOOL process_init(void)
setbuf
(
stderr
,
NULL
);
setlocale
(
LC_CTYPE
,
""
);
if
(
!
params
->
AllocationSize
)
{
/* This is wine specific: we have no parent (we're started from unix)
* so, create a simple console with bare handles to unix stdio
* input & output streams (aka simple console)
*/
wine_server_fd_to_handle
(
0
,
GENERIC_READ
|
SYNCHRONIZE
,
TRUE
,
&
params
->
hStdInput
);
wine_server_fd_to_handle
(
1
,
GENERIC_WRITE
|
SYNCHRONIZE
,
TRUE
,
&
params
->
hStdOutput
);
wine_server_fd_to_handle
(
2
,
GENERIC_WRITE
|
SYNCHRONIZE
,
TRUE
,
&
params
->
hStdError
);
params
->
CurrentDirectory
.
DosPath
.
Length
=
0
;
params
->
CurrentDirectory
.
DosPath
.
MaximumLength
=
RtlGetLongestNtPathLength
()
*
sizeof
(
WCHAR
);
params
->
CurrentDirectory
.
DosPath
.
Buffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
params
->
CurrentDirectory
.
DosPath
.
MaximumLength
);
}
else
if
(
!
init_user_process_params
(
params
))
return
FALSE
;
if
(
!
init_user_process_params
(
peb
->
ProcessParameters
))
return
FALSE
;
kernel32_handle
=
GetModuleHandleW
(
kernel32W
);
LOCALE_Init
();
if
(
!
p
arams
->
AllocationSize
)
if
(
!
p
eb
->
ProcessParameters
->
Environment
)
{
/* Copy the parent environment */
if
(
!
build_initial_environment
(
__wine_main_environ
))
return
FALSE
;
...
...
@@ -976,7 +962,7 @@ static BOOL process_init(void)
}
init_windows_dirs
();
init_current_directory
(
&
p
aram
s
->
CurrentDirectory
);
init_current_directory
(
&
p
eb
->
ProcessParameter
s
->
CurrentDirectory
);
return
TRUE
;
}
...
...
dlls/ntdll/loader.c
View file @
3be8cb8b
...
...
@@ -2126,22 +2126,9 @@ void __wine_process_init( int argc, char *argv[] )
NTSTATUS
status
;
ANSI_STRING
func_name
;
void
(
*
DECLSPEC_NORETURN
init_func
)();
ULONG
info_size
;
extern
mode_t
FILE_umask
;
info_size
=
thread_init
();
if
(
info_size
)
{
RTL_USER_PROCESS_PARAMETERS
*
params
=
NULL
;
if
(
NtAllocateVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
params
,
0
,
&
info_size
,
MEM_COMMIT
,
PAGE_READWRITE
)
==
STATUS_SUCCESS
)
{
params
->
AllocationSize
=
info_size
;
NtCurrentTeb
()
->
Peb
->
ProcessParameters
=
params
;
}
}
thread_init
();
/* retrieve current umask */
FILE_umask
=
umask
(
0777
);
...
...
dlls/ntdll/ntdll_misc.h
View file @
3be8cb8b
...
...
@@ -34,6 +34,8 @@
#define SIGNAL_STACK_SIZE 0
/* we don't need a signal stack on non-i386 */
#endif
#define MAX_NT_PATH_LENGTH 277
extern
void
WINAPI
__regs_RtlRaiseException
(
PEXCEPTION_RECORD
,
PCONTEXT
);
/* debug helper */
...
...
@@ -48,7 +50,7 @@ extern NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handl
/* init routines */
extern
BOOL
SIGNAL_Init
(
void
);
extern
void
debug_init
(
void
);
extern
ULONG
thread_init
(
void
);
extern
void
thread_init
(
void
);
extern
void
virtual_init
(
void
);
/* server support */
...
...
dlls/ntdll/path.c
View file @
3be8cb8b
...
...
@@ -783,7 +783,7 @@ DWORD WINAPI RtlGetFullPathName_U(const WCHAR* name, ULONG size, WCHAR* buffer,
*/
DWORD
WINAPI
RtlGetLongestNtPathLength
(
void
)
{
return
277
;
return
MAX_NT_PATH_LENGTH
;
}
/******************************************************************
...
...
dlls/ntdll/thread.c
View file @
3be8cb8b
...
...
@@ -48,6 +48,7 @@ struct startup_info
static
PEB
peb
;
static
PEB_LDR_DATA
ldr
;
static
RTL_USER_PROCESS_PARAMETERS
params
;
/* default parameters if no parent */
static
WCHAR
current_dir
[
MAX_NT_PATH_LENGTH
];
static
RTL_BITMAP
tls_bitmap
;
static
RTL_BITMAP
tls_expansion_bitmap
;
static
LIST_ENTRY
tls_links
;
...
...
@@ -102,7 +103,7 @@ static inline void free_teb( TEB *teb )
*
* NOTES: The first allocated TEB on NT is at 0x7ffde000.
*/
ULONG
thread_init
(
void
)
void
thread_init
(
void
)
{
TEB
*
teb
;
void
*
addr
;
...
...
@@ -116,6 +117,8 @@ ULONG thread_init(void)
peb
.
TlsBitmap
=
&
tls_bitmap
;
peb
.
TlsExpansionBitmap
=
&
tls_expansion_bitmap
;
peb
.
LdrData
=
&
ldr
;
params
.
CurrentDirectory
.
DosPath
.
Buffer
=
current_dir
;
params
.
CurrentDirectory
.
DosPath
.
MaximumLength
=
sizeof
(
current_dir
);
RtlInitializeBitMap
(
&
tls_bitmap
,
peb
.
TlsBitmapBits
,
sizeof
(
peb
.
TlsBitmapBits
)
*
8
);
RtlInitializeBitMap
(
&
tls_expansion_bitmap
,
peb
.
TlsExpansionBitmapBits
,
sizeof
(
peb
.
TlsExpansionBitmapBits
)
*
8
);
...
...
@@ -161,7 +164,28 @@ ULONG thread_init(void)
MESSAGE
(
"wine: failed to create the process heap
\n
"
);
exit
(
1
);
}
return
info_size
;
/* allocate user parameters */
if
(
info_size
)
{
RTL_USER_PROCESS_PARAMETERS
*
params
=
NULL
;
if
(
NtAllocateVirtualMemory
(
NtCurrentProcess
(),
(
void
**
)
&
params
,
0
,
&
info_size
,
MEM_COMMIT
,
PAGE_READWRITE
)
==
STATUS_SUCCESS
)
{
params
->
AllocationSize
=
info_size
;
NtCurrentTeb
()
->
Peb
->
ProcessParameters
=
params
;
}
}
else
{
/* This is wine specific: we have no parent (we're started from unix)
* so, create a simple console with bare handles to unix stdio
*/
wine_server_fd_to_handle
(
0
,
GENERIC_READ
|
SYNCHRONIZE
,
TRUE
,
&
params
.
hStdInput
);
wine_server_fd_to_handle
(
1
,
GENERIC_WRITE
|
SYNCHRONIZE
,
TRUE
,
&
params
.
hStdOutput
);
wine_server_fd_to_handle
(
2
,
GENERIC_WRITE
|
SYNCHRONIZE
,
TRUE
,
&
params
.
hStdError
);
}
}
...
...
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