home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / thnker.zip / THUNKER.DOC < prev    next >
Text File  |  1994-05-01  |  3KB  |  65 lines

  1. 4/30/94 
  2.  
  3. While OS/2 2.X has many wonderful features it has one source of irritation 
  4. to programmers used to almost any other system. That source of irritation is 
  5. the fact that somebody at IBM made a poor decision and eliminated the KBD 
  6. MOU and VIO system calls from the 32 bit version of the operating system. 
  7. Whatever the reasoning behind this choice, it left the system crippled. 
  8. I would guess that one of the excuses given for deleting these calls was 
  9. that command line programs are "obsolete". In addition it was probably also 
  10. argued that programmers could always create thunks to the existing 16 bit 
  11. API's if they needed to.
  12.     Trust me on this; the source code necessary to create the thunks to 
  13. the almost 100 missing API functions is so ugly that in a controlled test 
  14. mere exposure to it resulted in the sterilization of frogs at a distance of 
  15. more than 100 paces. 
  16.     Fortunately I was able to hide all of this ugliness inside of nice 
  17. clean little .DLL file so that the rest of you won't have to see it. 
  18.  
  19. The files in THUNKER.ZIP are:
  20.  
  21. THUNKER.DLL --- This converts 32 bit calls to 16 bit for you.
  22. THUNKER.LIB --- This allows 32 bit C & asm to call MOU KBD and VIO functions.
  23. THUNKER.H   --- This allows C to pretend there are 32 bit MOU KBD & VIO API's.
  24. THUNKER.DOC --- Obviously this document.
  25. THNKTEST.C  --- Sample for use of the 32 bit MOU KBD and VIO API's
  26. THNKTEST.MAK -- Sample make file showing the linking.
  27. THNKTEST.DEF -- Def file for sample.
  28.  
  29.     Maybe the fact that this DLL exists will encourage IBM to correct 
  30. their horrendous blunder and make real 32 bit versions of these functions. 
  31. In any case, as long as the 16 bit calls exist in the system this .DLL makes 
  32. them accessible for your use.
  33.     The only 32 bit C which I have is GNU C. While the header functions 
  34. correctly with it,I have not tested it to work with commercial C compilers. 
  35. About the only source of potential trouble would be if some items in 
  36. THUNKER.H were already defined in your other headers. It is very plain 
  37. vanilla C - nothing compiler specific about it.
  38.     There is no reason not to call the functions from assembly code, but
  39. be aware of the following: 
  40.  
  41.     1. The function names are preceded by an '_'. EX: _VioWriteTTY
  42.     2. The stack is left dirty with the calling parms.
  43.     3. Parms are pushed in reverse order from the 1.x calls
  44.  
  45. All 3 of the above are for C's benefit.
  46.  
  47. THIS CODE IS RELEASED INTO THE PUBLIC DOMAIN AND MAY BE USED FOR COMMERCIAL 
  48. PURPOSES. UNDER NO CIRCUMSTANCES WILL THE AUTHOR BE LIABLE FOR ANY DAMAGES 
  49. RESULTING FROM THE USE OF THIS CODE.
  50.  
  51. ABOUT:
  52.     The code: THUNKER.DLL was written in 32 bit assembly and assembled 
  53. with MASM 6.0 under OS/2.
  54.  
  55.     The author: Robert E. Canup II has been involved in the micro 
  56. computer revolution since the pre-IBM S-100 days as an engineer and 
  57. programmer. He has held the world record for the fastest micro computer 
  58. design. 
  59.  
  60.  
  61. I am interested in any comments about this code including bug reports. 
  62. My CompuServe number is 73513,216
  63.  
  64.                         Bob
  65.