ApiSetResourceName (Opnum 13)

(Protocol Version 3) The ApiSetResourceName method sets the name of the designated resource to the string represented by the lpszResourceName parameter. The nonvolatile cluster state associated with this resource is updated.

The server MUST accept an ApiSetResourceName request for processing only if it is in the read/write state, as specified in section 3.1.1.

The server MUST require that the access level associated with the hResource context handle is "All" (section 3.1.4).

 error_status_t ApiSetResourceName(
   [in] HRES_RPC hResource,
   [in, string] LPCWSTR lpszResourceName,
   [out] error_status_t *rpc_status

hResource: An HRES_RPC context handle that was obtained in a previous ApiOpenResource, ApiOpenResourceEx, or ApiCreateResource method call.

lpszResourceName: A pointer to a Unicode string that contains the new name of the resource.

rpc_status: A 32-bit integer that indicates success or failure. The RPC 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 [C706].

Return Values: The method MUST return the following error codes for the specified conditions.

Return value/code







The hResource parameter does not represent a valid HRES_RPC context handle.



The name pointed to by the lpszResourceName parameter MUST contain at least one character.



The resource represented by the hResource parameter no longer exists in the nonvolatile cluster state.



The specified name is already in use as either the name or the ID of another resource.

For any other condition, the server MUST set Status to a value that is not one of the values listed in the preceding table. The client MUST treat all values that are not listed in the preceding table the same, except as specified in section