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.

71 lines
3.6 KiB

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