ConvertStringSidToSid S-1-5 (groupe NT AUTHORITY)
-
24-10-2019 - |
Question
J'ai un objet CSID tenant un sid bien connu pour SYSTEM. Fonction d'appel de domaine () je peux voir que le domaine est « NT AUTHORITY ».
Dans MSDN j'ai découvert ce le SID du groupe est « S-1-5 », donc j'ai essayé d'utiliser ConvertStringSidToSid () afin d'obtenir un PSID pour ce groupe mais je suis une erreur que la structure SID est incorrecte.
Y at-il un moyen d'obtenir CSID pour ce groupe? est-il possible?
Merci beaucoup! : -)
La solution
Vous devez utiliser la fonction AllocateAndInitializeSid
() pour cela. Voir cet exemple dans MSDN.
PSID psid;
SID_IDENTIFIER_AUTHORITY SIDAuth = SECURITY_NT_AUTHORITY;
if(! AllocateAndInitializeSid( &SIDAuth, 2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&psid) )
{
printf( "AllocateAndInitializeSid Error %u\n", GetLastError() );
return FALSE;
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow