Microsoft DirectX 8.1 (C++)

IMediaObject::Lock

The Lock method acquires or releases a lock on the DMO. Call this method to keep the DMO serialized when performing multiple operations.

Syntax

HRESULT Lock(
    LONG bLock
);

Parameters

bLock

Value that specifies whether to acquire or release the lock. If the value is non-zero, a lock is acquired. If the value is zero, the lock is released.

Return Value

Returns an HRESULT value. Possible values include those in the following table.

Return Code Description
E_FAIL Failure
S_OK Success

Remarks

This method prevents other threads from calling methods on the DMO. If another thread calls a method on the DMO, the thread blocks until the lock is released.

See also