NetUserModalsGet (netapi32)
Last changed: anonymous

.
Summary
TODO - a short description

C# Signature:

    [DllImport("netapi32.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall, SetLastError = true)]
    static extern uint NetUserModalsGet(
        string server,
        int level,
        out IntPtr BufPtr);

VB Signature:

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

    USER_MODALS_INFO_0 objUserModalsInfo0 = new USER_MODALS_INFO_0();
    IntPtr bufPtr; // because it's an OUT, we don't need to Alloc
    uint lngReturn = NetUserModalsGet(@"\\" + Environment.MachineName, 0, out bufPtr);
    if (lngReturn == 0)
    {
    objUserModalsInfo0 = (USER_MODALS_INFO_0)Marshal.PtrToStructure(bufPtr, typeof(USER_MODALS_INFO_0));

    int maxPassAge = objUserModalsInfo0.usrmod0_max_passwd_age;

    }
    NetApiBufferFree(bufPtr);
    bufPtr = IntPtr.Zero;

Documentation