RRAS service not stopping




I am facing the problem with the RRAS service. My code tries to open a
RAS connection. Before opeing the RAS connection it stops the RRAS
service and starts again. This logic iterates till the RAS connection
is not opened. Once the RAS connection is open it will not start and
stop the service. If the CDMA modem is not able to switch to 1xRTT
mode the RAS connection is closed. so the logic is as follows

timer ( 60 secs )

if ( RAS Connection is open )
if 1xRTT
close RAS
stop RRAS
start RRAS
open RAS

When the signal strength is low (this is my observation), This works
fine for 4-6 hours. after that the the code returns error while
opening the Ras connection. The RAS connection never opens. when I
cheked in the windows services, the Status of the Remote and Routing
Access service is stopping.

Error log
I am logging the error from the RAS API's into the event logs.
following is the summary of that log.
First error in the event log is "Error Code = 691 - Access was denied
because the username and/or password was invalid on the domain.".
After this error, the connection never opens and the event log
contains series of "The RPC server is too busy to complete this
operation." errors

Is there any way I can stop the RRAS service forcefully. As there are
many critical applications running on the computer I can not restart
the computeer.

My machine configuration
Windows XP embedded - SP2

Thanks in advance


Have you tried testing the app on regular XP Pro? Does the problem appear

You can certainly stop the RRAS service: "net stop RemoteAccess".


Have you tried testing the app on regular XP Pro? Does the problem appear

You can certainly stop the RRAS service: "net stop RemoteAccess".


- Show quoted text -

I am starting and stopping the service programmatically. So I use the
API's like OpenService and ControlService.
I could start and stop the service for some time (6-8 hrs in an
iterative loop) but after that the program stops and never start
again(fails in initial part), because the first step in the program is
to start the service.

If I see in the Services window, the status of the "Routing and Remote
Access" is "Stopping". Something wrong happened with the service.
I thought it takes some time to stop the service, but I waited for 2
hrs and it did not stop the service. The Stop button for the service
is disables. (all buttons are disabled)

I found the solution for this. Please validate if the solution is

There is an API QueryServiceStatusEx which returns a structure that
contains the PID of the process running under this service.
I can get the PID and kill the process.

Problem is, your application does not have the right to kill the
system process.
The solution for this is to change the access rights of your process
to "SeDebugPriviledge" and use the AdjustTokenPrivileges API to change
the access rights.

Now using the OpenProcess API and the PID we can get the handle of the
process and then use the TerminateProcess API to kill the process.
After you kill the process change the access rights of your
application to the original access rights. I hope changing the access
rights do not create any problems.

Since this problem is not easily re-producible, I could test this
solution couple of times and it worked.

Thanks and Regards

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question