- 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.


svn path=/trunk/; revision=67611
This commit is contained in:
Aleksandar Andrejevic 2015-05-10 00:55:38 +00:00
parent ec4790f045
commit 8872cfb339
2 changed files with 31 additions and 2 deletions

View file

@ -318,7 +318,7 @@ static VOID WINAPI BiosMiscService(LPWORD Stack)
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 @@ static VOID WINAPI BiosMiscService(LPWORD Stack)
if (!MemQueryMemoryZone(Offset, &Length, &Hooked))
{
/* No more memory blocks */
setCF(1);
Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
break;
}

View file

@ -513,6 +513,35 @@ static VOID WINAPI XmsBopProcedure(LPWORD Stack)
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());