BASS WAS API

BASS_WASAPI_Lock


Locks the device to the current thread.

BOOL BASS_WASAPI_Lock(
    BOOL lock
);

Parameters

lockIf FALSE, unlock the device, else lock it.

Return value

If successful, TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_INITBASS_WASAPI_Init has not been successfully called.

Remarks

Locking a device prevents other threads from accessing the device buffer, including a WASAPIPROC. Other threads wanting to access a locked device will block until it is unlocked, so a device should only be locked very briefly. A device must be unlocked in the same thread that it was locked.