The LookupAccountSid function accepts a security identifier (SID) as input. It retrieves the name of the account for this SID and the name of the first domain on which this SID is found.
BOOL LookupAccountSid(
LPCTSTR lpSystemName, |
// address of string for system name |
PSID Sid, |
// address of security identifier |
LPTSTR Name, |
// address of string for account name |
LPDWORD cbName, |
// address of size account string |
LPTSTR ReferencedDomainName, |
// address of string for referenced domain |
LPDWORD cbReferencedDomainName, |
// address of size domain string |
PSID_NAME_USE peUse |
// address of structure for SID type |
); |
For Windows NT systems, the domain name returned for most accounts in the local computer’s security database is the computer’s name as of the last start of the system. Backslashes are excluded. If the computer’s name changes, the old name continues to be returned as the domain name until the system is restarted.
For Windows NT Server systems, the domain name returned for most accounts in the local computer’s security database is the name of the domain for which the Windows NT Server is a domain controller.
Some accounts are predefined by the system. The domain name returned for these
accounts is BUILTIN.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The LookupAccountSid function attempts to find a name for the specified security identifier by first checking a list of well-known SIDs. If the supplied SID does not correspond to a well-known SID, the function checks built-in and administratively defined local accounts. Next, the function checks the primary domain. Security identifiers not recognized by the primary domain are checked against the trusted domains corresponding to their SID prefixes.
EqualPrefixSid, LookupAccountName
file: /Techref/os/win/api/win32/func/src/f55_3.htm, 5KB, , updated: 2001/6/25 06:59, local time: 2024/12/29 10:39,
3.16.50.1:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/techref/os/win/api/win32/func/src/f55_3.htm"> LookupAccountSid</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.