Choosing Between Control Codes and Cluster API Functions

Control codes describe a great many operations, some of which can also be performed with a Cluster API function. This can be confusing — do you use a control code function or one of the other Cluster API functions? The rule of thumb is to always use a control code if possible, especially if the operation involves accessing the cluster database. For example, there are two ways to set a resource's private properties in the cluster database:

  1. Call ClusterResourceControl with the CLUSCTL_RESOURCE_SET_PRIVATE_PROPERTIES control code.
  2. Call ClusterRegOpenKey to access the appropriate key in the database and ClusterRegSetValue to perform the update.

Although the end result is the same, using the control code function is preferrable.