Sector reading and writing

Posted: 02-02-2006, 01:48 PM
Hi All,

We have problem in reading and writing to the sector
beyond 6GB of data.

The direct function Calls are used to deal with sector
reading and writing.

// First a handle is created using the following code.
CreateFile(_devicename, GENERIC_READ, FILE_SHARE_READ |
FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);

// Then it is made to point to sector using the following.
SetFilePointerEx (hDevice, L,&L1, FILE_BEGIN)

//Reading of the sector is done using the following
ReadFile (hDevice, buffer, 512*numberofsectors,
&bytesread, NULL);

//Writing to the sector is done as follows.
WriteFile (hDevice, buffer,
512*numberofsectors,&byteswrite, NULL);

We got the program in MSDN to know the hard disk details, so
sure with size of sector.

Reading and writing is done on block of the sectors, i.e,
100 * 1024.
We are creating a image file of the read sector, and using
this image file we are restoring back the contents of the disk or drive.

There is no problem in reading and writing of data till
6GB it is working fine with no loss of data.

Beyong 6Gb, We are able to create the image, but after
writing the data we are unable see the contents.
We tested with the image created by blocking the write
operation,
which showed the few contents. With which we were sure that
image created after reading the sector has got no problem.
So there was some problem in writing to the sectors.

No files can be seen, but the size is reflected. But after
that whats actually happening, not able to track it.

Program is written in VC++.Net on Windows XP. Is there any
limit or restriction of the harddisk or OS(whatever dont know exactly)
after certain amount of data.

Kindly suggest if any idea regarding this.

Regards,
sumana.











Reply With Quote

Responses to "Sector reading and writing"

 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Large Unspecified Backup sector KueyBozis Windows Vista Performance & Maintenance 2 04-28-2007 10:44 AM
Bad Sector on HDD? Matt Coy Windows XP Basics 0 08-18-2003 11:52 PM
Error reading drive 80 I/O Timeout Sector=112227723, result=4 Eldon Windows XP Hardware 0 07-04-2003 10:05 PM