Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3310076
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:42:59+00:00 2026-05-17T21:42:59+00:00

Goal I’m porting a filesystem to Windows, and am writing a more Windows-like interface

  • 0

Goal

I’m porting a filesystem to Windows, and am writing a more Windows-like interface for the mounter executable. Part of this process is letting the user locate a partition and pick a drive letter. Ultimately the choice of partition has to result in something I can open using CreateFile(), open(), fopen() or similar.

Leads

Windows seems to revolve around the concept of volumes, which don’t seem quite analogous to disks, and only occur for already mounted filesystems.

Promising leads I’ve had include:

  • IOCTL_DISK_GET_DRIVE_LAYOUT_EX
  • Physical Disks and Volumes
  • Displaying Volume Paths

However these all end in volumes or offsets thereof, not the /dev/sda1 partition-specific-style handle I’m after.

This question is after a very similar thing, I considered a bounty until I observed the OP is after physical disk names, not partitions. This answer contains a method to brute force partition names, I’d like to avoid that (or see documentation containing bounds for the possible paths).

Question

I’d like:

  • Correct terminology and documentation for unmounted partitions in Windows.
  • An effective and documented method to reliably retrieve all available partitions.
  • The closest fit to the partition file abstraction as available in Linux, wherein all IO is bound to the appropriate area of the disk for the partition opened.

Update0

While the main goal is still opening raw partitions, it appears the solution may involve first acquiring a handle to each disk drive, and then using that in turn to acquire each partition. How to enumerate all the disk drives (even those without mounted volumes on them already) is required.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:42:59+00:00Added an answer on May 17, 2026 at 9:42 pm

    As you noted, you can use IOCTL_DISK_GET_DRIVE_LAYOUT_EX to get a list of partitions.

    There’s a good overview of the related concepts here. I wonder if the missing link for you is

    Detecting the Type of Disk

    There is no specific function to
    programmatically detect the type of
    disk a particular file or directory is
    located on. There is an indirect
    method.

    First, call GetVolumePathName. Then,
    call CreateFile to open the volume
    using the path. Next, use
    IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS
    with the volume handle to obtain the
    disk number and use the disk number to
    construct the disk path, such as
    “\?\PhysicalDriveX”. Finally, use
    IOCTL_DISK_GET_DRIVE_LAYOUT_EX to
    obtain the partition list, and check
    the PartitionType for each entry in
    the partition list.

    The full list of disk management control codes may have more that would be useful. To be honest I’m not sure how the Unix partition name maps onto Windows, maybe it just doesn’t directly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Goal - find out which DateTime is more recent. Can I figure this out
Goal: Create Photomosaics programmatically using .NET and C#. Main reason I'd like to do
My Goal I would like to have a main processing thread (non GUI), and
Goal Let me start with my final vision of what I'd like to be
My goal is to have a CMS that is totally self-contained like a flat-file
My goal is to display the profile of a user. I have this function:
Goal: retrieve an element of data from within a PHP object by number. This
My goal is writing a ContentProvider without an Activity. For testing I wrote a
Goal Java client for Yahoo's HotJobs Resumé Search REST API . Background I'm used
My goal is to maintain a web file server separately from my main ASP.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.