AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

logonuser-schwierigkeiten

Ein Thema von Illuminator-23-5 · begonnen am 31. Okt 2003 · letzter Beitrag vom 13. Dez 2004
Antwort Antwort
Illuminator-23-5
(Gast)

n/a Beiträge
 
#1

logonuser-schwierigkeiten

  Alt 31. Okt 2003, 14:59
ich spiel grad mit logonuser ein bisschen rum, doch ich komm nicht recht weit.
wenn ich es aufrufe, kommt immer der Fehler 87 = ungültige Parameter
hier der funktionsaufruf:
Delphi-Quellcode:
  logonUser(PChar(edit1.Text), PChar(Edit3.Text), PChar(edit2.Text),
    0, LOGON32_LOGON_NETWORK, h);
  if h = 0 then begin
    ShowMessage(IntToStr(GetLastError) + ' - error');
  end
  else
    ShowMessage('got: ' + IntToStr(h));
in den Edits befinen sich die richtigen daten(benutzername, passwort und domain stimmen)

woran könnts liegen, dasses nicht klappt?
  Mit Zitat antworten Zitat
Tpercon

Registriert seit: 7. Jun 2002
638 Beiträge
 
Delphi 5 Professional
 
#2

Re: logonuser-schwierigkeiten

  Alt 31. Okt 2003, 15:15
Tausch mal den 4. und 5. Parameter. Wie siehts dann aus?
  Mit Zitat antworten Zitat
Illuminator-23-5
(Gast)

n/a Beiträge
 
#3

Re: logonuser-schwierigkeiten

  Alt 31. Okt 2003, 18:45
beim fünften hab ich schon alles probiert, aber beim 4. weiß ich nicht!
  Mit Zitat antworten Zitat
Tpercon

Registriert seit: 7. Jun 2002
638 Beiträge
 
Delphi 5 Professional
 
#4

Re: logonuser-schwierigkeiten

  Alt 1. Nov 2003, 12:33
Zitat:
BOOL LogonUser(

LPTSTR lpszUsername, // string that specifies the user name
LPTSTR lpszDomain, // string that specifies the domain or server
LPTSTR lpszPassword, // string that specifies the password
DWORD dwLogonType, // specifies the type of logon operation
DWORD dwLogonProvider, // specifies the logon provider
PHANDLE phToken // pointer to variable to receive token handle
);
Zitat:
dwLogonType

Specifies the type of logon operation to perform. The following logon types are defined:

Value Meaning
LOGON32_LOGON_BATCH This logon type is intended for batch servers, where processes may be executing on behalf of a user without their direct intervention; or for higher performance servers that process many clear-text authentication attempts at a time, such as mail or web servers. LogonUser does not cache credentials for this logon type.
LOGON32_LOGON_INTERACTIVE This logon type is intended for users who will be interactively using the machine, such as a user being logged on by a terminal server, remote shell, or similar process. This logon type has the additional expense of caching logon information for disconnected operation, and is therefore inappropriate for some client/server applications, such as a mail server.
LOGON32_LOGON_SERVICE Indicates a service-type logon. The account provided must have the service privilege enabled.
LOGON32_LOGON_NETWORK This logon type is intended for high performance servers to authenticate clear text passwords. LogonUser does not cache credentials for this logon type. This is the fastest logon path, but there are two limitations. First, 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. Second, if you convert the token to a primary token and use it in CreateProcessAsUser to start a process, the new process will not be able to access other network resources, such as remote servers or printers, through the redirector.


dwLogonProvider

Specifies the logon provider. The following logon providers are defined:

Value Meaning
LOGON32_PROVIDER_DEFAULT Use the standard logon provider. This is the recommended value for dwLogonProvider. It gives an application the maximum upward compatibility with future releases of Windows NT.
Daher -> tausch den 4. und 5. Parameter bei dir. Geht'S dann?
  Mit Zitat antworten Zitat
Illuminator-23-5
(Gast)

n/a Beiträge
 
#5

Re: logonuser-schwierigkeiten

  Alt 6. Nov 2003, 19:07
*fast in vergessenheit geraten *

nee, da gehts leider auch nicht, da bekomm ich immer den wert 1936 zurück, habe aber auch dafür keinen Fehler gefunden!
  Mit Zitat antworten Zitat
Benutzerbild von Motzi
Motzi

Registriert seit: 6. Aug 2002
Ort: Wien
598 Beiträge
 
Delphi XE2 Professional
 
#6

Re: logonuser-schwierigkeiten

  Alt 7. Nov 2003, 10:43
Zitat von MSDN:
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.
Du benötigst das TCB-Privilege und das besitzt du normalerweise nur wenn dein Prog als Service läuft..!
Manuel Pöter
  Mit Zitat antworten Zitat
ChromStahl

Registriert seit: 15. Okt 2004
Ort: Würenlos
1 Beiträge
 
#7

Re: logonuser-schwierigkeiten

  Alt 13. Dez 2004, 12:04
Du hast den dwLogonProvider vergessen.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:18 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz