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.

73 lines
2.6 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1994-1995 **
  4. //*********************************************************************
  5. //
  6. // TCPCMN.H - central header file for TCP/IP structures and configuration
  7. // functions
  8. //
  9. // HISTORY:
  10. //
  11. // 12/6/94 jeremys Created.
  12. // 96/03/23 markdu Removed Get/ApplyInstanceTcpInfo functions.
  13. // 96/03/23 markdu Removed TCPINFO struct and TCPINSTANCE struct.
  14. // 96/03/25 markdu Removed connectoid name parameter from
  15. // Get/ApplyGlobalTcpInfo functions since they should not
  16. // be setting per-connectoid stuff anymore.
  17. // Renamed ApplyGlobalTcpInfo to ClearGlobalTcpInfo, and
  18. // changed function to just clear the settings.
  19. // Renamed GetGlobalTcpInfo to IsThereGlobalTcpInfo, and
  20. // changed function to just get the settings.
  21. // Removed TCPGLOBAL struct,
  22. // 96/04/04 markdu Added pfNeedsRestart to WarnIfServerBound, and
  23. // added function RemoveIfServerBound.
  24. //
  25. #ifndef _TCPCMN_H_
  26. #define _TCPCMN_H_
  27. typedef DWORD IPADDRESS;
  28. // same limits as in net setup UI
  29. #define IP_ADDRESS_LEN 15 // big enough for www.xxx.yyy.zzz
  30. #define MAX_GATEWAYS 8
  31. #define MAX_DNSSERVER 3
  32. // big enough for <ip>,<ip>,...
  33. #define MAX_DNSSERVERLEN MAX_DNSSERVER * (IP_ADDRESS_LEN+1)
  34. #define MAX_GATEWAYLEN MAX_GATEWAYS * (IP_ADDRESS_LEN+1)
  35. // functions in TCPCFG.C
  36. HRESULT WarnIfServerBound(HWND hDlg,DWORD dwCardFlags,BOOL* pfNeedsRestart);
  37. HRESULT RemoveIfServerBound(HWND hDlg,DWORD dwCardFlags,BOOL* pfNeedsRestart);
  38. BOOL IPStrToLong(LPCTSTR pszAddress,IPADDRESS * pipAddress);
  39. BOOL IPLongToStr(IPADDRESS ipAddress,LPTSTR pszAddress,UINT cbAddress);
  40. // dwGet/ApplyFlags bits for GetInstanceTCPInfo / ApplyInstanceTCPInfo:
  41. // use INSTANCE_NETDRIVER, INSTANCE_PPPDRIVER, INSTANCE_ALL defined in wizglob.h
  42. #define MAKEIPADDRESS(b1,b2,b3,b4) ((LPARAM)(((DWORD)(b1)<<24)+((DWORD)(b2)<<16)+((DWORD)(b3)<<8)+((DWORD)(b4))))
  43. // node type flags for _dwNodeFlags
  44. #define NT_DRIVERNODE 0x0001
  45. #define NT_ENUMNODE 0x0002
  46. class ENUM_TCP_INSTANCE
  47. {
  48. private:
  49. DWORD _dwCardFlags; // INSTANCE_NETDRIVER, INSTANCE_PPPDRIVER, etc
  50. DWORD _dwNodeFlags; // NT_DRIVERNODE, NT_ENUMNODE, etc
  51. UINT _error;
  52. HKEY _hkeyTcpNode;
  53. VOID CloseNode();
  54. public:
  55. ENUM_TCP_INSTANCE(DWORD dwCardFlags,DWORD dwNodeFlags);
  56. ~ENUM_TCP_INSTANCE();
  57. HKEY Next();
  58. UINT GetError() { return _error; }
  59. };
  60. #endif // _TCPCMN_H_