Hi,
I am wondering if anyone knows how the program 'partcopy' accesses the disk directly in windows. I have a couple of methods that work, but they only seem to work about 25% of the time, but when I use partcopy it works 100% of the time. I have tried putting Sleep() statements between my code to allow the floppy to catch up but it doesn't work.
I was simply going to use partcopy from within my program but I need more detailed information about errors and stuff, simply redirecting console output does not give me what I need.
Cheers.
Direct Disk Access In Windows
- paulqddinh
- Posts: 9
- Joined: Thu Jan 14, 2010 9:12 am
- Location: Hanoi, VN
Re: Direct Disk Access In Windows
gud day,
let me push up this topic again pls
i can access sectors of logical drive (indicated in Mbr) by visual c++
using CreateFile, ReadFile, WriteFile
but i still dont know how to access physical drive through visual c++
on windows
help... me......
let me push up this topic again pls
i can access sectors of logical drive (indicated in Mbr) by visual c++
using CreateFile, ReadFile, WriteFile
but i still dont know how to access physical drive through visual c++
on windows
help... me......
Asus EeePC 1000H/XP Pro
x86 Intel Atom N270 1.6GHz -- 1GB RAM
x86 Intel Atom N270 1.6GHz -- 1GB RAM
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Direct Disk Access In Windows
You may want to use dd for any images anywhere. It works and saves you from writing your own stuff.
Visual c++ is a compiler, not an image writer. Also, CreateFile is the correct system call. MSDN has the necessary information about all this. Please don't be stupid enough to overwrite your harddisk's MBR.
Visual c++ is a compiler, not an image writer. Also, CreateFile is the correct system call. MSDN has the necessary information about all this. Please don't be stupid enough to overwrite your harddisk's MBR.
- paulqddinh
- Posts: 9
- Joined: Thu Jan 14, 2010 9:12 am
- Location: Hanoi, VN
Re: Direct Disk Access In Windows
tkx, i've found it how,
just use \\.\PhysicalDriveN in CreateFile function
you know how to differentiate between HDD & USB?
coz my USB is also listed as physical drive
just use \\.\PhysicalDriveN in CreateFile function
you know how to differentiate between HDD & USB?
coz my USB is also listed as physical drive
Asus EeePC 1000H/XP Pro
x86 Intel Atom N270 1.6GHz -- 1GB RAM
x86 Intel Atom N270 1.6GHz -- 1GB RAM