Source code of Windows XP (NT5)
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.

95 lines
3.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: netapi.h
  7. //
  8. // Contents: Network/SENS API wrappers
  9. //
  10. // Classes:
  11. //
  12. // Notes:
  13. //
  14. // History: 08-Dec-97 rogerg Created.
  15. //
  16. //--------------------------------------------------------------------------
  17. #ifndef _SYNCMGRNETAPI_
  18. #define _SYNCMGRNETAPI_
  19. #include <ras.h>
  20. #include <raserror.h>
  21. #include <wininet.h>
  22. #ifdef _SENS
  23. #include <eventsys.h> // EventSystem Headers
  24. #include <sens.h>
  25. #endif // _SENS
  26. #ifndef NETWORK_ALIVE_LAN
  27. #define NETWORK_ALIVE_LAN 0x00000001
  28. #endif // NETWORK_ALIVE_LAN
  29. #ifndef NETWORK_ALIVE_WAN
  30. #define NETWORK_ALIVE_WAN 0x00000002
  31. #endif // NETWORK_ALIVE_WAN
  32. #define CNETAPI_CONNECTIONTYPEUNKNOWN 0x00
  33. #define CNETAPI_CONNECTIONTYPELAN 0x01
  34. #define CNETAPI_CONNECTIONTYPEWAN 0x02
  35. //
  36. // When INTERNET_OPTION_AUTODIAL is available, remove this definition
  37. //
  38. #ifndef INTERNET_OPTION_DISABLE_AUTODIAL
  39. #define INTERNET_OPTION_DISABLE_AUTODIAL 70
  40. #endif // INTERNET_OPTION_DISABLE_AUTODIAL
  41. #define RASERROR_MAXSTRING 256
  42. // interface delcaration so can get at
  43. // NetApi through MobsyncGetClassObject
  44. interface INetApi : public IUnknown
  45. {
  46. // SENS Methods
  47. virtual STDMETHODIMP_(BOOL) IsSensInstalled(void) = 0;
  48. virtual STDMETHODIMP_(BOOL) IsNetworkAlive(LPDWORD lpdwFlags) = 0;
  49. virtual STDMETHODIMP GetWanConnections(DWORD *cbNumEntries,RASCONN **pWanConnections) = 0;
  50. virtual STDMETHODIMP FreeWanConnections(RASCONN *pWanConnections) = 0;
  51. virtual STDMETHODIMP GetConnectionStatus(LPCTSTR pszConnectionName,DWORD ConnectionType,BOOL *fConnected,BOOL *fCanEstablishConnection) = 0;
  52. virtual STDMETHODIMP_(DWORD) RasEnumConnections(LPRASCONNW lprasconn,LPDWORD lpcb,LPDWORD lpcConnections) = 0;
  53. virtual STDMETHODIMP RasGetAutodial( BOOL& fEnabled ) = 0;
  54. virtual STDMETHODIMP RasSetAutodial( BOOL fEnabled ) = 0;
  55. virtual STDMETHODIMP_(DWORD) RasGetErrorStringProc( UINT uErrorValue, LPTSTR lpszErrorString,DWORD cBufSize) = 0;
  56. virtual STDMETHODIMP_(DWORD) RasEnumEntries(LPWSTR reserved,LPWSTR lpszPhoneBook,
  57. LPRASENTRYNAME lprasEntryName,LPDWORD lpcb,LPDWORD lpcEntries) = 0;
  58. // ConvertGid, GetEntryProps only support on NT 5.0
  59. virtual STDMETHODIMP RasConvertGuidToEntry(GUID *pGuid,LPWSTR lpszEntry,RASENTRY *pRasEntry) = 0;
  60. // methods for calling wininet
  61. virtual STDMETHODIMP_(DWORD) InternetDialA(HWND hwndParent,char* lpszConnectoid,DWORD dwFlags,
  62. LPDWORD lpdwConnection, DWORD dwReserved) = 0;
  63. virtual STDMETHODIMP_(DWORD)InternetDialW(HWND hwndParent,WCHAR* lpszConnectoid,DWORD dwFlags,
  64. LPDWORD lpdwConnection, DWORD dwReserved) = 0;
  65. virtual STDMETHODIMP_(DWORD)InternetHangUp(DWORD dwConnection,DWORD dwReserved) = 0;
  66. virtual STDMETHODIMP_(BOOL) InternetAutodial(DWORD dwFlags,DWORD dwReserved) = 0;
  67. virtual STDMETHODIMP_(BOOL) InternetAutodialHangup(DWORD dwReserved) = 0;
  68. virtual STDMETHODIMP InternetGetAutodial( BOOL& fEnabled ) = 0;
  69. virtual STDMETHODIMP InternetSetAutodial( BOOL fEnabled ) = 0;
  70. virtual STDMETHODIMP_(BOOL) IsGlobalOffline(void) = 0;
  71. virtual STDMETHODIMP_(BOOL) SetOffline(BOOL fOffline) = 0;
  72. };
  73. typedef INetApi *LPNETAPI;
  74. STDAPI ResetNetworkIdle();
  75. #endif // _SYNCMGRNETAPI_