SAMPLE: XMSWin.exe - TSR to Share XMS Mem. Bet. Virt. Computers

ID: Q74809


The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) versions 3.0, 3.1


SUMMARY

XMSWin.exe is a sample application that demonstrates the techniques outlined in the following paragraphs. A copy of the Microsoft Macro Assembler (MASM) version 5.0 or later is required to build the applications in this file.

By using a terminate-and-stay-resident program (TSR) loaded before Windows, programs can share a block of extended memory specification (XMS) memory between virtual machines (VMs).

When the TSR is loaded, it allocates and locks a block of XMS memory. This memory is now global to all VMs. The TSR hooks an interrupt and will return the physical address of the block and the XMS block handle.

A protected-mode Windows program can access the memory directly by converting the physical address returned by the TSR to a linear address using DPMI (the MS-DOS Protected Mode Interface). This linear address can then be used to build a descriptor that references the memory. The descriptor is also built using DPMI.

For the MS-DOS VM to access the XMS block, it must use the XMS block handle returned by the TSR. With this handle, MS-DOS-based applications can copy data to and from the block.


MORE INFORMATION

The following file is available for download from the Microsoft Download Center. Click the file name below to download the file:

XMSWin.exe
For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

Additional query words:

Keywords : kbfile kbsample kb16bitonly kbKernBase
Version : WINDOWS:3.0,3.1
Platform : WINDOWS
Issue type :


Last Reviewed: December 2, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.