Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Blinker 5.10 Online Reference - <b> dosunlockseg()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosUnlockSeg()
------------------------------------------------------------------------------
 Purpose:
 Unlock a segment previously locked using DosLockSeg().

 Syntax:
 USHORT BLXAPI DosUnlockSeg(SEL selector);

 Parameters:
 selector  A selector previously locked using DosLockSeg().

 Returns:
 None.

 Description:
 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()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson