Author: aandrejevic
Date: Tue May 12 03:47:10 2015
New Revision: 67676
URL:
http://svn.reactos.org/svn/reactos?rev=67676&view=rev
Log:
[NTVDM]
Fix the XMS driver (again):
- Don't return handle information for unallocated handles.
- Don't allow freeing unallocated handles.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.c
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] Tue May 12
03:47:10 2015
@@ -281,7 +281,7 @@
DWORD BlockNumber;
PXMS_HANDLE HandleEntry = GetHandleRecord(Handle);
- if (HandleEntry == NULL) return XMS_STATUS_INVALID_HANDLE;
+ if (HandleEntry == NULL || HandleEntry->Handle == 0) return
XMS_STATUS_INVALID_HANDLE;
if (HandleEntry->LockCount) return XMS_STATUS_LOCKED;
BlockNumber = (HandleEntry->Address - XMS_ADDRESS) / XMS_BLOCK_SIZE;
@@ -540,7 +540,7 @@
{
PXMS_HANDLE Entry = GetHandleRecord(getDX());
- if (Entry)
+ if (Entry && Entry->Handle != 0)
{
INT i;
UCHAR Handles = 0;