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.

93 lines
4.2 KiB

  1. // ############################################################################
  2. #if !defined(WIN16)
  3. #define RASAPI_LIBRARY TEXT("RASAPI32.DLL")
  4. #define RNAPH_LIBRARY TEXT("RNAPH.DLL")
  5. #else
  6. #define RASAPI_LIBRARY "rasc16ie.dll"
  7. #endif
  8. #define RASAPI_RASSETENTRY "RasSetEntryPropertiesA"
  9. #define RASAPI_RASGETENTRY "RasGetEntryPropertiesA"
  10. #define RASAPI_RASDELETEENTRY "RasDeleteEntryA"
  11. // ############################################################################
  12. typedef DWORD (WINAPI* PFNRASENUMDEVICES)(LPRASDEVINFO lpRasDevInfo, LPDWORD lpcb, LPDWORD lpcDevices);
  13. typedef DWORD (WINAPI* PFNRASVALIDATEENTRYNAE)(LPTSTR lpszPhonebook, LPTSTR lpszEntry);
  14. typedef DWORD (WINAPI* PFNRASSETENTRYPROPERTIES)(LPTSTR lpszPhonebook, LPTSTR lpszEntry, LPBYTE lpbEntryInfo, DWORD dwEntryInfoSize, LPBYTE lpbDeviceInfo, DWORD dwDeviceInfoSize);
  15. typedef DWORD (WINAPI* PFNRASGETENTRYPROPERTIES)(LPTSTR lpszPhonebook, LPTSTR lpszEntry, LPBYTE lpbEntryInfo, LPDWORD lpdwEntryInfoSize, LPBYTE lpbDeviceInfo, LPDWORD lpdwDeviceInfoSize);
  16. typedef DWORD (WINAPI* PFNRASDELETEENTRY)(LPTSTR lpszPhonebook, LPTSTR lpszEntry);
  17. typedef DWORD (WINAPI* PFNRASHANGUP)(HRASCONN);
  18. typedef DWORD (WINAPI* PFNRASENUMCONNECTIONS)(LPRASCONN, LPDWORD, LPDWORD);
  19. typedef DWORD (WINAPI* PFNRASDIAL)(LPRASDIALEXTENSIONS,LPTSTR,LPRASDIALPARAMS,DWORD,LPVOID,LPHRASCONN);
  20. typedef DWORD (WINAPI* PFNRASGETENTRYDIALPARAMS)(LPTSTR,LPRASDIALPARAMS,LPBOOL);
  21. typedef DWORD (WINAPI* PFNRASGETCONNECTSTATUS)(HRASCONN,LPRASCONNSTATUS);
  22. typedef DWORD (WINAPI* PFNRASGETCOUNTRYINFO)(LPRASCTRYINFO,LPDWORD);
  23. typedef DWORD (WINAPI* PFNRASSETENTRYDIALPARAMS)(LPTSTR,LPRASDIALPARAMS,BOOL);
  24. typedef DWORD (WINAPI* PFNRASSETAUTODIALENABLE)(DWORD dwDialingLocation, BOOL fEnabled);
  25. #ifndef WIN16
  26. typedef DWORD (WINAPI* PFNRASSETAUTODIALADDRESS)(LPTSTR lpszAddress,DWORD dwReserved, LPRASAUTODIALENTRY lpAutoDialEntries,
  27. DWORD dwcbAutoDialEntries,DWORD dwcAutoDialEntries);
  28. #endif
  29. // ############################################################################
  30. class RNAAPI
  31. {
  32. public:
  33. RNAAPI();
  34. ~RNAAPI();
  35. DWORD RasEnumDevices(LPRASDEVINFO, LPDWORD, LPDWORD);
  36. DWORD RasValidateEntryName(LPTSTR,LPTSTR);
  37. DWORD RasSetEntryProperties(LPTSTR lpszPhonebook, LPTSTR lpszEntry,
  38. LPBYTE lpbEntryInfo, DWORD dwEntryInfoSize,
  39. LPBYTE lpbDeviceInfo, DWORD dwDeviceInfoSize);
  40. DWORD RasGetEntryProperties(LPTSTR lpszPhonebook, LPTSTR lpszEntry,
  41. LPBYTE lpbEntryInfo, LPDWORD lpdwEntryInfoSize,
  42. LPBYTE lpbDeviceInfo, LPDWORD lpdwDeviceInfoSize);
  43. DWORD RasDeleteEntry(LPTSTR lpszPhonebook, LPTSTR lpszEntry);
  44. DWORD RasHangUp(HRASCONN hrasconn);
  45. DWORD RasGetEntryDialParams(LPTSTR lpszPhonebook,LPRASDIALPARAMS lprasdialparams,
  46. LPBOOL lpfPassword);
  47. DWORD RasDial(LPRASDIALEXTENSIONS lpRasDialExtensions,LPTSTR lpszPhonebook,
  48. LPRASDIALPARAMS lpRasDialParams,DWORD dwNotifierType,LPVOID lpvNotifier,
  49. LPHRASCONN lphRasConn);
  50. DWORD RasEnumConnections(LPRASCONN lprasconn,LPDWORD lpcb,LPDWORD lpcConnections);
  51. DWORD RasGetConnectStatus(HRASCONN, LPRASCONNSTATUS);
  52. DWORD RasGetCountryInfo(LPRASCTRYINFO, LPDWORD);
  53. DWORD RasSetEntryDialParams(LPTSTR,LPRASDIALPARAMS,BOOL);
  54. DWORD RasSetAutodialEnable (DWORD dwDialingLocation, BOOL fEnabled);
  55. #ifndef WIN16
  56. DWORD RasSetAutodialAddress(LPTSTR lpszAddress,DWORD dwReserved, LPRASAUTODIALENTRY lpAutoDialEntries,
  57. DWORD dwcbAutoDialEntries,DWORD dwcAutoDialEntries);
  58. #endif
  59. private:
  60. BOOL LoadApi(LPCSTR, FARPROC*);
  61. HINSTANCE m_hInst;
  62. HINSTANCE m_hInst2;
  63. PFNRASENUMDEVICES m_fnRasEnumDeviecs;
  64. PFNRASVALIDATEENTRYNAE m_fnRasValidateEntryName;
  65. PFNRASSETENTRYPROPERTIES m_fnRasSetEntryProperties;
  66. PFNRASGETENTRYPROPERTIES m_fnRasGetEntryProperties;
  67. PFNRASDELETEENTRY m_fnRasDeleteEntry;
  68. PFNRASHANGUP m_fnRasHangUp;
  69. PFNRASENUMCONNECTIONS m_fnRasEnumConnections;
  70. PFNRASDIAL m_fnRasDial;
  71. PFNRASGETENTRYDIALPARAMS m_fnRasGetEntryDialParams;
  72. PFNRASGETCONNECTSTATUS m_fnRasGetConnectStatus;
  73. PFNRASGETCOUNTRYINFO m_fnRasGetCountryInfo;
  74. PFNRASSETENTRYDIALPARAMS m_fnRasSetEntryDialParams;
  75. PFNRASSETAUTODIALENABLE m_fnRasSetAutodialEnable;
  76. #ifndef WIN16
  77. PFNRASSETAUTODIALADDRESS m_fnRasSetAutodialAddress;
  78. #endif
  79. };