UNICODE_STRING (Structures)
Last changed: -219.111.155.239

.
Summary
The UNICODE_STRING structure is used to define Unicode strings.

C# Definition:

[StructLayout(LayoutKind.Sequential)]
public struct UNICODE_STRING : IDisposable
{
   public ushort Length;
   public ushort MaximumLength;
   private IntPtr buffer;

   public UNICODE_STRING(string s)
   {
     Length = (ushort)(s.Length * 2);
     MaximumLength = (ushort)(Length + 2);
     buffer = Marshal.StringToHGlobalUni(s);
   }

   public void Dispose()
   {
     Marshal.FreeHGlobal(buffer);
     buffer = IntPtr.Zero;
   }

   public override string ToString()
   {
     return Marshal.PtrToStringUni(buffer);
   }
}

User-Defined Field Types:

None.

Notes:

cf. NtOpenDirectoryObject, NtOpenSymbolicLinkObject

Documentation