SecMakeSPNEx2 function

SecMakeSPNEx2 creates a service provider name string that can be used when it communicates with specific security service providers.

Syntax

NTSTATUS SecMakeSPNEx2(
  _In_    PUNICODE_STRING ServiceClass,
  _In_    PUNICODE_STRING ServiceName,
  _In_    PUNICODE_STRING InstanceName,
  _In_    USHORT          InstancePort,
  _In_    PUNICODE_STRING Referrer,
  _In_    PUNICODE_STRING TargetInfo,
  _Inout_ PUNICODE_STRING Spn,
  _Out_   PULONG          TotalSize,
  _In_    BOOLEAN         Allocate,
  _In_    BOOLEAN         IsTargetInfoMarshaled
);

Parameters

  • ServiceClass [in]
    A pointer to a Unicode string that specifies the service class for the security service provider.

  • ServiceName [in]
    A pointer to a Unicode string that specifies the service name for the security service provider.

  • InstanceName [in]
    A pointer to an optional Unicode string that specifies the instance name that is used to connect with the security service provider.

  • InstancePort [in]
    An optional variable that specifies the instance port that is used to connect with the security service provider.

  • Referrer [in]
    A pointer to an optional Unicode string that specifies the referrer name that is used to connect with the security service provider.

  • TargetInfo [in]
    A pointer to an optional Unicode string that specifies target information that is used to connect with the security service provider.

  • Spn [in, out]
    A pointer to a Unicode string that receives the security service provider name string that is created by this function.

  • TotalSize [out]
    A pointer to an optional variable that receives the length of the security service provider name string that is created by this function.

  • Allocate [in]
    A Boolean variable that indicates if the memory that is used to store the Spn Unicode string should be allocated by this function. If this parameter is TRUE, memory for Spn will be allocated from paged pool.

  • IsTargetInfoMarshaled [in]
    A Boolean variable that indicates that the caller provided a marshaled InTargetInfo structure. If IsTargetInfoMarshaled is TRUE, InTargetInfo->Buffer points to a string representation of the CREDENTIAL_TARGET_INFORMATION structure as returned by the CredMarshalTargetInfo function.

Return value

SecMakeSPNEx2 returns STATUS_SUCCESS on success or one of the following error codes on failure:

Return code Description
STATUS_BUFFER_OVERFLOW

The Allocate parameter was set to FALSE and one of the following conditions occurred:

The Spn parameter was a NULL pointer.

The maximum length for the Spn Unicode string parameter was too small.

STATUS_INVALID_PARAMETER

A total length of the Spn parameter exceeds 65535 bytes.

STATUS_NO_MEMORY

The Allocate parameter was set to TRUE, but the memory allocation request failed.

 

Remarks

SecMakeSPNEx2 is an enhanced version of SecMakeSPNEx.

Requirements

Target platform

Universal

Version

This function is available on Windows Vista, Windows Server 2008, and later versions of the Windows operating systems.

Header

Ntifs.h (include Ntifs.h or FltKernel.h)

Library

Ksecdd.lib

IRQL

<= APC_LEVEL

See also

SecMakeSPN

SecMakeSPNEx

 

 

Send comments about this topic to Microsoft