3.2.4.28 R_DhcpGetClassInfo (Opnum 27)

The R_DhcpGetClassInfo method retrieves the user class or vendor class information configured for the DHCP server. The caller of this function can free the memory pointed to by FilledClassInfo by calling the function midl_user_free (section 3).

 DWORD R_DhcpGetClassInfo(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] DWORD ReservedMustBeZero,
   [in] LPDHCP_CLASS_INFO PartialClassInfo,
   [out] LPDHCP_CLASS_INFO* FilledClassInfo
 );

ServerIpAddress: The IP address/host name of the DHCP server. This parameter is unused.

ReservedMustBeZero: This is of type DWORDand is reserved for future use. Currently it is not used, and any value set to this parameter will not affect the behavior of this method.

PartialClassInfo: This is of type LPDHCP_CLASS_INFO (section 2.2.1.2.75), containing the partial information of the class for which full information is retrieved in FilledClassInfo. The mandatory fields in this structure are ClassName, ClassData, and ClassDataLength.

FilledClassInfo: This is a pointer to type LPDHCP_CLASS_INFO (section 2.2.1.2.75) in which the complete information of a class is retrieved based on the PartialClassInfo.

Return Values: A 32-bit unsigned integer value that indicates return status. A return value ERROR_SUCCESS (0x00000000) indicates that the operation was completed successfully, else it contains a Win32 error code, as specified in [MS-ERREF]. This error code value can correspond to a DHCP-specific failure, which takes a value between 20000 and 20099, or any generic failure.

Return value/code

Description

0x00000000

ERROR_SUCCESS

The call was successful.

0x00004E4C

ERROR_DHCP_CLASS_NOT_FOUND

The class name being used is unknown or incorrect.

The opnum field value for this method is 27.

When processing this call, the DHCP server MUST do the following:

  • If PartialClassInfo or FilledClassInfo is NULL, return ERROR_INVALID_PARAMETER.

  • If the ClassName and ClassData fields in PartialClassInfo are NULL, return ERROR_INVALID_PARAMETER.

  • If the ClassName field in PartialClassInfo is NULL and the ClassDataLength field in PartialClassInfo is 0, return ERROR_INVALID_PARAMETER.

  • Validate if this method is authorized for read access per section 3.5.4. If not, return the error ERROR_ACCESS_DENIED.

  • Retrieve all the entries in the server ADM element DHCPv4ClassDefList, and retrieve the class corresponding toPartialClassInfo. If the ADM element DHCPv4ClassDef has no entry that matches all the mandatory fields of the PartialClassInfo parameter, return ERROR_DHCP_CLASS_NOT_FOUND.

  • Allocate the memory for FilledClassInfo, and copy the class information from DHCPv4ClassDef entry in the allocated memory and return it to the caller.

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].