Partager via


3.1.4.18 RQueryServiceLockStatusW (Opnum 18)

The RQueryServiceLockStatusW method returns the lock status of the specified SCM database.

 DWORD RQueryServiceLockStatusW(
   [in] SC_RPC_HANDLE hSCManager,
   [out] LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus,
   [in, range(0, 1024*4)] DWORD cbBufSize,
   [out] LPBOUNDED_DWORD_4K pcbBytesNeeded
 );

hSCManager: An SC_RPC_HANDLE (section 2.2.4) data type that defines the handle to the SCM database created using one of the open methods specified in section 3.1.4. The SC_MANAGER_QUERY_LOCK_STATUS access right MUST have been granted to the caller when the RPC context handle was created.

lpLockStatus: A pointer to a buffer that contains QUERY_SERVICE_LOCK_STATUSW (section 2.2.17) structures.

cbBufSize: The size, in bytes, of the lpLockStatus buffer.

pcbBytesNeeded: An LPBOUNDED_DWORD_4K (section 2.2.7) data type that defines the pointer to a variable that receives the number of bytes needed to return all the lock status information if the method fails.

Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise, it returns one of the following error codes.

Return value/code

Description

5

ERROR_ACCESS_DENIED

The SC_MANAGER_QUERY_LOCK_STATUS access right had not been granted to the caller when the RPC context handle was created.

6

ERROR_INVALID_HANDLE

The handle is no longer valid.

122

ERROR_INSUFFICIENT_BUFFER

The data area passed to a system call is too small.

In response to this request from the client, for a successful operation the server MUST query the lock status of the SCM database identified by the hSCManager parameter of the client request. The server MUST return this lock status by setting the lpLockStatus parameter as specified in 2.2.17.

If the buffer pointed to by lpLockStatus is insufficient to hold all the lock status data, the server MUST fail the call with ERROR_INSUFFICIENT_BUFFER (122) and set the required buffer size in the pcbBytesNeeded parameter. If the size is sufficient for data returned, the server also returns the required size, in bytes.