Okay thats great.
I reread your code and found the problem :
I forgot to add the attributes
Delphi-Quellcode:
pGroups^.Groups[0].Attributes := SE_GROUP_MANDATORY or
SE_GROUP_ENABLED or
SE_GROUP_ENABLED_BY_DEFAULT or
SE_GROUP_LOGON_ID;
Delphi-Quellcode:
aLocalGroups := TSecurityIDList.Create(true);
aLogonSid := GetLogonSID(WTSToken);
[b]OR[/b]
aLogonSid := GetLogonSID();
aLocalGroups.Add(aLogonSid);
aLogonSid.Attributes := SE_GROUP_MANDATORY or
SE_GROUP_ENABLED or
SE_GROUP_ENABLED_BY_DEFAULT or
SE_GROUP_LOGON_ID;
You see both versions of GetLogonSID are working.
Question:
Do I have to set the attributes for the my special debugger user ?
aLocalGroups.Add(TSecurityID.Create('','DebuggerUser'));
I get debug privileges but cannot bring the taskmanager to enable "show processes of all users" .
('C:\WINDOWS\system32\taskmgr.exe')
Only this works:
Delphi-Quellcode:
aSID := AdministratorsSID;
aLocalGroups.Add(aSID);
aSID.Attributes := SE_GROUP_MANDATORY or
SE_GROUP_ENABLED or
SE_GROUP_ENABLED_BY_DEFAULT or
SE_GROUP_LOGON_ID;