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
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. #ifndef AUTODIAL_MODE_NEVER
  23. //
  24. // Define constants for autodial mode that are present
  25. // in IE5 and later. These are normally defined in wininet.h
  26. //
  27. # define AUTODIAL_MODE_NEVER 1
  28. # define AUTODIAL_MODE_ALWAYS 2
  29. # define AUTODIAL_MODE_NO_NETWORK_PRESENT 4
  30. #endif
  31. #ifdef _SENS
  32. #include <eventsys.h> // EventSystem Headers
  33. #include <sens.h>
  34. #endif // _SENS
  35. #ifndef NETWORK_ALIVE_LAN
  36. #define NETWORK_ALIVE_LAN 0x00000001
  37. #endif // NETWORK_ALIVE_LAN
  38. #ifndef NETWORK_ALIVE_WAN
  39. #define NETWORK_ALIVE_WAN 0x00000002
  40. #endif // NETWORK_ALIVE_WAN
  41. #define CNETAPI_CONNECTIONTYPEUNKNOWN 0x00
  42. #define CNETAPI_CONNECTIONTYPELAN 0x01
  43. #define CNETAPI_CONNECTIONTYPEWAN 0x02
  44. #define RASERROR_MAXSTRING 256
  45. // interface delcaration so can get at
  46. // NetApi through MobsyncGetClassObject
  47. interface INetApi : public IUnknown
  48. {
  49. // SENS Methods
  50. virtual STDMETHODIMP_(BOOL) IsSensInstalled(void) = 0;
  51. virtual STDMETHODIMP_(BOOL) IsNetworkAlive(LPDWORD lpdwFlags) = 0;
  52. virtual STDMETHODIMP GetWanConnections(DWORD *cbNumEntries,RASCONN **pWanConnections) = 0;
  53. virtual STDMETHODIMP FreeWanConnections(RASCONN *pWanConnections) = 0;
  54. virtual STDMETHODIMP GetConnectionStatus(LPCTSTR pszConnectionName,DWORD ConnectionType,BOOL *fConnected,BOOL *fCanEstablishConnection) = 0;
  55. virtual STDMETHODIMP_(DWORD) RasEnumConnections(LPRASCONNW lprasconn,LPDWORD lpcb,LPDWORD lpcConnections) = 0;
  56. virtual STDMETHODIMP RasGetAutodial( BOOL& fEnabled ) = 0;
  57. virtual STDMETHODIMP RasSetAutodial( BOOL fEnabled ) = 0;
  58. virtual STDMETHODIMP_(DWORD) RasGetErrorStringProc( UINT uErrorValue, LPTSTR lpszErrorString,DWORD cBufSize) = 0;
  59. virtual STDMETHODIMP_(DWORD) RasEnumEntries(LPWSTR reserved,LPWSTR lpszPhoneBook,
  60. LPRASENTRYNAME lprasEntryName,LPDWORD lpcb,LPDWORD lpcEntries) = 0;
  61. // methods for calling wininet
  62. virtual STDMETHODIMP_(DWORD) InternetDialA(HWND hwndParent,char* lpszConnectoid,DWORD dwFlags,
  63. LPDWORD lpdwConnection, DWORD dwReserved) = 0;
  64. virtual STDMETHODIMP_(DWORD)InternetDialW(HWND hwndParent,WCHAR* lpszConnectoid,DWORD dwFlags,
  65. LPDWORD lpdwConnection, DWORD dwReserved) = 0;
  66. virtual STDMETHODIMP_(DWORD)InternetHangUp(DWORD dwConnection,DWORD dwReserved) = 0;
  67. virtual STDMETHODIMP_(BOOL) InternetAutodial(DWORD dwFlags,DWORD dwReserved) = 0;
  68. virtual STDMETHODIMP_(BOOL) InternetAutodialHangup(DWORD dwReserved) = 0;
  69. virtual STDMETHODIMP InternetGetAutodial( DWORD *pdwMode ) = 0;
  70. virtual STDMETHODIMP InternetSetAutodial( DWORD dwMode ) = 0;
  71. virtual STDMETHODIMP_(BOOL) IsGlobalOffline(void) = 0;
  72. virtual STDMETHODIMP_(BOOL) SetOffline(BOOL fOffline) = 0;
  73. };
  74. typedef INetApi *LPNETAPI;
  75. STDAPI ResetNetworkIdle();
  76. #endif // _SYNCMGRNETAPI_