Hallo,
Dir ist aber schon bewußt, dass
Delphi-Quellcode:
if not Fun(UserData)
then RaiseLastOSError;
das Kernstück ist, oder?
Das muss unbedingt drinbleiben sonst ist der ganze Aufruf sinnlos!
ändere bitte mal die Funktion Logon wie folgt ab:
Delphi-Quellcode:
function Logon(const User, Domain, Passw: string; Flag: Integer): THandle;
var
LR : TLogonRec;
begin
LR.U := PChar(User);
LR.D := PChar(Domain);
LR.P := PChar(Passw);
LR.Flag := Flag;
LR.Token := INVALID_HANDLE_VALUE; // hier ändern !!!
PrivilegedExec(SE_CHANGE_NOTIFY_NAME, _Logon2, LR);
Result := LR.Token;
end;
"... we know, there are known knowns; there are things we know we know. We also know there are known unknowns; that is to say we know there are some things we don't know. But there are also unknown unknowns - the ones we don't know we don't know."