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.

156 lines
5.5 KiB

  1. // inets.h: interface for the CInetSetup class.
  2. //
  3. //
  4. // Thomas A. Jeyaseelan [thomasje]
  5. // Capability: RAS: (modem, isdn, atm)
  6. // LAN: (cable, ethernet) - As of 8 Dec 99
  7. // 1483: - As of 14 Dec 99
  8. //
  9. //////////////////////////////////////////////////////////////////////
  10. // Note. These APIs are do not have OOBE dependencies and are fully self-
  11. // sufficient. However, they can *ONLY* be run on Windows 9x machines.
  12. #if !defined(AFX_INETSETUP_H__E5B39864_835C_41EE_A773_A5010699D1DE__INCLUDED_)
  13. #define AFX_INETSETUP_H__E5B39864_835C_41EE_A773_A5010699D1DE__INCLUDED_
  14. #pragma pack (push, inets, 4)
  15. #include <windows.h>
  16. #include "wancfg.h"
  17. #include <ras.h>
  18. #include <stdlib.h>
  19. #include <malloc.h>
  20. #include <tchar.h>
  21. #include <string.h>
  22. #include <setupapi.h>
  23. #define PNP_MAX_STRING_LENGTH 260
  24. #define GEN_MAX_STRING_LENGTH 260
  25. #define NET_MAX_STRING_LENGTH 260
  26. #define VXD_MAX_STRING_LENGTH 260
  27. #define INETS_ADAPTER_HARDWAREID 0x00000001
  28. #define INETS_ADAPTER_INSTANCEID 0x00000002
  29. // -*-*-*-*-*-*-*-*-*-*-* InetSGetDeviceRegistryKey -*-*-*-*-*-*-*-*-*-*-*-* //
  30. typedef WINSETUPAPI BOOLEAN (WINAPI *LPFNDLL_SETUPDICLASSGUIDSFROMNAME)
  31. (PCWSTR, LPGUID, DWORD, PDWORD);
  32. typedef WINSETUPAPI HDEVINFO (WINAPI *LPFNDLL_SETUPDIGETCLASSDEVS)
  33. (LPGUID, PCWSTR, HWND, DWORD);
  34. typedef WINSETUPAPI BOOLEAN (WINAPI *LPFNDLL_SETUPDIGETDEVICEINSTANCEID)
  35. (HDEVINFO, PSP_DEVINFO_DATA, PCWSTR, DWORD, PDWORD);
  36. static const CHAR cszSetupDiClassGuidsFromName[] = "SetupDiClassGuidsFromNameW";
  37. static const CHAR cszSetupDiGetClassDevs[] = "SetupDiGetClassDevsW";
  38. static const CHAR cszSetupDiGetDeviceRegistryProperty[] = "SetupDiGetDeviceRegistryPropertyW";
  39. static const CHAR cszSetupDiGetDeviceInstanceId[] = "SetupDiGetDeviceInstanceIdW";
  40. typedef WINSETUPAPI BOOLEAN (WINAPI *LPFNDLL_SETUPDIENUMDEVICEINFO)
  41. (HDEVINFO, DWORD, PSP_DEVINFO_DATA);
  42. typedef WINSETUPAPI BOOLEAN (WINAPI *LPFNDLL_SETUPDIGETDEVICEREGISTRYPROPERTY)
  43. (HDEVINFO, PSP_DEVINFO_DATA, DWORD, PDWORD, PBYTE, DWORD, PDWORD);
  44. typedef WINSETUPAPI HKEY (WINAPI *LPFNDLL_SETUPDIOPENDEVREGKEY)
  45. (HDEVINFO, PSP_DEVINFO_DATA, DWORD, DWORD, DWORD, REGSAM);
  46. // -*-*-*-*-*-*-*-*-*-*-* end InetSGetDeviceRegistryKey -*-*-*-*-*-*-*-*-*-*-*-* //
  47. // The following structure is the generic TCP INFO structure. It will
  48. // be used by all services to extract and use TCP Information.
  49. typedef struct _TCPIP_INFO_EXT {
  50. DWORD dwSize; // versioning information
  51. //
  52. // IP Address - AutoIP is considered to be TRUE for Dial-up Adapters
  53. //
  54. DWORD EnableIP;
  55. WCHAR szIPAddress[NET_MAX_STRING_LENGTH];
  56. WCHAR szIPMask[NET_MAX_STRING_LENGTH];
  57. //
  58. // Default Gateway
  59. //
  60. WCHAR szDefaultGatewayList[NET_MAX_STRING_LENGTH]; // n.n.n.n, n.n.n.n, ...
  61. //
  62. // DHCP Info - where is this placed?
  63. //
  64. DWORD EnableDHCP;
  65. WCHAR szDHCPServer[NET_MAX_STRING_LENGTH];
  66. //
  67. // DNS - This is global and will overwrite existing settings.
  68. //
  69. DWORD EnableDNS;
  70. WCHAR szHostName[NET_MAX_STRING_LENGTH];
  71. WCHAR szDomainName[NET_MAX_STRING_LENGTH];
  72. WCHAR szDNSList[NET_MAX_STRING_LENGTH]; // n.n.n.n, n.n.n.n, ...
  73. WCHAR szSuffixSearchList[NET_MAX_STRING_LENGTH];
  74. //
  75. // WINS
  76. //
  77. DWORD EnableWINS;
  78. WCHAR szWINSList[NET_MAX_STRING_LENGTH]; // n.n.n.n, n.n.n.n, ...
  79. UINT uiScopeID;
  80. //
  81. //
  82. //
  83. } TCPIP_INFO_EXT, *PTCPIP_INFO_EXT, FAR * LPTCPIP_INFO_EXT;
  84. typedef struct _RFC1483_INFO_EXT {
  85. DWORD dwSize;
  86. DWORD dwRegSettingsBufSize;
  87. // DWORD dwRegNdiParamBufSize;
  88. LPBYTE lpbRegSettingsBuf;
  89. // LPBYTE lpbRegNdiParamBuf;
  90. } RFC1483_INFO_EXT, * PRFC1483_INFO_EXT, FAR * LPRFC1483_INFO_EXT;
  91. typedef struct _PPPOE_INFO_EXT {
  92. DWORD dwSize;
  93. DWORD dwRegSettingsBufSize;
  94. // DWORD dwRegNdiParamBufSize;
  95. LPBYTE lpbRegSettingsBuf;
  96. // LPBYTE lpbRegNdiParamBuf;
  97. } PPPOE_INFO_EXT, * PPPPOE_INFO_EXT, FAR * LPPPPOE_INFO_EXT;
  98. typedef struct _LANINFO {
  99. DWORD dwSize;
  100. TCPIP_INFO_EXT TcpIpInfo;
  101. WCHAR szPnPId[PNP_MAX_STRING_LENGTH];
  102. } LANINFO, * PLANINFO, FAR * LPLANINFO;
  103. typedef struct _RASINFO {
  104. DWORD dwSize;
  105. WCHAR szPhoneBook[GEN_MAX_STRING_LENGTH];
  106. WCHAR szEntryName[GEN_MAX_STRING_LENGTH];
  107. LPBYTE lpDeviceInfo;
  108. DWORD dwDeviceInfoSize;
  109. RASENTRY RasEntry;
  110. } RASINFO, *LPRASINFO, FAR * LPRASINFO;
  111. typedef struct _RFC1483INFO {
  112. DWORD dwSize;
  113. RFC1483_INFO_EXT Rfc1483Module;
  114. LANINFO TcpIpInfo;
  115. } RFC1483INFO, * PRFC1483INFO, FAR * LPRFC1483INFO;
  116. typedef struct _PPPOEINFO {
  117. DWORD dwSize;
  118. PPPOE_INFO_EXT PppoeModule;
  119. LANINFO TcpIpInfo;
  120. } PPPOEINFO, * PPPPOEINFO, FAR * LPPPPOEINFO;
  121. DWORD WINAPI InetSSetRasConnection ( RASINFO& RasEntry );
  122. DWORD WINAPI InetSSetLanConnection ( LANINFO& LanInfo );
  123. DWORD WINAPI InetSSetRfc1483Connection ( RFC1483INFO &Rfc1483Info );
  124. DWORD WINAPI InetSSetPppoeConnection ( PPPOEINFO& PppoeInfo );
  125. // helper routines //
  126. DWORD WINAPI InetSGetAdapterKey ( LPCWSTR cszDeviceClass, LPCWSTR cszDeviceParam, DWORD dwEnumType, DWORD dwRequiredKeyType, HKEY &hkeyDevKey );
  127. #endif // !defined(AFX_INETSETUP_H__E5B39864_835C_41EE_A773_A5010699D1DE__INCLUDED_)