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.

128 lines
5.9 KiB

  1. #ifndef _RASHELP_H_
  2. #define _RASHELP_H_
  3. #include <ras.h>
  4. #include <raserror.h>
  5. BOOL RasIsInstalled();
  6. //----- RAS function prototypes -----
  7. // NOTE: (andrewgu) W versions of RAS apis are not implemented on Win9x platforms.
  8. // used by CloseRasConnections() in the branding dll
  9. typedef DWORD (WINAPI* RASENUMCONNECTIONSA)(LPRASCONNA, LPDWORD, LPDWORD);
  10. typedef DWORD (WINAPI* RASHANGUPA)(HRASCONN);
  11. typedef DWORD (WINAPI* RASGETCONNECTSTATUSA)(HRASCONN, LPRASCONNSTATUSA);
  12. // used by ProcessConnectionSettingsDeletion() in the branding dll
  13. typedef DWORD (WINAPI* RASENUMENTRIESA)(LPCSTR, LPCSTR, LPRASENTRYNAMEA, LPDWORD, LPDWORD);
  14. typedef DWORD (WINAPI* RASENUMENTRIESW)(LPCWSTR, LPCWSTR, LPRASENTRYNAMEW, LPDWORD, LPDWORD);
  15. typedef DWORD (WINAPI* RASDELETEENTRYA)(LPCSTR, LPCSTR);
  16. typedef DWORD (WINAPI* RASDELETEENTRYW)(LPCWSTR, LPCWSTR);
  17. // used by ProcessConnectionSettings() and lcy50_ProcessConnectionSettings() in the branding dll
  18. typedef DWORD (WINAPI* RASENUMDEVICESA)(LPRASDEVINFOA, LPDWORD, LPDWORD);
  19. typedef DWORD (WINAPI* RASENUMDEVICESW)(LPRASDEVINFOW, LPDWORD, LPDWORD);
  20. // used by ImportConnectSet() in the engine dll
  21. typedef DWORD (WINAPI* RASGETENTRYPROPERTIESA)(LPCSTR, LPCSTR, LPRASENTRYA, LPDWORD, LPBYTE, LPDWORD);
  22. typedef DWORD (WINAPI* RASGETENTRYPROPERTIESW)(LPCWSTR, LPCWSTR, LPRASENTRYW, LPDWORD, LPBYTE, LPDWORD);
  23. // used by ImportConnectSet() in the engine dll
  24. typedef DWORD (WINAPI* RASGETENTRYDIALPARAMSA)(LPCSTR, LPRASDIALPARAMSA, LPBOOL);
  25. typedef DWORD (WINAPI* RASGETENTRYDIALPARAMSW)(LPCWSTR, LPRASDIALPARAMSW, LPBOOL);
  26. // used by lcy50_ProcessConnectionSettings() and importRasSettings() in the branding dll
  27. typedef DWORD (WINAPI* RASSETENTRYPROPERTIESA)(LPCSTR, LPCSTR, LPRASENTRYA, DWORD, LPBYTE, DWORD);
  28. typedef DWORD (WINAPI* RASSETENTRYPROPERTIESW)(LPCWSTR, LPCWSTR, LPRASENTRYW, DWORD, LPBYTE, DWORD);
  29. // used by importRasCredentialsSettings() in the branding dll
  30. typedef DWORD (WINAPI* RASSETENTRYDIALPARAMSA)(LPCSTR, LPRASDIALPARAMSA, BOOL);
  31. typedef DWORD (WINAPI* RASSETENTRYDIALPARAMSW)(LPCWSTR, LPRASDIALPARAMSW, BOOL);
  32. //----- Global RAS function pointers -----
  33. extern RASENUMCONNECTIONSA g_pfnRasEnumConnectionsA;
  34. extern RASHANGUPA g_pfnRasHangupA;
  35. extern RASGETCONNECTSTATUSA g_pfnRasGetConnectStatusA;
  36. extern RASENUMENTRIESA g_pfnRasEnumEntriesA;
  37. extern RASENUMENTRIESW g_pfnRasEnumEntriesW;
  38. extern RASDELETEENTRYA g_pfnRasDeleteEntryA;
  39. extern RASDELETEENTRYW g_pfnRasDeleteEntryW;
  40. extern RASENUMDEVICESA g_pfnRasEnumDevicesA;
  41. extern RASENUMDEVICESW g_pfnRasEnumDevicesW;
  42. extern RASGETENTRYPROPERTIESA g_pfnRasGetEntryPropertiesA;
  43. extern RASGETENTRYPROPERTIESW g_pfnRasGetEntryPropertiesW;
  44. extern RASGETENTRYDIALPARAMSA g_pfnRasGetEntryDialParamsA;
  45. extern RASGETENTRYDIALPARAMSW g_pfnRasGetEntryDialParamsW;
  46. extern RASSETENTRYPROPERTIESA g_pfnRasSetEntryPropertiesA;
  47. extern RASSETENTRYPROPERTIESW g_pfnRasSetEntryPropertiesW;
  48. extern RASSETENTRYDIALPARAMSA g_pfnRasSetEntryDialParamsA;
  49. extern RASSETENTRYDIALPARAMSW g_pfnRasSetEntryDialParamsW;
  50. //----- RasPrepareApis -----
  51. #define RPA_UNLOAD 0x00000000
  52. #define RPA_RASENUMCONNECTIONSA 0x00000001
  53. #define RPA_RASHANGUPA 0x00000002
  54. #define RPA_RASGETCONNECTSTATUSA 0x00000004
  55. #define RPA_RASENUMENTRIESA 0x00000008
  56. #define RPA_RASENUMENTRIESW 0x00000010
  57. #define RPA_RASDELETEENTRYA 0x00000020
  58. #define RPA_RASDELETEENTRYW 0x00000040
  59. #define RPA_RASENUMDEVICESA 0x00000080
  60. #define RPA_RASENUMDEVICESW 0x00000100
  61. #define RPA_RASGETENTRYPROPERTIESA 0x00000200
  62. #define RPA_RASGETENTRYPROPERTIESW 0x00000400
  63. #define RPA_RASGETENTRYDIALPARAMSA 0x00000800
  64. #define RPA_RASGETENTRYDIALPARAMSW 0x00001000
  65. #define RPA_RASSETENTRYPROPERTIESA 0x00002000
  66. #define RPA_RASSETENTRYPROPERTIESW 0x00004000
  67. #define RPA_RASSETENTRYDIALPARAMSA 0x00008000
  68. #define RPA_RASSETENTRYDIALPARAMSW 0x00010000
  69. BOOL RasPrepareApis(DWORD dwApiFlags, BOOL fLoad = TRUE);
  70. //----- Wrappers and miscellaneous helpers -----
  71. // RWM stands for Ras Wrappers Mode
  72. #define RWM_FORCE_A 0x00000001
  73. #define RWM_FORCE_W 0x00000002
  74. #define RWM_RUNTIME 0x00000004
  75. typedef BOOL (*RASENUMPROCA)(PCSTR pszNameA, LPARAM lParam);
  76. typedef BOOL (*RASENUMPROCW)(PCWSTR pszNameW, LPARAM lParam);
  77. BOOL RasEnumEntriesCallback(PCTSTR pszPhonebook, PVOID pfnEnumAorW, LPARAM lParam,
  78. DWORD dwMode = RWM_RUNTIME);
  79. DWORD RasEnumConnectionsExA(LPRASCONNA *pprcA, PDWORD pcbBuffer, PDWORD pcEntries);
  80. DWORD RasEnumEntriesExA(PCSTR pszPhonebookA, LPRASENTRYNAMEA *pprenA, PDWORD pcbBuffer, PDWORD pcEntries);
  81. DWORD RasEnumEntriesExW(PCWSTR pszPhonebookW, LPRASENTRYNAMEW *pprenW, PDWORD pcbBuffer, PDWORD pcEntries,
  82. DWORD dwMode = RWM_RUNTIME);
  83. DWORD RasEnumDevicesExA(LPRASDEVINFOA *pprdiA, PDWORD pcbBuffer, PDWORD pcEntries);
  84. DWORD RasEnumDevicesExW(LPRASDEVINFOW *pprdiW, PDWORD pcbBuffer, PDWORD pcEntries,
  85. DWORD dwMode = RWM_RUNTIME);
  86. DWORD RasGetEntryPropertiesExA(PCSTR pszNameA, LPRASENTRYA *ppreA, PDWORD pcbRasEntry);
  87. DWORD RasGetEntryPropertiesExW(PCWSTR pszNameW, LPRASENTRYW *ppreW, PDWORD pcbRasEntry,
  88. DWORD dwMode = RWM_RUNTIME);
  89. DWORD RasEnumEntriesWrap(PCWSTR pszPhonebookW, LPRASENTRYNAMEW prenW, PDWORD pcbBuffer, PDWORD pcEntries,
  90. DWORD dwMode = RWM_RUNTIME);
  91. DWORD RasEnumDevicesWrap(LPRASDEVINFOW prdiW, PDWORD pcbBuffer, PDWORD pcEntries,
  92. DWORD dwMode = RWM_RUNTIME);
  93. DWORD RasGetEntryPropertiesWrap(PCWSTR pszNameW, LPRASENTRYW preW, PDWORD pcbRasEntry,
  94. DWORD dwMode = RWM_RUNTIME);
  95. DWORD RasGetEntryDialParamsWrap(LPRASDIALPARAMSW prdpW, PBOOL pfPassword,
  96. DWORD dwMode = RWM_RUNTIME);
  97. DWORD RasSetEntryPropertiesWrap(PCWSTR pszPhonebookW, PCWSTR pszNameW, LPRASENTRYW preW, DWORD cbRasEntry,
  98. DWORD dwMode = RWM_RUNTIME);
  99. DWORD RasSetEntryDialParamsWrap(PCWSTR pszPhonebookW, LPRASDIALPARAMSW prdpW, BOOL fRemovePassword,
  100. DWORD dwMode = RWM_RUNTIME);
  101. #endif