mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 21:46:05 +00:00
- Allocate memory for groups list dynamically, and make it enough (4096 bytes) for a really long list of groups. This makes Windows 2003 booting up to explorer without crashing.
svn path=/trunk/; revision=32051
This commit is contained in:
parent
f6e0124144
commit
7550f93c9e
1 changed files with 12 additions and 2 deletions
|
@ -429,7 +429,7 @@ WinLdrScanRegistry(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
{
|
{
|
||||||
LONG rc = 0;
|
LONG rc = 0;
|
||||||
FRLDRHKEY hGroupKey, hOrderKey, hServiceKey, hDriverKey;
|
FRLDRHKEY hGroupKey, hOrderKey, hServiceKey, hDriverKey;
|
||||||
WCHAR GroupNameBuffer[512];
|
LPWSTR GroupNameBuffer;
|
||||||
WCHAR ServiceName[256];
|
WCHAR ServiceName[256];
|
||||||
ULONG OrderList[128];
|
ULONG OrderList[128];
|
||||||
ULONG BufferSize;
|
ULONG BufferSize;
|
||||||
|
@ -480,7 +480,8 @@ WinLdrScanRegistry(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the Name Group */
|
/* Get the Name Group */
|
||||||
BufferSize = sizeof(GroupNameBuffer);
|
BufferSize = 4096;
|
||||||
|
GroupNameBuffer = MmHeapAlloc(BufferSize);
|
||||||
rc = RegQueryValue(hGroupKey, L"List", NULL, (PUCHAR)GroupNameBuffer, &BufferSize);
|
rc = RegQueryValue(hGroupKey, L"List", NULL, (PUCHAR)GroupNameBuffer, &BufferSize);
|
||||||
DbgPrint((DPRINT_REACTOS, "RegQueryValue(): rc %d\n", (int)rc));
|
DbgPrint((DPRINT_REACTOS, "RegQueryValue(): rc %d\n", (int)rc));
|
||||||
if (rc != ERROR_SUCCESS)
|
if (rc != ERROR_SUCCESS)
|
||||||
|
@ -515,7 +516,10 @@ WinLdrScanRegistry(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
if (rc == ERROR_NO_MORE_ITEMS)
|
if (rc == ERROR_NO_MORE_ITEMS)
|
||||||
break;
|
break;
|
||||||
if (rc != ERROR_SUCCESS)
|
if (rc != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
MmHeapFree(GroupNameBuffer);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
//DbgPrint((DPRINT_REACTOS, "Service %d: '%S'\n", (int)Index, ServiceName));
|
//DbgPrint((DPRINT_REACTOS, "Service %d: '%S'\n", (int)Index, ServiceName));
|
||||||
|
|
||||||
/* open driver Key */
|
/* open driver Key */
|
||||||
|
@ -591,7 +595,10 @@ WinLdrScanRegistry(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
if (rc == ERROR_NO_MORE_ITEMS)
|
if (rc == ERROR_NO_MORE_ITEMS)
|
||||||
break;
|
break;
|
||||||
if (rc != ERROR_SUCCESS)
|
if (rc != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
MmHeapFree(GroupNameBuffer);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
//DbgPrint((DPRINT_REACTOS, "Service %d: '%S'\n", (int)Index, ServiceName));
|
//DbgPrint((DPRINT_REACTOS, "Service %d: '%S'\n", (int)Index, ServiceName));
|
||||||
|
|
||||||
/* open driver Key */
|
/* open driver Key */
|
||||||
|
@ -657,6 +664,9 @@ WinLdrScanRegistry(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
/* Move to the next group name */
|
/* Move to the next group name */
|
||||||
GroupName = GroupName + wcslen(GroupName) + 1;
|
GroupName = GroupName + wcslen(GroupName) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Free allocated memory */
|
||||||
|
MmHeapFree(GroupNameBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue