Error 633: when i connect VPN using my application

I have a VPN application which installs miniport , LWF driver . I want to create a VPN connection in my PC .

The created VPN is working fine when with out my application . When i install my application and i am trying to connect the old VPN connection i got error like :

**********************************************************

"Error 633: The modem (or other connecting device) is already in use or is not configured properly. "

*************************************************************
so i need to connect the VPN using my VPN application . Why this is happening . I think , my VPN application and the newly created VPN is using same port ? or not ?

Then i tried to add registry values with the help of some websites :

************************************************************

"Explicitly reserve the TCP port that is used for the VPN connection "

HKEY_LOCAL_MACHINESYSTEM\CurrentControlSet\Services\Tcpip\Parameters

added Multi-String Value named as ReservedPorts with value 1723-1723

***************************************************************

But this is not working . I got same Error . Why this is happening ? How can i prevent this ?

Are you using the RAS API’s to connect the VPN? If so, what functions are you calling, in what order, with what values? What are you seeing in wireshark for ports 500 & 4500?

Thanks for your valuable suggestions . Yes I am using RAS API .My doubt is why this error occur with out connecting my application . When I connect VPN using system Windows 8.1 ,Windows 7 , still the errors there .but when I uninstall my application , I can setup VPN successfully . So my question is which port is using by vpn ? Or my application changes the system vpn configuration ?

I need to fix the VPN connection using system .

The analyzed only the tcp dest and source port . The source port is greater than 5000 . I didn’t analyzed further .

I will analyse and updated that . So what are the things should the check to avoid this error ?

Thanks

I can’t see any packets when i filter tcp.srcport==500 & 4500 . The RAS api i am using ::

*****************************************

// Load functions
m_fRasDial = GetProcAddress(m_hRasApiModule, “RasDialW”);
m_fRasDeleteEntry = GetProcAddress(m_hRasApiModule, “RasDeleteEntryW”);
m_fRasGetErrorString = GetProcAddress(m_hRasApiModule, “RasGetErrorStringW”);
m_fRasGetConnectStatus = GetProcAddress(m_hRasApiModule, “RasGetConnectStatusW”);
m_fRasGetEntryDialParams = GetProcAddress(m_hRasApiModule, “RasGetEntryDialParamsW”);
m_fRasGetProjectionInfo = GetProcAddress(m_hRasApiModule, “RasGetProjectionInfoW”);
m_fRasGetEntryProperties = GetProcAddress(m_hRasApiModule, “RasGetEntryPropertiesW”);
m_fRasEnumConnections = GetProcAddress(m_hRasApiModule, “RasEnumConnectionsW”);
m_fRasEnumEntries = GetProcAddress(m_hRasApiModule, “RasEnumEntriesW”);
m_fRasEnumDevices = GetProcAddress(m_hRasApiModule, “RasEnumDevicesW”);
m_fRasHangUp = GetProcAddress(m_hRasApiModule, “RasHangUpW”);
m_fRasSetEntryProperties = GetProcAddress(m_hRasApiModule, “RasSetEntryPropertiesW”);

// Check functions
bResult = m_fRasDial &&
m_fRasDeleteEntry &&
m_fRasGetErrorString &&
m_fRasEnumDevices &&
m_fRasGetProjectionInfo &&
m_fRasGetConnectStatus &&
m_fRasGetEntryDialParams &&
m_fRasGetEntryProperties &&
m_fRasEnumConnections &&
m_fRasEnumEntries &&
m_fRasHangUp &&
m_fRasSetEntryProperties ;

*******************************

DWORD RasApi::RasDial(LPRASDIALEXTENSIONS lpRasDialExtensions, LPCTSTR lpszPhonebook, LPRASDIALPARAMS lpRasDialParams, DWORD dwNotifierType, LPVOID lpvNotifier, LPHRASCONN lphRasConn)
{

RASAPI_DWORD_CALL( m_fRasDial,
((DWORD (APIENTRY*) (LPRASDIALEXTENSIONS, LPCTSTR, LPRASDIALPARAMS, DWORD, LPVOID, LPHRASCONN)) m_fRasDial)
(lpRasDialExtensions, lpszPhonebook, lpRasDialParams, dwNotifierType, lpvNotifier, lphRasConn)
)
}

****************************************

DWORD RasApi::RasDeleteEntry(LPCTSTR lpszPhonebook, LPCTSTR lpszEntry)
{
NS_RASAPI_DWORD_CALL( m_fRasDeleteEntry,
((DWORD (APIENTRY*) (LPCTSTR, LPCTSTR)) m_fRasDeleteEntry) (lpszPhonebook, lpszEntry)
)
}

**********************************************
DWORD RasApi::RasGetErrorString(UINT uErrorValue, LPTSTR lpszErrorString, DWORD cBufSize)
{
if(m_fRasGetErrorString)
{
return ((DWORD (APIENTRY*) (UINT, LPTSTR, DWORD)) m_fRasGetErrorString)(uErrorValue, lpszErrorString, cBufSize);
}
else
{
if(lpszErrorString && cBufSize)
{
lpszErrorString[0] = 0;
return ERROR_SUCCESS;
}
}

return ERROR_SUCCESS;
}
*********************************************************
DWORD RasApi::RasGetConnectStatus(HRASCONN hrasconn, LPRASCONNSTATUS lprasconnstatus)
{
RASAPI_DWORD_CALL(m_fRasGetConnectStatus,
((DWORD (APIENTRY*) (HRASCONN, LPRASCONNSTATUS)) m_fRasGetConnectStatus) (hrasconn, lprasconnstatus)
)
}
*********************************************
DWORD RasApi::RasGetEntryDialParams(LPCTSTR lpszPhonebook, LPRASDIALPARAMS lprasdialparams, LPBOOL lpfPassword)
{
RASAPI_DWORD_CALL(m_fRasGetEntryDialParams,
((DWORD (APIENTRY*) (LPCTSTR, LPRASDIALPARAMS, LPBOOL)) m_fRasGetEntryDialParams) (lpszPhonebook, lprasdialparams, lpfPassword)
)
}
**************************************************
DWORD RasApi::RasGetProjectionInfo(HRASCONN hrasconn, RASPROJECTION rasprojection, LPVOID lpprojection, LPDWORD lpcb)
{
RASAPI_DWORD_CALL(m_fRasGetProjectionInfo,
((DWORD (APIENTRY*) (HRASCONN, RASPROJECTION, LPVOID, LPDWORD)) m_fRasGetProjectionInfo) (hrasconn, rasprojection, lpprojection, lpcb)
)
}
*******************************************
etc …

after searching error 633 i got something like :

Error Code 633:

The port is already in use or is not configured for Remote Access dialout. If Rasdial.exe
terminates prematurely, it can leave the port in an indeterminate state. The port disappears
from Remote Access Server Manager if it is configured for dial-in. When a cu attempts to dial
out using RAS, cu receives the error message. NOTE: This problem is not specific to Rasdial.exe.
Any program that terminates prematurely without clearing the port state may cause this problem.
Stopping and restarting the Remote Access Service temporarily resolves the problem.

**************

is it correct ? How can i solve this ?

> I can’t see any packets when i filter tcp.srcport==500 & 4500 . The RAS api i am using ::

What does TCP 500/4500 have to do with VPN?

If you are trying to observe IKE and/or IPSec ESP-UDP then you had best start with capturing UDP 500/4500.

is it correct ? How can i solve this ?

Is what correct? What is it you are trying to do?

Good Luck,
Dave Cattley

i am trying to create a VPN normally in windows 7 , 8.1 . But i ma installing my application which act as a VPN application . I am creating VPN in my system not in my application . So i got error

"Error 633: The modem (or other connecting device) is already in use or is not
configured properly. "

Some time i got error like " device missing " error . this is the scenario .

In side my application i am trying to create VPN using RAS API . So i think this application taking the access to VPN . So that i gor error 633 ??

Presumably by ?normally? you mean by using one of the dial-up VPN protocols like PPTP. There are many VPN protocols and you would be wise to understand which one(s) you are trying to use. Typically, either UDP or GRE will be used as the encapsulation protocol, but the ports (if any) will vary depending on the application.

No matter what you are trying to do here, your first step should be to clarify your requirements since VPN as an acronym means only the use of some encapsulation protocol that may or may not provide security for inter domain network routing that probably uses the internet as a transport.

Sent from Mailhttps: for Windows 10

From: xxxxx@gmail.commailto:xxxxx
Sent: March 1, 2016 10:32 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] Error 633: when i connect VPN using my application

In side my application i am trying to create VPN using RAS API . So i think this application taking the access to VPN . So that i gor error 633 ??


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:></mailto:xxxxx></mailto:xxxxx></https:>

What, other than calling RASAPI as a ‘dialer’ application, does your code do with respect to VPN?

Do your provide a WAN Miniport as a novel way of transporting VPN encapsulation?

Cheers,
Dave Cattley

vinay, you’re conflicting yourself in your own posts which seriously hurts your chances of some help.

I am creating VPN in my system not in my application

In side my application i am trying to create VPN using RAS API

I would suggest creating an empty proof of concept project and having the following iterations.

  1. Creating and destroying a VPN adapter using RASAPI
  2. Connecting and disconnecting said adapter using RASAPI
  3. Integration into the wider solution you’re trying to build

This way you’ll be able to narrow down at what point things are going wrong. If something is going wrong @ 3 then you know it’s likely something in your wider solution rather than any particular RASAPI call.

Thanks for your valuable suggestions again .

This "Error 633: The modem (or other connecting device) is already in use or is not
configured properly. " error gone when i change INF values in filter driver INF file like :

[INSTALL.NDI]
HKR, Ndi, Service, 0, %MUXTUN.Name%
HKR, Ndi, CoServices, 0x00010000, %MUXTUN.Name%
HKR, Ndi, HelpText, 0, %MUXTUN.Description%
HKR, Ndi, FilterClass, , custom
HKR, Ndi, FilterType, 0x00010001, 0x00000002
HKR, Ndi\Interfaces, UpperRange, , “noupper”
HKR, Ndi\Interfaces, LowerRange, , “nolower”
HKR, Ndi\Interfaces, FilterMediaTypes, , “nolower, ethernet, wan”
HKR, Ndi, FilterRunType, 0x00010001, 1

to

[INSTALL.NDI]
HKR, Ndi, Service, 0, %MUXTUN.Name%
HKR, Ndi, CoServices, 0x00010000, %MUXTUN.Name%
HKR, Ndi, HelpText, 0, %MUXTUN.Description%
HKR, Ndi, FilterClass, , custom
HKR, Ndi, FilterType, 0x00010001, 0x00000002
HKR, Ndi\Interfaces, UpperRange, , “noupper”
HKR, Ndi\Interfaces, LowerRange, , “nolower”
HKR, Ndi\Interfaces, FilterMediaTypes, , “ethernet, wan”
HKR, Ndi, FilterRunType, 0x00010001, 1

I just removed no lower from filter INF file .

But after that when i connecting getting some other errors

““633: The modem (or other connecting device) is already in use or is not configured properly.””

and

“” 789: The L2TP connection attempt failed because the security layer encountered a processing error during initial negotiations with the remote computer. “”"

alternatively these errors getting ::

So will it the problems on adapter binding ???

any suggestions ?

What are you attempting to accomplish with an NDIS LWF in your target
scenario?

Where are you expecting to insert you LWF in the binding stack?

Between the upper-edge of NDISWAN and the lower-edge of TCPIP?

If so, then I strongly suggest you don’t do this unless you have a really
specific reason to do so and instead filter with WFP.

Good Luck,
Dave Cattley