Needful Software

Raw Disk Access

Introduction

This tutorial explains how to access the data on a drive directly without going through the file system. Typically a program doesn't need to access the data on a drive directly but uses the file system to read and write to files organized in directories. But if for some reason you need to access the data on the drive directly this tutorial will show you how to do it.

In this tutorial we will explain:

  • how to use CreateFile to open a drive rather than a file,
  • how to use ReadFile to read data from an opened drive, and
  • how to use GetDiskFreeSpace to get the size of the sectors.

About the examples

All the examples for this tutorial can de downloaded from the Downloads page. The examples contain build files for Microsoft Visual Studio 2003 only but they don't contain many source files so they should be easily built with other compilers.

Bibliography

blog comments powered by Disqus