DhcpGetClassInfo function (dhcpsapi.h)

The DhcpGetClassInfo function returns the user or vendor class information configured on a specific DHCP server.

Syntax

DWORD DhcpGetClassInfo(
  [in]  LPWSTR            ServerIpAddress,
  [in]  DWORD             ReservedMustBeZero,
  [in]  LPDHCP_CLASS_INFO PartialClassInfo,
  [out] LPDHCP_CLASS_INFO *FilledClassInfo
);

Parameters

[in] ServerIpAddress

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

[in] ReservedMustBeZero

Reserved. This parameter must be set to 0.

[in] PartialClassInfo

DHCP_CLASS_INFO structure that contains data provided by the caller for the following members, with all other fields initialized.

  • ClassName
  • ClassData
  • ClassDataLength
These fields must not be null.

[out] FilledClassInfo

DHCP_CLASS_INFO structure returned after lookup that contains the complete class information.

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 code Description
ERROR_ACCESS_DENIED
This call was performed by a client who is not a member of the "DHCP Administrators" security group.
ERROR_INVALID_PARAMETER
The DHCP_CLASS_INFO structure provided in PartialClassInfo has null or zero values for one or more of the required members.
ERROR_DHCP_CLASS_NOT_FOUND
A class name could not be found that matches the provided information.

Remarks

A DHCP class is a specific category of client, defined either by the vendor or by a user. An example of a vendor-defined class would be all Windows 8 clients, with Microsoft as the vendor. A user-defined class consists of those clients with specific attributes selected by a user or administrator, such as all laptops or clients that support wireless connections.

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

See also

DHCP_CLASS_INFO

DhcpCreateClass