| | |
ACL TRUSTEE_TYPE is always Unknown.
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
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: 116
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 beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy desktop developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker list loop looping loops map math memory multiple news node number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference rpg sorting string strings struct temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





