Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 235 of file wnet.c.
Referenced by DllMain().
{ static const WCHAR providerOrderKey[] = { 'S','y','s','t','e','m','\\', 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', 'C','o','n','t','r','o','l','\\', 'N','e','t','w','o','r','k','P','r','o','v','i','d','e','r','\\', 'O','r','d','e','r',0 }; static const WCHAR providerOrder[] = { 'P','r','o','v','i','d','e','r', 'O','r','d','e','r',0 }; HKEY hKey; if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, providerOrderKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS) { DWORD size = 0; RegQueryValueExW(hKey, providerOrder, NULL, NULL, NULL, &size); if (size) { PWSTR providers = HeapAlloc(GetProcessHeap(), 0, size); if (providers) { DWORD type; if (RegQueryValueExW(hKey, providerOrder, NULL, &type, (LPBYTE)providers, &size) == ERROR_SUCCESS && type == REG_SZ) { PWSTR ptr; DWORD numToAllocate; TRACE("provider order is %s\n", debugstr_w(providers)); /* first count commas as a heuristic for how many to * allocate space for */ for (ptr = providers, numToAllocate = 1; ptr; ) { ptr = strchrW(ptr, ','); if (ptr) { numToAllocate++; ptr++; } } providerTable = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WNetProviderTable) + (numToAllocate - 1) * sizeof(WNetProvider)); if (providerTable) { PWSTR ptrPrev; int entireNetworkLen; LPCWSTR stringresource; entireNetworkLen = LoadStringW(hInstDll, IDS_ENTIRENETWORK, (LPWSTR)&stringresource, 0); providerTable->entireNetwork = HeapAlloc( GetProcessHeap(), 0, (entireNetworkLen + 1) * sizeof(WCHAR)); if (providerTable->entireNetwork) { memcpy(providerTable->entireNetwork, stringresource, entireNetworkLen*sizeof(WCHAR)); providerTable->entireNetwork[entireNetworkLen] = 0; } providerTable->numAllocated = numToAllocate; for (ptr = providers; ptr; ) { ptrPrev = ptr; ptr = strchrW(ptr, ','); if (ptr) *ptr++ = '\0'; _tryLoadProvider(ptrPrev); } } } HeapFree(GetProcessHeap(), 0, providers); } } RegCloseKey(hKey); } }