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 "UNICODE_STRING" in [All]

advapi32

.

         ref LSA_UNICODE_STRING KeyName,

.

         ref LSA_UNICODE_STRING PrivateData

.

   LSA_UNICODE_STRING[] UserRights,

.

    ByRef UserRights As LSA_UNICODE_STRING, _

.

    The UserRights parameter is really an array of LSA_UNICODE_STRINGS

.

    Dim SystemName, DenyTSRights As LSA_UNICODE_STRING

.

// out PLSA_UNICODE_STRING* UserRights,

.

Similarly - the sample code below works, but why can't you just use an array of LSA_UNICODE_STRING ???

.

    LSA_UNICODE_STRING_withPointer structure = new LSA_UNICODE_STRING_withPointer();

.

    ptr = (IntPtr)(((long)ptr) + Marshal.SizeOf(typeof(LSA_UNICODE_STRING)));

.

    LSA_UNICODE_STRING[] UserRights,

.

    ByRef userRights As LSA_UNICODE_STRING, _

.

    '  PLSA_UNICODE_STRING UserRights,

.

    struct LSA_UNICODE_STRING

.

    LSA_UNICODE_STRING[] SystemName,

.

    LSA_UNICODE_STRING[] UserRights,

.

        LSA_UNICODE_STRING[] system = null;

.

        system = new LSA_UNICODE_STRING[1];

.

        LSA_UNICODE_STRING[] privileges = new LSA_UNICODE_STRING[1];

.

    static LSA_UNICODE_STRING InitLsaString(string s)

.

        LSA_UNICODE_STRING lus = new LSA_UNICODE_STRING();

.

    Dim SystemName, DenyTSRights As LSA_UNICODE_STRING

.

    LSA_UNICODE_STRING userRight;

.

       userRight = (LSA_UNICODE_STRING)Marshal.PtrToStructure(ptr, typeof(LSA_UNICODE_STRING));

.

    struct LSA_UNICODE_STRING

.

    LSA_UNICODE_STRING[] SystemName,

.

    LSA_UNICODE_STRING[] UserRights,

.

    LSA_UNICODE_STRING[] UserRights,

.

        LSA_UNICODE_STRING[] UserRights,

.

    LSA_UNICODE_STRING[] Names,

.

        internal LSA_UNICODE_STRING Name;

.

        internal LSA_UNICODE_STRING Name;

.

        LSA_UNICODE_STRING[] system = null;

.

        system = new LSA_UNICODE_STRING[1];

.

        LSA_UNICODE_STRING[] privileges = new LSA_UNICODE_STRING[1];

.

        LSA_UNICODE_STRING name = lsaNames[i].Name;

.

        LSA_UNICODE_STRING name = lsaNames[i].Name;

.

        LSA_UNICODE_STRING tempDomain = lsaDomainName[i].Name;

.

        LSA_UNICODE_STRING[] privileges = new LSA_UNICODE_STRING[1];

.

        LSA_UNICODE_STRING[] privileges = new LSA_UNICODE_STRING[1];

.

        LSA_UNICODE_STRING[] names = new LSA_UNICODE_STRING[1];

.

    static LSA_UNICODE_STRING InitLsaString(string s)

.

        LSA_UNICODE_STRING lus = new LSA_UNICODE_STRING();

.

   ref LSA_UNICODE_STRING SystemName,

.

    ByRef SystemName As LSA_UNICODE_STRING, _

.

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 )

.

        LSA_UNICODE_STRING aSystemName = new LSA_UNICODE_STRING();

.

            LSA_UNICODE_STRING[] aUserRightsLSAString = new LSA_UNICODE_STRING[1];

.

            aUserRightsLSAString[0] = new LSA_UNICODE_STRING();

.

    internal struct LSA_UNICODE_STRING

.

                LSA_UNICODE_STRING lus = (LSA_UNICODE_STRING) Marshal.PtrToStructure(pNativeData, typeof(LSA_UNICODE_STRING));

.

            LSA_UNICODE_STRING lus = new LSA_UNICODE_STRING();

.

                LSA_UNICODE_STRING lus = (LSA_UNICODE_STRING) Marshal.PtrToStructure(pNativeData, typeof(LSA_UNICODE_STRING));

.

            public LSA_UNICODE_STRING ObjectName;

.

    Dim SystemName, DenyTSRights As LSA_UNICODE_STRING

.

    LSA_UNICODE_STRING[] UserRights,

.

    ByRef UserRights As LSA_UNICODE_STRING, _

.

    '  PLSA_UNICODE_STRING[] UserRights,

.

    The UserRights parameter is really an array of LSA_UNICODE_STRINGS

.

    Dim SystemName, DenyTSRights As LSA_UNICODE_STRING

.

                ref LSA_UNICODE_STRING KeyName,

.

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

.

Private Type LSA_UNICODE_STRING

.

    private struct LSA_UNICODE_STRING

.

        public LSA_UNICODE_STRING ObjectName;

.

                ref LSA_UNICODE_STRING KeyName,

.

         ref LSA_UNICODE_STRING KeyName,

.

         ref LSA_UNICODE_STRING PrivateData

.

       ref LSA_UNICODE_STRING SystemName,

.

    private LSA_UNICODE_STRING localsystem;

.

    private LSA_UNICODE_STRING secretName;

.

        localsystem = new LSA_UNICODE_STRING();

.

        secretName = new LSA_UNICODE_STRING();

.

        LSA_UNICODE_STRING lusSecretData = new LSA_UNICODE_STRING();

.

        LSA_UNICODE_STRING lusSecretData =

.

        (LSA_UNICODE_STRING)Marshal.PtrToStructure(PrivateData, typeof(LSA_UNICODE_STRING));

.

         ref LSA_UNICODE_STRING KeyName,

.

         ref LSA_UNICODE_STRING PrivateData

Structures

.

   public LSA_UNICODE_STRING ObjectName;

.

   Dim ObjectName As LSA_UNICODE_STRING

.

struct LSA_UNICODE_STRING

.

Structure LSA_UNICODE_STRING

.

    LSA_UNICODE_STRING userRight;

.

       userRight = (LSA_UNICODE_STRING)Marshal.PtrToStructure(ptr, typeof(LSA_UNICODE_STRING));

.
Documentation
[LSA_UNICODE_STRING] on MSDN
.

        ObjectName = New UNICODE_STRING(name)

.

    Public Property ObjectName As UNICODE_STRING

.

            Return DirectCast(Marshal.PtrToStructure(m_objectName, GetType(UNICODE_STRING)), UNICODE_STRING)

.

            Marshal.DestroyStructure(m_objectName, GetType(UNICODE_STRING))

.

     ObjectName = new UNICODE_STRING(name);

.

   public UNICODE_STRING ObjectName

.

      return (UNICODE_STRING)Marshal.PtrToStructure(

.

       objectName, typeof(UNICODE_STRING));

.

       Marshal.DestroyStructure(objectName, typeof(UNICODE_STRING));

.

UNICODE_STRING

.

   public UNICODE_STRING Name;

.

   public UNICODE_STRING TypeName;

.

UNICODE_STRING

.

    public LSA_UNICODE_STRING Username;

.

    public LSA_UNICODE_STRING LoginDomain;

.

    public LSA_UNICODE_STRING AuthenticationPackage;

.

    public LSA_UNICODE_STRING LogonServer;

.

    public LSA_UNICODE_STRING DnsDomainName;

.

    public LSA_UNICODE_STRING Upn;

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

public struct UNICODE_STRING : IDisposable

.

   public UNICODE_STRING(string s)

.

Private Structure UNICODE_STRING

.
Documentation
[UNICODE_STRING] on MSDN

ntdll

.

public struct UNICODE_STRING

.

UNICODE_STRING unicodeString;

.

   var buf = new UNICODE_STRING(new string(' ', 512));

.

   ref UNICODE_STRING LinkTarget,

.

UNICODE_STRING

.

var buffer = new UNICODE_STRING(new string(' ', 512));

.

    ProcessImageFileName, // q: UNICODE_STRING

.

    ProcessImageFileNameWin32, // q: UNICODE_STRING

.

   ref UNICODE_STRING UnicodeString);

.

UNICODE_STRING

.
Summary
Converts a Unicode-Char-Array to an Unicode_String
.

  ref UNICODE_STRING DestinationString,

.

   out UNICODE_STRING DestinationString,

.

public struct UNICODE_STRING

.

UNICODE_STRING

secur32

.

private struct LSA_UNICODE_STRING

.

    public LSA_UNICODE_STRING Username;

.

    public LSA_UNICODE_STRING LoginDomain;

.

    public LSA_UNICODE_STRING AuthenticationPackage;

.

    public LSA_UNICODE_STRING LogonServer;

.

    public LSA_UNICODE_STRING DnsDomainName;

.

    public LSA_UNICODE_STRING Upn;

.

                    public struct LSA_UNICODE_STRING

.

                        public LSA_UNICODE_STRING ClientUpn;   // REQUIRED: UPN for client

.

                        public LSA_UNICODE_STRING ClientRealm; // Optional: Client Realm, if known

netapi32

.

        LSA_UNICODE_STRING aSystemName = new LSA_UNICODE_STRING();


 
Access PInvoke.net directly from VS: