PTCATALOG WSAAPI OpenInitializedCatalog(VOID) { INT ErrorCode; PTCATALOG Catalog; HKEY WsKey; /* Allocate the catalog */ Catalog = WsTcAllocate(); if (Catalog) { /* Open the WS Key */ WsKey = WsOpenRegistryRoot(); /* Initialize the catalog */ ErrorCode = WsTcInitializeFromRegistry(Catalog, WsKey, NULL); /* Close the key */ RegCloseKey(WsKey); } /* Return it */ return Catalog; }
INT WSAAPI WsProcInitialize(IN PWSPROCESS Process) { INT ErrorCode = WSAEFAULT; HKEY RootKey = NULL; /* Initialize the thread list lock */ InitializeCriticalSection(&Process->ThreadLock); Process->LockReady = TRUE; /* Open the Winsock Key */ RootKey = WsOpenRegistryRoot(); /* Create the LP Catalog change event and catalog */ Process->ProtocolCatalogEvent = CreateEvent(NULL, TRUE, FALSE, NULL); Process->ProtocolCatalog = WsTcAllocate(); // FIXME: Check for Process->ProtocolCatalog == NULL /* Initialize it */ WsTcInitializeFromRegistry(Process->ProtocolCatalog, RootKey, Process->ProtocolCatalogEvent); /* Create the NS Catalog change event and catalog */ Process->NamespaceCatalogEvent = CreateEvent(NULL, TRUE, FALSE, NULL); Process->NamespaceCatalog = WsNcAllocate(); // FIXME: Check for Process->NamespaceCatalog == NULL /* Initialize it */ ErrorCode = WsNcInitializeFromRegistry(Process->NamespaceCatalog, RootKey, Process->NamespaceCatalogEvent); /* Close the root key */ RegCloseKey(RootKey); return ErrorCode; }