SecMakeSPN function

SecMakeSPN creates a service provider name string that can be used when communicating with specific security service providers.

Syntax

NTSTATUS SecMakeSPN(
  _In_    PUNICODE_STRING ServiceClass,
  _In_    PUNICODE_STRING ServiceName,
  _In_    PUNICODE_STRING InstanceName,
  _In_    USHORT          InstancePort,
  _In_    PUNICODE_STRING Referrer,
  _Inout_ PUNICODE_STRING Spn,
  _Out_   PULONG          Length,
  _In_    BOOLEAN         Allocate
);

Parameters

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

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

  • InstanceName [in]
    A pointer to an optional Unicode string specifying the instance name for connecting with the security service provider.

  • InstancePort [in]
    An optional variable specifying the instance port for connecting with the security service provider.

  • Referrer [in]
    A pointer to an optional Unicode string specifying the referrer name for connecting with the security service provider.

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

  • Length [out]
    A pointer to an optional variable for storing the length of the security service provider name string created by this function.

  • Allocate [in]
    A Boolean variable indicating if the memory for storing the Spn Unicode string should be allocated by this function. If this parameter is true, memory for Spn will be allocated from paged pool.

Return value

SecMakeSPN 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.

 

Requirements

Target platform

Universal

Header

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

Library

Ksecdd.lib

IRQL

<= APC_LEVEL

See also

SecMakeSPNEx

SecMakeSPNEx2

 

 

Send comments about this topic to Microsoft