summaryrefslogtreecommitdiffhomepage
path: root/src/argv
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-01-19 19:53:26 +0000
committermidipix <writeonce@midipix.org>2017-01-19 15:57:31 -0500
commit9cb431a807c05028a8c4ccda6371cc3a94d35883 (patch)
treecaacc62f4896c4761e0d7a70b0998017e345f87a /src/argv
parent804edfafcbd5066873a1d6a77b6e6bacba783c14 (diff)
downloadntapi-9cb431a807c05028a8c4ccda6371cc3a94d35883.tar.bz2
ntapi-9cb431a807c05028a8c4ccda6371cc3a94d35883.tar.xz
__ntapi_tt_get_cmd_line_utf16(): rewrite more elegantly.
Diffstat (limited to 'src/argv')
-rw-r--r--src/argv/ntapi_tt_argv_envp.c13
1 files changed, 4 insertions, 9 deletions
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;
}