Solved

RAS not loading admin DLL

Posted on 1997-07-02
6
271 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
ID: 1399952
Edited text of question
0
 
LVL 5

Expert Comment

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

Expert Comment

by:NickRepin
ID: 1399954
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:robinhood
ID: 1399955
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
ID: 1399956
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
ID: 1399957
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
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…
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…

863 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

20 Experts available now in Live!

Get 1:1 Help Now