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

LSA_UNICODE_STRING (Structures)
 
.
Summary
TODO - a short description

C# Definition:

[StructLayout(LayoutKind.Sequential)]
struct LSA_UNICODE_STRING
{
    public UInt16 Length;
    public UInt16 MaximumLength;
    public IntPtr Buffer;
}

VB Definition:

Structure LSA_UNICODE_STRING

Structure LSA_UNICODE_STRING

   Dim Length As Short
   Dim MaximumLength As Short
   Dim Buffer As IntPtr
End Structure

End Structure

User-Defined Field Types:

None.

Notes:

None.

Sample Code (C#):

// You should already have the HPolicy and SID ready
IntPtr rightsPtr;
uint countOfRights;
LsaEnumerateAccountRights(HPolicy, SID, out rightsPtr, out countOfRights);
try
{
    IntPtr ptr = rightsPtr;
    LSA_UNICODE_STRING userRight;
    for (int i = 0; i < countOfRights; i++)
    {
       userRight = (LSA_UNICODE_STRING)Marshal.PtrToStructure(ptr, typeof(LSA_UNICODE_STRING));
       String userRightStr = Marshal.PtrToStringAuto(userRight.Buffer);
       Console.WriteLine("Another Privilege found: " + userRightStr);
       ptr = (IntPtr)((Int32)ptr + Marshal.SizeOf(userRight));
    }
}
finally
{
    LsaFreeMemory(rightsPtr);
}

Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions