ISoftUSBConfigurations::Unlock Method
The Unlock method re-enables changes to a collection after your previously called ISoftUSBConfigurations::Lock.
Syntax
HRESULT Unlock();
Parameters
This method has no parameters.
Return Value
Unlock returns an HRESULT value. This method returns S_OK if the collection is successfully unlocked.
Remarks
The following C++ code example shows how to unlock an ISoftUSBConfigurations collection.
HRESULT CTestDevice::GetConfigurationEnum(IUnknown *punk)
{
HRESULT hr = S_OK;
ISoftUSBConfigurations *piConfigList = NULL;
// Get the configuration list
hr = m_piDevice->get_Configurations(&piConfigList);
if (FAILED(hr))
{
goto Exit;
}
// Lock the collection
hr = piConfigList->Lock();
if (FAILED(hr))
goto Exit;
// Get the enumerator for the collection
hr = piConfigList->get__NewEnum(&punk);
if(FAILED(hr))
goto Exit;
hr = piConfigList->Unlock();
if (FAILED(hr))
goto Exit;
Exit:
if( NULL != piConfigList)
{
piConfigList->Release();
piConfigList = NULL;
}
return hr;
}
Requirements
Header |
SoftUSBif.h |
See Also
Send comments about this topic to Microsoft
Build date: 9/21/2010