home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sd386v50.zip / sd386src.zip / D16.C < prev    next >
Text File  |  1992-10-13  |  3KB  |  50 lines

  1. /*****************************************************************************/
  2. /* Get16BitDosExitEntry                                                      */
  3. /*                                                                           */
  4. /* Description:                                                              */
  5. /*                                                                           */
  6. /*   Get the DosExit entry point for a 16 bit application.                   */
  7. /*                                                                           */
  8. /* Parameters:                                                               */
  9. /*                                                                           */
  10. /*   mte            This is the module handle for DOSCALLS.DLL               */
  11. /*                                                                           */
  12. /* Return:                                                                   */
  13. /*                                                                           */
  14. /*   usrc           Just a return code.                                      */
  15. /*   DosExitEntryPt The sel:off address of the 16 bit DosExit entry.         */
  16. /*                                                                           */
  17. /* Assumptions:                                                              */
  18. /*                                                                           */
  19. /*   mte is valid.                                                           */
  20. /*                                                                           */
  21. /*                                                                           */
  22. /* Notes:                                                                    */
  23. /*                                                                           */
  24. /* These are the options used to compile this module.                        */
  25. /*                                                                           */
  26. /* cl  /c /Zi /U_DATA /U_TEXT -G2s /MD -Od -W3 -AL -NTCODX -NDDATX  $*.c     */
  27. /*                                                                           */
  28. /* I used MSC 6.00a, but you could use C/2 1.1                               */
  29. /*                                                                           */
  30. /*****************************************************************************/
  31. typedef unsigned long ulong;
  32. typedef unsigned short ushort;
  33.  
  34. #define DOSEXITORDINAL16BIT   5
  35.  
  36. ushort  Get16BitDosExitEntry(ulong);
  37. ulong   DosExitEntryPt16;
  38. ushort  pascal far DosGetProcAddr(ushort, void *, void *);
  39.  
  40. ushort Get16BitDosExitEntry(ulong mte)
  41. {
  42.  ulong   ordinal;
  43.  ushort  usrc;
  44.  
  45.  ordinal = DOSEXITORDINAL16BIT;
  46.  
  47.  usrc =  DosGetProcAddr((ushort)mte,(void *)ordinal,(void*)&DosExitEntryPt16);
  48.  return(usrc);
  49. }
  50.