Einzelnen Beitrag anzeigen

steppo

Registriert seit: 31. Dez 2002
235 Beiträge
 
Delphi 10 Seattle Enterprise
 
#4

Re: string in unicode konvertieren und an Api-Funktion überg

  Alt 2. Okt 2003, 12:32
Ich brauche die Api-funktion "NetJoinDomain".

Delphi-Quellcode:
function NetJoinDomain(lpServer, lpDomain, lpAccountOU, lpAccount, lpPassword:
  PChar; fJoinOptions: Integer): Integer; stdcall; external
'Netapi32.dllname 'NetJoinDomain';
und noch eine Frage!
wie definieren ich die FJoinOptions.
gebe im Moment nur den Integerwert der zu benutzenden Optionen an:

fJoinOptions
[in] Specifies a value that contains a set of bit flags defining the join options. This parameter can be one or more of the following values. Value Meaning
NETSETUP_JOIN_DOMAIN Joins the computer to a domain. If this value is not specified, joins the computer to a workgroup.
NETSETUP_ACCT_CREATE Creates the account on the domain.
NETSETUP_WIN9X_UPGRADE The join operation is occurring as part of an upgrade of Windows Me/98/95.
NETSETUP_DOMAIN_JOIN_IF_JOINED Allows a join to a new domain even if the computer is already joined to a domain.
NETSETUP_JOIN_UNSECURE Performs an unsecured join.
NETSETUP_MACHINE_PWD_PASSED Indicates that the lpPassword parameter specifies a local machine account password rather than a user password. This flag is valid only for unsecured joins, which you must indicate by also setting the NETSETUP_JOIN_UNSECURE flag.
If you set this flag, then after the join operation succeeds, the machine password will be set to the value of lpPassword, if that value is a valid machine password.

das ganze wird dann so
Delphi-Quellcode:
Api_Meldung := NetJoinDomain(PChar(UebergabeParam[0]),
    PChar(UebergabeParam[1]), PChar(UebergabeParam[2]),
    PChar(UebergabeParam[3]), PChar(UebergabeParam[4]), 0 + 1);
übergeben.
Wir sind heute die, vor denen uns unsere Eltern immer gewarnt haben!
  Mit Zitat antworten Zitat