[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Detecting actual physical drive size

Posted on 2001-06-29
4
Medium Priority
?
193 Views
Last Modified: 2008-03-10
Is there a routine I can use to detect the actual physical drive size (including Non-formatted space!) of a drive?

I seem to recall the Win API report the formatted space but I need a routine/function that reports the actual physical size the drive was built for.
0
Comment
Question by:rascal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 300 total points
ID: 6239042
You need to use the API function DeviceIoControl and the IOCTL_DISK_GET_DRIVE_GEOMETRY command.
0
 
LVL 1

Author Comment

by:rascal
ID: 6239052
I assume this requires I write a device driver? Is there a non-device driver way to perform the same thing by any chance?
0
 
LVL 1

Author Comment

by:rascal
ID: 6239068
I looked up IOCTL_DISK_GET_DRIVE_GEOMETRY and found an example in the MSDN and it appears I do not need a device driver (phew!).

I neglected to mention I need a solution that works on Win9X platforms as well as NT and Win2K and IOCTL_DISK_GET_DRIVE_GEOMETRY is NT/Win2K specific.

Can you recommend a Win9x solution as well by any chance?
0
 
LVL 86

Expert Comment

by:jkr
ID: 6239087
In addition to what jhance already suggested, 'IOCTL_DISK_GET_DRIVE_LAYOUT' might be an option, too...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question