Export (0) Print
Expand All

LsaRetrievePrivateData function

Do not use the LSA private data functions. Instead, use the CryptProtectData and CryptUnprotectData functions.

Syntax


NTSTATUS LsaRetrievePrivateData(
  _In_   LSA_HANDLE PolicyHandle,
  _In_   PLSA_UNICODE_STRING KeyName,
  _Out_  PLSA_UNICODE_STRING *PrivateData
);

Parameters

PolicyHandle [in]

A handle to a Policy object. The handle must have the POLICY_GET_PRIVATE_INFORMATION access right. For more information, see Opening a Policy Object Handle.

KeyName [in]

Pointer to an LSA_UNICODE_STRING structure that contains the name of the key under which the private data is stored.

To create a specialized object, add one of the following prefixes to the key name.

PrefixMeaning
L$

For local objects.

G$

For global objects.

M$

For computer objects.

 

If you are not creating one of these specialized types, you do not need to specify a key name prefix. For more information, see Private Data Object.

PrivateData [out]

Pointer to a variable that receives a pointer to an LSA_UNICODE_STRING structure that contains the private data.

When you no longer need the information, pass the returned pointer to LsaFreeMemory.

Return value

If the function succeeds, the function returns STATUS_SUCCESS.

If the function fails, it returns an NTSTATUS value, which can be the following value or one of the LSA Policy Function Return Values.

Return codeDescription
STATUS_OBJECT_NAME_NOT_FOUND

No private data is stored under the name specified by the KeyName parameter.

 

You can use the LsaNtStatusToWinError function to convert the NTSTATUS value to a Windows error code.

Remarks

You must run this process "As Administrator" or the call fails with ERROR_ACCESS_DENIED.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Ntsecapi.h

Library

Advapi32.lib

DLL

Advapi32.dll

See also

LsaFreeMemory
LsaStorePrivateData
LSA_UNICODE_STRING

 

 

Community Additions

ADD
Show:
© 2014 Microsoft