[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosUnlockSeg()                Unlock segment previously locked using DosLockSeg()
------------------------------------------------------------------------------

 Function : Unlock a segment previously locked using DosLockSeg()

 Syntax   : USHORT BLXAPI DosUnlockSeg(SEL selector);

 selector   A selector previously locked using DosLockSeg().

 Return   : None

 DosUnLockSeg() unlocks the memory associated with the selector parameter
 allowing it to be swapped out to disk. This function should be used to
 unlock hardware interrupt handlers when they are no longer active, and to
 unlock any selector whose alias has been freed.

 Example:

    #include <stdio.h>
    #include <blx286.h>
    void comminstall(void);
    void commhandler(void);
    void communinstall(void);
    void main(void)
    {
    if (DosLockSeg(SELECTOROF(commhandler)) == 0)
       {
       printf("Serial interrupt handler locked in memory\n");
       comminstall(); /* Hook serial comms interrupt */
       ...
       communinstall(); /* Unhook comms interrupt */
       if (DosUnlockSeg(SELECTOROF(commhandler)) == 0)
          printf("Comms handler may now be swapped to disk\n");
       }
    }

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