SpQueryContextAttributes function

The SpQueryContextAttributes function retrieves the attributes of a security context.

The SpQueryContextAttributes function is the dispatch function for the QueryContextAttributes (General) function of the Security Support Provider Interface.


NTSTATUS SpQueryContextAttributes(
  _In_  LSA_SEC_HANDLE ContextHandle,
  _In_  ULONG          ContextAttribute,
  _Out_ PVOID          Buffer


ContextHandle [in]

A handle to the security context.

ContextAttribute [in]

Context attribute to query. For a list of valid values, see the QueryContextAttributes (General) function.

Buffer [out]

Pointer that receives the address of a buffer containing the requested attributes. Memory for the Buffer parameter should be allocated with the AllocateHeap function from the SECPKG_DLL_FUNCTIONS function table in user-mode. In Local Security Authority (LSA) mode, use the AllocateLsaHeap function.

Return value

If the function succeeds, return STATUS_SUCCESS.

If the function fails, return an NTSTATUS code that indicates the reason it failed. The following lists a common reason for failure and the error code that the function should return.

Return codeDescription

The handle is not valid.



SSP/APs must implement the SpQueryContextAttributes function; however, the actual name given to the implementation is up to the developer.

A pointer to the LSA-mode implementation of the SpQueryContextAttributes function is available in the SECPKG_FUNCTION_TABLE structure received from the SpLsaModeInitialize function.

A pointer to the user-mode implementation of the SpQueryContextAttributes function is available in the SECPKG_USER_FUNCTION_TABLE structure received from the SpUserModeInitialize function.


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]



See also