OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 3:04 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Writing and reading at specifical address of hard disk c++
PostPosted: Sun Mar 05, 2017 11:42 am 
Offline

Joined: Fri Jan 20, 2017 4:35 pm
Posts: 11
Hi,

i hope i will get an answer here after done 4 forums. I am looking for how to write and read at specifical address in a hard disk under Windows 7. I mean by specifical address, in a sole physical sector https://en.wikipedia.org/wiki/Disk_sector and without taking care of any file or file system. I am using c++. So i specify again i am looking for a fonction in c++ who asks a physical sector address and go to search all bit who are in this sole sector, this fonction should not have relation with any file or file system.


Top
 Profile  
 
 Post subject: Re: Writing and reading at specifical address of hard disk c
PostPosted: Sun Mar 05, 2017 12:37 pm 
Offline
Member
Member
User avatar

Joined: Sun Dec 25, 2016 1:54 am
Posts: 204
you open the disk device using a special file name...

https://support.microsoft.com/en-us/hel ... nder-win32

open with CreateFile

https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx


calculate offset into file using sector size and off you go....

cheers

_________________
Plagiarize. Plagiarize. Let not one line escape thine eyes...


Last edited by dchapiesky on Sun Mar 05, 2017 7:09 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Writing and reading at specifical address of hard disk c
PostPosted: Sun Mar 05, 2017 5:55 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
dchapiesky wrote:
https: //msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx

(the above link is broken intentionally - COPY the link and remove space between https: and // cause the forum does not like the address with .aspx ending)


Wouldn't it have been easier just to wrap it in a BBcode 'url' tag instead?

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
 Post subject: Re: Writing and reading at specifical address of hard disk c
PostPosted: Sun Mar 05, 2017 7:09 pm 
Offline
Member
Member
User avatar

Joined: Sun Dec 25, 2016 1:54 am
Posts: 204
well alrighty then.... thanks!

_________________
Plagiarize. Plagiarize. Let not one line escape thine eyes...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 32 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group