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
8e7c6422
Commit
8e7c6422
authored
Apr 15, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move create_startup_info() to env.c.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a7a1e264
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
68 deletions
+70
-68
env.c
dlls/ntdll/unix/env.c
+69
-0
process.c
dlls/ntdll/unix/process.c
+0
-68
unix_private.h
dlls/ntdll/unix/unix_private.h
+1
-0
No files found.
dlls/ntdll/unix/env.c
View file @
8e7c6422
...
...
@@ -1897,6 +1897,23 @@ static inline WCHAR *get_dos_path( WCHAR *nt_path )
return
nt_path
;
}
static
inline
const
WCHAR
*
get_params_string
(
const
RTL_USER_PROCESS_PARAMETERS
*
params
,
const
UNICODE_STRING
*
str
)
{
if
(
params
->
Flags
&
PROCESS_PARAMS_FLAG_NORMALIZED
)
return
str
->
Buffer
;
return
(
const
WCHAR
*
)((
const
char
*
)
params
+
(
UINT_PTR
)
str
->
Buffer
);
}
static
inline
DWORD
append_string
(
void
**
ptr
,
const
RTL_USER_PROCESS_PARAMETERS
*
params
,
const
UNICODE_STRING
*
str
)
{
const
WCHAR
*
buffer
=
get_params_string
(
params
,
str
);
memcpy
(
*
ptr
,
buffer
,
str
->
Length
);
*
ptr
=
(
WCHAR
*
)
*
ptr
+
str
->
Length
/
sizeof
(
WCHAR
);
return
str
->
Length
;
}
/*************************************************************************
* build_initial_params
*
...
...
@@ -2113,6 +2130,58 @@ void init_startup_info(void)
}
/***********************************************************************
* create_startup_info
*/
void
*
create_startup_info
(
const
RTL_USER_PROCESS_PARAMETERS
*
params
,
DWORD
*
info_size
)
{
startup_info_t
*
info
;
DWORD
size
;
void
*
ptr
;
size
=
sizeof
(
*
info
);
size
+=
params
->
CurrentDirectory
.
DosPath
.
Length
;
size
+=
params
->
DllPath
.
Length
;
size
+=
params
->
ImagePathName
.
Length
;
size
+=
params
->
CommandLine
.
Length
;
size
+=
params
->
WindowTitle
.
Length
;
size
+=
params
->
Desktop
.
Length
;
size
+=
params
->
ShellInfo
.
Length
;
size
+=
params
->
RuntimeInfo
.
Length
;
size
=
(
size
+
1
)
&
~
1
;
*
info_size
=
size
;
if
(
!
(
info
=
calloc
(
size
,
1
)))
return
NULL
;
info
->
debug_flags
=
params
->
DebugFlags
;
info
->
console_flags
=
params
->
ConsoleFlags
;
info
->
console
=
wine_server_obj_handle
(
params
->
ConsoleHandle
);
info
->
hstdin
=
wine_server_obj_handle
(
params
->
hStdInput
);
info
->
hstdout
=
wine_server_obj_handle
(
params
->
hStdOutput
);
info
->
hstderr
=
wine_server_obj_handle
(
params
->
hStdError
);
info
->
x
=
params
->
dwX
;
info
->
y
=
params
->
dwY
;
info
->
xsize
=
params
->
dwXSize
;
info
->
ysize
=
params
->
dwYSize
;
info
->
xchars
=
params
->
dwXCountChars
;
info
->
ychars
=
params
->
dwYCountChars
;
info
->
attribute
=
params
->
dwFillAttribute
;
info
->
flags
=
params
->
dwFlags
;
info
->
show
=
params
->
wShowWindow
;
ptr
=
info
+
1
;
info
->
curdir_len
=
append_string
(
&
ptr
,
params
,
&
params
->
CurrentDirectory
.
DosPath
);
info
->
dllpath_len
=
append_string
(
&
ptr
,
params
,
&
params
->
DllPath
);
info
->
imagepath_len
=
append_string
(
&
ptr
,
params
,
&
params
->
ImagePathName
);
info
->
cmdline_len
=
append_string
(
&
ptr
,
params
,
&
params
->
CommandLine
);
info
->
title_len
=
append_string
(
&
ptr
,
params
,
&
params
->
WindowTitle
);
info
->
desktop_len
=
append_string
(
&
ptr
,
params
,
&
params
->
Desktop
);
info
->
shellinfo_len
=
append_string
(
&
ptr
,
params
,
&
params
->
ShellInfo
);
info
->
runtime_len
=
append_string
(
&
ptr
,
params
,
&
params
->
RuntimeInfo
);
return
info
;
}
/**************************************************************************
* NtGetNlsSectionPtr (NTDLL.@)
*/
...
...
dlls/ntdll/unix/process.c
View file @
8e7c6422
...
...
@@ -156,74 +156,6 @@ static char **build_argv( const UNICODE_STRING *cmdline, int reserved )
}
static
inline
const
WCHAR
*
get_params_string
(
const
RTL_USER_PROCESS_PARAMETERS
*
params
,
const
UNICODE_STRING
*
str
)
{
if
(
params
->
Flags
&
PROCESS_PARAMS_FLAG_NORMALIZED
)
return
str
->
Buffer
;
return
(
const
WCHAR
*
)((
const
char
*
)
params
+
(
UINT_PTR
)
str
->
Buffer
);
}
static
inline
DWORD
append_string
(
void
**
ptr
,
const
RTL_USER_PROCESS_PARAMETERS
*
params
,
const
UNICODE_STRING
*
str
)
{
const
WCHAR
*
buffer
=
get_params_string
(
params
,
str
);
memcpy
(
*
ptr
,
buffer
,
str
->
Length
);
*
ptr
=
(
WCHAR
*
)
*
ptr
+
str
->
Length
/
sizeof
(
WCHAR
);
return
str
->
Length
;
}
/***********************************************************************
* create_startup_info
*/
static
startup_info_t
*
create_startup_info
(
const
RTL_USER_PROCESS_PARAMETERS
*
params
,
DWORD
*
info_size
)
{
startup_info_t
*
info
;
DWORD
size
;
void
*
ptr
;
size
=
sizeof
(
*
info
);
size
+=
params
->
CurrentDirectory
.
DosPath
.
Length
;
size
+=
params
->
DllPath
.
Length
;
size
+=
params
->
ImagePathName
.
Length
;
size
+=
params
->
CommandLine
.
Length
;
size
+=
params
->
WindowTitle
.
Length
;
size
+=
params
->
Desktop
.
Length
;
size
+=
params
->
ShellInfo
.
Length
;
size
+=
params
->
RuntimeInfo
.
Length
;
size
=
(
size
+
1
)
&
~
1
;
*
info_size
=
size
;
if
(
!
(
info
=
calloc
(
size
,
1
)))
return
NULL
;
info
->
debug_flags
=
params
->
DebugFlags
;
info
->
console_flags
=
params
->
ConsoleFlags
;
info
->
console
=
wine_server_obj_handle
(
params
->
ConsoleHandle
);
info
->
hstdin
=
wine_server_obj_handle
(
params
->
hStdInput
);
info
->
hstdout
=
wine_server_obj_handle
(
params
->
hStdOutput
);
info
->
hstderr
=
wine_server_obj_handle
(
params
->
hStdError
);
info
->
x
=
params
->
dwX
;
info
->
y
=
params
->
dwY
;
info
->
xsize
=
params
->
dwXSize
;
info
->
ysize
=
params
->
dwYSize
;
info
->
xchars
=
params
->
dwXCountChars
;
info
->
ychars
=
params
->
dwYCountChars
;
info
->
attribute
=
params
->
dwFillAttribute
;
info
->
flags
=
params
->
dwFlags
;
info
->
show
=
params
->
wShowWindow
;
ptr
=
info
+
1
;
info
->
curdir_len
=
append_string
(
&
ptr
,
params
,
&
params
->
CurrentDirectory
.
DosPath
);
info
->
dllpath_len
=
append_string
(
&
ptr
,
params
,
&
params
->
DllPath
);
info
->
imagepath_len
=
append_string
(
&
ptr
,
params
,
&
params
->
ImagePathName
);
info
->
cmdline_len
=
append_string
(
&
ptr
,
params
,
&
params
->
CommandLine
);
info
->
title_len
=
append_string
(
&
ptr
,
params
,
&
params
->
WindowTitle
);
info
->
desktop_len
=
append_string
(
&
ptr
,
params
,
&
params
->
Desktop
);
info
->
shellinfo_len
=
append_string
(
&
ptr
,
params
,
&
params
->
ShellInfo
);
info
->
runtime_len
=
append_string
(
&
ptr
,
params
,
&
params
->
RuntimeInfo
);
return
info
;
}
/***********************************************************************
* get_so_file_info
*/
...
...
dlls/ntdll/unix/unix_private.h
View file @
8e7c6422
...
...
@@ -141,6 +141,7 @@ extern struct ldt_copy __wine_ldt_copy DECLSPEC_HIDDEN;
extern
void
init_environment
(
int
argc
,
char
*
argv
[],
char
*
envp
[]
)
DECLSPEC_HIDDEN
;
extern
void
init_startup_info
(
void
)
DECLSPEC_HIDDEN
;
extern
void
*
create_startup_info
(
const
RTL_USER_PROCESS_PARAMETERS
*
params
,
DWORD
*
info_size
)
DECLSPEC_HIDDEN
;
extern
DWORD
ntdll_umbstowcs
(
const
char
*
src
,
DWORD
srclen
,
WCHAR
*
dst
,
DWORD
dstlen
)
DECLSPEC_HIDDEN
;
extern
int
ntdll_wcstoumbs
(
const
WCHAR
*
src
,
DWORD
srclen
,
char
*
dst
,
DWORD
dstlen
,
BOOL
strict
)
DECLSPEC_HIDDEN
;
extern
char
**
build_envp
(
const
WCHAR
*
envW
)
DECLSPEC_HIDDEN
;
...
...
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