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> dosprottoreal()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosProtToReal()
------------------------------------------------------------------------------
 Purpose:
 Get a real mode pointer corresponding to a protected mode pointer.

 Syntax:
 REALPTR BLXAPI DosProtToReal(void __far * pmptr);

 Parameters:
 pmptr  Protected mode pointer.

 Returns:
 A real mode pointer or NULL if the protected mode pointer base address
 is above 1 MB.

 Description:
 DosProtToReal() returns a real mode pointer corresponding to a protected
 mode pointer.

 Example:
 #include <stdio.h>                                                          
 #include <blx286.h>                                                         
                                                                             
 void main(void)                                                             
 {                                                                           
 void *fp;                                                                   
 REALPTR rmptr;                                                              
                                                                             
 fp = DosRealToProt ((REALPTR) MK_FP (0x40,0));                              
 if (fp == NULL)                                                             
    printf ("Unable to map pointer to BIOS data area");                      
 else                                                                        
    {                                                                        
    printf ("PM pointer to BIOS data area : %p\n\n",fp);                     
    if ((rmptr = DosProtToReal(fp)) == NULL)                                 
       printf ("Pointer was in extended memory");                            
    else                                                                     
       printf ("RM pointer to BIOS data area : %p\n\n", rmptr);              
    }                                                                        
 }                                                                           

See Also: DosRealToProt()

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