Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

The Cursed RAS API

Posted on 1999-09-27
7
Medium Priority
?
424 Views
Last Modified: 2013-12-03
Hi all,

I am trying to programatically create a PPP/TCP DUN profile for win95 and NT. RasSetEntryProperties() seems like the way to go, but I can't get it to work. It returns an error code that isn't in the range of error codes described in the documentation or in raserror.h...any ideas what I may be doing wrong? I'd appreciate any suggestions you may have.
0
Comment
Question by:salmalux
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 

Author Comment

by:salmalux
ID: 2079699
Edited text of question.
0
 
LVL 23

Expert Comment

by:chensu
ID: 2079712
What's the error code? Post your code please.
0
 

Author Comment

by:salmalux
ID: 2079731
Here you go...

//start code

RASENTRY RasProps;
RASDEVINFO Modems[20];
DWORD dwBufSize = 1024;
DWORD dwResult = 0;
DWORD dwBytesWritten = 0;

ZeroMemory(&RasProps, sizeof(RASENTRY));
Modems->dwSize = sizeof(RASDEVINFO);

dwResult = RasEnumDevices(Modems, &dwBufSize, &dwBytesWritten);  //enum the modems

//set up RASENTRY struct
RasProps.dwSize = sizeof(RASENTRY);
strcpy(RasProps.szLocalPhoneNumber,"5555555");
RasProps.dwfNetProtocols = RASNP_Ip;
RasProps.dwFramingProtocol = RASFP_Ppp;
strcpy(RasProps.szDeviceType, "RASDT_Modem");
strcpy(RasProps.szDeviceName, Modems[0].szDeviceName);
      
dwResult = RasSetEntryProperties(NULL, "profile", &RasProps, sizeof(RASENTRY),NULL, 0);

//end code

for some reason, RasSetEntryProperties() returns "87" instead of a RAS error (in the 600's). Any ideas? I'll raise points if there's a way to do it *without* using any TAPI stuff (like lineGetDevConfig) =)


0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

Author Comment

by:salmalux
ID: 2079733
The RasEnumDevices function works fine and correctly lists my modem(s)...FYI
0
 
LVL 23

Accepted Solution

by:
chensu earned 1500 total points
ID: 2079751
Try using RasGetEntryProperties to retrieve the existing properties and only change the needed members.

HOWTO: Set Device Configuration for RAS Phonebook Entry
http://support.microsoft.com/support/kb/articles/Q163/2/36.asp
0
 

Author Comment

by:salmalux
ID: 2079782
Good idea, except I want to create the profile from scratch...perhaps I can find a workaround
0
 

Author Comment

by:salmalux
ID: 2079800
whoa, I think I got it... I changed
strcpy(RasProps.szDeviceType, "RASDT_Modem");

to

strcpy(RasProps.szDeviceType, "modem");

and I get an error code of "0" and the profile shows up in the registry. Let me verify and I'll give ya the points tomorrow...thanks!

0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

661 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