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.

143 lines
2.5 KiB

  1. /*
  2. Copyright (c) 1998, Microsoft Corporation, all rights reserved
  3. Description:
  4. History:
  5. */
  6. #ifndef _TCPREG_H_
  7. #define _TCPREG_H_
  8. #include "rasiphlp.h"
  9. // Maximum characters in an IP address string of the form a.b.c.d
  10. #define MAXIPSTRLEN 20
  11. typedef struct _TCPIP_INFO
  12. {
  13. BOOL fChanged;
  14. BOOL fDisableNetBIOSoverTcpip;
  15. WCHAR* wszAdapterName;
  16. WCHAR wszIPAddress[MAXIPSTRLEN + 1];
  17. WCHAR wszSubnetMask[MAXIPSTRLEN + 1];
  18. WCHAR* wszDNSNameServers; // space separated SZ
  19. WCHAR* mwszNetBIOSNameServers; // MULTI_SZ
  20. WCHAR* wszDNSDomainName;
  21. } TCPIP_INFO;
  22. // *ppTcpipInfo must ultimately be freed by calling FreeTcpipInfo()
  23. DWORD
  24. LoadTcpipInfo(
  25. IN TCPIP_INFO** ppTcpipInfo,
  26. IN WCHAR* wszAdapterName,
  27. IN BOOL fAdapterOnly
  28. );
  29. DWORD
  30. SaveTcpipInfo(
  31. IN TCPIP_INFO* pTcpipInfo
  32. );
  33. DWORD
  34. FreeTcpipInfo(
  35. IN TCPIP_INFO** ppTcpipInfo
  36. );
  37. VOID
  38. ClearTcpipInfo(
  39. VOID
  40. );
  41. DWORD
  42. GetAdapterInfo(
  43. IN DWORD dwIndex,
  44. OUT IPADDR* pnboIpAddress,
  45. OUT IPADDR* pnboDNS1,
  46. OUT IPADDR* pnboDNS2,
  47. OUT IPADDR* pnboWINS1,
  48. OUT IPADDR* pnboWINS2,
  49. OUT IPADDR* pnboGateway,
  50. OUT BYTE* pbAddress
  51. );
  52. DWORD
  53. GetPreferredAdapterInfo(
  54. OUT IPADDR* pnboIpAddress,
  55. OUT IPADDR* pnboDNS1,
  56. OUT IPADDR* pnboDNS2,
  57. OUT IPADDR* pnboWINS1,
  58. OUT IPADDR* pnboWINS2,
  59. OUT BYTE* pbAddress
  60. );
  61. DWORD
  62. MwszLength(
  63. IN WCHAR* mwsz
  64. );
  65. DWORD
  66. RegQueryValueWithAllocA(
  67. IN HKEY hKey,
  68. IN CHAR* szValueName,
  69. IN DWORD dwTypeRequired,
  70. IN BYTE** ppbData
  71. );
  72. DWORD
  73. RegQueryValueWithAllocW(
  74. IN HKEY hKey,
  75. IN WCHAR* wszValueName,
  76. IN DWORD dwTypeRequired,
  77. IN BYTE** ppbData
  78. );
  79. IPADDR
  80. IpAddressFromAbcdWsz(
  81. IN WCHAR* wszIpAddress
  82. );
  83. VOID
  84. AbcdSzFromIpAddress(
  85. IN IPADDR nboIpAddr,
  86. OUT CHAR* szIpAddress
  87. );
  88. VOID
  89. AbcdWszFromIpAddress(
  90. IN IPADDR nboIpAddr,
  91. OUT WCHAR* wszIpAddress
  92. );
  93. DWORD
  94. PrependWszIpAddress(
  95. IN WCHAR** pwsz,
  96. IN WCHAR* wszIpAddress
  97. );
  98. DWORD
  99. PrependWszIpAddressToMwsz(
  100. IN WCHAR** pmwsz,
  101. IN WCHAR* wszIpAddress
  102. );
  103. DWORD
  104. PrependDwIpAddress(
  105. IN WCHAR** pwsz,
  106. IN IPADDR nboIpAddr
  107. );
  108. DWORD
  109. PrependDwIpAddressToMwsz(
  110. IN WCHAR** pmwsz,
  111. IN IPADDR nboIpAddr
  112. );
  113. #endif // #ifndef _TCPREG_H_