Commit 0f4bc322 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

kernelbase: Pass PROC_THREAD_ATTRIBUTE_JOB_LIST to NtCreateUserProcess().

parent 0986c8a3
...@@ -249,11 +249,12 @@ static NTSTATUS create_nt_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBUT ...@@ -249,11 +249,12 @@ static NTSTATUS create_nt_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBUT
SECURITY_ATTRIBUTES *tsa, DWORD process_flags, SECURITY_ATTRIBUTES *tsa, DWORD process_flags,
RTL_USER_PROCESS_PARAMETERS *params, RTL_USER_PROCESS_PARAMETERS *params,
RTL_USER_PROCESS_INFORMATION *info, HANDLE parent, RTL_USER_PROCESS_INFORMATION *info, HANDLE parent,
const struct proc_thread_attr *handle_list ) const struct proc_thread_attr *handle_list,
const struct proc_thread_attr *job_list)
{ {
OBJECT_ATTRIBUTES process_attr, thread_attr; OBJECT_ATTRIBUTES process_attr, thread_attr;
PS_CREATE_INFO create_info; PS_CREATE_INFO create_info;
ULONG_PTR buffer[offsetof( PS_ATTRIBUTE_LIST, Attributes[7] ) / sizeof(ULONG_PTR)]; ULONG_PTR buffer[offsetof( PS_ATTRIBUTE_LIST, Attributes[8] ) / sizeof(ULONG_PTR)];
PS_ATTRIBUTE_LIST *attr = (PS_ATTRIBUTE_LIST *)buffer; PS_ATTRIBUTE_LIST *attr = (PS_ATTRIBUTE_LIST *)buffer;
UNICODE_STRING nameW; UNICODE_STRING nameW;
NTSTATUS status; NTSTATUS status;
...@@ -312,6 +313,14 @@ static NTSTATUS create_nt_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBUT ...@@ -312,6 +313,14 @@ static NTSTATUS create_nt_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBUT
attr->Attributes[pos].ReturnLength = NULL; attr->Attributes[pos].ReturnLength = NULL;
pos++; pos++;
} }
if (job_list)
{
attr->Attributes[pos].Attribute = PS_ATTRIBUTE_JOB_LIST;
attr->Attributes[pos].Size = job_list->size;
attr->Attributes[pos].ValuePtr = job_list->value;
attr->Attributes[pos].ReturnLength = NULL;
pos++;
}
attr->TotalLength = offsetof( PS_ATTRIBUTE_LIST, Attributes[pos] ); attr->TotalLength = offsetof( PS_ATTRIBUTE_LIST, Attributes[pos] );
InitializeObjectAttributes( &process_attr, NULL, 0, NULL, psa ? psa->lpSecurityDescriptor : NULL ); InitializeObjectAttributes( &process_attr, NULL, 0, NULL, psa ? psa->lpSecurityDescriptor : NULL );
...@@ -353,7 +362,7 @@ static NTSTATUS create_vdm_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBU ...@@ -353,7 +362,7 @@ static NTSTATUS create_vdm_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBU
winevdm, params->ImagePathName.Buffer, params->CommandLine.Buffer ); winevdm, params->ImagePathName.Buffer, params->CommandLine.Buffer );
RtlInitUnicodeString( &params->ImagePathName, winevdm ); RtlInitUnicodeString( &params->ImagePathName, winevdm );
RtlInitUnicodeString( &params->CommandLine, newcmdline ); RtlInitUnicodeString( &params->CommandLine, newcmdline );
status = create_nt_process( token, debug, psa, tsa, flags, params, info, NULL, NULL ); status = create_nt_process( token, debug, psa, tsa, flags, params, info, NULL, NULL, NULL );
HeapFree( GetProcessHeap(), 0, newcmdline ); HeapFree( GetProcessHeap(), 0, newcmdline );
return status; return status;
} }
...@@ -382,7 +391,7 @@ static NTSTATUS create_cmd_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBU ...@@ -382,7 +391,7 @@ static NTSTATUS create_cmd_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBU
swprintf( newcmdline, len, L"%s /s/c \"%s\"", comspec, params->CommandLine.Buffer ); swprintf( newcmdline, len, L"%s /s/c \"%s\"", comspec, params->CommandLine.Buffer );
RtlInitUnicodeString( &params->ImagePathName, comspec ); RtlInitUnicodeString( &params->ImagePathName, comspec );
RtlInitUnicodeString( &params->CommandLine, newcmdline ); RtlInitUnicodeString( &params->CommandLine, newcmdline );
status = create_nt_process( token, debug, psa, tsa, flags, params, info, NULL, NULL ); status = create_nt_process( token, debug, psa, tsa, flags, params, info, NULL, NULL, NULL );
RtlFreeHeap( GetProcessHeap(), 0, newcmdline ); RtlFreeHeap( GetProcessHeap(), 0, newcmdline );
return status; return status;
} }
...@@ -485,7 +494,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR ...@@ -485,7 +494,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
const WCHAR *cur_dir, STARTUPINFOW *startup_info, const WCHAR *cur_dir, STARTUPINFOW *startup_info,
PROCESS_INFORMATION *info, HANDLE *new_token ) PROCESS_INFORMATION *info, HANDLE *new_token )
{ {
const struct proc_thread_attr *handle_list = NULL; const struct proc_thread_attr *handle_list = NULL, *job_list = NULL;
WCHAR name[MAX_PATH]; WCHAR name[MAX_PATH];
WCHAR *p, *tidy_cmdline = cmd_line; WCHAR *p, *tidy_cmdline = cmd_line;
RTL_USER_PROCESS_PARAMETERS *params = NULL; RTL_USER_PROCESS_PARAMETERS *params = NULL;
...@@ -580,6 +589,11 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR ...@@ -580,6 +589,11 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
params->ConsoleHandle = console->reference; params->ConsoleHandle = console->reference;
break; break;
} }
case PROC_THREAD_ATTRIBUTE_JOB_LIST:
job_list = &attrs->attrs[i];
TRACE( "PROC_THREAD_ATTRIBUTE_JOB_LIST handle count %Iu.\n",
attrs->attrs[i].size / sizeof(HANDLE) );
break;
default: default:
FIXME("Unsupported attribute %#Ix.\n", attrs->attrs[i].attr); FIXME("Unsupported attribute %#Ix.\n", attrs->attrs[i].attr);
break; break;
...@@ -594,7 +608,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR ...@@ -594,7 +608,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
if (flags & CREATE_SUSPENDED) nt_flags |= PROCESS_CREATE_FLAGS_SUSPENDED; if (flags & CREATE_SUSPENDED) nt_flags |= PROCESS_CREATE_FLAGS_SUSPENDED;
status = create_nt_process( token, debug, process_attr, thread_attr, status = create_nt_process( token, debug, process_attr, thread_attr,
nt_flags, params, &rtl_info, parent, handle_list ); nt_flags, params, &rtl_info, parent, handle_list, job_list );
switch (status) switch (status)
{ {
case STATUS_SUCCESS: case STATUS_SUCCESS:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment