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.

44 lines
1.5 KiB

  1. #include "drive.hxx"
  2. #include "bpb.hxx"
  3. #define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR))
  4. extern "C" {
  5. #include "lfs.h"
  6. #include "ofsdisk.h"
  7. };
  8. typedef struct _DSKBPB
  9. {
  10. USHORT BytesPerSector;
  11. UCHAR SectorsPerCluster;
  12. USHORT ReservedSectors;
  13. UCHAR Fats;
  14. USHORT RootEntries;
  15. USHORT Sectors16;
  16. UCHAR Media;
  17. USHORT SectorsPerFat;
  18. USHORT SectorsPerTrack;
  19. USHORT Heads;
  20. ULONG HiddenSectors;
  21. ULONG Sectors32;
  22. } DSKBPB;
  23. //
  24. // This macro takes a Packed BPB and fills in its Unpacked equivalent
  25. //
  26. #define UnpackOfsBios(Bios,Pbios) { \
  27. CopyUchar2(&((Bios)->BytesPerSector), (Pbios)->BytesPerSector ); \
  28. CopyUchar1(&((Bios)->SectorsPerCluster), (Pbios)->SectorsPerCluster); \
  29. CopyUchar2(&((Bios)->ReservedSectors), (Pbios)->ReservedSectors ); \
  30. CopyUchar1(&((Bios)->Fats), (Pbios)->Fats ); \
  31. CopyUchar2(&((Bios)->RootEntries), (Pbios)->RootEntries ); \
  32. CopyUchar2(&((Bios)->Sectors16), (Pbios)->Sectors16 ); \
  33. CopyUchar1(&((Bios)->Media), (Pbios)->Media ); \
  34. CopyUchar2(&((Bios)->SectorsPerFat), (Pbios)->SectorsPerFat ); \
  35. CopyUchar2(&((Bios)->SectorsPerTrack), (Pbios)->SectorsPerTrack ); \
  36. CopyUchar2(&((Bios)->Heads), (Pbios)->Heads ); \
  37. CopyUchar4(&((Bios)->HiddenSectors), (Pbios)->HiddenSectors ); \
  38. CopyUchar4(&((Bios)->Sectors32), (Pbios)->Sectors32 ); \
  39. }