Author: aandrejevic
Date: Wed May 6 03:38:41 2015
New Revision: 67573
URL:
http://svn.reactos.org/svn/reactos?rev=67573&view=rev
Log:
[NTVDM]
Implement EMS function AH = 53h (Get/Set Handle Name).
Some programs expect to find the string "EMMXXXX0" at offset 0x0A in
the segment where the EMS interrupt handler is, so move the interrupt
handler BOP to the private device area of the EMS driver.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.h
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.c [iso-8859-1] Wed May 6
03:38:41 2015
@@ -221,6 +221,41 @@
break;
}
+ /* Get/Set Handle Name */
+ case 0x53:
+ {
+ PEMS_HANDLE HandleEntry = GetHandleRecord(getDX());
+ if (HandleEntry == NULL || !HandleEntry->Allocated)
+ {
+ setAL(EMS_STATUS_INVALID_HANDLE);
+ break;
+ }
+
+ if (getAL() == 0x00)
+ {
+ /* Retrieve the name */
+ RtlCopyMemory(SEG_OFF_TO_PTR(getES(), getDI()),
+ HandleEntry->Name,
+ sizeof(HandleEntry->Name));
+ setAH(EMS_STATUS_OK);
+ }
+ else if (getAL() == 0x01)
+ {
+ /* Store the name */
+ RtlCopyMemory(HandleEntry->Name,
+ SEG_OFF_TO_PTR(getDS(), getSI()),
+ sizeof(HandleEntry->Name));
+ setAH(EMS_STATUS_OK);
+ }
+ else
+ {
+ DPRINT1("Invalid subfunction %02X for EMS function AH = 53h\n",
getAL());
+ setAH(EMS_STATUS_UNKNOWN_FUNCTION);
+ }
+
+ break;
+ }
+
/* Move/Exchange Memory */
case 0x57:
{
@@ -418,12 +453,17 @@
EmsReadMemory,
EmsWriteMemory);
- RegisterDosInt32(EMS_INTERRUPT_NUM, EmsIntHandler);
/* Create the device */
- Node = DosCreateDevice(DOS_DEVATTR_IOCTL | DOS_DEVATTR_CHARACTER,
- EMS_DEVICE_NAME);
+ Node = DosCreateDeviceEx(DOS_DEVATTR_IOCTL | DOS_DEVATTR_CHARACTER,
+ EMS_DEVICE_NAME,
+ 32);
Node->IoctlReadRoutine = EmsDrvDispatchIoctlRead;
+
+ RegisterInt32(MAKELONG(sizeof(DOS_DRIVER) + DEVICE_CODE_SIZE,
HIWORD(Node->Driver)),
+ EMS_INTERRUPT_NUM,
+ EmsIntHandler,
+ NULL);
return TRUE;
}
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/emsdrv.h [iso-8859-1] Wed May 6
03:38:41 2015
@@ -34,6 +34,7 @@
BOOLEAN Allocated;
USHORT PageCount;
LIST_ENTRY PageList;
+ UCHAR Name[8];
} EMS_HANDLE, *PEMS_HANDLE;
typedef struct _EMS_PAGE