Filter:Pascal C++ (DLL/Lib) C++ (VCL) C++ (.NET) C# VB.NET
Opens raw access to the volume and returns the volume handle
- DeviceName - Required device name to open (with full path in the windows object namespace). Eg: "\??\C:" or "\??\PhysicalDrive0".
- DesiredAccess - Desired access, eg. GENERIC_READ | GENERIC_WRITE. The constants are defined in Windows API
- LicenseKey - The license key. RawDisk doesn't work without the license key (either production or evaluation). You can request the evaluation license key via request form.
The handle of the device.
Use this method to open the device and obtain it's handle. The obtained handle must be used with ReadFile(), WriteFile() and DeviceIoControl() functions of Windows API.
Once you finished using the direct access to the device, call CloseHandle() Windows API function to release the resources.
The name of the device can be obtained using an utility, offered by Microsoft.
The constants for DesiredAccess parameter can be found in the description of CreateFile() function of Windows API in MSDN Library.
This method doesn't unmount the volume and if you plan to make modifications to raw disk structure, you can corrupt the data (or your changes can be overwritten). Use OpenEx method to unmount the volume before accessing it.
This method can return "Access Denied" error if you try to access logical disk (eg. "\??\C:") without unmounting it. Use OpenEx method to open the partition and unmount it before opening.
If the method fails for whatever reason, an exception with Windows-defined error code is thrown.