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.

459 lines
15 KiB

  1. //--------------------------------------------------------------------------------
  2. // This is the newer RPC interface. Apparently, the old one had to be
  3. // hand checked in. I do not want to handle the extra trouble of keeping up
  4. // with the old interface. So, I am just creating a new one for NT5.0.
  5. // Please check dhcp.idl for old interface.
  6. //--------------------------------------------------------------------------------
  7. //
  8. // New interface.
  9. //
  10. //
  11. [
  12. uuid(5b821720-f63b-11d0-aad2-00c04fc324db),
  13. version(1.0),
  14. pointer_default(unique)
  15. ]
  16. interface dhcpsrv2
  17. //
  18. // New interface body
  19. //
  20. {
  21. import "imports.idl";
  22. typedef [handle] LPWSTR DHCP_SRV_HANDLE;
  23. DWORD
  24. R_DhcpEnumSubnetClientsV5(
  25. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  26. [in] DHCP_IP_ADDRESS SubnetAddress,
  27. [in, out] DHCP_RESUME_HANDLE *ResumeHandle,
  28. [in] DWORD PreferredMaximum,
  29. [out] LPDHCP_CLIENT_INFO_ARRAY_V5 *ClientInfo,
  30. [out] DWORD *ClientsRead,
  31. [out] DWORD *ClientsTotal
  32. );
  33. //
  34. // MDHCP Apis
  35. //
  36. DWORD
  37. R_DhcpSetMScopeInfo(
  38. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  39. [in, ref, string] WCHAR *MScopeName,
  40. [in, ref] LPDHCP_MSCOPE_INFO MScopeInfo,
  41. [in] BOOL NewScope
  42. );
  43. DWORD
  44. R_DhcpGetMScopeInfo(
  45. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  46. [in, ref, string] WCHAR *MScopeName,
  47. [out] LPDHCP_MSCOPE_INFO *MScopeInfo
  48. );
  49. DWORD
  50. R_DhcpEnumMScopes(
  51. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  52. [in, out] DHCP_RESUME_HANDLE *ResumeHandle,
  53. [in] DWORD PreferredMaximum,
  54. [out] LPDHCP_MSCOPE_TABLE *MScopeTable,
  55. [out] DWORD *ElementsRead,
  56. [out] DWORD *ElementsTotal
  57. );
  58. DWORD
  59. R_DhcpAddMScopeElement(
  60. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  61. [in, ref, string] WCHAR *MScopeName,
  62. [in, ref] LPDHCP_SUBNET_ELEMENT_DATA_V4 AddElementInfo
  63. );
  64. DWORD
  65. R_DhcpEnumMScopeElements(
  66. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  67. [in, ref, string] WCHAR *MScopeName,
  68. [in] DHCP_SUBNET_ELEMENT_TYPE EnumElementType,
  69. [in, out] DHCP_RESUME_HANDLE *ResumeHandle,
  70. [in] DWORD PreferredMaximum,
  71. [out] LPDHCP_SUBNET_ELEMENT_INFO_ARRAY_V4 *EnumElementInfo,
  72. [out] DWORD *ElementsRead,
  73. [out] DWORD *ElementsTotal
  74. );
  75. DWORD
  76. R_DhcpRemoveMScopeElement(
  77. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  78. [in, ref, string] WCHAR *MScopeName,
  79. [in, ref] LPDHCP_SUBNET_ELEMENT_DATA_V4 RemoveElementInfo,
  80. [in] DHCP_FORCE_FLAG ForceFlag
  81. );
  82. DWORD
  83. R_DhcpDeleteMScope(
  84. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  85. [in, ref, string] WCHAR *MScopeName,
  86. [in] DHCP_FORCE_FLAG ForceFlag
  87. );
  88. DWORD
  89. R_DhcpScanMDatabase(
  90. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  91. [in, ref, string] WCHAR *MScopeName,
  92. [in] DWORD FixFlag,
  93. [out] LPDHCP_SCAN_LIST *ScanList
  94. );
  95. //
  96. // Client APIs
  97. //
  98. DWORD
  99. R_DhcpCreateMClientInfo(
  100. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  101. [in, ref, string] WCHAR *MScopeName,
  102. [in, ref] LPDHCP_MCLIENT_INFO ClientInfo
  103. );
  104. DWORD
  105. R_DhcpSetMClientInfo(
  106. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  107. [in, ref] LPDHCP_MCLIENT_INFO ClientInfo
  108. );
  109. DWORD
  110. R_DhcpGetMClientInfo(
  111. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  112. [in, ref] LPDHCP_SEARCH_INFO SearchInfo,
  113. [out] LPDHCP_MCLIENT_INFO *ClientInfo
  114. );
  115. DWORD
  116. R_DhcpDeleteMClientInfo(
  117. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  118. [in, ref] LPDHCP_SEARCH_INFO ClientInfo
  119. );
  120. DWORD
  121. R_DhcpEnumMScopeClients(
  122. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  123. [in, ref, string] WCHAR *MScopeName,
  124. [in, out] DHCP_RESUME_HANDLE *ResumeHandle,
  125. [in] DWORD PreferredMaximum,
  126. [out] LPDHCP_MCLIENT_INFO_ARRAY *ClientInfo,
  127. [out] DWORD *ClientsRead,
  128. [out] DWORD *ClientsTotal
  129. );
  130. DWORD // ERROR_DHCP_OPTION_EXITS if option is already there
  131. R_DhcpCreateOptionV5( // create a new option (must not exist)
  132. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  133. [in] DWORD Flags,
  134. [in] DHCP_OPTION_ID OptionId, // must be between 0-255 or 256-511 (for vendor stuff)
  135. [in, string, unique] WCHAR* ClassName,
  136. [in, string, unique] WCHAR* VendorName,
  137. [in] LPDHCP_OPTION OptionInfo
  138. ) ;
  139. DWORD // ERROR_DHCP_OPTION_NOT_PRESENT if option does not exist
  140. R_DhcpSetOptionInfoV5( // Modify existing option's fields
  141. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  142. [in] DWORD Flags,
  143. [in] DHCP_OPTION_ID OptionID,
  144. [in, string, unique] WCHAR* ClassName,
  145. [in, string, unique] WCHAR* VendorName,
  146. [in] LPDHCP_OPTION OptionInfo
  147. ) ;
  148. DWORD // ERROR_DHCP_OPTION_NOT_PRESENT
  149. R_DhcpGetOptionInfoV5( // retrieve the information from off the mem structures
  150. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  151. [in] DWORD Flags,
  152. [in] DHCP_OPTION_ID OptionID,
  153. [in, string, unique] WCHAR* ClassName,
  154. [in, string, unique] WCHAR* VendorName,
  155. [out] LPDHCP_OPTION *OptionInfo // allocate memory using MIDL functions
  156. ) ;
  157. DWORD // ERROR_DHCP_OPTION_NOT_PRESENT if option does not exist
  158. R_DhcpEnumOptionsV5( // enumerate the options defined
  159. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  160. [in] DWORD Flags,
  161. [in, string, unique] WCHAR* ClassName,
  162. [in, string, unique] WCHAR* VendorName,
  163. [in, out] DHCP_RESUME_HANDLE *ResumeHandle, // must be zero intially and then never touched
  164. [in] DWORD PreferredMaximum, // max # of bytes of info to pass along
  165. [out] LPDHCP_OPTION_ARRAY *Options, // fill this option array
  166. [out] DWORD *OptionsRead, // fill in the # of options read
  167. [out] DWORD *OptionsTotal // fill in the total # here
  168. ) ;
  169. DWORD // ERROR_DHCP_OPTION_NOT_PRESENT if option not existent
  170. R_DhcpRemoveOptionV5( // remove the option definition from the registry
  171. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  172. [in] DWORD Flags,
  173. [in] DHCP_OPTION_ID OptionID,
  174. [in, string, unique] WCHAR* ClassName,
  175. [in, string, unique] WCHAR* VendorName
  176. ) ;
  177. DWORD // OPTION_NOT_PRESENT if option is not defined
  178. R_DhcpSetOptionValueV5( // replace or add a new option value
  179. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  180. [in] DWORD Flags,
  181. [in] DHCP_OPTION_ID OptionId,
  182. [in, string, unique] WCHAR* ClassName,
  183. [in, string, unique] WCHAR* VendorName,
  184. [in] LPDHCP_OPTION_SCOPE_INFO ScopeInfo,
  185. [in] LPDHCP_OPTION_DATA OptionValue
  186. ) ;
  187. DWORD // not atomic!!!!
  188. R_DhcpSetOptionValuesV5( // set a bunch of options
  189. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  190. [in] DWORD Flags,
  191. [in, string, unique] WCHAR* ClassName,
  192. [in, string, unique] WCHAR* VendorName,
  193. [in] LPDHCP_OPTION_SCOPE_INFO ScopeInfo,
  194. [in] LPDHCP_OPTION_VALUE_ARRAY OptionValues
  195. ) ;
  196. DWORD
  197. R_DhcpGetOptionValueV5( // fetch the required option at required level
  198. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  199. [in] DWORD Flags,
  200. [in] DHCP_OPTION_ID OptionID,
  201. [in, string, unique] WCHAR* ClassName,
  202. [in, string, unique] WCHAR* VendorName,
  203. [in] LPDHCP_OPTION_SCOPE_INFO ScopeInfo,
  204. [out] LPDHCP_OPTION_VALUE *OptionValue // allocate memory using MIDL_user_allocate
  205. ) ;
  206. DWORD
  207. R_DhcpEnumOptionValuesV5(
  208. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  209. [in] DWORD Flags,
  210. [in, string, unique] WCHAR* ClassName,
  211. [in, string, unique] WCHAR* VendorName,
  212. [in] LPDHCP_OPTION_SCOPE_INFO ScopeInfo,
  213. [in,out] DHCP_RESUME_HANDLE *ResumeHandle,
  214. [in] DWORD PreferredMaximum,
  215. [out] LPDHCP_OPTION_VALUE_ARRAY *OptionValues,
  216. [out] DWORD *OptionsRead,
  217. [out] DWORD *OptionsTotal
  218. ) ;
  219. DWORD
  220. R_DhcpRemoveOptionValueV5(
  221. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  222. [in] DWORD Flags,
  223. [in] DHCP_OPTION_ID OptionID,
  224. [in, string, unique] WCHAR* ClassName,
  225. [in, string, unique] WCHAR* VendorName,
  226. [in] LPDHCP_OPTION_SCOPE_INFO ScopeInfo
  227. ) ;
  228. DWORD
  229. R_DhcpCreateClass(
  230. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  231. [in] DWORD ReservedMustBeZero,
  232. [in] LPDHCP_CLASS_INFO ClassInfo
  233. ) ;
  234. DWORD
  235. R_DhcpModifyClass(
  236. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  237. [in] DWORD ReservedMustBeZero,
  238. [in] LPDHCP_CLASS_INFO ClassInfo
  239. ) ;
  240. DWORD
  241. R_DhcpDeleteClass(
  242. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  243. [in] DWORD ReservedMustBeZero,
  244. [in, string, unique] WCHAR* ClassName
  245. ) ;
  246. DWORD
  247. R_DhcpGetClassInfo(
  248. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  249. [in] DWORD ReservedMustBeZero,
  250. [in] LPDHCP_CLASS_INFO PartialClassInfo,
  251. [out] LPDHCP_CLASS_INFO *FilledClassInfo
  252. ) ;
  253. DWORD
  254. R_DhcpEnumClasses(
  255. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  256. [in] DWORD ReservedMustBeZero,
  257. [in,out] DHCP_RESUME_HANDLE *ResumeHandle,
  258. [in] DWORD PreferredMaximum,
  259. [out] LPDHCP_CLASS_INFO_ARRAY *ClassInfoArray,
  260. [out] DWORD *nRead,
  261. [out] DWORD *nTotal
  262. ) ;
  263. DWORD
  264. R_DhcpGetAllOptions(
  265. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  266. [in] DWORD Flags,
  267. [out] LPDHCP_ALL_OPTIONS *OptionStruct
  268. ) ;
  269. DWORD
  270. R_DhcpGetAllOptionValues(
  271. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  272. [in] DWORD Flags,
  273. [in] LPDHCP_OPTION_SCOPE_INFO ScopeInfo,
  274. [out] LPDHCP_ALL_OPTION_VALUES *Values
  275. ) ;
  276. DWORD
  277. R_DhcpGetMCastMibInfo(
  278. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  279. [out] LPDHCP_MCAST_MIB_INFO *MibInfo
  280. );
  281. DWORD
  282. R_DhcpAuditLogSetParams(
  283. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  284. [in] DWORD Flags,
  285. [in, string] LPWSTR AuditLogDir,
  286. [in] DWORD DiskCheckInterval,
  287. [in] DWORD MaxLogFilesSize,
  288. [in] DWORD MinSpaceOnDisk
  289. );
  290. typedef [string] LPWSTR LPWSTR_RPC_STRING;
  291. DWORD
  292. R_DhcpAuditLogGetParams(
  293. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  294. [in] DWORD Flags,
  295. [out] LPWSTR_RPC_STRING *AuditLogDir,
  296. [out] DWORD *DiskCheckInterval,
  297. [out] DWORD *MaxLogFilesSize,
  298. [out] DWORD *MinSpaceOnDisk
  299. );
  300. DWORD
  301. R_DhcpServerQueryAttribute(
  302. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  303. [in] ULONG dwReserved,
  304. [in] DHCP_ATTRIB_ID DhcpAttribId,
  305. [out] LPDHCP_ATTRIB *pDhcpAttrib
  306. );
  307. DWORD
  308. R_DhcpServerQueryAttributes(
  309. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  310. [in] ULONG dwReserved,
  311. // There are 6 attributes. Check DHCP_ATTRIB_* in dhcpapi.w,
  312. [in, range(0,6)] ULONG dwAttribCount,
  313. [in, size_is(dwAttribCount)] LPDHCP_ATTRIB_ID pDhcpAttribs,
  314. [out] LPDHCP_ATTRIB_ARRAY *pDhcpAttribArr
  315. );
  316. DWORD // Status code
  317. R_DhcpServerRedoAuthorization( // retry the rogue server stuff
  318. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  319. [in] ULONG dwReserved
  320. );
  321. DWORD
  322. R_DhcpAddSubnetElementV5(
  323. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  324. [in] DHCP_IP_ADDRESS SubnetAddress,
  325. [in, ref] LPDHCP_SUBNET_ELEMENT_DATA_V5 AddElementInfo
  326. );
  327. DWORD
  328. R_DhcpEnumSubnetElementsV5(
  329. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  330. [in] DHCP_IP_ADDRESS SubnetAddress,
  331. [in] DHCP_SUBNET_ELEMENT_TYPE EnumElementType,
  332. [in, out] DHCP_RESUME_HANDLE *ResumeHandle,
  333. [in] DWORD PreferredMaximum,
  334. [out] LPDHCP_SUBNET_ELEMENT_INFO_ARRAY_V5 *EnumElementInfo,
  335. [out] DWORD *ElementsRead,
  336. [out] DWORD *ElementsTotal
  337. );
  338. DWORD
  339. R_DhcpRemoveSubnetElementV5(
  340. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  341. [in] DHCP_IP_ADDRESS SubnetAddress,
  342. [in, ref] LPDHCP_SUBNET_ELEMENT_DATA_V5 RemoveElementInfo,
  343. [in] DHCP_FORCE_FLAG ForceFlag
  344. );
  345. DWORD
  346. R_DhcpGetServerBindingInfo(
  347. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  348. [in] ULONG Flags,
  349. [out] LPDHCP_BIND_ELEMENT_ARRAY *BindElementsInfo
  350. );
  351. DWORD
  352. R_DhcpSetServerBindingInfo(
  353. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  354. [in] ULONG Flags,
  355. [ref] LPDHCP_BIND_ELEMENT_ARRAY BindElementsInfo
  356. );
  357. DWORD
  358. R_DhcpQueryDnsRegCredentials(
  359. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  360. // 1024 chars name snould be good enough
  361. [in, range( 0, 1024 )] ULONG UnameSize,
  362. [out, size_is(UnameSize)] LPWSTR Uname,
  363. [in, range( 0, 1024 )] ULONG DomainSize,
  364. [out, size_is(UnameSize)] LPWSTR Domain
  365. );
  366. DWORD
  367. R_DhcpSetDnsRegCredentials(
  368. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  369. [in, string, unique] LPWSTR Uname,
  370. [in, string, unique] LPWSTR Domain,
  371. [in, string, unique] LPWSTR Passwd
  372. );
  373. DWORD
  374. R_DhcpBackupDatabase(
  375. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  376. [in, string] LPWSTR Path
  377. );
  378. DWORD
  379. R_DhcpRestoreDatabase(
  380. [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
  381. [in, string] LPWSTR Path
  382. );
  383. }
  384. //================================================================================
  385. // end of file
  386. //================================================================================