Author: akhaldi
Date: Sat May 2 10:23:26 2015
New Revision: 67509
URL: http://svn.reactos.org/svn/reactos?rev=67509&view=rev
Log:
[MSPORTS] Introduce a setting that makes the driver accept resources with an IRQ instead of only resources without an IRQ. Brought to you by The ReactOS Printing Group. CORE-9645
Modified:
trunk/reactos/dll/win32/msports/classinst.c
Modified: trunk/reactos/dll/win32/msports/classinst.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msports/classins…
==============================================================================
--- trunk/reactos/dll/win32/msports/classinst.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msports/classinst.c [iso-8859-1] Sat May 2 10:23:26 2015
@@ -381,6 +381,7 @@
WCHAR szPortName[8];
DWORD dwPortNumber = 0;
DWORD dwSize;
+ DWORD dwValue;
LONG lError;
HKEY hKey;
@@ -457,6 +458,23 @@
REG_SZ,
(LPBYTE)szPortName,
(wcslen(szPortName) + 1) * sizeof(WCHAR));
+
+ /*
+ * FIXME / HACK:
+ * This is to get the w2k3 parport.sys to work until we have our own.
+ * This setting makes the driver accept resources with an IRQ instead
+ * of only resources without an IRQ.
+ *
+ * We should probably also fix IO manager to actually give devices a
+ * chance to register without an IRQ. CORE-9645
+ */
+ dwValue = 0;
+ RegSetValueExW(hKey,
+ L"FilterResourceMethod",
+ 0,
+ REG_DWORD,
+ (LPBYTE)&dwValue,
+ sizeof(dwValue));
RegCloseKey(hKey);
}
Author: aandrejevic
Date: Sat May 2 02:59:21 2015
New Revision: 67507
URL: http://svn.reactos.org/svn/reactos?rev=67507&view=rev
Log:
[NTVDM]
Implement INT 27h (Terminate and Stay Resident).
Keep track of the last entry SS:SP in the INT 21h handler.
Restore the stack in DosTerminateProcess.
The number of bytes to keep resident applies only to the block which holds the PSP,
other blocks are not freed.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Sat May 2 02:59:21 2015
@@ -177,6 +177,10 @@
INT Return;
(*InDos)++;
+
+ /* Save the value of SS:SP on entry in the PSP */
+ SEGMENT_TO_PSP(CurrentPsp)->LastStack =
+ MAKELONG(getSP() + (STACK_FLAGS + 1) * 2, getSS());
/* Check the value in the AH register */
switch (getAH())
@@ -1817,6 +1821,11 @@
Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
}
+VOID WINAPI DosInt27h(LPWORD Stack)
+{
+ DosTerminateProcess(getCS(), 0, (getDX() + 0x0F) >> 4);
+}
+
VOID WINAPI DosFastConOut(LPWORD Stack)
{
/*
@@ -2002,6 +2011,7 @@
// RegisterDosInt32(0x22, DosInt22h ); // Termination
RegisterDosInt32(0x23, DosBreakInterrupt); // Ctrl-C / Ctrl-Break
// RegisterDosInt32(0x24, DosInt24h ); // Critical Error
+ RegisterDosInt32(0x27, DosInt27h ); // Terminate and Stay Resident
RegisterDosInt32(0x29, DosFastConOut ); // DOS 2+ Fast Console Output
RegisterDosInt32(0x2F, DosInt2Fh );
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] Sat May 2 02:59:21 2015
@@ -780,23 +780,20 @@
/* Check if this block was allocated by the process */
if (CurrentMcb->OwnerPsp == Psp)
{
- if (KeepResident == 0)
+ if (KeepResident)
+ {
+ /* Check if this is the PSP block and we should reduce its size */
+ if (McbSegment == Psp && KeepResident < CurrentMcb->Size)
+ {
+ /* Reduce the size of the block */
+ DosResizeMemory(McbSegment + 1, KeepResident, NULL);
+ break;
+ }
+ }
+ else
{
/* Free this entire block */
DosFreeMemory(McbSegment + 1);
- }
- else if (KeepResident < CurrentMcb->Size)
- {
- /* Reduce the size of the block */
- DosResizeMemory(McbSegment + 1, KeepResident, NULL);
-
- /* No further paragraphs need to stay resident */
- KeepResident = 0;
- }
- else
- {
- /* Just reduce the amount of paragraphs we need to keep resident */
- KeepResident -= CurrentMcb->Size;
}
}
@@ -849,6 +846,10 @@
/* Save the return code - Normal termination */
DosErrorLevel = MAKEWORD(ReturnCode, 0x00);
+ /* Restore the old stack */
+ setSS(HIWORD(SEGMENT_TO_PSP(CurrentPsp)->LastStack));
+ setSP(LOWORD(SEGMENT_TO_PSP(CurrentPsp)->LastStack));
+
/* Return control to the parent process */
CpuExecute(HIWORD(PspBlock->TerminateAddress),
LOWORD(PspBlock->TerminateAddress));