1 {******************************************************************************}
2 { }
3 { DHCP Server Management API interface Unit for Object Pascal }
4 { }
5 { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
6 { Corporation. All Rights Reserved. }
7 { }
8 { The original file is: dhcpsapi.h, released Feb 2003. The original Pascal }
9 { code is: DhcpsApi.pas, released December 2003. The initial developer of the }
10 { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
11 { }
12 { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
13 { Marcel van Brakel. All Rights Reserved. }
14 { }
15 { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
16 { }
17 { You may retrieve the latest version of this file at the Project JEDI }
18 { APILIB home page, located at http://jedi-apilib.sourceforge.net }
19 { }
20 { The contents of this file are used with permission, subject to the Mozilla }
21 { Public License Version 1.1 (the "License"); you may not use this file except }
22 { in compliance with the License. You may obtain a copy of the License at }
23 { http://www.mozilla.org/MPL/MPL-1.1.html }
24 { }
25 { Software distributed under the License is distributed on an "AS IS" basis, }
26 { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
27 { the specific language governing rights and limitations under the License. }
28 { }
29 { Alternatively, the contents of this file may be used under the terms of the }
30 { GNU Lesser General Public License (the "LGPL License"), in which case the }
31 { provisions of the LGPL License are applicable instead of those above. }
32 { If you wish to allow use of your version of this file only under the terms }
33 { of the LGPL License and not to allow others to use your version of this file }
34 { under the MPL, indicate your decision by deleting the provisions above and }
35 { replace them with the notice and other provisions required by the LGPL }
36 { License. If you do not delete the provisions above, a recipient may use }
37 { your version of this file under either the MPL or the LGPL License. }
38 { }
39 { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
40 { }
41 {******************************************************************************}
42
43 // $Id: JwaDhcpsApi.pas,v 1.12 2007/09/06 14:57:11 marquardt Exp $
44 {$IFNDEF JWA_OMIT_SECTIONS}
45 unit JwaDhcpsApi;
46
47 {$WEAKPACKAGEUNIT}
48
49 {$ENDIF JWA_OMIT_SECTIONS}
50
51 {$HPPEMIT ''}
52 {$HPPEMIT '#include "dhcpsapi.h"'}
53 {$HPPEMIT ''}
54
55 {$IFNDEF JWA_OMIT_SECTIONS}
56 {$I jediapilib.inc}
57
58 interface
59
60 uses
61 JwaWinType;
62 {$ENDIF JWA_OMIT_SECTIONS}
63
64 {$IFNDEF JWA_IMPLEMENTATIONSECTION}
65
66 type
67 {$IFNDEF JWA_INCLUDEMODE}
68 DHCP_IP_ADDRESS = DWORD;
69 {$ENDIF JWA_INCLUDEMODE}
70
71 {$EXTERNALSYM DHCP_IP_ADDRESS}
72 PDHCP_IP_ADDRESS = ^DHCP_IP_ADDRESS;
73 {$EXTERNALSYM PDHCP_IP_ADDRESS}
74
75 {$IFNDEF JWA_INCLUDEMODE}
76 LPDHCP_IP_ADDRESS = ^DHCP_IP_ADDRESS;
77 {$EXTERNALSYM LPDHCP_IP_ADDRESS}
78 {$ENDIF JWA_INCLUDEMODE}
79
80 {$IFNDEF JWA_INCLUDEMODE}
81 TDhcpIpAddress = DHCP_IP_ADDRESS;
82 PDhcpIpAddress = ^DHCP_IP_ADDRESS;
83 {$ENDIF JWA_INCLUDEMODE}
84
85 DHCP_IP_MASK = DWORD;
86 {$EXTERNALSYM DHCP_IP_MASK}
87 TDhcpIpMask = DHCP_IP_MASK;
88 DHCP_RESUME_HANDLE = DWORD;
89 {$EXTERNALSYM DHCP_RESUME_HANDLE}
90 TDhcpResumeHandle = DHCP_RESUME_HANDLE;
91
92 DHCP_OPTION_ID = DWORD;
93 {$EXTERNALSYM DHCP_OPTION_ID}
94 TDhcpOptionID = DHCP_OPTION_ID;
95
96 _DATE_TIME = record
97 dwLowDateTime: DWORD;
98 dwHighDateTime: DWORD;
99 end;
100 {$EXTERNALSYM _DATE_TIME}
101 DATE_TIME = _DATE_TIME;
102 {$EXTERNALSYM DATE_TIME}
103 LPDATE_TIME = ^DATE_TIME;
104 {$EXTERNALSYM LPDATE_TIME}
105
106 {$IFNDEF JWA_INCLUDEMODE}
107 TDateTime = DATE_TIME;
108 PDateTime = ^DATE_TIME;
109 {$ENDIF JWA_INCLUDEMODE}
110
111 _DWORD_DWORD = record
112 DWord1: DWORD;
113 DWord2: DWORD;
114 end;
115 {$EXTERNALSYM _DWORD_DWORD}
116 DWORD_DWORD = _DWORD_DWORD;
117 {$EXTERNALSYM DWORD_DWORD}
118 LPDWORD_DWORD = ^DWORD_DWORD;
119 {$EXTERNALSYM LPDWORD_DWORD}
120 TDwordDword = DWORD_DWORD;
121 PDwordDword = ^DWORD_DWORD;
122
123 _DHCP_BINARY_DATA = record
124 DataLength: DWORD;
125 Data: LPBYTE;
126 end;
127 {$EXTERNALSYM _DHCP_BINARY_DATA}
128 DHCP_BINARY_DATA = _DHCP_BINARY_DATA;
129 {$EXTERNALSYM DHCP_BINARY_DATA}
130 LPDHCP_BINARY_DATA = ^DHCP_BINARY_DATA;
131 {$EXTERNALSYM LPDHCP_BINARY_DATA}
132 TDhcpBinaryData = DHCP_BINARY_DATA;
133 PDhcpBinaryData = ^DHCP_BINARY_DATA;
134
135 DHCP_CLIENT_UID = DHCP_BINARY_DATA;
136 {$EXTERNALSYM DHCP_CLIENT_UID}
137 TDhcpClientUid = DHCP_CLIENT_UID;
138
139 const
140 DHCP_ENDPOINT_FLAG_CANT_MODIFY = $01;
141 {$EXTERNALSYM DHCP_ENDPOINT_FLAG_CANT_MODIFY}
142
143 type
144 _DHCP_BIND_ELEMENT = record
145 Flags: ULONG;
146 fBoundToDHCPServer: BOOL;
147 AdapterPrimaryAddress: DHCP_IP_ADDRESS;
148 AdapterSubnetAddress: DHCP_IP_ADDRESS;
149 IfDescription: LPWSTR;
150 IfIdSize: ULONG;
151 IfId: LPBYTE;
152 end;
153 {$EXTERNALSYM _DHCP_BIND_ELEMENT}
154 DHCP_BIND_ELEMENT = _DHCP_BIND_ELEMENT;
155 {$EXTERNALSYM DHCP_BIND_ELEMENT}
156 LPDHCP_BIND_ELEMENT = ^DHCP_BIND_ELEMENT;
157 {$EXTERNALSYM LPDHCP_BIND_ELEMENT}
158 TDhcpBindElement = DHCP_BIND_ELEMENT;
159 PDhcpBindElement = ^DHCP_BIND_ELEMENT;
160
161 _DHCP_BIND_ELEMENT_ARRAY = record
162 NumElements: DWORD;
163 Elements: LPDHCP_BIND_ELEMENT; //array
164 end;
165 {$EXTERNALSYM _DHCP_BIND_ELEMENT_ARRAY}
166 DHCP_BIND_ELEMENT_ARRAY = _DHCP_BIND_ELEMENT_ARRAY;
167 {$EXTERNALSYM DHCP_BIND_ELEMENT_ARRAY}
168 LPDHCP_BIND_ELEMENT_ARRAY = ^DHCP_BIND_ELEMENT_ARRAY;
169 {$EXTERNALSYM LPDHCP_BIND_ELEMENT_ARRAY}
170 TDhcpBindElementArray = DHCP_BIND_ELEMENT_ARRAY;
171 PDhcpBindElementArray = ^DHCP_BIND_ELEMENT_ARRAY;
172
173 _DHCP_CLIENT_SEARCH_TYPE = (
174 DhcpClientIpAddress,
175 DhcpClientHardwareAddress,
176 DhcpClientName);
177 {$EXTERNALSYM _DHCP_CLIENT_SEARCH_TYPE}
178 DHCP_SEARCH_INFO_TYPE = _DHCP_CLIENT_SEARCH_TYPE;
179 {$EXTERNALSYM DHCP_SEARCH_INFO_TYPE}
180 LPDHCP_SEARCH_INFO_TYPE = ^DHCP_SEARCH_INFO_TYPE;
181 {$EXTERNALSYM LPDHCP_SEARCH_INFO_TYPE}
182 TDhcpSearchInfoType = DHCP_SEARCH_INFO_TYPE;
183 PDhcpSearchInfoType = ^DHCP_SEARCH_INFO_TYPE;
184
185 _DHCP_CLIENT_SEARCH_UNION = record
186 case Integer of
187 0: (ClientIpAddress: DHCP_IP_ADDRESS);
188 1: (ClientHardwareAddress: DHCP_CLIENT_UID);
189 2: (ClientName: LPWSTR);
190 end;
191 {$EXTERNALSYM _DHCP_CLIENT_SEARCH_UNION}
192
193 _DHCP_CLIENT_SEARCH_INFO = record
194 SearchType: DHCP_SEARCH_INFO_TYPE;
195 SearchInfo: _DHCP_CLIENT_SEARCH_UNION;
196 end;
197 {$EXTERNALSYM _DHCP_CLIENT_SEARCH_INFO}
198 DHCP_SEARCH_INFO = _DHCP_CLIENT_SEARCH_INFO;
199 {$EXTERNALSYM DHCP_SEARCH_INFO}
200 LPDHCP_SEARCH_INFO = ^DHCP_SEARCH_INFO;
201 {$EXTERNALSYM LPDHCP_SEARCH_INFO}
202 TDhcpSearchInfo = DHCP_SEARCH_INFO;
203 PDhcpSearchInfo = ^DHCP_SEARCH_INFO;
204
205 _DHCP_OPTION_SCOPE_TYPE = (
206 DhcpDefaultOptions,
207 DhcpGlobalOptions,
208 DhcpSubnetOptions,
209 DhcpReservedOptions,
210 DhcpMScopeOptions);
211 {$EXTERNALSYM _DHCP_OPTION_SCOPE_TYPE}
212 DHCP_OPTION_SCOPE_TYPE = _DHCP_OPTION_SCOPE_TYPE;
213 {$EXTERNALSYM DHCP_OPTION_SCOPE_TYPE}
214 LPDHCP_OPTION_SCOPE_TYPE = ^DHCP_OPTION_SCOPE_TYPE;
215 {$EXTERNALSYM LPDHCP_OPTION_SCOPE_TYPE}
216 TDhcpOptionScopeType = DHCP_OPTION_SCOPE_TYPE;
217 PDhcpOptionScopeType = ^DHCP_OPTION_SCOPE_TYPE;
218
219 _DHCP_RESERVED_SCOPE = record
220 ReservedIpAddress: DHCP_IP_ADDRESS;
221 ReservedIpSubnetAddress: DHCP_IP_ADDRESS;
222 end;
223 {$EXTERNALSYM _DHCP_RESERVED_SCOPE}
224 DHCP_RESERVED_SCOPE = _DHCP_RESERVED_SCOPE;
225 {$EXTERNALSYM DHCP_RESERVED_SCOPE}
226 LPDHCP_RESERVED_SCOPE = ^DHCP_RESERVED_SCOPE;
227 {$EXTERNALSYM LPDHCP_RESERVED_SCOPE}
228 TDhcpReservedScope = DHCP_RESERVED_SCOPE;
229 PDhcpReservedScope = ^DHCP_RESERVED_SCOPE;
230
231 _DHCP_OPTION_SCOPE_UNION = record
232 case Integer of
233 0: (DefaultScopeInfo: PVOID); // must be NULL
234 1: (GlobalScopeInfo: PVOID); // must be NULL
235 2: (SubnetScopeInfo: DHCP_IP_ADDRESS);
236 3: (ReservedScopeInfo: DHCP_RESERVED_SCOPE);
237 4: (MScopeInfo: LPWSTR);
238 end;
239 {$EXTERNALSYM _DHCP_OPTION_SCOPE_UNION}
240
241 _DHCP_OPTION_SCOPE_INFO = record
242 ScopeType: DHCP_OPTION_SCOPE_TYPE;
243 ScopeInfo: _DHCP_OPTION_SCOPE_UNION;
244 end;
245 {$EXTERNALSYM _DHCP_OPTION_SCOPE_INFO}
246 DHCP_OPTION_SCOPE_INFO = _DHCP_OPTION_SCOPE_INFO;
247 {$EXTERNALSYM DHCP_OPTION_SCOPE_INFO}
248 LPDHCP_OPTION_SCOPE_INFO = ^DHCP_OPTION_SCOPE_INFO;
249 {$EXTERNALSYM LPDHCP_OPTION_SCOPE_INFO}
250 TDhcpOptionScopeInfo = DHCP_OPTION_SCOPE_INFO;
251 PDhcpOptionScopeInfo = ^DHCP_OPTION_SCOPE_INFO;
252
253 _DHCP_HOST_INFO = record
254 IpAddress: DHCP_IP_ADDRESS; // minimum information always available
255 NetBiosName: LPWSTR; // optional information
256 HostName: LPWSTR; // optional information
257 end;
258 {$EXTERNALSYM _DHCP_HOST_INFO}
259 DHCP_HOST_INFO = _DHCP_HOST_INFO;
260 {$EXTERNALSYM DHCP_HOST_INFO}
261 LPDHCP_HOST_INFO = ^DHCP_HOST_INFO;
262 {$EXTERNALSYM LPDHCP_HOST_INFO}
263 TDhcpHostInfo = DHCP_HOST_INFO;
264 PDhcpHostInfo = ^DHCP_HOST_INFO;
265
266 _DHCP_CLIENT_INFO = record
267 ClientIpAddress: DHCP_IP_ADDRESS; // currently assigned IP address.
268 SubnetMask: DHCP_IP_MASK;
269 ClientHardwareAddress: DHCP_CLIENT_UID;
270 ClientName: LPWSTR; // optional.
271 ClientComment: LPWSTR;
272 ClientLeaseExpires: DATE_TIME; // UTC time in FILE_TIME format.
273 OwnerHost: DHCP_HOST_INFO; // host that distributed this IP address.
274 end;
275 {$EXTERNALSYM _DHCP_CLIENT_INFO}
276 DHCP_CLIENT_INFO = _DHCP_CLIENT_INFO;
277 {$EXTERNALSYM DHCP_CLIENT_INFO}
278 LPDHCP_CLIENT_INFO = ^DHCP_CLIENT_INFO;
279 {$EXTERNALSYM LPDHCP_CLIENT_INFO}
280 TDhcpClientInfo = DHCP_CLIENT_INFO;
281 PDhcpClientInfo = ^DHCP_CLIENT_INFO;
282
283 _DHCP_CLIENT_INFO_ARRAY = record
284 NumElements: DWORD;
285 Clients: ^LPDHCP_CLIENT_INFO; // array of pointers\
286 end;
287 {$EXTERNALSYM _DHCP_CLIENT_INFO_ARRAY}
288 DHCP_CLIENT_INFO_ARRAY = _DHCP_CLIENT_INFO_ARRAY;
289 {$EXTERNALSYM DHCP_CLIENT_INFO_ARRAY}
290 LPDHCP_CLIENT_INFO_ARRAY = ^DHCP_CLIENT_INFO_ARRAY;
291 {$EXTERNALSYM LPDHCP_CLIENT_INFO_ARRAY}
292 TDhcpClientInfoArray = DHCP_CLIENT_INFO_ARRAY;
293 PDhcpClientInfoArray = ^DHCP_CLIENT_INFO_ARRAY;
294
295 _DHCP_IP_ARRAY = record
296 NumElements: DWORD;
297 Elements: LPDHCP_IP_ADDRESS; //array
298 end;
299 {$EXTERNALSYM _DHCP_IP_ARRAY}
300 DHCP_IP_ARRAY = _DHCP_IP_ARRAY;
301 {$EXTERNALSYM DHCP_IP_ARRAY}
302 LPDHCP_IP_ARRAY = ^DHCP_IP_ARRAY;
303 {$EXTERNALSYM LPDHCP_IP_ARRAY}
304 TDhcpIpArray = DHCP_IP_ARRAY;
305 PDhcpIpArray = ^DHCP_IP_ARRAY;
306
307 //
308 // Subnet State.
309 //
310 // Currently a Subnet scope can be Enabled or Disabled.
311 //
312 // If the state is Enabled State,
313 // The server distributes address to the client, extends leases and
314 // accepts releases.
315 //
316 // If the state is Disabled State,
317 // The server does not distribute address to any new client, and does
318 // extent (and sends NACK) old leases, but the servers accepts lease
319 // releases.
320 //
321 // The idea behind this subnet state is, when the admin wants to stop
322 // serving a subnet, he moves the state from Enbaled to Disabled so
323 // that the clients from the subnets smoothly move to another servers
324 // serving that subnet. When all or most of the clients move to
325 // another server, the admin can delete the subnet without any force
326 // if no client left in that subnet, otherwise the admin should use
327 // full force to delete the subnet.
328 //
329
330 type
331 _DHCP_SUBNET_STATE = (
332 {$IFDEF COMPILER6_UP}
333 DhcpSubnetEnabled = 0,
334 {$ELSE}
335 DhcpSubnetEnabled,
336 {$ENDIF}
337
338
339 DhcpSubnetDisabled,
340 DhcpSubnetEnabledSwitched,
341 DhcpSubnetDisabledSwitched,
342 DhcpSubnetInvalidState);
343 {$EXTERNALSYM _DHCP_SUBNET_STATE}
344 DHCP_SUBNET_STATE = _DHCP_SUBNET_STATE;
345 {$EXTERNALSYM DHCP_SUBNET_STATE}
346 LPDHCP_SUBNET_STATE = ^DHCP_SUBNET_STATE;
347 {$EXTERNALSYM LPDHCP_SUBNET_STATE}
348 TDhcpSubnetState = DHCP_SUBNET_STATE;
349 PDhcpSubnetState = ^DHCP_SUBNET_STATE;
350
351 //
352 // Subnet related data structures.
353 //
354
355 _DHCP_SUBNET_INFO = record
356 SubnetAddress: DHCP_IP_ADDRESS;
357 SubnetMask: DHCP_IP_MASK;
358 SubnetName: LPWSTR;
359 SubnetComment: LPWSTR;
360 PrimaryHost: DHCP_HOST_INFO;
361 SubnetState: DHCP_SUBNET_STATE;
362 end;
363 {$EXTERNALSYM _DHCP_SUBNET_INFO}
364 DHCP_SUBNET_INFO = _DHCP_SUBNET_INFO;
365 {$EXTERNALSYM DHCP_SUBNET_INFO}
366 LPDHCP_SUBNET_INFO = ^DHCP_SUBNET_INFO;
367 {$EXTERNALSYM LPDHCP_SUBNET_INFO}
368 TDhcpSubnetInfo = DHCP_SUBNET_INFO;
369 PDhcpSubnetInfo = ^DHCP_SUBNET_INFO;
370
371 //
372 // DHCP Options related data structures.
373 //
374
375 _DHCP_OPTION_DATA_TYPE = (
376 DhcpByteOption,
377 DhcpWordOption,
378 DhcpDWordOption,
379 DhcpDWordDWordOption,
380 DhcpIpAddressOption,
381 DhcpStringDataOption,
382 DhcpBinaryDataOption,
383 DhcpEncapsulatedDataOption);
384 {$EXTERNALSYM _DHCP_OPTION_DATA_TYPE}
385 DHCP_OPTION_DATA_TYPE = _DHCP_OPTION_DATA_TYPE;
386 {$EXTERNALSYM DHCP_OPTION_DATA_TYPE}
387 LPDHCP_OPTION_DATA_TYPE = ^DHCP_OPTION_DATA_TYPE;
388 {$EXTERNALSYM LPDHCP_OPTION_DATA_TYPE}
389 TDhcpOptionDataType = DHCP_OPTION_DATA_TYPE;
390 PDhcpOptionDataType = ^DHCP_OPTION_DATA_TYPE;
391
392 _DHCP_OPTION_ELEMENT_UNION = record
393 case Integer of
394 0: (ByteOption: BYTE);
395 1: (WordOption: WORD);
396 2: (DWordOption: DWORD);
397 3: (DWordDWordOption: DWORD_DWORD);
398 4: (IpAddressOption: DHCP_IP_ADDRESS);
399 5: (StringDataOption: LPWSTR);
400 6: (BinaryDataOption: DHCP_BINARY_DATA);
401 7: (EncapsulatedDataOption: DHCP_BINARY_DATA);
402 // for vendor specific information option.
403 end;
404 {$EXTERNALSYM _DHCP_OPTION_ELEMENT_UNION}
405
406 _DHCP_OPTION_DATA_ELEMENT = record
407 OptionType: DHCP_OPTION_DATA_TYPE;
408 Element: _DHCP_OPTION_ELEMENT_UNION;
409 end;
410 {$EXTERNALSYM _DHCP_OPTION_DATA_ELEMENT}
411 DHCP_OPTION_DATA_ELEMENT = _DHCP_OPTION_DATA_ELEMENT;
412 {$EXTERNALSYM DHCP_OPTION_DATA_ELEMENT}
413 LPDHCP_OPTION_DATA_ELEMENT = ^DHCP_OPTION_DATA_ELEMENT;
414 {$EXTERNALSYM LPDHCP_OPTION_DATA_ELEMENT}
415 TDhcpOptionDataElement = DHCP_OPTION_DATA_ELEMENT;
416 PDhcpOptionDataElement = ^DHCP_OPTION_DATA_ELEMENT;
417
418 _DHCP_OPTION_DATA = record
419 NumElements: DWORD; // number of option elements in the pointed array
420 Elements: LPDHCP_OPTION_DATA_ELEMENT; //array
421 end;
422 {$EXTERNALSYM _DHCP_OPTION_DATA}
423 DHCP_OPTION_DATA = _DHCP_OPTION_DATA;
424 {$EXTERNALSYM DHCP_OPTION_DATA}
425 LPDHCP_OPTION_DATA = ^DHCP_OPTION_DATA;
426 {$EXTERNALSYM LPDHCP_OPTION_DATA}
427 TDhcpOptionData = DHCP_OPTION_DATA;
428 PDhcpOptionData = ^DHCP_OPTION_DATA;
429
430 _DHCP_OPTION_VALUE = record
431 OptionID: DHCP_OPTION_ID;
432 Value: DHCP_OPTION_DATA;
433 end;
434 {$EXTERNALSYM _DHCP_OPTION_VALUE}
435 DHCP_OPTION_VALUE = _DHCP_OPTION_VALUE;
436 {$EXTERNALSYM DHCP_OPTION_VALUE}
437 LPDHCP_OPTION_VALUE = ^DHCP_OPTION_VALUE;
438 {$EXTERNALSYM LPDHCP_OPTION_VALUE}
439 TDhcpOptionValue = DHCP_OPTION_VALUE;
440 PDhcpOptionValue = ^DHCP_OPTION_VALUE;
441
442
443
444
DhcpGetVersionnull445 function DhcpGetVersion(ServerIpAddress: LPWSTR; MajorVersion, MinorVersion: LPDWORD): DWORD; stdcall;
446 {$EXTERNALSYM DhcpGetVersion}
DhcpSetServerBindingInfonull447 function DhcpSetServerBindingInfo(ServerIpAddress: PWideChar; Flags: ULONG; BindElementInfo: LPDHCP_BIND_ELEMENT_ARRAY): DWORD; stdcall;
448 {$EXTERNALSYM DhcpSetServerBindingInfo}
DhcpGetServerBindingInfonull449 function DhcpGetServerBindingInfo(ServerIpAddress: PWideChar; Flags: ULONG; out BindElementsInfo: LPDHCP_BIND_ELEMENT_ARRAY): DWORD; stdcall;
450 {$EXTERNALSYM DhcpGetServerBindingInfo}
DhcpCreateClientInfonull451 function DhcpCreateClientInfo(ServerIpAddress: PWideChar; ClientInfo: LPDHCP_CLIENT_INFO): DWORD; stdcall;
452 {$EXTERNALSYM DhcpCreateClientInfo}
DhcpSetClientInfonull453 function DhcpSetClientInfo(ServerIpAddress: PWideChar; ClientInfo: LPDHCP_CLIENT_INFO): DWORD; stdcall;
454 {$EXTERNALSYM DhcpSetClientInfo}
DhcpGetClientInfonull455 function DhcpGetClientInfo(ServerIpAddress: PWideChar; SearchInfo: LPDHCP_SEARCH_INFO; ClientInfo: LPDHCP_CLIENT_INFO): DWORD; stdcall;
456 {$EXTERNALSYM DhcpGetClientInfo}
DhcpDeleteClientInfonull457 function DhcpDeleteClientInfo(ServerIpAddress: PWideChar; ClientInfo: LPDHCP_SEARCH_INFO): DWORD; stdcall;
458 {$EXTERNALSYM DhcpDeleteClientInfo}
DhcpEnumSubnetClientsnull459 function DhcpEnumSubnetClients(ServerIpAddress: PWideChar; SubnetAddress: DHCP_IP_ADDRESS; var ResumeHandle: DHCP_RESUME_HANDLE; PreferredMaximum: DWORD; out ClientInfo: LPDHCP_CLIENT_INFO_ARRAY; out ClientsRead, ClientsTotal: DWORD): DWORD; stdcall;
460 {$EXTERNALSYM DhcpEnumSubnetClients}
DhcpEnumSubnetsnull461 function DhcpEnumSubnets(ServerIpAddress: PWideChar; var ResumeHandle: DHCP_RESUME_HANDLE; PreferredMaximum: DWORD; EnumInfo: LPDHCP_IP_ARRAY; out ElementsRead, ElementsTotal: DWORD): DWORD; stdcall;
462 {$EXTERNALSYM DhcpEnumSubnets}
DhcpGetSubnetInfonull463 function DhcpGetSubnetInfo(ServerIpAddress: PWideChar; SubnetAddress: DHCP_IP_ADDRESS; out SubnetInfo: LPDHCP_SUBNET_INFO): DWORD; stdcall;
464 {$EXTERNALSYM DhcpGetSubnetInfo}
DhcpGetOptionValuenull465 function DhcpGetOptionValue(ServerIpAddress: PWideChar; OptionID: DHCP_OPTION_ID; const ScopeInfo: DHCP_OPTION_SCOPE_INFO; out OptionValue: LPDHCP_OPTION_VALUE): DWORD; stdcall;
466 {$EXTERNALSYM DhcpGetOptionValue}
467 procedure DhcpRpcFreeMemory(BufferPointer: PVOID); stdcall;
468 {$EXTERNALSYM DhcpRpcFreeMemory}
469
470 {$ENDIF JWA_IMPLEMENTATIONSECTION}
471
472 {$IFNDEF JWA_OMIT_SECTIONS}
473 implementation
474 //uses ...
475 {$ENDIF JWA_OMIT_SECTIONS}
476
477
478 {$IFNDEF JWA_INTERFACESECTION}
479
480 {$IFNDEF JWA_INCLUDEMODE}
481 const
482 dhcplib = 'dhcpsapi.dll';
483 {$ENDIF JWA_INCLUDEMODE}
484
485 {$IFDEF DYNAMIC_LINK}
486
487 var
488 _DhcpGetVersion: Pointer;
489
DhcpGetVersionnull490 function DhcpGetVersion;
491 begin
492 GetProcedureAddress(_DhcpGetVersion, dhcplib, 'DhcpGetVersion');
493 asm
494 MOV ESP, EBP
495 POP EBP
496 JMP [_DhcpGetVersion]
497 end;
498 end;
499
500 var
501 _DhcpSetServerBindingInfo: Pointer;
502
DhcpSetServerBindingInfonull503 function DhcpSetServerBindingInfo;
504 begin
505 GetProcedureAddress(_DhcpSetServerBindingInfo, dhcplib, 'DhcpSetServerBindingInfo');
506 asm
507 MOV ESP, EBP
508 POP EBP
509 JMP [_DhcpSetServerBindingInfo]
510 end;
511 end;
512
513 var
514 _DhcpGetServerBindingInfo: Pointer;
515
DhcpGetServerBindingInfonull516 function DhcpGetServerBindingInfo;
517 begin
518 GetProcedureAddress(_DhcpGetServerBindingInfo, dhcplib, 'DhcpGetServerBindingInfo');
519 asm
520 MOV ESP, EBP
521 POP EBP
522 JMP [_DhcpGetServerBindingInfo]
523 end;
524 end;
525
526 var
527 _DhcpCreateClientInfo: Pointer;
528
DhcpCreateClientInfonull529 function DhcpCreateClientInfo;
530 begin
531 GetProcedureAddress(_DhcpCreateClientInfo, dhcplib, 'DhcpCreateClientInfo');
532 asm
533 MOV ESP, EBP
534 POP EBP
535 JMP [_DhcpCreateClientInfo]
536 end;
537 end;
538
539 var
540 _DhcpSetClientInfo: Pointer;
541
DhcpSetClientInfonull542 function DhcpSetClientInfo;
543 begin
544 GetProcedureAddress(_DhcpSetClientInfo, dhcplib, 'DhcpSetClientInfo');
545 asm
546 MOV ESP, EBP
547 POP EBP
548 JMP [_DhcpSetClientInfo]
549 end;
550 end;
551
552 var
553 _DhcpGetClientInfo: Pointer;
554
DhcpGetClientInfonull555 function DhcpGetClientInfo;
556 begin
557 GetProcedureAddress(_DhcpGetClientInfo, dhcplib, 'DhcpGetClientInfo');
558 asm
559 MOV ESP, EBP
560 POP EBP
561 JMP [_DhcpGetClientInfo]
562 end;
563 end;
564
565 var
566 _DhcpDeleteClientInfo: Pointer;
567
DhcpDeleteClientInfonull568 function DhcpDeleteClientInfo;
569 begin
570 GetProcedureAddress(_DhcpDeleteClientInfo, dhcplib, 'DhcpDeleteClientInfo');
571 asm
572 MOV ESP, EBP
573 POP EBP
574 JMP [_DhcpDeleteClientInfo]
575 end;
576 end;
577
578 var
579 _DhcpEnumSubnetClients: Pointer;
580
DhcpEnumSubnetClientsnull581 function DhcpEnumSubnetClients;
582 begin
583 GetProcedureAddress(_DhcpEnumSubnetClients, dhcplib, 'DhcpEnumSubnetClients');
584 asm
585 MOV ESP, EBP
586 POP EBP
587 JMP [_DhcpEnumSubnetClients]
588 end;
589 end;
590
591 var
592 _DhcpEnumSubnets: Pointer;
593
DhcpEnumSubnetsnull594 function DhcpEnumSubnets;
595 begin
596 GetProcedureAddress(_DhcpEnumSubnets, dhcplib, 'DhcpEnumSubnets');
597 asm
598 MOV ESP, EBP
599 POP EBP
600 JMP [_DhcpEnumSubnets]
601 end;
602 end;
603
604 var
605 _DhcpGetSubnetInfo: Pointer;
606
DhcpGetSubnetInfonull607 function DhcpGetSubnetInfo;
608 begin
609 GetProcedureAddress(_DhcpGetSubnetInfo, dhcplib, 'DhcpGetSubnetInfo');
610 asm
611 MOV ESP, EBP
612 POP EBP
613 JMP [_DhcpGetSubnetInfo]
614 end;
615 end;
616
617 var
618 _DhcpGetOptionValue: Pointer;
619
DhcpGetOptionValuenull620 function DhcpGetOptionValue;
621 begin
622 GetProcedureAddress(_DhcpGetOptionValue, dhcplib, 'DhcpGetOptionValue');
623 asm
624 MOV ESP, EBP
625 POP EBP
626 JMP [_DhcpGetOptionValue]
627 end;
628 end;
629
630 var
631 _DhcpRpcFreeMemory: Pointer;
632
633 procedure DhcpRpcFreeMemory;
634 begin
635 GetProcedureAddress(_DhcpRpcFreeMemory, dhcplib, 'DhcpRpcFreeMemory');
636 asm
637 MOV ESP, EBP
638 POP EBP
639 JMP [_DhcpRpcFreeMemory]
640 end;
641 end;
642
643 {$ELSE}
644
DhcpGetVersionnull645 function DhcpGetVersion; external dhcplib name 'DhcpGetVersion';
DhcpSetServerBindingInfonull646 function DhcpSetServerBindingInfo; external dhcplib name 'DhcpSetServerBindingInfo';
DhcpGetServerBindingInfonull647 function DhcpGetServerBindingInfo; external dhcplib name 'DhcpGetServerBindingInfo';
DhcpCreateClientInfonull648 function DhcpCreateClientInfo; external dhcplib name 'DhcpCreateClientInfo';
DhcpSetClientInfonull649 function DhcpSetClientInfo; external dhcplib name 'DhcpSetClientInfo';
DhcpGetClientInfonull650 function DhcpGetClientInfo; external dhcplib name 'DhcpGetClientInfo';
DhcpDeleteClientInfonull651 function DhcpDeleteClientInfo; external dhcplib name 'DhcpDeleteClientInfo';
DhcpEnumSubnetClientsnull652 function DhcpEnumSubnetClients; external dhcplib name 'DhcpEnumSubnetClients';
DhcpEnumSubnetsnull653 function DhcpEnumSubnets; external dhcplib name 'DhcpEnumSubnets';
DhcpGetSubnetInfonull654 function DhcpGetSubnetInfo; external dhcplib name 'DhcpGetSubnetInfo';
DhcpGetOptionValuenull655 function DhcpGetOptionValue; external dhcplib name 'DhcpGetOptionValue';
656 procedure DhcpRpcFreeMemory; external dhcplib name 'DhcpRpcFreeMemory';
657
658 {$ENDIF DYNAMIC_LINK}
659
660 {$ENDIF JWA_INTERFACESECTION}
661
662 {$IFNDEF JWA_OMIT_SECTIONS}
663 end.
664 {$ENDIF JWA_OMIT_SECTIONS}
665
666