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.

371 lines
8.1 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. lproto.h
  5. Abstract:
  6. This file contains function proto types for the NT specific
  7. functions.
  8. Author:
  9. Madan Appiah (madana) Dec-7-1993
  10. Environment:
  11. User Mode - Win32
  12. Revision History:
  13. --*/
  14. //
  15. // dhcpreg.c
  16. //
  17. DWORD
  18. DhcpRegQueryInfoKey(
  19. HKEY KeyHandle,
  20. LPDHCP_KEY_QUERY_INFO QueryInfo
  21. );
  22. DWORD
  23. GetRegistryString(
  24. HKEY Key,
  25. LPVOID ValueStringName,
  26. LPTSTR *String,
  27. LPDWORD StringSize
  28. );
  29. DWORD
  30. DhcpRegReadParamString(
  31. LPWSTR AdapterName,
  32. LPWSTR RegKeyLocation,
  33. LPWSTR ValueName,
  34. LPWSTR *ReturnValue
  35. );
  36. DWORD
  37. RegSetIpAddress(
  38. HKEY KeyHandle,
  39. LPWSTR ValueName,
  40. DWORD ValueType,
  41. DHCP_IP_ADDRESS IpAddress
  42. );
  43. #if DBG
  44. DWORD
  45. RegSetTimeField(
  46. HKEY KeyHandle,
  47. LPWSTR ValueName,
  48. DWORD ValueType,
  49. time_t Time
  50. );
  51. #endif
  52. DWORD
  53. DhcpGetRegistryValue(
  54. LPWSTR RegKey,
  55. LPWSTR ValueName,
  56. DWORD ValueType,
  57. PVOID *Data
  58. );
  59. DWORD
  60. DhcpSetDNSAddress(
  61. HKEY KeyHandle,
  62. LPWSTR ValueName,
  63. DWORD ValueType,
  64. DHCP_IP_ADDRESS UNALIGNED *Data,
  65. DWORD DataLength
  66. );
  67. DWORD
  68. SetDhcpOption(
  69. LPWSTR AdapterName,
  70. DHCP_OPTION_ID OptionId,
  71. LPBOOL DefaultGatewaysSet,
  72. BOOL LastKnownDefaultGateway
  73. );
  74. DWORD
  75. DhcpMakeNICList(
  76. VOID
  77. );
  78. DWORD
  79. DhcpAddNICtoList(
  80. LPWSTR AdapterName,
  81. LPWSTR DeviceName,
  82. PDHCP_CONTEXT *DhcpContext
  83. );
  84. #if defined(_PNP_POWER_)
  85. DWORD
  86. DhcpAddNICtoListEx(
  87. LPWSTR AdapterName,
  88. DWORD ipInterfaceContext,
  89. PDHCP_CONTEXT *DhcpContext
  90. );
  91. #endif _PNP_POWER_
  92. BOOL
  93. SetOverRideDefaultGateway(
  94. LPWSTR AdapterName
  95. );
  96. BOOL
  97. DhcpGetAddressOption(
  98. DHCP_IP_ADDRESS **ppDNSServerList,
  99. DWORD *pNumberOfServers
  100. );
  101. BOOL
  102. DhcpRegReadUseMHAsyncDnsFlag(
  103. VOID
  104. );
  105. DWORD // Win32 status
  106. DhcpInitRegistry( // Initialize registry based globals
  107. VOID
  108. );
  109. VOID
  110. DhcpCleanupRegistry( // undo the effects of InitReg call
  111. VOID
  112. );
  113. DHCP_IP_ADDRESS // the static ip address of the adapter
  114. DhcpRegReadIpAddress( // get the first ip address
  115. LPWSTR AdapterName, // the adaptor of interest
  116. LPWSTR ValueName // the ip address value to read
  117. );
  118. DWORD // status
  119. DhcpRegReadIpAddresses( // read a set of ip addresses
  120. IN DHCPKEY RegKeyHandle, // open key handle
  121. IN LPWSTR ValueName, // name of value to read frm
  122. IN WCHAR Separation, // a MULTI_SZ has L'\0', SZ has L' ' or L',' etc.
  123. OUT PDHCP_IP_ADDRESS *AddressArray, // an array of addresses
  124. OUT LPDWORD AddressCount // the output size of above array
  125. );
  126. VOID
  127. DhcpRegInitializeClasses( // initialize the classes list
  128. IN OUT PDHCP_CONTEXT DhcpContext // NULL or adpater context
  129. );
  130. DWORD // status
  131. DhcpGetRegistryValueWithKey( // see defn of GetRegistryValue
  132. IN HKEY KeyHandle, // keyhandle NOT location
  133. IN LPTSTR ValueName, // value to read from registry
  134. IN DWORD ValueType, // type of value
  135. OUT LPVOID Data // this will be filled in
  136. );
  137. DWORD // status
  138. DhcpRegExpandString( // replace '?' with AdapterName
  139. IN LPWSTR InString, // input string to expand
  140. IN LPWSTR AdapterName, // the adapter name
  141. OUT LPWSTR *OutString, // the output ptr to store string
  142. IN OUT LPWSTR Buffer // the buffer to use if non NULL
  143. );
  144. DWORD // status
  145. DhcpRegReadFromLocation( // read from one location
  146. IN LPWSTR OneLocation, // value to read from
  147. IN LPWSTR AdapterName, // replace '?' with adapternames
  148. OUT LPBYTE *Value, // output value
  149. OUT DWORD *ValueType, // data type of value
  150. OUT DWORD *ValueSize // the size in bytes
  151. );
  152. DWORD // status
  153. DhcpRegReadFromAnyLocation( // read from one of many locations
  154. IN LPWSTR MzRegLocation, // multiple locations thru REG_MULTI_MZ
  155. IN LPWSTR AdapterName, // may have to replace '?' with AdapterName
  156. OUT LPBYTE *Value, // data for the value read
  157. OUT DWORD *ValueType, // type of the data
  158. OUT DWORD *ValueSize // the size of data
  159. );
  160. DWORD // win32 status
  161. DhcpRegFillParams( // get the registry config for this adapter
  162. IN OUT PDHCP_CONTEXT DhcpContext, // adapter context to fill in
  163. IN BOOL ReadAllInfo // read EVERYTHING or only some critical info?
  164. );
  165. VOID
  166. DhcpRegReadClassId( // Read the class id stuff
  167. IN PDHCP_CONTEXT DhcpContext // Input context to read for
  168. );
  169. //
  170. // ioctl.c
  171. //
  172. DWORD
  173. IPSetIPAddress(
  174. DWORD IpInterfaceContext,
  175. DHCP_IP_ADDRESS IpAddress,
  176. DHCP_IP_ADDRESS SubnetMask
  177. );
  178. DWORD
  179. IPAddIPAddress(
  180. LPWSTR AdapterName,
  181. DHCP_IP_ADDRESS Address,
  182. DHCP_IP_ADDRESS SubnetMask
  183. );
  184. DWORD
  185. IPResetIPAddress(
  186. DWORD dwInterfaceContext,
  187. DHCP_IP_ADDRESS SubnetMask
  188. );
  189. DWORD
  190. SetIPAddressAndArp(
  191. PVOID pvLocalInformation,
  192. DWORD dwAddress,
  193. DWORD dwSubnetMask
  194. );
  195. DWORD
  196. NetBTSetIPAddress(
  197. LPWSTR DeviceName,
  198. DHCP_IP_ADDRESS IpAddress,
  199. DHCP_IP_ADDRESS SubnetMask
  200. );
  201. DWORD
  202. NetBTResetIPAddress(
  203. LPWSTR DeviceName,
  204. DHCP_IP_ADDRESS SubnetMask
  205. );
  206. DWORD
  207. NetBTNotifyRegChanges(
  208. LPWSTR DeviceName
  209. );
  210. DWORD
  211. SetDefaultGateway(
  212. DWORD Command,
  213. DHCP_IP_ADDRESS GatewayAddress
  214. );
  215. HANDLE
  216. DhcpOpenGlobalEvent(
  217. void
  218. );
  219. #if defined(_PNP_POWER_) && !defined(VXD)
  220. DWORD
  221. IPGetIPEventRequest(
  222. HANDLE handle,
  223. HANDLE event,
  224. UINT seqNo,
  225. PIP_GET_IP_EVENT_RESPONSE responseBuffer,
  226. DWORD responseBufferSize,
  227. PIO_STATUS_BLOCK ioStatusBlock
  228. );
  229. DWORD
  230. IPCancelIPEventRequest(
  231. HANDLE handle,
  232. PIO_STATUS_BLOCK ioStatusBlock
  233. );
  234. #endif _PNP_POWER_ && !VXD
  235. //
  236. // api.c
  237. //
  238. DWORD
  239. DhcpApiInit(
  240. VOID
  241. );
  242. VOID
  243. DhcpApiCleanup(
  244. VOID
  245. );
  246. DWORD
  247. ProcessApiRequest(
  248. HANDLE PipeHandle,
  249. LPOVERLAPPED Overlap
  250. );
  251. //
  252. // util.c
  253. //
  254. PDHCP_CONTEXT
  255. FindDhcpContextOnRenewalList(
  256. LPWSTR AdapterName,
  257. DWORD InterfaceContext
  258. );
  259. PDHCP_CONTEXT
  260. FindDhcpContextOnNicList(
  261. LPWSTR AdapterName,
  262. DWORD InterfaceContext
  263. );
  264. BOOL
  265. IsMultiHomeMachine(
  266. VOID
  267. );
  268. //
  269. // options.c
  270. //
  271. SERVICE_SPECIFIC_DHCP_OPTION *
  272. FindDhcpOption(
  273. DHCP_OPTION_ID OptionID
  274. );
  275. DWORD
  276. ReadGlobalOptionList();
  277. DWORD
  278. LoseAllEnvSpecificOptions(
  279. PDHCP_CONTEXT dhcpContext
  280. );
  281. //
  282. // dhcp.c
  283. //
  284. DWORD
  285. SetIpConfigurationForNIC(
  286. HKEY KeyHandle,
  287. PDHCP_CONTEXT DhcpContext,
  288. PDHCP_OPTIONS DhcpOptions,
  289. DHCP_IP_ADDRESS ServerIpAddress,
  290. DWORD dwLeaseTime,
  291. DWORD dwT1Time,
  292. DWORD dwT2Time,
  293. BOOL ObtainedNewAddress
  294. );