Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than rasapi32, prefix the name with the module name and a period.
RasEnumEntries (rasapi32)
.
C# Signature:
[DllImport("rasapi32.dll", SetLastError=true,CharSet=CharSet.Auto)]
static extern uint RasEnumEntries(
IntPtr reserved,
IntPtr lpszPhonebook,
[In,Out] RASENTRYNAME[] lprasentryname,
ref int lpcb,
ref int lpcEntries);
VB Signature:
<DllImport("rasapi32.dll", EntryPoint:="RasEnumEntries", CharSet:=CharSet.Auto)> _
Private Shared Function RasEnumEntries( _
ByVal reserved As String, _
ByVal lpszPhoneBook As String, _
ByVal lpRasEntryName As IntPtr, _
ByRef lpc As Int32, _
ByRef lpcEntries As Int32) As ReturnCodes
End Function
User-Defined Types:
None.
Notes:
None.
Tips & Tricks:
const int MAX_PATH = 260;
const int RAS_MaxEntryName = 256;
[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Auto)]
struct RASENTRYNAME {
public int dwSize;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=RAS_MaxEntryName + 1)]
public string szEntryName;
public int dwFlags;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=MAX_PATH + 1)]
public string szPhonebook;
}
Sample Code:
using System;
using System.Runtime.InteropServices;
class RasEnumEntriesSample
{
const int MAX_PATH = 260;
const int RAS_MaxEntryName = 256;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
struct RASENTRYNAME
{
public int dwSize;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = RAS_MaxEntryName + 1)]
public string szEntryName;
public int dwFlags;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH + 1)]
public string szPhonebook;
}
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).