MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / IsUserAdmin

Function IsUserAdmin

Libraries/unrar/system.cpp:166–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164
165
166bool IsUserAdmin()
167{
168 SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
169 PSID AdministratorsGroup;
170 BOOL b = AllocateAndInitializeSid(&NtAuthority,2,SECURITY_BUILTIN_DOMAIN_RID,
171 DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &AdministratorsGroup);
172 if (b)
173 {
174 if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
175 b = FALSE;
176 FreeSid(AdministratorsGroup);
177 }
178 return b!=FALSE;
179}
180
181#endif
182

Callers 3

ExtractACL20Function · 0.85
ExtractACLFunction · 0.85
CreateReparsePointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected