Domanda

Ho un oggetto CSID in possesso di un SID noto per SYSTEM. funzione di chiamata di dominio () vedo che il dominio è "NT AUTHORITY".

In MSDN ho scoperto che il SID di questo gruppo è "S-1-5", così ho cercato di usare ConvertStringSidToSid () al fine di ottenere un PSID per quel gruppo, ma ho ottenuto un errore che la struttura SID non è corretta.

C'è un modo per ottenere CSID per il gruppo? è possibile?

Grazie mille! : -)

È stato utile?

Soluzione

È necessario utilizzare la funzione AllocateAndInitializeSid () per questo. Vedere questo esempio in 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;
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top