{
INTErrorCode = ERROR_SUCCESS;
PTPROVIDER Provider;
/* Lock the catalog */WsTcLock();
/* Check if we have a provider already */if (!CatalogEntry->Provider)
{
/* Try to find another instance */
Provider = WsTcFindProvider(Catalog,
&CatalogEntry->ProtocolInfo.ProviderId);
/* Check if we found one now */if (Provider)
{
/* Set this one as the provider */WsTcEntrySetProvider(CatalogEntry, Provider);
ErrorCode = ERROR_SUCCESS;
}
else
{
/* Nothing found, Allocate a provider */if ((Provider = WsTpAllocate()))
{
/* Initialize it */
ErrorCode = WsTpInitialize(Provider,
CatalogEntry->DllPath,
&CatalogEntry->ProtocolInfo);
/* Ensure success */if (ErrorCode == ERROR_SUCCESS)
{
/* Set the provider */WsTcEntrySetProvider(CatalogEntry, Provider);
}
/* Dereference it */WsTpDereference(Provider);
}
else
{
/* No memory */
ErrorCode = WSA_NOT_ENOUGH_MEMORY;
}
}
}
/* Release the lock */WsTcUnlock();
returnErrorCode;
}
Generated on Fri May 25 2012 05:19:20 for ReactOS by
1.7.6.1
ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.