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
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
MprAdminUserGetInfo (mpr)
 
.
Summary
Returns the state of the dialin and callback privileges.

C# Signature:

[DllImport("mprapi.dll", SetLastError = false)]
    static extern UInt32 MprAdminUserGetInfo(
        [MarshalAs(UnmanagedType.LPWStr)]  string serverName,
        [MarshalAs(UnmanagedType.LPWStr)]  string userName,
        UInt32 Level,
        ref RAS_1 buffer);

VB Signature:

Declare Function MprAdminUserGetInfo Lib "mpr.dll" (TODO) As TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

     private const byte RASPRIV_NoCallback = 1;
     private const byte RASPRIV_AdminSetCallback = 2;
     private const byte RASPRIV_CallerSetCallback = 4;
     private const byte RASPRIV_DialinPrivilege = 8;

Tips & Tricks:

Please add some!

Sample Code:

private bool getDialin()
    {
        bool hasError = false;

        try
        {
        RAS_1 rasUser = new RAS_1();
        UInt32 result = MprAdminUserGetInfo(serverName, userId, 1, ref rasUser);
        if (result != 0)
        {
            throw new Exception("MprAdminUserGetInfo failed with code " + result.ToString());
        }

        if ((rasUser.bfPrivilege & RASPRIV_DialinPrivilege) == RASPRIV_DialinPrivilege)
        {
            dialInEnabled = true;
        }
        else
        {
            dialInEnabled = false;
        }
        }
        catch (Exception ex)
        {
        hasError = true;
        errorDescription = "MgtLib, getDialin: Exception with userId=<" + userId + ">: " + ex.Message;
        }

        return hasError;
    }

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

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