The R_DhcpV4GetPolicy method returns the specified policy. The memory for the Policy structure is allocated by this method and can be freed by the caller by using the function midl_user_free (section 3).

 DWORD R_DhcpV4GetPolicy(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] BOOL ServerPolicy,
   [in] DHCP_IP_ADDRESS SubnetAddress,
   [in, unique, string] LPWSTR PolicyName,
   [out] LPDHCP_POLICY* Policy
 );

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

ServerPolicy: This is of type BOOL and indicates whether the server level policy or scope level policy is being requested.

SubnetAddress: This is of type DHCP_IP_ADDRESS (section 2.2.1.2.1) and identifies the IPv4 subnet from which the policy is being requested.

PolicyName: A pointer to a null-terminated Unicode string that contains the name of the policy requested.

Policy: This out parameter is a pointer of type LPDHCP_POLICY that contains the policy data for the requested policy.

Return Values: A 32-bit unsigned integer value that indicates return status. A return value of ERROR_SUCCESS (0x00000000) indicates operation was completed successfully. Otherwise, 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.

0x00004E25

ERROR_DHCP_SUBNET_NOT_PRESENT

The specified IPv4 subnet does not exist.

The opnum field value for this method is 109.

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

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