int hungup(LPCTSTR szEntry) { if (ghRasConn != NULL) { RasHangUp(ghRasConn); Sleep(3000); ghRasConn = NULL; } RasDeleteEntry(NULL, szEntry); return 0; }
/* * XXX: currently only uses profile_name, not server_address */ int rashelper_delete_profiles(char *profile_name, char *server_address) { int rv; /* http://msdn2.microsoft.com/en-us/library/aa376739(VS.85).aspx */ rv = RasDeleteEntry(NULL, profile_name); if (rv == ERROR_SUCCESS) { return 1; } else { return 0; } }
// // RasCustomDeleteEntryNotify // // this export is the custom dial entry when RasDeleteEntry has been called by // an application - the call is forwarded to here and it is up to this // function then to handle the phonebook entry that is specified // extern "C" DWORD WINAPI RasCustomDeleteEntryNotify( LPCTSTR lpszPhonebook, LPCTSTR lpszEntry, DWORD dwFlags ) { DWORD rc = NO_ERROR; // return code OutputTraceString(L"RasCustomDeleteEntryNotify called in customdial.dll\n"); // just forward the request on - one could do more custom delete stuff here rc = RasDeleteEntry(lpszPhonebook, lpszEntry); OutputTraceString(L"RasCustomDeleteEntryNotify exiting customdial.dll with return code: %d\n"); return rc; }