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.

664 lines
20 KiB

  1. //========================================================================
  2. // Copyright (C) 1997 Microsoft Corporation
  3. // Author: RameshV
  4. // Description: This file has been generated. Pl look at the .c file
  5. //========================================================================
  6. typedef struct _REG_HANDLE {
  7. HKEY Key;
  8. HKEY SubKey;
  9. LPWSTR SubKeyLocation;
  10. } REG_HANDLE, *PREG_HANDLE, *LPREG_HANDLE;
  11. #define REG_THIS_SERVER L"Software\\Microsoft\\DHCPServer\\Configuration"
  12. #define REG_THIS_SERVER_DS L"Software\\Microsoft\\DHCPServer\\Config_DS"
  13. #define REG_THIS_SERVER_DS_VALUE L"Config_DS"
  14. #define REG_THIS_SERVER_DS_PARENT L"Software\\Microsoft\\DHCPServer"
  15. #define REG_SERVER_GLOBAL_OPTIONS L"GlobalOptionValues"
  16. #define REG_SERVER_OPTDEFS L"OptionInfo"
  17. #define REG_SERVER_SUBNETS L"Subnets"
  18. #define REG_SERVER_SSCOPES L"SuperScope"
  19. #define REG_SERVER_CLASSDEFS L"ClassDefs"
  20. #define REG_SERVER_MSCOPES L"MulticastScopes"
  21. #define REG_SUBNET_SERVERS L"DHCPServers"
  22. #define REG_SUBNET_RANGES L"IpRanges"
  23. #define REG_SUBNET_RESERVATIONS L"ReservedIps"
  24. #define REG_SUBNET_OPTIONS L"SubnetOptions"
  25. #define REG_SUBNET_EXCL L"ExcludedIpRanges"
  26. #define REG_SUBNET_ADDRESS L"SubnetAddress"
  27. #define REG_SUBNET_NAME L"SubnetName"
  28. #define REG_SUBNET_COMMENT L"SubnetComment"
  29. #define REG_SUBNET_MASK L"SubnetMask"
  30. #define REG_SUBNET_STATE L"SubnetState"
  31. #define REG_SUBNET_SWITCHED_FLAG L"SwitchedNetworkFlag"
  32. #define REG_MSCOPE_NAME L"MScopeName"
  33. #define REG_MSCOPE_COMMENT L"MScopeComment"
  34. #define REG_MSCOPE_SCOPEID L"MScopeIdValue"
  35. #define REG_MSCOPE_STATE L"MScopeState"
  36. #define REG_MSCOPE_ADDR_POLICY L"MScopeAddressPolicy"
  37. #define REG_MSCOPE_TTL L"MScopeTTL"
  38. #define REG_MSCOPE_LANG_TAG L"MScopeLangTag"
  39. #define REG_MSCOPE_EXPIRY_TIME L"MScopeExpiryTime"
  40. #define REG_SUB_SERVER_NAME L"ServerHostName"
  41. #define REG_SUB_SERVER_COMMENT L"ServerComment"
  42. #define REG_SUB_SERVER_ADDRESS L"ServerAddress"
  43. #define REG_SUB_SERVER_ROLE L"Role"
  44. #define REG_RANGE_NAME L"RangeName"
  45. #define REG_RANGE_COMMENT L"RangeComment"
  46. #define REG_RANGE_START_ADDRESS L"StartAddress"
  47. #define REG_RANGE_END_ADDRESS L"EndAddress"
  48. #define REG_RANGE_INUSE_CLUSTERS L"InUseClusters"
  49. #define REG_RANGE_USED_CLUSTERS L"UsedClusters"
  50. #define REG_RANGE_BITS_PREFIX L"Bits "
  51. #define REG_RANGE_BITS_PREFIX_WCHAR_COUNT (5)
  52. #define REG_RANGE_FLAGS L"RangeFlags"
  53. #define REG_RANGE_ALLOC L"RangeBootpAllocated"
  54. #define REG_RANGE_MAX_ALLOC L"RangeBootpMaxAllowed"
  55. #define REG_OPTION_NAME L"OptionName"
  56. #define REG_OPTION_COMMENT L"OptionComment"
  57. #define REG_OPTION_TYPE L"OptionType"
  58. #define REG_OPTION_VALUE L"OptionValue"
  59. #define REG_OPTION_ID L"OptionId"
  60. #define REG_OPTION_CLASSNAME L"OptionClassName"
  61. #define REG_OPTION_VENDORNAME L"OptionVendorName"
  62. #define REG_CLASSDEF_NAME L"ClassName"
  63. #define REG_CLASSDEF_COMMENT L"ClassComment"
  64. #define REG_CLASSDEF_TYPE L"ClassType"
  65. #define REG_CLASSDEF_VALUE L"ClassValue"
  66. #define REG_RESERVATION_ADDRESS L"IpAddress"
  67. #define REG_RESERVATION_UID L"ClientUID"
  68. #define REG_RESERVATION_TYPE L"AllowedClientTypes"
  69. #define REG_RESERVATION_NAME L"ReservationName"
  70. #define REG_RESERVATION_COMMENT L"ReservationComment"
  71. #define REG_FLAGS L"Flags"
  72. #define REG_ACCESS KEY_ALL_ACCESS
  73. #define REG_DEFAULT_SUBNET_STATE 0
  74. #define REG_DEFAULT_SUBNET_MASK 0xFFFFFFFF
  75. #define REG_DEFAULT_SWITCHED_FLAG FALSE
  76. #define REG_CLASS L"DhcpClass"
  77. #define DHCP_LAST_DOWNLOAD_TIME_VALUE L"LastDownloadTime"
  78. #define DHCP_LAST_DOWNLOAD_TIME_TYPE REG_BINARY
  79. #define DEF_RANGE_ALLOC 0
  80. #define DEF_RANGE_MAX_ALLOC (~(ULONG)0)
  81. //================================================================================
  82. // The basic open/traverse/close functions are here
  83. //================================================================================
  84. DWORD
  85. DhcpRegSetCurrentServer(
  86. IN OUT PREG_HANDLE Hdl
  87. ) ;
  88. DWORD
  89. DhcpRegGetThisServer(
  90. IN OUT PREG_HANDLE Hdl
  91. ) ;
  92. DWORD
  93. DhcpRegGetNextHdl(
  94. IN PREG_HANDLE Hdl,
  95. IN LPWSTR NextLoc,
  96. OUT PREG_HANDLE OutHdl
  97. ) ;
  98. DWORD
  99. DhcpRegCloseHdl(
  100. IN OUT PREG_HANDLE Hdl
  101. ) ;
  102. //================================================================================
  103. // MISC utilities for registry manipulation
  104. //================================================================================
  105. DWORD
  106. DhcpRegFillSubKeys(
  107. IN PREG_HANDLE Hdl,
  108. IN OUT PARRAY Array // fill in a list of key names
  109. ) ;
  110. LPVOID // DWORD or LPWSTR or LPBYTE
  111. DhcpRegRead( // read differnt values from registry and allocate if not DWORD
  112. IN PREG_HANDLE Hdl,
  113. IN DWORD Type, // if DWORD dont allocate memory
  114. IN LPWSTR ValueName,
  115. IN LPVOID RetValue // value to use if nothing found
  116. ) ;
  117. DWORD
  118. DhcpRegReadBinary( // read binary type
  119. IN PREG_HANDLE Hdl,
  120. IN LPWSTR ValueName,
  121. OUT LPBYTE *RetVal,
  122. OUT DWORD *RetValSize
  123. ) ;
  124. LPWSTR
  125. DhcpRegCombineClassAndOption( // create string based on class name and option id
  126. IN LPWSTR ClassName,
  127. IN LPWSTR VendorName,
  128. IN DWORD OptionId
  129. ) ;
  130. LPWSTR
  131. ConvertAddressToLPWSTR(
  132. IN DWORD Address,
  133. IN OUT LPWSTR BufferStr // input buffer to fill with dotted notation
  134. ) ;
  135. //================================================================================
  136. // the following functions help traversing the registry
  137. //================================================================================
  138. DWORD
  139. DhcpRegServerGetSubnetHdl(
  140. IN PREG_HANDLE Hdl,
  141. IN LPWSTR Subnet,
  142. OUT PREG_HANDLE Hdl2
  143. ) ;
  144. DWORD
  145. DhcpRegServerGetSScopeHdl(
  146. IN PREG_HANDLE Hdl,
  147. IN LPWSTR SScope,
  148. OUT PREG_HANDLE Hdl2
  149. ) ;
  150. DWORD
  151. DhcpRegServerGetOptDefHdl(
  152. IN PREG_HANDLE Hdl,
  153. IN LPWSTR OptDef,
  154. OUT PREG_HANDLE Hdl2
  155. ) ;
  156. DWORD
  157. DhcpRegServerGetOptHdl(
  158. IN PREG_HANDLE Hdl,
  159. IN LPWSTR Opt,
  160. OUT PREG_HANDLE Hdl2
  161. ) ;
  162. DWORD
  163. DhcpRegServerGetMScopeHdl(
  164. IN PREG_HANDLE Hdl,
  165. IN LPWSTR MScope,
  166. OUT PREG_HANDLE Hdl2
  167. ) ;
  168. DWORD
  169. DhcpRegServerGetClassDefHdl(
  170. IN PREG_HANDLE Hdl,
  171. IN LPWSTR ClassDef,
  172. OUT PREG_HANDLE Hdl2
  173. ) ;
  174. DWORD
  175. DhcpRegSubnetGetOptHdl(
  176. IN PREG_HANDLE Hdl,
  177. IN LPWSTR Opt,
  178. OUT PREG_HANDLE Hdl2
  179. ) ;
  180. DWORD
  181. DhcpRegSubnetGetRangeHdl(
  182. IN PREG_HANDLE Hdl,
  183. IN LPWSTR Range,
  184. OUT PREG_HANDLE Hdl2
  185. ) ;
  186. DWORD
  187. DhcpRegSubnetGetReservationHdl(
  188. IN PREG_HANDLE Hdl,
  189. IN LPWSTR Reservation,
  190. OUT PREG_HANDLE Hdl2
  191. ) ;
  192. DWORD
  193. DhcpRegSubnetGetServerHdl(
  194. IN PREG_HANDLE Hdl,
  195. IN LPWSTR Server,
  196. OUT PREG_HANDLE Hdl2
  197. ) ;
  198. DWORD
  199. DhcpRegReservationGetOptHdl(
  200. IN PREG_HANDLE Hdl,
  201. IN LPWSTR OptionName,
  202. OUT PREG_HANDLE Hdl2
  203. ) ;
  204. //================================================================================
  205. // List retrieval functions.. for servers, subnets, ranges etc.
  206. //================================================================================
  207. DWORD
  208. DhcpRegServerGetList(
  209. IN PREG_HANDLE Hdl, // ptr to server location
  210. IN OUT PARRAY OptList, // list of LPWSTR options
  211. IN OUT PARRAY OptDefList, // list of LPWSTR optdefs
  212. IN OUT PARRAY Subnets, // list of LPWSTR subnets
  213. IN OUT PARRAY SScopes, // list of LPWSTR sscopes
  214. IN OUT PARRAY ClassDefs, // list of LPWSTR classes
  215. IN OUT PARRAY MScopes // list of LPWSTR mscopes
  216. ) ;
  217. DWORD
  218. DhcpRegSubnetGetExclusions(
  219. IN PREG_HANDLE Hdl,
  220. OUT LPBYTE *Excl,
  221. OUT DWORD *ExclSize
  222. ) ;
  223. DWORD
  224. DhcpRegSubnetGetList(
  225. IN PREG_HANDLE Hdl,
  226. IN OUT PARRAY Servers,
  227. IN OUT PARRAY IpRanges,
  228. IN OUT PARRAY Reservations,
  229. IN OUT PARRAY Options,
  230. OUT LPBYTE *Excl,
  231. OUT DWORD *ExclSizeInBytes
  232. ) ;
  233. DWORD
  234. DhcpRegSScopeGetList(
  235. IN PREG_HANDLE Hdl,
  236. IN OUT PARRAY Subnets
  237. ) ;
  238. DWORD
  239. DhcpRegReservationGetList(
  240. IN PREG_HANDLE Hdl,
  241. IN OUT PARRAY Options
  242. ) ;
  243. //================================================================================
  244. // the separate stuff are here -- these are not list stuff, but just simple
  245. // single valued attributes
  246. // some of these actually, dont even go to the registry, but that's fine alright?
  247. //================================================================================
  248. DWORD
  249. DhcpRegServerGetAttributes(
  250. IN PREG_HANDLE Hdl,
  251. OUT LPWSTR *Name,
  252. OUT LPWSTR *Comment,
  253. OUT DWORD *Flags
  254. // more attributes will come here soon?
  255. ) ;
  256. DWORD
  257. DhcpRegSubnetGetAttributes(
  258. IN PREG_HANDLE Hdl,
  259. OUT LPWSTR *Name,
  260. OUT LPWSTR *Comment,
  261. OUT DWORD *Flags,
  262. OUT DWORD *Address,
  263. OUT DWORD *Mask
  264. ) ;
  265. DWORD
  266. DhcpRegMScopeGetAttributes(
  267. IN PREG_HANDLE Hdl,
  268. OUT LPWSTR *Comments,
  269. OUT DWORD *State,
  270. OUT DWORD *ScopeId,
  271. OUT DWORD *Policy,
  272. OUT DWORD *TTL,
  273. OUT LPWSTR *LangTag,
  274. OUT PDATE_TIME *ExpiryTime
  275. ) ;
  276. DWORD
  277. DhcpRegOptDefGetAttributes(
  278. IN PREG_HANDLE Hdl,
  279. OUT LPWSTR *Name,
  280. OUT LPWSTR *Comments,
  281. OUT DWORD *Flags,
  282. OUT DWORD *OptionId,
  283. OUT LPWSTR *ClassName,
  284. OUT LPWSTR *VendorName,
  285. OUT LPBYTE *Value,
  286. OUT DWORD *ValueSize
  287. ) ;
  288. DWORD
  289. DhcpRegSScopeGetAttributes( // superscopes dont have any information stored.. dont use this
  290. IN PREG_HANDLE Hdl,
  291. OUT LPWSTR *Name,
  292. OUT LPWSTR *Comment,
  293. OUT DWORD *Flags
  294. ) ;
  295. DWORD
  296. DhcpRegClassDefGetAttributes(
  297. IN PREG_HANDLE Hdl,
  298. OUT LPWSTR *Name,
  299. OUT LPWSTR *Comment,
  300. OUT DWORD *Flags,
  301. OUT LPBYTE *Value,
  302. OUT DWORD *ValueSize
  303. ) ;
  304. DWORD
  305. DhcpRegSubnetServerGetAttributes(
  306. IN PREG_HANDLE Hdl,
  307. OUT LPWSTR *Name,
  308. OUT LPWSTR *Comment,
  309. OUT DWORD *Flags,
  310. OUT DWORD *Address,
  311. OUT DWORD *Role
  312. ) ;
  313. DWORD
  314. DhcpRegRangeGetAttributes(
  315. IN PREG_HANDLE Hdl,
  316. OUT LPWSTR *Name,
  317. OUT LPWSTR *Comment,
  318. OUT DWORD *Flags,
  319. OUT ULONG *AllocCount,
  320. OUT ULONG *MaxAllocCount,
  321. OUT DWORD *StartAddress,
  322. OUT DWORD *EndAddress,
  323. OUT LPBYTE *InUseClusters,
  324. OUT DWORD *InUseClusterSize,
  325. OUT LPBYTE *UsedClusters,
  326. OUT DWORD *UsedClustersSize
  327. ) ;
  328. DWORD
  329. DhcpRegReservationGetAttributes(
  330. IN PREG_HANDLE Hdl,
  331. OUT LPWSTR *Name,
  332. OUT LPWSTR *Comment,
  333. OUT DWORD *Flags,
  334. OUT DWORD *Address,
  335. OUT LPBYTE *ClientUID,
  336. OUT DWORD *ClientUIDSize
  337. ) ;
  338. DWORD
  339. DhcpRegOptGetAttributes(
  340. IN PREG_HANDLE Hdl,
  341. OUT DWORD *OptionId,
  342. OUT LPWSTR *ClassName,
  343. OUT LPWSTR *VendorName,
  344. OUT DWORD *Flags,
  345. OUT LPBYTE *Value,
  346. OUT DWORD *ValueSize
  347. ) ;
  348. //================================================================================
  349. // the following functiosn help in writing to the registry
  350. //================================================================================
  351. DWORD
  352. DhcpRegSaveSubKeys(
  353. IN PREG_HANDLE Hdl,
  354. IN OUT PARRAY Array
  355. ) ;
  356. DWORD
  357. DhcpRegSaveSubKeysPrefixed(
  358. IN PREG_HANDLE Hdl,
  359. IN OUT PARRAY Array,
  360. IN LPWSTR CommonPrefix
  361. ) ;
  362. DWORD
  363. DhcpRegServerSetList(
  364. IN PREG_HANDLE Hdl,
  365. IN PARRAY OptList, // list of LPWSTR options
  366. IN PARRAY OptDefList, // list of LPWSTR optdefs
  367. IN PARRAY Subnets, // list of LPWSTR subnets
  368. IN PARRAY SScopes, // list of LPWSTR sscopes
  369. IN PARRAY ClassDefs, // list of LPWSTR classes
  370. IN PARRAY MScopes // list of LPWSTR mscopes
  371. ) ;
  372. DWORD
  373. DhcpRegSubnetSetExclusions(
  374. IN PREG_HANDLE Hdl,
  375. IN LPBYTE *Excl,
  376. IN DWORD ExclSize
  377. ) ;
  378. DWORD
  379. DhcpRegSubnetSetList(
  380. IN PREG_HANDLE Hdl,
  381. IN PARRAY Servers,
  382. IN PARRAY IpRanges,
  383. IN PARRAY Reservations,
  384. IN PARRAY Options,
  385. IN LPBYTE *Excl,
  386. IN DWORD ExclSizeInBytes
  387. ) ;
  388. DWORD
  389. DhcpRegSScopeSetList(
  390. IN PREG_HANDLE Hdl,
  391. IN OUT PARRAY Subnets
  392. ) ;
  393. DWORD
  394. DhcpRegReservationSetList(
  395. IN PREG_HANDLE Hdl,
  396. IN PARRAY Subnets
  397. ) ;
  398. //================================================================================
  399. // the single stuff are here -- these are not list stuff, but just simple
  400. // single valued attributes
  401. // some of these actually, dont even go to the registry, but that's fine alright?
  402. //================================================================================
  403. DWORD
  404. DhcpRegServerSetAttributes(
  405. IN PREG_HANDLE Hdl,
  406. IN LPWSTR *Name,
  407. IN LPWSTR *Comment,
  408. IN DWORD *Flags
  409. // more attributes will come here soon?
  410. ) ;
  411. DWORD
  412. DhcpRegSubnetSetAttributes(
  413. IN PREG_HANDLE Hdl,
  414. IN LPWSTR *Name,
  415. IN LPWSTR *Comment,
  416. IN DWORD *Flags,
  417. IN DWORD *Address,
  418. IN DWORD *Mask
  419. ) ;
  420. DWORD
  421. DhcpRegMScopeSetAttributes(
  422. IN PREG_HANDLE Hdl,
  423. IN LPWSTR *Comments,
  424. IN DWORD *State,
  425. IN DWORD *ScopeId,
  426. IN DWORD *Policy,
  427. IN DWORD *TTL,
  428. IN LPWSTR *LangTag,
  429. IN PDATE_TIME *ExpiryTime
  430. ) ;
  431. DWORD
  432. DhcpRegOptDefSetAttributes(
  433. IN PREG_HANDLE Hdl,
  434. IN LPWSTR *Name,
  435. IN LPWSTR *Comments,
  436. IN DWORD *Flags,
  437. IN DWORD *OptionId,
  438. IN LPWSTR *ClassName,
  439. IN LPWSTR *VendorName,
  440. IN LPBYTE *Value,
  441. IN DWORD ValueSize
  442. ) ;
  443. DWORD
  444. DhcpRegSScopeSetAttributes( // superscopes dont have any information stored.. dont use this
  445. IN PREG_HANDLE Hdl,
  446. IN LPWSTR *Name,
  447. IN LPWSTR *Comment,
  448. IN DWORD *Flags
  449. ) ;
  450. DWORD
  451. DhcpRegClassDefSetAttributes(
  452. IN PREG_HANDLE Hdl,
  453. IN LPWSTR *Name,
  454. IN LPWSTR *Comment,
  455. IN DWORD *Flags,
  456. IN LPBYTE *Value,
  457. IN DWORD ValueSize
  458. ) ;
  459. DWORD
  460. DhcpRegSubnetServerSetAttributes(
  461. IN PREG_HANDLE Hdl,
  462. IN LPWSTR *Name,
  463. IN LPWSTR *Comment,
  464. IN DWORD *Flags,
  465. IN DWORD *Address,
  466. IN DWORD *Role
  467. ) ;
  468. DWORD
  469. DhcpRegRangeSetAttributes(
  470. IN PREG_HANDLE Hdl,
  471. IN LPWSTR *Name,
  472. IN LPWSTR *Comment,
  473. IN DWORD *Flags,
  474. IN ULONG *AllocCount,
  475. IN ULONG *MaxAllocCount,
  476. IN DWORD *StartAddress,
  477. IN DWORD *EndAddress,
  478. IN LPBYTE *InUseClusters,
  479. IN DWORD InUseClusterSize,
  480. IN LPBYTE *UsedClusters,
  481. IN DWORD UsedClustersSize
  482. ) ;
  483. DWORD
  484. DhcpRegReservationSetAttributes(
  485. IN PREG_HANDLE Hdl,
  486. IN LPWSTR *Name,
  487. IN LPWSTR *Comment,
  488. IN DWORD *Flags,
  489. IN DWORD *Address,
  490. IN LPBYTE *ClientUID,
  491. IN DWORD ClientUIDSize
  492. ) ;
  493. DWORD
  494. DhcpRegOptSetAttributes(
  495. IN PREG_HANDLE Hdl,
  496. IN DWORD *OptionId,
  497. IN LPWSTR *ClassName,
  498. IN LPWSTR *VendorName,
  499. IN DWORD *Flags,
  500. IN LPBYTE *Value,
  501. IN DWORD ValueSize
  502. ) ;
  503. DWORD
  504. DhcpRegRecurseDelete(
  505. IN PREG_HANDLE Hdl,
  506. IN LPWSTR KeyName
  507. ) ;
  508. DWORD
  509. DhcpRegRecurseDeleteBunch(
  510. IN PREG_HANDLE Hdl,
  511. IN PARRAY KeysArray
  512. ) ;
  513. DWORD
  514. DhcpRegUpdateTime( // update the last modified time
  515. VOID
  516. ) ;
  517. //========================================================================
  518. // end of file
  519. //========================================================================