ITsSbResourcePluginStoreEx::AcquireTargetLock method

Locks a target.

Syntax

HRESULT AcquireTargetLock(
  [in]  BSTR     targetName,
  [in]  DWORD    dwTimeout,
  [out] IUnknown **ppContext
);

Parameters

targetName [in]

The name of the target to lock.

dwTimeout [in]

The timeout for the operation, in milliseconds.

ppContext [out]

Returns a pointer to the context of the lock. To release the lock, supply this pointer to the ReleaseTargetLock method.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

After the lock is acquired, the calling thread is assumed to have exclusive access to the target object and therefore no other thread (within the same machine) can update it. Therefore the calling thread must call the ReleaseTargetLock method as soon as it has made the necessary updates to the target object.

Important

this lock does not completely prevent target objects from being modified externally if more than one Connection Broker exists in the deployment. The calling thread must be prepared to handle a failure gracefully and retry the target update.

This method is available on Windows Server 2012 R2 with KB3091411 installed in the ITsSbResourcePluginStoreEx interface.

Requirements

Requirement Value
Minimum supported client
None supported
Minimum supported server
Windows Server 2012 R2
End of server support
Windows Server 2012 R2
IDL
SbTsV.idl
IID
IID_ITsSbResourcePluginStoreEx is defined as 80b83ffd-625d-11e5-bea1-a0481c7e9064

See also

ITsSbResourcePluginStoreEx