  ͻ
                                                                           
             Technical Description of EMS Contexts and Handles             
                                                                           
  ͼ

CONTEXTS & HANDLES

  A context is the state of the expanded memory pages that are physically
  mapped into the 64K-byte page frame at a given time.  A handle is a value
  associated with a logical page of expanded memory.  Application programs
  use handles to identify the expanded memory pages they've allocated.
  Applications also use EMM to save information about the pages they have
  mapped into the page frame.  EMM saves the context and keeps track of it
  using the handle the application program used in requesting the context
  save.

  EMM saves this information in its own internal data structures (using EMM
  Function 8) or in the data space of the application requesting the context
  save (using EMM Function 15).  The Context and Handles parameters only
  relate to EMM Functions 8 and 9 (Save Page Map and Restore Page Map),
  which save and restore only the mapping context of the 64K-byte page
  frame.  This is because functions 8 and 9 use space within EMM to store
  the context information, and that space is allocated based on these
  parameters.

  Functions 15 and 16 use data space in the application to save the mapping
  information.  This means the number of contexts that can be saved is not
  limited by these parameters.

  The number of contexts limits the maximum number of handles that can do a
  context save (each handle can do only one context save using Function 8)
  without doing a context restore (Function 9).

  EXAMPLE

  The Above Board QUIKBUF program is a memory-resident program.  This means
  it may be invoked when another program has pages mapped into the expanded
  memory page frame.  QUIKBUF must make sure that if it uses expanded
  memory, it doesn't corrupt the other applications that are also using it.

  Therefore, when QUIKBUF needs to use expanded memory, it tells EMM to save
  the context (Function 8) to save the current state of the expanded memory
  pages.  QUIKBUF then maps the pages it needs into the 64K-byte page frame.
  When it's done using expanded memory, QUIKBUF tells EMM to restore the
  context (Function 9).



End of file                 Intel FaxBack # 1110          December 2,1992
