[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
* function: xms_copy()
*
* description: xms_copy() is the most complex of these XMS wrapper
*     functions, because the driver wants a pointer to a structure of
*     information.  What we'll have to do is fake that structure, and
*     return a pointer to the beginning of it.  Since we only need
*     the structure for the driver call, we'll just use some private
*     variables.  Note that we use the undocumented function make_ptr()
*     to get the segment:offset pointer of the beginning of the structure.
*-------------------------------------------------------------------------
FUNCTION LOGICAL xms_copy
   PARAMETERS VALUE INT  s_handle,  VALUE LONG s_offset, ;
              VALUE INT  d_handle,  VALUE LONG d_offset, ;
              VALUE LONG cp_len

   VARDEF
      UINT  ax,bx,cx,dx,ds,si,es,di,bp
   ENDDEF

   *---
   * Quick note: xms_copy() will fail if the length is not even!
   *---
   if cp_len % 2 = 1
      cp_len = cp_len + 1
   endif

   Copy_Length    = cp_len
   SourceHandle   = s_handle
   SourceOffset   = s_offset
   DestHandle     = d_handle
   DestOffset     = d_offset

   make_ptr( ds, si, Copy_Length )

   ax = &XMS_MOVE_MEM
   call_driver( xms_get_driver(), ax, bx, cx, dx, si, di, bp, ds, es)
   xms_set_error( ax, bx )

   if xms_get_error() <> 0
      return &FALSE
   endif

   return &TRUE

ENDPRO


See Also: xms_installed() xms_avail() xms_get_driver() xms_get_version() xms_alloc() xms_free() hma_alloc() hma_free() xms_lock() xms_unlock()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson