CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Windows SDK File System: How to get information about a partition?

    Q: How to get information about a partition?

    A:

    Code:
    #include <iostream>
    #include <iomanip>
    
    TCHAR szVolumeName[100]    = "";
    TCHAR szFileSystemName[10] = "";
    DWORD dwSerialNumber       = 0;
    DWORD dwMaxFileNameLength  = 0;
    DWORD dwFileSystemFlags    = 0;
    
    if(::GetVolumeInformation("c:\\",
                              szVolumeName,
                              sizeof(szVolumeName),
                              &dwSerialNumber,
                              &dwMaxFileNameLength,
                              &dwFileSystemFlags,
                              szFileSystemName,
                              sizeof(szFileSystemName)) == TRUE)
    {
      std::cout << "Volume name = " << szVolumeName << std::endl
                << "Serial number = " << dwSerialNumber << std::endl
                << "Max. filename length = " << dwMaxFileNameLength << std::endl
                << "File system flags = $" << std::hex << dwFileSystemFlags << std::endl
                << "File system name = " << szFileSystemName << std::endl;
    }
    Last edited by Andreas Masur; July 24th, 2005 at 05:21 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured