Solved

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

Posted on 2004-08-22
6
166 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
ID: 11867043
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
ID: 11867171
Look at DeviceIoControl API function
0
 
LVL 30

Expert Comment

by:Axter
ID: 11867197
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 30

Expert Comment

by:Axter
ID: 11867200
0
 
LVL 30

Accepted Solution

by:
Axter earned 500 total points
ID: 11867215
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
ID: 11869013
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

831 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