не в тему, но добавлю (завалялось) коннект-дисконнект впн. синтаксис простой: имя_соединения, логин, пасс Code: //--------------------------------------------------------------------------- HRASCONN connect_VPN(wchar_t* conn_name, wchar_t* szUser, wchar_t* szPass) { RASDIALPARAMSW dial_params; HRASCONN connection; memset(&dial_params, 0, sizeof(dial_params)); dial_params.dwSize = sizeof(RASDIALPARAMSW); lstrcpyW(dial_params.szEntryName, conn_name); lstrcpyW(dial_params.szUserName, szUser); lstrcpyW(dial_params.szPassword, szPass); connection = NULL; if(RasDialW(NULL, NULL, &dial_params, 0, NULL, &connection) == ERROR_SUCCESS) { return connection; } return NULL; } //--------------------------------------------------------------------------- void disconnect_VPN(wchar_t* conn_name) { DWORD dwCb = 0; DWORD dwRet = ERROR_SUCCESS; DWORD dwConnections = 0; LPRASCONNW lpRasConn = NULL; dwRet = RasEnumConnectionsW(lpRasConn, &dwCb, &dwConnections); if (dwRet == ERROR_BUFFER_TOO_SMALL){ lpRasConn = (LPRASCONNW) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwCb); lpRasConn[0].dwSize = sizeof(RASCONN); dwRet = RasEnumConnectionsW(lpRasConn, &dwCb, &dwConnections); if (ERROR_SUCCESS == dwRet) for (DWORD i = 0; i < dwConnections; i++) if(!lstrcmpW(lpRasConn[i].szEntryName, conn_name)) { RasHangUp(lpRasConn[i].hrasconn); break; } //Deallocate memory for the connection buffer HeapFree(GetProcessHeap(), 0, lpRasConn); lpRasConn = NULL; } }