Provider = CatalogEntry->Provider;
/* Check for a match */
- if ((Provider) &&
- !(memcmp(&CatalogEntry->ProtocolInfo.ProviderId,
- ProviderId,
- sizeof(GUID))))
+ if (Provider &&
+ IsEqualGUID(&CatalogEntry->ProtocolInfo.ProviderId, ProviderId))
{
/* Found a match */
return Provider;
/* Get this entry */
CatalogEntry = CONTAINING_RECORD(Entry, TCATALOG_ENTRY, CatalogLink);
- /* Remove it */
+ /* Remove it and dereference it */
WsTcRemoveCatalogItem(Catalog, CatalogEntry);
-
- /* Dereference it */
WsTcEntryDereference(CatalogEntry);
/* Move to the next entry */
Entry = Entry->Flink;
/* Check if they match */
- if (memcmp(&CatalogEntry->ProviderId,
- &OldCatalogEntry->ProviderId,
- sizeof(GUID)))
+ if (IsEqualGUID(&CatalogEntry->ProviderId,
+ &OldCatalogEntry->ProviderId))
{
/* We have a match, use the old item instead */
WsNcEntryDereference(CatalogEntry);
NextEntry = NextEntry->Flink;
/* Check if this is the Catalog Entry ID we want */
- if (!(memcmp(&Entry->ProviderId, ProviderId, sizeof(GUID))))
+ if (IsEqualGUID(&Entry->ProviderId, ProviderId))
{
/* Check if it doesn't already have a provider */
if (!Entry->Provider)
/* Get this entry */
CatalogEntry = CONTAINING_RECORD(Entry, NSCATALOG_ENTRY, CatalogLink);
- /* Remove it */
+ /* Remove it and dereference it */
WsNcRemoveCatalogItem(Catalog, CatalogEntry);
-
- /* Dereference it */
WsNcEntryDereference(CatalogEntry);
/* Move to the next entry */
SetLastError(ErrorCode);
ErrorCode = SOCKET_ERROR;
NsQuery->TryAgain = FALSE;
- goto error;
+ goto Exit;
}
/* Cache the information for a restart */
/* Check if we have a specific ID */
if (Restrictions->lpNSProviderId)
{
- /* Get the provider */
+ /* Get the catalog entry */
ErrorCode = WsNcGetCatalogFromProviderId(Catalog,
Restrictions->lpNSProviderId,
&CatalogEntry);
- /* Check for success */
+ /* Check for failure */
if (ErrorCode != ERROR_SUCCESS)
{
/* Fail */
SetLastError(WSAEINVAL);
ErrorCode = SOCKET_ERROR;
- goto error;
+ goto Exit;
}
else
{
/* Fail */
SetLastError(WSAEINVAL);
ErrorCode = SOCKET_ERROR;
- goto error;
+ goto Exit;
}
}
/* We don't have any providers to handle this! */
ErrorCode = SOCKET_ERROR;
SetLastError(WSASERVICE_NOT_FOUND);
- goto error;
+ goto Exit;
}
/* Get the first provider and loop */
}
}
-error:
+Exit:
/* Check if we had an error somewhere */
if (ErrorCode == SOCKET_ERROR)
{
{
/* Fail, couldn't allocate memory */
ErrorCode = WSA_NOT_ENOUGH_MEMORY;
- goto error;
+ goto Exit;
}
/* Build the relative buffer version */
ErrorCode = WSABuildQuerySetBufferA(AnsiSet, AnsiSize, AnsiCopy);
- if (ErrorCode != ERROR_SUCCESS) goto error;
+ if (ErrorCode != ERROR_SUCCESS) goto Exit;
/* Re-use the ANSI version since the fields match */
UnicodeCopy = (LPWSAQUERYSETW)AnsiCopy;
{
/* Fail */
ErrorCode = WSA_NOT_ENOUGH_MEMORY;
- goto error;
+ goto Exit;
}
/* Set the new string pointer */
{
/* Fail */
ErrorCode = WSA_NOT_ENOUGH_MEMORY;
- goto error;
+ goto Exit;
}
/* Set the new string pointer */
{
/* Fail */
ErrorCode = WSA_NOT_ENOUGH_MEMORY;
- goto error;
+ goto Exit;
}
/* Set the new string pointer */
{
/* Fail */
ErrorCode = WSA_NOT_ENOUGH_MEMORY;
- goto error;
+ goto Exit;
}
/* Set the new string pointer */
/* The buffer wasn't large enough; return how much we need */
*SetSize = UnicodeSize;
ErrorCode = WSAEFAULT;
- goto error;
+ goto Exit;
}
/* Build the relative unicode buffer */
ErrorCode = WSABuildQuerySetBufferW(UnicodeCopy, *SetSize, UnicodeSet);
-error:
+Exit:
/* Free the Ansi copy if we had one */
if (AnsiCopy) HeapFree(WsSockHeap, 0, AnsiCopy);
{
/* Fail, couldn't allocate memory */
ErrorCode = WSA_NOT_ENOUGH_MEMORY;
- goto error;
+ goto Exit;
}
/* Build the relative buffer version */
ErrorCode = WSABuildQuerySetBufferW(UnicodeSet, UnicodeSize, UnicodeCopy);
- if (ErrorCode != ERROR_SUCCESS) goto error;
+ if (ErrorCode != ERROR_SUCCESS) goto Exit;
/* Re-use the Unicode version since the fields match */
AnsiCopy = (LPWSAQUERYSETA)UnicodeCopy;
{
/* Fail */
ErrorCode = WSA_NOT_ENOUGH_MEMORY;
- goto error;
+ goto Exit;
}
/* Set the new string pointer */
{
/* Fail */
ErrorCode = WSA_NOT_ENOUGH_MEMORY;
- goto error;
+ goto Exit;
}
/* Set the new string pointer */
{
/* Fail */
ErrorCode = WSA_NOT_ENOUGH_MEMORY;
- goto error;
+ goto Exit;
}
/* Set the new string pointer */
{
/* Fail */
ErrorCode = WSA_NOT_ENOUGH_MEMORY;
- goto error;
+ goto Exit;
}
/* Set the new string pointer */
/* The buffer wasn't large enough; return how much we need */
*SetSize = AnsiSize;
ErrorCode = WSAEFAULT;
- goto error;
+ goto Exit;
}
/* Build the relative unicode buffer */
ErrorCode = WSABuildQuerySetBufferA(AnsiCopy, *SetSize, AnsiSet);
-error:
+Exit:
/* Free the Ansi copy if we had one */
if (UnicodeCopy) HeapFree(WsSockHeap, 0, UnicodeCopy);