A module encapsulating the Windows Remote Access Service (RAS) API.
-
Creates a new phonebook entry. The function displays a dialog box into which the user can enter information about the entry.
-
Establishes a RAS connection to a RAS server.
-
Creates a new phonebook entry. The function displays a dialog box into which the user can enter information about the entry
-
Returns a list of tuples, one for each active connection.
-
Returns a list of tuples, one for each phonebook entry.
-
Returns a tuple with connection information.
-
Returns a tuple with the most recently set dial parameters for the specified entry.
-
Returns an error string for a RAS error code.
-
Terminates a remote access session.
-
Indicates if the given RAS handle is valid.
-
Sets the dial parameters for the specified entry.
-
Creates a new RASDIALEXTENSIONS object
win32ras.CreatePhonebookEntry
CreatePhonebookEntry(hWnd, fileName) Creates a new phonebook entry. The function displays a dialog box into which the user can enter information about the entry
-
hWnd : int
Handle to the parent window of the dialog box.
-
fileName=None : string
Specifies the filename of the phonebook entry. Currently this is ignored.
- Search for RasCreatePhonebookEntry at msdn, google or google groups.
win32ras.Dial
int, int = Dial(dialExtensions, fileName
, RasDialParams
, callback
) Establishes a RAS connection to a RAS server.
-
dialExtensions : PyRASDIALEXTENSIONS
An object providing the RASDIALEXTENSIONS information, or None
-
fileName : string
Specifies the filename of the phonebook entry, or None. Ignored on Win95.
-
RasDialParams : RASDIALPARAMS
A tuple describing a RASDIALPARAMS structure.
-
callback : method or hwnd
The method to be called when RAS events occur, or None. If not None, the function must have the signature of win32ras::RasDialFunc1
Note - this handle must be closed using win32ras::HangUp, or
else the RAS port will remain open, even after the program has terminated.
Your operating system may need rebooting to clean up otherwise!
- Search for RasDial at msdn, google or google groups.
The return value is (handle, retCode).
It is possible for a valid handle to be returned even on failure.
If the returned handle is = 0, then it can be assumed invalid.
win32ras.EditPhonebookEntry
EditPhonebookEntry(hWnd, fileName, entryName) Creates a new phonebook entry. The function displays a dialog box into which the user can enter information about the entry
-
hWnd : int
Handle to the parent window of the dialog box.
-
fileName : string
Specifies the filename of the phonebook entry, or None. Currently this is ignored.
-
entryName=None : string
Specifies the name of the phonebook entry to edit
- Search for RasEditPhonebookEntry at msdn, google or google groups.
win32ras.EnumConnections
list = EnumConnections() Returns a list of tuples, one for each active connection.
- Search for RasEnumConnections at msdn, google or google groups.
Each tuple is of format (handle, entryName, deviceType, deviceName)
win32ras.EnumEntries
EnumEntries(reserved, fileName) Returns a list of tuples, one for each phonebook entry.
-
reserved=None : string
Reserved - must be None
-
fileName=None : string
The name of the phonebook file, or None.
win32ras.GetConnectStatus
(int, int, string, string) = GetConnectStatus(hrasconn) Returns a tuple with connection information.
-
hrasconn : int
Handle to the RAS session.
-
Search for RasGetConnectStatus at msdn, google or google groups.
-
Search for RasGetConnectStatus at msdn, google or google groups.
win32ras.GetEntryDialParams
(s,s,s,s,s,s),i = GetEntryDialParams(fileName, entryName
) Returns a tuple with the most recently set dial parameters for the specified entry.
-
fileName : string
The filename of the phonebook, or None.
-
entryName : string
The name of the entry to retrieve the params for.
-
Search for RasGetEntryDialParams at msdn, google or google groups.
-
Search for RasGetConnectStatus at msdn, google or google groups.
The return value is a tuple describing the params retrieved, plus a BOOL integer
indicating if the password was also retrieved.
win32ras.GetErrorString
string = GetErrorString(error) Returns an error string for a RAS error code.
-
error : int
The error value being queried.
- Search for RasGetErrorString at msdn, google or google groups.
win32ras.HangUp
HangUp(hras) Terminates a remote access session.
-
hras : int
The handle to the RAS connection to be terminated.
- Search for RasHangUp at msdn, google or google groups.
win32ras.IsHandleValid
IsHandleValid(hras) Indicates if the given RAS handle is valid.
-
hras : int
The handle to the RAS connection being checked.
const win32ras.RASCS_AllDevicesConnected;
Constant for RAS state.
const win32ras.RASCS_AuthAck;
Constant for RAS state.
const win32ras.RASCS_AuthCallback;
Constant for RAS state.
const win32ras.RASCS_AuthChangePassword;
Constant for RAS state.
const win32ras.RASCS_AuthLinkSpeed;
Constant for RAS state.
const win32ras.RASCS_AuthNotify;
Constant for RAS state.
const win32ras.RASCS_AuthProject;
Constant for RAS state.
const win32ras.RASCS_AuthRetry;
Constant for RAS state.
const win32ras.RASCS_Authenticate;
Constant for RAS state.
const win32ras.RASCS_Authenticated;
Constant for RAS state.
const win32ras.RASCS_CallbackComplete;
Constant for RAS state.
const win32ras.RASCS_CallbackSetByCaller;
Constant for RAS state.
const win32ras.RASCS_ConnectDevice;
Constant for RAS state.
const win32ras.RASCS_Connected;
Constant for RAS state.
const win32ras.RASCS_DeviceConnected;
Constant for RAS state.
const win32ras.RASCS_Disconnected;
Constant for RAS state.
const win32ras.RASCS_Interactive;
Constant for RAS state.
const win32ras.RASCS_LogonNetwork;
Constant for RAS state.
const win32ras.RASCS_OpenPort;
Constant for RAS state.
const win32ras.RASCS_PasswordExpired;
Constant for RAS state.
const win32ras.RASCS_PortOpened;
Constant for RAS state.
const win32ras.RASCS_PrepareForCallback;
Constant for RAS state.
const win32ras.RASCS_Projected;
Constant for RAS state.
const win32ras.RASCS_ReAuthenticate;
Constant for RAS state.
const win32ras.RASCS_RetryAuthentication;
Constant for RAS state.
const win32ras.RASCS_StartAuthentication;
Constant for RAS state.
const win32ras.RASCS_WaitForCallback;
Constant for RAS state.
const win32ras.RASCS_WaitForModemReset;
Constant for RAS state.
RasDialFunc1()
A placeholder for a RAS callback.
Defined in: O:/SRC/PYWIN32/WIN32/SRC/WIN32RASMODULE.CPP
Certain RAS function require a callback function to be passed.
This description describes the signature of the function you pass
to these functions.
-
hrascon : int
The handle to the RAS session.
-
msg : int
A message code identifying the reason for the callback.
-
rascs : int
Connection state about to be entered.
-
error : int
The error state of the connection
-
extendedError : int
win32ras.SetEntryDialParams
SetEntryDialParams(fileName, RasDialParams, bSavePassword) Sets the dial parameters for the specified entry.
-
fileName : string
The filename of the phonebook, or None.
-
RasDialParams : (tuple)
A tuple describing a RASDIALPARAMS structure.
-
bSavePassword : int
Indicates whether to remove password from entry's parameters.
-
Search for RasSetEntryDialParams at msdn, google or google groups.
-
Search for RasGetConnectStatus at msdn, google or google groups.