DhcpGetAllOptions function (dhcpsapi.h)
The DhcpGetAllOptions function returns an array that contains all options defined on the DHCP server.
Syntax
DWORD DhcpGetAllOptions(
[in] LPWSTR ServerIpAddress,
[in] DWORD Flags,
[out] LPDHCP_ALL_OPTIONS *OptionStruct
);
Parameters
[in] ServerIpAddress
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 options are vendor-specific. If the qualification of vendor options is not necessary, this parameter should be 0.
Value | Meaning |
---|---|
|
This flag should be set if vendor-specific options are desired. |
[out] OptionStruct
Pointer to a DHCP_ALL_OPTIONS structure containing every option defined for a vendor or default class. If there are no options available on the server, this value will be null.
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 code | Description |
---|---|
|
An error occurred while accessing the DHCP server database. |
Remarks
There will be one option element in the array specified by OptionStruct for each vendor/class pair defined on the DHCP server.
Requirements
Requirement | Value |
---|---|
Minimum supported client | None supported |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | dhcpsapi.h |
Library | Dhcpsapi.lib |
DLL | Dhcpsapi.dll |