Author: hbelusca
Date: Tue Aug 18 12:26:38 2015
New Revision: 68754
URL: http://svn.reactos.org/svn/reactos?rev=68754&view=rev
Log:
[NTVDM]: Initialize the PSP' memory control block owner name with the file name (without extension, and up to 8 chars) of the started program.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c [iso-8859-1] Tue Aug 18 12:26:38 2015
@@ -31,17 +31,52 @@
/* PRIVATE FUNCTIONS **********************************************************/
-static inline VOID DosSetPspCommandLine(WORD Segment, LPCSTR CommandLine)
+static VOID DosInitPsp(IN WORD Segment,
+ IN WORD EnvBlock,
+ IN LPCSTR CommandLine,
+ IN LPCSTR ProgramName)
{
PDOS_PSP PspBlock = SEGMENT_TO_PSP(Segment);
+ PDOS_MCB Mcb = SEGMENT_TO_MCB(Segment - 1);
+ LPCSTR PspName;
+ USHORT i;
+
+ /* Link the environment block */
+ PspBlock->EnvBlock = EnvBlock;
/*
- * Copy the command line block.
+ * Copy the command line.
* Format of the CommandLine parameter: 1 byte for size; 127 bytes for contents.
*/
PspBlock->CommandLineSize = min(*(PBYTE)CommandLine, DOS_CMDLINE_LENGTH);
CommandLine++;
RtlCopyMemory(PspBlock->CommandLine, CommandLine, DOS_CMDLINE_LENGTH);
+
+ /*
+ * Initialize the owner name of the MCB of the PSP.
+ */
+
+ /* Find the start of the file name, skipping all the path elements */
+ PspName = ProgramName;
+ while (*ProgramName)
+ {
+ switch (*ProgramName++)
+ {
+ /* Path delimiter, skip it */
+ case ':': case '\\': case '/':
+ PspName = ProgramName;
+ break;
+ }
+ }
+ /* Copy the file name up to the extension... */
+ for (i = 0; i < sizeof(Mcb->Name) && PspName[i] != '.' && PspName[i] != '\0'; ++i)
+ {
+ Mcb->Name[i] = RtlUpperChar(PspName[i]);
+ }
+ /* ... and NULL-terminate if needed */
+ if (i < sizeof(Mcb->Name)) Mcb->Name[i] = '\0';
+
+ // FIXME: Initialize the FCBs
}
static inline VOID DosSaveState(VOID)
@@ -408,10 +443,9 @@
/* Set INT 22h to the return address */
((PULONG)BaseAddress)[0x22] = ReturnAddress;
- /* Create the PSP */
+ /* Create the PSP and initialize it */
DosCreatePsp(Segment, (WORD)TotalSize);
- DosSetPspCommandLine(Segment, CommandLine);
- SEGMENT_TO_PSP(Segment)->EnvBlock = EnvBlock;
+ DosInitPsp(Segment, EnvBlock, CommandLine, ExePath);
/* Calculate the segment where the program should be loaded */
if (!LoadHigh)
@@ -486,10 +520,9 @@
/* Set INT 22h to the return address */
((PULONG)BaseAddress)[0x22] = ReturnAddress;
- /* Create the PSP */
+ /* Create the PSP and initialize it */
DosCreatePsp(Segment, MaxAllocSize);
- DosSetPspCommandLine(Segment, CommandLine);
- SEGMENT_TO_PSP(Segment)->EnvBlock = EnvBlock;
+ DosInitPsp(Segment, EnvBlock, CommandLine, ExePath);
/* Calculate the segment where the program should be loaded */
LoadSegment = Segment + (sizeof(DOS_PSP) >> 4);
Author: tfaber
Date: Tue Aug 18 11:28:30 2015
New Revision: 68753
URL: http://svn.reactos.org/svn/reactos?rev=68753&view=rev
Log:
[NTOS:MM]
- Leave guarded region in failure case of MiFindContiguousPages.
CORE-10026 #resolve
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/contmem.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/contmem.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/contmem.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/contmem.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/contmem.c [iso-8859-1] Tue Aug 18 11:28:30 2015
@@ -205,6 +205,7 @@
//
// And if we get here, it means no suitable physical memory runs were found
//
+ KeLeaveGuardedRegion();
return 0;
}
Author: hbelusca
Date: Mon Aug 17 20:22:10 2015
New Revision: 68747
URL: http://svn.reactos.org/svn/reactos?rev=68747&view=rev
Log:
Fix a comment and add something that was forgotten in the previous commit.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c [iso-8859-1] Mon Aug 17 20:22:10 2015
@@ -546,7 +546,7 @@
*/
setDX(Segment);
setDI(FinalSP);
- setBP(0x091E); // DOS base stack pointer relic value
+ setBP(0x091E); // DOS base stack pointer relic value. In MS-DOS 5.0 and Windows' NTVDM it's 0x091C. This is in fact the old SP value inside DosData disk stack.
setSI(FinalIP);
setAX(0/*0xFFFF*/); // FIXME: fcbcode
@@ -897,7 +897,7 @@
/* Notify VDDs of process termination */
VDDTerminateUserHook(Psp);
- /* Check if this PSP is it's own parent */
+ /* Check if this PSP is its own parent */
if (PspBlock->ParentPsp == Psp) goto Done;
if (KeepResident == 0)