.NET Framework Bookmark and Share   
 index > Network Class Library (System.Net) > Solve RRAS Hangup Problem in .Net 1.1
 

Solve RRAS Hangup Problem in .Net 1.1

I am currently creating a class to interface with the winapi RASfunctions and enumeratetypes. I need to translate this function into a C# call.

void CALLBACK MprAdminConnectionHangupNotification( __in RAS_CONNECTION_0 *pRasConnection0, __in RAS_CONNECTION_1 *pRasConnection1 ); 
Initially, i thought this was easy

internal delegate void MprAdminConnectionHangupNotification ([in] RAS_CONNECTION_0 pRasConnection0, [in]AS_CONNECTION_0 pRasConnection1)


My next step was to translate the datatypeRAS_CONNECTION_0 and RAS_CONNECTION_1.

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
internal struct RAS_CONNECTION_0
{

internal readonly int MAX_INTERFACE_NAME_LEN =256;
IntPtr hConnection;
IntPtr hInterface;
public uint dwConnectDuration;
RouterInterfaceType dwInterfaceType;
public uint dwConnectionFlags;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=(
int) 256)] public string wszInterfaceName; [MarshalAs(UnmanagedType.ByValTStr, SizeConst=(int) 256)] public string wszUserName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=(
int) 256)] public string wszLogonDomain;

[MarshalAs(UnmanagedType.ByValTStr, SizeConst=(
int) 256)] public string wszRemoteComputer;

};

The Original structure is

typedef struct _RAS_CONNECTION_0 {
HANDLE hConnection;
HANDLE hInterface;
DWORD dwConnectDuration;
ROUTER_INTERFACE_TYPE dwInterfaceType;
DWORD dwConnectionFlags;
WCHAR wszInterfaceName[MAX_INTERFACE_NAME_LEN + 1];
WCHAR wszUserName[UNLEN + 1];
WCHAR wszLogonDomain[DNLEN + 1];
WCHAR wszRemoteComputer[NETBIOS_NAME_LEN + 1]; } RAS_CONNECTION_0,
*PRAS_CONNECTION_0;



Can Someone tell me where to find UNLEN and DNLEN?

I am close to solving the hang up problem, I just need some assistance as to where to locate mpradmin.h.

Thanks in advanced
David


David Moss
Kountree
I believe you're looking for lmcons.h in the Platform SDK.
Aaron Oneal [NCL]
I believe you're looking for lmcons.h in the Platform SDK.
Aaron Oneal [NCL]

You can use google to search for other answers

Custom Search

More Threads

• Sockets
• Getting ip address of each network adapter (C#)
• How can i do a POST request faster (httpWebRequest, VB.NET)
• IPAddress.Parse question.
• Listen does not receive callback if cable disconnected and then subsequently connected
• check facebook user online status (C#)?
• 401 error in http...
• Socket Communication from a Telit modem
• Finding occasional and irregular bad bytes in a reliable(?) networkstream
• sending FTP commands not supported by FtpWebRequest.