WriteFile function is not working in Win 7 64 bit machine

Hi friends

I am facing one problem that, the writefile function is not working on 64 bit machine(win 7).

I have written a code to copy one drive to another drive at sector level. for that I have open handle for the both source and destination. by setting file pointer both on beginning and trying to read source and write on destination.

the writefile function returns an error code access denied.

I am running exe with option "Run as administrator" and still facing this problem.

I am getting handle as below,

hDriveHandle = CreateFile(wstrVolumeName.c_str() ,
GENERIC_WRITE,
FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
Your executable is 64-bit binary also ?
Yes , My executable is 64-bit binary,

I want a function or parameter's to the function like that, it will work for both 32 bit and 64 bit.
Topic archived. No new replies allowed.