if (!AllocateAndInitializeSid(&SIDAuthWorld, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &_pr_nt_sids.everyone)) {  PR_ASSERT(GetLastError() == ERROR_CALL_NOT_IMPLEMENTED); return; }
void _PR_NT_InitSids(void){    SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY;    HANDLE hToken;    UCHAR infoBuffer[1024];    PTOKEN_OWNER pTokenOwner = (PTOKEN_OWNER) infoBuffer;    PTOKEN_PRIMARY_GROUP pTokenPrimaryGroup            = (PTOKEN_PRIMARY_GROUP) infoBuffer;    DWORD dwLength;    BOOL rv;    /* Create a well-known SID for the Everyone group. */    if (!AllocateAndInitializeSid(&SIDAuthWorld, 1,            SECURITY_WORLD_RID,            0, 0, 0, 0, 0, 0, 0,            &_pr_nt_sids.everyone)) {        /*         * On non-NT systems, this function is not implemented,         * and neither are the other security functions. There         * is no point in going further.         */        PR_ASSERT(GetLastError() == ERROR_CALL_NOT_IMPLEMENTED);        return;    }    /*     * Look up and make a copy of the owner and primary group     * SIDs in the access token of the calling process.     */    rv = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken);    PR_ASSERT(rv != 0);    rv = GetTokenInformation(hToken, TokenOwner, infoBuffer,            sizeof(infoBuffer), &dwLength);    PR_ASSERT(rv != 0);    dwLength = GetLengthSid(pTokenOwner->Owner);    _pr_nt_sids.owner = (PSID) PR_Malloc(dwLength);    PR_ASSERT(_pr_nt_sids.owner != NULL);    rv = CopySid(dwLength, _pr_nt_sids.owner, pTokenOwner->Owner);    PR_ASSERT(rv != 0);    rv = GetTokenInformation(hToken, TokenPrimaryGroup, infoBuffer,            sizeof(infoBuffer), &dwLength);    PR_ASSERT(rv != 0);    dwLength = GetLengthSid(pTokenPrimaryGroup->PrimaryGroup);    _pr_nt_sids.group = (PSID) PR_Malloc(dwLength);    PR_ASSERT(_pr_nt_sids.group != NULL);    rv = CopySid(dwLength, _pr_nt_sids.group,            pTokenPrimaryGroup->PrimaryGroup);    PR_ASSERT(rv != 0);    rv = CloseHandle(hToken);    PR_ASSERT(rv != 0);}