Solved

RAS not loading admin DLL

Posted on 1997-07-02
6
275 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Fox Pro commands 15 50
Where to obtain Oracle Data Provider for .NET 3.5 7 54
String manipulation in Visual Basic 7 73
What .NET URL re-routing tool did I use? 2 76
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…
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…
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…

830 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