About: 3170 results

How to WriteFile to a PhysicalDrive (Windows 7) without getting ...
https://stackoverflow.com/questions/6608466/how-to ...
\PhysicalDrive2" hDevice = ::CreateFile( "\\.\PhysicalDrive2", GENERIC_READ| GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, ...
How do I use CreateFile to access a physical disk? - Stack Overflow
https://stackoverflow.com/questions/8506767/how-do ...
Your C example has this code: /* LPWSTR wszPath */ hDevice = CreateFileW( wszPath, // drive to open 0, // no access to the drive FILE_SHARE_READ | // share mode FILE_SHARE_WRITE, NULL, // default security attributes ...
Open physical drive. Windows - Stack Overflow
https://stackoverflow.com/questions/33753020/open- ...
You have to run the program with elevated access. Request GENERIC_READ / GENERIC_WRITE hdrive = CreateFile(L"\\\\.\\PhysicalDrive0", GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);. If you just ...
mapping partitions starting from PhysicalDrive - Stack Overflow
https://stackoverflow.com/questions/4672388/mappin ...
... for i := 0 to 99 do begin H := CreateFile(PAnsiChar('\\.\PhysicalDrive' + IntToStr( i)), GENERIC_READ, FILE_SHARE_READ or FILE_SHARE_WRITE, nil, OPEN_ EXISTING, 0, 0); if H = INVALID_HANDLE_VALUE then //no more hdd's Break; ...
How to list physical disks? - Stack Overflow
https://stackoverflow.com/questions/327718/how-to- ...
In the simple case where the volume resides on a single physical drive, the physical drive number is available in ... NULL ), " SetupDiGetDeviceInterfaceDetail - 2" ); disk = CreateFile( deviceInterfaceDetailData->DevicePath, GENERIC_READ, ...
Fastest way to write raw data to hard drive (PhysicalDrive) on ...
https://stackoverflow.com/questions/28375925/faste ...
Feb 6, 2015 ... You should not call CreateFile and CloseHandle for each sector overwritten. CreateFile is a very expensive operation that has to do security checks (evaluate group membership, walk SIDs, etc). Open the handle once, pass it ...
PhysicalDrive to \\.\SCSI - Stack Overflow
https://stackoverflow.com/q/5583553
Apr 7, 2011 ... Look at the code which I posted in my answer to the question. The author of the question had changed the text of the question so many time and the last version of text clear nor really what the original problem was.
INFO: Direct Drive Access Under Win32 - Microsoft Support
https://support.microsoft.com/en-us/help/100027/in ...
Apr 19, 2018 ... You must use both the CreateFile() FILE_SHARE_READ and FILE_SHARE_WRITE flags to gain access to the drive. Once the logical or physical drive has been opened, you can then perform direct I/O to the data on the entire ...
CreateFile - Microsoft Docs
https://docs.microsoft.com/en-us/windows/win32/api ...
Dec 5, 2018 ... If this parameter is zero and CreateFile succeeds, the file or device cannot be shared and cannot be opened ... To obtain the physical drive identifier for a volume, open a handle to the volume and call the DeviceIoControl ...
Calling DeviceIoControl - Win32 apps | Microsoft Docs
https://docs.microsoft.com/en-us/windows/win32/dev ...
May 31, 2018 ... It uses the CreateFile function to retrieve the device handle to the first physical drive, and then uses DeviceIoControl with the IOCTL_DISK_GET_DRIVE_GEOMETRY control code to fill a DISK_GEOMETRY structure with ...