anchor.diff:  		   overlapped)))
   
   (defun unlock-mapping (map)
  +  (declare (type mapping map))
     (with-foreign-object (overlapped '(:struct overlapped))
       (setf (foreign-slot-value overlapped '(:struct overlapped)
   			      'offset)
  
positive.code: 
  (defun flush-buffers (mapping)
    "Ensure changes to the file mapping are written to disk."
    (%flush-file-buffers (mapping-fhandle mapping)))
  
  ;; we lock the first byte and rely on co-operative locking
  (defun lock-mapping (map)
    (with-foreign-object (overlapped '(:struct overlapped))
      (setf (foreign-slot-value overlapped '(:struct overlapped)
  			      'offset)
  
negative.code:   ;; make sure the file actually exists before mapping it 
    (let ((path (ensure-file-exists path size)))
  
      (let ((fhandle (with-foreign-string (s path)
  		     (%create-file s 
  				   #xC0000000 ;; access == generic_read|generic_write
  				   3 ;; mode == share_read|share_write
  				   (null-pointer) ;; attrs
  				   4 ;; disposition == open always
  				   128 ;; flags == file attribute normal
  				   (null-pointer)))))
        (when (invalid-handle-p fhandle)
  	(get-last-error))
        
        (let ((mhandle (%create-file-mapping fhandle
  					   (null-pointer) ;; attrs
  					   4 ;; protect == page_readwrite
  					   0 ;; high
  					   0 ;; low
  					   (null-pointer))))
  	(when (null-pointer-p mhandle)
  	  (%close-handle fhandle)
  	  (get-last-error))
  	(let ((ptr (%map-view-of-file mhandle
  				      #x001f ;; access == filemapallaccess
  				      0 ;; low
  				      0 ;; high
  				      size)))
  	  (when (null-pointer-p ptr)
  	    (%close-handle mhandle)
  	    (%close-handle fhandle)
  	    (get-last-error))
  	  (make-mapping :fhandle fhandle
  			:mhandle mhandle
  			:ptr ptr
  			:size size))))))
  
  (defun close-mapping (mapping)
    "Closes the mapping structure."
  