DhcpEnumOptionValuesV6 function (dhcpsapi.h)

The DhcpEnumOptionValuesV6 function returns an enumerated list of option values (the option data and the associated ID number) for a specific scope within a given class.

Syntax

DWORD DHCP_API_FUNCTION DhcpEnumOptionValuesV6(
  [in]      DHCP_CONST WCHAR          *ServerIpAddress,
  [in]      DWORD                     Flags,
  [in]      LPWSTR                    ClassName,
  [in]      LPWSTR                    VendorName,
  [in]      LPDHCP_OPTION_SCOPE_INFO6 ScopeInfo,
  [in, out] DHCP_RESUME_HANDLE        *ResumeHandle,
  [in]      DWORD                     PreferredMaximum,
  [out]     LPDHCP_OPTION_VALUE_ARRAY *OptionValues,
  [out]     DWORD                     *OptionsRead,
  [out]     DWORD                     *OptionsTotal
);

Parameters

[in] ServerIpAddress

Pointer to a Unicode string that specifies the IP address or hostname of the DHCP server.

[in] Flags

Specifies a bit flag that indicates whether or not the option is vendor specific. If it is not vendor specific, this parameter should be 0.

Value Meaning
DHCP_FLAGS_OPTION_IS_VENDOR
This flag should be set if the option is provided by a vendor.

[in] ClassName

Unicode string that contains the name of the class whose scope's option values will be enumerated.

[in] VendorName

Unicode string that contains the name of the vendor for the class. This parameter is optional.

[in] ScopeInfo

DHCP_OPTION_SCOPE_INFO6 structure that contains the scope for which the option values are defined.

[in, out] ResumeHandle

Pointer to a DHCP_RESUME_HANDLE value that identifies the enumeration operation. Initially, this value should be zero, with a successful call returning the handle value used for subsequent enumeration requests. For example, if PreferredMaximum is set to 1000 bytes, and 2000 bytes worth of option values are stored on the server, the resume handle can be used after the first 1000 bytes are retrieved to obtain the next 1000 on a subsequent call, and so forth.

[in] PreferredMaximum

Specifies the preferred maximum number of bytes of option values to return. If the number of remaining unenumerated options (in bytes) is less than this value, then that amount will be returned.

[out] OptionValues

Pointer to a DHCP_OPTION_VALUE_ARRAY structure that contains the enumerated option values returned for the specified scope. If there are no option values available for this scope on the DHCP server, this parameter will return null.

[out] OptionsRead

Pointer to a DWORD value that specifies the number of option values returned in OptionValues.

[out] OptionsTotal

Pointer to a DWORD value that specifies the total number of option values for this scope stored on the DHCP server.

Return value

This function returns ERROR_SUCCESS upon a successful call. Otherwise, it returns one of the DHCP Server Management API Error Codes.

Return code Description
ERROR_INVALID_PARAMETER
The parameters were invalid.
ERROR_NO_MORE_ITEMS
No more items to enumerate.
ERROR_NOT_ENOUGH_MEMORY
Memory failure.
ERROR_MORE_DATA
More data is available to enumerate.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header dhcpsapi.h
Library Dhcpsapi.lib
DLL Dhcpsapi.dll