Direct Disk IO - few questions

Does C# provide any API to do direct disk IO?

I am using CreateFile to do sector-level IO on a compact flash card. The code to open the drive is as follows:

HANDLE hDevice;

hDevice = CeateFile(TEXT(“\\.\H:”),
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING,
0, NULL);

Does C# provide any API to do direct disk IO?

I am using CreateFile to do sector-level IO on a compact flash card. The code to open the drive is as follows:

HANDLE hDevice;

hDevice = CeateFile(TEXT(“\\.\H:”),
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, NULL);

Here I have hard-coded the drive letter ‘H:’. What if I have some different drive letter for the removable media on some different computer. The drive letter will change e.g. may be G, I, K etc. How can I automatically detect the drive in which the compact flash is inserted. Can anybody help?