en el siguiente codigo no me lee ni escriove correctamente ciertos valores de las estructura TheRasEntry , estos valores son en concreto :
TheRasEntry.dwRedialCount
TheRasEntry.dwRedialPause
, aunque si funciona
TheRasEntry.szLocalPhoneNumber,
mi codigo es el siguiente
String NombreConexion = BuscaPrimeraConexionConfigurada();
Código Delphi
[-]
DWORD dwLength, dwNumDispositivos;
BYTE bDeviceInfo = NULL;
DWORD dwDeviceInfoSize = sizeof(bDeviceInfo);
RASENTRY TheRasEntry;
ZeroMemory(&TheRasEntry, sizeof(TheRasEntry));
LPTSTR nombre = BuscaPrimeraConexionConfigurada().c_str();
DWORD dwEntrySize = 0;
DWORD a = 0;
DWORD b = 0;
int j = RasGetEntryProperties(NULL,NULL,0,&a,0,0);
int k = RasGetEntryProperties(NULL,NombreConexion.c_str(),0,&b,0,0);
TheRasEntry.dwSize = a;
int n = RasGetEntryProperties(NULL,NombreConexion.c_str(),&TheRasEntry,&b,0,0);
if (FListaTelefonos.Length > 0)
TheRasEntry.dwRedialCount = FNumeroReintentos;
TheRasEntry.dwRedialPause = FTiempoEntreReintentos;
DWORD fRet;
DWORD g = sizeof(TheRasEntry);
fRet = RasSetEntryProperties(NULL,NombreConexion.c_str() ,&TheRasEntry, g, NULL, 0);
if (fRet != 0)
throw Exception("Error :: RasSetEntryProperties");
// Añade el nombre de usuario y clave a la entrada creada