| | |
ACL TRUSTEE_TYPE is always Unknown.
![]() |
•
•
Join Date: Dec 2007
Posts: 21
Reputation:
Solved Threads: 0
Hi All
I am using the code below to get ACL information from files on Windows (in this case Vista). I need to know wether or not a trustee is a group or a user but when I loop through each trustee they all say "TRUSTEE_IS_UNKNOWN". Am I getting something horribly wrong?
I am using the code below to get ACL information from files on Windows (in this case Vista). I need to know wether or not a trustee is a group or a user but when I loop through each trustee they all say "TRUSTEE_IS_UNKNOWN". Am I getting something horribly wrong?
dwError = GetExplicitEntriesFromAcl(pAcl, &cCountOfExplicitEntries, &pListOfExplicitEntries);
if (dwError != ERROR_SUCCESS){
printf("GetExplicitEntriesFromAcl failed with error : %u\n\n", dwError);
return;
}
printf("cCountOfExplicitEntries : %d\n", cCountOfExplicitEntries);
printf("******\n");
for(ULONG i=0; i<cCountOfExplicitEntries;i++){
printf("++++++\n");
switch (pListOfExplicitEntries[i].Trustee.TrusteeForm){
case TRUSTEE_IS_SID:
printf("TRUSTEE_IS_SID\n");
break;
case TRUSTEE_IS_NAME:
printf("TRUSTEE_IS_NAME\n");
//printf("Name: %s\n", pListOfExplicitEntries[i].Trustee.ptstrName);
break;
}
printf("++++++\n");
switch (pListOfExplicitEntries[i].Trustee.TrusteeType){
case TRUSTEE_IS_USER:
printf("TRUSTEE_IS_USER\n");
break;
case TRUSTEE_IS_GROUP:
printf("TRUSTEE_IS_GROUP\n");
break;
case TRUSTEE_IS_DOMAIN:
printf("TRUSTEE_IS_DOMAIN\n");
break;
case TRUSTEE_IS_ALIAS:
printf("TRUSTEE_IS_ALIAS\n");
break;
case TRUSTEE_IS_INVALID:
printf("TRUSTEE_IS_INVALID\n");
break;
case TRUSTEE_IS_UNKNOWN:
printf("TRUSTEE_IS_UNKNOWN\n");
break;
}
TCHAR account[1000];
TCHAR domain[1000];
DWORD AccountBufflength = 1000;
DWORD DomainBufflength = 1000;
PSID_NAME_USE peUse = new SID_NAME_USE;
PSID Sid = pListOfExplicitEntries[i].Trustee.ptstrName;
LookupAccountSid(NULL, Sid, account, &AccountBufflength,domain,&DomainBufflength,peUse);
_tprintf(TEXT("%s\\%s\n"), domain, account);•
•
Join Date: Apr 2008
Posts: 113
Reputation:
Solved Threads: 12
It's a wrong method.
Ask on Adv. Win32 api newsgroup
news://comp.os.ms-windows.programmer.win32
for the well-known right method...
Ask on Adv. Win32 api newsgroup
news://comp.os.ms-windows.programmer.win32
for the well-known right method...
![]() |
Other Threads in the C++ Forum
- Previous Thread: help with files
- Next Thread: Linker issue LNK 2019 LNK2005
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ char class classes classified code coding compatible compile console conversion count date delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file filewrite forms fstream function functions game givemetehcodez graph gui homeworkhelp homeworkhelper homeworksolutions iamthwee icon if...else ifstream input int integer java lib linkedlist linker loop looping loops map math matrix memory multiple news node object output play pointer problem program programming project python random read recursion reference rpg string strings struct symbol temperature template test text text-file toolkit tree url values variable vector video win32 windows winsock wordfrequency wxwidgets





