3.1.4.2.119 ApiOpenResourceEx (Opnum 120)

(Protocol Version 3) The ApiOpenResourceEx method SHOULD<99> establish context on the server about the interaction of a client with the specified cluster resource by using the current RPC connection. ApiOpenResourceEx returns a context handle so that the client can refer to the resource in subsequent method calls.

The server MUST determine the level of access to be granted to the client (section 3.1.4). Upon success, the server MUST associate that level of access with the resource context it has established.

The client has several ways to determine the resource name to specify for the lpszResourceName parameter. A resource can have a well-known name if it was configured as such by using implementation-specific methods between servers. Or, a client can use ApiCreateEnum with enumeration type CLUSTER_ENUM_RESOURCE, as specified in section 3.1.4.2.8. This method obtains a list of all resource names in the cluster state. The client can then examine names or open resources to call additional methods to determine on which resources to operate.

The server SHOULD accept an ApiOpenResourceEx request if its protocol server state is read-only, and MUST accept the processing request if it is in the read/write state, as specified in section 3.1.1.

 HRES_RPC ApiOpenResourceEx(
   [in, string] LPCWSTR lpszResourceName,
   [in] DWORD dwDesiredAccess,
   [out] DWORD * lpdwGrantedAccess,
   [out] error_status_t *Status,
   [out] error_status_t *rpc_status
 );

lpszResourceName: A Unicode string that contains the name of the resource for which to establish context on the server. For version 3.0, the server MUST also accept the resource unique ID as returned by the ApiGetResourceId method.

dwDesiredAccess: The value for this parameter is the same as specified for dwDesiredAccess in ApiOpenClusterEx.

lpdwGrantedAccess: The value for this parameter is the same as specified for lpdwGrantedAccess in ApiOpenClusterEx.

Status: Indicates the status of this operation. The server MUST set Status to the following error codes for the specified conditions.

Value

Meaning

ERROR_SUCCESS

0x0000000

Success.

ERROR_ACCESS_DENIED

0x00000005

dwDesiredAccess indicates a level of access exceeding what the client is entitled to (section 3.1.4).

ERROR_INVALID_PARAMETER

0x00000057

dwDesiredAccess is invalid, as specified earlier in this section.

RPC_S_PROCNUM_OUT_OF_RANGE

0x000006D1

The server does not support this method.

ERROR_RESOURCE_NOT_FOUND

0x0000138f

A resource that matches name lpszResourceName was not found in the cluster configuration.

For any other condition, the server sets 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.

rpc_status: A 32-bit integer used to indicate 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 a valid HRES_RPC (section 2.2.1.4) context handle to indicate success; otherwise, it MUST return NULL.