summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/ntapi/nt_process.h1
-rw-r--r--src/process/ntapi_tt_create_native_process_v1.c8
-rw-r--r--src/process/ntapi_tt_create_native_process_v2.c8
3 files changed, 17 insertions, 0 deletions
diff --git a/include/ntapi/nt_process.h b/include/ntapi/nt_process.h
index 8ffd1b6..5792529 100644
--- a/include/ntapi/nt_process.h
+++ b/include/ntapi/nt_process.h
@@ -550,6 +550,7 @@ typedef struct _nt_create_process_params {
__in wchar16_t * image_name;
__in wchar16_t * cmd_line;
__in wchar16_t * environment;
+ __in void * hsession;
__in nt_runtime_data_block * rtblock;
__in uint32_t desired_access_process;
__in uint32_t desired_access_thread;
diff --git a/src/process/ntapi_tt_create_native_process_v1.c b/src/process/ntapi_tt_create_native_process_v1.c
index a44ed4f..1163092 100644
--- a/src/process/ntapi_tt_create_native_process_v1.c
+++ b/src/process/ntapi_tt_create_native_process_v1.c
@@ -232,6 +232,14 @@ int32_t __stdcall __ntapi_tt_create_native_process_v1(nt_create_process_params *
(nt_unicode_string *)0)))
return __tt_create_process_cancel(params,hsection,status);
+ /* session registration */
+ if (params->hsession && (params->hsession != NT_INVALID_HANDLE_VALUE))
+ if ((status = __ntapi->tty_client_process_register(
+ params->hsession,
+ params->pbi.unique_process_id,
+ 0,0,0)))
+ return __tt_create_process_cancel(params,hsection,status);
+
/* update the target process environment block: */
/* make process_params point to rparams_block */
if ((status = __ntapi->zw_write_virtual_memory(
diff --git a/src/process/ntapi_tt_create_native_process_v2.c b/src/process/ntapi_tt_create_native_process_v2.c
index f28a522..f20c51f 100644
--- a/src/process/ntapi_tt_create_native_process_v2.c
+++ b/src/process/ntapi_tt_create_native_process_v2.c
@@ -211,6 +211,14 @@ int32_t __stdcall __ntapi_tt_create_native_process_v2(
params->create_process_ext_params)))
return status;
+ /* session registration */
+ if (params->hsession && (params->hsession != NT_INVALID_HANDLE_VALUE))
+ if ((status = __ntapi->tty_client_process_register(
+ params->hsession,
+ params->pbi.unique_process_id,
+ 0,0,0)))
+ return __tt_create_process_cancel(params,status);
+
/* tidy up */
__ntapi->zw_close(params->create_process_info->success_state.hfile);
__ntapi->zw_close(params->create_process_info->success_state.hsection);