DhcpAddServer function (dhcpsapi.h)

The DhcpAddServer function attempts to add a new server to the existing list of DHCP servers maintained in the domain directory service. If the specified DHCP server already exists in the directory service, an error is returned.

Syntax

DWORD DhcpAddServer(
  [in] DWORD              Flags,
  [in] LPVOID             IdInfo,
  [in] LPDHCP_SERVER_INFO NewServer,
  [in] LPVOID             CallbackFn,
  [in] LPVOID             CallbackData
);

Parameters

[in] Flags

Reserved for future use. This field should be set to 0x00000000.

[in] IdInfo

Pointer to an address containing the server's ID block. This field should be set to null.

[in] NewServer

Pointer to a DHCP_SERVER_INFO structure containing information about the new DHCP server. The DsLocation and DsLocType members present in this structure are not valid in this implementation, and they should be set to null. The Version member of this structure should be set to 0.

[in] CallbackFn

Pointer to the callback function that will be called when the server add operation completes. This field should be null.

[in] CallbackData

Pointer to a data block containing the formatted structure for callback information. This field should be null.

Return value

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

Requirements

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

See also

DHCP_SERVER_INFO

DhcpDeleteServer