diff options
author | 2017-11-29 02:40:42 +1100 | |
---|---|---|
committer | 2017-11-29 02:40:42 +1100 | |
commit | af3cd2dd4d436cf7d3c439645c21097838fa3dcc (patch) | |
tree | 0adfa007359cd0e5561db1d9e7a14daa0fb6a9c8 | |
parent | 8fe2198a265a863601e6dd8f21457043886089c2 (diff) |
this file is Allman style, use nullptr for NULL pointers, DeviceIoControl returns BOOL so treat it like a boolean (nw)
-rw-r--r-- | src/osd/modules/file/winfile.cpp | 14 |
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) |