<div class="content" name="ApiCreateEnumEx" uuid="f40a3677-3138-4142-9e55-d61c7dfe4284"><p>(Protocol Version 3) The ApiCreateEnumEx method SHOULD<a id="Appendix_A_Target_104"></a><a aria-label="Product behavior note 104" href="1d58eff8-a042-478c-972c-8e9c76a3f978#Appendix_A_104" data-linktype="relative-path">&lt;104&gt;</a> return two <span><a href="3b8f47c7-f694-4841-9aea-afa77184bbfa" data-linktype="relative-path">ENUM_LIST</a></span>
structures of equal length containing the <b>ID</b> and <b>Name</b> attributes
of the requested objects of the specified enumeration type from the cluster
state. Each <b>Element</b> in the <b>ReturnIdEnum</b> parameter corresponds to
the ID of the element at the same offset in the <b>ReturnNameEnum</b>
parameter.</p><p>If multiple enumeration types are indicated, the resulting
ENUM_LIST contains zero or more entries of each type, and the type of each
entry in the list is indicated by the <span><a href="fbc1bc18-45d4-4668-980d-ed639ea2f03e" data-linktype="relative-path">ENUM_ENTRY</a></span> data
structure, as specified in section 2.2.3.4.</p><p>The server SHOULD accept an ApiCreateEnumEx request if its <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_a93e2fea-3006-4a06-b48f-fdb36d9abac9" data-linktype="relative-path">protocol
server state</a></span> is read-only, as specified in section <span><a href="756547e7-ca64-4b7c-9f1b-2b1fbc6153d3" data-linktype="relative-path">3.1.1</a></span>,
and the <i>dwType</i> parameter is CLUSTER_ENUM_NODE. The server MUST accept an
ApiCreateEnumEx request if its protocol server state is read/write.</p><p>The server MUST fail this method with the
ERROR_INVALID_PARAMETER (0x00000057) return value if the <i>dwType</i>
parameter is not one of the specified values or if the <i>dwOptions</i>
parameter is not 0x00000000.</p><p>The server SHOULD accept an ApiCreateEnumEx request if the
access level associated with the hCluster context handle is at least
&#34;Read&#34; (section <span><a href="a249a463-3d3b-4058-abf6-3024d81806a0" data-linktype="relative-path">3.1.4</a></span>).</p><dl>
<dd>
<div><pre> error_status_t ApiCreateEnumEx(
   [in] HCLUSTER_RPC hCluster,
   [in] DWORD dwType,
   [in] DWORD dwOptions,
   [out] PENUM_LIST* ReturnIdEnum,
   [out] PENUM_LIST* ReturnNameEnum,
   [out] error_status_t* rpc_status
 );
</pre></div>
</dd></dl><p><b>hCluster: </b>An <span><a href="0102f475-9af8-45fa-83e6-22e57451570a" data-linktype="relative-path">HCLUSTER_RPC (section 2.2.1.1)</a></span>
context handle that was obtained in a previous <span><a href="19800483-bf86-42ec-8dcc-9af3ed8339e8" data-linktype="relative-path">ApiOpenCluster (section 3.1.4.2.1)</a></span>
or <span><a href="00ce494d-0c74-44fd-8276-c73665cf616b" data-linktype="relative-path">ApiOpenClusterEx (section 3.1.4.2.116)</a></span>
method call.</p><p><b>dwType: </b>The type of enumeration to be returned
by the server. This value MUST be set to the bitwise OR operator of one or more
of the following values, except as noted for CLUSTER_ENUM_INTERNAL_NETWORK.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>CLUSTER_ENUM_NODE 0x00000001</td>
  <td>The server MUST return an enumeration of names, in ReturnNameEnum, and an enumeration of IDs, in ReturnIdEnum, representing cluster nodes that are members of the cluster. Each element of ReturnIdEnum that sets dwType to CLUSTER_ENUM_NODE contains the ID of the cluster node as if the CLUSCTL_NODE_GET_ID control code is sent to the node with the name in the corresponding element of the ReturnNameEnum.</td>
 </tr><tr>
  <td>CLUSTER_ENUM_RESTYPE 0x00000002</td>
  <td>The serer MUST return an enumeration of names representing the resource types installed in the cluster as the ReturnNameEnum out parameter. The server MUST return an ENUM_LIST of equal length in the ReturnIdEnum out parameter with each element that sets dwType to CLUSTER_ENUM_RESTYPE a zero-length null-terminated Unicode string.</td>
 </tr><tr>
  <td>CLUSTER_ENUM_RESOURCE 0x00000004</td>
  <td>The server MUST return an enumeration of names, in ReturnNameEnum, and an enumeration of IDs, in ReturnIdEnum,  representing the cluster resources. Each element of ReturnIdEnum that sets dwType to CLUSTER_ENUM_RESOURCE contains the ID of the cluster resource as if the CLUSCTL_RESOURCE_GET_ID control code is sent to the resource with the name in the corresponding element of the ReturnNameEnum.</td>
 </tr><tr>
  <td>CLUSTER_ENUM_GROUP 0x00000008</td>
  <td>The server MUST return an enumeration of names, in ReturnNameEnum, and an enumeration of IDs, in ReturnIdEnum, of cluster groups. Each element of ReturnIdEnum that sets dwType to CLUSTER_ENUM_GROUP contains the ID of the cluster group as if the CLUSCTL_GROUP_GET_ID control code is sent to the group with the name in the corresponding element of the ReturnNameEnum.</td>
 </tr><tr>
  <td>CLUSTER_ENUM_NETWORK 0x00000010</td>
  <td>The server MUST return an enumeration of names, in ReturnNameEnum, and an enumeration of IDs, in ReturnIdEnum, of cluster networks. Each element of ReturnIdEnum that sets dwType to CLUSTER_ENUM_NETWORK contains the ID of the cluster network as if the CLUSCTL_NETWORK_GET_ID control code is sent to the cluster network with the name in the corresponding element of the ReturnNameEnum.</td>
 </tr><tr>
  <td>CLUSTER_ENUM_NETINTERFACE 0x00000020</td>
  <td>The server MUST return an enumeration of names, in ReturnNameEnum, and an enumeration of IDs, in ReturnIdEnum, of cluster network interfaces. Each element of ReturnIdEnum that sets dwType to CLUSTER_ENUM_NETINTERFACE contains the ID of the cluster network interface as if the CLUSCTL_NETINTERFACE_GET_ID control code is sent to the cluster network interface with the name in the corresponding element of the ReturnNameEnum.</td>
 </tr><tr>
  <td>CLUSTER_ENUM_INTERNAL_NETWORK 0x80000000</td>
  <td>Cannot be specified with any other value for this parameter. The server MUST return an enumeration of names, in ReturnNameEnum, and an enumeration of IDs, in ReturnIdEnum, of cluster networks that are used only for internal communications. Each element of ReturnIdEnum that sets dwType to CLUSTER_ENUM_INTERNAL_NETWORK contains the ID of the cluster network as if the CLUSCTL_NETWORK_GET_ID control code is sent to the cluster network with the name in the corresponding element of the ReturnNameEnum.</td>
 </tr></tbody></table>
</dd></dl><p><b>dwOptions: </b>A 32-bit integer that specifies the
options on the type of elements to return. The client MUST set this value to
0x00000000. The server MUST fail the call if this parameter is not set to 0x00000000.</p><p><b>ReturnIdEnum: </b>A pointer to a
PENUM_LIST (section 2.2.3.5). The pointer contains the IDs of the
objects that match the enumeration type that is indicated by the <i>dwType</i>
parameter. The server MUST allocate as much memory as is required to return the
enumeration data. If the method fails, this parameter MUST be ignored.</p><p><b>ReturnNameEnum: </b>A pointer to a
PENUM_LIST (section 2.2.3.5). The pointer contains the name of the
objects that match the enumeration type that is indicated by the <i>dwType</i>
parameter, except where noted above. The server MUST allocate as much memory as
is required to return the enumeration data. If the method fails, this parameter
MUST be ignored.</p><p><b>rpc_status: </b>A 32-bit integer used to indicate
success or failure. The <span><a href="694e5e7a-5833-4f3d-b47e-323ee1d452c2#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> runtime MUST
indicate, by writing to this parameter, whether it succeeded in executing this
method on the server. The encoding of the value passed in this parameter MUST
conform to encoding for comm_status and fault_status, as specified in Appendix
E of <span><a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a></span>.</p><p><b>Return Values: </b>The method MUST return the
following error codes for the conditions that are specified as follows.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 ERROR_SUCCESS</td>
  <td>Success.</td>
 </tr><tr>
  <td>0x00000008 ERROR_NOT_ENOUGH_MEMORY</td>
  <td>The server failed to allocate enough memory for the ReturnEnum parameter.</td>
 </tr><tr>
  <td>0x000000057 ERROR_INVALID_PARAMETER</td>
  <td>The enumeration type that is specified by dwType is not valid or dwOptions is not set to 0x00000000.</td>
 </tr><tr>
  <td>0x000006D1 RPC_S_PROCNUM_OUT_OF_RANGE</td>
  <td>The server does not support this method.</td>
 </tr></tbody></table>
</dd></dl><p>For any other condition, the server returns a value that is
not one of the values listed in the preceding table. The client MUST behave in one
consistent, identical manner for all values that are not listed in the
preceding table. However, the client SHOULD treat errors specified in <span><a href="ca75805a-4b39-4074-8b5b-dbaae6e81b1f" data-linktype="relative-path">3.2.4.6</a></span>
as recoverable errors and initiate the reconnect procedure as specified in
section 3.2.4.6.</p></div>