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.

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