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
2379e3c1
Commit
2379e3c1
authored
Sep 23, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Sep 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Pass the token to NtCreateUserProcess().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6cf3561f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
process.c
dlls/kernelbase/process.c
+19
-11
No files found.
dlls/kernelbase/process.c
View file @
2379e3c1
...
...
@@ -263,14 +263,14 @@ struct _PROC_THREAD_ATTRIBUTE_LIST
/***********************************************************************
* create_nt_process
*/
static
NTSTATUS
create_nt_process
(
SECURITY_ATTRIBUTES
*
psa
,
SECURITY_ATTRIBUTES
*
tsa
,
static
NTSTATUS
create_nt_process
(
HANDLE
token
,
SECURITY_ATTRIBUTES
*
psa
,
SECURITY_ATTRIBUTES
*
tsa
,
BOOL
inherit
,
DWORD
flags
,
RTL_USER_PROCESS_PARAMETERS
*
params
,
RTL_USER_PROCESS_INFORMATION
*
info
,
HANDLE
parent
,
const
struct
proc_thread_attr
*
handle_list
)
{
OBJECT_ATTRIBUTES
process_attr
,
thread_attr
;
PS_CREATE_INFO
create_info
;
ULONG_PTR
buffer
[
offsetof
(
PS_ATTRIBUTE_LIST
,
Attributes
[
5
]
)
/
sizeof
(
ULONG_PTR
)];
ULONG_PTR
buffer
[
offsetof
(
PS_ATTRIBUTE_LIST
,
Attributes
[
6
]
)
/
sizeof
(
ULONG_PTR
)];
PS_ATTRIBUTE_LIST
*
attr
=
(
PS_ATTRIBUTE_LIST
*
)
buffer
;
UNICODE_STRING
nameW
;
NTSTATUS
status
;
...
...
@@ -315,6 +315,14 @@ static NTSTATUS create_nt_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES
attr
->
Attributes
[
pos
].
ReturnLength
=
NULL
;
pos
++
;
}
if
(
token
)
{
attr
->
Attributes
[
pos
].
Attribute
=
PS_ATTRIBUTE_TOKEN
;
attr
->
Attributes
[
pos
].
Size
=
sizeof
(
token
);
attr
->
Attributes
[
pos
].
ValuePtr
=
token
;
attr
->
Attributes
[
pos
].
ReturnLength
=
NULL
;
pos
++
;
}
attr
->
TotalLength
=
offsetof
(
PS_ATTRIBUTE_LIST
,
Attributes
[
pos
]
);
InitializeObjectAttributes
(
&
process_attr
,
NULL
,
0
,
NULL
,
psa
?
psa
->
lpSecurityDescriptor
:
NULL
);
...
...
@@ -335,7 +343,7 @@ static NTSTATUS create_nt_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES
/***********************************************************************
* create_vdm_process
*/
static
NTSTATUS
create_vdm_process
(
SECURITY_ATTRIBUTES
*
psa
,
SECURITY_ATTRIBUTES
*
tsa
,
static
NTSTATUS
create_vdm_process
(
HANDLE
token
,
SECURITY_ATTRIBUTES
*
psa
,
SECURITY_ATTRIBUTES
*
tsa
,
BOOL
inherit
,
DWORD
flags
,
RTL_USER_PROCESS_PARAMETERS
*
params
,
RTL_USER_PROCESS_INFORMATION
*
info
)
{
...
...
@@ -356,7 +364,7 @@ static NTSTATUS create_vdm_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
winevdm
,
params
->
ImagePathName
.
Buffer
,
params
->
CommandLine
.
Buffer
);
RtlInitUnicodeString
(
&
params
->
ImagePathName
,
winevdm
);
RtlInitUnicodeString
(
&
params
->
CommandLine
,
newcmdline
);
status
=
create_nt_process
(
psa
,
tsa
,
inherit
,
flags
,
params
,
info
,
NULL
,
NULL
);
status
=
create_nt_process
(
token
,
psa
,
tsa
,
inherit
,
flags
,
params
,
info
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
newcmdline
);
return
status
;
}
...
...
@@ -365,7 +373,7 @@ static NTSTATUS create_vdm_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
/***********************************************************************
* create_cmd_process
*/
static
NTSTATUS
create_cmd_process
(
SECURITY_ATTRIBUTES
*
psa
,
SECURITY_ATTRIBUTES
*
tsa
,
static
NTSTATUS
create_cmd_process
(
HANDLE
token
,
SECURITY_ATTRIBUTES
*
psa
,
SECURITY_ATTRIBUTES
*
tsa
,
BOOL
inherit
,
DWORD
flags
,
RTL_USER_PROCESS_PARAMETERS
*
params
,
RTL_USER_PROCESS_INFORMATION
*
info
)
{
...
...
@@ -384,7 +392,7 @@ static NTSTATUS create_cmd_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
swprintf
(
newcmdline
,
len
,
L"%s /s/c
\"
%s
\"
"
,
comspec
,
params
->
CommandLine
.
Buffer
);
RtlInitUnicodeString
(
&
params
->
ImagePathName
,
comspec
);
RtlInitUnicodeString
(
&
params
->
CommandLine
,
newcmdline
);
status
=
create_nt_process
(
psa
,
tsa
,
inherit
,
flags
,
params
,
info
,
NULL
,
NULL
);
status
=
create_nt_process
(
token
,
psa
,
tsa
,
inherit
,
flags
,
params
,
info
,
NULL
,
NULL
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
newcmdline
);
return
status
;
}
...
...
@@ -500,7 +508,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
TRACE
(
"app %s cmdline %s
\n
"
,
debugstr_w
(
app_name
),
debugstr_w
(
cmd_line
)
);
if
(
token
)
FIXME
(
"Creating a process with a token is not yet implemented
\n
"
);
if
(
new_token
)
FIXME
(
"No support for returning created process token
\n
"
);
if
(
app_name
)
...
...
@@ -585,7 +592,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
}
}
status
=
create_nt_process
(
process_attr
,
thread_attr
,
inherit
,
flags
,
params
,
&
rtl_info
,
parent
,
handle_list
);
status
=
create_nt_process
(
token
,
process_attr
,
thread_attr
,
inherit
,
flags
,
params
,
&
rtl_info
,
parent
,
handle_list
);
switch
(
status
)
{
case
STATUS_SUCCESS
:
...
...
@@ -594,7 +602,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
case
STATUS_INVALID_IMAGE_NE_FORMAT
:
case
STATUS_INVALID_IMAGE_PROTECT
:
TRACE
(
"starting %s as Win16/DOS binary
\n
"
,
debugstr_w
(
app_name
)
);
status
=
create_vdm_process
(
process_attr
,
thread_attr
,
inherit
,
flags
,
params
,
&
rtl_info
);
status
=
create_vdm_process
(
token
,
process_attr
,
thread_attr
,
inherit
,
flags
,
params
,
&
rtl_info
);
break
;
case
STATUS_INVALID_IMAGE_NOT_MZ
:
/* check for .com or .bat extension */
...
...
@@ -602,12 +610,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
if
(
!
wcsicmp
(
p
,
L".com"
)
||
!
wcsicmp
(
p
,
L".pif"
))
{
TRACE
(
"starting %s as DOS binary
\n
"
,
debugstr_w
(
app_name
)
);
status
=
create_vdm_process
(
process_attr
,
thread_attr
,
inherit
,
flags
,
params
,
&
rtl_info
);
status
=
create_vdm_process
(
token
,
process_attr
,
thread_attr
,
inherit
,
flags
,
params
,
&
rtl_info
);
}
else
if
(
!
wcsicmp
(
p
,
L".bat"
)
||
!
wcsicmp
(
p
,
L".cmd"
))
{
TRACE
(
"starting %s as batch binary
\n
"
,
debugstr_w
(
app_name
)
);
status
=
create_cmd_process
(
process_attr
,
thread_attr
,
inherit
,
flags
,
params
,
&
rtl_info
);
status
=
create_cmd_process
(
token
,
process_attr
,
thread_attr
,
inherit
,
flags
,
params
,
&
rtl_info
);
}
break
;
}
...
...
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