[WS2_32] Create registry keys Protocol_Catalog9/NameSpace_Catalog5 if needed

This fixes networking in LiveCD and installation in 2nd stage.
CORE-17514
This commit is contained in:
Hervé Poussineau 2021-04-17 23:06:53 +02:00
parent 9e947e2b2b
commit af9df93274
2 changed files with 68 additions and 48 deletions

View file

@ -59,6 +59,15 @@ WsTcOpen(IN PTCATALOG Catalog,
&RegType,
NULL,
&RegSize);
if (ErrorCode == ERROR_FILE_NOT_FOUND)
{
static const CHAR DefaultCatalogName[] = "Protocol_Catalog9";
RegSize = sizeof(DefaultCatalogName);
CatalogKeyName = HeapAlloc(WsSockHeap, 0, RegSize);
memcpy(CatalogKeyName, DefaultCatalogName, RegSize);
}
else
{
if (ErrorCode != ERROR_SUCCESS)
{
DPRINT1("Failed to get protocol catalog name: %d.\n", ErrorCode);
@ -87,6 +96,7 @@ WsTcOpen(IN PTCATALOG Catalog,
0,
MAXIMUM_ALLOWED,
&CatalogKey);
}
/* If we didn't find the key, create it */
if (ErrorCode == ERROR_SUCCESS)

View file

@ -58,6 +58,15 @@ WsNcOpen(IN PNSCATALOG Catalog,
&RegType,
NULL,
&RegSize);
if (ErrorCode == ERROR_FILE_NOT_FOUND)
{
static const CHAR DefaultCatalogName[] = "NameSpace_Catalog5";
RegSize = sizeof(DefaultCatalogName);
CatalogKeyName = HeapAlloc(WsSockHeap, 0, RegSize);
memcpy(CatalogKeyName, DefaultCatalogName, RegSize);
}
else
{
if (ErrorCode != ERROR_SUCCESS)
{
DPRINT1("Failed to get namespace catalog name: %d.\n", ErrorCode);
@ -86,6 +95,7 @@ WsNcOpen(IN PNSCATALOG Catalog,
0,
MAXIMUM_ALLOWED,
&CatalogKey);
}
/* If we didn't find the key, create it */
if (ErrorCode == ERROR_SUCCESS)