The DsMakePasswordCredentials function constructs a credential handle suitable for use with the DsBindWithCred function.
NTDSAPI DWORD DsMakePasswordCredentialsA( LPCSTR User, LPCSTR Domain, LPCSTR Password, RPC_AUTH_IDENTITY_HANDLE *pAuthIdentity );
Pointer to a null-terminated string that contains the user name to use for the credentials.
Pointer to a null-terminated string that contains the domain that the user is a member of.
Pointer to a null-terminated string that contains the password to use for the credentials.
Pointer to an RPC_AUTH_IDENTITY_HANDLE value that receives the credential handle. This handle is used in a subsequent call to DsBindWithCred. This handle must be freed with the DsFreePasswordCredentials function when it is no longer required.
Returns a Windows error code, including the following.
A null, default credential handle is created if User, Domain and Password are all NULL. Otherwise, User must be present. The Domain parameter may be NULL when User is fully qualified, such as a user in UPN format; for example, "firstname.lastname@example.org".
- Call DsMakePasswordCredentials to obtain the credential handle.
- Call DsBindWithCred, and pass the credential handle.
- Call DsUnbind when the binding is no longer required.
- Call DsFreePasswordCredentials to free the credential handle.
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|