[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosLockSeg()                  Lock segment in memory to prevent it being swapped out by Blinker DOS extender's VM system.
------------------------------------------------------------------------------

 Function : Lock a segment in memory to prevent it being swapped out by the
            Blinker DOS extender's VM system.

 Syntax   : USHORT BLXAPI DosIsBlinkX(SEL selector);

 selector   The selector to be locked.

 Return   : None

 DosLockSeg() locks the memory associated with the selector parameter in
 memory, preventing it from being swapped out to disk. This function should
 be used to lock hardware interrupt handlers into memory, as it may not be
 possible to call DOS to reload the segment at the time the interrupt occurs.
 Locking a selector causes the segment to be loaded into memory.

 DosLockSeg() should also be used to lock selectors into memory before they
 are aliased using DosCreateDSAlias() or DosCreateCSAlias(). Segments that
 are to be aliased using these functions must be locked to prevent them from
 being swapped out and subsequently reloaded at a different linear base
 address, which would cause the alias selector to no longer point to the same
 memory region as the original alias.

 Example:

    #include <stdio.h>
    #include <blx286.h>
    void comminstall(void);
    void commhandler(void);
    void main(void)
    {
    if (DosLockSeg(SELECTOROF(commhandler))==0)
       {
       printf("Serial interrupt handler locked in memory\n");
       comminstall(); /* Hook serial comms interrupt */
       ...
       }
    }

See Also: DosUnlockSeg()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson