Solved

RAS Server Error

Posted on 1998-08-24
4
216 Views
Last Modified: 2011-08-18
I have a program which at a certain time per day get initiated. All this program does is Shuts down the FTP, WWW and RAS Services, copies and appends all the IIS logs to one file, performs some logic to the log files and then starts the RAS, WWW and FTP service ( in that order).
Lately, once a week at random intervals, I get a RASSRV.EXE - Application Error on the NT Server 4.0 with option pack 3
The message further reads "The instruction at 0x77f88ob referenced memory at 0x00000018. The memory cannot be read.

I am using StopService() API  to Stop all services and StartService() API to start all the services. Ofcourse. a lot of other initialization is done before these API's are called.

Is this a known defect on NT Server RAS Services or is my program doing something wrong. This message usually appears when I am tryng to Start the RAS service. My Console program  is still in the wait loop for the RAS to start.

Appreciate all the help.
0
Comment
Question by:rian
  • 3
4 Comments
 
LVL 1

Accepted Solution

by:
gasim earned 50 total points
ID: 1171090
I have ran into similar problems stoping the RAS service and I finally gave up and used another approach to stop it and since you are running a console application then it will work for you as well.
You can Use CreateProcess API to execute the (net stop) and (net start) CMD commands. I have tried it and it works with no problems.
If you are interested in doing so below is the code for using (net stop):

#include <windows.h>

main()
{
      STARTUPINFO STARTUP_INFO;
      PROCESS_INFORMATION process_info;
      GetStartupInfo(&STARTUP_INFO);
      CreateProcess(0,"net stop \"ras server\"",0,0,FALSE,CREATE_NEW_CONSOLE,0,0,&STARTUP_INFO,&process_info);
      return;
}

0
 

Author Comment

by:rian
ID: 1171091
Thanks a lot. That worked.

0
 
LVL 1

Expert Comment

by:gasim
ID: 1171092
I'm gladd that it did.
Thank you
0
 
LVL 1

Expert Comment

by:gasim
ID: 1171093
I'm gladd that it did.
Thank you
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now