[WS2_32] Fix error handling on non-existing registry keys

This commit is contained in:
Jérôme Gardou
2021-03-02 14:39:22 +01:00
parent 4e4c47cccc
commit 7320c989fe
2 changed files with 22 additions and 0 deletions
+11
View File
@@ -59,6 +59,17 @@ WsTcOpen(IN PTCATALOG Catalog,
&RegType,
NULL,
&RegSize);
if (ErrorCode != ERROR_SUCCESS)
{
DPRINT1("Failed to get protocol catalog name: %d.\n", ErrorCode);
return FALSE;
}
if (RegType != REG_SZ)
{
DPRINT1("Protocol catalog name is not a string (Type %d).\n", RegType);
return FALSE;
}
CatalogKeyName = HeapAlloc(WsSockHeap, 0, RegSize);
+11
View File
@@ -58,6 +58,17 @@ WsNcOpen(IN PNSCATALOG Catalog,
&RegType,
NULL,
&RegSize);
if (ErrorCode != ERROR_SUCCESS)
{
DPRINT1("Failed to get namespace catalog name: %d.\n", ErrorCode);
return FALSE;
}
if (RegType != REG_SZ)
{
DPRINT1("Namespace catalog name is not a string (Type %d).\n", RegType);
return FALSE;
}
CatalogKeyName = HeapAlloc(WsSockHeap, 0, RegSize);