Einzelnen Beitrag anzeigen

CodeX

Registriert seit: 30. Okt 2004
471 Beiträge
 
Delphi 12 Athens
 

Re: RunAs Dialog vor dem Programmstart???

  Alt 10. Mär 2006, 13:13
Zitat von MathiasSimmack:
@Codex: Hast du da nicht ein Zitat vergessen:
Zitat:
The SE_TCB_NAME privilege is not required for this function unless you are logging onto a Passport account.
wir schmeissen hier mit zitatfetzen um uns ...
also hier mal vollständig:

Zitat:
Remarks

The LOGON32_LOGON_NETWORK logon type is fastest, but it has the following limitations:

* The function returns an impersonation token, not a primary token. You cannot use this token directly in the CreateProcessAsUser function. However, you can call the DuplicateTokenEx function to convert the token to a primary token, and then use it in CreateProcessAsUser.
* 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.

The SE_TCB_NAME privilege is not required for this function unless you are logging onto a Passport account.

Windows 2000: The process calling LogonUser requires the SE_TCB_NAME privilege. If the calling process does not have this privilege, LogonUser fails and GetLastError returns ERROR_PRIVILEGE_NOT_HELD. In some cases, the process that calls LogonUser must also have the SE_CHANGE_NOTIFY_NAME privilege enabled; otherwise, LogonUser fails and GetLastError returns ERROR_ACCESS_DENIED. This privilege is not required for the local system account or accounts that are members of the administrators group. By default, SE_CHANGE_NOTIFY_NAME is enabled for all users, but some administrators may disable it for everyone. For more information about privileges, see Privileges.
ich habe den code jetzt ausprobiert. unter XP funktioniert das einwandfrei.
unter 2000 jedoch nicht. LogonUser liefert hier false zurück. das wird wohl genau der hinweis sein, den ich als zitat gepostet habe.
kann das bitte jemand auch ausprobieren und bestätigen/dementieren? (btw: als DOMAIN habe ich '' genommen, da ich das lokal machen möchte. ging unter XP, vllt braucht 2000 was anderes?)

für meine zwecke müsste eine solche funktion für 2000/XP/2003 funktionieren. die 2000 user möchste/kann ich auf keinen fall ausnehmen.
  Mit Zitat antworten Zitat