Skip to content

Latest commit

 

History

History
152 lines (115 loc) · 5.27 KB

nc-ntsecpkg-lsa_get_credentials.md

File metadata and controls

152 lines (115 loc) · 5.27 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NC:ntsecpkg.LSA_GET_CREDENTIALS
LSA_GET_CREDENTIALS (ntsecpkg.h)
Retrieves credentials associated with a logon session.
GetCredentials
GetCredentials callback function [Security]
LSA_GET_CREDENTIALS
LSA_GET_CREDENTIALS callback
_lsa_getcredentials
ntsecpkg/GetCredentials
security.getcredentials
security\getcredentials.htm
security
e9a2d112-6681-4400-b316-ffd7095e319a
12/05/2018
GetCredentials, GetCredentials callback function [Security], LSA_GET_CREDENTIALS, LSA_GET_CREDENTIALS callback, _lsa_getcredentials, ntsecpkg/GetCredentials, security.getcredentials
ntsecpkg.h
Windows
Windows XP [desktop apps only]
Windows Server 2003 [desktop apps only]
Windows
19H1
LSA_GET_CREDENTIALS
ntsecpkg/LSA_GET_CREDENTIALS
c++
APIRef
kbSyntax
UserDefined
Ntsecpkg.h
GetCredentials

LSA_GET_CREDENTIALS callback function

-description

Retrieves credentials associated with a logon session.

This function is not used by newer authentication packages, such as Kerberos.

-parameters

-param LogonId [in]

Pointer to an LUID structure containing the session ID of the logon session from which credentials are to be retrieved.

-param AuthenticationPackage [in]

Authentication package ID of the calling authentication package. Authentication packages should retrieve only their own credentials.

-param QueryContext [in, out]

Pointer to an unsigned LONG value used across successive calls to retrieve multiple credentials. The first time this function is used, the value pointed to by this argument should be zero. Thereafter, this value will be updated to allow retrieval to continue where it left off. This value should, therefore, not be changed until all credentials of a given query operation have been retrieved.

-param RetrieveAllCredentials [in]

Indicates whether all credentials for the specified logon session should be retrieved (TRUE), or only those matching the specified PrimaryKeyValue (FALSE).

-param PrimaryKeyValue [in, out]

This parameter serves two purposes. If the RetrieveAllCredentials parameter is FALSE, this string contains the value to use as a primary lookup key. In this case, only credentials belonging to the correct logon session with a primary lookup key matching this value will be retrieved.

If RetrieveAllCredentials is TRUE, the value of this string on input is ignored and the primary lookup key of each credential retrieved is returned in this string.

-param PrimaryKeyLength [out]

If the RetrieveAllCredentials parameter is TRUE, this parameter receives the length needed to store the PrimaryKeyValue string.

-param Credentials [out]

Pointer to a buffer that receives the retrieved credential. Only one credential is retrieved for each call made. The credential is returned in a buffer that the function allocates by calling the AllocateLsaHeap function. It is the caller's responsibility to free the Credentials buffer when it is no longer needed, by calling FreeLsaHeap.

-returns

If the function succeeds, the function returns the NTSTATUS code, STATUS_SUCCESS, indicating that the credentials were successfully retrieved.

If the function fails, the return value is an NTSTATUS code, which can be one of the following values or one of the LSA Policy Function Return Values.

Return code Description
ERROR_GEN_FAILURE
No more credentials are available. If this code is returned on the first call, there are no credentials matching the selection criteria.
STATUS_MORE_ENTRIES
The string provided to receive the PrimaryKeyValue was not large enough to hold the data. In this case, no data is retrieved, and the QueryContext value is not modified. This allows the same call to be made again with a larger string buffer.
STATUS_NO_SUCH_LOGON_SESSION
The specified logon session could not be found.
 

The LsaNtStatusToWinError function converts an NTSTATUS code to a Windows error code.

-see-also

LSA_DISPATCH_TABLE

LSA_SECPKG_FUNCTION_TABLE