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

    Parsing an extended partition for logical partitions


    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),
    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


  2. #2
    Join Date
    Jul 2009

    Re: Parsing an extended partition for logical partitions


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


Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.