Solved

RAS not loading admin DLL

Posted on 1997-07-02
6
269 Views
Last Modified: 2013-12-03
I have coded a RAS Admin DLL that exports only the function RasAdminGetIpAddressForUser(), but I can't seem to get RAS to start when the registry keys are added.  The registry keys are written as per instructions at http://www.microsoft.com/msdn/sdk/platforms/doc/sdk/win32/func/src/f69_19.htm, as follows:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RAS\AdminDll]
"DisplayName"="Trial IP DLL"
"DLLPath"="D:\\usermgr\\IPByPort.dll"

I've built the DLL (no errors, no warnings) using VC++5, and written a .DEF file that's included in the project as follows:

LIBRARY    IPByPort
DESCRIPTION "Assigns a fixed IP address by COM Port number"
EXPORTS
   RasAdminGetIpAddressForUser

So the question is - I'm fairly new to DLL programming, so this may well be simple - why doesn't RAS load it?  The error in the event log is event ID 20104, data 7f 00 00 00.
0
Comment
Question by:robinhood
  • 3
  • 2
6 Comments
 

Author Comment

by:robinhood
Comment Utility
Edited text of question
0
 
LVL 5

Expert Comment

by:y96andha
Comment Utility
You might need to create all functions. Try adding the rest of them as empty stubs.
0
 
LVL 15

Expert Comment

by:NickRepin
Comment Utility
Make sure your callback functions entries are declared with WINAPI, CALLBACK, APIENTRY or _stdcall modifiers.

Change your code and Rassapi.h to use the following function declarations:

DWORD APIENTRY RasAdminGetIpAddressForUser(
   ....);

Or, download the latest version of rassapi.h from http://www.microsoft.com/msdn/sdk/platforms/doc/sdk/headers/_winnt/c382_19.htm.

Also, there is the sample on the microsoft's sites which demonstrates the creation of a user's dll for RAS server. But I don't remember  exactly where it resides. But I have got a copy of it and I can send you if you want.

P.S. I'm unavailable to read a mail every day this month, so it's may be a delay with my answer.

0
Free Trending Threat Insights Every Day

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.

 

Author Comment

by:robinhood
Comment Utility
I've got the new rassapi.h already (came with VC++5) - at least, it has the correct (APIENTRY) definitions for the DLL functions. I've also found *a* (if not *the*) sample on MS's site, including both .exe and .dll code for RASSAPI functions.  Needless to say, neither of them even come close to compiling, but that's okay - I've checked the general coding structure that they've used, and it all seems to be the same as what I was trying.

The comment from y96andha might be the trick I'm looking for, and is the one difference between my project and that of the MS sample (except that mine builds :) - I'll give it a go and follow up here with how it works out.
0
 

Author Comment

by:robinhood
Comment Utility
The comment from y97andha is in fact the correct solution.

Sorry about the "F", Nick - ExEx haven't got their act together yet to enable the "Mark a comment as an answer...", so it wasn't that your answer was wrong, it just wasn't the solution to the problem.
0
 
LVL 5

Accepted Solution

by:
y96andha earned 140 total points
Comment Utility
I think Microsoft could have done better on the error message, to show what was really wrong. I read through the docs, and noted that there was nothing about what functions had to be implemented, and then that there would be a message in the event log if any function couldn't be loaded.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

771 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

10 Experts available now in Live!

Get 1:1 Help Now