summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/file/winfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/file/winfile.cpp')
-rw-r--r--src/osd/modules/file/winfile.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/osd/modules/file/winfile.cpp b/src/osd/modules/file/winfile.cpp
index e62382a92ab..66281d08b4a 100644
--- a/src/osd/modules/file/winfile.cpp
+++ b/src/osd/modules/file/winfile.cpp
@@ -231,21 +231,23 @@ osd_file::error osd_file::open(std::string const &orig_path, uint32_t openflags,
// get the file size
DWORD upper, lower;
- if (is_path_to_physical_drive(path.c_str())) {
-
+ if (is_path_to_physical_drive(path.c_str()))
+ {
GET_LENGTH_INFORMATION gli;
DWORD ret;
- int getsize = DeviceIoControl(h, IOCTL_DISK_GET_LENGTH_INFO, 0, 0, &gli, sizeof(gli), &ret, 0);
- if (getsize==0) {
+ if (!DeviceIoControl(h, IOCTL_DISK_GET_LENGTH_INFO, nullptr, 0, &gli, sizeof(gli), &ret, nullptr))
+ {
upper = 0;
lower = INVALID_FILE_SIZE;
}
- else {
+ else
+ {
lower = gli.Length.LowPart;
upper = gli.Length.HighPart;
}
}
- else {
+ else
+ {
lower = GetFileSize(h, &upper);
}
if (INVALID_FILE_SIZE == lower)