diff options
author | midipix <writeonce@midipix.org> | 2024-01-24 00:30:06 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-01-24 02:11:15 +0000 |
commit | b862c7314cd69af6b09e4a02b7868fbbe157e220 (patch) | |
tree | 25a5b1e127ae02c58ee4e1768d403d8e21aebcfc /src | |
parent | 833e69970351cc9b60ac5e36c98cc24ee25230c1 (diff) | |
download | ntapi-b862c7314cd69af6b09e4a02b7868fbbe157e220.tar.bz2 ntapi-b862c7314cd69af6b09e4a02b7868fbbe157e220.tar.xz |
__ntapi_tt_spawn_native_process(): use macro defs for alloc- and buffer size.
Diffstat (limited to 'src')
-rw-r--r-- | src/process/ntapi_tt_spawn_native_process.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/process/ntapi_tt_spawn_native_process.c b/src/process/ntapi_tt_spawn_native_process.c index 086e4e2..76bbbc4 100644 --- a/src/process/ntapi_tt_spawn_native_process.c +++ b/src/process/ntapi_tt_spawn_native_process.c @@ -18,6 +18,9 @@ (NT_PROCESS_SPAWN_FLAG_DEBUG_EXECUTION \ | NT_PROCESS_SPAWN_FLAG_DEBUG_SUSPENDED) +#define __SPAWN_NATIVE_PROCESS_RUNTIME_BLOCK_ALLOC_SIZE (0x40000) +#define __SPAWN_NATIVE_PROCESS_RUNTIME_BLOCK_IMGBUF_SIZE (0x10000) + static int32_t __stdcall __tt_spawn_return( nt_runtime_data_block * rtblock, void * hprocess, @@ -121,7 +124,7 @@ int32_t __stdcall __ntapi_tt_spawn_native_process(nt_spawn_process_params * spar /* rtblock, rdata */ rtblock.addr = 0; - rtblock.size = 0x40000; + rtblock.size = __SPAWN_NATIVE_PROCESS_RUNTIME_BLOCK_ALLOC_SIZE; rtblock.remote_addr = 0; rtblock.remote_size = 0; rtblock.flags = 0; @@ -150,21 +153,22 @@ int32_t __stdcall __ntapi_tt_spawn_native_process(nt_spawn_process_params * spar /* imgbuf */ imgbuf = (wchar16_t *)rtblock.addr; - imgbuf += 0x30000 / sizeof(*imgbuf); + imgbuf += __SPAWN_NATIVE_PROCESS_RUNTIME_BLOCK_ALLOC_SIZE / sizeof(*imgbuf); + imgbuf -= __SPAWN_NATIVE_PROCESS_RUNTIME_BLOCK_IMGBUF_SIZE / sizeof(*imgbuf); /* hfile */ if (sparams->himage) hfile = sparams->himage; else if ((status = __ntapi_tt_open_file_utf8( &hfile,hat,patharg,1, - imgbuf,0x2000))) + imgbuf,__SPAWN_NATIVE_PROCESS_RUNTIME_BLOCK_IMGBUF_SIZE))) return status; /* imgname */ if ((status = __ntapi->zw_query_object( hfile, NT_OBJECT_NAME_INFORMATION, - imgbuf,0x10000, + imgbuf,__SPAWN_NATIVE_PROCESS_RUNTIME_BLOCK_IMGBUF_SIZE, &(uint32_t){0}))) return __tt_spawn_return( &rtblock,0,0,status); @@ -280,7 +284,7 @@ int32_t __stdcall __ntapi_tt_spawn_native_process(nt_spawn_process_params * spar buflen -= needed; } - if (buflen < 0x10000) + if (buflen < __SPAWN_NATIVE_PROCESS_RUNTIME_BLOCK_IMGBUF_SIZE) return __tt_spawn_return( &rtblock,0,0,NT_STATUS_BUFFER_TOO_SMALL); |