Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

RAS not loading admin DLL

Posted on 1997-07-02
6
Medium Priority
?
280 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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

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 420 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

636 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