summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-01-06 09:44:17 -0500
committermidipix <writeonce@midipix.org>2017-01-07 09:02:24 -0500
commitf154f6e8506ce6cd5bab49a143804b80ac9eaff9 (patch)
tree729a4f35a5d0d982060907eac791029ee0cec5d0 /src
parent3a85e17c465838aecef252d2929afe6921b787fe (diff)
downloadntapi-f154f6e8506ce6cd5bab49a143804b80ac9eaff9.tar.bz2
ntapi-f154f6e8506ce6cd5bab49a143804b80ac9eaff9.tar.xz
native process creation: added child process session registration support.
Diffstat (limited to 'src')
-rw-r--r--src/process/ntapi_tt_create_native_process_v1.c8
-rw-r--r--src/process/ntapi_tt_create_native_process_v2.c8
2 files changed, 16 insertions, 0 deletions
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);