Direct Disk Read/Write

This is a discussion on Direct Disk Read/Write within the Networking/Device Communication forums, part of the General Programming Boards category; Is there a way to direcly read and write the physical data to the drive sectors through windows? I've been ...

  1. #1
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189

    Direct Disk Read/Write

    Is there a way to direcly read and write the physical data to the drive sectors through windows?
    I've been looking at DeviceIOControl(), but msdn doesnt seem to list any control codes for actually reading and writing the data, just for partition info, etc. What I'm looking for is direct RAW access to the volume's sector data. Doing this in DOS was fairly easy using INT 0x13, but I want to update an old project to a windows application.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,649
    http://support.microsoft.com/kb/100027

    Use SetFilePointer() to a particular sector, then ReadFile() or WriteFile(). The memory that you read or write to/from has to be sector aligned. Memory from VirtualAlloc is always at least sector aligned.

    gg

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,649
    Everything from the reading and writing: http://msdn.microsoft.com/en-us/libr...47(VS.85).aspx

    gg

  4. #4
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Thanks
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Disk failure in 3 disk RAID0 & 5?
    By cpjust in forum Tech Board
    Replies: 12
    Last Post: 12-22-2008, 09:09 AM
  2. lost disk
    By Benzakhar in forum Linux Programming
    Replies: 7
    Last Post: 01-11-2004, 05:18 PM
  3. Formatting Output
    By Aakash Datt in forum C++ Programming
    Replies: 2
    Last Post: 05-16-2003, 08:20 PM
  4. Towers of Hanoi, special output.
    By spoon_ in forum C Programming
    Replies: 3
    Last Post: 03-15-2003, 05:08 PM
  5. Direct disk access in DOS
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 02-26-2002, 01:52 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21