' ########################################################################################
' Microsoft Windows
' File: dhcpsapi.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_dhcpsapi_PBI)
#DEFINE PBX_dhcpsapi_PBI
%DHCPSAPI_INC = 1
'#ifndef _DHCP_
'typedef DWORD DHCP_IP_ADDRESS, *PDHCP_IP_ADDRESS, *LPDHCP_IP_ADDRESS;
'typedef DWORD DHCP_OPTION_ID;
' // Serie = 8 bytes
TYPE DATE_TIME DWORD
 dwLowDateTime AS DWORD
 dwHighDateTime AS DWORD
END TYPE
'#endif // _DHCP_
'typedef DWORD DHCP_IP_MASK;
'typedef DWORD DHCP_RESUME_HANDLE;
' // Serie = 8 bytes
TYPE DHCP_IP_RANGE DWORD
 StartAddress AS DWORD ' DHCP_IP_ADDRESS
 EndAddress AS DWORD ' DHCP_IP_ADDRESS
END TYPE
' // Serie = 8 bytes
TYPE DHCP_BINARY_DATA DWORD
 DataLength AS DWORD
 Data AS BYTE PTR ' BYTE*
END TYPE
'typedef DHCP_BINARY_DATA DHCP_CLIENT_UID;
MACRO DHCP_CLIENT_UID = DHCP_BINARY_DATA
' // Serie = 12 bytes
TYPE DHCP_HOST_INFO DWORD
 IpAddress AS DWORD ' DHCP_IP_ADDRESS // minimum information always available
 NetBiosName AS WSTRINGZ PTR ' LPWSTR // optional information
 HostName AS WSTRINGZ PTR ' LPWSTR // optional information
END TYPE
' enum DHCP_FORCE_FLAG
%DhcpFullForce = 0 ' // The operation deletes all client records affected by the element, and then deletes the element.,
%DhcpNoForce = 1 ' // The operation only deletes the subnet element, leaving intact any client records impacted by the change.
' // Serie = 8 bytes
TYPE DWORD_DWORD DWORD
 DWord1 AS DWORD
 DWord2 AS DWORD
END TYPE
' enum _DHCP_SUBNET_STATE
%DhcpSubnetEnabled = 0
%DhcpSubnetDisabled = 1
%DhcpSubnetEnabledSwitched = 2
%DhcpSubnetDisabledSwitched = 3
%DhcpSubnetInvalidState = 4
'//
'// Subnet related data structures.
'//
' // Serie = 32 bytes
TYPE DHCP_SUBNET_INFO DWORD
 SubnetAddress AS DWORD ' DHCP_IP_ADDRESS
 SubnetMask AS DWORD ' DHCP_IP_MASK
 SubnetName AS WSTRINGZ PTR
 SubnetComment AS WSTRINGZ PTR
 PrimaryHost AS DHCP_HOST_INFO
 SubnetState AS LONG ' DHCP_SUBNET_STATE
END TYPE
'#define DHCP_SUBNET_INFO_VQ_FLAG_QUARANTINE (1 << 0) // Bit 0
%DHCP_SUBNET_INFO_VQ_FLAG_QUARANTINE = 1
' // Serie = 64 bytes
TYPE DHCP_SUBNET_INFO_VQ QWORD FILL
 SubnetAddress AS DWORD ' DHCP_IP_ADDRESS
 SubnetMask AS DWORD ' DHCP_IP_MASK
 SubnetName AS WSTRINGZ PTR
 SubnetComment AS WSTRINGZ PTR
 PrimaryHost AS DHCP_HOST_INFO
 SubnetState AS LONG ' DHCP_SUBNET_STATE
 QuarantineOn AS DWORD
 Reserved1 AS DWORD
 Reserved2 AS DWORD
 Reserved3 AS QUAD ' INT64
 Reserved4 AS QUAD ' INT64
END TYPE
' // Serie = 8 bytes
TYPE DHCP_IP_ARRAY DWORD
 NumElements AS DWORD
 Elements AS DWORD PTR ' LPDHCP_IP_ADDRESS //array
END TYPE
' // Serie = 8 bytes
TYPE DHCP_IP_CLUSTER DWORD
 ClusterAddress AS DWORD ' DHCP_IP_ADDRESS
 ClusterMask AS DWORD
END TYPE
' // Serie = 8 bytes
TYPE DHCP_IP_RESERVATION DWORD
 ReservedIpAddress AS DWORD ' DHCP_IP_ADDRESS
 ReservedForClient AS DHCP_CLIENT_UID PTR ' DHCP_CLIENT_UID*
END TYPE
' enum DHCP_SUBNET_ELEMENT_TYPE alias _DHCP_SUBNET_ELEMENT_TYPE_V5
%DhcpIpRanges = 0 ' // The subnet element contains the range of DHCP-served IP addresses.
%DhcpSecondaryHosts = 1 ' // The subnet element contains the IP addresses of secondary DHCP hosts available in the subnet.
%DhcpReservedIps = 2 ' // The subnet element contains the individual reserved IP addresses for the subnet.,
%DhcpExcludedIpRanges = 3 ' // The subnet element contains the IP addresses excluded from the range of DHCP-served addresses.,
%DhcpIpRangesDhcpOnly = 4 ' // The subnet element contains the IP addresses served by DHCP to the subnet (as opposed to those served by other dynamic address services, such as BOOTP).,
%DhcpIpRangesDhcpBootp = 5 ' // The subnet element contains the IP addresses served by both DHCP and BOOTP to the subnet.,
%DhcpIpRangesBootpOnly = 6 ' // The subnet element contains the IP addresses served by BOOTP to the subnet (specifically excluding DHCP-served addresses).
'#define ELEMENT_MASK(E) ((((E) <= DhcpIpRangesBootpOnly) && (DhcpIpRangesDhcpOnly <= (E)))?(0):(E))
' // Serie = 4 bytes
UNION DHCP_SUBNET_ELEMENT_DATA_UNION DWORD
 IpRange AS DHCP_IP_RANGE PTR ' DHCP_IP_RANGE*
 SecondaryHost AS DHCP_HOST_INFO PTR ' DHCP_HOST_INFO*
 ReservedIp AS DHCP_IP_RESERVATION PTR ' DHCP_IP_RESERVATION*
 ExcludeIpRange AS DHCP_IP_RANGE PTR ' DHCP_IP_RANGE*
 IpUsedCluster AS DHCP_IP_CLUSTER PTR ' DHCP_IP_CLUSTER*
END UNION
' // Serie = 8 bytes
TYPE DHCP_SUBNET_ELEMENT_DATA DWORD
 ElementType AS LONG ' DHCP_SUBNET_ELEMENT_TYPE
 Element AS DHCP_SUBNET_ELEMENT_DATA_UNION
END TYPE
' // Serie = 8 bytes
TYPE DHCP_SUBNET_ELEMENT_INFO_ARRAY DWORD
 NumElements AS DWORD
 Elements AS DHCP_SUBNET_ELEMENT_DATA PTR ' LPDHCP_SUBNET_ELEMENT_DATA_V5 //array
END TYPE
' // Serie = 16 bytes
TYPE DHCP_IPV6_ADDRESS QWORD
 HighOrderBits AS QUAD ' ULONGLONG
 LowOrderBits AS QUAD ' ULONGLONG
END TYPE
'typedef DHCP_IPV6_ADDRESS DHCP_RESUME_IPV6_HANDLE;
MACRO DHCP_RESUME_IPV6_HANDLE = DHCP_IPV6_ADDRESS
'//
'// DHCP Filter related data structures.
'//
%MAX_PATTERN_LENGTH = 255
%MAC_ADDRESS_LENGTH = 6
%HWTYPE_ETHERNET_10MB = 1
' enum DHCP_FILTER_LIST_TYPE
%DHCP_FILTER_LIST_TYPE_Deny = 0
%DHCP_FILTER_LIST_TYPE_Allow = 1
' // Serie = 268 bytes
TYPE DHCP_ADDR_PATTERN WORD
 MatchHWType AS LONG
 HWType AS BYTE ' BYTE
 IsWildcard AS LONG
 Length AS BYTE ' BYTE
 Pattern(%MAX_PATTERN_LENGTH - 1) AS BYTE ' BYTE // Variable Length address/pattern
END TYPE
' // Serie = 276 bytes
TYPE DHCP_FILTER_ADD_INFO DWORD
 AddrPatt AS DHCP_ADDR_PATTERN ' DHCP_ADDR_PATTERN // Contains address/pattern
 Comment AS WSTRINGZ PTR ' LPWSTR // Comment associated with address/pattern
 ListType AS LONG ' DHCP_FILTER_LIST_TYPE // Enum that specifies either allow or deny
END TYPE
MACRO DHCP_FILTER_ADD_INFOV4 = DHCP_FILTER_ADD_INFO
' // Serie = 8 bytes
TYPE DHCP_FILTER_GLOBAL_INFO DWORD
 EnforceAllowList AS LONG
 EnforceDenyList AS LONG
END TYPE
' // Serie = 272 bytes
TYPE DHCP_FILTER_RECORD DWORD
 AddrPatt AS DHCP_ADDR_PATTERN ' DHCP_ADDR_PATTERN // Contains MAC address/pattern and Mask
 Comment AS WSTRINGZ PTR ' LPWSTR // Comment associated with MAC address/pattern
END TYPE
' // Serie = 8 bytes
TYPE DHCP_FILTER_ENUM_INFO DWORD
 NumElements AS DWORD
 pEnumRecords AS DHCP_FILTER_RECORD PTR ' LPDHCP_FILTER_RECORD
END TYPE
'//
'// DHCP Options related data structures.
'//
' enum DHCP_OPTION_DATA_TYPE
%DhcpByteOption = 0
%DhcpWordOption = 1
%DhcpDWordOption = 2
%DhcpDWordDWordOption = 3
%DhcpIpAddressOption = 4
%DhcpStringDataOption = 5
%DhcpBinaryDataOption = 6
%DhcpEncapsulatedDataOption = 7
%DhcpIpv6AddressOption = 8
' // Serie = 8 bytes
UNION DHCP_OPTION_ELEMENT_UNION
 ByteOption AS BYTE ' BYTE
 WordOption AS WORD ' WORD
 DWordOption AS DWORD
 DWordDWordOption AS DWORD_DWORD
 IpAddressOption AS DWORD ' DHCP_IP_ADDRESS
 StringDataOption AS WSTRINGZ PTR
 BinaryDataOption AS DHCP_BINARY_DATA
 EncapsulatedDataOption AS DHCP_BINARY_DATA
 Ipv6AddressDataOption AS WSTRINGZ PTR
 ' // for vendor specific information option.
END UNION
' // Serie = 12 bytes
TYPE DHCP_OPTION_DATA_ELEMENT DWORD
 OptionType AS LONG ' DHCP_OPTION_DATA_TYPE enum
 Element AS DHCP_OPTION_ELEMENT_UNION
END TYPE
' // Serie = 8 bytes
TYPE DHCP_OPTION_DATA DWORD
 NumElements AS DWORD ' DWORD // number of option elements in the pointed array
 Elements AS DHCP_OPTION_DATA_ELEMENT PTR ' LPDHCP_OPTION_DATA_ELEMENT //array
END TYPE
' enum DHCP_OPTION_TYPE
%DhcpUnaryElementTypeOption = 0
%DhcpArrayTypeOption = 1
' // Serie = 24 bytes
TYPE DHCP_OPTION DWORD
 OptionID AS DWORD ' DHCP_OPTION_ID
 OptionName AS WSTRINGZ PTR
 OptionComment AS WSTRINGZ PTR
 DefaultValue AS DHCP_OPTION_DATA ' DHCP_OPTION_DATA
 OptionType AS LONG ' DHCP_OPTION_TYPE
END TYPE
' // Serie = 8 bytes
TYPE DHCP_OPTION_ARRAY DWORD
 NumElements AS DWORD ' DWORD // number of options in the pointed array
 Options AS DHCP_OPTION PTR ' LPDHCP_OPTION // array
END TYPE
' // Serie = 12 bytes
TYPE DHCP_OPTION_VALUE DWORD
 OptionID AS DWORD ' DHCP_OPTION_ID
 Value AS DHCP_OPTION_DATA
END TYPE
' // Serie = 8 bytes
TYPE DHCP_OPTION_VALUE_ARRAY DWORD
 NumElements AS DWORD ' DWORD // number of options in the pointed array
 Values AS DHCP_OPTION_VALUE PTR ' LPDHCP_OPTION_VALUE // array
END TYPE
' enum DHCP_OPTION_SCOPE_TYPE
%DhcpDefaultOptions = 0
%DhcpGlobalOptions = 1
%DhcpSubnetOptions = 2
%DhcpReservedOptions = 3
%DhcpMScopeOptions = 4
' // Serie = 8 bytes
TYPE DHCP_RESERVED_SCOPE DWORD
 ReservedIpAddress AS DWORD ' DHCP_IP_ADDRESS
 ReservedIpSubnetAddress AS DWORD ' DHCP_IP_ADDRESS
END TYPE
' // Serie = 8 bytes
UNION DHCP_OPTION_SCOPE_UNION
 DefaultScopeInfo AS DWORD ' PVOID // must be NULL
 GlobalScopeInfo AS DWORD ' PVOID // must be NULL
 SubnetScopeInfo AS DWORD ' DHCP_IP_ADDRESS
 ReservedScopeInfo AS DHCP_RESERVED_SCOPE
 MScopeInfo AS WSTRINGZ PTR
END UNION
' // Serie = 12 bytes
TYPE DHCP_OPTION_SCOPE_INFO DWORD
 ScopeType AS LONG ' DHCP_OPTION_SCOPE_TYPE enum
 ScopeInfo AS DHCP_OPTION_SCOPE_UNION
END TYPE
' enum DHCP_OPTION_SCOPE_TYPE6
%DhcpDefaultOptions6 = 0
%DhcpScopeOptions6 = 1
%DhcpReservedOptions6 = 2
%DhcpGlobalOptions6 = 3
' // Serie = 32 bytes
TYPE DHCP_RESERVED_SCOPE6 QWORD
 ReservedIpAddress AS DHCP_IPV6_ADDRESS
 ReservedIpSubnetAddress AS DHCP_IPV6_ADDRESS
END TYPE
' // Serie = 32 bytes
UNION DHCP_OPTION_SCOPE_INFO6_ScopeInfo QWORD
 DefaultScopeInfo AS DWORD ' PVOID // must be NULL
 SubnetScopeInfo AS DHCP_IPV6_ADDRESS
 ReservedScopeInfo AS DHCP_RESERVED_SCOPE6
END UNION
' // Serie = 40 bytes
TYPE DHCP_OPTION_SCOPE_INFO6 QWORD
 ScopeType AS LONG ' DHCP_OPTION_SCOPE_TYPE6
 ScopeInfo AS DHCP_OPTION_SCOPE_INFO6_ScopeInfo
END TYPE
' // Serie = 8 bytes
TYPE DHCP_OPTION_LIST DWORD
 NumOptions AS DWORD
 Options AS DHCP_OPTION_VALUE PTR ' DHCP_OPTION_VALUE* // array
END TYPE
'//
'// DHCP Client information data structures
'//
' // Serie = 44 bytes
TYPE DHCP_CLIENT_INFO DWORD
 ClientIpAddress AS DWORD ' DHCP_IP_ADDRESS // currently assigned IP address.
 SubnetMask AS DWORD ' DHCP_IP_MASK
 ClientHardwareAddress AS DHCP_CLIENT_UID
 ClientName AS WSTRINGZ PTR ' LPWSTR // optional.
 ClientComment AS WSTRINGZ PTR
 ClientLeaseExpires AS DATE_TIME ' // UTC time in FILE_TIME format.
 OwnerHost AS DHCP_HOST_INFO ' // host that distributed this IP address.
END TYPE
' // Serie = 8 bytes
TYPE DHCP_CLIENT_INFO_ARRAY DWORD
 NumElements AS DWORD
 Clients AS DHCP_CLIENT_INFO PTR ' LPDHCP_CLIENT_INFO* // array of pointers
END TYPE
' enum QuarantineStatus
%QuarantineStatus_NOQUARANTINE = 0
%QuarantineStatus_RESTRICTEDACCESS = 1
%QuarantineStatus_DROPPACKET = 2
%QuarantineStatus_PROBATION = 3
%QuarantineStatus_EXEMPT = 4
%QuarantineStatus_DEFAULTQUARSETTING = 5
%QuarantineStatus_NOQUARINFO = 6
' // Serie = 64 bytes
TYPE DHCP_CLIENT_INFO_VQ WORD
 ClientIpAddress AS DWORD ' DHCP_IP_ADDRESS // currently assigned IP address.
 SubnetMask AS DWORD ' DHCP_IP_MASK
 ClientHardwareAddress AS DHCP_CLIENT_UID
 ClientName AS WSTRINGZ PTR
 ClientComment AS WSTRINGZ PTR
 ClientLeaseExpires AS DATE_TIME ' // UTC time in FILE_TIME format.
 OwnerHost AS DHCP_HOST_INFO ' // host that distributed this IP address.
 bClientType AS BYTE ' BYTE
 AddressState AS BYTE ' BYTE
 Status AS LONG ' QuarantineStatus
 ProbationEnds AS DATE_TIME
 QuarantineCapable AS LONG
END TYPE
' // Serie = 8 bytes
TYPE DHCP_CLIENT_INFO_ARRAY_VQ DWORD
 NumElements AS DWORD
 Clients AS DHCP_CLIENT_INFO_VQ PTR ' LPDHCP_CLIENT_INFO_VQ* // array of pointers
END TYPE
'//When the client's MAC Address doesn't match any configured filters
%FILTER_STATUS_NONE = &H00000001
'//When the client's MAC Address matches an allow filter fully
%FILTER_STATUS_FULL_MATCH_IN_ALLOW_LIST = &H00000002
'//When the client's MAC Address matches a deny filter fully
%FILTER_STATUS_FULL_MATCH_IN_DENY_LIST = &H00000004
'//When the client's MAC Address has a wildcard match in the allow list
%FILTER_STATUS_WILDCARD_MATCH_IN_ALLOW_LIST = &H00000008
'//When the client's MAC Address has a wildcard match in the deny list
%FILTER_STATUS_WILDCARD_MATCH_IN_DENY_LIST = &H00000010
' // Serie = 68 bytes
TYPE DHCP_CLIENT_FILTER_STATUS_INFO WORD
 ClientIpAddress AS DWORD ' DHCP_IP_ADDRESS
 SubnetMask AS DWORD ' DHCP_IP_MASK
 ClientHardwareAddress AS DHCP_CLIENT_UID
 ClientName AS WSTRINGZ PTR
 ClientComment AS WSTRINGZ PTR
 ClientLeaseExpires AS DATE_TIME
 OwnerHost AS DHCP_HOST_INFO
 bClientType AS BYTE ' BYTE
 AddressState AS BYTE ' BYTE
 Status AS LONG ' QuarantineStatus
 ProbationEnds AS DATE_TIME
 QuarantineCapable AS LONG
 FilterStatus AS DWORD
END TYPE
' // Serie = 8 bytes
TYPE DHCP_CLIENT_FILTER_STATUS_INFO_ARRAY DWORD
 NumElements AS DWORD
 Clients AS DHCP_CLIENT_FILTER_STATUS_INFO PTR ' LPDHCP_CLIENT_FILTER_STATUS_INFO * // array of pointers
END TYPE
' enum DHCP_SEARCH_INFO_TYPE alias DHCP_CLIENT_SEARCH_TYPE
%DhcpClientIpAddress = 0
%DhcpClientHardwareAddress = 1
%DhcpClientName = 2
' // Serie = 8 bytes
UNION DHCP_SEARCH_INFO_UNION DWORD
 ClientIpAddress AS DWORD ' DHCP_IP_ADDRESS
 ClientHardwareAddress AS DHCP_CLIENT_UID
 ClientName AS WSTRINGZ PTR
END UNION
' // Serie = 8 bytes
TYPE DHCP_SEARCH_INFO DWORD
 SearchType AS LONG ' DHCP_SEARCH_INFO_TYPE enum
 SearchInfo AS DHCP_SEARCH_INFO_UNION
END TYPE
MACRO DHCP_CLIENT_SEARCH_INFO = DHCP_SEARCH_INFO
'//
'// Mib Info structures.
'//
' // Serie = 16 bytes
TYPE SCOPE_MIB_INFO DWORD
 Subnet AS DWORD ' DHCP_IP_ADDRESS
 NumAddressesInuse AS DWORD
 NumAddressesFree AS DWORD
 NumPendingOffers AS DWORD
END TYPE
' // Serie = 44 bytes
TYPE DHCP_MIB_INFO DWORD
 Discovers AS DWORD
 Offers AS DWORD
 Requests AS DWORD
 Acks AS DWORD
 Naks AS DWORD
 Declines AS DWORD
 Releases AS DWORD
 ServerStartTime AS DATE_TIME
 Scopes AS DWORD
 ScopeInfo AS SCOPE_MIB_INFO PTR ' LPSCOPE_MIB_INFO // array.
END TYPE
'//
'// Quarantine version of mib structures
'//
' // Serie = 40 bytes
TYPE SCOPE_MIB_INFO_VQ DWORD
 Subnet AS DWORD ' DHCP_IP_ADDRESS
 NumAddressesInuse AS DWORD
 NumAddressesFree AS DWORD
 NumPendingOffers AS DWORD
 ' // Quarantine MIB info
 QtnNumLeases AS DWORD
 QtnPctQtnLeases AS DWORD
 QtnProbationLeases AS DWORD
 QtnNonQtnLeases AS DWORD
 QtnExemptLeases AS DWORD
 QtnCapableClients AS DWORD
END TYPE
' // Serie = 72 bytes
TYPE DHCP_MIB_INFO_VQ DWORD
 Discovers AS DWORD
 Offers AS DWORD
 Requests AS DWORD
 Acks AS DWORD
 Naks AS DWORD
 Declines AS DWORD
 Releases AS DWORD
 ServerStartTime AS DATE_TIME
 ' // Quarantine MIB info
 QtnNumLeases AS DWORD
 QtnPctQtnLeases AS DWORD
 QtnProbationLeases AS DWORD
 QtnNonQtnLeases AS DWORD
 QtnExemptLeases AS DWORD
 QtnCapableClients AS DWORD
 QtnIASErrors AS DWORD
 Scopes AS DWORD
 ScopeInfo AS SCOPE_MIB_INFO_VQ PTR ' LPSCOPE_MIB_INFO_VQ // array.
END TYPE
' // Serie = 16 bytes
TYPE SCOPE_MIB_INFO_V5 DWORD
 Subnet AS DWORD ' DHCP_IP_ADDRESS
 NumAddressesInuse AS DWORD
 NumAddressesFree AS DWORD
 NumPendingOffers AS DWORD
END TYPE
' // Serie = 80 bytes
TYPE DHCP_MIB_INFO_V5 DWORD
 Discovers AS DWORD
 Offers AS DWORD
 Requests AS DWORD
 Acks AS DWORD
 Naks AS DWORD
 Declines AS DWORD
 Releases AS DWORD
 ServerStartTime AS DATE_TIME
 ' // Quarantine MIB info
 QtnNumLeases AS DWORD
 QtnPctQtnLeases AS DWORD
 QtnProbationLeases AS DWORD
 QtnNonQtnLeases AS DWORD
 QtnExemptLeases AS DWORD
 QtnCapableClients AS DWORD
 QtnIASErrors AS DWORD
 DelayedOffers AS DWORD
 ScopesWithDelayedOffers AS DWORD
 Scopes AS DWORD
 ScopeInfo AS SCOPE_MIB_INFO_V5 PTR ' LPSCOPE_MIB_INFO_V5 // array.
END TYPE
%Set_APIProtocolSupport = &H00000001
%Set_DatabaseName = &H00000002
%Set_DatabasePath = &H00000004
%Set_BackupPath = &H00000008
%Set_BackupInterval = &H00000010
%Set_DatabaseLoggingFlag = &H00000020
%Set_RestoreFlag = &H00000040
%Set_DatabaseCleanupInterval = &H00000080
%Set_DebugFlag = &H00000100
%Set_PingRetries = &H00000200
%Set_BootFileTable = &H00000400
%Set_AuditLogState = &H00000800
%Set_QuarantineON = &H00001000
%Set_QuarantineDefFail = &H00002000
' // Serie = 36 bytes
TYPE DHCP_SERVER_CONFIG_INFO DWORD
 APIProtocolSupport AS DWORD ' DWORD // bit map of the protocols supported.
 DatabaseName AS WSTRINGZ PTR ' LPWSTR // JET database name.
 DatabasePath AS WSTRINGZ PTR ' LPWSTR // JET database path.
 BackupPath AS WSTRINGZ PTR ' LPWSTR // Backup path.
 BackupInterval AS DWORD ' DWORD // Backup interval in mins.
 DatabaseLoggingFlag AS DWORD ' DWORD // Boolean database logging flag.
 RestoreFlag AS DWORD ' DWORD // Boolean database restore flag.
 DatabaseCleanupInterval AS DWORD ' DWORD // Database Cleanup Interval in mins.
 DebugFlag AS DWORD ' DWORD // Bit map of server debug flags.
END TYPE
' enum DHCP_SCAN_FLAG
%DhcpRegistryFix = 0
%DhcpDatabaseFix = 1
' // Serie = 8 bytes
TYPE DHCP_SCAN_ITEM DWORD
 IpAddress AS DWORD ' DHCP_IP_ADDRESS
 ScanFlag AS LONG ' DHCP_SCAN_FLAG
END TYPE
' // Serie = 8 bytes
TYPE DHCP_SCAN_LIST DWORD
 NumScanItems AS DWORD
 ScanItems AS DHCP_SCAN_ITEM PTR ' DHCP_SCAN_ITEM* // array
END TYPE
' // Serie = 24 bytes
TYPE DHCP_CLASS_INFO DWORD
 ClassName AS WSTRINGZ PTR
 ClassComment AS WSTRINGZ PTR
 ClassDataLength AS DWORD
 IsVendor AS LONG
 Flags AS DWORD
 ClassData AS BYTE PTR
END TYPE
' // Serie = 8 bytes
TYPE DHCP_CLASS_INFO_ARRAY DWORD
 NumElements AS DWORD
 Classes AS DHCP_CLASS_INFO PTR ' LPDHCP_CLASS_INFO
END TYPE
' // Serie = 28 bytes
TYPE DHCP_CLASS_INFO_V6 DWORD
 ClassName AS WSTRINGZ PTR
 ClassComment AS WSTRINGZ PTR
 ClassDataLength AS DWORD
 IsVendor AS LONG
 EnterpriseNumber AS DWORD
 Flags AS DWORD
 ClassData AS BYTE PTR
END TYPE
' // Serie = 8 bytes
TYPE DHCP_CLASS_INFO_ARRAY_V6 DWORD
 NumElements AS DWORD
 Classes AS DHCP_CLASS_INFO_V6 PTR ' LPDHCP_CLASS_INFO_V6
END TYPE
' // Serie = 8 bytes
TYPE DHCP_SERVER_SPECIFIC_STRINGS DWORD
 DefaultVendorClassName AS WSTRINGZ PTR
 DefaultUserClassName AS WSTRINGZ PTR
END TYPE
' // Serie = 12 bytes
TYPE DHCP_IP_RESERVATION_V4 DWORD
 ReservedIpAddress AS DWORD ' DHCP_IP_ADDRESS
 ReservedForClient AS DHCP_CLIENT_UID PTR ' DHCP_CLIENT_UID*
 bAllowedClientTypes AS BYTE ' BYTE
END TYPE
' // Serie = 4 bytes
UNION DHCP_SUBNET_ELEMENT_DATA_V4_UNION
 IpRange AS DHCP_IP_RANGE PTR ' DHCP_IP_RANGE*
 SecondaryHost AS DHCP_HOST_INFO PTR ' DHCP_HOST_INFO*
 ReservedIp AS DHCP_IP_RESERVATION_V4 PTR ' DHCP_IP_RESERVATION_V4*
 ExcludeIpRange AS DHCP_IP_RANGE PTR ' DHCP_IP_RANGE*
 IpUsedCluster AS DHCP_IP_CLUSTER PTR ' DHCP_IP_CLUSTER*
END UNION
' // Serie = 8 bytes
TYPE DHCP_SUBNET_ELEMENT_DATA_V4 DWORD
 ElementType AS LONG ' DHCP_SUBNET_ELEMENT_TYPE
 Element AS DHCP_SUBNET_ELEMENT_DATA_V4_UNION
END TYPE
' // Serie = 8 bytes
TYPE DHCP_SUBNET_ELEMENT_INFO_ARRAY_V4 DWORD
 NumElements AS DWORD
 Elements AS DHCP_SUBNET_ELEMENT_DATA_V4 PTR ' LPDHCP_SUBNET_ELEMENT_DATA_V4
END TYPE
%CLIENT_TYPE_UNSPECIFIED = &H0
%CLIENT_TYPE_DHCP = &H1
%CLIENT_TYPE_BOOTP = &H2
%CLIENT_TYPE_BOTH = %CLIENT_TYPE_DHCP OR %CLIENT_TYPE_BOOTP
%CLIENT_TYPE_RESERVATION_FLAG = &H4
%CLIENT_TYPE_NONE = &H64
' // Serie = 48 bytes
TYPE DHCP_CLIENT_INFO_V4 DWORD
 ClientIpAddress AS DWORD ' DHCP_IP_ADDRESS
 SubnetMask AS DWORD ' DHCP_IP_MASK
 ClientHardwareAddress AS DHCP_CLIENT_UID
 ClientName AS WSTRINGZ PTR
 ClientComment AS WSTRINGZ PTR
 ClientLeaseExpires AS DATE_TIME
 OwnerHost AS DHCP_HOST_INFO
 bClientType AS BYTE
END TYPE
' // Serie = 8 bytes
TYPE DHCP_CLIENT_INFO_ARRAY_V4 DWORD
 NumElements AS DWORD
 Clients AS DHCP_CLIENT_INFO_V4 PTR ' LPDHCP_CLIENT_INFO_V4*
END TYPE
' // Serie = 52 bytes
TYPE DHCP_SERVER_CONFIG_INFO_V4 DWORD
 APIProtocolSupport AS DWORD
 DatabaseName AS WSTRINGZ PTR
 DatabasePath AS WSTRINGZ PTR
 BackupPath AS WSTRINGZ PTR
 BackupInterval AS DWORD
 DatabaseLoggingFlag AS DWORD
 RestoreFlag AS DWORD
 DatabaseCleanupInterval AS DWORD
 DebugFlag AS DWORD
 dwPingRetries AS DWORD ' DWORD // valid range: 0-5 inclusive
 cbBootTableString AS DWORD
 wszBootTableString AS WSTRINGZ PTR ' WCHAR*
 fAuditLog AS LONG ' BOOL // TRUE to enable audit log
END TYPE
'//
'// Server Configuration Info with quarantine config.
'//
' // Serie = 64 bytes
TYPE DHCP_SERVER_CONFIG_INFO_VQ DWORD
 APIProtocolSupport AS DWORD ' DWORD // bit map of the protocols supported.
 DatabaseName AS WSTRINGZ PTR ' LPWSTR // JET database name.
 DatabasePath AS WSTRINGZ PTR ' LPWSTR // JET database path.
 BackupPath AS WSTRINGZ PTR ' LPWSTR // Backup path.
 BackupInterval AS DWORD ' DWORD // Backup interval in mins.
 DatabaseLoggingFlag AS DWORD ' DWORD // Boolean database logging flag.
 RestoreFlag AS DWORD ' DWORD // Boolean database restore flag.
 DatabaseCleanupInterval AS DWORD ' DWORD // Database Cleanup Interval in mins.
 DebugFlag AS DWORD ' DWORD // Bit map of server debug flags.
 dwPingRetries AS DWORD ' DWORD // valid range: 0-5 inclusive
 cbBootTableString AS DWORD
 wszBootTableString AS WSTRINGZ PTR ' WCHAR*
 fAuditLog AS LONG ' BOOL // TRUE to enable audit log
 QuarantineOn AS LONG ' BOOL // Server global Quarantine on/off
 QuarDefFail AS DWORD ' DWORD // Default behavior when IAS fails
 ' // to be set to QUARANTINE_DEFFAIL_ACCEPT
 ' // or QUARANTINE_DEFFAIL_DROP
 QuarRuntimeStatus AS LONG ' BOOL // This tells us whether NAP is actually running
 ' // on the DHCP server as opposed to the the value
 ' // which is configured by the admin.
END TYPE
' // Serie = 36 bytes
TYPE DHCP_SERVER_CONFIG_INFO_V6 DWORD
 UnicastFlag AS LONG
 RapidCommitFlag AS LONG
 PreferredLifetime AS DWORD
 ValidLifetime AS DWORD
 T1 AS DWORD
 T2 AS DWORD
 PreferredLifetimeIATA AS DWORD
 ValidLifetimeIATA AS DWORD
 fAuditLog AS LONG
END TYPE
%Set_UnicastFlag = &H00000001
%Set_RapidCommitFlag = &H00000002
%Set_PreferredLifetime = &H00000004
%Set_ValidLifetime = &H00000008
%Set_T1 = &H00000010
%Set_T2 = &H00000020
%Set_PreferredLifetimeIATA = &H00000040
%Set_ValidLifetimeIATA = &H00000080
' // Serie = 16 bytes
TYPE DHCP_SUPER_SCOPE_TABLE_ENTRY DWORD
 SubnetAddress AS DWORD ' DHCP_IP_ADDRESS // subnet address
 SuperScopeNumber AS DWORD ' DWORD // super scope group number
 NextInSuperScope AS DWORD ' DWORD // index of the next subnet in the superscope
 SuperScopeName AS WSTRINGZ PTR ' LPWSTR // super scope name
 ' // NULL indicates no superscope membership.
END TYPE
' // Serie = 8 bytes
TYPE DHCP_SUPER_SCOPE_TABLE DWORD
 cEntries AS DWORD
 pEntries AS DHCP_SUPER_SCOPE_TABLE_ENTRY PTR ' DHCP_SUPER_SCOPE_TABLE_ENTRY*
END TYPE
' // Serie = 48 bytes
TYPE DHCP_CLIENT_INFO_V5 WORD
 ClientIpAddress AS DWORD ' DHCP_IP_ADDRESS // currently assigned IP address.
 SubnetMask AS DWORD ' DHCP_IP_MASK
 ClientHardwareAddress AS DHCP_CLIENT_UID
 ClientName AS WSTRINGZ PTR ' LPWSTR // optional.
 ClientComment AS WSTRINGZ PTR
 ClientLeaseExpires AS DATE_TIME ' // UTC time in FILE_TIME format.
 OwnerHost AS DHCP_HOST_INFO ' // host that distributed this IP address.
 bClientType AS BYTE ' BYTE
 AddressState AS BYTE ' BYTE
END TYPE
%V5_ADDRESS_STATE_OFFERED = &H0
%V5_ADDRESS_STATE_ACTIVE = &H1
%V5_ADDRESS_STATE_DECLINED = &H2
%V5_ADDRESS_STATE_DOOM = &H3
%V5_ADDRESS_BIT_DELETED = &H80
%V5_ADDRESS_BIT_UNREGISTERED = &H40
%V5_ADDRESS_BIT_BOTH_REC = &H20
%DNS_FLAG_ENABLED = &H01
%DNS_FLAG_UPDATE_DOWNLEVEL = &H02
%DNS_FLAG_CLEANUP_EXPIRED = &H04
%DNS_FLAG_UPDATE_BOTH_ALWAYS = &H10
%DNS_FLAG_UPDATE_DHCID = &H20
' // Serie = 8 bytes
TYPE DHCP_CLIENT_INFO_ARRAY_V5 DWORD
 NumElements AS DWORD
 Clients AS DHCP_CLIENT_INFO_V5 PTR ' LPDHCP_CLIENT_INFO_V5* // array of pointers
END TYPE
%DHCP_OPT_ENUM_IGNORE_VENDOR = &H01
%DHCP_OPT_ENUM_USE_CLASSNAME = &H02
' // Serie = 12 bytes
TYPE DHCP_ALL_OPTIONS_VendorOptions DWORD
 Option AS DHCP_OPTION
 VendorName AS WSTRINGZ PTR
 ClassName AS WSTRINGZ PTR ' LPWSTR // currently unused.
END TYPE
' // Serie = 16 bytes
TYPE DHCP_ALL_OPTIONS DWORD
 Flags AS DWORD ' DWORD // must be zero -- not used..
 NonVendorOptions AS DHCP_OPTION_ARRAY PTR ' LPDHCP_OPTION_ARRAY
 NumVendorOptions AS DWORD
 VendorOptions AS DHCP_ALL_OPTIONS_VendorOptions PTR
END TYPE
' // Serie = 16 bytes
TYPE DHCP_ALL_OPTION_VALUES_Options DWORD
 ClassName AS WSTRINGZ PTR ' LPWSTR // for each user class (NULL if none exists)
 VendorName AS WSTRINGZ PTR ' LPWSTR // for each vendor class (NULL if none exists)
 IsVendor AS LONG ' BOOL // is this set of options vendor specific?
 OptionsArray AS DHCP_OPTION_VALUE_ARRAY PTR ' LPDHCP_OPTION_VALUE_ARRAY // list of options for the above pair: (vendor,user)
END TYPE
' // Serie = 12 bytes
TYPE DHCP_ALL_OPTION_VALUES DWORD
 Flags AS DWORD ' DWORD // must be zero -- not used
 NumElements AS DWORD ' DWORD // the # of elements in array of Options below..
 Options AS DHCP_ALL_OPTION_VALUES_Options PTR ' // for each vendor/user class pair, one element in this array..
END TYPE
'#ifndef _ST_SRVR_H_
'#define _ST_SRVR_H_
' // Serie = 28 bytes
TYPE DHCPDS_SERVER DWORD
 Version AS DWORD ' DWORD // version of this structure -- currently zero
 ServerName AS WSTRINGZ PTR ' LPWSTR // [DNS?] unique name for server
 ServerAddress AS DWORD ' DWORD // ip address of server
 Flags AS DWORD ' DWORD // additional info -- state
 State AS DWORD ' DWORD // not used ...
 DsLocation AS WSTRINGZ PTR ' LPWSTR // ADsPath to server object
 DsLocType AS DWORD ' DWORD // path relative? absolute? diff srvr?
END TYPE
MACRO DHCP_SERVER_INFO = DHCPDS_SERVER
' // Serie = 12 bytes
TYPE DHCPDS_SERVERS DWORD
 Flags AS DWORD ' DWORD // not used currently.
 NumElements AS DWORD ' DWORD // # of elements in array
 Servers AS DHCPDS_SERVER PTR ' LPDHCPDS_SERVER // array of server info
END TYPE
MACRO DHCP_SERVER_INFO_ARRAY = DHCPDS_SERVERS
'#endif _ST_SRVR_H_
%DHCP_FLAGS_DONT_ACCESS_DS = &H01
%DHCP_FLAGS_DONT_DO_RPC = &H02
%DHCP_FLAGS_OPTION_IS_VENDOR = &H03
%DHCP_ATTRIB_BOOL_IS_ROGUE = &H01
%DHCP_ATTRIB_BOOL_IS_DYNBOOTP = &H02
%DHCP_ATTRIB_BOOL_IS_PART_OF_DSDC = &H03
%DHCP_ATTRIB_BOOL_IS_BINDING_AWARE = &H04
%DHCP_ATTRIB_BOOL_IS_ADMIN = &H05
%DHCP_ATTRIB_ULONG_RESTORE_STATUS = &H06
%DHCP_ATTRIB_TYPE_BOOL = &H01
%DHCP_ATTRIB_TYPE_ULONG = &H02
'typedef ULONG DHCP_ATTRIB_ID, *PDHCP_ATTRIB_ID, *LPDHCP_ATTRIB_ID;
' // Serie = 8 bytes
UNION DHCP_ATTRIB_UNION DWORD
 DhcpAttribBool AS LONG
 DhcpAttribUlong AS DWORD ' ULONG
END UNION
' // Serie = 12 bytes
TYPE DHCP_ATTRIB DWORD
 DhcpAttribId AS DWORD ' DHCP_ATTRIB_ID // one of the DHCP_ATTRIB_*
 DhcpAttribType AS DWORD ' ULONG // type of attrib
 DHCP_ATTRIB_UNION
END TYPE
' // Serie = 8 bytes
TYPE DHCP_ATTRIB_ARRAY DWORD
 NumElements AS DWORD ' ULONG
 DhcpAttribs AS DHCP_ATTRIB PTR ' DHCP_ATTRIB
END TYPE
' // Serie = 16 bytes
TYPE DHCP_BOOTP_IP_RANGE DWORD
 StartAddress AS DWORD ' DHCP_IP_ADDRESS
 EndAddress AS DWORD ' DHCP_IP_ADDRESS
 BootpAllocated AS DWORD ' ULONG
 MaxBootpAllowed AS DWORD ' ULONG
END TYPE
' // Serie = 4 bytes
UNION DHCP_SUBNET_ELEMENT_DATA_V5_UNION
 IpRange AS DHCP_BOOTP_IP_RANGE PTR ' DHCP_BOOTP_IP_RANGE*
 SecondaryHost AS DHCP_HOST_INFO PTR ' DHCP_HOST_INFO*
 ReservedIp AS DHCP_IP_RESERVATION_V4 PTR ' DHCP_IP_RESERVATION_V4*
 ExcludeIpRange AS DHCP_IP_RANGE PTR ' DHCP_IP_RANGE*
END UNION
' // Serie = 8 bytes
TYPE DHCP_SUBNET_ELEMENT_DATA_V5 DWORD
 ElementType AS LONG
 Element AS DHCP_SUBNET_ELEMENT_DATA_V5_UNION
END TYPE
' // Serie = 8 bytes
TYPE DHCP_SUBNET_ELEMENT_INFO_ARRAY_V5 DWORD
 NumElements AS DWORD
 Elements AS DHCP_SUBNET_ELEMENT_DATA_V5 PTR ' LPDHCP_SUBNET_ELEMENT_DATA_V5 //array
END TYPE
'#pragma pack(4)
' // Serie = 76 bytes
TYPE DHCP_PERF_STATS DWORD ' // performance statistics
 ' // DO NOT CHANGE THIS ORDER -- THIS AFFECTS THE PERF COUNTER DEFINITION
 ' // ORDER IN DHCPDATA.C (under PERF directory)
 dwNumPacketsReceived AS DWORD ' ULONG
 dwNumPacketsDuplicate AS DWORD ' ULONG
 dwNumPacketsExpired AS DWORD ' ULONG
 dwNumMilliSecondsProcessed AS DWORD ' ULONG
 dwNumPacketsInActiveQueue AS DWORD ' ULONG
 dwNumPacketsInPingQueue AS DWORD ' ULONG
 dwNumDiscoversReceived AS DWORD ' ULONG
 dwNumOffersSent AS DWORD ' ULONG
 dwNumRequestsReceived AS DWORD ' ULONG
 dwNumInformsReceived AS DWORD ' ULONG
 dwNumAcksSent AS DWORD ' ULONG
 dwNumNacksSent AS DWORD ' ULONG
 dwNumDeclinesReceived AS DWORD ' ULONG
 dwNumReleasesReceived AS DWORD ' ULONG
 ' // Count of Delayed Offer sent
 dwNumDelayedOfferInQueue AS DWORD ' ULONG
 dwNumPacketsProcessed AS DWORD ' ULONG
 ' // For Quarantine
 dwNumPacketsInQuarWaitingQueue AS DWORD ' ULONG
 dwNumPacketsInQuarReadyQueue AS DWORD ' ULONG
 dwNumPacketsInQuarDecisionQueue AS DWORD ' ULONG
END TYPE
'#pragma pack()
%DHCP_ENDPOINT_FLAG_CANT_MODIFY = &H01
' // Serie = 28 bytes
TYPE DHCP_BIND_ELEMENT DWORD
 Flags AS DWORD ' ULONG
 fBoundToDHCPServer AS LONG
 AdapterPrimaryAddress AS DWORD ' DHCP_IP_ADDRESS
 AdapterSubnetAddress AS DWORD ' DHCP_IP_ADDRESS
 IfDescription AS WSTRINGZ PTR
 IfIdSize AS DWORD ' ULONG
 IfId AS BYTE PTR
END TYPE
' // Serie = 8 bytes
TYPE DHCP_BIND_ELEMENT_ARRAY DWORD
 NumElements AS DWORD
 Elements AS DHCP_BIND_ELEMENT PTR ' LPDHCP_BIND_ELEMENT //array
END TYPE
' // Serie = 56 bytes
TYPE DHCPV6_BIND_ELEMENT DWORD
 Flags AS DWORD ' ULONG
 fBoundToDHCPServer AS LONG
 AdapterPrimaryAddress AS DHCP_IPV6_ADDRESS
 AdapterSubnetAddress AS DHCP_IPV6_ADDRESS
 IfDescription AS WSTRINGZ PTR
 IpV6IfIndex AS DWORD
 IfIdSize AS DWORD ' ULONG
 IfId AS BYTE PTR
END TYPE
' // Serie = 8 bytes
TYPE DHCPV6_BIND_ELEMENT_ARRAY DWORD
 NumElements AS DWORD
 Elements AS DHCPV6_BIND_ELEMENT PTR ' LPDHCPV6_BIND_ELEMENT //array
END TYPE
'//
'// For Quarantine
'//
%QUARANTIN_OPTION_BASE = 43220
%QUARANTINE_SCOPE_QUARPROFILE_OPTION = %QUARANTIN_OPTION_BASE + 1
%QUARANTINE_CONFIG_OPTION = %QUARANTIN_OPTION_BASE + 2
'// DHCP IPV6 specific Structures
' // Serie = 32 bytes
TYPE DHCP_IP_RANGE_V6 QWORD
 StartAddress AS DHCP_IPV6_ADDRESS
 EndAddress AS DHCP_IPV6_ADDRESS
END TYPE
' // Serie = 24 bytes
TYPE DHCP_HOST_INFO_V6 DWORD
 IpAddress AS DHCP_IPV6_ADDRESS ' DHCP_IPV6_ADDRESS // minimum information always available
 NetBiosName AS WSTRINGZ PTR ' LPWSTR // optional information
 HostName AS WSTRINGZ PTR ' LPWSTR // optional information
END TYPE
' // Serie = 40 bytes
TYPE DHCP_SUBNET_INFO_V6 DWORD
 SubnetAddress AS DHCP_IPV6_ADDRESS
 Prefix AS DWORD ' ULONG
 Preference AS WORD ' USHORT
 SubnetName AS WSTRINGZ PTR
 SubnetComment AS WSTRINGZ PTR
 State AS DWORD
 ScopeId AS DWORD
END TYPE
'//
'// Mib Info structures.
'//
' // Serie = 40 bytes
TYPE SCOPE_MIB_INFO_V6 QWORD
 Subnet AS DHCP_IPV6_ADDRESS
 NumAddressesInuse AS QUAD ' ULONGLONG
 NumAddressesFree AS QUAD ' ULONGLONG
 NumPendingAdvertises AS QUAD ' ULONGLONG
END TYPE
' // Serie = 56 bytes
TYPE DHCP_MIB_INFO_V6 DWORD
 Solicits AS DWORD
 Advertises AS DWORD
 Requests AS DWORD
 Renews AS DWORD
 Rebinds AS DWORD
 Replies AS DWORD
 Confirms AS DWORD
 Declines AS DWORD
 Releases AS DWORD
 Informs AS DWORD
 ServerStartTime AS DATE_TIME
 Scopes AS DWORD
 ScopeInfo AS SCOPE_MIB_INFO_V6 PTR ' LPSCOPE_MIB_INFO_V6 // array.
END TYPE
' // Serie = 24 bytes
TYPE DHCP_IP_RESERVATION_V6 DWORD
 ReservedIpAddress AS DHCP_IPV6_ADDRESS
 ReservedForClient AS DHCP_CLIENT_UID PTR ' DHCP_CLIENT_UID*
 InterfaceId AS DWORD
END TYPE
' enum DHCP_SUBNET_ELEMENT_TYPE_V6
%Dhcpv6IpRanges = 0
%Dhcpv6ReservedIps = 1
%Dhcpv6ExcludedIpRanges = 2
' // Serie = 4 bytes
UNION DHCP_SUBNET_ELEMENT_DATA_V6_UNION
 IpRange AS DHCP_IP_RANGE_V6 PTR ' DHCP_IP_RANGE_V6*
 ReservedIp AS DHCP_IP_RESERVATION_V6 PTR ' DHCP_IP_RESERVATION_V6*
 ExcludeIpRange AS DHCP_IP_RANGE_V6 PTR ' DHCP_IP_RANGE_V6*
END UNION
' // Serie = 8 bytes
TYPE DHCP_SUBNET_ELEMENT_DATA_V6 DWORD
 ElementType AS LONG ' DHCP_SUBNET_ELEMENT_TYPE_V6
 Element AS DHCP_SUBNET_ELEMENT_DATA_V6_UNION
END TYPE
' // Serie = 8 bytes
TYPE DHCP_SUBNET_ELEMENT_INFO_ARRAY_V6 DWORD
 NumElements AS DWORD
 Elements AS DHCP_SUBNET_ELEMENT_DATA_V6 PTR ' LPDHCP_SUBNET_ELEMENT_DATA_V6 //array
END TYPE
'//
'// DHCPv6 Client information data structures
'//
%ADDRESS_TYPE_IANA = 0
%ADDRESS_TYPE_IATA = 1
' // Serie = 80 bytes
TYPE DHCP_CLIENT_INFO_V6 DWORD
 ClientIpAddress AS DHCP_IPV6_ADDRESS ' DHCP_IPV6_ADDRESS // currently assigned IP address.
 ClientDUID AS DHCP_CLIENT_UID ' DHCP_CLIENT_UID
 AddressType AS DWORD ' DWORD // IANA or IATA
 IAID AS DWORD ' DWORD // IAID Associated with the address.
 ClientName AS WSTRINGZ PTR ' LPWSTR // optional.
 ClientComment AS WSTRINGZ PTR
 ClientValidLeaseExpires AS DATE_TIME ' DATE_TIME // UTC time in FILE_TIME format.
 ClientPrefLeaseExpires AS DATE_TIME ' DATE_TIME // UTC time in FILE_TIME format.
 OwnerHost AS DHCP_HOST_INFO_V6 ' DHCP_HOST_INFO_V6 // host that distributed this IP address.
END TYPE
' // Serie = 8 bytes
TYPE DHCPV6_IP_ARRAY DWORD
 NumElements AS DWORD
 Elements AS DHCP_IPV6_ADDRESS PTR ' LPDHCP_IPV6_ADDRESS //array
END TYPE
' // Serie = 8 bytes
TYPE DHCP_CLIENT_INFO_ARRAY_V6 DWORD
 NumElements AS DWORD
 Clients AS DHCP_CLIENT_INFO_V6 PTR ' LPDHCP_CLIENT_INFO_V6* // array of pointers
END TYPE
' enum _DHCP_CLIENT_SEARCH_TYPE_V6 alias DHCP_SEARCH_INFO_TYPE_V6
%Dhcpv6ClientIpAddress = 0
%Dhcpv6ClientDUID = 1
%Dhcpv6ClientName = 2
' // Serie = 16 bytes
UNION DHCP_CLIENT_SEARCH_UNION_V6 QWORD
 ClientIpAddress AS DHCP_IPV6_ADDRESS
 ClientDUID AS DHCP_CLIENT_UID
 ClientName AS WSTRINGZ PTR
END UNION
' // Serie = 24 bytes
TYPE DHCP_CLIENT_SEARCH_INFO_V6 QWORD
 SearchType AS LONG ' DHCP_SEARCH_INFO_TYPE_V6
 SearchInfo AS DHCP_CLIENT_SEARCH_UNION_V6
END TYPE
MACRO DHCP_SEARCH_INFO_V6 = DHCP_CLIENT_SEARCH_INFO_V6
%SCOPE_STATE_ENABLED = %DhcpSubnetEnabled
%SCOPE_STATE_DISABLED = %DhcpSubnetDisabled
%DHCP_MIN_DELAY = 0
%DHCP_MAX_DELAY = 1000
' // Not included in dhcpsapi.h, but should be.
%ERROR_DHCP_OPTION_NOT_PRESENT = 20010
%ERROR_DHCP_SUBNET_EXISTS = 20052
%ERROR_DDS_SERVER_ALREADY_EXISTS = 20079
%ERROR_DDS_SERVER_DOES_NOT_EXIST = 20080
'#ifndef DHCPAPI_NO_PROTOTYPES
'//
'// DHCP Filter related APIs
'//
DECLARE FUNCTION DhcpAddFilterV4 LIB "dhcpsapi.dll" ALIAS "DhcpAddFilterV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF AddFilterInfo AS DHCP_FILTER_ADD_INFO , BYVAL ForceFlag AS LONG ) AS QUAD
DECLARE FUNCTION DhcpDeleteFilterV4 LIB "dhcpsapi.dll" ALIAS "DhcpDeleteFilterV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF DeleteFilterInfo AS DHCP_ADDR_PATTERN ) AS DWORD
DECLARE FUNCTION DhcpSetFilterV4 LIB "dhcpsapi.dll" ALIAS "DhcpSetFilterV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF GlobalFilterInfo AS DHCP_FILTER_GLOBAL_INFO ) AS DWORD
DECLARE FUNCTION DhcpGetFilterV4 LIB "dhcpsapi.dll" ALIAS "DhcpGetFilterV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF GlobalFilterInfo AS DHCP_FILTER_GLOBAL_INFO ) AS DWORD
DECLARE FUNCTION DhcpEnumFilterV4 LIB "dhcpsapi.dll" ALIAS "DhcpEnumFilterV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ResumeHandle AS DHCP_ADDR_PATTERN , BYVAL PreferredMaximum AS DWORD , BYREF ListType AS LONG , BYREF EnumFilterInfo AS DHCP_FILTER_ENUM_INFO , BYREF ElementsRead AS DWORD , BYREF ElementsTotal AS DWORD ) AS DWORD
'//
'// Subnet APIs
'//
DECLARE FUNCTION DhcpCreateSubnet LIB "dhcpsapi.dll" ALIAS "DhcpCreateSubnet" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS QUAD , BYREF SubnetInfo AS DHCP_SUBNET_INFO ) AS QUAD
DECLARE FUNCTION DhcpSetSubnetInfo LIB "dhcpsapi.dll" ALIAS "DhcpSetSubnetInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF SubnetInfo AS DHCP_SUBNET_INFO ) AS DWORD
DECLARE FUNCTION DhcpGetSubnetInfo LIB "dhcpsapi.dll" ALIAS "DhcpGetSubnetInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF SubnetInfo AS DHCP_SUBNET_INFO ) AS DWORD
DECLARE FUNCTION DhcpEnumSubnets LIB "dhcpsapi.dll" ALIAS "DhcpEnumSubnets" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF EnumInfo AS DHCP_CLIENT_INFO_ARRAY , BYREF ElementsRead AS DWORD , BYREF ElementsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpAddSubnetElement LIB "dhcpsapi.dll" ALIAS "DhcpAddSubnetElement" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF AddElementInfo AS DHCP_SUBNET_ELEMENT_DATA ) AS DWORD
DECLARE FUNCTION DhcpEnumSubnetElements LIB "dhcpsapi.dll" ALIAS "DhcpEnumSubnetElements" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYVAL EnumElementType AS LONG , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF EnumElementInfo AS DHCP_SUBNET_ELEMENT_INFO_ARRAY , BYREF ElementsRead AS DWORD , BYREF ElementsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpRemoveSubnetElement LIB "dhcpsapi.dll" ALIAS "DhcpRemoveSubnetElement" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF RemoveElementInfo AS DHCP_SUBNET_ELEMENT_DATA_V5 , BYVAL ForceFlag AS LONG ) AS DWORD
DECLARE FUNCTION DhcpDeleteSubnet LIB "dhcpsapi.dll" ALIAS "DhcpDeleteSubnet" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYVAL ForceFlag AS LONG ) AS DWORD
'//
'// Option APIs
'//
DECLARE FUNCTION DhcpCreateOption LIB "dhcpsapi.dll" ALIAS "DhcpCreateOption" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL OptionId AS QUAD , BYREF OptionInfo AS DHCP_OPTION ) AS QUAD
DECLARE FUNCTION DhcpSetOptionInfo LIB "dhcpsapi.dll" ALIAS "DhcpSetOptionInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL OptionId AS DWORD , BYREF OptionInfo AS DHCP_OPTION ) AS DWORD
DECLARE FUNCTION DhcpGetOptionInfo LIB "dhcpsapi.dll" ALIAS "DhcpGetOptionInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL OptionID AS DWORD , BYREF OptionInfo AS DHCP_OPTION ) AS DWORD
DECLARE FUNCTION DhcpEnumOptions LIB "dhcpsapi.dll" ALIAS "DhcpEnumOptions" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF Options AS DHCP_OPTION_ARRAY , BYREF OptionsRead AS DWORD , BYREF OptionsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpRemoveOption LIB "dhcpsapi.dll" ALIAS "DhcpRemoveOption" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL OptionID AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpSetOptionValue LIB "dhcpsapi.dll" ALIAS "DhcpSetOptionValue" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL OptionID AS DWORD , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO , BYREF OptionValue AS DHCP_OPTION_DATA ) AS DWORD
DECLARE FUNCTION DhcpSetOptionValues LIB "dhcpsapi.dll" ALIAS "DhcpSetOptionValues" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO , BYREF OptionValues AS DHCP_OPTION_VALUE_ARRAY ) AS DWORD
DECLARE FUNCTION DhcpGetOptionValue LIB "dhcpsapi.dll" ALIAS "DhcpGetOptionValue" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL OptionID AS DWORD , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO , BYREF OptionValue AS DHCP_OPTION_VALUE ) AS DWORD
DECLARE FUNCTION DhcpEnumOptionValues LIB "dhcpsapi.dll" ALIAS "DhcpEnumOptionValues" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO6 , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF OptionValues AS DHCP_OPTION_VALUE_ARRAY , BYREF OptionsRead AS DWORD , BYREF OptionsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpRemoveOptionValue LIB "dhcpsapi.dll" ALIAS "DhcpRemoveOptionValue" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL OptionID AS DWORD , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO ) AS DWORD
'//
'// Client APIs
'//
DECLARE FUNCTION DhcpCreateClientInfoVQ LIB "dhcpsapi.dll" ALIAS "DhcpCreateClientInfoVQ" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ClientInfo AS DHCP_CLIENT_INFO_VQ ) AS QUAD
DECLARE FUNCTION DhcpSetClientInfoVQ LIB "dhcpsapi.dll" ALIAS "DhcpSetClientInfoVQ" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ClientInfo AS DHCP_CLIENT_INFO_VQ ) AS DWORD
DECLARE FUNCTION DhcpGetClientInfoVQ LIB "dhcpsapi.dll" ALIAS "DhcpGetClientInfoVQ" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF SearchInfo AS DHCP_SEARCH_INFO , BYREF ClientInfo AS DHCP_CLIENT_INFO_VQ ) AS DWORD
DECLARE FUNCTION DhcpEnumSubnetClientsVQ LIB "dhcpsapi.dll" ALIAS "DhcpEnumSubnetClientsVQ" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF ClientInfo AS DHCP_CLIENT_INFO_ARRAY_VQ , BYREF ClientsRead AS DWORD , BYREF ClientsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpEnumSubnetClientsFilterStatusInfo LIB "dhcpsapi.dll" ALIAS "DhcpEnumSubnetClientsFilterStatusInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF ClientInfo AS DHCP_CLIENT_INFO_ARRAY , BYREF ClientsRead AS DWORD , BYREF ClientsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpCreateClientInfo LIB "dhcpsapi.dll" ALIAS "DhcpCreateClientInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ClientInfo AS DHCP_CLIENT_INFO ) AS DWORD
DECLARE FUNCTION DhcpSetClientInfo LIB "dhcpsapi.dll" ALIAS "DhcpSetClientInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ClientInfo AS DHCP_CLIENT_INFO ) AS DWORD
DECLARE FUNCTION DhcpGetClientInfo LIB "dhcpsapi.dll" ALIAS "DhcpGetClientInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF SearchInfo AS DHCP_SEARCH_INFO , BYREF ClientInfo AS DHCP_CLIENT_INFO ) AS DWORD
DECLARE FUNCTION DhcpDeleteClientInfo LIB "dhcpsapi.dll" ALIAS "DhcpDeleteClientInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ClientInfo AS DHCP_SEARCH_INFO ) AS DWORD
DECLARE FUNCTION DhcpEnumSubnetClients LIB "dhcpsapi.dll" ALIAS "DhcpEnumSubnetClients" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF ClientInfo AS DHCP_CLIENT_INFO_ARRAY , BYREF ClientsRead AS DWORD , BYREF ClientsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpGetClientOptions LIB "dhcpsapi.dll" ALIAS "DhcpGetClientOptions" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL ClientIpAddress AS DWORD , BYVAL ClientSubnetMask AS DWORD , BYREF ClientOptions AS DHCP_OPTION_LIST ) AS DWORD
DECLARE FUNCTION DhcpGetMibInfo LIB "dhcpsapi.dll" ALIAS "DhcpGetMibInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF MibInfo AS DHCP_MIB_INFO ) AS DWORD
DECLARE FUNCTION DhcpServerSetConfig LIB "dhcpsapi.dll" ALIAS "DhcpServerSetConfig" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL FieldsToSet AS DWORD , BYREF ConfigInfo AS DHCP_SERVER_CONFIG_INFO ) AS DWORD
DECLARE FUNCTION DhcpServerGetConfig LIB "dhcpsapi.dll" ALIAS "DhcpServerGetConfig" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ConfigInfo AS DHCP_SERVER_CONFIG_INFO ) AS DWORD
DECLARE FUNCTION DhcpScanDatabase LIB "dhcpsapi.dll" ALIAS "DhcpScanDatabase" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYVAL FixFlag AS DWORD , BYREF ScanList AS DHCP_SCAN_LIST ) AS DWORD
DECLARE SUB DhcpRpcFreeMemory LIB "dhcpsapi.dll" ALIAS "DhcpRpcFreeMemory" ( BYVAL BufferPointer AS DWORD )
DECLARE FUNCTION DhcpGetVersion LIB "dhcpsapi.dll" ALIAS "DhcpGetVersion" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF MajorVersion AS QUAD , BYREF MinorVersion AS QUAD ) AS QUAD
DECLARE FUNCTION DhcpAddSubnetElementV4 LIB "dhcpsapi.dll" ALIAS "DhcpAddSubnetElementV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF AddElementInfo AS DHCP_SUBNET_ELEMENT_DATA_V4 ) AS DWORD
DECLARE FUNCTION DhcpEnumSubnetElementsV4 LIB "dhcpsapi.dll" ALIAS "DhcpEnumSubnetElementsV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYVAL EnumElementType AS LONG , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF EnumElementInfo AS DHCP_SUBNET_ELEMENT_INFO_ARRAY_V4 , BYREF ElementsRead AS DWORD , BYREF ElementsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpRemoveSubnetElementV4 LIB "dhcpsapi.dll" ALIAS "DhcpRemoveSubnetElementV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF RemoveElementInfo AS DHCP_SUBNET_ELEMENT_DATA_V4 , BYVAL ForceFlag AS LONG ) AS DWORD
DECLARE FUNCTION DhcpCreateClientInfoV4 LIB "dhcpsapi.dll" ALIAS "DhcpCreateClientInfoV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ClientInfo AS DHCP_CLIENT_INFO_V4 ) AS DWORD
DECLARE FUNCTION DhcpSetClientInfoV4 LIB "dhcpsapi.dll" ALIAS "DhcpSetClientInfoV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ClientInfo AS DHCP_CLIENT_INFO_V4 ) AS DWORD
DECLARE FUNCTION DhcpGetClientInfoV4 LIB "dhcpsapi.dll" ALIAS "DhcpGetClientInfoV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF SearchInfo AS DHCP_SEARCH_INFO , BYREF ClientInfo AS DHCP_CLIENT_INFO_V4 ) AS DWORD
DECLARE FUNCTION DhcpEnumSubnetClientsV4 LIB "dhcpsapi.dll" ALIAS "DhcpEnumSubnetClientsV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF ClientInfo AS DHCP_CLIENT_INFO_ARRAY_V4 , BYREF ClientsRead AS DWORD , BYREF ClientsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpServerSetConfigV4 LIB "dhcpsapi.dll" ALIAS "DhcpServerSetConfigV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL FieldsToSet AS DWORD , BYREF ConfigInfo AS DHCP_SERVER_CONFIG_INFO_V4 ) AS DWORD
DECLARE FUNCTION DhcpServerGetConfigV4 LIB "dhcpsapi.dll" ALIAS "DhcpServerGetConfigV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ConfigInfo AS DHCP_SERVER_CONFIG_INFO_V4 ) AS DWORD
DECLARE FUNCTION DhcpSetSuperScopeV4 LIB "dhcpsapi.dll" ALIAS "DhcpSetSuperScopeV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF SuperScopeName AS WSTRINGZ , BYVAL ChangeExisting AS LONG ) AS DWORD
DECLARE FUNCTION DhcpDeleteSuperScopeV4 LIB "dhcpsapi.dll" ALIAS "DhcpDeleteSuperScopeV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF SuperScopeName AS WSTRINGZ ) AS DWORD
DECLARE FUNCTION DhcpGetSuperScopeInfoV4 LIB "dhcpsapi.dll" ALIAS "DhcpGetSuperScopeInfoV4" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF SuperScopeTable AS DHCP_SUPER_SCOPE_TABLE ) AS DWORD
DECLARE FUNCTION DhcpEnumSubnetClientsV5 LIB "dhcpsapi.dll" ALIAS "DhcpEnumSubnetClientsV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF ClientInfo AS DHCP_CLIENT_INFO_ARRAY_V5 , BYREF ClientsRead AS DWORD , BYREF ClientsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpCreateOptionV5 LIB "dhcpsapi.dll" ALIAS "DhcpCreateOptionV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionId AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF OptionInfo AS DHCP_OPTION ) AS DWORD
DECLARE FUNCTION DhcpSetOptionInfoV5 LIB "dhcpsapi.dll" ALIAS "DhcpSetOptionInfoV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionId AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF OptionInfo AS DHCP_OPTION ) AS DWORD
DECLARE FUNCTION DhcpGetOptionInfoV5 LIB "dhcpsapi.dll" ALIAS "DhcpGetOptionInfoV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionId AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF OptionInfo AS DHCP_OPTION ) AS DWORD
DECLARE FUNCTION DhcpEnumOptionsV5 LIB "dhcpsapi.dll" ALIAS "DhcpEnumOptionsV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF Options AS DHCP_OPTION_ARRAY , BYREF OptionsRead AS DWORD , BYREF OptionsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpRemoveOptionV5 LIB "dhcpsapi.dll" ALIAS "DhcpRemoveOptionV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionId AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ ) AS DWORD
DECLARE FUNCTION DhcpSetOptionValueV5 LIB "dhcpsapi.dll" ALIAS "DhcpSetOptionValueV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionID AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO , BYVAL OptionValue AS LONG ) AS DWORD
DECLARE FUNCTION DhcpSetOptionValuesV5 LIB "dhcpsapi.dll" ALIAS "DhcpSetOptionValuesV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO , BYREF OptionValues AS DHCP_OPTION_VALUE_ARRAY ) AS DWORD
DECLARE FUNCTION DhcpGetOptionValueV5 LIB "dhcpsapi.dll" ALIAS "DhcpGetOptionValueV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionId AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO , BYREF OptionValue AS DHCP_OPTION_VALUE ) AS DWORD
DECLARE FUNCTION DhcpGetOptionValueV6 LIB "dhcpsapi.dll" ALIAS "DhcpGetOptionValueV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionId AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO6 , BYREF OptionValue AS DHCP_OPTION_VALUE ) AS DWORD
DECLARE FUNCTION DhcpEnumOptionValuesV5 LIB "dhcpsapi.dll" ALIAS "DhcpEnumOptionValuesV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF OptionValues AS DHCP_OPTION_VALUE_ARRAY , BYREF OptionsRead AS DWORD , BYREF OptionsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpRemoveOptionValueV5 LIB "dhcpsapi.dll" ALIAS "DhcpRemoveOptionValueV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionId AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO ) AS DWORD
DECLARE FUNCTION DhcpCreateClass LIB "dhcpsapi.dll" ALIAS "DhcpCreateClass" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL ReservedMustBeZero AS DWORD , BYREF ClassInfo AS DHCP_CLASS_INFO ) AS DWORD
DECLARE FUNCTION DhcpModifyClass LIB "dhcpsapi.dll" ALIAS "DhcpModifyClass" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL ReservedMustBeZero AS DWORD , BYREF ClassInfo AS DHCP_CLASS_INFO ) AS DWORD
DECLARE FUNCTION DhcpDeleteClass LIB "dhcpsapi.dll" ALIAS "DhcpDeleteClass" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL ReservedMustBeZero AS DWORD , BYREF ClassName AS WSTRINGZ ) AS DWORD
DECLARE FUNCTION DhcpGetClassInfo LIB "dhcpsapi.dll" ALIAS "DhcpGetClassInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL ReservedMustBeZero AS DWORD , BYREF PartialClassInfo AS DHCP_CLASS_INFO , BYREF FilledClassInfo AS DHCP_CLASS_INFO ) AS DWORD
DECLARE FUNCTION DhcpEnumClasses LIB "dhcpsapi.dll" ALIAS "DhcpEnumClasses" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL ReservedMustBeZero AS DWORD , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF ClassInfoArray AS DHCP_CLASS_INFO_ARRAY , BYREF nRead AS DWORD , BYREF nTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpGetAllOptions LIB "dhcpsapi.dll" ALIAS "DhcpGetAllOptions" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF OptionStruct AS DHCP_ALL_OPTIONS ) AS DWORD
DECLARE FUNCTION DhcpGetAllOptionsV6 LIB "dhcpsapi.dll" ALIAS "DhcpGetAllOptionsV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF OptionStruct AS DHCP_ALL_OPTIONS ) AS DWORD
DECLARE FUNCTION DhcpGetAllOptionValues LIB "dhcpsapi.dll" ALIAS "DhcpGetAllOptionValues" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO6 , BYREF Values AS DHCP_ALL_OPTION_VALUES ) AS DWORD
DECLARE FUNCTION DhcpGetAllOptionValuesV6 LIB "dhcpsapi.dll" ALIAS "DhcpGetAllOptionValuesV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO6 , BYREF Values AS DHCP_ALL_OPTION_VALUES ) AS DWORD
'//DOC DhcpEnumServers enumerates the list of servers found in the DS. If the DS
'//DOC is not accessible, it returns an error. The only currently used parameter
'//DOC is the out parameter Servers. This is a SLOW call.
DECLARE FUNCTION DhcpEnumServers LIB "dhcpsapi.dll" ALIAS "DhcpEnumServers" ( BYVAL Flags AS QUAD , BYVAL IdInfo AS QUAD , BYREF Servers AS DHCP_SERVER_INFO_ARRAY , BYVAL CallbackFn AS QUAD , BYVAL CallbackData AS QUAD ) AS QUAD
'//DOC DhcpAddServer tries to add a new server to the existing list of servers in
'//DOC the DS. The function returns error if the Server already exists in the DS.
'//DOC The function tries to upload the server configuration to the DS..
'//DOC This is a SLOW call. Currently, the DsLocation and DsLocType are not valid
'//DOC fields in the NewServer and they'd be ignored. Version must be zero.
DECLARE FUNCTION DhcpAddServer LIB "dhcpsapi.dll" ALIAS "DhcpAddServer" ( BYVAL Flags AS QUAD , BYVAL IdInfo AS QUAD , BYREF NewServer AS DHCP_SERVER_INFO , BYVAL CallbackFn AS QUAD , BYVAL CallbackData AS QUAD ) AS QUAD
'//DOC DhcpDeleteServer tries to delete the server from DS. It is an error if the
'//DOC server does not already exist. This also deletes any objects related to
'//DOC this server in the DS (like subnet, reservations etc.).
DECLARE FUNCTION DhcpDeleteServer LIB "dhcpsapi.dll" ALIAS "DhcpDeleteServer" ( BYVAL Flags AS QUAD , BYVAL IdInfo AS QUAD , BYREF NewServer AS DHCP_SERVER_INFO , BYVAL CallbackFn AS QUAD , BYVAL CallbackData AS QUAD ) AS QUAD
DECLARE FUNCTION DhcpGetServerBindingInfo LIB "dhcpsapi.dll" ALIAS "DhcpGetServerBindingInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF BindElementInfo AS DHCP_BIND_ELEMENT_ARRAY ) AS DWORD
DECLARE FUNCTION DhcpSetServerBindingInfo LIB "dhcpsapi.dll" ALIAS "DhcpSetServerBindingInfo" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF BindElementInfo AS DHCP_BIND_ELEMENT_ARRAY ) AS DWORD
DECLARE FUNCTION DhcpAddSubnetElementV5 LIB "dhcpsapi.dll" ALIAS "DhcpAddSubnetElementV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF AddElementInfo AS DHCP_SUBNET_ELEMENT_DATA_V5 ) AS DWORD
DECLARE FUNCTION DhcpEnumSubnetElementsV5 LIB "dhcpsapi.dll" ALIAS "DhcpEnumSubnetElementsV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYVAL EnumElementType AS LONG , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF EnumElementInfo AS DHCP_SUBNET_ELEMENT_INFO_ARRAY_V5 , BYREF ElementsRead AS DWORD , BYREF ElementsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpRemoveSubnetElementV5 LIB "dhcpsapi.dll" ALIAS "DhcpRemoveSubnetElementV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF RemoveElementInfo AS DHCP_SUBNET_ELEMENT_DATA_V5 ) AS DWORD
'//V6 Api's
DECLARE FUNCTION DhcpCreateOptionV6 LIB "dhcpsapi.dll" ALIAS "DhcpCreateOptionV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS QUAD , BYVAL OptionId AS QUAD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF OptionInfo AS DHCP_OPTION ) AS QUAD
DECLARE FUNCTION DhcpRemoveOptionV6 LIB "dhcpsapi.dll" ALIAS "DhcpRemoveOptionV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionID AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ ) AS DWORD
DECLARE FUNCTION DhcpEnumOptionsV6 LIB "dhcpsapi.dll" ALIAS "DhcpEnumOptionsV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF Options AS DHCP_OPTION_ARRAY , BYREF OptionsRead AS DWORD , BYREF OptionsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpRemoveOptionValueV6 LIB "dhcpsapi.dll" ALIAS "DhcpRemoveOptionValueV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionID AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO6 ) AS DWORD
DECLARE FUNCTION DhcpGetOptionInfoV6 LIB "dhcpsapi.dll" ALIAS "DhcpGetOptionInfoV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionID AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF OptionInfo AS DHCP_OPTION ) AS DWORD
DECLARE FUNCTION DhcpSetOptionInfoV6 LIB "dhcpsapi.dll" ALIAS "DhcpSetOptionInfoV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionID AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF OptionInfo AS DHCP_OPTION ) AS DWORD
DECLARE FUNCTION DhcpSetOptionValueV6 LIB "dhcpsapi.dll" ALIAS "DhcpSetOptionValueV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYVAL OptionID AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO6 , BYVAL OptionValue AS LONG ) AS DWORD
DECLARE FUNCTION DhcpGetSubnetInfoVQ LIB "dhcpsapi.dll" ALIAS "DhcpGetSubnetInfoVQ" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF SubnetInfo AS DHCP_SUBNET_INFO_VQ ) AS DWORD
DECLARE FUNCTION DhcpCreateSubnetVQ LIB "dhcpsapi.dll" ALIAS "DhcpCreateSubnetVQ" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF SubnetInfo AS DHCP_SUBNET_INFO_VQ ) AS DWORD
DECLARE FUNCTION DhcpSetSubnetInfoVQ LIB "dhcpsapi.dll" ALIAS "DhcpSetSubnetInfoVQ" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF SubnetInfo AS DHCP_SUBNET_INFO_VQ ) AS DWORD
DECLARE FUNCTION DhcpEnumOptionValuesV6 LIB "dhcpsapi.dll" ALIAS "DhcpEnumOptionValuesV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF ClassName AS WSTRINGZ , BYREF VendorName AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO6 , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF OptionValues AS DHCP_OPTION_VALUE_ARRAY , BYREF OptionsRead AS DWORD , BYREF OptionsTotal AS DWORD ) AS DWORD
'#ENDIF ' DHCPAPI_NO_PROTOTYPES
'//DOC DhcpDsInit must be called exactly once per process.. this initializes the
'//DOC memory and other structures for this process. This initializes some DS
'//DOC object handles (memory), and hence is slow as this has to read from DS.
DECLARE FUNCTION DhcpDsInit LIB "dhcpsapi.dll" ALIAS "DhcpDsInit" ( ) AS QUAD
'//DOC DhcpDsCleanup undoes the effect of any DhcpDsInit. This function should be
'//DOC called exactly once for each process, and only at termination. Note that
'//DOC it is safe to call this function even if DhcpDsInit does not succeed.
DECLARE SUB DhcpDsCleanup LIB "dhcpsapi.dll" ALIAS "DhcpDsCleanup" ( )
DECLARE FUNCTION DhcpSetThreadOptions LIB "dhcpsapi.dll" ALIAS "DhcpSetThreadOptions" ( BYVAL Flags AS QUAD , BYVAL Reserved AS QUAD ) AS QUAD
'//DOC DhcpGetThreadOptions retrieves the current thread options as set by DhcpSetThreadOptions.
'//DOC If none were set, the return value is zero.
DECLARE FUNCTION DhcpGetThreadOptions LIB "dhcpsapi.dll" ALIAS "DhcpGetThreadOptions" ( BYVAL Flags AS QUAD , BYVAL Reserved AS QUAD ) AS QUAD
DECLARE FUNCTION DhcpServerQueryAttribute LIB "dhcpsapi.dll" ALIAS "DhcpServerQueryAttribute" ( BYREF ServerIpAddr AS WSTRINGZ , BYVAL dwReserved AS DWORD , BYVAL DhcpAttribId AS DWORD , BYREF pDhcpAttrib AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpServerQueryAttributes LIB "dhcpsapi.dll" ALIAS "DhcpServerQueryAttributes" ( BYREF ServerIpAddr AS WSTRINGZ , BYVAL dwReserved AS DWORD , BYVAL dwAttribCount AS DWORD , BYREF pDhcpAttribs AS DWORD , BYREF pDhcpAttribArr AS DHCP_ATTRIB_ARRAY ) AS DWORD
DECLARE FUNCTION DhcpServerRedoAuthorization LIB "dhcpsapi.dll" ALIAS "DhcpServerRedoAuthorization" ( BYREF ServerIpAddr AS WSTRINGZ , BYVAL dwReserved AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpAuditLogSetParams LIB "dhcpsapi.dll" ALIAS "DhcpServerRedoAuthorization" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS QUAD , BYREF AuditLogDir AS WSTRINGZ , BYVAL DiskCheckInterval AS QUAD , BYVAL MaxLogFilesSize AS QUAD , BYVAL MinSpaceOnDisk AS QUAD ) AS QUAD
DECLARE FUNCTION DhcpAuditLogGetParams LIB "dhcpsapi.dll" ALIAS "DhcpAuditLogGetParams" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF AuditLogDir AS DWORD , BYREF DiskCheckInterval AS DWORD , BYREF MaxLogFilesSize AS DWORD , BYREF MinSpaceOnDisk AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpServerQueryDnsRegCredentials LIB "dhcpsapi.dll" ALIAS "DhcpServerQueryDnsRegCredentials" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL UnameSize AS DWORD , BYREF Uname AS WSTRINGZ , BYVAL DomainSize AS DWORD , BYREF Domain AS WSTRINGZ ) AS DWORD
DECLARE FUNCTION DhcpServerSetDnsRegCredentials LIB "dhcpsapi.dll" ALIAS "DhcpServerSetDnsRegCredentials" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF Uname AS WSTRINGZ , BYREF Domain AS WSTRINGZ , BYREF Passwd AS WSTRINGZ ) AS DWORD
DECLARE FUNCTION DhcpServerSetDnsRegCredentialsV5 LIB "dhcpsapi.dll" ALIAS "DhcpServerSetDnsRegCredentialsV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF Uname AS WSTRINGZ , BYREF Domain AS WSTRINGZ , BYREF Passwd AS WSTRINGZ ) AS DWORD
DECLARE FUNCTION DhcpServerBackupDatabase LIB "dhcpsapi.dll" ALIAS "DhcpServerBackupDatabase" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Path AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpServerRestoreDatabase LIB "dhcpsapi.dll" ALIAS "DhcpServerRestoreDatabase" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Path AS DWORD ) AS DWORD
'//
'// All Quarantine related APIs
'//
DECLARE FUNCTION DhcpServerSetConfigVQ LIB "dhcpsapi.dll" ALIAS "DhcpServerSetConfigVQ" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL FieldsToSet AS QUAD , BYREF ConfigInfo AS DHCP_SERVER_CONFIG_INFO_VQ ) AS QUAD
DECLARE FUNCTION DhcpServerGetConfigVQ LIB "dhcpsapi.dll" ALIAS "DhcpServerGetConfigVQ" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ConfigInfo AS DHCP_SERVER_CONFIG_INFO_VQ ) AS DWORD
DECLARE FUNCTION DhcpGetServerSpecificStrings LIB "dhcpsapi.dll" ALIAS "DhcpGetServerSpecificStrings" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ServerSpecificStrings AS DHCP_SERVER_SPECIFIC_STRINGS ) AS DWORD
DECLARE SUB DhcpServerAuditlogParamsFree LIB "dhcpsapi.dll" ALIAS "DhcpServerAuditlogParamsFree" ( BYREF ConfigInfo AS DHCP_SERVER_CONFIG_INFO_VQ )
DECLARE FUNCTION DhcpCreateSubnetV6 LIB "dhcpsapi.dll" ALIAS "DhcpCreateSubnetV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DHCP_IPV6_ADDRESS , BYREF SubnetInfo AS DHCP_SUBNET_INFO_V6 ) AS QUAD
DECLARE FUNCTION DhcpDeleteSubnetV6 LIB "dhcpsapi.dll" ALIAS "DhcpDeleteSubnetV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DHCP_IPV6_ADDRESS , BYVAL ForceFlag AS LONG ) AS DWORD
DECLARE FUNCTION DhcpEnumSubnetsV6 LIB "dhcpsapi.dll" ALIAS "DhcpEnumSubnetsV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF EnumInfo AS DHCPV6_IP_ARRAY , BYREF ElementsRead AS DWORD , BYREF ElementsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpAddSubnetElementV6 LIB "dhcpsapi.dll" ALIAS "DhcpAddSubnetElementV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DHCP_IPV6_ADDRESS , BYREF AddElementInfo AS DHCP_SUBNET_ELEMENT_DATA_V6 ) AS DWORD
DECLARE FUNCTION DhcpRemoveSubnetElementV6 LIB "dhcpsapi.dll" ALIAS "DhcpRemoveSubnetElementV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DHCP_IPV6_ADDRESS , BYREF RemoveElementInfo AS DHCP_SUBNET_ELEMENT_DATA_V6 , BYVAL ForceFlag AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpEnumSubnetElementsV6 LIB "dhcpsapi.dll" ALIAS "DhcpEnumSubnetElementsV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DHCP_IPV6_ADDRESS , BYVAL EnumElementType AS LONG , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF EnumElementInfo AS DHCP_SUBNET_ELEMENT_INFO_ARRAY_V6 , BYREF ElementsRead AS DWORD , BYREF ElementsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpGetSubnetInfoV6 LIB "dhcpsapi.dll" ALIAS "DhcpGetSubnetInfoV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DHCP_IPV6_ADDRESS , BYREF SubnetInfo AS DHCP_SUBNET_INFO_V6 ) AS DWORD
DECLARE FUNCTION DhcpEnumSubnetClientsV6 LIB "dhcpsapi.dll" ALIAS "DhcpEnumSubnetClientsV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DHCP_IPV6_ADDRESS , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF ClientInfo AS DHCP_CLIENT_INFO_ARRAY_V6 , BYREF ClientsRead AS DWORD , BYREF ClientsTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpServerGetConfigV6 LIB "dhcpsapi.dll" ALIAS "DhcpServerGetConfigV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO6 , BYREF ConfigInfo AS DHCP_SERVER_CONFIG_INFO_V6 ) AS DWORD
DECLARE FUNCTION DhcpServerSetConfigV6 LIB "dhcpsapi.dll" ALIAS "DhcpServerSetConfigV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ScopeInfo AS DHCP_OPTION_SCOPE_INFO6 , BYVAL FieldsToSet AS DWORD , BYREF ConfigInfo AS DHCP_SERVER_CONFIG_INFO_V6 ) AS DWORD
DECLARE FUNCTION DhcpSetSubnetInfoV6 LIB "dhcpsapi.dll" ALIAS "DhcpSetSubnetInfoV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF SubnetAddress AS DHCP_IPV6_ADDRESS , BYREF SubnetInfo AS DHCP_SUBNET_INFO_V6 ) AS DWORD
DECLARE FUNCTION DhcpGetMibInfoV6 LIB "dhcpsapi.dll" ALIAS "DhcpGetMibInfoV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF MibInfo AS DHCP_MIB_INFO_V6 ) AS DWORD
DECLARE FUNCTION DhcpGetServerBindingInfoV6 LIB "dhcpsapi.dll" ALIAS "DhcpGetServerBindingInfoV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF BindElementsInfo AS DHCPV6_BIND_ELEMENT_ARRAY ) AS DWORD
DECLARE FUNCTION DhcpSetServerBindingInfoV6 LIB "dhcpsapi.dll" ALIAS "DhcpSetServerBindingInfoV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL Flags AS DWORD , BYREF BindElementsInfo AS DHCPV6_BIND_ELEMENT_ARRAY ) AS DWORD
DECLARE FUNCTION DhcpSetClientInfoV6 LIB "dhcpsapi.dll" ALIAS "DhcpSetClientInfoV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ClientInfo AS DHCP_CLIENT_INFO_V6 ) AS DWORD
DECLARE FUNCTION DhcpGetClientInfoV6 LIB "dhcpsapi.dll" ALIAS "DhcpGetClientInfoV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF SearchInfo AS DHCP_SEARCH_INFO_V6 , BYREF ClientInfo AS DHCP_CLIENT_INFO_V6 ) AS DWORD
DECLARE FUNCTION DhcpDeleteClientInfoV6 LIB "dhcpsapi.dll" ALIAS "DhcpDeleteClientInfoV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF ClientInfo AS DHCP_CLIENT_INFO_V6 ) AS DWORD
DECLARE FUNCTION DhcpCreateClassV6 LIB "dhcpsapi.dll" ALIAS "DhcpCreateClassV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL ReservedMustBeZero AS DWORD , BYREF ClassInfo AS DHCP_CLASS_INFO_V6 ) AS DWORD
DECLARE FUNCTION DhcpModifyClassV6 LIB "dhcpsapi.dll" ALIAS "DhcpModifyClassV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL ReservedMustBeZero AS DWORD , BYREF ClassInfo AS DHCP_CLASS_INFO_V6 ) AS DWORD
DECLARE FUNCTION DhcpDeleteClassV6 LIB "dhcpsapi.dll" ALIAS "DhcpDeleteClassV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL ReservedMustBeZero AS DWORD , BYREF ClassName AS WSTRINGZ ) AS DWORD
DECLARE FUNCTION DhcpEnumClassesV6 LIB "dhcpsapi.dll" ALIAS "DhcpEnumClassesV6" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL ReservedMustBeZero AS DWORD , BYREF ResumeHandle AS DWORD , BYVAL PreferredMaximum AS DWORD , BYREF ClassInfoArray AS DHCP_CLASS_INFO_ARRAY_V6 , BYREF nRead AS DWORD , BYREF nTotal AS DWORD ) AS DWORD
DECLARE FUNCTION DhcpSetSubnetDelayOffer LIB "dhcpsapi.dll" ALIAS "DhcpSetSubnetDelayOffer" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYVAL TimeDelayInMilliseconds AS WORD ) AS DWORD
DECLARE FUNCTION DhcpGetSubnetDelayOffer LIB "dhcpsapi.dll" ALIAS "DhcpGetSubnetDelayOffer" ( BYREF ServerIpAddress AS WSTRINGZ , BYVAL SubnetAddress AS DWORD , BYREF TimeDelayInMilliseconds AS WORD ) AS DWORD
DECLARE FUNCTION DhcpGetMibInfoV5 LIB "dhcpsapi.dll" ALIAS "DhcpGetMibInfoV5" ( BYREF ServerIpAddress AS WSTRINGZ , BYREF MibInfo AS DHCP_MIB_INFO_V5 ) AS DWORD
DECLARE FUNCTION DhcpAddSecurityGroup LIB "dhcpsapi.dll" ALIAS "DhcpAddSecurityGroup" ( BYREF ServerIpAddress AS WSTRINGZ ) AS DWORD