Index: dll/win32/ws2_32_new/src/nscatent.c =================================================================== --- dll/win32/ws2_32_new/src/nscatent.c (revision 69634) +++ dll/win32/ws2_32_new/src/nscatent.c (working copy) @@ -64,103 +64,108 @@ IN HKEY ParentKey, IN ULONG UniqueId) { + INT ErrorCode; CHAR CatalogEntryName[13]; HKEY EntryKey; ULONG RegType = REG_SZ; ULONG RegSize = MAX_PATH; + ULONG RegValue; /* Convert to a 00000xxx string */ sprintf(CatalogEntryName, "%0""12""i", (int)UniqueId); /* Open the Entry */ - RegOpenKeyEx(ParentKey, - CatalogEntryName, - 0, - KEY_READ, - &EntryKey); - + ErrorCode = RegOpenKeyEx(ParentKey, + CatalogEntryName, + 0, + KEY_READ, + &EntryKey); + if (ErrorCode != ERROR_SUCCESS) return ErrorCode; /* Read the Library Path */ - RegQueryValueExW(EntryKey, - L"LibraryPath", - 0, - &RegType, - (LPBYTE)&CatalogEntry->DllPath, - &RegSize); - + ErrorCode = RegQueryValueExW(EntryKey, + L"LibraryPath", + 0, + &RegType, + (LPBYTE)&CatalogEntry->DllPath, + &RegSize); + if (ErrorCode != ERROR_SUCCESS) goto out; /* Query Display String Size*/ - RegQueryValueExW(EntryKey, - L"DisplayString", - 0, - NULL, - NULL, - &RegSize); - + ErrorCode = RegQueryValueExW(EntryKey, + L"DisplayString", + 0, + NULL, + NULL, + &RegSize); + if (ErrorCode != ERROR_SUCCESS) goto out; /* Allocate it */ CatalogEntry->ProviderName = (LPWSTR)HeapAlloc(WsSockHeap, 0, RegSize); /* Read it */ - RegQueryValueExW(EntryKey, - L"DisplayString", - 0, - &RegType, - (LPBYTE)CatalogEntry->ProviderName, - &RegSize); - + ErrorCode = RegQueryValueExW(EntryKey, + L"DisplayString", + 0, + &RegType, + (LPBYTE)CatalogEntry->ProviderName, + &RegSize); + if (ErrorCode != ERROR_SUCCESS) goto out; /* Read the Provider Id */ RegType = REG_BINARY; RegSize = sizeof(GUID); - RegQueryValueEx(EntryKey, - "ProviderId", - 0, - &RegType, - (LPBYTE)&CatalogEntry->ProviderId, - &RegSize); - + ErrorCode = RegQueryValueEx(EntryKey, + "ProviderId", + 0, + &RegType, + (LPBYTE)&CatalogEntry->ProviderId, + &RegSize); + if (ErrorCode != ERROR_SUCCESS) goto out; /* Read the Address Family */ RegType = REG_DWORD; RegSize = sizeof(DWORD); - RegQueryValueEx(EntryKey, - "AddressFamily", - 0, - &RegType, - (LPBYTE)&CatalogEntry->AddressFamily, - &RegSize); - + ErrorCode = RegQueryValueEx(EntryKey, + "AddressFamily", + 0, + &RegType, + (LPBYTE)&CatalogEntry->AddressFamily, + &RegSize); + if (ErrorCode != ERROR_SUCCESS) goto out; /* Read the Namespace Id */ - RegQueryValueEx(EntryKey, - "SupportedNamespace", - 0, - &RegType, - (LPBYTE)&CatalogEntry->NamespaceId, - &RegSize); - + ErrorCode = RegQueryValueEx(EntryKey, + "SupportedNamespace", + 0, + &RegType, + (LPBYTE)&CatalogEntry->NamespaceId, + &RegSize); + if (ErrorCode != ERROR_SUCCESS) goto out; /* Read the Enabled Flag */ - RegQueryValueEx(EntryKey, - "Enabled", - 0, - &RegType, - (LPBYTE)&CatalogEntry->Enabled, - &RegSize); + ErrorCode = RegQueryValueEx(EntryKey, + "Enabled", + 0, + &RegType, + (LPBYTE)&RegValue, + &RegSize); + if (ErrorCode != ERROR_SUCCESS) goto out; + CatalogEntry->Enabled = RegValue != 0; /* Read the Version */ - RegQueryValueEx(EntryKey, - "Version", - 0, - &RegType, - (LPBYTE)&CatalogEntry->Version, - &RegSize); - + ErrorCode = RegQueryValueEx(EntryKey, + "Version", + 0, + &RegType, + (LPBYTE)&CatalogEntry->Version, + &RegSize); + if (ErrorCode != ERROR_SUCCESS) goto out; /* Read the Support Service Class Info Flag */ - RegQueryValueEx(EntryKey, - "Version", - 0, - &RegType, - (LPBYTE)&CatalogEntry->StoresServiceClassInfo, - &RegSize); - + ErrorCode = RegQueryValueEx(EntryKey, + "StoresServiceClassInfo", + 0, + &RegType, + (LPBYTE)&RegValue, + &RegSize); + CatalogEntry->StoresServiceClassInfo = RegValue != 0; +out: /* Done */ RegCloseKey(EntryKey); - return ERROR_SUCCESS; + return ErrorCode; } VOID