4.20 Deleting a Virtualization Instance
The following example describes how to delete a new virtualization instance named "example_vi1" in DNS server.
The client calls R_DnssrvOperation4 (section 3.1.4.16) and provides the following parameters:
DNS_RPC_CURRENT_CLIENT_VER (section 2.2.1.2.1) as the client version.
Zero as the settings flag.
A Unicode string containing the FQDN of the DNS server on which the virtualization instance is to be deleted.
Zero as the context.
DeleteVirtualizationInstance as the operation.
DNSSRV_TYPEID_VIRTUALIZATION_INSTANCE as the type ID.
Create a DNS_RPC_VIRTUALIZATION_INSTANCE (section 2.2.17.1.1) structure with pwszVirtualizationID as "example_vi1". This operation will delete the zones and zone scopes under the virtualization instance. Value of dwFlags can be set to DNS_RPC_FLAG_PRESERVE_ZONE_FILE if admin wants to preserve the zone files of zones under a virtualization instance. Pass this structure as RPC data.
The DNS server returns ERROR_SUCCESS if the operation was successful or a Windows error code if the operation fails.