Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

669 lines
20 KiB

  1. /*-----------------------------------------------------------------------------
  2. rnaapi.cpp
  3. Wrapper to softlink to RNAPH and RASAPI32.DLL
  4. Copyright (C) 1996 Microsoft Corporation
  5. All rights reserved.
  6. Authors:
  7. ChrisK ChrisKauffman
  8. History:
  9. 1/29/96 ChrisK Created
  10. 7/22/96 ChrisK Cleaned and formatted
  11. -----------------------------------------------------------------------------*/
  12. #include "pch.hpp"
  13. #include "globals.h"
  14. #if defined(WIN16)
  15. #include <memory.h>
  16. #endif
  17. static const TCHAR cszRASAPI32_DLL[] = TEXT("RASAPI32.DLL");
  18. static const TCHAR cszRNAPH_DLL[] = TEXT("RNAPH.DLL");
  19. static const TCHAR cszRAS16[] = TEXT("RASC16IE.DLL");
  20. static const CHAR cszRasValidateEntryNamePlain[] = "RasValidateEntryName";
  21. static const CHAR cszRasSetAutodialEnablePlain[] = "RasSetAutodialEnable";
  22. #ifdef UNICODE
  23. static const CHAR cszRasEnumDevices[] = "RasEnumDevicesW";
  24. static const CHAR cszRasValidateEntryName[] = "RasValidateEntryNameW";
  25. static const CHAR cszRasSetEntryProperties[] = "RasSetEntryPropertiesW";
  26. static const CHAR cszRasGetEntryProperties[] = "RasGetEntryPropertiesW";
  27. static const CHAR cszRasDeleteEntry[] = "RasDeleteEntryW";
  28. static const CHAR cszRasHangUp[] = "RasHangUpW";
  29. static const CHAR cszRasGetConnectStatus[] = "RasGetConnectStatusW";
  30. static const CHAR cszRasDial[] = "RasDialW";
  31. static const CHAR cszRasEnumConnections[] = "RasEnumConnectionsW";
  32. static const CHAR cszRasGetEntryDialParams[] = "RasGetEntryDialParamsW";
  33. static const CHAR cszRasGetCountryInfo[] = "RasGetCountryInfoW";
  34. static const CHAR cszRasSetEntryDialParams[] = "RasSetEntryDialParamsW";
  35. static const CHAR cszRasSetAutodialEnable[] = "RasSetAutodialEnableW";
  36. static const CHAR cszRasSetAutodialAddress[] = "RasSetAutodialAddressW";
  37. #else // UNICODE
  38. static const CHAR cszRasEnumDevices[] = "RasEnumDevicesA";
  39. static const CHAR cszRasValidateEntryName[] = "RasValidateEntryNameA";
  40. static const CHAR cszRasSetEntryProperties[] = "RasSetEntryPropertiesA";
  41. static const CHAR cszRasGetEntryProperties[] = "RasGetEntryPropertiesA";
  42. static const CHAR cszRasDeleteEntry[] = "RasDeleteEntryA";
  43. static const CHAR cszRasHangUp[] = "RasHangUpA";
  44. static const CHAR cszRasGetConnectStatus[] = "RasGetConnectStatusA";
  45. static const CHAR cszRasDial[] = "RasDialA";
  46. static const CHAR cszRasEnumConnections[] = "RasEnumConnectionsA";
  47. static const CHAR cszRasGetEntryDialParams[] = "RasGetEntryDialParamsA";
  48. static const CHAR cszRasGetCountryInfo[] = "RasGetCountryInfoA";
  49. static const CHAR cszRasSetEntryDialParams[] = "RasSetEntryDialParamsA";
  50. static const CHAR cszRasSetAutodialEnable[] = "RasSetAutodialEnableA";
  51. static const CHAR cszRasSetAutodialAddress[] = "RasSetAutodialAddressA";
  52. #endif // UNICODE
  53. #if defined(WIN16)
  54. // on Win3.x we have to call RasGetEntryProperties with a larger buffer than RASENTRY.
  55. // Who knows why. It isn't exactly the same bug as on NT, but similar. If the buffer
  56. // isn't larger, RasGetEntryProperties overwrites the buffer and eventually will
  57. // cause unexpected behavior such as GPFs and spontaeous reboots of the system.
  58. //
  59. #define RASENTRY_SIZE_PATCH 256
  60. #else
  61. // on NT we have to call RasGetEntryProperties with a larger buffer than RASENTRY.
  62. // This is a bug in WinNT4.0 RAS, that didn't get fixed.
  63. //
  64. #define RASENTRY_SIZE_PATCH (7 * sizeof(DWORD))
  65. #endif
  66. //+----------------------------------------------------------------------------
  67. //
  68. // Function: RNAAPI::RNAAPI
  69. //
  70. // Synopsis: Initialize class members and load DLLs
  71. //
  72. // Arguments: None
  73. //
  74. // Returns: None
  75. //
  76. // History: ChrisK Created 1/15/96
  77. //
  78. //-----------------------------------------------------------------------------
  79. RNAAPI::RNAAPI()
  80. {
  81. #if defined(WIN16)
  82. m_hInst = LoadLibrary(cszRAS16);
  83. m_hInst2 = NULL;
  84. #else
  85. m_hInst = LoadLibrary(cszRASAPI32_DLL);
  86. if (FALSE == IsNT ())
  87. {
  88. //
  89. // we only load RNAPH.DLL if it is not NT
  90. // MKarki (5/4/97) - Fix for Bug #3378
  91. //
  92. m_hInst2 = LoadLibrary(cszRNAPH_DLL);
  93. }
  94. else
  95. {
  96. m_hInst2 = NULL;
  97. }
  98. #endif
  99. m_fnRasEnumDeviecs = NULL;
  100. m_fnRasValidateEntryName = NULL;
  101. m_fnRasSetEntryProperties = NULL;
  102. m_fnRasGetEntryProperties = NULL;
  103. m_fnRasDeleteEntry = NULL;
  104. m_fnRasHangUp = NULL;
  105. m_fnRasGetConnectStatus = NULL;
  106. m_fnRasEnumConnections = NULL;
  107. m_fnRasDial = NULL;
  108. m_fnRasGetEntryDialParams = NULL;
  109. m_fnRasGetCountryInfo = NULL;
  110. m_fnRasSetEntryDialParams = NULL;
  111. m_fnRasSetAutodialEnable = NULL;
  112. #if !defined(WIN16)
  113. m_fnRasSetAutodialAddress = NULL;
  114. #endif
  115. }
  116. //+----------------------------------------------------------------------------
  117. //
  118. // Function: RNAAPI::~RNAAPI
  119. //
  120. // Synopsis: release DLLs
  121. //
  122. // Arguments: None
  123. //
  124. // Returns: None
  125. //
  126. // History: ChrisK Created 1/15/96
  127. //
  128. //-----------------------------------------------------------------------------
  129. RNAAPI::~RNAAPI()
  130. {
  131. //
  132. // Clean up
  133. //
  134. if (m_hInst) FreeLibrary(m_hInst);
  135. if (m_hInst2) FreeLibrary(m_hInst2);
  136. }
  137. //+----------------------------------------------------------------------------
  138. //
  139. // Function: RNAAPI::RasEnumDevices
  140. //
  141. // Synopsis: Softlink to RAS function
  142. //
  143. // Arguments: see RAS documentation
  144. //
  145. // Returns: see RAS documentation
  146. //
  147. // History: ChrisK Created 1/15/96
  148. //
  149. //-----------------------------------------------------------------------------
  150. DWORD RNAAPI::RasEnumDevices(LPRASDEVINFO lpRasDevInfo, LPDWORD lpcb,
  151. LPDWORD lpcDevices)
  152. {
  153. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  154. // Look for the API if we haven't already found it
  155. LoadApi(cszRasEnumDevices,(FARPROC*)&m_fnRasEnumDeviecs);
  156. if (m_fnRasEnumDeviecs)
  157. dwRet = (*m_fnRasEnumDeviecs) (lpRasDevInfo, lpcb, lpcDevices);
  158. return dwRet;
  159. }
  160. //+----------------------------------------------------------------------------
  161. //
  162. // Function: RNAAPI::LoadApi
  163. //
  164. // Synopsis: If the given function pointer is NULL, then try to load the API
  165. // from the first DLL, if that fails, try to load from the second
  166. // DLL
  167. //
  168. // Arguments: pszFName - the name of the exported function
  169. // pfnProc - point to where the proc address will be returned
  170. //
  171. // Returns: TRUE - success
  172. //
  173. // History: ChrisK Created 1/15/96
  174. //
  175. //-----------------------------------------------------------------------------
  176. BOOL RNAAPI::LoadApi(LPCSTR pszFName, FARPROC* pfnProc)
  177. {
  178. if (*pfnProc == NULL)
  179. {
  180. // Look for the entry point in the first DLL
  181. if (m_hInst)
  182. *pfnProc = GetProcAddress(m_hInst,pszFName);
  183. // if that fails, look for the entry point in the second DLL
  184. if (m_hInst2 && !(*pfnProc))
  185. *pfnProc = GetProcAddress(m_hInst2,pszFName);
  186. }
  187. return (pfnProc != NULL);
  188. }
  189. //+----------------------------------------------------------------------------
  190. //
  191. // Function: RNAAPI::RasGetConnectStatus
  192. //
  193. // Synopsis: Softlink to RAS function
  194. //
  195. // Arguments: see RAS documentation
  196. //
  197. // Returns: see RAS documentation
  198. //
  199. // History: ChrisK Created 7/16/96
  200. //
  201. //-----------------------------------------------------------------------------
  202. DWORD RNAAPI::RasGetConnectStatus(HRASCONN hrasconn,LPRASCONNSTATUS lprasconnstatus)
  203. {
  204. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  205. // Look for the API if we haven't already found it
  206. LoadApi(cszRasGetConnectStatus,(FARPROC*)&m_fnRasGetConnectStatus);
  207. if (m_fnRasGetConnectStatus)
  208. dwRet = (*m_fnRasGetConnectStatus) (hrasconn,lprasconnstatus);
  209. #if defined(WIN16) && defined(DEBUG)
  210. Dprintf("RasGetConnectStatus returned %lu\r\n", dwRet);
  211. #endif
  212. return dwRet;
  213. }
  214. //+----------------------------------------------------------------------------
  215. //
  216. // Function: RNAAPI::RasValidateEntryName
  217. //
  218. // Synopsis: Softlink to RAS function
  219. //
  220. // Arguments: see RAS documentation
  221. //
  222. // Returns: see RAS documentation
  223. //
  224. // History: ChrisK Created 1/15/96
  225. //
  226. //-----------------------------------------------------------------------------
  227. DWORD RNAAPI::RasValidateEntryName(LPTSTR lpszPhonebook,LPTSTR lpszEntry)
  228. {
  229. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  230. // Look for the API if we haven't already found it
  231. LoadApi(cszRasValidateEntryNamePlain,(FARPROC*)&m_fnRasValidateEntryName);
  232. LoadApi(cszRasValidateEntryName,(FARPROC*)&m_fnRasValidateEntryName);
  233. if (m_fnRasValidateEntryName)
  234. dwRet = (*m_fnRasValidateEntryName) (lpszPhonebook, lpszEntry);
  235. return dwRet;
  236. }
  237. //+----------------------------------------------------------------------------
  238. //
  239. // Function: RNAAPI::RasSetEntryProperties
  240. //
  241. // Synopsis: Softlink to RAS function
  242. //
  243. // Arguments: see RAS documentation
  244. //
  245. // Returns: see RAS documentation
  246. //
  247. // History: ChrisK Created 1/15/96
  248. //
  249. //-----------------------------------------------------------------------------
  250. DWORD RNAAPI::RasSetEntryProperties(LPTSTR lpszPhonebook, LPTSTR lpszEntry,
  251. LPBYTE lpbEntryInfo, DWORD dwEntryInfoSize,
  252. LPBYTE lpbDeviceInfo, DWORD dwDeviceInfoSize)
  253. {
  254. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  255. RASENTRY FAR *lpRE = NULL;
  256. // Look for the API if we haven't already found it
  257. LoadApi(cszRasSetEntryProperties,(FARPROC*)&m_fnRasSetEntryProperties);
  258. Assert(
  259. (NULL != lpbDeviceInfo) && (NULL != dwDeviceInfoSize)
  260. ||
  261. (NULL == lpbDeviceInfo) && (NULL == dwDeviceInfoSize)
  262. );
  263. #if !defined(WIN16)
  264. #define RASGETCOUNTRYINFO_BUFFER_SIZE 256
  265. // Only worry about valid countryCode and countryID if we're not dial-as-is
  266. if ( (0 == ((LPRASENTRY)lpbEntryInfo)->dwCountryCode) &&
  267. (((LPRASENTRY)lpbEntryInfo)->dwfOptions & RASEO_UseCountryAndAreaCodes) )
  268. {
  269. BYTE rasCI[RASGETCOUNTRYINFO_BUFFER_SIZE];
  270. LPRASCTRYINFO prasCI;
  271. DWORD dwSize;
  272. DWORD dw;
  273. prasCI = (LPRASCTRYINFO)rasCI;
  274. ZeroMemory(prasCI,sizeof(rasCI));
  275. prasCI->dwSize = sizeof(RASCTRYINFO);
  276. dwSize = sizeof(rasCI);
  277. Assert(((LPRASENTRY)lpbEntryInfo)->dwCountryID);
  278. prasCI->dwCountryID = ((LPRASENTRY)lpbEntryInfo)->dwCountryID;
  279. dw = RNAAPI::RasGetCountryInfo(prasCI,&dwSize);
  280. if (ERROR_SUCCESS == dw)
  281. {
  282. Assert(prasCI->dwCountryCode);
  283. ((LPRASENTRY)lpbEntryInfo)->dwCountryCode = prasCI->dwCountryCode;
  284. }
  285. else
  286. {
  287. AssertSz(0,"Unexpected error from RasGetCountryInfo.\r\n");
  288. }
  289. }
  290. #endif
  291. if (m_fnRasSetEntryProperties)
  292. dwRet = (*m_fnRasSetEntryProperties) (lpszPhonebook, lpszEntry,
  293. lpbEntryInfo, dwEntryInfoSize,
  294. lpbDeviceInfo, dwDeviceInfoSize);
  295. lpRE = (RASENTRY FAR*)lpbEntryInfo;
  296. #if !defined(WIN16)
  297. LclSetEntryScriptPatch(lpRE->szScript,lpszEntry);
  298. #endif
  299. return dwRet;
  300. }
  301. //+----------------------------------------------------------------------------
  302. //
  303. // Function: RNAAPI::RasGetEntryProperties
  304. //
  305. // Synopsis: Softlink to RAS function
  306. //
  307. // Arguments: see RAS documentation
  308. //
  309. // Returns: see RAS documentation
  310. //
  311. // History: ChrisK Created 1/15/96
  312. // jmazner 9/17/96 Modified to allow calls with buffers = NULL and InfoSizes = 0.
  313. // (Based on earlier modification to the same procedure in icwdial)
  314. // See RasGetEntryProperties docs to learn why this is needed.
  315. //
  316. //-----------------------------------------------------------------------------
  317. DWORD RNAAPI::RasGetEntryProperties(LPTSTR lpszPhonebook, LPTSTR lpszEntry,
  318. LPBYTE lpbEntryInfo, LPDWORD lpdwEntryInfoSize,
  319. LPBYTE lpbDeviceInfo, LPDWORD lpdwDeviceInfoSize)
  320. {
  321. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  322. LPBYTE lpbEntryInfoPatch = NULL;
  323. LPDWORD lpdwEntryInfoPatchSize = 0;
  324. #if (!defined(WIN16) && WINVER != 0x400)
  325. #error This was built with WINVER not equal to 0x400. The size of RASENTRY may not be valid.
  326. #endif
  327. if( (NULL == lpbEntryInfo) && (NULL == lpbDeviceInfo) )
  328. {
  329. Assert( NULL != lpdwEntryInfoSize );
  330. Assert( NULL != lpdwDeviceInfoSize );
  331. Assert( 0 == *lpdwEntryInfoSize );
  332. Assert( 0 == *lpdwDeviceInfoSize );
  333. // we're here to ask RAS what size these buffers need to be, don't use the patch stuff
  334. // (see RasGetEntryProperties docs)
  335. lpbEntryInfoPatch = lpbEntryInfo;
  336. lpdwEntryInfoPatchSize = lpdwEntryInfoSize;
  337. }
  338. else
  339. {
  340. Assert((*lpdwEntryInfoSize) >= sizeof(RASENTRY));
  341. Assert(lpbEntryInfo && lpdwEntryInfoSize);
  342. //
  343. // We are going to fake out RasGetEntryProperties by creating a slightly larger
  344. // temporary buffer and copying the data in and out.
  345. //
  346. lpdwEntryInfoPatchSize = (LPDWORD) GlobalAlloc(GPTR, sizeof(DWORD));
  347. if (NULL == lpdwEntryInfoPatchSize)
  348. return ERROR_NOT_ENOUGH_MEMORY;
  349. *lpdwEntryInfoPatchSize = (*lpdwEntryInfoSize) + RASENTRY_SIZE_PATCH;
  350. lpbEntryInfoPatch = (LPBYTE)GlobalAlloc(GPTR,*lpdwEntryInfoPatchSize);
  351. if (NULL == lpbEntryInfoPatch)
  352. return ERROR_NOT_ENOUGH_MEMORY;
  353. // RAS expects the dwSize field to contain the size of the LPRASENTRY struct
  354. // (used to check which version of the struct we're using) rather than the amount
  355. // of memory actually allocated to the pointer.
  356. #if defined(WIN16)
  357. //((LPRASENTRY)lpbEntryInfoPatch)->dwSize = ((LPRASENTRY)lpbEntryInfo)->dwSize;
  358. ((LPRASENTRY)lpbEntryInfoPatch)->dwSize = sizeof(RASENTRY);
  359. #else
  360. // RAS expects the dwSize field to contain the size of the LPRASENTRY struct
  361. // (used to check which version of the struct we're using) rather than the amount
  362. // of memory actually allocated to the pointer.
  363. //((LPRASENTRY)lpbEntryInfoPatch)->dwSize = dwEntryInfoPatch;
  364. ((LPRASENTRY)lpbEntryInfoPatch)->dwSize = sizeof(RASENTRY);
  365. #endif
  366. }
  367. // Look for the API if we haven't already found it
  368. LoadApi(cszRasGetEntryProperties,(FARPROC*)&m_fnRasGetEntryProperties);
  369. if (m_fnRasGetEntryProperties)
  370. dwRet = (*m_fnRasGetEntryProperties) (lpszPhonebook, lpszEntry,
  371. lpbEntryInfoPatch, lpdwEntryInfoPatchSize,
  372. lpbDeviceInfo, lpdwDeviceInfoSize);
  373. Dprintf(TEXT("ICWCONN2: RasGetEntryProperties returned %lu\r\n"), dwRet);
  374. if( NULL != lpbEntryInfo )
  375. {
  376. //
  377. // Copy out the contents of the temporary buffer UP TO the size of the original buffer
  378. //
  379. Assert(lpbEntryInfoPatch);
  380. memcpy(lpbEntryInfo,lpbEntryInfoPatch,*lpdwEntryInfoSize);
  381. GlobalFree(lpbEntryInfoPatch);
  382. lpbEntryInfoPatch = NULL;
  383. if( lpdwEntryInfoPatchSize )
  384. {
  385. GlobalFree( lpdwEntryInfoPatchSize );
  386. lpdwEntryInfoPatchSize = NULL;
  387. }
  388. //
  389. // We are again faking Ras functionality here by over writing the size value;
  390. // This is neccesary due to a bug in the NT implementation of RasSetEntryProperties
  391. *lpdwEntryInfoSize = sizeof(RASENTRY);
  392. }
  393. return dwRet;
  394. }
  395. //+----------------------------------------------------------------------------
  396. //
  397. // Function: RNAAPI::RasDeleteEntry
  398. //
  399. // Synopsis: Softlink to RAS function
  400. //
  401. // Arguments: see RAS documentation
  402. //
  403. // Returns: see RAS documentation
  404. //
  405. // History: ChrisK Created 1/15/96
  406. //
  407. //-----------------------------------------------------------------------------
  408. DWORD RNAAPI::RasDeleteEntry(LPTSTR lpszPhonebook, LPTSTR lpszEntry)
  409. {
  410. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  411. // Look for the API if we haven't already found it
  412. LoadApi(cszRasDeleteEntry,(FARPROC*)&m_fnRasDeleteEntry);
  413. if (m_fnRasDeleteEntry)
  414. dwRet = (*m_fnRasDeleteEntry) (lpszPhonebook, lpszEntry);
  415. return dwRet;
  416. }
  417. //+----------------------------------------------------------------------------
  418. //
  419. // Function: RNAAPI::RasHangUp
  420. //
  421. // Synopsis: Softlink to RAS function
  422. //
  423. // Arguments: see RAS documentation
  424. //
  425. // Returns: see RAS documentation
  426. //
  427. // History: ChrisK Created 1/15/96
  428. //
  429. //-----------------------------------------------------------------------------
  430. DWORD RNAAPI::RasHangUp(HRASCONN hrasconn)
  431. {
  432. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  433. // Look for the API if we haven't already found it
  434. LoadApi(cszRasHangUp,(FARPROC*)&m_fnRasHangUp);
  435. if (m_fnRasHangUp)
  436. {
  437. dwRet = (*m_fnRasHangUp) (hrasconn);
  438. #if !defined(WIN16)
  439. Sleep(3000);
  440. #endif
  441. }
  442. return dwRet;
  443. }
  444. // ############################################################################
  445. DWORD RNAAPI::RasDial(LPRASDIALEXTENSIONS lpRasDialExtensions,LPTSTR lpszPhonebook,
  446. LPRASDIALPARAMS lpRasDialParams, DWORD dwNotifierType,
  447. LPVOID lpvNotifier, LPHRASCONN lphRasConn)
  448. {
  449. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  450. // Look for the API if we haven't already found it
  451. LoadApi(cszRasDial,(FARPROC*)&m_fnRasDial);
  452. if (m_fnRasDial)
  453. {
  454. dwRet = (*m_fnRasDial) (lpRasDialExtensions,lpszPhonebook,lpRasDialParams,
  455. dwNotifierType,lpvNotifier,lphRasConn);
  456. }
  457. return dwRet;
  458. }
  459. // ############################################################################
  460. DWORD RNAAPI::RasEnumConnections(LPRASCONN lprasconn,LPDWORD lpcb,LPDWORD lpcConnections)
  461. {
  462. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  463. // Look for the API if we haven't already found it
  464. LoadApi(cszRasEnumConnections,(FARPROC*)&m_fnRasEnumConnections);
  465. if (m_fnRasEnumConnections)
  466. {
  467. dwRet = (*m_fnRasEnumConnections) (lprasconn,lpcb,lpcConnections);
  468. }
  469. return dwRet;
  470. }
  471. // ############################################################################
  472. DWORD RNAAPI::RasGetEntryDialParams(LPTSTR lpszPhonebook,LPRASDIALPARAMS lprasdialparams,
  473. LPBOOL lpfPassword)
  474. {
  475. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  476. // Look for the API if we haven't already found it
  477. LoadApi(cszRasGetEntryDialParams,(FARPROC*)&m_fnRasGetEntryDialParams);
  478. if (m_fnRasGetEntryDialParams)
  479. {
  480. dwRet = (*m_fnRasGetEntryDialParams) (lpszPhonebook,lprasdialparams,lpfPassword);
  481. }
  482. return dwRet;
  483. }
  484. //+----------------------------------------------------------------------------
  485. //
  486. // Function: RNAAPI::RasGetCountryInfo
  487. //
  488. // Synopsis: Softlink to RAS function
  489. //
  490. // Arguments: see RAS documentation
  491. //
  492. // Returns: see RAS documentation
  493. //
  494. // History: ChrisK Created 8/16/96
  495. //
  496. //-----------------------------------------------------------------------------
  497. DWORD RNAAPI::RasGetCountryInfo(LPRASCTRYINFO lprci, LPDWORD lpdwSize)
  498. {
  499. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  500. // Look for the API if we haven't already found it
  501. LoadApi(cszRasGetCountryInfo,(FARPROC*)&m_fnRasGetCountryInfo);
  502. if (m_fnRasGetCountryInfo)
  503. {
  504. dwRet = (*m_fnRasGetCountryInfo) (lprci,lpdwSize);
  505. }
  506. return dwRet;
  507. }
  508. //+----------------------------------------------------------------------------
  509. //
  510. // Function: RNAAPI::RasSetEntryDialParams
  511. //
  512. // Synopsis: Softlink to RAS function
  513. //
  514. // Arguments: see RAS documentation
  515. //
  516. // Returns: see RAS documentation
  517. //
  518. // History: ChrisK Created 8/20/96
  519. //
  520. //-----------------------------------------------------------------------------
  521. DWORD RNAAPI::RasSetEntryDialParams(LPTSTR lpszPhonebook,LPRASDIALPARAMS lprasdialparams,
  522. BOOL fRemovePassword)
  523. {
  524. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  525. // Look for the API if we haven't already found it
  526. LoadApi(cszRasSetEntryDialParams,(FARPROC*)&m_fnRasSetEntryDialParams);
  527. if (m_fnRasSetEntryDialParams)
  528. {
  529. dwRet = (*m_fnRasSetEntryDialParams) (lpszPhonebook,lprasdialparams,
  530. fRemovePassword);
  531. }
  532. return dwRet;
  533. }
  534. //+----------------------------------------------------------------------------
  535. //
  536. // Function: RNAAPI::RasSetAutodialEnable
  537. //
  538. // Synopsis: Softlink to RAS function
  539. //
  540. // Arguments: see RAS documentation
  541. //
  542. // Returns: see RAS documentation
  543. //
  544. // History: jmazner Created 10/8/96
  545. //
  546. //-----------------------------------------------------------------------------
  547. DWORD RNAAPI::RasSetAutodialEnable (DWORD dwDialingLocation, BOOL fEnabled)
  548. {
  549. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  550. // Look for the API if we haven't already found it
  551. LoadApi(cszRasSetAutodialEnablePlain,(FARPROC*)&m_fnRasSetAutodialEnable);
  552. if (m_fnRasSetAutodialEnable)
  553. {
  554. dwRet = (*m_fnRasSetAutodialEnable) (dwDialingLocation, fEnabled);
  555. }
  556. return dwRet;
  557. }
  558. #if !defined(WIN16)
  559. //+----------------------------------------------------------------------------
  560. //
  561. // Function: RNAAPI::RasSetAutodialAddress
  562. //
  563. // Synopsis: Softlink to RAS function
  564. //
  565. // Arguments: see RAS documentation
  566. //
  567. // Returns: see RAS documentation
  568. //
  569. // History: jmazner Created 10/8/96
  570. //
  571. //-----------------------------------------------------------------------------
  572. DWORD RNAAPI::RasSetAutodialAddress(LPTSTR lpszAddress,DWORD dwReserved, LPRASAUTODIALENTRY lpAutoDialEntries,
  573. DWORD dwcbAutoDialEntries,DWORD dwcAutoDialEntries)
  574. {
  575. DWORD dwRet = ERROR_DLL_NOT_FOUND;
  576. // Look for the API if we haven't already found it
  577. LoadApi(cszRasSetAutodialAddress,(FARPROC*)&m_fnRasSetAutodialAddress);
  578. if (m_fnRasSetAutodialAddress)
  579. {
  580. dwRet = (*m_fnRasSetAutodialAddress) (lpszAddress,dwReserved, lpAutoDialEntries,
  581. dwcbAutoDialEntries,dwcAutoDialEntries);
  582. }
  583. return dwRet;
  584. }
  585. #endif