Click to See Complete Forum and Search --> : Compactflash custom filesystem


chacham15
October 9th, 2009, 09:31 AM
Problem: I have a compactflash card with a custom filesystem (implemented in a hardware device). I want to take the compactflash card and insert it into a compactflashcard reader. Then I want a program to modify some data on the card. Therefore, the problem is that windows does not know anything about how the data is laid out on the drive.

What I would like is an interface which I call some function which retuns a handle to the device. Then I would be able to read and write to it like any normal file. Therefore, I can create an interface to the filesystem myself. Is there something like this? Is there any solution to my problem?

Thanks,
Chacham15

hoxsiew
October 9th, 2009, 09:44 AM
You can probably open the device directly with something like:


HANDLE hDrive=CreateFile(
L"\\\\.\\PhysicalDrive2",
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
0
);


Substitute the proper drive for PhysicalDrive2.