Solved

RAS not loading admin DLL

Posted on 1997-07-02
6
276 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
[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
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 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