ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: LookupAccountSid() - trouver le nom d'un utilisateur système à partir   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

ven. 23 mars 2012, 18h59
OlivierH
atoutfox.public.association

Re: LookupAccountSid() - trouver le nom d'un utilisateur système à partir

La réponse de fin de Christophe chenavier :

http://fr.narkive.com/2004/8/13/2355732-openprocess.html

Olivier,


Le 23/03/2012 18:27, Thierry N a écrit :
> Bonjour,
>
> Auriez-vous un exemple de code VFP utilisant la fonction Win API
> LookupAccountSid()
>
> Merci,
> thn
> ---------------------------
> LookupAccountSid
>
> 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 WINAPI LookupAccountSid(
> __in_opt LPCTSTR lpSystemName,
> __in PSID lpSid,
> __out_opt LPTSTR lpName,
> __inout LPDWORD cchName,
> __out_opt LPTSTR lpReferencedDomainName,
> __inout LPDWORD cchReferencedDomainName,
> __out PSID_NAME_USE peUse
> );
>
> lpSystemName [in, optional]
> A pointer to a null-terminated character string that specifies the
> target computer. This string can be the name of a remote computer. If
> this parameter is NULL, the account name translation begins on the local
> system. If the name cannot be resolved on the local system, this
> function will try to resolve the name using domain controllers trusted
> by the local system. Generally, specify a value for lpSystemName only
> when the account is in an untrusted domain and the name of a computer in
> that domain is known.
>
> lpSid [in]
> A pointer to the SID to look up.
>
> lpName [out, optional]
> A pointer to a buffer that receives a null-terminated string that
> contains the account name that corresponds to the lpSid parameter.
>
> cchName [in, out]
> On input, specifies the size, in TCHARs, of the lpName buffer. If the
> function fails because the buffer is too small or if cchName is zero,
> cchName receives the required buffer size, including the terminating
> null character.
>
> lpReferencedDomainName [out, optional]
> A pointer to a buffer that receives a null-terminated string that
> contains the name of the domain where the account name was found.
> On a server, the domain name returned for most accounts in the security
> database of the local computer is the name of the domain for which the
> server is a domain controller.
> On a workstation, the domain name returned for most accounts in the
> security database of the local computer is the name of the computer as
> of the last start of the system (backslashes are excluded). If the name
> of the computer changes, the old name continues to be returned as the
> domain name until the system is restarted.
> Some accounts are predefined by the system. The domain name returned for
> these accounts is BUILTIN.
>
> cchReferencedDomainName [in, out]
> On input, specifies the size, in TCHARs, of the lpReferencedDomainName
> buffer. If the function fails because the buffer is too small or if
> cchReferencedDomainName is zero, cchReferencedDomainName receives the
> required buffer size, including the terminating null character.
>
> peUse [out]
> A pointer to a variable that receives a SID_NAME_USE value that
> indicates the type of the account.
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000008487
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3