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
d203af0f
Commit
d203af0f
authored
May 24, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Add support for the PROC_THREAD_ATTRIBUTE_MACHINE_TYPE attribute.
parent
ca7a7abe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
process.c
dlls/kernelbase/process.c
+22
-5
No files found.
dlls/kernelbase/process.c
View file @
d203af0f
...
...
@@ -257,13 +257,14 @@ struct _PROC_THREAD_ATTRIBUTE_LIST
static
NTSTATUS
create_nt_process
(
HANDLE
token
,
HANDLE
debug
,
SECURITY_ATTRIBUTES
*
psa
,
SECURITY_ATTRIBUTES
*
tsa
,
DWORD
process_flags
,
RTL_USER_PROCESS_PARAMETERS
*
params
,
RTL_USER_PROCESS_INFORMATION
*
info
,
HANDLE
parent
,
RTL_USER_PROCESS_INFORMATION
*
info
,
HANDLE
parent
,
USHORT
machine
,
const
struct
proc_thread_attr
*
handle_list
,
const
struct
proc_thread_attr
*
job_list
)
{
OBJECT_ATTRIBUTES
process_attr
,
thread_attr
;
PS_CREATE_INFO
create_info
;
ULONG_PTR
buffer
[
offsetof
(
PS_ATTRIBUTE_LIST
,
Attributes
[
8
]
)
/
sizeof
(
ULONG_PTR
)];
ULONG_PTR
buffer
[
offsetof
(
PS_ATTRIBUTE_LIST
,
Attributes
[
9
]
)
/
sizeof
(
ULONG_PTR
)];
PS_ATTRIBUTE_LIST
*
attr
=
(
PS_ATTRIBUTE_LIST
*
)
buffer
;
UNICODE_STRING
nameW
;
NTSTATUS
status
;
...
...
@@ -330,6 +331,14 @@ static NTSTATUS create_nt_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBUT
attr
->
Attributes
[
pos
].
ReturnLength
=
NULL
;
pos
++
;
}
if
(
machine
)
{
attr
->
Attributes
[
pos
].
Attribute
=
PS_ATTRIBUTE_MACHINE_TYPE
;
attr
->
Attributes
[
pos
].
Size
=
sizeof
(
machine
);
attr
->
Attributes
[
pos
].
Value
=
machine
;
attr
->
Attributes
[
pos
].
ReturnLength
=
NULL
;
pos
++
;
}
attr
->
TotalLength
=
offsetof
(
PS_ATTRIBUTE_LIST
,
Attributes
[
pos
]
);
InitializeObjectAttributes
(
&
process_attr
,
NULL
,
0
,
NULL
,
psa
?
psa
->
lpSecurityDescriptor
:
NULL
);
...
...
@@ -371,7 +380,7 @@ static NTSTATUS create_vdm_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBU
winevdm
,
params
->
ImagePathName
.
Buffer
,
params
->
CommandLine
.
Buffer
);
RtlInitUnicodeString
(
&
params
->
ImagePathName
,
winevdm
);
RtlInitUnicodeString
(
&
params
->
CommandLine
,
newcmdline
);
status
=
create_nt_process
(
token
,
debug
,
psa
,
tsa
,
flags
,
params
,
info
,
NULL
,
NULL
,
NULL
);
status
=
create_nt_process
(
token
,
debug
,
psa
,
tsa
,
flags
,
params
,
info
,
0
,
0
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
newcmdline
);
return
status
;
}
...
...
@@ -400,7 +409,7 @@ static NTSTATUS create_cmd_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBU
swprintf
(
newcmdline
,
len
,
L"%s /s/c
\"
%s
\"
"
,
comspec
,
params
->
CommandLine
.
Buffer
);
RtlInitUnicodeString
(
&
params
->
ImagePathName
,
comspec
);
RtlInitUnicodeString
(
&
params
->
CommandLine
,
newcmdline
);
status
=
create_nt_process
(
token
,
debug
,
psa
,
tsa
,
flags
,
params
,
info
,
NULL
,
NULL
,
NULL
);
status
=
create_nt_process
(
token
,
debug
,
psa
,
tsa
,
flags
,
params
,
info
,
0
,
0
,
NULL
,
NULL
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
newcmdline
);
return
status
;
}
...
...
@@ -510,6 +519,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
RTL_USER_PROCESS_INFORMATION
rtl_info
;
HANDLE
parent
=
0
,
debug
=
0
;
ULONG
nt_flags
=
0
;
USHORT
machine
=
0
;
NTSTATUS
status
;
/* Process the AppName and/or CmdLine to get module name and path */
...
...
@@ -602,6 +612,10 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
TRACE
(
"PROC_THREAD_ATTRIBUTE_JOB_LIST handle count %Iu.
\n
"
,
attrs
->
attrs
[
i
].
size
/
sizeof
(
HANDLE
)
);
break
;
case
PROC_THREAD_ATTRIBUTE_MACHINE_TYPE
:
machine
=
*
(
USHORT
*
)
attrs
->
attrs
[
i
].
value
;
TRACE
(
"PROC_THREAD_ATTRIBUTE_MACHINE %x.
\n
"
,
machine
);
break
;
default:
FIXME
(
"Unsupported attribute %#Ix.
\n
"
,
attrs
->
attrs
[
i
].
attr
);
break
;
...
...
@@ -616,7 +630,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
if
(
flags
&
CREATE_SUSPENDED
)
nt_flags
|=
PROCESS_CREATE_FLAGS_SUSPENDED
;
status
=
create_nt_process
(
token
,
debug
,
process_attr
,
thread_attr
,
nt_flags
,
params
,
&
rtl_info
,
parent
,
handle_list
,
job_list
);
nt_flags
,
params
,
&
rtl_info
,
parent
,
machine
,
handle_list
,
job_list
);
switch
(
status
)
{
case
STATUS_SUCCESS
:
...
...
@@ -1722,6 +1736,9 @@ static inline DWORD validate_proc_thread_attribute( DWORD_PTR attr, SIZE_T size
case
PROC_THREAD_ATTRIBUTE_JOB_LIST
:
if
((
size
/
sizeof
(
HANDLE
))
*
sizeof
(
HANDLE
)
!=
size
)
return
ERROR_BAD_LENGTH
;
break
;
case
PROC_THREAD_ATTRIBUTE_MACHINE_TYPE
:
if
(
size
!=
sizeof
(
USHORT
))
return
ERROR_BAD_LENGTH
;
break
;
default:
FIXME
(
"Unhandled attribute %Iu
\n
"
,
attr
&
PROC_THREAD_ATTRIBUTE_NUMBER
);
return
ERROR_NOT_SUPPORTED
;
...
...
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