DhcpGetAllOptionValues function

The DhcpGetAllOptionValues function returns an array that contains all option values defined for a specific scope on the DHCP server.

Syntax


DWORD DhcpGetAllOptionValues(
  _In_  LPWSTR                   ServerIpAddress,
  _In_  DWORD                    Flags,
  _In_  LPDHCP_OPTION_SCOPE_INFO ScopeInfo,
  _Out_ LPDHCP_ALL_OPTION_VALUES *Values
);

Parameters

ServerIpAddress [in]

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

Flags [in]

Specifies a bit flag that indicates whether the options are vendor-specific. If the qualification of vendor options is not necessary, this parameter should be 0.

ValueMeaning
DHCP_FLAGS_OPTION_IS_VENDOR

This flag should be set if vendor-specific options are desired.

 

ScopeInfo [in]

Pointer to a DHCP_OPTION_SCOPE_INFO structure that contains information on the specific scope whose option values will be returned. This information defines the option values that are being retrieved from the default, server, or scope level, or for a specific IPv4 reservation.

Values [out]

Pointer to a DHCP_ALL_OPTION_VALUES structure that contains the returned option values for the scope specified in ScopeInfo.

Note  

The memory for this parameter must be free using DhcpRpcFreeMemory.

 

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
ERROR_ACCESS_DENIED

This call was performed by a client who is not a member of the "DHCP Administrators" security group.

ERROR_DHCP_SUBNET_NOT_PRESENT

This specified IPv4 sunet is not defined on the DHCP server.

ERROR_DHCP_NOT_RESERVED_CLIENT

The specified DHCP client is not a reserved client.

 

Remarks

There will be one option value in the array specified by Values for each vendor/class pair defined on the DHCP server.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Dhcpsapi.h

Library

Dhcpsapi.lib

DLL

Dhcpsapi.dll

See also

DhcpGetAllOptions

 

 

Show: