Solved

[RAS] detecting installation

Posted on 1998-02-04
3
320 Views
Last Modified: 2013-12-03
How do you detect a RAS installation?
The current method I'm using is to connect to the DLL, and see if a rasEnumDevices call returns ok.
But If I install and then un-install RAS on a system, this will method will still return "true", while it should return false.
Any ideas?
0
Comment
Question by:lowlevel
3 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 200 total points
ID: 1410856
Under NT (which I assume you're talking about since Win95 uses DUN and not RAS), check for the existence of the following registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NdisWan

If it's there, RAS there is an instance of the RAS service installed.  If not, it's not.  If you check:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\RemoteAccess

you can tell if the RAS software has been installed but not configured.
0
 
LVL 1

Author Comment

by:lowlevel
ID: 1410857
I actually was looking for the win95 solution aswell..
anyway, with your help I was able to figure it out myself (took me about 30 minutes, that's why the D grade) and it now works.

just to be complete, a delphi function that'll do the trick:

function rasInstalled : boolean;
var osi : tOSVersionInfo;
    reg : tRegistry;
begin
  osi.dwOSVersionInfoSize:=sizeof(tOSVersionInfo);
  getVersionEx (osi);

  reg:=tRegistry.create;
  reg.rootkey:=hkey_local_machine;
  case osi.dwPlatformID of    //
    VER_PLATFORM_WIN32S        : result:=false; //win32s = win 3 = no RAS
    VER_PLATFORM_WIN32_WINDOWS : result:=reg.openkey ('\system\currentcontrolset\services\remoteAccess\networkprovider',false);
    VER_PLATFORM_WIN32_NT      : result:=reg.openkey ('\system\currentcontrolset\services\remoteaccess',false);
  end;    //case
  reg.free;
end;

0
 

Expert Comment

by:ljadams
ID: 1410858
As you may know, on NT you may also configure your modems for Dialing out, Receiving calls, or both. In your Network control panel, click on the Services tab, select Remote Access Service, click properties, select a modem (you may have to add a modem, if there are none to select), then click Configure.  If your only modem is configured to Receive calls only, then any calls to rasDial could result in an unhandled exception.  RasEnumDevices still returns this modem as a valid device.  Thus, on NT, you may also have to check for keys under the registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AsyncMac\Parameters
I would get a list of all of the subkeys (Some of them are DialinIP, DialoutIP, DialinoutIPX, DialoutNBF), and for any that contain the phrase "out" (you can use a strstr function to do this), check the value of that key.  If there are no "out" keys with their value set to TRUE, you can be pretty well assured that no modems are configured for dialing out using RAS. I have tested this using two different modems connected to two separate ports, and this works great on NT for detecting when neither modem is configured for dialing out.  Win95 is different, but as far as I know, you cannot configure your modem on Win95 to only receive calls.

Note: The information above represents my own opinions and knowlege based on my limited experience, and are not necessarily shared by Intel Corp.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How Does Quick Books store date / time? 3 97
Why I am having this error installing Visual Basic Enterprise 11 60
WPF issue with Trigger 2 107
Trouble with References... 5 54
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

809 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