Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Apple RAS PPP SDK error (-5835 ERR_DAMAGED - "The ARA file has be en modified;")



Hi all,

[Mac OS 9, Open Transport 2.6, CodeWarrior 6.0]

I have found a way to achieve what I originally wanted to do: create a Mac
Dialer RAS
based app (an application that given: username, passw, phone number, etc.
could directly
dial the modem and establish a PPP connection for accessing a special
secured web site).

To start testing what I found to achieve this, I created a "Remote Access
Document"
(entered to Remote Access and exported a valid tested configuration). Later
using the Apple
Remote Access API snippet that you can find bellow (Found in the latest Open
Transport SDK
2.6) tried to establish the same connection from C code. The point is that
when I call
DoConnect() specifically the function "MorePBRemoteAccess" (this function
taken from
MoreInterfacesLib sources in the MoreNetworkSetup sample Mac networking
code) the
connectPB.CONNECT.ioResult returns the following error:

-5835 ERR_DAMAGED - The ARA file has been modified;

Sincerely I haven't found further doc about it, neither have the slightest
idea of what
its supposed to mean. Would greatly appreciate if anyone could help me on
this one.

ONLY a guess... could this error be due to I have installed older run-time
version
of the OT libraries??? How I see what version of the runtime libraries I
currently have
installed and where I could find the new ones???

Best Regards,
Giovanni

BTW: Does anyone have information regarding to the original function
PBRemoteAccess??? was
supposed to be included in the libraries of the OT SDK but I didn't find it
ANYWHERE!
was getting linker errors with it until I found the MorePBRemoteAccess...

And just to add... while Apple doesn't improve their support and
documentation THEY INDEED WILL
NEVER GET A FOOT AHEAD MICRSOFT!!!

CAppleRAS::CAppleRAS() { }

CAppleRAS::~CAppleRAS() { }

void CAppleRAS::LoadRemoteAccess()
{
TRemoteAccessParamBlock loadPB;

loadPB.LOAD.csCode = RAM_EXTENDED_CALL; // extended call
loadPB.LOAD.resultStrPtr = nil; // result string
loadPB.LOAD.extendedType = (char*)REMOTEACCESSNAME; // to remote access
loadPB.LOAD.extendedCode = CmdRemoteAccess_Load; // try to load
MorePBRemoteAccess(&loadPB, false); // issue sync call

if (loadPB.LOAD.ioResult)
{
Str255 numberAsString;
NumToString(loadPB.LOAD.ioResult,numberAsString);
MessageBox("\pError", numberAsString);
ExitToShell();
}
} // LoadRemoteAccess

void CAppleRAS::UnloadRemoteAccess()
{
TRemoteAccessParamBlock unloadPB;

// unload the code (will not actually go away till this connection is
done)
unloadPB.UNLOAD.csCode = RAM_EXTENDED_CALL; // extended call
unloadPB.UNLOAD.resultStrPtr = nil; // result string
unloadPB.UNLOAD.extendedType = (char*)REMOTEACCESSNAME; // to remote
access
unloadPB.UNLOAD.extendedCode = CmdRemoteAccess_Unload; // try to unload
MorePBRemoteAccess(&unloadPB, false); // issue sync call

if (unloadPB.UNLOAD.ioResult)
{
Str255 numberAsString;
NumToString(unloadPB.UNLOAD.ioResult,numberAsString);
MessageBox("\pError", numberAsString);
ExitToShell();
}
} // UnloadRemoteAccess

void CAppleRAS::DoConnect()
{
TRemoteAccessParamBlock connectPB;
Str255 PathName;

strcpy((char*)PathName,(char*)"\pMacintosh HD:Sviluppo:Metrowerks
CodeWarrior 6.0:Projects:GNDialer:GNDialerRASConfg");

// Test if we can actually get the file...
FSSpec fileSpec;
OSErr err = FSMakeFSSpec(0,0,PathName,&fileSpec);

LoadRemoteAccess(); // Get the Remote Access Manager

// loaded
connectPB.CONNECT.csCode = RAM_EXTENDED_CALL; //
extended call
connectPB.CONNECT.resultStrPtr = NULL; // don't
want result strings
connectPB.CONNECT.extendedType = (char*)REMOTEACCESSNAME; // to
Remote Access
connectPB.CONNECT.extendedCode = CmdRemoteAccess_DoConnect; //
connect command
connectPB.CONNECT.portGlobalsPtr = nil; // use
the user port
connectPB.CONNECT.fileInfo.vRefNum = 0; // Use
the full pathname
connectPB.CONNECT.fileInfo.parID = 0;
strcpy((char*)&connectPB.CONNECT.fileInfo.name,(char*)&PathName); // copy
the string to fileInfo.name

// Ask for password if needed, use connection document, & show connection
status
connectPB.CONNECT.optionFlags = kNSCanInteract | kNSConnectDocument |
kNSShowStatus
| kNS2SavvyFlags // Use the 2.0 flags below
| kNSAR2Connection // connection to a 2.0 server
| kNSNotifyWhileConnected; // displaying
notification icon

MorePBRemoteAccess(&connectPB, false); // issue sync call

if (connectPB.CONNECT.ioResult)
{
Str255 numberAsString;
NumToString(connectPB.CONNECT.ioResult,numberAsString);
MessageBox("\pError", numberAsString);
ExitToShell();
}

UnloadRemoteAccess(); // Unload when disconnected.
} // DoConnect




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.