locked
WMI partition-related stuff RRS feed

  • Question

  • Which forum deals with WMI and partitions? (E.g. given a WIN32_DiskPartition object, how to perform queries on that object)?
    Tuesday, November 3, 2009 6:03 AM

Answers

All replies

  • Hello,

    Thank you for your post.
    You can find those stuff here:
    http://msdn.microsoft.com/en-us/library/aa394582(VS.85).aspx

    For forum kindly provide some more details of the problem you are having the problem with so that we can direct you to teh relevent forum.

    Thanks & regards,
    Ashawani Tier 2 Application Support Server and Tools Online Engineering Live Services Team
    Tuesday, November 3, 2009 9:31 AM
  • What I'm trying to do is to get a list of all the partitions in the system.

    Basically:

    partition_list (WIN32_Disk d) {
    vector q;
    vector ext;
    for (i = 0; i < partitions; i++) {
     WIN32_DiskPartition p = WIN32_DiskPartition(d, i);
     q.append(p);
     if (p.type = PARTITION_EXTENDED)
    ext.add(p);
    }
    for (i = 0; i < ext.length; i++)
    q.append(ExtendedPartition_list(ext.get(i));
    return q;
    }

    Is there a WMI method that works for extended partitions (since this is only necessary for MBR disks, I could just open the partition and read the extended superblock)?
    Also, can WMI handles be used with CreateFile or is there a method in WIN32_DiskPartition named DeviceID or similar?
    Tuesday, November 3, 2009 3:08 PM