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.

115 lines
5.1 KiB

  1. /*
  2. * $Log: V:/Flite/archives/TrueFFS5/Src/BDDEFS.H_V $
  3. *
  4. * Rev 1.4 Jan 17 2002 23:00:00 oris
  5. * Replace FLFlash record with a pointer to FLFlash record (TrueFFS now uses only SOCKETS number of FLFlash records).
  6. * Removed SINGLE_BUFFER ifdef.
  7. * Added partition parameter to setBusy.
  8. *
  9. * Rev 1.3 Mar 28 2001 05:59:22 oris
  10. * copywrite dates.
  11. * Added empty line at the end of the file
  12. * left alligned all # directives
  13. * Removed dismountLowLevel extern prototype
  14. *
  15. * Rev 1.2 Feb 18 2001 14:22:58 oris
  16. * Removed driveHandle field from volume record.
  17. *
  18. * Rev 1.1 Feb 12 2001 12:51:08 oris
  19. * Changed the mutex field to a pointer to support TrueFFS 5.0 mutex mechanism
  20. *
  21. * Rev 1.0 Feb 02 2001 12:04:16 oris
  22. * Initial revision.
  23. *
  24. */
  25. /***********************************************************************************/
  26. /* M-Systems Confidential */
  27. /* Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-2001 */
  28. /* All Rights Reserved */
  29. /***********************************************************************************/
  30. /* NOTICE OF M-SYSTEMS OEM */
  31. /* SOFTWARE LICENSE AGREEMENT */
  32. /* */
  33. /* THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE */
  34. /* AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT */
  35. /* FOR THE SPECIFIC TERMS AND CONDITIONS OF USE, */
  36. /* OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE: */
  37. /* E-MAIL = [email protected] */
  38. /***********************************************************************************/
  39. #ifndef BDDEFS_H
  40. #define BDDEFS_H
  41. #include "fltl.h"
  42. #include "flsocket.h"
  43. #include "flbuffer.h"
  44. #include "stdcomp.h"
  45. typedef struct {
  46. char flags; /* See description in flreq.h */
  47. unsigned sectorsPerCluster; /* Cluster size in sectors */
  48. unsigned maxCluster; /* highest cluster no. */
  49. unsigned bytesPerCluster; /* Bytes per cluster */
  50. unsigned bootSectorNo; /* Sector no. of DOS boot sector */
  51. unsigned firstFATSectorNo; /* Sector no. of 1st FAT */
  52. unsigned secondFATSectorNo; /* Sector no. of 2nd FAT */
  53. unsigned numberOfFATS; /* number of FAT copies */
  54. unsigned sectorsPerFAT; /* Sectors per FAT copy */
  55. unsigned rootDirectorySectorNo; /* Sector no. of root directory */
  56. unsigned sectorsInRootDirectory; /* No. of sectors in root directory */
  57. unsigned firstDataSectorNo; /* 1st cluster sector no. */
  58. unsigned allocationRover; /* rover pointer for allocation */
  59. #if FILES > 0
  60. FLBuffer volBuffer; /* Define a sector buffer */
  61. #endif
  62. FLMutex* volExecInProgress;
  63. FLFlash FAR2* flash; /* flash structure for low level operations */
  64. TL tl; /* Translation layer methods */
  65. FLSocket *socket; /* Pointer to socket */
  66. #ifdef WRITE_PROTECTION
  67. unsigned long password[2];
  68. #endif
  69. #ifdef WRITE_EXB_IMAGE
  70. dword binaryLength; /* Actual binary area taken by the exb */
  71. byte moduleNo; /* Currently written module */
  72. #endif /* WRITE_EXB_IMAGE */
  73. } Volume;
  74. /* drive handle masks */
  75. #if defined(FILES) && FILES > 0
  76. typedef struct {
  77. long currentPosition; /* current byte offset in file */
  78. #define ownerDirCluster currentPosition /* 1st cluster of owner directory */
  79. long fileSize; /* file size in bytes */
  80. SectorNo directorySector; /* sector of directory containing file */
  81. unsigned currentCluster; /* cluster of current position */
  82. unsigned char directoryIndex; /* entry no. in directory sector */
  83. unsigned char flags; /* See description below */
  84. Volume * fileVol; /* Drive of file */
  85. } File;
  86. /* File flag definitions */
  87. #define FILE_MODIFIED 4 /* File was modified */
  88. #define FILE_IS_OPEN 8 /* File entry is used */
  89. #define FILE_IS_DIRECTORY 0x10 /* File is a directory */
  90. #define FILE_IS_ROOT_DIR 0x20 /* File is root directory */
  91. #define FILE_READ_ONLY 0x40 /* Writes not allowed */
  92. #define FILE_MUST_OPEN 0x80 /* Create file if not found */
  93. #endif /* FILES > 0 */
  94. /* #define buffer (vol.volBuffer) */
  95. #define execInProgress (vol.volExecInProgress)
  96. extern FLStatus dismountVolume(Volume vol);
  97. extern FLBoolean initDone; /* Initialization already done */
  98. extern Volume vols[VOLUMES];
  99. extern FLStatus setBusy(Volume vol, FLBoolean state, byte partition);
  100. const void FAR0 *findSector(Volume vol, SectorNo sectorNo);
  101. FLStatus dismountFS(Volume vol,FLStatus status);
  102. #if FILES>0
  103. void initFS(void);
  104. #endif
  105. #endif