ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

DWORD WSAAPI WsTcLoadProvider ( IN PTCATALOG  TCatalog,
IN PTCATALOG_ENTRY  CatalogEntry 
)

Definition at line 577 of file dcatalog.c.

Referenced by WsTcFindIfsProviderForSocket(), WsTcGetEntryFromAf(), WsTcGetEntryFromCatalogEntryId(), and WsTcGetEntryFromTriplet().

{
    INT ErrorCode = 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();
    return ErrorCode;
}

Generated on Fri May 25 2012 05:19:20 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.