Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
3.6 KiB

  1. /************************************************************/
  2. /* Windows Write, Copyright 1985-1992 Microsoft Corporation */
  3. /************************************************************/
  4. /* Include file with headers for functions in DOSLIB.ASM */
  5. typedef unsigned DOSHND; /* DOS handle */
  6. typedef DOSHND typeOSFN; /* General WRITE type for OS file handle */
  7. struct TIM { /* Time structure returned by OsTime */
  8. CHAR minutes, hour, hsec, sec;
  9. };
  10. int CchCurSzPath( CHAR *, CHAR );
  11. #ifdef ENABLE /* We are not currently using these */
  12. int FFirst( CHAR near *, PSTR, int );
  13. int FNext( CHAR near * );
  14. DOSHND WOpenSzFfname( CHAR *, int );
  15. #endif
  16. WORD DaGetFileModeSz(CHAR *);
  17. void OsTime( struct TIM * ); /* NOTE: function moved to lib.asm */
  18. DOSHND WCreateNewSzFfname( CHAR *, int );
  19. DOSHND WCreateSzFfname( CHAR *, int );
  20. int CchReadDoshnd( DOSHND, CHAR FAR *, int );
  21. int CchWriteDoshnd( DOSHND, CHAR FAR *, int );
  22. int FCloseDoshnd( DOSHND );
  23. WORD WDosVersion( void );
  24. int DosxError( void );
  25. long DwSeekDw( DOSHND, long, int );
  26. int FpeDeleteSzFfname( CHAR * );
  27. int FpeRenameSzFfname( CHAR *, CHAR * );
  28. #define DA_NORMAL 0x00 /* DOS File Attribute */
  29. #define DA_READONLY 0x01 /* DOS File Attribute for read-only file */
  30. #define DA_NIL 0xFFFF /* Error DA */
  31. #define dosxSharing 32 /* Extended error code for sharing viol. */
  32. #define nErrNoAcc 5 /* OpenFile error code for Access Denied */
  33. #define nErrFnf 2 /* OpenFile error code for File Not Found */
  34. #define bSHARE_DENYRDWR 0x10 /* Sharing Open mode for exclusive use */
  35. /* Error condition returned by "CCH" returning DOS functions, e.g. read */
  36. #define FIsErrCchDisk(cch) ((int)(cch) < 0)
  37. #define cchDiskHardError -1 /* Bogus error code, not returned by DOS */
  38. #define fpeHardError -1 /* also */
  39. /* Error condition returned by functions that return DOS handles */
  40. #define FIsErrDoshnd(doshnd) ((int)(doshnd) < 0)
  41. /* DOS Error codes */
  42. /* These are the negative of the codes returned in AX by DOS functions */
  43. #define fpeFnfError -2 /* File Not Found */
  44. #define fpeBadPathError -3 /* Bad Path (path not found) */
  45. #define fpeNoHndError -4 /* No Handles Available */
  46. #define fpeNoAccError -5 /* Access Denied */
  47. #define fpeBadHndError -6 /* Bad handle passed in */
  48. #define fpeNoDriveError -15 /* Non-existent drive passed in */
  49. #define fpeExistError -80 /* File exists */
  50. /* Seek-from type codes passed to DOS function 42H */
  51. #define SF_BEGINNING 0 /* Seek from beginning of file */
  52. #define SF_CURRENT 1 /* Seek from current file pointer */
  53. #define SF_END 2 /* Seek from end of file */
  54. /* Error test for seek position */
  55. #define FIsErrDwSeek(dw) ((long)(dw) < (long)0)
  56. /* Error test for fpe-returning functions */
  57. #define FIsErrFpe(fpe) ((int)(fpe) < 0)
  58. /* Tests whether an error is a hardware error. Hardware errors are caught
  59. and prompted for by Windows, so we should not duplicate those prompts.
  60. Chrisp says these DOS 3.0 error codes are generated by Windows for all
  61. supported versions of DOS
  62. fpe is WRITE's error type; ofe is the unadulturated error returned by
  63. DOS or OpenFile */
  64. #define ofeCaughtFirst 19
  65. #define ofeCaughtLast 27
  66. #define FIsCaughtOfe(ofe) (((ofe)>=ofeCaughtFirst)&&((ofe)<=ofeCaughtLast))
  67. #define FIsCaughtFpe(fpe) FIsCaughtOfe(-(fpe))
  68. #define FIsCaughtDwSeekErr(dw) FIsCaughtFpe((int)(dw))
  69. #define FpeFromCchDisk(cch) (cch)
  70. #define fpeNoErr 0
  71.