Hello there,
i posted a question earlier , and iam requesting another time
with my question modified to some extent
iam changing the id of a particular sector to some number x.
In 9X, iam able to recognise whether that sector x is existing or not by
reading from that particular sector through the issue of 13h interrupt
with the help of DeviceIocontrol function.
But under NT, when iam using createfile, readfile etc. iam unable to do
so.
is it possible to know that a particular sector on a particular
track (i have altered the id of that sector to some id x) is existing or
not. is there any way to achieve that in NT, whether through a device
driver or kernel mode driver etc.
if the question is still not clear then pls let me know.
any help in this regard is mostly appreciated.
bye
ramana
> But under NT, when iam using createfile, readfile etc. iam unable to do
so.
is it possible to know that a particular sector on a particular
track (i have altered the id of that sector to some id x) is existing or
not. is there any way to achieve that in NT, whether through a device
driver or kernel mode driver etc.
What exactly u are facing problem ? are u able to read sector ?
Regards,
int3
hello there,
thank u for showing interest in my problem.
iam formatting a track, and iam changin one sector id on that track from
10 to 23.
iam able to read from that 23 sector on 10th track in in 9X, using
deviceiocontrol by issuing int13h interrupt.
but when iam reading that sector on NT by using readfile method ,i.e iam
reading by setting the file pointer to the logical sector which will be
computed as
LogicalSector = (sector-1) + (head*SECTORSPERTRACK) +
(track*SECTORSPERTRACK*NUMOFHEADS)
here track 10 sector id 23 on head 0 will be
logicalsector=(23-1)+10*18*2
iam getting error no 27, which is sector not found.
but actually that sector exists on the floppy which i have created and iam
also able to read on 9X machine.
i want to know ,how can i detect that sector on NT/2000.
waiting for the reply.
bye
ramana
Try this,
int LogicalSector = (sector-1) + (head*SECTORSPERTRACK) +
(track*SECTORSPERTRACK*NUMOFHEADS) ;
hDeviceHandle = CreateFile ( “\.\PHYSICALDRIVE0”, … ); // for harddisk 0
SetFilePointer (hDeviceHandle, (LogicalSector*512), NULL, FILE_BEGIN);
ReadFile ( hDeviceHandle, buffer, 512*numsec, &bytesread, NULL) ;
This should work.
Regards,
int3
----- Original Message -----
From: “ramana cheekoti”
To: “NT Developers Interest List”
Sent: Friday, August 09, 2002 10:13 AM
Subject: [ntdev] reading the sector id on NT/2000
> hello there,
> thank u for showing interest in my problem.
> iam formatting a track, and iam changin one sector id on that track from
> 10 to 23.
> iam able to read from that 23 sector on 10th track in in 9X, using
> deviceiocontrol by issuing int13h interrupt.
>
> but when iam reading that sector on NT by using readfile method ,i.e iam
> reading by setting the file pointer to the logical sector which will be
> computed as
>
> LogicalSector = (sector-1) + (headSECTORSPERTRACK) +
> (trackSECTORSPERTRACKNUMOFHEADS)
>
> here track 10 sector id 23 on head 0 will be
>
> logicalsector=(23-1)+1018*2
>
> iam getting error no 27, which is sector not found.
> but actually that sector exists on the floppy which i have created and iam
> also able to read on 9X machine.
> i want to know ,how can i detect that sector on NT/2000.
> waiting for the reply.
> bye
> ramana
>
> —
> You are currently subscribed to ntdev as: xxxxx@aalayance.net
> To unsubscribe send a blank email to %%email.unsub%%
hi there,
thanks once again.
the method u showed is what iam implementing in my program.
but on NT iam getting the return value as the sector not found.
i dont think through readfile we can detect the presence of sectors with
abnormal sector ids. if u know anyother method to achieve this ,pls let me
know.
bye
ramana
Hi,
As for as i know, there is no other way to read/write the Sector from the
user mode applicatiion. Only precondition is you need to have Admin
privilage to do these operations. I suspect problem is somewhere else in ur
programm.
Regards,
Satish K.S
----- Original Message -----
From: “ramana cheekoti”
To: “NT Developers Interest List”
Sent: Friday, August 09, 2002 11:27 AM
Subject: [ntdev] Re: reading the sector id on NT/2000
> hi there,
> thanks once again.
> the method u showed is what iam implementing in my program.
> but on NT iam getting the return value as the sector not found.
> i dont think through readfile we can detect the presence of sectors with
> abnormal sector ids. if u know anyother method to achieve this ,pls let me
> know.
> bye
> ramana
>
> —
> You are currently subscribed to ntdev as: xxxxx@aalayance.net
> To unsubscribe send a blank email to %%email.unsub%%