Mailing Lists: Apple Mailing Lists

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

PBRemoteAccess function...



Hi all,

Can anyone tell me where to find the implementation of PBRemoteAccess
function??? I mean what is the library?

and/or why is it that this snippet works for loading ARA:

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();
}

and fails with this next call to Connect to a saved PPP config with the
error -5835 ERR_DAMAGED - "The ARA file has been modified;")???

TRemoteAccessParamBlock connectPB;
Str255 PathName;

strcpy((char*)PathName,(char*)"\pMacintosh HD: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;
connectPB.CONNECT.resultStrPtr = NULL;
connectPB.CONNECT.extendedType = (char*)REMOTEACCESSNAME
connectPB.CONNECT.extendedCode = CmdRemoteAccess_DoConnect;
connectPB.CONNECT.portGlobalsPtr = nil;
connectPB.CONNECT.fileInfo.vRefNum = 0;
connectPB.CONNECT.fileInfo.parID = 0;

strcpy((char*)&connectPB.CONNECT.fileInfo.name,(char*)&PathName);

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

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

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


Regards,
Giovanni




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.