From 3ce44c57dbe868e6dd7b7f296311a2313e6ec032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 28 Dec 2014 22:15:08 +0000 Subject: [PATCH] [WHOAMI] Better error message when we're unable to find the logon SID svn path=/trunk/; revision=65865 --- reactos/base/applications/cmdutils/whoami/whoami.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reactos/base/applications/cmdutils/whoami/whoami.c b/reactos/base/applications/cmdutils/whoami/whoami.c index 61741002671..660d3f5877e 100644 --- a/reactos/base/applications/cmdutils/whoami/whoami.c +++ b/reactos/base/applications/cmdutils/whoami/whoami.c @@ -386,7 +386,13 @@ int WhoamiLogonId(void) } } - if (pSid == 0 || !ConvertSidToStringSidW(pSid, &pSidStr)) + if (pSid == 0) + { + WhoamiFree(pGroupInfo); + wprintf(L"ERROR: Couldn't find the logon SID.\n"); + return 1; + } + if (!ConvertSidToStringSidW(pSid, &pSidStr)) { WhoamiFree(pGroupInfo); wprintf(L"ERROR: Couldn't convert the logon SID to a string.\n");