CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2006
    Posts
    1

    Parsing an extended partition for logical partitions

    Hi,

    I'm working on an application to print out informations
    for all partitions on a HD.

    I'm using VisualStudio 2003 on Win2000.

    There is one primary partition and one extended partition with
    5 logical partitions.

    The property "Partitions" of the WMI Class "Win32_DiskDrive"
    gives me the right number of partitions -> 6.

    Then I'm using the following query for every HD:
    QueryString = @"ASSOCIATORS OF Win32_DiskDrive.DeviceID="""+strEscapedDeviceID+
    @"""} WHERE AssocClass = Win32_DiskDriveToDiskPartition";

    ManagementObjectCollection wmiDiskPartitions = (
    new ManagementObjectSearcher(Scope, new ObjectQuery(QueryString),
    Options)).Get();
    The Caption property of the result reads:
    Disk #0, Partition #0 -> boot partition
    Disk #0, Partition #1 -> extended partition

    but there are 5 more (logical) partitions (4 with no drive letter assigned
    because they are backup partitions but still valid NTFS partitions)

    Can someone tell me how to get informations on these partitions
    with WMI or P/Invoke

    Thanx

  2. #2
    Join Date
    Jul 2009
    Posts
    1

    Re: Parsing an extended partition for logical partitions

    Hi,

    Have you figured it out? I'm having the same problem.

    Thanks

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