mirror of
https://github.com/reactos/reactos.git
synced 2024-08-04 18:40:59 +00:00
[NTVDM]
Fix bug while initializing and copying the environment strings. svn path=/branches/ntvdm/; revision=59557
This commit is contained in:
parent
c04b008f1f
commit
87fc3759e3
|
@ -83,8 +83,8 @@ static WORD DosCopyEnvironmentBlock(WORD SourceSegment)
|
|||
strcpy(DestBuffer, Ptr);
|
||||
|
||||
/* Advance to the next string */
|
||||
Ptr += strlen(Ptr) + 1;
|
||||
DestBuffer += strlen(Ptr);
|
||||
Ptr += strlen(Ptr) + 1;
|
||||
|
||||
/* Put a zero after the string */
|
||||
*(DestBuffer++) = 0;
|
||||
|
@ -231,6 +231,8 @@ WORD DosAllocateMemory(WORD Size, WORD *MaxAvailable)
|
|||
PDOS_MCB CurrentMcb, NextMcb;
|
||||
BOOLEAN SearchUmb = FALSE;
|
||||
|
||||
DPRINT("DosAllocateMemory: Size 0x%04X\n", Size);
|
||||
|
||||
if (DosUmbLinked && (DosAllocStrategy & (DOS_ALLOC_HIGH | DOS_ALLOC_HIGH_LOW)))
|
||||
{
|
||||
/* Search UMB first */
|
||||
|
@ -246,6 +248,7 @@ WORD DosAllocateMemory(WORD Size, WORD *MaxAvailable)
|
|||
/* Make sure it's valid */
|
||||
if (CurrentMcb->BlockType != 'M' && CurrentMcb->BlockType != 'Z')
|
||||
{
|
||||
DPRINT("The DOS memory arena is corrupted!\n");
|
||||
DosLastError = ERROR_ARENA_TRASHED;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1750,13 +1753,13 @@ BOOLEAN DosInitialize(VOID)
|
|||
/* Copy the string into DOS memory */
|
||||
strcpy(DestPtr, AsciiString);
|
||||
|
||||
/* Free the memory */
|
||||
HeapFree(GetProcessHeap(), 0, AsciiString);
|
||||
|
||||
/* Move to the next string */
|
||||
SourcePtr += wcslen(SourcePtr) + 1;
|
||||
DestPtr += strlen(AsciiString);
|
||||
*(DestPtr++) = 0;
|
||||
|
||||
/* Free the memory */
|
||||
HeapFree(GetProcessHeap(), 0, AsciiString);
|
||||
}
|
||||
*DestPtr = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue