3.1.4.29 RQueryServiceLockStatusA (Opnum 30)

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

 DWORD RQueryServiceLockStatusA(
   [in] SC_RPC_HANDLE hSCManager,
   [out] LPQUERY_SERVICE_LOCK_STATUSA 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 previously, 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 the QUERY_SERVICE_LOCK_STATUSA (section 2.2.16) 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.

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 section 2.2.16.

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.

The server MUST use the process described in Conversion Between ANSI and Unicode String Formats (section 3.1.7) to convert a string to the appropriate format.