[WHOAMI] Better error message when we're unable to find the logon SID
authorHervé Poussineau <hpoussin@reactos.org>
Sun, 28 Dec 2014 22:15:08 +0000 (22:15 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Sun, 28 Dec 2014 22:15:08 +0000 (22:15 +0000)
svn path=/trunk/; revision=65865

reactos/base/applications/cmdutils/whoami/whoami.c

index 6174100..660d3f5 100644 (file)
@@ -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");