mirror of
https://github.com/reactos/reactos.git
synced 2024-06-24 06:51:47 +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
|
@ -59,35 +59,45 @@ WsTcOpen(IN PTCATALOG Catalog,
|
|||
&RegType,
|
||||
NULL,
|
||||
&RegSize);
|
||||
if (ErrorCode != ERROR_SUCCESS)
|
||||
if (ErrorCode == ERROR_FILE_NOT_FOUND)
|
||||
{
|
||||
DPRINT1("Failed to get protocol catalog name: %d.\n", ErrorCode);
|
||||
return FALSE;
|
||||
static const CHAR DefaultCatalogName[] = "Protocol_Catalog9";
|
||||
RegSize = sizeof(DefaultCatalogName);
|
||||
CatalogKeyName = HeapAlloc(WsSockHeap, 0, RegSize);
|
||||
memcpy(CatalogKeyName, DefaultCatalogName, RegSize);
|
||||
}
|
||||
|
||||
if (RegType != REG_SZ)
|
||||
else
|
||||
{
|
||||
DPRINT1("Protocol catalog name is not a string (Type %d).\n", RegType);
|
||||
return FALSE;
|
||||
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);
|
||||
|
||||
/* 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 (ErrorCode == ERROR_SUCCESS)
|
||||
{
|
||||
|
|
|
@ -58,35 +58,45 @@ WsNcOpen(IN PNSCATALOG Catalog,
|
|||
&RegType,
|
||||
NULL,
|
||||
&RegSize);
|
||||
if (ErrorCode != ERROR_SUCCESS)
|
||||
if (ErrorCode == ERROR_FILE_NOT_FOUND)
|
||||
{
|
||||
DPRINT1("Failed to get namespace catalog name: %d.\n", ErrorCode);
|
||||
return FALSE;
|
||||
static const CHAR DefaultCatalogName[] = "NameSpace_Catalog5";
|
||||
RegSize = sizeof(DefaultCatalogName);
|
||||
CatalogKeyName = HeapAlloc(WsSockHeap, 0, RegSize);
|
||||
memcpy(CatalogKeyName, DefaultCatalogName, RegSize);
|
||||
}
|
||||
|
||||
if (RegType != REG_SZ)
|
||||
else
|
||||
{
|
||||
DPRINT1("Namespace catalog name is not a string (Type %d).\n", RegType);
|
||||
return FALSE;
|
||||
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);
|
||||
|
||||
/* 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 (ErrorCode == ERROR_SUCCESS)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue