mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[NTDLL/LDR]
- Correctly handle out of memory condition (CID 14615) - Remove a useless assignment (CID 14493) - Correct wrong sizeof usage (CID 14104), add an assert svn path=/trunk/; revision=56193
This commit is contained in:
parent
b9678be68a
commit
a5326360ca
1 changed files with 17 additions and 15 deletions
|
@ -207,12 +207,8 @@ LdrQueryImageFileKeyOption(IN HANDLE KeyHandle,
|
|||
KeyValueInformation = RtlAllocateHeap(RtlGetProcessHeap(),
|
||||
0,
|
||||
KeyInfoSize);
|
||||
if (KeyValueInformation == NULL)
|
||||
if (KeyValueInformation != NULL)
|
||||
{
|
||||
/* Give up this time */
|
||||
Status = STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
/* Try again */
|
||||
Status = ZwQueryValueKey(KeyHandle,
|
||||
&ValueNameString,
|
||||
|
@ -222,6 +218,12 @@ LdrQueryImageFileKeyOption(IN HANDLE KeyHandle,
|
|||
&ResultSize);
|
||||
FreeHeap = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Give up this time */
|
||||
Status = STATUS_NO_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for success */
|
||||
if (NT_SUCCESS(Status))
|
||||
|
@ -641,7 +643,7 @@ LdrpRunInitializeRoutines(IN PCONTEXT Context OPTIONAL)
|
|||
/* Allocate space for all the entries */
|
||||
LdrRootEntry = RtlAllocateHeap(RtlGetProcessHeap(),
|
||||
0,
|
||||
Count * sizeof(LdrRootEntry));
|
||||
Count * sizeof(*LdrRootEntry));
|
||||
if (!LdrRootEntry) return STATUS_NO_MEMORY;
|
||||
}
|
||||
else
|
||||
|
@ -687,6 +689,7 @@ LdrpRunInitializeRoutines(IN PCONTEXT Context OPTIONAL)
|
|||
if (LdrEntry->EntryPoint)
|
||||
{
|
||||
/* Write in array */
|
||||
ASSERT(i < Count);
|
||||
LdrRootEntry[i] = LdrEntry;
|
||||
|
||||
/* Display debug message */
|
||||
|
@ -1546,7 +1549,6 @@ LdrpInitializeProcess(IN PCONTEXT Context,
|
|||
|
||||
/* Normalize the parameters */
|
||||
ProcessParameters = RtlNormalizeProcessParams(Peb->ProcessParameters);
|
||||
ProcessParameters = Peb->ProcessParameters;
|
||||
if (ProcessParameters)
|
||||
{
|
||||
/* Save the Image and Command Line Names */
|
||||
|
|
Loading…
Reference in a new issue