i'm writing an app for cloning usb hard disk drives and it does also low level format on usb device (pen drive)
but when i try to open device (hard disk to clone) i obtain as thandle a high value
ADrive := '\\.\' + edit2.text;
//CreateFile(Path, GENERIC_READ, 0, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero);
hVol := CreateFile(pchar(ADrive), GENERIC_READ, FILE_SHARE_READ or FILE_SHARE_WRITE, nil, OPEN_EXISTING, 0,0);
showmessage(inttostr(GetLastError));
what is wrong with this code?
THandle returned = 446744073709551615
exe with admin rights
best regards
andrea verdi