home *** CD-ROM | disk | FTP | other *** search
/ CICA 1993 August / CICA.cdr / cis_libs / mswin32 / 13 / ioport.rd2 < prev    next >
Encoding:
Text File  |  1993-01-11  |  2.5 KB  |  65 lines

  1. January 9, 1993
  2. Robert R. Howell
  3.  
  4. This file contains additional notes concerning the I/O port drivers which I 
  5. uploaded on January 8.
  6.  
  7. ----------------------------------------------------------------------------
  8. TABS:
  9.  
  10. The Quick-C for Windows editor that I used left tabs within the files.  If you 
  11. want print-outs to LOOK NICE, load the files into an editor such as QC-Win 
  12. which understands tabs, with a setting of one tab stop every 4 characters.  
  13. Then save the files with the tabs converted to spaces.
  14.  
  15.  
  16. ----------------------------------------------------------------------------
  17. CORRECTIONS to the COMMENTS in the files:
  18.  
  19. In several places I discovered that I had not eliminated comments appropriate 
  20. only to the ADLIB drivers.  I also have a few clarifications.
  21.  
  22. --------
  23. in WKD.H
  24.  
  25. The comment on the structure member "DeviceType" is:   // in or out.
  26. Ignore that comment.  This variable stores the DeviceType which should be used 
  27. in the IOCTL code, and checks this when IOCTL call is serviced.  I'm not sure 
  28. if these needs to be done, but it doesn't hurt. 
  29.  
  30. ------------
  31. in WKDINIT.C  
  32.  
  33. Change the comment which reads // Maps 1 byte of IO space ...
  34.                          to    // Maps (NUMBER_PORTS) bytes of IO space
  35.  
  36. -------------
  37. in DISPATCH.C
  38.  
  39. After IRP_MJ_CREATE there is a block of code from the ADLIB driver which I've 
  40. commented out and my explanation is confusing.  I should have simply said that 
  41. I was always allowing the CreateFile call to succeed, without performing any 
  42. of the access checks.  
  43.  
  44. The BREAK which ends the CASE is also commented out.  It shouldn't be.  
  45. The driver works anyway, because the next CASE block ALSO does nothing but 
  46. return STATUS_SUCCESS.  Eliminate the // before the BREAK;
  47.  
  48. At the start of the wkdIoctlReadPort and wkdIoctlWritePort routines, the 
  49. return values listed are left over from the ADLIB code.  The returns SHOULD 
  50. BE:
  51.  
  52.     STATUS_SUCCESS            --  Read or write succeeded
  53.  
  54.     STATUS_BUFFER_TOO_SMALL   --  On WRITE:  The buffer sent to the driver was 
  55.                                   too small to contain both the port and the 
  56.                                   value to be written. 
  57.                                   on READ:   The buffer sent to the driver was 
  58.                                   too small to contain the port, or the buffer 
  59.                                   which would be sent back to the driver is 
  60.                                   too small to contain the datae.
  61.  
  62.     STATUS_ACCESS_VIOLATION   --  An illegal port number was given.
  63.  
  64.  
  65.