diff options
author | midipix <writeonce@midipix.org> | 2019-05-28 18:20:23 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-05-28 20:56:12 +0000 |
commit | d7c519f4b44e965eb57bb94f0fa60795450a523d (patch) | |
tree | 553634c1f576059dc472cda4a2b69f3a2801769b /src/thread | |
parent | 03cd3c36a20e2fc10094a8bb61994c7f463019f9 (diff) | |
download | ntapi-d7c519f4b44e965eb57bb94f0fa60795450a523d.tar.bz2 ntapi-d7c519f4b44e965eb57bb94f0fa60795450a523d.tar.xz |
__ntapi_tt_create_thread(): remote threads: x86_64: properly pass arg in reg.
Diffstat (limited to 'src/thread')
-rw-r--r-- | src/thread/ntapi_tt_create_thread.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/thread/ntapi_tt_create_thread.c b/src/thread/ntapi_tt_create_thread.c index 5ee1db0..ad69905 100644 --- a/src/thread/ntapi_tt_create_thread.c +++ b/src/thread/ntapi_tt_create_thread.c @@ -1,6 +1,6 @@ /********************************************************/ /* ntapi: Native API core library */ -/* Copyright (C) 2013--2017 Z. Gilboa */ +/* Copyright (C) 2013--2019 Z. Gilboa */ /* Released under GPLv2 and GPLv3; see COPYING.NTAPI. */ /********************************************************/ @@ -217,7 +217,7 @@ int32_t __stdcall __ntapi_tt_create_thread(nt_thread_params * params) /* */ /* A "RAPUNZEL" TOP-OF-STACK, VARIABLE-SIZE ENTRY-ROUTINE CONTEXT */ /* */ -/* COPYRIGHT (C) 2013--2018 ZVI GILBOA */ +/* COPYRIGHT (C) 2013--2019 ZVI GILBOA */ /* */ /* */ /* */ @@ -264,11 +264,17 @@ int32_t __stdcall __ntapi_tt_create_thread(nt_thread_params * params) /**/ /**/ /**/ /**/ /* write entry-routine argument */ -/**/ if (params->creation_flags & NT_CREATE_LOCAL_THREAD) /**/ +/**/ if (sizeof(intptr_t) == 8) { /**/ /**/ at_store( /**/ /**/ (intptr_t *)parg, /**/ /**/ (intptr_t)params->arg); /**/ -/**/ else { /**/ +/**/ /**/ +/**/ } else if (params->creation_flags & NT_CREATE_LOCAL_THREAD) { /**/ +/**/ at_store( /**/ +/**/ (intptr_t *)parg, /**/ +/**/ (intptr_t)params->arg); /**/ +/**/ /**/ +/**/ } else { /**/ /**/ status = __ntapi->zw_write_virtual_memory( /**/ /**/ params->hprocess, /**/ /**/ parg, /**/ |