3.1.4.1.14 ApiSetResourceName (Opnum 13)

msdn link

(Protocol Version 2) 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.

 error_status_t ApiSetResourceName(
   [in] HRES_RPC hResource,
   [in, string] LPCWSTR lpszResourceName
 );

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

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

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

Return value/code

Description

0x00000000

ERROR_SUCCESS

Success.

0x00000006

ERROR_INVALID_HANDLE

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

0x0000007B

ERROR_INVALID_NAME

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

0x0000138E

ERROR_RESOURCE_NOT_AVAILABLE

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

0x000000B7

ERROR_ALREADY_EXISTS

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 3.2.4.6.