The R_DhcpCreateSubnetVQ method is used to create the new IPv4 subnet along with its NAP state on the DHCPv4 server. This method is an extension of R_DhcpCreateSubnet (section 3.1.4.1).

 DWORD R_DhcpCreateSubnetVQ(
   [in, unique, string] DHCP_SRV_HANDLE ServerIpAddress,
   [in] DHCP_IP_ADDRESS SubnetAddress,
   [in, ref] LPDHCP_SUBNET_INFO_VQ SubnetInfoVQ
 );

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

SubnetAddress: This is of type DHCP_IP_ADDRESS (section 2.2.1.2.1), containing the IPv4 address of the subnet.

SubnetInfoVQ: This is a pointer to a structure of type DHCP_SUBNET_INFO_VQ (section 2.2.1.2.45) that contains information about the IPv4 subnet, including the IPv4 subnet mask and the IPv4 address of the subnet. The structure DHCP_HOST_INFO (section 2.2.1.2.7) (referred by the PrimaryHost member) stored in the SubnetInfoVQ parameter MUST be ignored by both the caller and the server.

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.

0x00004E2D

ERROR_DHCP_JET_ERROR

An error occurred while accessing the DHCP server database.

0x00004E54

ERROR_DHCP_SUBNET_EXISTS

The IPv4 scope parameters are incorrect. Either the IPv4 scope already exists, corresponding to the SubnetAddress and SubnetMask members of the DHCP_SUBNET_INFO_VQ (section 2.2.1.2.45) structure, or there is a range overlap of IPv4 addresses between those associated with the SubnetAddress and SubnetMask members of the new IPv4 scope and the subnet address and mask of an already existing IPv4 scope.

The opnum field value for this method is 48.

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 [MS-RPCE].