Leaked source code of windows server 2003
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.

110 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. vststvolinfo.hxx
  5. Abstract:
  6. Declaration of volume information class
  7. Brian Berkowitz [brianb] 06/06/2000
  8. TBD:
  9. Revision History:
  10. Name Date Comments
  11. brianb 06/06/2000 Created
  12. --*/
  13. #ifndef _VSTSTVOLINFO_HXX_
  14. #define _VSTSTVOLINFO_HXX_
  15. class CVsTstVolumeInfo
  16. {
  17. public:
  18. friend class CVsTstVolumeList;
  19. CVsTstVolumeInfo();
  20. ~CVsTstVolumeInfo();
  21. LPCWSTR GetVolumeName() const { return m_wszVolumeName; }
  22. LPCWSTR GetFileSystemName() const { return m_wszFileSystemName; }
  23. bool IsNtfs() const { return wcscmp(m_wszFileSystemName, L"NTFS") == 0; }
  24. bool IsFat() const { return wcscmp(m_wszFileSystemName, L"FAT") == 0; }
  25. bool IsFat32() const { return wcscmp(m_wszFileSystemName, L"FAT32") == 0; }
  26. bool IsRaw() const { return wcscmp(m_wszFileSystemName, L"RAW") == 0; }
  27. UINT GetDriveType() const { return m_driveType; }
  28. bool IsReadOnly() const { return (m_flags & FILE_READ_ONLY_VOLUME) != 0; }
  29. ULONGLONG GetTotalSize() const { return m_llTotalSize; }
  30. ULONGLONG GetFreeSize() const { return m_llTotalFreeSpace; }
  31. bool IsCompressed() const { return (m_flags & FS_VOL_IS_COMPRESSED) != 0; }
  32. DWORD GetFileSystemFlags() const { return m_flags; }
  33. private:
  34. LPWSTR m_wszVolumeName;
  35. LPWSTR m_wszFileSystemName;
  36. ULONGLONG m_llTotalSize;
  37. ULONGLONG m_llUserFreeSpace;
  38. ULONGLONG m_llTotalFreeSpace;
  39. DWORD m_flags;
  40. DWORD m_serialNumber;
  41. DWORD m_maxFileNameLength;
  42. UINT m_driveType;
  43. CVsTstVolumeInfo *m_pVolumeNext;
  44. };
  45. class CVsTstVolumeList
  46. {
  47. public:
  48. CVsTstVolumeList() :
  49. m_pVolumeFirst(NULL)
  50. {
  51. }
  52. ~CVsTstVolumeList()
  53. {
  54. FreeVolumeList();
  55. }
  56. HRESULT RefreshVolumeList();
  57. UINT GetVolumeCount();
  58. const CVsTstVolumeInfo *GetVolumeInfo(UINT iVolume);
  59. private:
  60. void FreeVolumeList();
  61. CVsTstVolumeInfo *m_pVolumeFirst;
  62. };
  63. #endif // !defined(_VSTSTVOLINFO_HXX_)