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.