Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "LSARetrievePrivateData" in [All]

advapi32

.

see LsaRetrievePrivateData

.

I used a custom marshaler to live a happier life with the "own super special" string type that LSA uses. It marshals LSA_UNICODE_STRINGS to and from normal .NET strings. See "Alternate Sample Code" way below. However I'm quite new to p/invoke and this is my first custom marshaler ever, so please keep your eyes open for problems and bugs with my code. (A problem I had was CleanUpNativeData for data converted from managed to unmanaged aswell as for data converted from unmanaged to managed. Since I didn't allocate the data myself in the latter case my marshaler uses a hash table to keep track of the native data it allocated itself. Don't know if that's the correct way, however. Feel free to mail me at pi AT removethispart frohwalt removethisaswell DOT de for suggestions/corrections. ) Oh, by the way this also contains an example for LSARetrievePrivateData in case you want to read out some RunAs passwords from the LSA. (My goal is to ultimateley change them, not to read them )

.

            UInt32 ntstatus = LsaRetrievePrivateData(policy, key, ref result);

.

        private static extern UInt32 LsaRetrievePrivateData(

.
Summary
The LsaRetrievePrivateData function retrieves private data that was stored by the LsaStorePrivateData function.
.

    private static extern uint LsaRetrievePrivateData(

.

Private Declare Function LsaRetrievePrivateData Lib "ADVAPI32.dll" (ByVal PolicyHandle As Long, ByRef KeyName As LSA_UNICODE_STRING, ByVal PrivateData As Long) As Long

.

    private static extern uint LsaRetrievePrivateData(

.

        uint ntsResult = LsaRetrievePrivateData(LsaPolicyHandle, ref secretName, out PrivateData);

.
Documentation
[LsaRetrievePrivateData] on MSDN
.

See sample code on LsaRetrievePrivateData


 
Access PInvoke.net directly from VS: