DhcpEnumOptionsV6 function

The DhcpEnumOptionsV6 function returns an enumerated list of DHCP options for a given class and/or vendor.


DWORD DhcpEnumOptionsV6(
  _In_    LPWSTR              ServerIpAddress,
  _In_    DWORD               Flags,
  _In_    WCHAR               *ClassName,
  _In_    WCHAR               *VendorName,
  _Inout_ DHCP_RESUME_HANDLE  *ResumeHandle,
  _In_    DWORD               PreferredMaximum,
  _Out_   LPDHCP_OPTION_ARRAY *Options,
  _Out_   DWORD               *OptionsRead,
  _Out_   DWORD               *OptionsTotal


ServerIpAddress [in]

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

Flags [in]

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


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


ClassName [in]

Unicode string that contains the name of the class whose options will be enumerated.

VendorName [in]

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

ResumeHandle [in, out]

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 options 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.

PreferredMaximum [in]

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

Options [out]

Pointer to a DHCP_OPTION_ARRAY structure containing the returned options. If there are no options available on the DHCP server, this parameter will return null.

OptionsRead [out]

Pointer to a DWORD value that specifies the number of options returned in Options.

OptionsTotal [out]

Pointer to a DWORD value that specifies the total number of options 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 codeDescription

The parameters were invalid.


No more items to enumerate.


Memory failure.


More data is available to enumerate.



Minimum supported client

None supported

Minimum supported server

Windows Server 2008 [desktop apps only]