mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:23:34 +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
1 changed files with 7 additions and 4 deletions
|
@ -83,8 +83,8 @@ static WORD DosCopyEnvironmentBlock(WORD SourceSegment)
|
||||||
strcpy(DestBuffer, Ptr);
|
strcpy(DestBuffer, Ptr);
|
||||||
|
|
||||||
/* Advance to the next string */
|
/* Advance to the next string */
|
||||||
Ptr += strlen(Ptr) + 1;
|
|
||||||
DestBuffer += strlen(Ptr);
|
DestBuffer += strlen(Ptr);
|
||||||
|
Ptr += strlen(Ptr) + 1;
|
||||||
|
|
||||||
/* Put a zero after the string */
|
/* Put a zero after the string */
|
||||||
*(DestBuffer++) = 0;
|
*(DestBuffer++) = 0;
|
||||||
|
@ -231,6 +231,8 @@ WORD DosAllocateMemory(WORD Size, WORD *MaxAvailable)
|
||||||
PDOS_MCB CurrentMcb, NextMcb;
|
PDOS_MCB CurrentMcb, NextMcb;
|
||||||
BOOLEAN SearchUmb = FALSE;
|
BOOLEAN SearchUmb = FALSE;
|
||||||
|
|
||||||
|
DPRINT("DosAllocateMemory: Size 0x%04X\n", Size);
|
||||||
|
|
||||||
if (DosUmbLinked && (DosAllocStrategy & (DOS_ALLOC_HIGH | DOS_ALLOC_HIGH_LOW)))
|
if (DosUmbLinked && (DosAllocStrategy & (DOS_ALLOC_HIGH | DOS_ALLOC_HIGH_LOW)))
|
||||||
{
|
{
|
||||||
/* Search UMB first */
|
/* Search UMB first */
|
||||||
|
@ -246,6 +248,7 @@ WORD DosAllocateMemory(WORD Size, WORD *MaxAvailable)
|
||||||
/* Make sure it's valid */
|
/* Make sure it's valid */
|
||||||
if (CurrentMcb->BlockType != 'M' && CurrentMcb->BlockType != 'Z')
|
if (CurrentMcb->BlockType != 'M' && CurrentMcb->BlockType != 'Z')
|
||||||
{
|
{
|
||||||
|
DPRINT("The DOS memory arena is corrupted!\n");
|
||||||
DosLastError = ERROR_ARENA_TRASHED;
|
DosLastError = ERROR_ARENA_TRASHED;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1750,13 +1753,13 @@ BOOLEAN DosInitialize(VOID)
|
||||||
/* Copy the string into DOS memory */
|
/* Copy the string into DOS memory */
|
||||||
strcpy(DestPtr, AsciiString);
|
strcpy(DestPtr, AsciiString);
|
||||||
|
|
||||||
/* Free the memory */
|
|
||||||
HeapFree(GetProcessHeap(), 0, AsciiString);
|
|
||||||
|
|
||||||
/* Move to the next string */
|
/* Move to the next string */
|
||||||
SourcePtr += wcslen(SourcePtr) + 1;
|
SourcePtr += wcslen(SourcePtr) + 1;
|
||||||
DestPtr += strlen(AsciiString);
|
DestPtr += strlen(AsciiString);
|
||||||
*(DestPtr++) = 0;
|
*(DestPtr++) = 0;
|
||||||
|
|
||||||
|
/* Free the memory */
|
||||||
|
HeapFree(GetProcessHeap(), 0, AsciiString);
|
||||||
}
|
}
|
||||||
*DestPtr = 0;
|
*DestPtr = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue