Solved

Low level disk i/o in C++ for editing the metafiles

Posted on 2004-08-22
6
162 Views
Last Modified: 2010-04-01
I currently own two Maxtor hard drives--both of which I've experienced at one time or another a failure or corruption of the master file table (\$MFT).  As a result of this I frequently have backed up the drives metafiles using R-Studio NTFS, but have no way to restore the backed up files without typing in each byte from the backed up file.  Frustrated by this, I decided to design a C++ program that would both read and write these metafiles, however I do not know how to do low-level disk I/O in C++ under Windows 2000.  Can anyone point me in the right direction to how I might do low-level disk reads and writes in a Windows 2000 C++ environment so that I can save and restore my drives metafiles?

Thanks,

Chris
0
Comment
Question by:crward
  • 4
6 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
I guess Windows2000 won't allow you to write directly to any sector of your disk. So the unique solution I know is to build a driver to access IDE I/O port, just like in DOS.
Look at this question related to writting directly to system I/O ports.
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VisualC_PLUS_PLUS_DOT_NET/Q_21045309.html
0
 
LVL 30

Expert Comment

by:Axter
Comment Utility
Look at DeviceIoControl API function
0
 
LVL 30

Expert Comment

by:Axter
Comment Utility
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 30

Expert Comment

by:Axter
Comment Utility
0
 
LVL 30

Accepted Solution

by:
Axter earned 500 total points
Comment Utility
Verry strange.  For some reason the links are not working right.

Lets try this one more time:
http:Q_20666119.html
http:Q_20009071.html
http:Q_10081599.html
http:Q_20389244.html
0
 
LVL 22

Expert Comment

by:grg99
Comment Utility
You can open up any disk device with some funny drive name incantation, see the drive paths that scroll up your screen when you do a "safe mode" boot.   Put those in a call to CreateFile() and you shoul dbe good to go.

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now