LookupAccountName
The LookupAccountName function accepts the name of a system and an account as input. It retrieves a security identifier (SID) for the account and the name of the domain on which the account was found.
BOOL LookupAccountName(
LPCTSTR lpSystemName, // system name
LPCTSTR lpAccountName, // account name
PSID Sid, // security identifier
LPDWORD cbSid, // size of security identifier
LPTSTR DomainName, // domain name
LPDWORD cbDomainName, // size of domain name
PSID_NAME_USE peUse // SID-type indicator
);
详细用法请参见MSDN Library/Platform SDK/Security/Access Control/Access Control Reference/Access Control Functions