From 9cb431a807c05028a8c4ccda6371cc3a94d35883 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 19 Jan 2017 19:53:26 +0000 Subject: __ntapi_tt_get_cmd_line_utf16(): rewrite more elegantly. --- src/argv/ntapi_tt_argv_envp.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/argv/ntapi_tt_argv_envp.c b/src/argv/ntapi_tt_argv_envp.c index 520254d..1c20cfc 100644 --- a/src/argv/ntapi_tt_argv_envp.c +++ b/src/argv/ntapi_tt_argv_envp.c @@ -696,16 +696,11 @@ int32_t __stdcall __ntapi_tt_get_argv_envp_utf8( wchar16_t * __stdcall __ntapi_tt_get_cmd_line_utf16(void) { - nt_peb * peb; - nt_unicode_string cmd_line; - - peb = (nt_peb *)pe_get_peb_address(); + nt_peb * peb; - if (peb) { - cmd_line = peb->process_params->command_line; - return cmd_line.buffer; - } else - return (wchar16_t *)0; + return (peb = (nt_peb *)pe_get_peb_address()) + ? peb->process_params->command_line.buffer + : 0; } -- cgit v1.2.3