mirror of
https://github.com/reactos/reactos.git
synced 2025-06-06 01:40:36 +00:00
[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:
parent
9e947e2b2b
commit
af9df93274
2 changed files with 68 additions and 48 deletions
|
@ -59,35 +59,45 @@ WsTcOpen(IN PTCATALOG Catalog,
|
||||||
&RegType,
|
&RegType,
|
||||||
NULL,
|
NULL,
|
||||||
&RegSize);
|
&RegSize);
|
||||||
if (ErrorCode != ERROR_SUCCESS)
|
if (ErrorCode == ERROR_FILE_NOT_FOUND)
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to get protocol catalog name: %d.\n", ErrorCode);
|
static const CHAR DefaultCatalogName[] = "Protocol_Catalog9";
|
||||||
return FALSE;
|
RegSize = sizeof(DefaultCatalogName);
|
||||||
|
CatalogKeyName = HeapAlloc(WsSockHeap, 0, RegSize);
|
||||||
|
memcpy(CatalogKeyName, DefaultCatalogName, RegSize);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (RegType != REG_SZ)
|
|
||||||
{
|
{
|
||||||
DPRINT1("Protocol catalog name is not a string (Type %d).\n", RegType);
|
if (ErrorCode != ERROR_SUCCESS)
|
||||||
return FALSE;
|
{
|
||||||
|
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);
|
||||||
|
|
||||||
|
/* Read the catalog name */
|
||||||
|
ErrorCode = RegQueryValueEx(ParentKey,
|
||||||
|
"Current_Protocol_Catalog",
|
||||||
|
0,
|
||||||
|
&RegType,
|
||||||
|
(LPBYTE)CatalogKeyName,
|
||||||
|
&RegSize);
|
||||||
|
|
||||||
|
/* Open the Catalog Key */
|
||||||
|
ErrorCode = RegOpenKeyEx(ParentKey,
|
||||||
|
CatalogKeyName,
|
||||||
|
0,
|
||||||
|
MAXIMUM_ALLOWED,
|
||||||
|
&CatalogKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
CatalogKeyName = HeapAlloc(WsSockHeap, 0, RegSize);
|
|
||||||
|
|
||||||
/* Read the catalog name */
|
|
||||||
ErrorCode = RegQueryValueEx(ParentKey,
|
|
||||||
"Current_Protocol_Catalog",
|
|
||||||
0,
|
|
||||||
&RegType,
|
|
||||||
(LPBYTE)CatalogKeyName,
|
|
||||||
&RegSize);
|
|
||||||
|
|
||||||
/* Open the Catalog Key */
|
|
||||||
ErrorCode = RegOpenKeyEx(ParentKey,
|
|
||||||
CatalogKeyName,
|
|
||||||
0,
|
|
||||||
MAXIMUM_ALLOWED,
|
|
||||||
&CatalogKey);
|
|
||||||
|
|
||||||
/* If we didn't find the key, create it */
|
/* If we didn't find the key, create it */
|
||||||
if (ErrorCode == ERROR_SUCCESS)
|
if (ErrorCode == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,35 +58,45 @@ WsNcOpen(IN PNSCATALOG Catalog,
|
||||||
&RegType,
|
&RegType,
|
||||||
NULL,
|
NULL,
|
||||||
&RegSize);
|
&RegSize);
|
||||||
if (ErrorCode != ERROR_SUCCESS)
|
if (ErrorCode == ERROR_FILE_NOT_FOUND)
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to get namespace catalog name: %d.\n", ErrorCode);
|
static const CHAR DefaultCatalogName[] = "NameSpace_Catalog5";
|
||||||
return FALSE;
|
RegSize = sizeof(DefaultCatalogName);
|
||||||
|
CatalogKeyName = HeapAlloc(WsSockHeap, 0, RegSize);
|
||||||
|
memcpy(CatalogKeyName, DefaultCatalogName, RegSize);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (RegType != REG_SZ)
|
|
||||||
{
|
{
|
||||||
DPRINT1("Namespace catalog name is not a string (Type %d).\n", RegType);
|
if (ErrorCode != ERROR_SUCCESS)
|
||||||
return FALSE;
|
{
|
||||||
|
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);
|
||||||
|
|
||||||
|
/* Read the catalog name */
|
||||||
|
ErrorCode = RegQueryValueEx(ParentKey,
|
||||||
|
"Current_NameSpace_Catalog",
|
||||||
|
0,
|
||||||
|
&RegType,
|
||||||
|
(LPBYTE)CatalogKeyName,
|
||||||
|
&RegSize);
|
||||||
|
|
||||||
|
/* Open the Catalog Key */
|
||||||
|
ErrorCode = RegOpenKeyEx(ParentKey,
|
||||||
|
CatalogKeyName,
|
||||||
|
0,
|
||||||
|
MAXIMUM_ALLOWED,
|
||||||
|
&CatalogKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
CatalogKeyName = HeapAlloc(WsSockHeap, 0, RegSize);
|
|
||||||
|
|
||||||
/* Read the catalog name */
|
|
||||||
ErrorCode = RegQueryValueEx(ParentKey,
|
|
||||||
"Current_NameSpace_Catalog",
|
|
||||||
0,
|
|
||||||
&RegType,
|
|
||||||
(LPBYTE)CatalogKeyName,
|
|
||||||
&RegSize);
|
|
||||||
|
|
||||||
/* Open the Catalog Key */
|
|
||||||
ErrorCode = RegOpenKeyEx(ParentKey,
|
|
||||||
CatalogKeyName,
|
|
||||||
0,
|
|
||||||
MAXIMUM_ALLOWED,
|
|
||||||
&CatalogKey);
|
|
||||||
|
|
||||||
/* If we didn't find the key, create it */
|
/* If we didn't find the key, create it */
|
||||||
if (ErrorCode == ERROR_SUCCESS)
|
if (ErrorCode == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue