Check the return value of CheckTokenMembership()

Signed-off-by: Selva Nair <selva.nair@gmail.com>
pull/33/head
Selva Nair 2016-04-03 16:14:50 -04:00
parent 875d9f9457
commit bd2d80c1cc
1 changed files with 2 additions and 1 deletions

3
misc.c
View File

@ -343,7 +343,8 @@ BOOL IsUserAdmin(VOID)
&AdministratorsGroup);
if(b)
{
CheckTokenMembership(NULL, AdministratorsGroup, &b);
if (!CheckTokenMembership(NULL, AdministratorsGroup, &b))
b = FALSE;
FreeSid(AdministratorsGroup);
}