0, // No optional flags.
NULL)); // No template file.
- if (!device_handle) {
+ if (!device_handle.IsValid()) {
PLOG(ERROR) << "Opening device handle failed.";
return false;
}
DISK_GEOMETRY geometry;
DWORD bytes_returned;
status = DeviceIoControl(
- device_handle, // Device handle.
+ device_handle.Get(), // Device handle.
IOCTL_DISK_GET_DRIVE_GEOMETRY, // Flag to request disk size.
NULL, // Optional additional parameters.
0, // Optional parameter size.
scoped_ptr<char[]> output_buf(new char[1024]);
status = DeviceIoControl(
- device_handle, // Device handle.
+ device_handle.Get(), // Device handle.
IOCTL_STORAGE_QUERY_PROPERTY, // Flag to request device properties.
&query, // Query parameters.
sizeof(STORAGE_PROPERTY_QUERY), // query parameters size.
// Create a drive identifier from the drive number.
STORAGE_DEVICE_NUMBER device_number = {0};
status = DeviceIoControl(
- device_handle, // Device handle.
+ device_handle.Get(), // Device handle.
IOCTL_STORAGE_GET_DEVICE_NUMBER,// Flag to request device number.
NULL, // Query parameters, should be NULL.
0, // Query parameters size, should be 0.