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.

410 lines
9.0 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. LPWSTR ValueStringName,
  26. LPWSTR *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. RegGetIpAndSubnet(
  38. IN DHCP_CONTEXT *DhcpContext,
  39. OUT PIP_SUBNET *TcpConf,
  40. OUT int *Count
  41. );
  42. DWORD
  43. RegSetIpAddress(
  44. HKEY KeyHandle,
  45. LPWSTR ValueName,
  46. DWORD ValueType,
  47. DHCP_IP_ADDRESS IpAddress
  48. );
  49. #if DBG
  50. DWORD
  51. RegSetTimeField(
  52. HKEY KeyHandle,
  53. LPWSTR ValueName,
  54. DWORD ValueType,
  55. time_t Time
  56. );
  57. #endif
  58. DWORD
  59. DhcpGetRegistryValue(
  60. LPWSTR RegKey,
  61. LPWSTR ValueName,
  62. DWORD ValueType,
  63. PVOID *Data
  64. );
  65. DWORD
  66. DhcpSetDNSAddress(
  67. HKEY KeyHandle,
  68. LPWSTR ValueName,
  69. DWORD ValueType,
  70. DHCP_IP_ADDRESS UNALIGNED *Data,
  71. DWORD DataLength
  72. );
  73. DWORD
  74. SetDhcpOption(
  75. LPWSTR AdapterName,
  76. DHCP_OPTION_ID OptionId,
  77. LPBOOL DefaultGatewaysSet,
  78. BOOL LastKnownDefaultGateway
  79. );
  80. DWORD
  81. DhcpMakeNICList(
  82. VOID
  83. );
  84. DWORD
  85. DhcpAddNICtoList(
  86. LPWSTR AdapterName,
  87. LPWSTR DeviceName,
  88. PDHCP_CONTEXT *DhcpContext
  89. );
  90. #if defined(_PNP_POWER_)
  91. DWORD
  92. DhcpAddNICtoListEx(
  93. LPWSTR AdapterName,
  94. DWORD ipInterfaceContext,
  95. PDHCP_CONTEXT *DhcpContext
  96. );
  97. #endif _PNP_POWER_
  98. BOOL
  99. SetOverRideDefaultGateway(
  100. LPWSTR AdapterName
  101. );
  102. BOOL
  103. DhcpGetAddressOption(
  104. DHCP_IP_ADDRESS **ppDNSServerList,
  105. DWORD *pNumberOfServers
  106. );
  107. BOOL
  108. DhcpRegReadUseMHAsyncDnsFlag(
  109. VOID
  110. );
  111. DWORD // Win32 status
  112. DhcpInitRegistry( // Initialize registry based globals
  113. VOID
  114. );
  115. VOID
  116. DhcpCleanupRegistry( // undo the effects of InitReg call
  117. VOID
  118. );
  119. DHCP_IP_ADDRESS // the static ip address of the adapter
  120. DhcpRegReadIpAddress( // get the first ip address
  121. LPWSTR AdapterName, // the adaptor of interest
  122. LPWSTR ValueName // the ip address value to read
  123. );
  124. DWORD // status
  125. DhcpRegReadIpAddresses( // read a set of ip addresses
  126. IN DHCPKEY RegKeyHandle, // open key handle
  127. IN LPWSTR ValueName, // name of value to read frm
  128. IN WCHAR Separation, // a MULTI_SZ has L'\0', SZ has L' ' or L',' etc.
  129. OUT PDHCP_IP_ADDRESS *AddressArray, // an array of addresses
  130. OUT LPDWORD AddressCount // the output size of above array
  131. );
  132. VOID
  133. DhcpRegInitializeClasses( // initialize the classes list
  134. IN OUT PDHCP_CONTEXT DhcpContext // NULL or adpater context
  135. );
  136. DWORD // status
  137. DhcpGetRegistryValueWithKey( // see defn of GetRegistryValue
  138. IN HKEY KeyHandle, // keyhandle NOT location
  139. IN LPWSTR ValueName, // value to read from registry
  140. IN DWORD ValueType, // type of value
  141. OUT LPVOID Data // this will be filled in
  142. );
  143. DWORD // status
  144. DhcpRegExpandString( // replace '?' with AdapterName
  145. IN LPWSTR InString, // input string to expand
  146. IN LPCWSTR AdapterName, // the adapter name
  147. OUT LPWSTR *OutString, // the output ptr to store string
  148. IN OUT LPWSTR Buffer // the buffer to use if non NULL
  149. );
  150. DWORD // status
  151. DhcpRegReadFromLocation( // read from one location
  152. IN LPWSTR OneLocation, // value to read from
  153. IN LPWSTR AdapterName, // replace '?' with adapternames
  154. OUT LPBYTE *Value, // output value
  155. OUT DWORD *ValueType, // data type of value
  156. OUT DWORD *ValueSize // the size in bytes
  157. );
  158. DWORD // status
  159. DhcpRegReadFromAnyLocation( // read from one of many locations
  160. IN LPWSTR MzRegLocation, // multiple locations thru REG_MULTI_MZ
  161. IN LPWSTR AdapterName, // may have to replace '?' with AdapterName
  162. OUT LPBYTE *Value, // data for the value read
  163. OUT DWORD *ValueType, // type of the data
  164. OUT DWORD *ValueSize // the size of data
  165. );
  166. DWORD // win32 status
  167. DhcpRegFillParams( // get the registry config for this adapter
  168. IN OUT PDHCP_CONTEXT DhcpContext, // adapter context to fill in
  169. IN BOOL ReadAllInfo // read EVERYTHING or only some critical info?
  170. );
  171. DWORD // win32 status
  172. DhcpRegFillFallbackConfig( // get the fallback config for this adapter
  173. IN OUT PDHCP_CONTEXT DhcpContext // adapter context to fill in
  174. );
  175. VOID
  176. DhcpRegReadClassId( // Read the class id stuff
  177. IN PDHCP_CONTEXT DhcpContext // Input context to read for
  178. );
  179. #ifdef BOOTPERF
  180. VOID
  181. DhcpRegDeleteQuickBootValues(
  182. IN HKEY Key
  183. );
  184. VOID
  185. DhcpRegSaveQuickBootValues(
  186. IN HKEY Key,
  187. IN ULONG IpAddress,
  188. IN ULONG Mask,
  189. IN ULONGLONG LeaseExpirationTime
  190. );
  191. #endif BOOTPERF
  192. //
  193. // ioctl.c
  194. //
  195. DWORD
  196. IPSetIPAddress(
  197. DWORD IpInterfaceContext,
  198. DHCP_IP_ADDRESS IpAddress,
  199. DHCP_IP_ADDRESS SubnetMask
  200. );
  201. DWORD
  202. IPAddIPAddress(
  203. LPWSTR AdapterName,
  204. DHCP_IP_ADDRESS Address,
  205. DHCP_IP_ADDRESS SubnetMask
  206. );
  207. DWORD
  208. IPDelIPAddress(
  209. DWORD IpInterfaceContext
  210. );
  211. DWORD
  212. IPResetIPAddress(
  213. DWORD dwInterfaceContext,
  214. DHCP_IP_ADDRESS SubnetMask
  215. );
  216. DWORD
  217. SetIPAddressAndArp(
  218. PVOID pvLocalInformation,
  219. DWORD dwAddress,
  220. DWORD dwSubnetMask
  221. );
  222. DWORD
  223. NetBTSetIPAddress(
  224. LPWSTR DeviceName,
  225. DHCP_IP_ADDRESS IpAddress,
  226. DHCP_IP_ADDRESS SubnetMask
  227. );
  228. DWORD
  229. NetBTResetIPAddress(
  230. LPWSTR DeviceName,
  231. DHCP_IP_ADDRESS SubnetMask
  232. );
  233. DWORD
  234. NetBTNotifyRegChanges(
  235. LPWSTR DeviceName
  236. );
  237. DWORD
  238. SetDefaultGateway(
  239. DWORD Command,
  240. DHCP_IP_ADDRESS GatewayAddress,
  241. DWORD Metric
  242. );
  243. HANDLE
  244. APIENTRY
  245. DhcpOpenGlobalEvent(
  246. void
  247. );
  248. #if defined(_PNP_POWER_) && !defined(VXD)
  249. DWORD
  250. IPGetIPEventRequest(
  251. HANDLE handle,
  252. HANDLE event,
  253. UINT seqNo,
  254. PIP_GET_IP_EVENT_RESPONSE responseBuffer,
  255. DWORD responseBufferSize,
  256. PIO_STATUS_BLOCK ioStatusBlock
  257. );
  258. DWORD
  259. IPCancelIPEventRequest(
  260. HANDLE handle,
  261. PIO_STATUS_BLOCK ioStatusBlock
  262. );
  263. #endif _PNP_POWER_ && !VXD
  264. //
  265. // api.c
  266. //
  267. DWORD
  268. DhcpApiInit(
  269. VOID
  270. );
  271. VOID
  272. DhcpApiCleanup(
  273. VOID
  274. );
  275. DWORD
  276. ProcessApiRequest(
  277. HANDLE PipeHandle,
  278. LPOVERLAPPED Overlap
  279. );
  280. //
  281. // util.c
  282. //
  283. PDHCP_CONTEXT
  284. FindDhcpContextOnNicList(
  285. LPCWSTR AdapterName,
  286. DWORD InterfaceContext
  287. );
  288. //
  289. // dhcp.c
  290. //
  291. DWORD
  292. DhcpCommonInit(
  293. VOID
  294. );
  295. DWORD
  296. SetIpConfigurationForNIC(
  297. HKEY KeyHandle,
  298. PDHCP_CONTEXT DhcpContext,
  299. PDHCP_OPTIONS DhcpOptions,
  300. DHCP_IP_ADDRESS ServerIpAddress,
  301. DWORD dwLeaseTime,
  302. DWORD dwT1Time,
  303. DWORD dwT2Time,
  304. BOOL ObtainedNewAddress
  305. );
  306. #ifdef BOOTPERF
  307. DWORD
  308. DhcpQueryHWInfoEx(
  309. DWORD IpInterfaceContext,
  310. DWORD *pIpInterfaceInstance,
  311. DWORD *pOldIpAddress OPTIONAL,
  312. DWORD *pOldMask OPTIONAL,
  313. BOOL *pfInterfaceDown OPTIONAL,
  314. LPBYTE HardwareAddressType,
  315. LPBYTE *HardwareAddress,
  316. LPDWORD HardwareAddressLength
  317. );
  318. #endif BOOTPERF
  319. DWORD
  320. IPGetWOLCapability(
  321. IN ULONG IfIndex,
  322. OUT PULONG pRetVal
  323. );
  324. DWORD
  325. QueryIfIndex(
  326. IN ULONG IpInterfaceContext,
  327. IN ULONG IpInterfaceInstance
  328. );
  329. BOOL
  330. IsUnidirectionalAdapter(
  331. IN DWORD IpInterfaceContext
  332. );