Thema: Delphi CreateProcessAsUser

Einzelnen Beitrag anzeigen

Assarbad
(Gast)

n/a Beiträge
 
#4

Re: CreateProcessAsUser

  Alt 10. Feb 2005, 11:29
PSDK sagt:
The CreateProcessWithLogonW function is similar to CreateProcessAsUser, except that the caller does not need to call the LogonUser function to authenticate the user and get a token.


Du mußt eben LogonUser() bei der gewünschten Funktion explizit aufrufen - danach das erhaltene Token an die Funktion übergeben. Außerdem existiert CreateProcessWithLogonW() erst ab Windows 2000.

Außerdem werden bestimmte Privilegien benötigt, die du um es maximalst kompatibel zu gestalten, vorher aktivieren solltest. Funktionen dazu für Dlephi gibt's wie Sand am Meer:
PSDK meint:
Typically, the process that calls the CreateProcessAsUser function must have the SE_ASSIGNPRIMARYTOKEN_NAME and SE_INCREASE_QUOTA_NAME privileges. However, if hToken is a restricted version of the caller's primary token, the SE_ASSIGNPRIMARYTOKEN_NAME privilege is not required. If the necessary privileges are not already enabled, CreateProcessAsUser enables them for the duration of the call. For more information, see Running with Special Privileges.


Bei weiteren Fragen einfach fragen ... notfalls PN an mich, weil ich nur unregelmäßig reinschaue.
  Mit Zitat antworten Zitat