api - How can I get the name of the Administrators Group? -
i looking windows 32 api function gets name of administrators group. when answer, please add full example. source code should work windows xp , later.
you can use lookupaccountsid
function that:
byte bbuffer[128]; dword dwsize = sizeof(bbuffer); if (createwellknownsid(winbuiltinadministratorssid, null, (psid)bbuffer, &dwsize)) { wchar_t wchname[128], wchdomain[128]; dword cchname = _countof(wchname), cchdomain = _countof(wchdomain); sid_name_use use; if (lookupaccountsid(null, (psid)bbuffer, wchname, &cchname, wchdomain, &cchdomain, &use)) { // wchdomain contain builtin // wchname contain administrators } }
Comments
Post a Comment