Einzelnen Beitrag anzeigen

Dezipaitor

Registriert seit: 14. Apr 2003
Ort: Stuttgart
1.701 Beiträge
 
Delphi 7 Professional
 
#4

Re: CreateProcessAsUser: Wie Verbindung mit Netzwerk herstel

  Alt 18. Aug 2008, 14:02
Aufgrund meiner derzeit spärlichen Zeit kann ich nicht alle Probleme behandeln. Folgendes solltest du überdenken:

1. Die Fehlerüberprüfung gründlich überdenken
2. Die LogonUser API genau studieren : http://msdn.microsoft.com/en-us/library/aa378184.aspx
So steht da:
Zitat:
The LOGON32_LOGON_NETWORK logon type is fastest, but it has the following limitations:
...
* If you convert the token to a primary token and use it in CreateProcessAsUser to start a process, the new process cannot access other network resources, such as remote servers or printers, through the redirector. An exception is that if the network resource is not access controlled, then the new process will be able to access it.
3. LogonUser benötigt immer das Passwort des Benutzers. D.h. du musst es speichern. Das muss gründlich überlegt werden, wo und wie.

4. Die erste Zeile ist nicht notwendig:
Delphi-Quellcode:
  FillChar(sil,SizeOf(TSecurityImpersonationLevel),#0);
  sil := SecurityIdentification;
Warum darfst du kein Framework verwenden? Was ist dein Ziel? Willst du eine Anwendung bauen, oder willst du über die Security API etwas schreiben?

Teste mal denselben Ansatz mit interaktiven Logon und den UNC-Pfaden. Vllt funktioniert das schon. Und gib bescheid!
Christian
Windows, Tokens, Access Control List, Dateisicherheit, Desktop, Vista Elevation?
Goto: JEDI API LIB & Windows Security Code Library (JWSCL)
  Mit Zitat antworten Zitat