SspiPrepareForCredWrite function (sspi.h)

Generates values from an identity structure that can be passed as the values of parameters in a call to the CredWrite function.

Syntax

SECURITY_STATUS SEC_ENTRY SspiPrepareForCredWrite(
  [in]  PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity,
  [in]  PCWSTR                          pszTargetName,
  [out] PULONG                          pCredmanCredentialType,
  [out] PCWSTR                          *ppszCredmanTargetName,
  [out] PCWSTR                          *ppszCredmanUserName,
  [out] PUCHAR                          *ppCredentialBlob,
  [out] PULONG                          pCredentialBlobSize
);

Parameters

[in] AuthIdentity

The identity structure from which to generate the credentials to be passed to the CredWrite function.

[in] pszTargetName

A target name that can be modified by this function depending on the value of the AuthIdentity parameter.

Set the value of this parameter to NULL to use the user name as the target.

[out] pCredmanCredentialType

The credential type to pass to the CredWrite function.

[out] ppszCredmanTargetName

The target name to pass to the CredWrite function.

[out] ppszCredmanUserName

The user name to pass to the CredWrite function.

[out] ppCredentialBlob

The credential BLOB to send to the CredWrite function.

[out] pCredentialBlobSize

The size, in bytes, of the ppCredentialBlob buffer.

Return value

If the function succeeds, it returns SEC_E_OK.

If the function fails, it returns a nonzero error code.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header sspi.h
Library Secur32.lib
DLL SspiCli.dll