Author: aandrejevic
Date: Sun May 10 00:55:38 2015
New Revision: 67611
URL:
http://svn.reactos.org/svn/reactos?rev=67611&view=rev
Log:
[NTVDM]
- Implement XMS function 0x0E (Get Handle Information).
- Fix INT 15h, AX = E820h - setCF can't be used inside an int32 callback for changing
the return carry flag, because it has a different meaning there (it means that the BOP
should be repeated). Instead, we must modify the CF that was pushed on the stack.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c [iso-8859-1] Sun May 10
00:55:38 2015
@@ -318,7 +318,7 @@
PBIOS_MEMORY_MAP Map = (PBIOS_MEMORY_MAP)SEG_OFF_TO_PTR(getES(),
getDI());
/* Assume the buffer won't be large enough */
- setCF(0);
+ Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF;
while (BytesWritten < getECX() && (ULONG_PTR)Map <
(MAX_ADDRESS - sizeof(BIOS_MEMORY_MAP)))
{
@@ -326,7 +326,7 @@
if (!MemQueryMemoryZone(Offset, &Length, &Hooked))
{
/* No more memory blocks */
- setCF(1);
+ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
break;
}
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.c [iso-8859-1] Sun May 10
00:55:38 2015
@@ -513,6 +513,35 @@
break;
}
+ /* Get Handle Information */
+ case 0x0E:
+ {
+ PXMS_HANDLE Entry = GetHandleRecord(getDX());
+
+ if (Entry)
+ {
+ INT i;
+ UCHAR Handles = 0;
+
+ for (i = 0; i < XMS_MAX_HANDLES; i++)
+ {
+ if (HandleTable[i].Handle == 0) Handles++;
+ }
+
+ setAX(1);
+ setBH(Entry->LockCount);
+ setBL(Handles);
+ setDX(Entry->Size);
+ }
+ else
+ {
+ setAX(0);
+ setBL(XMS_STATUS_INVALID_HANDLE);
+ }
+
+ break;
+ }
+
default:
{
DPRINT1("XMS command AH = 0x%02X NOT IMPLEMENTED\n", getAH());